[solved] Random interval repetition task
I would like to use a random interval repetition task with two intervals: 900 msec for the short intervals and 1500 msec for the long intervals. These lengths should be sampled randomly each with a probability of 0.50. So the average pace is 1200 msec. I would like to set a restriction of no more than four of the same intervals in a row. Each bleep is a 200-Hz tone presented for 50 msec, and the intervals will be measured from the onset of the bleep to the onset of the next bleep. So in fact the advanced delay time should be 850 of 1500ms. Dependent variables are RT and error rate (failure to respond in time to the stimulus).
So for example: 850 - 850 - 1450 - 850 -1450 - 1450 etc.
Can someone advise me how to program this?
Thanks! Suzanne
s.c.vanveen@uu.nl
Comments
Hi Suzanne,
The most effective way to do this, is by using a bit of inline scripting (and since you want to do things pseudo-randomly, there is no alternative). The following script can be used to create a delay, to which you can refer to in other items using
[interval]. Add the following to aninline_scriptat the start of your trial, preferably in the Prepare phase.By the way: as the interval is determined in the
inline_script, you could get rid of theadvanced_delayaltogether, and simply use the interval as the duration of the sketchpad preceding youradvanced_delay.Good luck!
Hi Edwin,
Thanks for your quick reply on my question! I added the inline script at the beginnen of my experiment/trial, in the prepare phase.
I only don't understand what you mean with your last comment: "simply use the interval as the duration of the sketchpad preceding your advanced_delay."
I used to have a loop with a sequence with:
In the sampler I added my sound: hoog200Hz.wav
In the synt controlor, again the Hz: 200
In the keyboard respons: cr = b, timeout = 2000
This is the editing script for my loop:
Where to specify the term [interval] as you mentioned?
Cheers,
Suzanne
I assumed you were using a visual stimulus. Two options:
1) Replace the advanced_delay with a sketchpad. Set the sketchpad's duration to
[interval]. Just leave the sketchpad blank, so it won't change the way the display looks.2) Adjust the advanced_delay's script a bit (click on the black button in the top right, it's labelled '>_'). Normally, there would be a line like this:
Replace with:
Either way, make sure to paste the code from my previous post into the prepare phase of an inline_script at the start of your sequence.
Good luck!
Hi edwin,
Again, thank you for your quick reply! I understand the sketchpad adjustments. I've tried to run the experiment, but 1 line in your inline script produces an error. It's about:
if not hasattr(exp, 'histlist'):
exp.histlist = []
The error is:
Error while executing inline script
phase: prepare
item: inline_script
line: 29
exception message: name 'histlist' is not defined
exception type: NameError
I've tried to fix it myself but it isn't working. Do you know how I could define histlist, so this error doesn't pop up?
Many thanks for all your help!!
Suzanne
Hi Suzanne,
Apologies, my mistake. The error was in line 29 actually, where I wrote
hitlistrather thanexp.hitlist. I've edited my previous post, which should now work (just tested it: it does on my system).Good luck!