Hacking the keyboard of m-audio Axiom 32

Hacking the keyboard of m-audio axiom 32
I love this keyboard because of the size/octaves and how it feels when being played

VC = Velocity column (its used to determine velocity)

This is how the developers mapped the keys in columns/rows on the flex cable (in order):

R1, R2, R3, R4, R5, R6, R7, R8, C1, VC1, VC2, C2, C3, VC3, C4, VC4

There are two keys placed differently on the PCB underneath every piano key/note. One is slightly higher and located above the other. So the velocity can be determined by counting the time between the keypress on the above one and the lower one.  When I tested this and timed the keypresses I measured with the millis() function in Arduino it never went above 1000, usually it stayed between 1 to 600.

In my key matrix I decided to map the velocity columns to numbers 100, which makes it easy to determine if its a “velocity key” or “note key” being pressed. If the key pressed is above 100 just start the millis() timer.

The timing later needs to be mapped >logarithmically< into velocity MIDI data (1-127).
This is how I mapped it:
uint8_t velocity = log(elapsed+1)/log(600)*127;
velocity=map(velocity, 1, 127, 127, 1);

Code: https://gist.github.com/brorgustav/3a0d533106b51187f7aabdc7a5e4e836
Required library: https://github.com/brorgustav/BGW_keyboard


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.