Insert random intervals between mouse responses and sounds
Hi,
I'm totally noob in coding, so, i'm trying to do a simple action-effect task by using only the OS graphic interface.
I need to generate fixed random intervals (200, 500 and 800 ms) between mouse clicks (actions) and respective sounds (effects), and i'm currently using mouse_response + advance_delay + sampler items to do this.
I try to structure the experiment by ordering the items in one of the two different variations of sequences below, in both, i can't do the randomization work through the random function in the loop item. There are:
1) Block_loop
Trial_seq
mouse_resp
adv_delay_ (200 ms)
sampler
mouse_resp
adv_delay_1 (500 ms)
sampler
mouse_resp
adv_delay_2 (800 ms)
sampler
2) Block_loop
Trial_seq
mouse_resp
adv_delay_ (200 ms)
adv_delay_1 (500 ms)
adv_delay_2 (800 ms)
sampler
[in the case above, there is a sum of the three intervals, i.e: mouse click -> 1500ms (200+500+800 ms) -> sound]
As i say, i try the random in the block_loop, etc,etc, but nothing. When i run the experiment, the trial_sequence run without a random in the intervals, like in "sequential order" mode.
The independent variables in my loop are:
Mouse (level: left_button)/Random_delay (3 levels: 200/500/800 ms)/Sound (level: beep_1)
I really need help!
Thanks in advance,
Hugo.
Comments
Hi Hugo,
I think you want to use the loop like:
1) Block_loop
Trial_seq
mouse_resp
adv_delay_ ([var.delay])
sampler
Run that 3 times (or more) in random order and use values 200, 500 and 800 for var.delay.
Like 'left' and 'right' are used for gaze_cue in http://osdoc.cogsci.nl/3.1/tutorials/beginner/
Best,
Jarik
PS if I'm misunderstanding your question, could you upload your experiment?
Hi Jarik,
Thank you very much for the help.
I try to plot the values (200, 500 and 800) in adv_delay_ ([var.delay]), but it don't run as it might be.
The loop look like this:
adv_delay (in the first row, as the variable name. Open sesame don't accept ( ) and [ ] in the first row.
adv_delay_ ([200])
adv_delay_ ([500])
adv_delay_ ([800])
Am i right about the way to plot? Of course i could upload the experiment, but i don't know how, do you can say to me how can i do this?
Thanks again!
Hugo.
Hi Hugo,
You can upload using the right-most item of the toolbar above the comment field. Possibly you can even drag and drop your experiment file on the comment field (where you type your posts).
Best,
Jarik
Hi Jarik,
Thanks again for your attention!
The experiment is the following.
Hugo.
Hi Hugo,
You will have to remove 2 of the 3 advanced_delays as you will vary the duration via the
advanced_delay
variable from the loop item. Now the difficult part is the Duration field of the advanced_delay item does not expect anything else then numbers. So you can just type your variable in there like: "[advanced_delay]". There is a workaround for this:set duration 200
toset duration [advanced_delay]
Another option might be to just use a sketchpad item instead of an advanced_delay item. This will enable you to just type "[advanced_delay]" in the Duration field. It will also enable you to clear the screen which keeps showing new_form_text_display until you draw something new. You could add a text like "please click mouse" for example.
Best,
Jarik
PS it might be more clear to choose a variable name like
advanced_delay_duration
instead ofadvanced_delay
to be able to tell things apart.Hi Jarik,
I try the way you indicated, but it doesn't work. Both, advanced_delay and the sketchpad items don't accepted the [advanced_delay] in something like a random form.
Do you think about some code that could help to randomize the intervals? I'm completely noob about coding. Anyway, i'm trying the clock.sleep function, and it work like the advanced_delay item. Again, the problem is related with the randomization...
I'm trying some random. codes, but it doesn't work.
Thanks for your help,
Hugo.
Hi Hugo,
Please find your slightly modified experiment attached. I used a sketchpad item that also displays the delay on screen. If you run the experiment you will see the loop loop_1_active_1 gives random delays (200, 500 or 800) between the mouse click and the beep.
Best,
Jarik
Hi Jarik,
The randomization occurs normally! I better understand the link between the variables in the loop and in the other items now.
I'm just doing the trick using advanced_delay item, instead of sketchpad.
Thank you very much again!
Hugo.