Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brianhouse/bjorklund
Euclidean rhythms: Björklund's algorithm in Python
https://github.com/brianhouse/bjorklund
Last synced: 18 days ago
JSON representation
Euclidean rhythms: Björklund's algorithm in Python
- Host: GitHub
- URL: https://github.com/brianhouse/bjorklund
- Owner: brianhouse
- License: mit
- Created: 2013-01-18T23:39:23.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2018-02-21T21:45:15.000Z (over 6 years ago)
- Last Synced: 2024-07-31T22:49:37.050Z (3 months ago)
- Language: Python
- Size: 4.88 KB
- Stars: 80
- Watchers: 7
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Euclidean Rhythms: Björklund's Algorithm in Python
==================================================After encountering some [buzz](http://ruinwesen.com/blog?id=216) about it online, I read and was inspired by Godfried Toussaint’s paper, [“The Euclidean Algorithm Generates Traditional Musical Rhythms”](http://cgm.cs.mcgill.ca/~godfried/publications/banff.pdf). In short, he demonstrates how many classic rhythms, particularly of African origin, can be described by a ubiquitous mathematical principle first documented by Euclid and even used for timing patterns in neutron accelerators.
However, while I found many implementations of the algorithm in various languages, all of the ones I tried (in Ruby, Python, Java, and Javascript) return inaccurate results! Trying 13 steps with 5 pulses was an easy way to break most of them. Luckily, Toussaint’s source, Björklund, provides C code in his paper [The Theory of Rep-Rate Pattern Generation in the SNS Timing System](https://ics-web.sns.ornl.gov/timing/Rep-Rate%20Tech%20Note.pdf). I translated this into Python 3, and found the result to be elegant, efficient, and accurate.
### Copyright/License
Copyright (c) 2011 Brian House
This code is released under the MIT License and is completely free to use for any purpose. See the LICENSE file for details.