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];
|
const output = this.midiOutputs[this.currentOutputIndex];
|
||||||
if (output) {
|
if (output) {
|
||||||
const noteOnMessage = [0x90, noteNumber, velocity];
|
const noteOnMessage = [0x90 + channel, noteNumber, velocity];
|
||||||
const noteOffMessage = [0x80, noteNumber, 0];
|
const noteOffMessage = [0x80 + channel, noteNumber, 0];
|
||||||
|
|
||||||
// Send Note On
|
// Send Note On
|
||||||
output.send(noteOnMessage);
|
output.send(noteOnMessage);
|
||||||
|
|||||||
@ -249,9 +249,7 @@ export class Editor {
|
|||||||
(keycode, index) => {
|
(keycode, index) => {
|
||||||
if (event.keyCode === keycode) {
|
if (event.keyCode === keycode) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
// Check if Ctrl is pressed as well
|
|
||||||
if (event.ctrlKey) {
|
if (event.ctrlKey) {
|
||||||
// We trigger a script if ctrl is pressed
|
|
||||||
this.api.script(keycode - 111)
|
this.api.script(keycode - 111)
|
||||||
} else {
|
} else {
|
||||||
this.changeToLocalBuffer(index);
|
this.changeToLocalBuffer(index);
|
||||||
|
|||||||
Reference in New Issue
Block a user