New wave of corrections

This commit is contained in:
2023-09-17 13:20:54 +02:00
parent 4eea3896ba
commit f10a0f00d5
4 changed files with 35 additions and 39 deletions

View File

@ -1025,17 +1025,9 @@ export class UserAPI {
};
// =============================================================
// Modulo basd time filters
// Modulo based time filters
// =============================================================
public modbar = (...n: number[]): boolean => {
const results: boolean[] = n.map(
(value) =>
this.app.clock.time_position.bar % Math.floor(value * this.ppqn()) === 0
);
return results.some((value) => value === true);
};
// =============================================================
// Other core temporal functions
// =============================================================
@ -1056,7 +1048,7 @@ export class UserAPI {
return pos_within_chunk < threshold;
};
public divbar = (chunk: number): boolean => {
public flipbar = (chunk: number = 1): boolean => {
const time_pos = this.app.clock.time_position.bar;
const current_chunk = Math.floor(time_pos / chunk);
return current_chunk % 2 === 0;