minor optimisations

This commit is contained in:
2023-11-19 21:36:46 +01:00
parent 1fd9d514f9
commit 268533a5c6
3 changed files with 7 additions and 10 deletions

View File

@ -100,9 +100,6 @@ export const installEditor = (app: Editor) => {
editorSetup, editorSetup,
toposTheme, toposTheme,
app.chosenLanguage.of(javascript()), app.chosenLanguage.of(javascript()),
EditorView.updateListener.of((v: ViewUpdate) => {
v;
}),
]; ];
app.dynamicPlugins = new Compartment(); app.dynamicPlugins = new Compartment();
app.state = EditorState.create({ app.state = EditorState.create({

View File

@ -135,10 +135,8 @@ export const registerOnKeyDown = (app: Editor) => {
if (event.keyCode === keycode) { if (event.keyCode === keycode) {
event.preventDefault(); event.preventDefault();
if (event.ctrlKey) { if (event.ctrlKey) {
event.preventDefault();
app.api.script(keycode - 111); app.api.script(keycode - 111);
} else { } else {
event.preventDefault();
app.changeModeFromInterface("local"); app.changeModeFromInterface("local");
app.changeToLocalBuffer(index); app.changeToLocalBuffer(index);
hideDocumentation(); hideDocumentation();

View File

@ -22,8 +22,10 @@ export class TransportNode extends AudioWorkletNode {
this.app.clock.tick this.app.clock.tick
); );
this.app.clock.time_position = futureTimeStamp; 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
}:${zeroPad(futureTimeStamp.pulse, 2)} / ${this.app.clock.bpm}`; } / ${this.app.clock.bpm}`;
}
if (this.app.exampleIsPlaying) { if (this.app.exampleIsPlaying) {
tryEvaluate(this.app, this.app.example_buffer); tryEvaluate(this.app, this.app.example_buffer);
} else { } else {