Created
March 5, 2020 00:32
-
-
Save ceiborg/2d4680f1183e2405eadfda0aa79846a1 to your computer and use it in GitHub Desktop.
como recibir MIDI en Hydra
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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