[solved] ending a synth event during another event?
Hi,
I'm having a blast creating an experiment in OpenSesame, it's a very intuitive and powerful framework. In one part, I'm trying to add some noise to video stimuli, so I created a "synth" white-noise event and made the duration longer than the longest movie. The noise starts, the movie starts immediately after and so they overlap nicely, but I'd like the noise to stop as soon as the movie does (and the movies are variable in length). Is there any command I can put in at the end of the movie event (or at the start of a following sketch event) that would terminate a currently running synth event?
Thanks! OpenSesame Rocks!
Mark
I'm having a blast creating an experiment in OpenSesame, it's a very intuitive and powerful framework. In one part, I'm trying to add some noise to video stimuli, so I created a "synth" white-noise event and made the duration longer than the longest movie. The noise starts, the movie starts immediately after and so they overlap nicely, but I'd like the noise to stop as soon as the movie does (and the movies are variable in length). Is there any command I can put in at the end of the movie event (or at the start of a following sketch event) that would terminate a currently running synth event?
Thanks! OpenSesame Rocks!
Mark
Comments
Hi Mark,
Glad you like it!
Yes, that's possible, but it will take a little Python code. Very little, actually. Let's assume that your synth item is simply called "synth". You then insert an inline_script (at some point in the experiment where you want playback to stop) with the following code in the run phase:
self.experiment.items["synth"].sampler.stop()
There's a lot of references here, so let's go through them one by one:
You can find a list of all synth functions here: http://osdoc.cogsci.nl/python-inline-code/synth-functions
Hope this helps!
Kindest regards,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
[solved] Thanks! Works like a charm!
Mark