Skip to content

Commit

Permalink
fix for msc messages
Browse files Browse the repository at this point in the history
  • Loading branch information
josephdadams committed May 31, 2023
1 parent d2f06a2 commit 7c04db4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions midi.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ var navigator = require('jzz');
const notifications = require('./notifications.js');
const contextmenu = require('./contextmenu.js');

const _ = require('lodash');

var logger = navigator.Widget({ _receive: function(msg) { console.log('virtual message received: '); console.log(msg.toString()); }});

function createVirtualMIDIPort() {
Expand Down Expand Up @@ -83,7 +85,7 @@ function sendMIDI(midiObj, callback) {

let rawmessage = '';

switch(midiObj.midicommand) {
switch(midiObj.midicommand.toLowerCase()) {
case 'noteon':
msg = navigator.MIDI.noteOn(midiObj.channel, midiObj.note, midiObj.velocity);
break;
Expand All @@ -106,7 +108,7 @@ function sendMIDI(midiObj, callback) {
msg = navigator.MIDI.pitchBend(midiObj.channel, midiObj.value);
break;
case 'msc':
msg = BuildMSC(midiObj.deviceId, midiObj.commandFormat, midiObj.command, midiObj.cue, midiObj.cueList, midiObj.cuePath);
msg = BuildMSC(midiObj.deviceid, midiObj.commandformat, midiObj.command, midiObj.cue, midiObj.cuelist, midiObj.cuepath);
break;
case 'sysex':
msg = midiObj.message;
Expand All @@ -125,7 +127,6 @@ function sendMIDI(midiObj, callback) {
}
}
returnObj = {result: 'midi-sent-successfully', midiObj: midiObj, message: rawmessage};
console.log(returnObj);
callback(returnObj);
}
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "midi-relay",
"productName": "midi-relay",
"version": "3.0.3",
"version": "3.0.4",
"description": "Listens for HTTP requests with JSON payload and relays MIDI/MSC commands on local ports.",
"license": "MIT",
"repository": "josephdadams/midi-relay",
Expand Down Expand Up @@ -31,6 +31,7 @@
"express": "^4.18.1",
"jquery": "^3.3.1",
"jzz": "^1.6.1",
"lodash": "^4.17.21",
"mdns-js": "^1.0.3",
"socket.io": "^4.5.1"
},
Expand Down

0 comments on commit 7c04db4

Please sign in to comment.