prepare version
This commit is contained in:
25
src/API.ts
25
src/API.ts
@ -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.
|
||||
@ -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.
|
||||
|
||||
@ -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,8 +88,7 @@ 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.timeviewer.innerHTML = `${zeroPad(futureTimeStamp.bar, 2)}:${futureTimeStamp.beat + 1
|
||||
} / ${this.app.clock.bpm}`;
|
||||
}
|
||||
if (this.app.exampleIsPlaying) {
|
||||
|
||||
@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user