support old way of setting frequencies
This commit is contained in:
parent
745c37f2d1
commit
48526824d6
1 changed files with 2 additions and 0 deletions
|
|
@ -53,6 +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 === 'number' && context.type === 'frequency') {
|
||||||
|
note = hap.value; // legacy workaround.. will be removed in the future
|
||||||
} else if (typeof note !== 'string' || !isNote(note)) {
|
} else if (typeof note !== 'string' || !isNote(note)) {
|
||||||
throw new Error('not a note: ' + JSON.stringify(note));
|
throw new Error('not a note: ' + JSON.stringify(note));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue