Merge pull request #881 from tidalcycles/error-tolerance

fix: make sure n is never undefined before nanFallback
This commit is contained in:
Felix Roos 2023-12-31 17:02:57 +01:00 committed by GitHub
commit 92e0d09c28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) => {