add midi channel to note function
This commit is contained in:
@ -58,11 +58,12 @@ export class MidiConnection{
|
||||
});
|
||||
}
|
||||
|
||||
public sendMidiNote(noteNumber: number, velocity: number, durationMs: number): void {
|
||||
|
||||
public sendMidiNote(noteNumber: number, channel: number, velocity: number, durationMs: number): void {
|
||||
const output = this.midiOutputs[this.currentOutputIndex];
|
||||
if (output) {
|
||||
const noteOnMessage = [0x90, noteNumber, velocity];
|
||||
const noteOffMessage = [0x80, noteNumber, 0];
|
||||
const noteOnMessage = [0x90 + channel, noteNumber, velocity];
|
||||
const noteOffMessage = [0x80 + channel, noteNumber, 0];
|
||||
|
||||
// Send Note On
|
||||
output.send(noteOnMessage);
|
||||
|
||||
@ -249,9 +249,7 @@ export class Editor {
|
||||
(keycode, index) => {
|
||||
if (event.keyCode === keycode) {
|
||||
event.preventDefault();
|
||||
// Check if Ctrl is pressed as well
|
||||
if (event.ctrlKey) {
|
||||
// We trigger a script if ctrl is pressed
|
||||
this.api.script(keycode - 111)
|
||||
} else {
|
||||
this.changeToLocalBuffer(index);
|
||||
|
||||
Reference in New Issue
Block a user