Skip to content

Commit

Permalink
prevent error
Browse files Browse the repository at this point in the history
  • Loading branch information
felixroos committed Sep 28, 2023
1 parent 6c3a3b9 commit 0dcc55e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/midi/midi.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ let listeners = {};
const refs = {};

export async function midin(input) {
console.log('midi in...');
const initial = await enableWebMidi(); // only returns on first init
const device = getDevice(input, WebMidi.inputs);

Expand All @@ -186,9 +185,8 @@ export async function midin(input) {
listeners[input] = (e) => {
const cc = e.dataBytes[0];
const v = e.dataBytes[1];
refs[input][cc] = v / 127;
refs[input] && (refs[input][cc] = v / 127);
};
device.addListener('midimessage', listeners[input]);
//return { cc };
return cc;
}

0 comments on commit 0dcc55e

Please sign in to comment.