[sdiy] MIDI velocity

Richie Burnett rburnett at richieburnett.co.uk
Wed Apr 6 12:45:33 CEST 2016


Roman wrote:

> ...regular scanning starts and is repeated until all keys are
detected released and debounced.

Out of interest, what rule do you use for the de-bouncing of musical 
instrument keys?

For general switches in the user-interface of embedded control projects I 
have always used the rule that the switch state must have been stable for 
10ms before updating the output state.  So, whatever action the switch 
causes only takes place after the switch has been in the active state 
without bouncing for 10ms, and then the action variable only cancels when 
the switch has been in the inactive state for 10ms without bouncing.  This 
works very well for de-bouncing pushbuttons and toggle switches in things 
like industrial control equipment because it inherently rejects any brief 
glitches due to EMC transients, as well as removing the effects of 
mechanical switch bounce.  Nobody notices 10ms latency on the start and stop 
buttons of a CNC machine, or an oscilloscope, or whatever it is used for. 
But for musical keys, or drum pads, I am thinking that this 10ms latency on 
the closing of the switch is not acceptable.  Maybe I should revise the 
algorithm to act on the first inactive-to-active transition and update the 
output state to active immediately.  I would be interested to hear what rule 
you apply.

-Richie, 




More information about the Synth-diy mailing list