Convert your Viscount organ pedalboard into a USB-MIDI input for Hauptwerk using an Arduino Uno R3—no firmware reflashing required.
Turn an organ pedalboard with a matrix and diodes into a USB-MIDI input for Hauptwerk virtual pipe organ software. The Arduino Uno R3 speaks raw MIDI bytes over USB serial, and host computer software bridges serial to a virtual MIDI port that Hauptwerk can see.
The Arduino Uno R3 does not enumerate as a native USB-MIDI device. Rather than reflashing the 16U2 chip (HIDUINO), we use a serial-to-MIDI bridge on the host computer, which is the recommended approach for Uno-class boards.
- Arduino Uno R3
- Viscount pedalboard with matrix wiring and diodes
- USB cable (Arduino to computer)
- Column pins (MD0-MD7): Arduino digital pins 2-9 (outputs)
- Row pins: Arduino analog pins A0-A3 (inputs with internal pullups)
- Diodes: Already present in pedalboard matrix to prevent ghosting
No resistors needed! The Arduino's internal pullup resistors handle everything.
Simply connect the pedalboard connector wires directly to the Arduino pins:
| Connector Pin # | Pedalboard Wire | Arduino Pin | Type | Notes |
|---|---|---|---|---|
| 1 | MD0 | Digital Pin 9 | OUTPUT | Column 0 (driven LOW to scan) |
| 2 | MD1 | Digital Pin 8 | OUTPUT | Column 1 |
| 3 | PS1 | Analog Pin A0 | INPUT_PULLUP | Row 1 (reads LOW when pressed) |
| 4 | MD2 | Digital Pin 7 | OUTPUT | Column 2 |
| 5 | PS2 | Analog Pin A1 | INPUT_PULLUP | Row 2 |
| 6 | MD3 | Digital Pin 6 | OUTPUT | Column 3 |
| 7 | PS3 | Analog Pin A2 | INPUT_PULLUP | Row 3 |
| 8 | MD4 | Digital Pin 5 | OUTPUT | Column 4 |
| 9 | PS4 | Analog Pin A3 | INPUT_PULLUP | Row 4 |
| 10 | MD5 | Digital Pin 4 | OUTPUT | Column 5 |
| 11 | (empty) | — | — | Not connected |
| 12 | MD6 | Digital Pin 3 | OUTPUT | Column 6 |
| 13 | (empty) | — | — | Not connected |
| 14 | MD7 | Digital Pin 2 | OUTPUT | Column 7 |
Important: The diodes in your pedalboard prevent ghosting and protect against shorts. Make sure they're all oriented the same direction.
- Open
arduino/pedalboard_midi/pedalboard_midi.inoin Arduino IDE - Upload to your Arduino Uno R3
- Close Arduino Serial Monitor (important - the MIDI bridge needs the serial port!)
OPTION A: Use the GUI App (Easiest!)
macOS:
- Download
releases/Pedalboard-MIDI-Bridge-macOS.zip - Unzip and drag the app to Applications
- Double-click to launch
- The app will auto-detect your Arduino and MIDI ports
- Click "Start Bridge"
Windows:
- Install Python dependencies:
pip install pyserial python-rtmidi - Run the build script:
build_windows.bat - The .exe will be created in the
distfolder - Double-click to launch
OPTION B: Run Python Script (Advanced)
If you prefer command-line or the GUI doesn't work:
With GUI:
python3 python/midi_bridge_gui.pyWithout GUI (command-line):
python3 python/midi_bridge.pyBoth require: pip install pyserial python-rtmidi
macOS:
- Open Audio MIDI Setup (Applications → Utilities)
- Window → Show MIDI Studio
- Double-click IAC Driver
- Check "Device is online"
- Click + to add a port, name it "Pedals"
- Click Apply
Windows:
- Download and install loopMIDI: https://www.tobias-erichsen.de/software/loopmidi.html
- Launch loopMIDI
- Create a new port named "Pedals"
macOS:
- Download MIDI Monitor: https://www.snoize.com/MIDIMonitor/
- Watch for Note On/Off from IAC: Pedals
Windows:
- Download MIDI-OX: http://www.midiox.com/
- Watch for Note On/Off from loopMIDI: Pedals
- Open Hauptwerk (or GarageBand for testing)
- Go to MIDI settings
- Enable input: IAC: Pedals (Mac) or loopMIDI: Pedals (Windows)
- Use auto-detect to map the pedalboard
- Play! 🎹
- Wire pedalboard to Arduino (see wiring table above)
- Upload
arduino/pedalboard_midi/pedalboard_midi.inoto Arduino - Create virtual MIDI port (IAC Driver on Mac, loopMIDI on Windows)
- Run the MIDI bridge app or Python script
- Connect Hauptwerk/GarageBand to the virtual MIDI port
That's it! Press pedals = hear notes! 🎹
- Baud rate: 115200 (for serial bridge)
- Note On:
0x90 | channel, note, velocity 100 - Note Off:
0x80 | channel, note, velocity 0 - Channel: 2 (standard for pedals)
- Note range: 32 notes starting at MIDI 36 (C2), adjustable via
BASE_NOTE - Debounce: 5-10ms per key
- Check USB cable connection
- Try a different USB port
- On Windows, check Device Manager for COM ports
- On macOS, look for
/dev/cu.usbmodem*entries
- Verify diodes are all oriented the same direction in the matrix
- Check that you're using
Serial.write()notSerial.println()in code
- Verify MIDI messages in MIDI Monitor or MIDI-OX first
- Ensure IAC/loopMIDI port is enabled in Hauptwerk settings
- Try using Hauptwerk's auto-detect feature for the pedalboard
- Increase
DEBOUNCE_MSvalue in sketch (try 10ms) - Check for loose wiring connections
organ-pedal-board/
├── README.md # This file
├── wiring-diagram.jpeg # Physical wiring reference
├── build_windows.bat # Windows build script
├── arduino/ # Arduino sketches
│ ├── pedalboard_midi/
│ │ └── pedalboard_midi.ino # Main Arduino MIDI sketch
│ └── pedal_test/
│ └── pedal_test.ino # Test sketch with Serial Monitor output
├── python/ # MIDI bridge software
│ ├── midi_bridge.py # Command-line MIDI bridge
│ └── midi_bridge_gui.py # GUI MIDI bridge (Mac/Windows)
├── releases/ # Compiled applications
│ └── Pedalboard-MIDI-Bridge-macOS.zip # Standalone Mac app
├── windows-build-instructions/ # Windows build guide
│ ├── BUILD-WINDOWS-APP.md # Detailed instructions
│ └── QUICK-COMMANDS.txt # Copy-paste commands
└── build-artifacts/ # PyInstaller build files
├── build/
├── dist/
└── Pedalboard MIDI Bridge.spec
If you want true plug-and-play USB-MIDI (no bridge software):
- Arduino Leonardo/Micro/Teensy: Use a USB-MIDI library with the same matrix code
- Uno 16U2 reflashing: Flash HIDUINO firmware via DFU mode (advanced)
For now, the serial bridge approach is simpler and requires no firmware modifications.
- Control-Surface Docs - Arduino MIDI library
- Hairless MIDI-Serial Bridge
- loopMIDI for Windows
- Apple IAC Driver Setup
- MIDI Monitor (macOS)
- MIDI-OX (Windows)
- QMK Matrix Scanning - Diode matrix explanation
- Hauptwerk
This project is open source. Feel free to modify and share!