add xen package
This commit is contained in:
parent
9458faf5b0
commit
e1bb58fb06
6 changed files with 46 additions and 671 deletions
26
packages/xen/package.json
Normal file
26
packages/xen/package.json
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"name": "@strudel/xen",
|
||||
"version": "0.0.1",
|
||||
"description": "Xenharmonic API for strudel",
|
||||
"main": "xen.mjs",
|
||||
"scripts": {
|
||||
"test": "mocha --colors"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/tidalcycles/strudel.git"
|
||||
},
|
||||
"keywords": [
|
||||
"tidalcycles",
|
||||
"strudel",
|
||||
"pattern",
|
||||
"livecoding",
|
||||
"algorave"
|
||||
],
|
||||
"author": "Felix Roos <flix91@gmail.com>",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"bugs": {
|
||||
"url": "https://github.com/tidalcycles/strudel/issues"
|
||||
},
|
||||
"homepage": "https://github.com/tidalcycles/strudel#readme"
|
||||
}
|
||||
8
packages/xen/test/xen.test.mjs
Normal file
8
packages/xen/test/xen.test.mjs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import { strict as assert } from 'assert';
|
||||
import { edo } from '../xen.mjs';
|
||||
|
||||
describe('xen', () => {
|
||||
it('edo', () => {
|
||||
assert.deepStrictEqual(edo('3edo'), [1, Math.pow(2, 1 / 3), Math.pow(2, 2 / 3)]);
|
||||
});
|
||||
});
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import { Pattern } from '@strudel/core/strudel.mjs';
|
||||
import { mod } from '../../packages/core/util.mjs';
|
||||
|
||||
function edo(name) {
|
||||
export function edo(name) {
|
||||
if (!/^[1-9]+[0-9]*edo$/.test(name)) {
|
||||
throw new Error('not an edo scale: "' + name + '"');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue