MIDI Controller
DIY USB MIDI Controller
Author: Gheorghita Vlad-Gabriel
GitHub Project Link: link
Description
A custom USB MIDI controller built using a Raspberry Pi Pico 2W and tactile switches to detect and transmit MIDI signals (Note On/Off + Velocity) to a DAW using the USB MIDI protocol.
Motivation
As someone passionate about composing music and making beats, I've always been curious about how physical MIDI instruments work under the hood. Instead of buying an off-the-shelf MIDI controller, I decided to build one myself to combine my love for music with my skills in electronics and programming. This project allows me to deepen my understanding of how musical interfaces communicate with digital audio workstations and explore creative, cost-effective solutions for real-world problems.
Architecture
Log
Week 5 - 11 May
Week 12 - 18 May
Week 19 - 25 May
Hardware
The DIY MIDI controller is built around the Raspberry Pi Pico 2W.
Each of the 12 keys has 2 separate tactile switches (one for each of the elevated buttons), resulting in a total of 24 pins required to interface the buttons with the microcontroller. The elevation for each key is achieved using a female header, creating staggered button heights, so that one button is pressed before the other. The timing difference between the button presses is used to determine the velocity of the note.
The Raspberry Pi Pico 2W processes the signals and builds MIDI packets, which are then sent via USB to the DAW.
The controller also includes a potentiometer for filter control and a button to control octave switching and filter selection through a carousel-like menu. This menu is displayed on an integrated screen, allowing users to navigate settings with short and long presses.
Schematics
Bill of Materials
Device | Usage | Price |
---|---|---|
Raspberry Pi Pico 2W | Main and debug microcontroller | 79.32 RON |
Breadboard Kit HQ 830p | Prototyping and testing | 22.00 RON |
6 x 6 x 6 Push Button | Dual-switch per key for velocity detection | 10.80 RON |
100k Mono Potentiometer | Optional control knob for filter adjustments | 1.49 RON |
Universal PCB Prototype Board 8x12cm | Soldering base for final PCB | 7.98 RON |
Colored 40p 2.54 mm Pitch Male Pin Header | Wiring headers for connections | 1.98 RON |
20p Female Pin Header 2.54 mm | Wiring headers for connections | 12.27 RON |
4p Female Pin Header 2.54 mm | Wiring headers for connections | 0.98 RON |
[Screen] | For showing filter and octave menu | [TBD] |
Total | - | 136,82 RON + screen price |
Software
Library | Description | Usage |
---|---|---|
embassy-rp | Rust + async embedded | Framework for embedded applications using async features on the Raspberry Pi Pico 2W |
lcd1602-rs | Driver for 1602 LCD via embedded-hal | Display menu for filter and octave selection |
micromath | Embedded-friendly math library | Handle fast floating-point math for MIDI velocity calculations |
arrayvec | A vector with fixed capacity, backed by an array | Store MIDI data or signal samples efficiently in memory |
fixed | Fixed-point numbers | Optimize arithmetic for embedded systems |
biquad | Library for second-order IIR filters | Apply signal processing for audio filters |
usbd-midi | USB MIDI device class for usb-device | Handle MIDI communication over USB between the Pico and DAW |
midi-parser | MIDI message parser | Parse incoming MIDI messages if needed for MIDI control |
Links
- USB MIDI Specification
- embassy-rp: Rust + async for embedded
- lcd1602-rs: LCD1602 Driver for Pico
- micromath: Embedded-friendly math library
- arrayvec: A vector with fixed capacity
- fixed: Fixed-point numbers library
- biquad: Digital second-order IIR filters
- MIDI Protocol Reference
- usbd-midi
- Example project 1
- Example project 2