match duration sketchpad to duration variable sound
in OpenSesame
Hello!
In an experiment in which I want to play a sound simultaneously to the presentation of a picture (in a sketchpad), I would like for the duration of the sketchpad to be the same as the sound. The problem here seems to be that I am using a variable for my sound (e.g. "intro{nr}.wav"). When I enter "intro{nr}.wav" into the duration of the sketchpad (which shows, for example, the image "intro{nr}.jpg"), it returns the error "Error: InvalidValue; Invalid duration: intro2.wav". I am a bit lost on how to solve this, so any help would be greatly appreciated!
Thanks in advance!
Amber
Comments
Hi Amber,
if the two items are presented right after one another, you can start with the sketchpad and set its duration to
0, and then the sampler with the duration set to the variable length of that sound bit, by setting it tosound.Hope this helps,
Eduard
I can't believe I didn't think of that, I had them the other way around the entire time. Works like a charm! Many thanks, Eduard.
Hi @amlema,
You get an error because, as the error message indicates, the information you provide as a duratrion is invalid. A file name is not a duration.
The solution depends on whether or not you just want to present a sketchpad and sound simultaneously without registering any response (i.e., presentation only), or if you want to register a keyboard response (and if you do, whether you want to register it once the sketchpad's full duration or if the response should interrupt the presentation of the sketchpad.
If you merely want to control the presentation of stimuli, and register a response only after the full duration of the sound/sketchpad has elapsed, the solution is simple:
You first present the sketchpad for 0ms, then present the sound, then the keyboard response.
Best,
Fabrice.
Hi @Fab
Such an easy solution, but it helps so much, thank you! Also, the information on the response registration is really useful - thanks.
Amber