From 74d18b85baf82701e22fee627001ca01560db14d Mon Sep 17 00:00:00 2001 From: Raphael Forment Date: Sat, 19 Aug 2023 17:12:31 +0200 Subject: [PATCH] test new mod --- src/API.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/API.ts b/src/API.ts index ce9c945..becd941 100644 --- a/src/API.ts +++ b/src/API.ts @@ -989,16 +989,21 @@ export class UserAPI { }); }; - mod = (...pulse: number[]): boolean => { - /** - * Returns true if the current pulse is a modulo of any of the given pulses. - * - * @param pulse - The pulse to check for - * @returns True if the current pulse is a modulo of any of the given pulses - */ - return pulse.some((p) => this.app.clock.time_position.pulse % p === 0); + public mod = (...n: number[]): boolean[] => { + const results: boolean[] = n.map((value) => epulse() % value === 0); + return results.some((value) => value === true); }; + // mod = (...pulse: number[]): boolean => { + // /** + // * Returns true if the current pulse is a modulo of any of the given pulses. + // * + // * @param pulse - The pulse to check for + // * @returns True if the current pulse is a modulo of any of the given pulses + // */ + // return pulse.some((p) => this.app.clock.time_position.pulse % p === 0); + // }; + modbar = (...bar: number[]): boolean => { /** * Returns true if the current bar is a modulo of any of the given bars.