Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[open] adding a delay to a trial and a repeat cycle

edited March 2015 in OpenSesame

hi everyone,

i have quite a simple experiment where participants are shown a colour and a sound simultaneously, they then press the space bar and answer a question, this then loops for 24 different variables.

i want to know how to delay just the sound variable from the sampler but still run the colour variable from the sketchpad, and then also have an option to repeat the sound variable for each trial ( from a keyboard press) then once the participant is happy they can still press the space bar to continue,

thanks

image

image

Comments

  • edited 9:39AM

    Hi,

    i want to know how to delay just the sound variable from the sampler but still run the colour variable from the sketchpad,

    The easiest way to do this is simply to set a duration in the sketchpad, for example 1000 ms. This will pause the experiment for 1000 ms before moving on to the sampler.

    and then also have an option to repeat the sound variable for each trial ( from a keyboard press) then once the participant is happy they can still press the space bar to continue,

    That's a bit trickier, but what you could do is the following:

    • Add your sampler (or synth in my example) and the keyboard_response to their own sequence, which is in its own loop.
    • Set the repeat value for the loop very high, so that it's practically infinite.
    • Set the break-if statement for the loop to [response] = space. This way the loop will end once the spacebar has been pressed.
    • Reset the response variable to None with a short inline_script before doing all this. Otherwise the variable may not exist or already have the value space when you enter the loop.

    Does this make sense? You'll have to tweak it a bit, but it shows the general idea.

    image

    You can see a working example here:

    Cheers,
    Sebastiaan

Sign In or Register to comment.