MIDI Projects with MicroPython
Welcome to the MIDI Projects Section
MIDI is the language that musical instruments use to talk to each other.
With a Raspberry Pi Pico and a few components, you can build your own
MIDI instrument, controller, or sequencer. Let's build something amazing!
What Is MIDI?
MIDI stands for Musical Instrument Digital Interface. It is a standard protocol that lets electronic instruments, computers, and controllers communicate.
MIDI does not send audio — it sends instructions, like: - "Play note 60 (Middle C) at volume 80" - "Stop note 60" - "Change to instrument 25 (steel guitar)"
These instructions are called MIDI messages. A synthesizer or software (like GarageBand or a DAW) receives the messages and produces the actual sound.
Key Idea
Think of MIDI like sheet music. The sheet music tells a musician what notes
to play, but the musician (synthesizer) decides what it sounds like. MIDI
separates the instructions from the sound.
MIDI on the Raspberry Pi Pico
The Pico can send MIDI messages over its UART serial port at the standard MIDI baud rate of 31 250 bits per second.
To send MIDI to external gear, you need: - A MIDI output circuit (an optocoupler and resistors, or a ready-made board) - A 5-pin DIN MIDI cable
For beginners, the easiest approach is to use USB MIDI by connecting the Pico directly to a computer. The computer sees the Pico as a USB MIDI device.
MIDI Hardware Options
| Option | Cost | Notes |
|---|---|---|
| Direct UART (serial MIDI) | ~$1 in parts | Needs optocoupler circuit |
| PicoMIDI Development Board (Midimuso) | ~$20 | All-in-one board with DIN connectors |
| USB MIDI (software only) | $0 | Pico W firmware needed |
Projects in This Section
| Project | What You Build |
|---|---|
| MIDI Basics | Send ascending MIDI notes over UART |
| Chromatic Scale | Play every note in one octave on a MIDI synth |
| Piano Keyboard | 13 buttons that play a full octave |
| MIDI Sequencer | A looping pattern of notes |
Quick Start: Play a Note Over UART
You need: 1. Raspberry Pi Pico 2. MIDI output circuit connected to GP4 (TX1) 3. MIDI synthesizer or computer with a soft synth
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
MIDI Note Numbers
MIDI uses numbers 0–127 for notes. Middle C is note number 60:
| Note | MIDI number |
|---|---|
| C4 (Middle C) | 60 |
| D4 | 62 |
| E4 | 64 |
| F4 | 65 |
| G4 | 67 |
| A4 (440 Hz) | 69 |
| B4 | 71 |
| C5 | 72 |
Monty's Tip
You can test MIDI without any hardware by installing a free software
synthesizer on your computer, such as VirtualMIDISynth (Windows) or
using the built-in IAC Driver (Mac). Connect the Pico via USB and the
computer will receive your MIDI messages as if from a keyboard.