slightly better
This commit is contained in:
13
src/Clock.ts
13
src/Clock.ts
@ -58,6 +58,19 @@ export class Clock {
|
||||
})
|
||||
}
|
||||
|
||||
get ticks_before_new_bar(): number {
|
||||
/**
|
||||
* This function returns the number of ticks sepaating the current moment
|
||||
* from the beginning of the next bar.
|
||||
*
|
||||
* @returns number of ticks until next bar
|
||||
*/
|
||||
const currentBeatInTicks = ((this.app.clock.beats_since_origin - 1) * 48) + this.time_position.pulse + 1
|
||||
const nextBarinTicks = (this.beats_per_bar * this.ppqn) * this.time_position.bar + 1
|
||||
return nextBarinTicks - currentBeatInTicks
|
||||
}
|
||||
|
||||
|
||||
get beats_per_bar(): number {
|
||||
/**
|
||||
* Returns the number of beats per bar.
|
||||
|
||||
Reference in New Issue
Block a user