- make dictionary a control

- standalone voicing function
- simplify voicing control names
This commit is contained in:
Felix Roos 2023-07-11 22:49:34 +02:00
parent d5c0309885
commit 0b3a8a5f65
3 changed files with 24 additions and 14 deletions

View file

@ -54,6 +54,15 @@ export const x2chroma = (x) => {
}
};
export const x2midi = (x) => {
if (typeof x === 'number') {
return x;
}
if (typeof x === 'string') {
return note2midi(x);
}
};
// duplicate: util.mjs (does not support sharp flag)
export const midi2note = (midi, sharp = false) => {
const oct = Math.floor(midi / 12) - 1;