Build your own MIDI circuits
Frequently Asked Questions.
MIDI & Music
MIDI and Music Information
MIDI/USB 64 (8x8) Note Keyboard Encoder


MIDI/USB 64-Note Keyboard Encoder 


This project consists of a 8x8 (64) matrix keyboard encoder capable of encoding any number of momentary action, push to make, single pole single throw (SPST), switches from 1 up to 64 to produce the equivalent MIDI note-on/note-off data commands.


The board operates on  MIDI Channel. Midi channels 1 but other MIDI channels can be programmed into the software on request. The MIDI start note is set to C2 (MIDI note number 36). But other start notes can be programmed into the software on request.


A toggle switch allows the boards to operate in a two different modes, with the diodes for the switches wired in a common anode or a common cathode arrangement. This allows the unit to work with keyboards that have either common anode or cathode switch/diode arrangements.


This unit can work in standard MIDI mode and via the USB/MIDI connection. It defaults to standard MIDI Baud rate of 31250. By replacing the original firmware on Mega8u2/16U2, the Arduino Uno will act as USB-MIDI device (Standard Midi Class), you don’t need to install additional device drivers on Windows, MaxOSX, and Linux, as the firmware acts as a device of Standard Midi Class. It will automatically install on the system as an Audio USB Device.


This unit can be connected to new keyboards or it can be used with an older non-MIDI keyboard by using magnetic/reed switches to isolate the old and new scanning circuits. This will allow the older keyboard synthesizer to continue to operate as normal while also providing a MIDI output.



MIDI 8x8 Keyboard Reverse Switchable


PRICE:  €45.00


*Click to Enlarge*




The 64 Note Keyboard Encoder to MIDI Unit consists of:


  • A Arduino boards including a suitable pre-programmed Atmega microcontroller, 
  • The MIDI channels (1-16) are pre-programmed in the firmware,
  • The velocity byte is preset to the maximum value.
  • The start Note of the keyboard encoders is pre-programmed in the firmware to C2 (MIDI note 36),
  • A 2.1mm power socket, and associated LED, 
  • A MIDI 5-pin DIN output socket,
  • A class compliant USB/MIDI Output,



The 64 Note Keyboard Encoder to MIDI unit requires:

  • a 9v battery or equivalent DC power source
  • Suitable key-switches or magnetic reed switches and associated IN4148 diodes


Circuit Schematic:

The circuit schematic diagrams of the a MIDI 64 note keyboard matrix arrangements shows the switch connections:


MIDI Wiring:

The MIDI OUT connection uses a 5-Pin 180 degree DIN sockets. Note that the MIDI OUT wiring is polarised and the correct pins should be used. These units can work in standard MIDI mode and via the USB/MIDI connection.


MIDI Keyboard Wiring:

The a boards have the switches/diodes organized in a 8 x 8 matrix (64 switches) arrangement.


For the common cathode arrangement, pins 2, 3, 4, 5, 6, 7, 8 and 9 are connected to switches SW1, SW2, SW3, SW4, SW5, Sw6, SW7 and SW8 respectively and then via the anodes of the diodes D1, D2, D3, D4, D5, D6, D7 and D8 and via the common cathodes to pin 10. The rest of the matrix wiring is done in a similar manner.


For the common anode arrangement, pins 10, 11, 12, A0, A1, A2, A3 and A4 are connected to switches SW1, SW9, SW17, SW25, SW33, SW41, SW49 and Sw57 respectively and then via the cathodes of the diodes D1, D9, D17, D25, D33, D41, D49 and D57 and via the common anodes to pin 10. The rest of the matrix wiring is done in a similar manner.


Power Supply:

The  Arduino can be powered via the USB connection or with an external power supply. The power source is selected automatically.


External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the board's power jack. Leads from a battery can be inserted in the Gnd and Vin pin headers of the POWER connector. A low dropout regulator provides improved energy efficiency.


The board can operate on an external supply of 7 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may be unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts.