fix getFrequency for .note
This commit is contained in:
parent
227dda921c
commit
1cd31cfce9
1 changed files with 5 additions and 2 deletions
|
|
@ -67,8 +67,11 @@ export const getPlayableNoteValue = (hap) => {
|
|||
export const getFrequency = (hap) => {
|
||||
let { value, context } = hap;
|
||||
// if value is number => interpret as midi number as long as its not marked as frequency
|
||||
if (typeof value === 'object' && value.freq) {
|
||||
return value.freq;
|
||||
if (typeof value === 'object') {
|
||||
if (value.freq) {
|
||||
return value.freq;
|
||||
}
|
||||
return getFreq(value.note || value.n || value.value);
|
||||
}
|
||||
if (typeof value === 'number' && context.type !== 'frequency') {
|
||||
value = fromMidi(hap.value);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue