Welcome!

Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

[solved] Flashing stimuli & overlayed sketchpads?

jpgjpg Posts: 7
edited February 2012 in OpenSesame

Hi Sebastian,

I've been enjoying OpensSesame so far, it's great to work with!

I was wondering if it is possible to have visual stimuli (something simple, a fixation dot will do) flash on and off a number of times (the number of times it flashes will be determined by a loop variable)

To complicate things, I need it to be flashing while other sketchpad items remain constant on the screen... I was thinking it might involve multiple canvases overlayed on each other?

Any advice?

Jamie

Comments

  • sebastiaansebastiaan Posts: 2,812
    edited February 2012

    Hi Jamie,

    Yes, sure. There are many ways to do this, but the easiest way (which will require minimal inline coding) is probably as follows:

    • Create a "template" sketchpad that contains the constant image and add it somewhere to the start of the experiment. You can give it a 0ms duration to make sure you don't notice it—it's only there to serve as a template.

    • Add a variable to the block_loop that contains the number of repetitions. Let's call it "repetitions".

    • Add the following to the run phase of an inline_script in the trial sequence. This will show a flashing display:

    my_canvas1 = self.copy_sketchpad("template")
    my_canvas2 = self.copy_sketchpad("template")
    my_canvas2.fixdot()
    for i in range(self.get("repetitions")):
        my_canvas1.show()
        self.sleep(100)
        my_canvas2.show()
        self.sleep(100)

    I guess the code is fairly self explanatory. For more canvas functions, please refer to the documentation:

    Hope this gets you started!

    Regards,
    Sebastiaan

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • jpgjpg Posts: 7
    edited 10:01AM

    Thanks Sebastian, that worked! :)

Sign In or Register to comment.