prepare version

This commit is contained in:
2023-12-02 10:44:12 +01:00
parent bcb0ddc1cb
commit 0e63f87271
3 changed files with 10 additions and 34 deletions

View File

@ -1790,18 +1790,6 @@ export class UserAPI {
return sum / values.length; 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 => { limit = (value: number, min: number, max: number): number => {
/** /**
* Limits a value between a minimum and a maximum. * Limits a value between a minimum and a maximum.
@ -1928,7 +1916,7 @@ export class UserAPI {
// ============================================================= // =============================================================
register = (name: string, operation: EventOperation<AbstractEvent>): void => { register = (name: string, operation: EventOperation<AbstractEvent>): void => {
AbstractEvent.prototype[name] = function ( AbstractEvent.prototype[name] = function(
this: AbstractEvent, this: AbstractEvent,
...args: any[] ...args: any[]
) { ) {
@ -2111,19 +2099,6 @@ export class UserAPI {
// Transport functions // 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 => { public tempo = (n?: number): number => {
/** /**
* Sets or returns the current bpm. * Sets or returns the current bpm.

View File

@ -66,6 +66,7 @@ export class Clock {
); );
} }
// @ts-ignore
clockCallback = (time: number, duration: number, tick: number) => { clockCallback = (time: number, duration: number, tick: number) => {
/** /**
* Callback function for the zyklus clock. Updates the clock info and sends a * Callback function for the zyklus clock. Updates the clock info and sends a
@ -87,8 +88,7 @@ export class Clock {
); );
this.app.clock.time_position = futureTimeStamp; this.app.clock.time_position = futureTimeStamp;
if (futureTimeStamp.pulse % this.app.clock.ppqn == 0) { if (futureTimeStamp.pulse % this.app.clock.ppqn == 0) {
this.timeviewer.innerHTML = `${zeroPad(futureTimeStamp.bar, 2)}:${ this.timeviewer.innerHTML = `${zeroPad(futureTimeStamp.bar, 2)}:${futureTimeStamp.beat + 1
futureTimeStamp.beat + 1
} / ${this.app.clock.bpm}`; } / ${this.app.clock.bpm}`;
} }
if (this.app.exampleIsPlaying) { if (this.app.exampleIsPlaying) {

View File

@ -144,9 +144,10 @@ export const installInterfaceLogic = (app: Editor) => {
}); });
app.interface.audio_nudge_range.addEventListener("input", () => { app.interface.audio_nudge_range.addEventListener("input", () => {
app.clock.nudge = parseInt( // TODO: rebuild this
(app.interface.audio_nudge_range as HTMLInputElement).value, // app.clock.nudge = parseInt(
); // (app.interface.audio_nudge_range as HTMLInputElement).value,
// );
}); });
app.interface.dough_nudge_range.addEventListener("input", () => { app.interface.dough_nudge_range.addEventListener("input", () => {