[solved] Adding random events throughout a block
Hi all,
This is more out of curiosity than anything else :-)
I am working on an attention experiment in which there are two types of blocks: a safe and a threat block. During the safe block nothing really happens, the participants goes on completing several trials of the attentional task without anything especial going on. In contrast, during the threat block, they are told that they may receive an aversive stimuli (a burst of white noise or a mild electric shock, for instance) at any moment during the block. These aversive stimuli just happen, they are not linked to their performance or to any other task condition whatsoever (except the block type, of course, they only happen during threat blocks).
Within these threat blocks, they may receive a variable (randomly defined) number of aversive stimuli (min 2 max 6 per block, for example). Crucially, these stimuli must be delivered at completely random points during the block, so that they are not at all predictable. The point is to make the aversive stimuli as unpredictable as possible, in order to keep the sense of threat stable (and high) throughout the block.
Now, I have managed to program it with all these conditions, except that the aversive stimuli are always delivered in-between trials. I think this should work out just fine for my purposes, but I was wondering: Is there any way to program these aversive stimuli so that they pop-up at completely random moments, regardless of what the participant is doing or the stage of the trial?
I would really appreciate your thoughts about how to make it work like that. I thought it might work with a parallel element which runs along the block sequence, and just pops the aversive stimuli without interfering with the block flow, but I'm not sure how to make it work out.
Like I said, any ideas would be great. It would be interesting for me to know if such a set-up can be arranged in OpenSesame.
Thanks, and looking forward to any comments!
Daniel
Comments
Hi Daniel,
I would advise against using the parallel plug-in, unless it is absolutely necessary. Assuming you are using an inline_script to present the aversive stimulus, your trial sequence will look something like this:
Alternatively, you could make it look like this:
Where the first inline_script determines whether there will be a shock this trial. I will assume you have already implemented this, using some probability of a shock occurring, like below (although the 0.2 is probably a variable in your case).
Each further inline_script starts with the following snippet:
Of course, this is a bit of a crude way to do it. However, it's quick-and-dirty, and nicely random and thus very unpredictable (even for the experimenter!).
Hope this gives you some inspiration!
Hey Edwin,
That will do nicely, good idea! I'II will have to break down my trial inlines to make it work (I usually have the entire trial sequence scripted in a single inline), but I agree, by implementing it like you recommended definitely makes it quite unpredictable.
Thanks a lot for your input,
Daniel
No worries! Hope you can make it work!
BTW: If you're already scripting all the way, I've implemented something similar in the past in Python (using PyGaze, but using PyGame or PsychoPy directly would also do the trick). The idea there was simple: the main Thread was used to display pictures, while one sub-Thread was used to play sounds and another to log keypresses (the onsets of which were compared afterwards). The point is that, if you are already going through the effort of coding everything in OpenSesame, you might try to code an experiment from scratch in Python with only a bit more effort.
Of course, using OpenSesame is still quicker for more straightforward designs. But if you want to do things in parallel, Python provides excellent tools for multithreading (and even proper parallel processing, although the differences between multithreading and parallel processing usually don't matter a lot for experiments).
Either way: good luck!
Edwin
PS: Marking this one as solved, but please don't hesitate to post here again (and mark the thread open) if further questions arise!