Skip to content

Commit

Permalink
Trying to fix key combinations, score re-centering (#60).
Browse files Browse the repository at this point in the history
  • Loading branch information
gogins committed Mar 15, 2024
1 parent 89b206f commit e40d071
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions music/NYCEMF-2024/cloud-5.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ class Cloud5Piece extends HTMLElement {
this.gui = new dat.GUI(dat_gui_parameters);
let dat_gui = document.getElementById('menu_item_dat_gui');
dat_gui.appendChild(this.gui.domElement);
document.addEventListener("keydown", function (e) {
document.onkeydown = ((e) => {
let e_char = String.fromCharCode(e.keyCode || e.charCode);
if (e.ctrlKey === true) {
if (e_char === 'H') {
Expand All @@ -302,11 +302,13 @@ class Cloud5Piece extends HTMLElement {
this.gui.closed = true;
gui.closed = false;
} else if (e_char === 'G') {
generate_score_hook();
this.score_generator_function_addon();
} else if (e_char === 'P') {
parameters.play();
this.play();
} else if (e_char === 'S') {
parameters.stop();
this.stop();
} else if (e_char === 'C') {
this?.piano_roll_overlay.recenter();
}
}
});
Expand Down Expand Up @@ -492,6 +494,9 @@ class Cloud5PianoRoll extends HTMLElement {
stop() {
clearInterval(this.interval_id);
}
recenter() {
this.silencio_score.lookAtFullScore3D();
}
}
customElements.define("cloud5-piano-roll", Cloud5PianoRoll);

Expand Down

0 comments on commit e40d071

Please sign in to comment.