Skip to content

Instantly share code, notes, and snippets.

@ceiborg
Created March 5, 2020 00:32
Show Gist options
  • Save ceiborg/2d4680f1183e2405eadfda0aa79846a1 to your computer and use it in GitHub Desktop.
Save ceiborg/2d4680f1183e2405eadfda0aa79846a1 to your computer and use it in GitHub Desktop.
como recibir MIDI en Hydra
r = 0
g = 0.4
b = 0.3
solid(()=>r,()=>g,()=>b).out()
onmsg = (ev) => {
let note = ev.data[1]
r = (note-60)/12
console.log(r)
}
navigator.requestMIDIAccess().then( (ma)=>{
ma.inputs.forEach( e => {e.onmidimessage = (ev) => {onmsg(ev)}})
},(msg) => { alert( "Failed- " + msg )})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment