Synthlet
Sequencers
npm package

Clock

A clock generator

@synthlet/clock

Generates a clock signal at a given tempo.

import { registerClockWorklet, Clock } from "synthlet";
 
const audioContext = new AudioContext();
await registerClockWorklet(audioContext);
const clock = Clock(audioContext, { bpm: 10 });

Example

Trigger a kick with a clock:

import { registerAllWorklets, KickDrum } from "synthlet";
 
const audioContext = new AudioContext();
await registerAllWorklets(audioContext);
const clock = Clock(audioContext, { bpm: 120 });
const kick = createKickDrum(audioContext, { trigger: clock });
kick.connect(audioContext.destination);

Parameters

  • bpm: beats per minute

On this page