[solved] Two independent sequences in parallel
Hello board!
To begin with, OpenSesame's obviously a great piece of software. I find it easy to create basic experiments, and the best thing about it might be that it teaches me some Python. Sebastiaan, I told you I'd use OpenSesame for the next thing I'm going to pre-register (This is intended for Cortex.)
Still, I'm stuck with my current experiment. I'm trying to program an RSVP sentence presentation experiment that allows the participant to immediately respond to individual words, and get immediate auditory feedback while the sentence keeps being presented.
So I've programmed two sequences. One presents a sentence word by word, with individual words on sketchpads with fixed timing (around 500 ms per word). The other sequence contains 1. a delay (depending on which word is the critical word, set by the loop), 2. a keyboard response, 3. two samplers with "yay!" and "boooh!" sounds, depending on the value of [correct]. And then I've simply put both sequences into a "parallel" item.
The idea is that the two sequences should work completely independently, with the sentence being presented in full, with strict timing, unperturbed by participant behaviour, and a keyboard response (when the participant detects a certain word in the stream) that is immediately followed by auditory feedback, without waiting for the sentence presentation sequence to finish..
Note that the average sentence is around 5 seconds, the average reaction time around 1 second, and the critical word appears halfway through the sentence.
It doesn't work, so far. Keyboard response (I'm on a Mac btw., so it's probably not the Windows/multithread bug I've seen mentioned here) are not recognized, 'correct' is stuck on "0" and the timing of the sentence sketchpads seems to be influenced by the events in the other sequence.
Is the basic approach sound? If so, I would put up my script on pastebin and kindly ask for more specific feedback. Or is it simply not possible the way I'm trying to do it right now?
I appreciate any feedback! Thanks,
Jona
Comments
Thank you, and good luck with the new format!
The basic approach should be sound, if the parallel plug-in would function as you would hope. Unfortunately, on many systems it doesn't. I don't use a Mac myself, but it sounds like a threading problem again.
My recommendation would be to implement the RSVP task through an inline_script. It's not that difficult, and it will save you considerable headaches. The basic idea is demonstrated in this script:
Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Thanks Sebastiaan! I think I mostly understand what's going on in that script. It will take me some time to implement it though. Alas, at least I'm learning Python.
However, one thing I'm worrying about is that the feedback sound cannot be time-locked to the text presentation, but must be time-locked to the button press (after some delay), while the canvas presentation should go on unperturbed (the sentence must be fully presented, and at the same speed). If I understand correctly the "if key != None:" line, whatever happens afterwards would start at the next iteration of the loop (when a new canvas would have been presented), and anything with a real duration here will delay the next canvas.
I think I have a vague idea of how to manage that - delay the sound file by a value dependent on RT (t2), as in the mock code here:
However, this would also delay the presentation of the next phrase. And as far as I understand it, updating SOA to a new value wouldn't change anything in the loop? Seems like I need a real parallel process again.
Best,
Jona
Okay, I've had a co-worker explain things to me a bit and I see where I understood your script, Sebastiaan. I will fiddle around with myself some more for now, please don't concern yourself with fixing what I should be able to do myself I'll post again when I run into actual problems.
Thanks for the help.
I've adapted Sebastiaan's proposed solution and it works up to this point. The main problem was getting the next canvas to be delayed after a button press, and only allowing key presses once the critical event of the sequence had been presented, which I solved using something not especially elegant, but functional.
Here is a link to what I did: http://pastebin.com/sP8J9Z0B
I've changed the thread tag to [solved] accordingly.
Great, and good luck with the experiment!
Check out SigmundAI.eu for our OpenSesame AI assistant!