mkontogiannis / euclidean-rhythms Goto Github PK
View Code? Open in Web Editor NEWCalculates the rhythmical patterns based on the euclidean/bjorklund's algorithm
Calculates the rhythmical patterns based on the euclidean/bjorklund's algorithm
Hey, man.
Great tool and really nicely documented code. The way I'm using it is with layered patterns using pulses and steps from the Fibonacci sequence, which is creating some wonderful generative patterns.
However, they are all starting, initially, on the 1 (so to speak), and I'd love to be able to have a third parameter defining which where in the sequence the first pulse occurs.
I had read (here) that, "A Euclidean rhythm is... controlled by three parameters: steps, pulses and offset".
Is that something you'd be interested in supporting?
er.getPattern(3,4); is not working in the browser bundle, er.default.getPattern(3,4); should be typed instead - how to test this?
master
branch failed. π¨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iβm sure you can resolve this πͺ.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those donβt help, or if this issue is reporting something you think isnβt right, you can always ask the humans behind semantic-release.
The npm token configured in the NPM_TOKEN
environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/
.
If you are using Two-Factor Authentication, make configure the auth-only
level is supported. semantic-release cannot publish with the default auth-and-writes
level.
Please make sure to set the NPM_TOKEN
environment variable in your CI with the exact value of the npm token.
Good luck with your project β¨
Your semantic-release bot π¦π
I've produced a test suite of all the patterns from Toussaint's paper, which I'll include here.
let test_suite = [
[[3,2], [1, 1, 0]],
[[4,3], [1, 1, 1, 0]],
[[5,2], [1, 0, 1, 0, 0]],
[[5,3], [1, 0, 1, 0, 1]],
[[5,4], [1, 1, 1, 1, 0]],
[[6,5], [1, 1, 1, 1, 1, 0]],
[[7,2], [1, 0, 0, 1, 0, 0, 0]],
[[7,3], [1, 0, 1, 0, 1, 0, 0]],
[[7,4], [1, 0,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, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0]],
[[16,9], [1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0]],
[[17,7], [1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0]],
[[17,8], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0]],
[[18,7], [1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0]],
[[20,9], [1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0]],
[[20,11],[1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0]],
[[22,9], [1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0]],
[[23,9], [1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0]],
[[24,11],[1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]],
[[24,13],[1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]],
[[30,19],[1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1]],
[[34,15],[1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0 ]],
];
I've found that there is a discrepancy between Bjorklund's algorithm (which several implementations use) and Toussaint's examples, in that patterns like (4,5) in which the pulses are one less than the steps, are produced with a different rotation. So for example, for 4/5, Toussaint shows (1,1,1,1,0) and several implementations of Bjorklund's algorithm give (1,0,1,1,1). Your algorithm also outputs (1,0,1,1,1).
I would not call this a bug in your code, as it appears to be a property of Bjorklund's algorithm, but it is something to be aware of. I have a python implementation which corrects this issue, which matches Toussaint's slightly different result, which I can provide on request.
The pattern array that is returned, is a mix of Number Objects and primitives.
That means that a === comparison would fail and it would be good to have some kind of type consistency in the array of 1s and 0s.
and many other files that shouldn't be distributed. It should contain only the dist folder, the README.md file and the package.json definition
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.