Audio · class
TapTempo
Tempo and phase, from somebody tapping along.
Explained in Your first game.
class TapTempoimport { TapTempo } from '@driftengine/audio';In depth
Phase is the part that matters. A player could type a BPM; what they cannot type is where the downbeat falls in the sound they are about to add, and a grid at the right tempo with the wrong phase is off by up to half a beat everywhere — worse than not syncing at all.
Accessors
| Name | Type | Description |
|---|---|---|
bpmget | number | null | Null until there is enough to be sure, and for anything implausible. |
offsetSecget | number | Seconds, from the same clock the taps were given in. |
Methods
tap
tap(nowMs: number): void| Parameter | Type | Description |
|---|---|---|
nowMs | number |
reset
reset(): void