Cues bind stimuli and a marker for synchronous presentation

class Cue(canvas=None, audiostim=None, visualstim=None, markerstr=None)[source]

bind stimuli and a marker for synchronous presentation

This class binds auditory and visual stimuli together with a canvas for presentation and sends markers.

  • canvas (reiz.Canvas) – a canvas for presentation of the visual stimuli. Create with

  • audiostim (reiz._audio.primitives.Sound) – a single auditory stimulus to be presented once at the start of show().

  • visualstim (reiz._visual.complex.Visual) – a list or a single visual stimulus. Will be presented on the canvas during the whole duration when show(). was called. If you use more than one visual stimulus, they will be overlayed and are plotted from left to right. That means the first is at the bottom layer, the last at the top.

  • markerstr (str) – a string encapsulating the meaning of the cue. This string will be forwarded to the marker-server, and published with LSL. By default, strings are sanitized for easier parsing, so do not use case-sensitive information, and try to limit yourself to ascii.

show(duration=0, canvas=None, safetime=0.2)[source]

present all stimuli stored in the cue

  • duration (float) – how many seconds you want to present the visual stimuli on the canvas. Defaults to zero. Using zero will result in the function returning immediatly, while keeping the visual stimulus maintained on the canvas. In that regard, it resembles presentation forever, (or until another cue is presented). This can confuse Windows 10 if the canvas is moved or resized, as the OS thinks the canvas is unresponsive. Any other positive values cause the function to not return and block for the whole duration.

  • canvas (reiz.Canvas) – In case you decide to present the Cue on a different canvas instead to the one assigned during instantiation. Will be ignored otherwise.

  • safetime (float) – continuous presentation causes the canvas to be updated at the flip rate of your screen and grapics cards (usually aroung 60Hz). This hardware limitation means that the duration of presentation will be quantizised, i.e. the duration of presentation will be a multiple of 16.6ms for a 60Hz screen. To achieve more accurate duration, the safetime parameters sets how long to the end of the duration we will no longer flip the screen. By default, we won’t flip the screen during the last 200ms. This can cause the OS to consider the screen unresponsive (see duration above). Please note that this does not improve the timing of the actual drawing on the screen, it just allows the show() to return at a more accurate time.

Return type