tttapa / Control-Surface

Arduino library for creating MIDI controllers and other MIDI devices.
GNU General Public License v3.0
1.19k stars 134 forks source link

Midi Keyboard Key Velocity Example #933

Open RandyRyanG opened 1 year ago

RandyRyanG commented 1 year ago

Would be very helpful to have an example sketch to add Keyboard velocity for a midi keybed that has 2 switches per key. That would measure the time from one switch to the next and then convert that measurement to the correct velocity.

  1. Key1 switch1 activated = start time
  2. Key1 switch2 activated (pressed harder) = stop time
  3. Calculate time from switch1 to switch2
  4. Convert time difference measurement to velocity
  5. Send Midi Note on Event with measured velocity

I have posted this question on the arduino forum in less detail and I received response from @tttapa https://forum.arduino.cc/t/adding-velocity-to-25key-midi-keyboard/1138753