mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-30 16:33:19 -04:00
toMidi now understands numbers
This commit is contained in:
@@ -19,6 +19,9 @@ export const tokenizeNote = (note) => {
|
||||
|
||||
// turns the given note into its midi number representation
|
||||
export const toMidi = (note) => {
|
||||
if (typeof note === 'number') {
|
||||
return note;
|
||||
}
|
||||
const [pc, acc, oct] = tokenizeNote(note);
|
||||
if (!pc) {
|
||||
throw new Error('not a note: "' + note + '"');
|
||||
|
||||
Reference in New Issue
Block a user