Sending Multiple EEG triggers for 1 sampler item
Hello Open Sesame Community,
For my latest experiment, I've recently switched to using Open Sesame.
I'm planning to conduct an ERP experiment, in which the participants will be presented with spoken sentences through a sampler item.
I would like to send multiple triggers for each sentence, for example at the start of the sentence, the start of the target word and the end of the sentence. My question is how to arrange this. On the Forum I could only find examples of scripts sending out 1 trigger per stimulus.
Would it be possible to write one single in line script that sends out three triggers, or would I need to create three different inline scripts, each for the trigger in question?
I've been trying to write the code needed for this, but I'm unsure if it would work. This is what I wrote so far (the Trigger and Delay variables would be in my loop item):
global io
trigger = var.Trigger #Is it possible to define multiple triggers here? E.g. Trigger1, Trigger2, Trigger3?
port = 0x378
try:
io.DlPortWritePortUchar(port, trigger)
except:
print 'Failed to send trigger!'
var.Trigger1 = clock.time() #trigger start soundfile
var.Trigger2 = clock.time()+ var.Delay1 #second trigger onset target
var.Trigger3 = clock.time()+ var.Delay2 #third trigger offset target
I hope someone could share some insights on how to send multiple triggers.
Thanks in advance!
Comments
Hi,
I would like to send multiple triggers for each sentence, for example at the start of the sentence, the start of the target word and the end of the sentence. My question is how to arrange this. On the Forum I could only find examples of scripts sending out 1 trigger per stimulus.
That is only possible if you have a different sampler file per stimulus (first word, target word, last word), or if you exactly know how long each word of the sentence last. If your entire sentence is one audio file, Opensesame doesn't how that file is structured (how many words, how long the word, etc.). In either case the temporal precision is not ideal. There is usually some jitter with presenting audio files, so that an EEG trigger might be accordingly a little imprecise. With that in mind it probably is better to have a different audio file for each word.
Would it be possible to write one single in line script that sends out three triggers, or would I need to create three different inline scripts, each for the trigger in question?
In theory, there is nothing wrong about that. The important is that you send the triggers as close in time as possible to the event you want to code. If you present all the sounds in a single inline_script you can send all the triggers in that script. If you use different scripts (or sampler items) to present the stimuli, you would probably also need different inline_scripts to send your triggers.
Hope this helps,
Eduard
Hi Eduard,
Thanks for your swift reply!
At this point we have one audio file per sentence. We do know when the separate words (e.g. the target) starts. When you write that the temporal precision is not ideal, what is the error/imprecision you are thinking about? I guess if it is a matter of up to 10 ms we could live with it, but if it is more like several 100ms it will become really problematic.
Thanks!
Hi,
I don't know exactly how much delay to expect, but this paper here: https://peerj.com/articles/9414/
might be a good starting point to find out. Potentially, also this website (if you use the psychopy backend): https://www.psychopy.org/general/timing/timing.html
Hope this helps.
Eduard
Thanks this helps :)