Skip to content

Commit

Permalink
Added a key for showing timing info in Cambiare.
Browse files Browse the repository at this point in the history
  • Loading branch information
PoneyClairDeLune committed Jul 10, 2024
1 parent 96ba1ea commit 1ad52b4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/basic/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ let RootDisplay = class extends CustomEventSource {
};
return beat;
};
get noteOffset() {
return this.#noteBarOffset;
};
getTimeSig() {
return [this.#noteNomin, this.#noteDenom];
};
Expand Down
8 changes: 8 additions & 0 deletions src/cambiare_demo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,14 @@ document.body.addEventListener("keydown", async (ev) => {
// Accelerate
break;
};
case "z": {
// Show time signature
let roundedBeat = Math.floor(visualizer.noteBeat * 2) / 2;
let roundedTime = (visualizer.noteBar * visualizer.getTimeSig()[0] + roundedBeat) * 60 / visualizer.getTempo() + visualizer.noteOffset;
//visualizer.getTimeSig()
console.info(`Requested rounded note progress: ${visualizer.noteBar + 1}/${roundedBeat + 1}, ${Math.round(roundedTime * 1000) / 1000}s`);
break;
};
default: {
preventKey = false;
self.debugMode && console.debug(`Unknown key "${key}" pressed.`);
Expand Down
6 changes: 6 additions & 0 deletions src/fakeQy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,3 +357,9 @@ getBridge().addEventListener("message", function (ev) {
perf.fresh();
demoPerfs["KANDI8"] = perf;
};
{
// Kandi8
let perf = new TimedEvents();
perf.fresh();
demoPerfs["HORIZON"] = perf;
};

0 comments on commit 1ad52b4

Please sign in to comment.