However when recording the events in a MIDI container and displaying them as events, all the notes have all the pitchs at C-1 and the notes from the keyboard seem to be in the column dedicated to velocities.
The keyboard widget sends channel, note and velocity as arguments, you need to apply some translation if want it to be formatted differently on the other end, here is a possible solution with the keyboard's onValue script (set bypass to true to prevent the default messages from being sent):
var ch = 0,
note = id.split('/').pop(), // get note from key button's id
vel = get(id) ? 100 : 0, // convert single key value (0 or 1) to velocity
address = `/vkb_midi/${ch}/note/@`
send(address, note, vel) // assumes target is set
Note: just in case, "@" in the address does nothing in open stage control, it's sent as is.
var ch = 0,
note = id.split('/').pop(), // get note from key button's id
vel = get(id) ? 0 : 100, // convert single key value (0 or 1) to velocity
address = `/vkb_midi/${ch}/note/` + note
send(address, vel) // assumes target is set
Hi, this works great, but i doesn't send note off messages when key is released how could i solve that on OSC?
I used this fix:
var ch = 0,
note = id.split('/').pop(), // get note from key button's id
vel = get(this).reduce( (total,item) => total + item,0) ? 100:0,
address = `/vkb_midi/${ch}/note/` + note
send(address, vel) // assumes target is set
This is basically giving you the number of pressed key on the keyboard, not the state of the key, checkout the code above carefully, it works and does send note offs.