Synthlet
Sequencers
npm package

Euclid

An euclidean rhythm generator

Generates an euclidean rhythm when connected to a clock:

import {
  registerAllWorklets,
  ClockNode,
  EuclidNode,
  ClaveDrumNode,
} from "synthlet";
 
const ac = new AudioContext();
await registerAllWorklets(ac);
 
const clock = ClockNode(ac, { bpm: 60 });
const euclid = EuclidNode(ac, { steps: 16, beats: 4, clock });
const clave = ClaveDrumNode(ac, { trigger: euclid });
clave.connect(ac.destination);
clock.bpm.value = 150;

Parameters

Pattern

  • steps: the number of steps in the sequence
  • beats: the number of beats in the sequence
  • rotation: the rotation of the sequence

Clock

  • clock: a clock the drives the rhythm
  • subdivision: the subdivision of the clock

On this page