The core of this project is an ATmega328 with an Arduino bootloader running at 16 MHz. It reads signals from the PS2-keyboards inside interrupt routines that listen to the CLK and DATA line from the keyboard, decodes the received bytes and places them into a first-level ringbuffer. A second stage consumes the bytes to assemble key-codes (carefully keeping track of key-up and key-down events) and fills second-level ringbuffers with key-events. These second-level ringbuffers are continuously monitored in the main loop of the program where the key-events are translated to MIDI sequences. The MIDI commands are subsequently transmitted via the serial line at 31250 baud such that MIDI devices can understand them.
The system features transposing notes and selecting MIDI channels as well as an arpeggiator that operates with two levels of complexity (chord level and harmonic sequence) and has a learn/replay mode.
The full description including the arduino sketch and a brief manual is available at