[open] Recording keyboard responses during and after an audio stimulus
Hello all,
I apologize in advance if this has been brought up before, but would really appreciate if anyone could help with this!
I am running 2 perception tasks on my subjects: A) a forced-choice task, and an AXB discrimination task. The subjects are asked to make keyboard responses to indicate their judgement of the sound file played.
So for every trial in task A, an audio file will be played for approximately 1000ms, and 5000ms will be allowed for them to make any response (the keyboard response has a timeout of 5000ms). However, both the keyboard response and the response time will not be recorded if the subject hit the keyboard before the whole sound file is played (meaning that those are recorded only after the 1000ms audio file is done). This is not what I want. I want the onset of the stimulus to be the same as the onset of the keyboard response, so that responses will be collected even if the subject press the button before the sound file is done.
And for each and every trial in task B, I am having the subjects make keypress responses to say whether the second (X) is more similar to the first (A) or to the third (B), and they have a timeout of 5000ms. 3 stimuli with a duration of 1000ms each (A, X, & will be played in sequence with a 1000ms inter-stimulus interval, so the sum of the 3 stimuli plus the inter-stimulus intervals is 5000ms. Same as what happens in task A, the keyboard response and the response time will be recorded only after all the 3 sound files are played (after 5000ms from the onset of the trial). However, I want to collect both the keyboard response and the response time from the start of the trial.
I was wondering if there is any way to have the keyboard responses recorded even before the sound files are done (for example, like in the middle of the soundfile). Thanks in advance, any help will be appreciated!
Thank you,
Rachel
Comments
Hi Rachel,
If you set the duration of the
sampler
item to 0, the sound will play in the background, and the experiment will advance right away to the next item. See also:Does that solve the issue?
Cheers,
Sebastian
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastian,
Thank you so much for the prompt response!
It worked perfectly for my task A, but couldn't fix the problem I have in task B.
So here is what my sequence looks like in task B:
I guess those Advanced_Delay items I have there blocked the 0-duration trick, so that didn't work quite well within this sequence. Is there any other way to fix this?
Once again, thank you so much!
Rachel
Hi Rachel,
Your
sequence
looks fine to me, although theadvanced_delay
could be replaced by a duration in thesampler
items. But that doesn't really matter.Is the problem that you want participants to be able to respond as soon as A starts playing? That is possible, although it would be slightly more tricky. But wouldn't it be better to have participants withhold their response until they have heard all sounds, given that they have to do similarity judgment?
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Because I am worried that responses could not be registered if the subjects accidentally hit the keyboard without waiting for all the 3 sounds being played. It happens to me that sometimes subjects forget about what they were told to do when they are too concentrated on listening to the stimuli, and I want to avoid this unexpected events from happening.
I am also hypothesizing that subjects could make a judgement as soon as the 2nd item is done if it is the 1st sound that is more similar to the 2nd sound, or they could identify the 3rd sound to be more similar to the 2nd one before the end of the 3rd sound.
Because of the two reasons mentioned, I want the keyboard response function to run as soon as the onset of the 1st sound. I hope this makes sense!
Thank you once again for the response!
Best,
Rachel
Hi Rachel,
There are a few ways to do this. One way would be to create an
inline_script
that alternately plays sounds and polls for responses. There a few examples of how to do this here on the forum, although they generally concern visual stimuli (but the idea is the same). For example:A similar problem is also tackled in a workshop tutorial:
However, this is quite a script-heavy approach. Perhaps you could first try whether you cannot simply use the
parallel
plug-in. Basically, you would split sequence1 into two differentsequence
s, one of which does the sound playback, and the other one does the rest. Then you use aparallel
item to run these twosequence
s in parallel. That would look something like this:A word of caution: The parallel plug-in is known to crash or freeze on certain systems. If this happens for you then we need to find another solution, probably using an
inline_script
. But if it works smoothly then using theparallel
plug-in is by far the easiest solution.Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!