Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
keyboardscanner
Turn your broken (or unused) keyboard into a MIDI controller (with pedal and veloticy)
You can look at https://github.com/elkayem/midi2cv for a complete MIDI to CV implementation with Arduino and cheap DACs. Instead of (or in addition to) receiving MIDI, you'd also need to implement keyscanning and MIDI sending.
Your project can be broken up into a number of subprojects. For keyscanning you don't need additional hardware, just the pins from the ribbon cables going to the arduino's digital pins and ground. Since the keys are just switches (two per key, the time difference between the two switches closing giving the source of velocity), you could start with some examples from the Arduino MIDI library (https://github.com/FortySevenEffects/arduino_midi_library). To test MIDI sending you don't even need to start from the keybed just yet, and if you do, you can start with a single key. Once you've got that part figured out end to end (key press/release generates note on/off events) you can work on iterating through the matrix, CC controls etc. MIDI out can be done in different ways. With a 5 pin DIN plug you'd just need two 220 ohm resistors.
In that case, check out https://github.com/oxesoft/keyboardscanner. You should be able to adapt the code to your specific matrix. I'd just suggest replacing the construction of serial messages by using the midi.h library, as it's a bit reinventing the wheel. You also don't need all those debugging conditions if you can simply view incoming midi messages from another device.