cardioception.devices.beat_source.VirtualBeatSource#

class cardioception.devices.beat_source.VirtualBeatSource(period='simulated', seed=None, clock=None, lead_in=1.0)[source]#

Beats known in advance, for the exteroceptive task.

poll() returns each beat one period before it happens (as soon as the previous virtual beat is due), so the engine can schedule the vibration at the beat itself and the tone after it. A beat’s period is the interval to the next virtual beat, which is known exactly.

Parameters
period

"simulated" for the firmware’s simulated heart (see simulated_periods()), a number for a fixed period in seconds, or a sequence of periods in seconds to replay (repeated when it runs out), e.g. the participant’s own RR intervals.

seed

Seed of the simulated heart.

clock

The clock beats are timed on; pylsl.local_clock by default.

lead_in

Seconds from start() to the first beat.

__init__(period='simulated', seed=None, clock=None, lead_in=1.0)[source]#

Methods

__init__([period, seed, clock, lead_in])

poll()

The beats due within one period from now.

start()

Start the heart: the first beat comes lead_in seconds from now.

stop()

Stop the heart; the next start() begins a new series.

wait_next_beat(after[, timeout])

The first beat after after; virtual beats are known, so no wait.

Attributes

period

virtual

The engine schedules a vibration on each beat of this source.