adding ebeat function

This commit is contained in:
2023-08-16 13:44:09 +02:00
parent fd0f5bdb8b
commit d3c864ff5c
2 changed files with 16 additions and 8 deletions

View File

@ -23,7 +23,6 @@ interface Pattern<T> {
};
}
/**
* This is an override of the basic "includes" method.
*/
@ -806,11 +805,17 @@ export class UserAPI {
get ebeat(): number {
/**
* Returns the current beat number since the origin of time
* TODO: fix! Why is this not working?
*/
return this.app.clock.beats_since_origin;
}
get epulse(): number {
/**
* Returns the current number of pulses elapsed since origin of time
*/
return this.app.clock.pulses_since_origin;
}
onbar(n: number, ...bar: number[]): boolean {
// n is acting as a modulo on the bar number
const bar_list = [...Array(n).keys()].map((i) => i + 1);