[open] Stop Signal Task
Hi, everyone.
I'm trying to use Open Sesame to make a Stop Signal Task, but I'm very new to this. I want a picture to be shown and then after a certain time, a sound to be played randomly in some trials, while the picture is still visible. My problem is that the sound plays in all the trials instead of playing randomly. Also, I have no idea how to define the sound variable so that it only plays in 25% trials.
Please help. ![]()
Thank you.
Comments
Hey Maryam,
In general, I can only recommend you to check out some of the tutorials. They are a great way to get familiar with OpenSesame.
There are different solutions for the issue you have. The most straightforward one (in my opinion) is almost entirely based on python scripting within an
inline_script, but it's also feasible with some OpenSesame items. So, what you need is aloopwith asequencecontaining (at least) aninline_script, asketchpadand asampleritem. For logging and such, you will need more of course.In the
loop tableyou should have a variablesound_presence, which isTruein one case, andFalsein three cases, that is, there won't be a sound on 75% of all trials. Next, you go to theinline_scriptand here you have to do two things. First, sample a random number that represents the time point, at which the sound is played, in case it is asound - presenttrial. Second, you'll have to retrieve the name of your sound file from somewhere (there are various options, if you browse through the documentation and the forum, you should be able to find descriptions of how this works). Lastly, you have to store these variables, so that OpenSesame can use them in its items. You can do it, by saving them asvar.sound_name = 'filename'. But again, checkout the documentation for details. Importantly, what you need to do to have a sound only on those 25% of all trials, is to set the duration of the sound to the random value you computed before, only if the current trial is asound - presenttrial. If it is not, you'll set the duration to 0, e.g.var.sound_duration = 0.Finally, you have to add the image_name to the
sketchpaditem, so that it knows which image to present, and the sound duration to thesampleritem, so that it knows for how long the sound should be played.That's the general idea. Like I said, you can do it in different ways, but with this description, you should be able to think of some tweaks that will make it work even better. So, check out the tutorials to see how to implement this idea. It really isn't too complicated, just give it a try.
If you run into more issues, don't hesitate to ask here, though.
Good luck,
Eduard