add more functions
This commit is contained in:
11
src/API.ts
11
src/API.ts
@ -93,8 +93,6 @@ export class UserAPI {
|
||||
return this.app._mouseY
|
||||
}
|
||||
|
||||
|
||||
|
||||
// =============================================================
|
||||
// Utility functions
|
||||
// =============================================================
|
||||
@ -363,9 +361,14 @@ export class UserAPI {
|
||||
return final_pulses.some(p => p == true)
|
||||
}
|
||||
|
||||
every(...n: number[]): boolean {
|
||||
return n.some(n => this.i % n === 0)
|
||||
stop(): void {
|
||||
this.app.clock.pause()
|
||||
this.app.setButtonHighlighting("pause", true);
|
||||
}
|
||||
silence = this.stop
|
||||
hush = this.stop
|
||||
|
||||
prob(p: number): boolean { return Math.random() * 100 < p }
|
||||
|
||||
mod(...pulse: number[]): boolean { return pulse.some(p => this.app.clock.time_position.pulse % p === 0) }
|
||||
modbar(...bar: number[]): boolean { return bar.some(b => this.app.clock.time_position.bar % b === 0) }
|
||||
|
||||
@ -45,7 +45,6 @@ export class Editor {
|
||||
clock: Clock;
|
||||
manualPlay: boolean = false;
|
||||
|
||||
|
||||
// Mouse position
|
||||
public _mouseX: number = 0;
|
||||
public _mouseY: number = 0;
|
||||
|
||||
Reference in New Issue
Block a user