[sdiy] MIDI velocity
Richie Burnett
rburnett at richieburnett.co.uk
Fri Apr 8 00:23:27 CEST 2016
I'm also finding the "UP, GOINGDOWN, DOWN, GOINGUP" nomenclature very
helpful useful here for identifying the states and what needs to be done
during each of them.
-Richie,
-----Original Message-----
From: Neil Johnson
Sent: Thursday, April 07, 2016 1:05 PM
To: synth-diy
Subject: Re: [sdiy] MIDI velocity
Interesting thread indeed.
About 7 years ago when I was writing the keyboard scanning code for a
Siel Opera 6 I had a simple scheme for scanning and measuring play and
release velocity (not many folks seem to know about release velocity
although some synthesizers do recognise it).
Using an Atmel ATMega8 scanning the entire keyboard every 1ms I run
4-state state machine for each key, where the states are UP,
GOINGDOWN, DOWN, GOINGUP, and an 8-bit counter for each key.
Debouncing is handled by the algorithm rather than a separate
debouncing step. With the right encoding of the states you can do
most of the testing and state transitions using btiwise operations, 8
keys at a time (on a 32-bit processor you could do 32 keys at a time).
I'll try and dig out the code and sling it up on github sometime.
It's all in C, no assembler required.
Neil
--
http://www.njohnson.co.uk
_______________________________________________
Synth-diy mailing list
Synth-diy at dropmix.xs4all.nl
http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7497 / Virus Database: 4545/11980 - Release Date: 04/07/16
More information about the Synth-diy
mailing list