mirror of
https://codeberg.org/uzu/strudel
synced 2026-08-15 09:38:28 -04:00
Fix falsy value check in getFreqeuncy
|| operator, which causes 0 to be treated as falsy and thus not passed to getFreq, resulting in incorrect frequency calculation for MIDI note 0. Replace || with ?? to allow 0 to be correctly passed to getFreq.
This commit is contained in:
@@ -137,7 +137,7 @@ export const getFrequency = (hap) => {
|
||||
if (value.freq) {
|
||||
return value.freq;
|
||||
}
|
||||
return getFreq(value.note || value.n || value.value);
|
||||
return getFreq(value.note ?? value.n ?? value.value);
|
||||
}
|
||||
if (typeof value === 'number' && context.type !== 'frequency') {
|
||||
value = midiToFreq(hap.value);
|
||||
|
||||
Reference in New Issue
Block a user