mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-12 22:15:27 -04:00
Remove recursion from mod
This commit is contained in:
@@ -27,7 +27,7 @@ export const fromMidi = (n) => {
|
||||
|
||||
// modulo that works with negative numbers e.g. mod(-1, 3) = 2
|
||||
// const mod = (n: number, m: number): number => (n < 0 ? mod(n + m, m) : n % m);
|
||||
export const mod = (n, m) => (n < 0 ? mod(n + m, m) : n % m);
|
||||
export const mod = (n, m) => (n % m + m) % m;
|
||||
|
||||
export const getPlayableNoteValue = (event) => {
|
||||
let { value: note, context } = event;
|
||||
|
||||
Reference in New Issue
Block a user