Question about Implementation of an auditory task

Hi All,

I would like to ask for advice and suggestions on an auditory task—ideally I would like to code this using PsychoPy, but I also want to get some input if it’s possible to achieve.

The task will be something like:
I have a set of pre-generated wav files, each of them is under 1 minute. I would like to choose the file randomly, play the melody to participants. While the melody is playing, I would like PsychoPy to send a trigger so that I can know when exactly the melody started playing, and throughout the listening process, participants make key presses when they hear certain modulations in the melody. Reaction time should be measured for each key press, so that we can measure the latency from the onset of each modulation to each key press of participant make. Each melody is played from beginning to end while participants make key presses.

I’m thinking about coding this in PsychoPy, and this won’t be an online study—is it possible to code something like this and have the measures that I mentioned above?

Thank you so much for your input, suggestions and critiques in advance!


Absolutely, yes! This seems like a very typical PsychoPy experiment. The main things you’d use for this in Builder are the Keyboard component and Sound component :slight_smile:

Thank you so much for the response!

I did manage to record all the key presses during one trial (i.e., one melody per trial), but I still have something that I am unable to solve yet—

Because all the melodies (called “sound1” below) have different lengths, I set their start time to be some buffer time for reaction, and then the stop time to be $length, which is start time plus the length of the melody. However, even though I put a loop around “trials”, I still had trouble moving on to the next iteration of the loop, aka the next melody. In trying to solve this, I added the keyboard component “key_resp_endtrials” so that participants can press a key and move on to the next iteration. However, the problem is, sometimes I have to press the key two times in order to move on (for no obvious reason to me yet), and sometimes the key press simply fails to move on to the next iteration. Any idea of why this is happening? I really appreciate your help!


Sorry, the reply button did not carry my message through…see above :sweat_smile:

This was a bug a few releases ago, I think it’s been fixed now so if you update to the latest version (2020.2.10 now I think, they’re coming thick and fast as we get quicker at fixing bugs!) it should work

Thank you for this information! I will check it out.