[open] Ending 2 loops simultaneously
Hello, I must say I love OpenSesame, it's the most intuitive software I've ever used for designing a study.
I'm having a little trouble with a parallel study. What I need is to have an image on screen that changes when a participant presses a certain key (in this case, LEFT CTRL). Simultaneously, an audio RT task, with a tone being played at semi-random intervals, with SPACE as the response key. This needs to be completely independent of the images.
What I have is a parallel with 2 loops, one with my image trial, the other with my RT. They both work and they play simultaneously, but what keeps happening is the RT task goes on longer than the image trial. The duration of the image trial will vary from participant to participant, as they control when one image ends and next begins. It could be as little as 60 seconds up to 7 or 8 minutes. So what's happening now is either I run out of images, and the final image displays until the audio RT (currently set at 10 repeats for brevity) finishes, or the audio RT finishes in the middle of the image trial.
What I want is to have the audio RT task last as long as the image trial. As soon as the participant presses CTRL on the final image, it will end both loops simultaneously. Is there a way to do this?
Comments
Flattery will get you everywhere.
I cannot give a very specific answer, because I'm not sure I full understand what your experiment looks like, but in general it sounds like you could make use of the
loop
s break-if statement.For example, you could put the sound-playing part of your experiment inside a
loop
and set the repeat value very high. Then you can add a break-if statement (under 'Show advanced options') that says something like['stop_playing] = 1
. Next, you insert a simpleinline_script
after the response-collection part of the experiment the sound loop (or at least prevent it from starting another cycle):Also, make sure to reset the
stop_playing
variable at the beginning of the trial, also using aninline_script
:Is than any help at all?
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Here's a screen cap of my overview. So I have a parallel with 2 loops, one presenting the images, the other presenting the audio beeps. Right now, I've got 6 images in the image loop, and I want to have the audio beep loop end when the 6th image is finished. I understand the concept of the "break-if" but I don't know how to use it. I added an inline_script like you said and put in the code you provided, but I'm very ignorant of python and don't know how to have it correspond to the image loop.