Flashing stimuli

Hi Chris,

I’d like to create a drifting grating that can repeatedly change contrast for variable durations. The ultimate goal is to create a task with a flashing stimulus that changes properties (orientation, contrast, etc), on a random cycle.

Is there a stimulus type or property of the drifting grating stimulus that we could use to do this? Or would we be better off setting timers to queue and dequeue the stimulus at regular intervals?

Thanks,
Lindsey.

Hi Lindsey,

Here’s how you can make this work:

  1. When defining your drifting grating, set each of the parameters you want to change dynamically to the name of a variable (rather than a literal value).
  2. To put the grating on screen, live queue it (with the live_queue_stimulus action).
  3. When you want to change a grating parameter, simply assign a new value to the corresponding variable. The change will be reflected on screen immediately, with no need for dequeue/queue or display update actions.

To vary the contrast, you’ll need to change the “alpha_multiplier” parameter. For this to work correctly, be sure that the grating is drawn on a 50% gray background.

I’ve attached an example experiment that sets up and displays a grating as I’ve described. Once it’s running, you can alter the grating’s appearance by changing parameters in the variables window. (In a real experiment, the changes would be made programmatically in the XML, but the variables window is nice for testing things out interactively.)

If you need more assistance, please let me know.

Cheers,
Chris

Attachment: dynamic_grating.xml (3.52 KB)

Chris- Perhaps this would be easier to discuss on the phone- is there a
phone number where I can reach you? Thanks, Lindsey.