Skip to content

Commit

Permalink
Merge pull request #881 from tidalcycles/error-tolerance
Browse files Browse the repository at this point in the history
fix: make sure n is never undefined before nanFallback
  • Loading branch information
felixroos committed Dec 31, 2023
2 parents 01391d3 + 64d80f9 commit 92e0d09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/util.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 92e0d09

Please sign in to comment.