John Kinkennon 

retired  field engineer, programmer, piano tuner...


Virtual Pipe Organ MIDI Projects

Here are some MIDI encoders designed for retrofitting older organ consoles for use with virtual pipe organ software such as Hauptwek, Miditzer, and JOrgan.  The code for the encoders is freely available to modify or to use "as is".  Since the programs are written in C with plenty of documentation they should prove highly accessible for others to modify.  An ICSP connection provides easy connection of a PICKit 3 or equivalent programmer.  A complete MPLAB X project file allows programming via the Microchip MPLAB X IDE.  Where HEX files are available, those files may be loaded to a UBW32 utilizing the UBW32's bootloader.  This allows programming (and reprogramming) without purchasing a dedicated programming device.

The UBW32 is a PIC-32 based design from Brian Schmalz.  It is available from

Here's a guide to setting up a development environment to work with these projects.

PIC32-based MIDI Encoder/Decoder for 11x6 Matrix Allen Consoles as well as 8x8 Matrix consoles.

This new encoder/decoder works with modified Allen consoles with three 11x6 matrix manuals and a pedal board which in some cases will need converted to a matrix.  It operates up to 64 or more SAMs using the original Allen (MOS & ADC era) power supply and associated SAMs driver circuitry. The controller is the PIC32-based UBW32 from SparkFun.  Communication with pistons, toe studs, and stop action magnets is handled via I2C using three or more Centipede Shield boards from  There are eight analog inputs for expression pedals and  console potentiometers, and a relay output to delay power to audio amplifiers via an external relay.  There are six status LED outputs and an LCD port so that Hauptwerk status information can be displayed.

The Allen Encoder is unusual in that MIDI traffic is never strung out through a conventional MIDI 31,250 bps serial connection or daisy chained through additional encoders.  This prevents the skewing of MIDI notes (who wants to play arpeggios?) as well as preventing additional latency caused by the daisy chaining of devices.  While these delays may be tolerable in ordinary MIDI configurations they do eat away at the overall system latency mandating less audio buffering than might otherwise be desirable.

View Schematic (.bmp):   UBW32 MIDI Matrix Encoder

View Allen 603-D Block Diagram (.bmp):   11x6 diagram

View Allen ADC 4100DK Block Diagram (.bmp):   8x8 diagram

Project File and Source Files v1.03 (.zip):   download

PIC32-based Midi75Encoder - handles one manual

This is a project for midifying a single manual with up to 30 pistons (matrix) and three analog inputs.  Together with users on the Miditzer forum, we've been aiming at a project which uses a single USB connection, keeps all wiring local to a single manual, uses a single programming file, and is simple to configure and build.

View Schematic (.bmp):   Midi75Encoder
Program File v1.02 (.hex):   download   You may need to right-click the link and then save the file.
Program File v1.03 (.hex):   download   This version has 30 pistons in a 6x5 matrix.
Project File and Source Files v1.02 (.zip):   download   (only needed to modify the program)
Project File and Source Files v1.03 (.zip):   download

PIC32-based MIDI Encoder, shift register (bus) version

Below is a UBW32 on a proto board which provides space for the connectors that are needed to connect eight keyboard scanners (or 4 banks of 4 MidiBox DINs each).  The inline connectors are for 4 potentiometers and for five status outputs.  Since taking this photo I added a +5v power supply and switching transistor to the empty area at the upper right of the proto board.  That's dedicated to switching a solid-state relay which controls AC power to an audio amplifier to prevent "thumps" when the organ console is powered up.  This is the board I am currently running in the Rodgers 321A organ console.

I am planning a new version of this encoder which will use the Centipede Shield in place of each pair of DINs.

View Schematic (.bmp):   MidiBusEncoder
Program File (.hex):   download   You may need to right-click the link and then save the file.
Download Project File and Source Files (.zip):   download  (only needed to modify the program)

PIC32-based MIDI Encoder, 4 8x8 Matrix version (expandable to 32x32)

The matrix version is new and awaits some additional testing as I no longer have my 8x8 matrix Johannus manuals available.  If someone decides to build this I'll support them in working out any problems that may be encountered.  Same with all the designs for that matter.

View Schematic (.bmp):   Midi4MatrixEncoder
Program File (.hex):   download   You may need to right-click the link and then save the file.
Download Project File and Source Files (.zip):   download  (only needed to modify the program)

These projects are self-documenting, ha! ha!  Seriously, if there are questions I'll be happy to respond.  Just send an email.  I haven't taken the time yet to write step-by-step instructions, but it's something I have on my to-do list.  I'm sometimes willing to add a feature or make modifications to the programs if you need a particular function or configuration.

An older project that works great -- PIC18 based MIDI Encoder

Download Schematics (.bmp):   Console Encoder    Keyboard Scan Bd pg. 1     Keyboard Scan Bd pg. 2

Download Project File and Source Files (.zip):   download          Block Diagram (.jpg)

The MidiCore4 program has been refined and circuit boards have been laid out and ordered for an Organ Console Encoder and Keyboard Input Readers.  The Console Encoder will handle up to eight keyboards or combinations of keyboards, pedal boards, stops, and pistons.  There's one Keyboard Scan board per keyboard or for every 64 switches.  There are connections for four pots and outputs for five of the Hauptwerk status indicators.  I am willing to  make the circuit board layouts available to individuals who request them, but would prefer being in the loop so that whenever possible orders can be combined for better pricing. 

New features added 10/26/2010:
    - Swell pedal linking/swapping for operating two virtual swell pedals from one console pedal
    - Translation tables for 64 stops and 64 pistons