{"id":13438059,"url":"https://github.com/mkontogiannis/euclidean-rhythms","last_synced_at":"2025-03-19T18:31:44.728Z","repository":{"id":57231057,"uuid":"72470817","full_name":"mkontogiannis/euclidean-rhythms","owner":"mkontogiannis","description":"Calculates the rhythmical patterns based on the euclidean/bjorklund's algorithm","archived":false,"fork":false,"pushed_at":"2022-09-29T23:36:49.000Z","size":851,"stargazers_count":30,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-16T10:03:19.602Z","etag":null,"topics":["bjorklund-algorithm","euclidean-rhythms","javascript","rhythmical-patterns","uberkool"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkontogiannis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-31T19:28:44.000Z","updated_at":"2023-10-30T11:49:12.000Z","dependencies_parsed_at":"2022-09-14T07:51:50.191Z","dependency_job_id":null,"html_url":"https://github.com/mkontogiannis/euclidean-rhythms","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkontogiannis%2Feuclidean-rhythms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkontogiannis%2Feuclidean-rhythms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkontogiannis%2Feuclidean-rhythms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkontogiannis%2Feuclidean-rhythms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkontogiannis","download_url":"https://codeload.github.com/mkontogiannis/euclidean-rhythms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221088039,"owners_count":16753913,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bjorklund-algorithm","euclidean-rhythms","javascript","rhythmical-patterns","uberkool"],"created_at":"2024-07-31T03:01:02.612Z","updated_at":"2025-03-19T18:31:44.721Z","avatar_url":"https://github.com/mkontogiannis.png","language":"TypeScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# euclidean-rhythms\n\n[![example branch parameter](https://github.com/mkontogiannis/euclidean-rhythms/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/mkontogiannis/euclidean-rhythms/actions/workflows/main.yml)\n[![Codecov](https://img.shields.io/codecov/c/gh/mkontogiannis/euclidean-rhythms.svg?style=flat-square)](https://codecov.io/gh/mkontogiannis/euclidean-rhythms)\n[![npm](https://img.shields.io/npm/v/euclidean-rhythms.svg?style=flat-square)](https://www.npmjs.com/package/euclidean-rhythms)\n[![npm](https://img.shields.io/npm/dt/euclidean-rhythms.svg?style=flat-square)](https://www.npmjs.com/package/euclidean-rhythms)\n\nA micro-library in javascript that calculates the rhythmical patterns of equally distributed pulses in available steps.\nIt implements the bjorklund's algorithm that is described by Godfried Toussaint in [The Euclidean algorithm generates traditional musical rhythms](http://cgm.cs.mcgill.ca/~godfried/publications/banff.pdf)\n\n## Purpose\n\nI made this library in 2016; I couldn't find an implementation that yields to the expected results as described on the paper above and also being well tested with unit tests and code coverage.\n\nThe current solution is a javascript / typescript interpretation of the python code that is retrieved from [atonalmicroshores.com](http://www.atonalmicroshores.com/2014/03/bjorklund-py/)\n\n## Usage\n\n### Node.js\n\nRun `npm install euclidean-rhythms`\n\nThen in your javascript / typescript code:\n\n`const er = require('euclidean-rhythms');`\n\nor in es6\n\n`import {getPattern} from 'euclidean-rhythms';`\n\n`let cumbia = getPattern(3, 4);`\u003cbr /\u003e\ncumbia should be [ 1, 0, 1, 1 ]\n\n`let cinquillo = getPattern(5, 8);`\u003cbr /\u003e\ncinquillo should be [ 1, 0, 1, 1, 0, 1, 1, 0 ]\n\netc ...\n\n### Browser\n\n\\*\\* There is currently no umd bundle support from tsup, will be added as long as there is need for it; in the meantime you can use the older pre-typescript version of it.\n\nUse one of the prepared browser bundles from [unpkg.com](https://unpkg.com) \u003cbr /\u003e\n[https://unpkg.com/euclidean-rhythms@2.0.1/dist/bundle.umd.js](https://unpkg.com/euclidean-rhythms@2.0.1/dist/bundle.umd.js) \u003cbr /\u003e\n[https://unpkg.com/euclidean-rhythms@2.0.1/dist/bundle.umd.min.js](https://unpkg.com/euclidean-rhythms@2.0.1/dist/bundle.umd.min.js) \u003cbr /\u003e\n\nThen in your javascript code:\n\n`var pattern = euclideanRhythms.getPattern(5, 13);`\u003cbr /\u003e\npattern should be : [ 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0 ]\n\n## Develop\n\nClone the git repository and cd into it.\nRun `npm run test` for executing the unit tests and `npm run build` to build the ems, commonjs and iife bundles and the type definitions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkontogiannis%2Feuclidean-rhythms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkontogiannis%2Feuclidean-rhythms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkontogiannis%2Feuclidean-rhythms/lists"}