euclidean-rhythm icon indicating copy to clipboard operation
euclidean-rhythm copied to clipboard

Euclidean rhythms in JS

euclidean-rhythm

The Euclidean rhythm in music was discovered by Godfried Toussaint in 2004 and is described in a 2005 paper "The Euclidean Algorithm Generates Traditional Musical Rhythms".[1] The greatest common divisor of two numbers is used rhythmically giving the number of beats and silences, generating almost all of the most important World Music rhythms,[2] (except Indian).[3] The beats in the resulting rhythms are as equidistant as possible; the same results can be obtained from the Bresenham algorithm.

Wikipedia, Euclidean rhythm

Usage

> var euclideanRhythm = require('euclidean-rhythm');
undefined
> euclideanRhythm(3, 8);
[ 1, 0, 0, 1, 0, 0, 1, 0 ]