Skip to main content
Version: ACS CC

MIDI Controller

DIY USB MIDI Controller

info

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

Block Diagram

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

Schematic

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2WMain and debug microcontroller79.32 RON
Breadboard Kit HQ 830pPrototyping and testing22.00 RON
6 x 6 x 6 Push ButtonDual-switch per key for velocity detection10.80 RON
100k Mono PotentiometerOptional control knob for filter adjustments1.49 RON
Universal PCB Prototype Board 8x12cmSoldering base for final PCB7.98 RON
Colored 40p 2.54 mm Pitch Male Pin HeaderWiring headers for connections1.98 RON
20p Female Pin Header 2.54 mmWiring headers for connections12.27 RON
4p Female Pin Header 2.54 mmWiring headers for connections0.98 RON
[Screen]For showing filter and octave menu[TBD]
Total-136,82 RON + screen price

Software

LibraryDescriptionUsage
embassy-rpRust + async embeddedFramework for embedded applications using async features on the Raspberry Pi Pico 2W
lcd1602-rsDriver for 1602 LCD via embedded-halDisplay menu for filter and octave selection
micromathEmbedded-friendly math libraryHandle fast floating-point math for MIDI velocity calculations
arrayvecA vector with fixed capacity, backed by an arrayStore MIDI data or signal samples efficiently in memory
fixedFixed-point numbersOptimize arithmetic for embedded systems
biquadLibrary for second-order IIR filtersApply signal processing for audio filters
usbd-midiUSB MIDI device class for usb-deviceHandle MIDI communication over USB between the Pico and DAW
midi-parserMIDI message parserParse incoming MIDI messages if needed for MIDI control
  1. USB MIDI Specification
  2. embassy-rp: Rust + async for embedded
  3. lcd1602-rs: LCD1602 Driver for Pico
  4. micromath: Embedded-friendly math library
  5. arrayvec: A vector with fixed capacity
  6. fixed: Fixed-point numbers library
  7. biquad: Digital second-order IIR filters
  8. MIDI Protocol Reference
  9. usbd-midi
  10. Example project 1
  11. Example project 2