Skip to content

@liminal-hq/undertone / LoopOptions

Interface: LoopOptions ​

Defined in: scheduler.ts:46

Where a voice's output lands, and options shared by every way of playing voices.

Extends ​

Properties ​

bpm? ​

optional bpm?: number

Defined in: scheduler.ts:50

Tempo in beats per minute, four beats to a cycle. Default 120 (2-second cycles).


cps? ​

optional cps?: number

Defined in: scheduler.ts:52

Tempo in cycles per second — an alternative to bpm for scores that know their loop length in seconds. Passing both throws.


ctx? ​

optional ctx?: AudioContextLike

Defined in: scheduler.ts:48

Audio context to schedule against; a lazily-created shared AudioContext when omitted.


output? ​

optional output?: AudioNodeLike

Defined in: engine.ts:115

Node the voices (and their effects buses) connect to instead of ctx.destination, e.g. a game's own mix bus.

Inherited from ​

OutputOptions.output


timer? ​

optional timer?: TimerLike

Defined in: scheduler.ts:54

Injectable timer (tests tick it by hand); defaults to global setInterval/clearInterval.