| Reference | Downloads | Github

Adding a sound file nested loop

If this template helps then use it. If not then just delete and start from scratch.


OS (e.g. Win10): Mac 10.15.7 (19H2)
PsychoPy version (e.g. 1.84.x): 2020.2.6
Standard Standalone? (y/n) If not then what?:
**What are you trying to achieve?:**I am trying to conduct an experiment to assess the difference between the effects of instrumental and lyrical music short term memory. To do this, I want to present several sets of two images of a similar nature for participants to distinguish between.

What did you try to make it work?: I have created 3 excel files with the image stimuli, correct answers, keys to press and music(for the control condition, this column is blank). In the builder window, I have created a nested loop for the trials which contains a routine to present both images, a keyboard component and a sound component. I have linked the music columns from the excel files to the sound component. However, I’m not sure how to get the instrumental music to play for one loop of all the sets and the lyrical music file to play for one loop of all the sets.

What specifically went wrong when you tried that?: the music file kept running and after the first set of 2 images, there was a blank screen.

Any help at all would be really appreciated.

Thank you in advance.

Kind Regards,

Dear Khushika

could you please show how you tried get the instrumental music playing for one loop and the lyrical music for the other loop?

One way could be to specify the sound that should be played in an excel column, e.g.:


You could specify that only specific rows are read from the excel-file in one case and the remaining rows are read in the other case.

Best wishes Jens