skip to content

Sequencer

Schedules future beats in a sequence and alerts subscribing elements.

class
Sequencer
extends
Base
tag
<sequencer-blam>
see

Props

name type default description
bpm number null

The tempo in beats-per-minute. Overrules the ancestor Audio element’s bpm if set.

scale number 1

The size of the interval in quarter-beats. 2 would mean each interval is, in effect, a half-beat.

swing boolean|number null

Applied as a Boolean attribute, it applies a swing of 0.333, making adjacent beats the first and last beats of a triplet. Supply a number to adjust this value.

Events

type description
blam

Critically contains the time for the scheduled beat (relative to currentTime), but also supplies Sequencer and Track information.

Methods

name args description
play

Starts the sequencer, which begins emitting blam events at intervals according to the current scale.

stop

Ceases emitting blam events and resets all descendant Track elements, essentially rewinding each to the beginning of their first Bar’s s pattern.

pause

Ceases emitting blam events. Does not reset any constituent Tracks.

playStop

Toggles between play and stop.

playPause

Toggles between play and pause.

Examples

Examples that use the Sequencer element: