From 0e63f872710eee4900bef39a96e8d61126003d2e Mon Sep 17 00:00:00 2001 From: Raphael Forment Date: Sat, 2 Dec 2023 10:44:12 +0100 Subject: [PATCH] prepare version --- src/API.ts | 31 +++---------------------------- src/Clock.ts | 6 +++--- src/InterfaceLogic.ts | 7 ++++--- 3 files changed, 10 insertions(+), 34 deletions(-) diff --git a/src/API.ts b/src/API.ts index 63699e5..8e4950a 100644 --- a/src/API.ts +++ b/src/API.ts @@ -1298,7 +1298,7 @@ export class UserAPI { const results: boolean[] = nArray.map( (value) => (this.app.clock.pulses_since_origin - Math.floor(nudge * this.ppqn())) % - Math.floor(value * this.ppqn()) === + Math.floor(value * this.ppqn()) === 0, ); return results.some((value) => value === true); @@ -1318,7 +1318,7 @@ export class UserAPI { const results: boolean[] = nArray.map( (value) => (this.app.clock.pulses_since_origin - nudgeInPulses) % - Math.floor(value * barLength) === + Math.floor(value * barLength) === 0, ); return results.some((value) => value === true); @@ -1790,18 +1790,6 @@ export class UserAPI { return sum / values.length; }; - public range = ( - inputY: number, - yMin: number, - yMax: number, - xMin: number, - xMax: number, - ): number => { - const percent = (inputY - yMin) / (yMax - yMin); - const outputX = percent * (xMax - xMin) + xMin; - return outputX; - }; - limit = (value: number, min: number, max: number): number => { /** * Limits a value between a minimum and a maximum. @@ -1928,7 +1916,7 @@ export class UserAPI { // ============================================================= register = (name: string, operation: EventOperation): void => { - AbstractEvent.prototype[name] = function ( + AbstractEvent.prototype[name] = function( this: AbstractEvent, ...args: any[] ) { @@ -2111,19 +2099,6 @@ export class UserAPI { // Transport functions // ============================================================= - public nudge = (nudge?: number): number => { - /** - * Sets or returns the current clock nudge. - * - * @param nudge - [optional] the nudge to set - * @returns The current nudge - */ - if (nudge) { - this.app.clock.nudge = nudge; - } - return this.app.clock.nudge; - }; - public tempo = (n?: number): number => { /** * Sets or returns the current bpm. diff --git a/src/Clock.ts b/src/Clock.ts index 7bc162b..e47c730 100644 --- a/src/Clock.ts +++ b/src/Clock.ts @@ -66,6 +66,7 @@ export class Clock { ); } + // @ts-ignore clockCallback = (time: number, duration: number, tick: number) => { /** * Callback function for the zyklus clock. Updates the clock info and sends a @@ -87,9 +88,8 @@ export class Clock { ); this.app.clock.time_position = futureTimeStamp; if (futureTimeStamp.pulse % this.app.clock.ppqn == 0) { - this.timeviewer.innerHTML = `${zeroPad(futureTimeStamp.bar, 2)}:${ - futureTimeStamp.beat + 1 - } / ${this.app.clock.bpm}`; + this.timeviewer.innerHTML = `${zeroPad(futureTimeStamp.bar, 2)}:${futureTimeStamp.beat + 1 + } / ${this.app.clock.bpm}`; } if (this.app.exampleIsPlaying) { tryEvaluate(this.app, this.app.example_buffer); diff --git a/src/InterfaceLogic.ts b/src/InterfaceLogic.ts index 0f55f3d..290a757 100644 --- a/src/InterfaceLogic.ts +++ b/src/InterfaceLogic.ts @@ -144,9 +144,10 @@ export const installInterfaceLogic = (app: Editor) => { }); app.interface.audio_nudge_range.addEventListener("input", () => { - app.clock.nudge = parseInt( - (app.interface.audio_nudge_range as HTMLInputElement).value, - ); + // TODO: rebuild this + // app.clock.nudge = parseInt( + // (app.interface.audio_nudge_range as HTMLInputElement).value, + // ); }); app.interface.dough_nudge_range.addEventListener("input", () => {