Same process

This commit is contained in:
2024-04-19 21:56:45 +02:00
parent 137840778a
commit 75481e19f0
4 changed files with 8 additions and 8 deletions

18
src/API/Time/Warp.ts Normal file
View File

@ -0,0 +1,18 @@
import { Editor } from "../../main";
export const warp = (app: Editor) => (n: number): void => {
/**
* Time-warp the clock by using the tick you wish to jump to.
*/
app.clock.tick = n;
app.clock.time_position = app.clock.convertTicksToTimeposition(n);
};
export const beat_warp = (app: Editor) => (beat: number): void => {
/**
* Time-warp the clock by using the tick you wish to jump to.
*/
const ticks = beat * app.clock.ppqn;
app.clock.tick = ticks;
app.clock.time_position = app.clock.convertTicksToTimeposition(ticks);
};