Firmware for a Raspberry Pi Pico–class board that shows up as a USB MIDI device and sends MIDI CC messages from three analog potentiometers.
This project uses the Raspberry Pi Pico SDK + TinyUSB (device stack).
- Enumerates as a USB MIDI controller
- Reads 3 ADC inputs and converts them to 7-bit CC values (0–127)
- Sends Control Change messages (channel 1 by default)
- Uses the on-board LED as a simple status/activity indicator
Any RP2040/RP2350 board supported by the Pico SDK + TinyUSB should work (for example: Pico, Pico W, Pico 2, etc.).
This firmware reads three pots on:
| Pot | GPIO | ADC channel | Default CC |
|---|---|---|---|
| 1 | 26 | ADC0 | CC1 (Mod Wheel) |
| 2 | 27 | ADC1 | CC74 |
| 3 | 28 | ADC2 | CC71 |
Make sure your pot wiring matches your board’s ADC pinout and reference voltage requirements.
The USB descriptors currently report:
- Manufacturer:
Khekhowich - Product:
Khekhowich MIDI Controller
(See usb_descriptors.c if you want to change the strings, VID/PID, etc.)
You’ll need:
- Raspberry Pi Pico SDK set up locally
- A working ARM GCC toolchain (as required by the Pico SDK)
- CMake (3.20+) and a generator (Ninja recommended)
Environment variable used by this repo:
PICO_SDK_PATH-> path to your pico-sdk checkout
This repo includes CMakePresets.json. If your SDK is at C:/pico-sdk, you can build with presets:
cmake --preset pico2-release
cmake --build --preset pico2-build-releaseArtifacts will be placed in the build/ directory (including a .uf2).
export PICO_SDK_PATH=/path/to/pico-sdk
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build buildAfter a successful build, you’ll get a .uf2 file in build/ (exact name depends on your target).
- Hold BOOTSEL button on Pico 2.
- Plug the board in over USB and then release the button.
- Copy the
.uf2file to the mounted USB drive - The board reboots and should appear as a USB MIDI device
Edit the CC mapping in main.c:
static const uint8_t POT_CC[3] = { 1, 74, 71 };Also in main.c:
EMA_SHIFTcontrols smoothing (higher = smoother/slower)CC_STEPadds hysteresis (reduces jitter)SEND_PERIOD_MSrate-limits per knob
If the device does not enumerate:
- Confirm you built for the correct board/target
- Verify TinyUSB is enabled and your Pico SDK setup is correct
If values jitter:
- Increase
EMA_SHIFTand/orCC_STEP - Check pot wiring and grounding
If MIDI messages don’t show up:
- Confirm your DAW/app is listening to the correct MIDI input
- Try a generic MIDI monitor utility to verify CC output
main.c- application logic (ADC -> MIDI CC)tusb_config.h- TinyUSB configuration (derived from upstream)usb_descriptors.c- USB device/config/string descriptors (derived from upstream)CMakeLists.txt,CMakePresets.json- build configuration
This repository is licensed under the MIT License (see LICENSE).
This repo includes files derived from TinyUSB / Pico SDK examples, which are also MIT-licensed:
tusb_config.h- Copyright (c) 2019 Ha Thach (tinyusb.org)usb_descriptors.c- Copyright (c) 2019 Ha Thach (tinyusb.org)
Their original license headers are preserved in those files, as required by the MIT License.
- TinyUSB by Ha Thach and contributors
- Raspberry Pi Pico SDK