fixed all the things

This commit is contained in:
Jade (Rose) Rowland 2024-01-05 01:00:22 -05:00
parent a2974099c1
commit 2ee392be9b
7 changed files with 145 additions and 150 deletions

View file

@ -86,7 +86,7 @@ export const midi2note = (n) => {
// modulo that works with negative numbers e.g. _mod(-1, 3) = 2. Works on numbers (rather than patterns of numbers, as @mod@ from pattern.mjs does)
export const _mod = (n, m) => ((n % m) + m) % m;
export function nanFallback(value, fallback) {
export function nanFallback(value, fallback = 0) {
if (isNaN(Number(value))) {
logger(`"${value}" is not a number, falling back to ${fallback}`, 'warning');
return fallback;