mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-27 21:48:27 +00:00
always throw error for invalid notes
This commit is contained in:
parent
684bab99a9
commit
8d1c98f03e
@ -53,8 +53,8 @@ export const getPlayableNoteValue = (hap) => {
|
|||||||
// if value is number => interpret as midi number as long as its not marked as frequency
|
// if value is number => interpret as midi number as long as its not marked as frequency
|
||||||
if (typeof note === 'number' && context.type !== 'frequency') {
|
if (typeof note === 'number' && context.type !== 'frequency') {
|
||||||
note = fromMidi(hap.value);
|
note = fromMidi(hap.value);
|
||||||
} else if (typeof note === 'string' && !isNote(note)) {
|
} else if (typeof note !== 'string' || !isNote(note)) {
|
||||||
throw new Error('not a note: ' + note);
|
throw new Error('not a note: ' + JSON.stringify(note));
|
||||||
}
|
}
|
||||||
return note;
|
return note;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user