Concept: Advanced Hauptwerk console

Abstract. Hauptwerk MIDI console

The first idea was using three MIDI keyboards in one case, connected through MIDI merger. But when I had started to dig into it, I’ve found that 4 channel MIDI mergers are not cheap, and there was a new idea to use Arduino board to build my own MIDI merger.

After a while, by progressing with Atmel Studio and AVR capabilities I have grown to custom boards and done prototyping with Arduino Mega and Arduino mini.

So, here is the block diagram of what I have now:

Block diagram

Velocity-sensitive keyboards (ATMega48A)

Keyboards are velocity-sensitive, despite the fact that it is not applicable in Hauptwerk: the console can be used with other software like Kontakt, where you can set different instruments to manuals and have a full scale of velocities.

Each keyboard sends NoteOn/NoteOff in MIDI channel 0. While standart is MIDI, since it is internal communication only, the connection speed is set maximum for ATMega UART (gotta check – 512Kbit or 1Mbit actual value).
Each keyboard has MIDI input, and merges input signal from upper keyboard increasing its channel number.
So, keyboard 1 sends channel 0 messages. Keyboard 2 send also channel 0, but passes KBD1 signals through with “+1” channel number (0->1).
Keyboard 3, again, sends channel 0 messages, and adds +1 channel to all input signals, making KBD1 – channel 2, KBD2 – channel 1.

Organ core (ATMega2560)

The console CORE receives MIDI signals with channel numbers 0, 1, 2 etc… In settings mode there is an option to leave these channels as is, or increase it once again +1, to use channel 0 for pedalboard and channels 1-127 to your 127 manuals.

The core is a (Arduino Mega actually):

  1. power supply 9V to 5V;
  2. 4-channel MIDI merger (4 inputs, 2 outputs). Output 1 is common output, Output 2 is a pass-through for Console MIDI IN – to control more piston boards as separate devices.
  3. LED board controller (MIDI+some logic -> TWI)
  4. LCD display controller (MIDI+some logic -> TWI);
  5. Piston controller (between keyboards) (MIDI NRPN <-> TWI);
  6. Pedals controller (IO board for pedals with 5mm jack is not shown on the diagram).
  7. Separate USB chip with ATMega162USB.

There is three options to power all this garbage:
When using MIDI IN/OUT: +9V power supply(1) or any USB 5V phone charger with USB A to USB B power cord(2).
When using MIDI over USB – direct USB power from PC(3).

While power consumption is still low for the whole setup, I do not recommend using PC to power the console and using MIDI over USB at the same time, because it is very annoying to search for good USB cords if you need it more than 3m long.

Preset buttons

Preset buttons communicate with CORE by TWI. CORE translates it to NRPN messages to control Hauptwerk. Selected preset is indicated by button backlight if applicable, thanks to the Hauptwerk back-messaging system.

Status LED panel

Status LED panel indicates system status for Hauptwerk, like “Organ ready”, CPU overload, memory overload, audio clipping etc.

1602 LCD

1602 LCD are used to display the current and next selected preset, combination and organ name, and other stuff. Used also in settings mode, but there are not much settings yet.

LCD 1602 information sampleIO board with MIDI DIN5 connections

Usual stuff. Connectors and opto-couplers.

IO Board redder


  • Jaap van Gent says:

    Nice project!
    Did you manange to half the cost of a regular midimerger?
    I build organs for hibby and it costs € 475,- to midifi an 4-manual console. Iḿ using midihardware,
    Do you have a suggestion for preset-buttons/thumbpistons? Most of them are too deep for mij manuals…

    Kind regards, Jaap van Gent

    • Kotgoth says:

      Thank you!
      I guess the cost is much less than a half of 475EUR. Basically, it is the cost of 3 optocouplers, AtMega2560 and PCB making (and some other small components). I guess not more than 15-20EUR. I have made first PCB by myself, but it is a difficult task, since ATMEga2560 has 100 pins.
      You can add extra 5-10EUR if you want to make USB output for the merger, not just MIDI.
      The keyboard PCB by itself is a small merger too, I am now waiting for factory manufactured PCB to write an article about them.

      All prices are taken from Aliexpress.

    • Kotgoth says:

      And about buttons:
      I had to combine tact switch buttons with LED backlight with caps from regular buttons. They are now very thin – no problems with size.

      I’ll add some photos today or tomorrow.

  • Sam says:

    Beautiful work. How have you programmed ATMega2560 for read LCD message from Hauptwerk?
    Thank you

    • Kotgoth says:

      It was the easiest part. Hauptwerk messages are standart MIDI sysex messages several bytes long. They are very well documented in Hauptwerk User guide (link to Hauptwerk site) from Page 217 and on. So, if your ATMega can send MIDI messages, it is also ready to receive them. The rest is logic with LEDs and 1602 LCDs.

      • Yvonne Jacobi says:

        Groeten uit Canada 🇨🇦 I know a bit of Dutch…but my first language is English. My dad dabbled in pipe organ building -several churches here have instruments he put together. He even brought one over from Holland. He has since passed away, but I have kept 4 of his keyboards and 2 pedalboards to make 2 electronic organs(one for me, one for my sister). Wiring is done but My son and I are having trouble getting the arduino code right. We have hauptwerk vers 4. And the atmega2560 you mention. Would you be willing to share your sketch with us? That would be amazing. We have a glitch somewhere and can’t figure it out because we aren’t experienced in this coding.👍👋 we believe our wiring is solid.

        • Kotgoth says:

          Hello! I can’t speak dutch, because I am from somwhere else 🙂
          I do not use sketches from Arduino to power up the boards, I have programmed my own firmware with AVR studio to power up keyboards with ATMega48A and the mainboard with ATMega2560, because Arduino sketches are too slow to provide low latency communication.
          Also, I have made my own custom board layout for AtMegas to connect peripherials. Technically, you can use Arduino Mega with USB MIDI serial (which I do not recommend), but you should use external programmer to program ATMega2560 core and it’s USB chip. And it would take some time on my side to prepare a spreadsheet which ports on Arduino you should use to keyboards.
          I connect all LEDS and OLED displays with TWI communication, but LEDS also use their own custom board.

          TL DR 🙂 … It would take some time for me to make it fully compatible with Arduino Mega, and you should use hardware programmer (made from basic Arduino, for example).