Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dbkaplun/euclidean-rhythm

Euclidean rhythms in JS
https://github.com/dbkaplun/euclidean-rhythm

Last synced: 14 days ago
JSON representation

Euclidean rhythms in JS

Awesome Lists containing this project

README

        

# [euclidean-rhythm](https://dbkaplun.github.io/euclidean-rhythm)

> The **Euclidean rhythm** in music was discovered by [Godfried Toussaint](https://en.wikipedia.org/wiki/Godfried_Toussaint)
> in 2004 and is described in a 2005 paper
> "The [Euclidean Algorithm](https://en.wikipedia.org/wiki/Euclidean_algorithm) Generates Traditional Musical Rhythms".[[1]](http://cgm.cs.mcgill.ca/~godfried/publications/banff.pdf)
> The [greatest common divisor](https://en.wikipedia.org/wiki/Greatest_common_divisor)
> of two numbers is used [rhythmically](https://en.wikipedia.org/wiki/Rhythm)
> giving the number of [beats](https://en.wikipedia.org/wiki/Beat_(music)) and
> silences, generating almost all of the most important
> [World Music](https://en.wikipedia.org/wiki/World_Music) rhythms,[[2]](http://cgm.cs.mcgill.ca/~godfried/rhythm-and-mathematics.html)
> (except [Indian](https://en.wikipedia.org/wiki/India#Performing_arts)).[[3]](http://cgm.cs.mcgill.ca/~godfried/publications/banff-extended.pdf)
> The beats in the resulting rhythms are as equidistant as possible; the same
> results can be obtained from the [Bresenham](https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm) algorithm.

—[Wikipedia, *Euclidean rhythm*](https://en.wikipedia.org/wiki/Euclidean_rhythm)

## Usage

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