fix: make sure n is never undefined before nanFallback
This commit is contained in:
parent
1d32da075d
commit
64d80f98db
1 changed files with 1 additions and 1 deletions
|
|
@ -95,7 +95,7 @@ export function nanFallback(value, fallback) {
|
|||
}
|
||||
// round to nearest int, negative numbers will output a subtracted index
|
||||
export const getSoundIndex = (n, numSounds) => {
|
||||
return _mod(Math.round(nanFallback(n, 0)), numSounds);
|
||||
return _mod(Math.round(nanFallback(n ?? 0, 0)), numSounds);
|
||||
};
|
||||
|
||||
export const getPlayableNoteValue = (hap) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue