fixed all the things
This commit is contained in:
parent
a2974099c1
commit
2ee392be9b
7 changed files with 145 additions and 150 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue