[solved] record keyboard response time while audio file is running
Hi -
I'm running an experiment in which a subject is presented with an image (two items side by side) and at the same time they hear an audio file "Now press the button for the please" . The subject is then supposed to press either "1" if is the left image or "0" if it's the right image. I have the experiment up and running and all seems well except for logging the response_time_left_right_response. What I'm interested in logging is the time from the onset of the target word to the listener's keyboard response (0 or 1). I want the image to stay on screen and the audio to finish playing, so keyboard_response shouldn't affect that.
Below I've given the scripts for the main part of my experiment as well as some lines of the logger output.
As far as I can tell the logger is logging the response_left_right_response correctly, but the response_time (column 7, see below) is almost always 0, which is definitely incorrect. It's unclear to me what it is logging, documentation suggests: "interval in ms between start of response interval and the last response".
Basically what I need to know is how to get opensesame to log the keyboard_response_time in relation to the audio file start time. Any advise how best to do this? I'm running opensesame on a Mac.
correct_left_right_response count_experiment count_trialsequence cr picture response_left_right_response response_time_left_right_response sound time_left_right_response
1 0 0 1 2broom-sun.bmp 1 10 carr_broom_3.wav 1785607
1 0 1 1 2peach-bed.bmp 1 0 carr_peach_2.wav 1789694
1 0 2 0 2pear-sun.bmp 0 0 carr_sun_2_um_chef_3.wav 1793874
1 0 3 1 2pear-church.bmp 1 0 carr_pear_2_um_chef_3.wav 1798029
1 0 4 0 2tree-swan.bmp 0 0 carr_swan_3.wav 1802035
1 0 5 0 2rake-foot.bmp 0 0 carr_foot_3_um_chef_3.wav 1805913
1 0 6 1 2fish-broom.bmp 1 0 carr_fish_3.wav 1809791
The order of the sequence (within a loop):
run fixation_dot "always"
run picture_pair "always"
run audio_files "always"
run left_right_response "always"
run logger "always"
script for picture_pair:
set duration "0"
set description "Displays stimuli"
draw image 0 0 "[picture]" scale=1 center=1 show_if="always"
script for audio_files
set volume "1"
set description "Plays a sound file in .wav or .ogg format"
set sample "[sound]"
set pitch "1"
set duration "sound"
set stop_after "0"
set pan "0"
set fade_in "0"
script for left_right_response:
set correct_response "[cr]"
set allowed_responses "1;0"
set description "Collects keyboard responses"
set timeout "infinite"
set flush "yes"
Thank you for your help! Mirjam
Comments
After further searching the answer was here:
http://forum.cogsci.nl/index.php?p=/discussion/161/open-word-sampler-and-keyboard-response-timing/p1
"The duration of the sampler/ synth is perhaps a bit counter-intuitive.
There is also 'duration = 0' which means that the sampler/ synth will not block at all, and simply have the sound playing in the background. This means that the experiment advances right to the keyboard_response, and your problem should be solved."
And this did solve it for me. Maybe this could be added to the documentation? It would have saved me quite some time.
Thanks,
Mirjam
Love the problems that sort themselves out. Thanks for letting us know!