I would like to use Webmidi to let a simple black box to turn white for a short time when a specific MIDI note, or any note from a specific MIDI channel is incoming. I have this code but i don't know how to trig the css color change. Thanks!
WebMidi.enable(function(err) {
if (err) console.log("WebMidi could not be enabled");
var input = WebMidi.inputs[0];
// Listening for a 'note on' message (on channel 1 only)
input.addEventListener('noteon', 1,
function(e){ console.log(e); }
);
// Listening to other messages works the same way
input.addListener('noteoff', "all,"
function(e){ console.log(e); }
);
}
);