Skip to content

zya/bjorklund

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bjorklund.js

Generates binary sequence patterns based on Bjorklund algorithm.

The algorithm solves the general problem of distributing npulses over m “timing slots” in the most even way possible, even though n may not necessarily be an even divisor of m.

These patterns can be used to achieve complex musical rhythms known as Euclidean Rhythms.

Example Usage

npm install bjorklund
var bjork = require('bjorklund');

bjork(2,5); // returns '10100'
bjork(3,7); // returns '1010100'
bjork(5,16); // returns '1001001001001000'
bjork(4,16); // returns '1000100010001000'

The method outputs the pattern as a string where 1s represent pulses and 0s represent empty slots.

Dependencies

  • Lodash

About

generates binary sequences based on Bjorklund algorithm

Resources

License

Stars

Watchers

Forks

Packages

No packages published