mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-11 21:58:31 +00:00
Remove recursion from mod
This commit is contained in:
parent
1029f8674c
commit
3742bf384c
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user