minor optimisations
This commit is contained in:
@ -100,9 +100,6 @@ export const installEditor = (app: Editor) => {
|
||||
editorSetup,
|
||||
toposTheme,
|
||||
app.chosenLanguage.of(javascript()),
|
||||
EditorView.updateListener.of((v: ViewUpdate) => {
|
||||
v;
|
||||
}),
|
||||
];
|
||||
app.dynamicPlugins = new Compartment();
|
||||
app.state = EditorState.create({
|
||||
|
||||
@ -135,10 +135,8 @@ export const registerOnKeyDown = (app: Editor) => {
|
||||
if (event.keyCode === keycode) {
|
||||
event.preventDefault();
|
||||
if (event.ctrlKey) {
|
||||
event.preventDefault();
|
||||
app.api.script(keycode - 111);
|
||||
} else {
|
||||
event.preventDefault();
|
||||
app.changeModeFromInterface("local");
|
||||
app.changeToLocalBuffer(index);
|
||||
hideDocumentation();
|
||||
|
||||
@ -12,9 +12,9 @@ export class TransportNode extends AudioWorkletNode {
|
||||
|
||||
/** @type {(this: MessagePort, ev: MessageEvent<any>) => any} */
|
||||
handleMessage = (message) => {
|
||||
if(message.data) {
|
||||
if (message.data) {
|
||||
if (message.data.type === "bang") {
|
||||
if(this.app.clock.running) {
|
||||
if (this.app.clock.running) {
|
||||
if (this.app.settings.send_clock) {
|
||||
this.app.api.MidiConnection.sendMidiClock();
|
||||
}
|
||||
@ -22,8 +22,10 @@ export class TransportNode extends AudioWorkletNode {
|
||||
this.app.clock.tick
|
||||
);
|
||||
this.app.clock.time_position = futureTimeStamp;
|
||||
if (futureTimeStamp.pulse % this.app.clock.ppqn == 0) {
|
||||
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) {
|
||||
tryEvaluate(this.app, this.app.example_buffer);
|
||||
} else {
|
||||
@ -60,6 +62,6 @@ export class TransportNode extends AudioWorkletNode {
|
||||
}
|
||||
|
||||
stop() {
|
||||
this.port.postMessage({type: "stop" });
|
||||
this.port.postMessage({ type: "stop" });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user