Welcome!
My GitHub name is rppicomidi because I like to develop MIDI projects for the Raspberry Pi Pico and Pico W.
This website will direct you to my software and hardware projects
for Bluetooth MIDI, USB MIDI, and old school serial port MIDI and to my software
libraries that the projects use for user interfaces, for Pico W Wi-Fi,
and for non-volatile storage. Most of the code is in C or C++.
What's New
22-Oct-2024 Updates
-
Applications updated to support Pico SDK 2.0
- midi2piousbhub
If you are running on a Pico-W board, you can now route Bluetooth Low Energy MIDI
(BLE-MIDI) clients (like iPads and computers) and servers (like control surfaces
and keyboards) the same way you route USB MIDI and serial port MIDI devices. Bluetooth is supported
using the CLI, which is accessible via the UART0 interface or via the USB device port
(USB CDC ACM).
- pico-w-ble-midi-lib
Added Bluetooth LE client capability include scan for advertising servers and connect
plus Bluetooth bonded device list management. The libraries have be updated to allow
you to switch between client and server mode within one application.
12-Jun-2024 Updates
-
There is a new application and a new driver:
- midi2piousbhub
Interconnect MIDI devices via a USB hub or old school MIDI. Configure the
interconnections using a serial port console and save the configurations as
presets in the Pico board's serial flash memory. Back up the presets to
USB flash. The USB MIDI host is implemented using the RP2040's PIO modules,
and the RP2040 native USB port is a USB device port that provides an additional
MIDI I/O port (to use a virtual instrument on an iPad, for example), and
a USB serial port for the command line interface.
- cdc_stdio_lib
Library allows a pico-sdk application that uses TinyUSB to add USB CDC stdio support.
For example, if you are using the RP2040's USB port as a USB MIDI device,
you can add a CDC class serial port interface as well. The stdio calls like printf
will route output to the USB port, etc. The
midi2piousbhub project
uses this library.
- To allow Arduino applications to have an easier time configuring MIDI libraries,
12-Feb-2024 Updates
-
Due to recent bug reports enumerating USB Audio+MIDI devices, I have increased
the default enumeration buffer size from 256 bytes 512 bytes, and I added a Troubleshooting
section to the README.md files for each of the following projects:
-
Removed an erroneous report on yesterday's entry for this web page about
a project that does not exist. Added an entry about an update to the
midi2usbhost
project.
11-Feb-2024 Updates
- usb_midi_host
Fixed a bug that prevented MIDI devices that are designed with high-speed
USB in mind from enumerating. The maximum full speed USB bulk transfer is
64 bytes. Two DSP guitar pedals assumed they were only hooking up to a high speed
capable host and specified a maximum bulk transfer of 512 bytes. The code
that attempted to correct this did not quite work. It is fixed now. Debugging
this issue revealed that the default enumeration buffer set by
CFG_TUH_ENUMERATION_BUFSIZE is too small to work with probably all
audio+MIDI devices like DSP guitar pedals. Future versions of the C/C++
examples will likely bump up CFG_TUH_ENUMERATION_BUFSIZE to 512 bytes.
Arduino examples require some hacking of the Adafruit TinyUSB Library.
See the project's README file for more details.
- usb_midi_host
This driver has the examples and documentation updated for use with either
the pico-sdk or the Arduino IDE. Further, the examples will work with either
the native RP2040 USB hardware or with a PIO USB host port. (Arduino sketches
require the Adafruit TinyUSB Library) You can load this library using the
Arduino Library Manager.
- EZ_USB_MIDI_HOST
This C++ library code that lets Arduino sketches and C/C++ programs use the
Arduino MIDI Library with the usb_midi_host library and the TinyUSB Library
(Arduino sketches require the Adafruit TinyUSB Library) You can load this
library using the Arduino Library Manager.
- midi2usbhost
This project now supports a C code version and an Arduino version. Build the
C code version with the pico-sdk. The Arduino sketch uses the Arduino IDE and the
EZ_USB_MIDI_HOST
library to do the work. The code is designed to run on a Raspberry Pi Pico board,
but it should work on any RP2040 type board with minor modifications.
24-Oct-2023 Updates
- midi_uart_lib
has been updated to move ring_buffer_lib to a peer subdirectory instead of
a sub-directory of midi_uart_lib. This makes it simpler to coexist with
ble-midi2usbhost,
and pio_midi_uart_lib.
I have updated the following project that use midi_uart_lib so they still build.
- pio_midi_uart_lib
documentation has been updated to describe the output only MIDI port feature and to
point to the midi-multistream2usbdev
example.
21-Aug-2023 Updates
- usb_midi_host
An application level USB MIDI Host driver for TinyUSB. On 15-Aug-2023, TinyUSB
was updated to include support for USB Host drivers added at the application
level. I created usb_midi_host so I could avoid requiring people to use a
forked version of TinyUSB to build my projects.
- Several projects updated to use usb_midi_host and standard TinyUSB instead of
my forked version of TinyUSB.
26-Jul-2023 Updates
- pico-w-ble-midi-lib
A MIDI 1.0 Bluetooth LE GATT service server. Used with the following 2 applications.
- pico-w-ble-midi-server-demo
A Bluetooth LE MIDI 1.0 server peripheral demo for the Raspberry Pi Pico W. It uses a command line
interface to send and recieve Bluetooth LE MIDI data. It also demonstrates using
pico-w-ble-midi-lib
- ble-midi2usbhost
A Pico W Bluetooth LE MIDI adapter for any class compliant USB MIDI device. With only a few
connectors and a power supply you connect any USB MIDI Controller or Synthesizer
to a phone, tablet or computer using Bluetooth instead of USB.
It also demonstrates using
pico-w-ble-midi-lib
8-May-2023 Updates
- pio_midi_uart_lib
Add support for using the PIO state machines for MIDI Out only mode.
- midi-multistream2usbdev
This new project is designed to give your PC, Mac, etc. a 2 input 6 output USB to 5-pin DIN MIDI
interface. It includes files
midi_device_multistream.c/h
that show how to use the
tinyusb library to build a USB MIDI device with more than one virtual MIDI cable per USB endpoint.
It also demonstrates using pio_midi_uart_lib
in both MIDI UART mode and MIDI Out only mode.
07-Apr-2023 Updates
- pico-usb-host-msc-demo
Changed build methods, added code and fixed CMake bugs to allow Pico W builds to coexist
with using the
Pico-PIO-USB
project for the USB Host port
- pico-mc-display-bridge
Made the
pico_pico_midi_lib
submodule project public and fixed other issues such
that it should be possible now for people other than me to build the code. Please file an
issue if you have any trouble building the code, missing files, etc.
- pico-ssd1306-mono-graphics-lib
Now the library will properly claim PIO State Machines so that the PIO units may be shared more easily
25-Mar-2023 Updates
-
Fixed the CLI for builds that do not use the DEBUG option. By default,
the pico-sdk command line build will not use the DEBUG option. I did not
realize that because I use VisualStudio Code IDE for development; the
default is the DEBUG option. Without debug, the
assert
macro
was not generating code for the CLI commands, so no commands were being
added to the CLI. The symptom is typing help
and only
seeing the help
command as an option.
The following projects had this bug and should be fixed.
The following projects have this bug and are not fixed yet. I hope to get to it soon. In
the meantime, please run cmake
with DEBUG enabled (i.e. cmake -DCMAKE_BUILD_TYPE=Debug ..
)
to build the following projects
-
Updated the tinyusb library version to use with the following projects
MIDI Projects
- pico-w-ble-midi-server-demo
A Bluetooth LE MIDI 1.0 server peripheral demo for the Raspberry Pi Pico W.
- ble-midi2usbhost
A Pico W Bluetooth LE MIDI adapter for any class compliant USB MIDI device.
- midi2usbhost
Add old school MIDI IN and MIDI OUT to a MIDI device with a USB B device port.
- midi2usbdev
Create a PC, Mac, etc. MIDI interface with one MIDI IN and one MIDI OUT.
- midi-multistream2usbdev
Create a PC, Mac, etc. 2 input 6 output USB to 5-pin DIN MIDI interface. Mac, iOS/iPadOS,
and Linux software will show the MIDI port names MIDI IN A, MIDI IN B, MIDI OUT A, MIDI OUT B,
..., MIDI OUT E, MIDI OUT F.
- midi2usbhub
Interconnect MIDI devices via a USB hub or old school MIDI. Configure the
interconnections using a serial port console and save the configurations as
presets in the Pico board's serial flash memory. Back up the presets to
USB flash. The USB MIDI host is implemented using the RP2040's native USB
hardware.
- midi2piousbhub
Interconnect MIDI devices via a USB hub, Bluetooth Low Energy MIDI or old school MIDI. Configure the
interconnections using a serial port console and save the configurations as
presets in the Pico board's serial flash memory. Back up the presets to
USB flash. The USB MIDI host is implemented using the RP2040's PIO modules,
and the RP2040 native USB port is a USB device port that provides an additional
MIDI I/O port (to use a virtual instrument on an iPad, for example), and
a USB serial port for the command line interface.
- pico-usb-midi-filter
Connect a Raspberry Pi Pico between a USB MIDI device and a USB Host to modify the USB MIDI traffic.
The filtering is determined in the source code. The USB descriptor of the attached device is not
changed.
-
pico-usb-midi-processor
Like pico-usb-midi-filter, except it has an OLED display and buttons for configuring what
processing to perform, it has up to 8 presets per device, and it allows you to save
presets to a USB flash drive.
-
midi2usbhub-web. The same as midi2usbhub, except it uses PIO for 2 serial MIDI ports and it
adds an embedded webserver UI for configuring routing and an OLED screen+USB keyboard UI for setting up
Wi-Fi and recalling presets.
- pico-mc-display-bridge
Insert this project between the USB host and any Mackie Control compatible USB MIDI controller
to get Mackie Control text display, VPot LED and signal meter for each channel strip,
a timecode display, a VPot mode display, some additional
per channel strip buttons, and other special function buttons.
MIDI-related Software Libraries
-
midi_uart_lib
Library for using Raspberry Pi Pico UART1 or both UART0 and UART1 for serial port MIDI.
Uses ring_buffer_lib
to add user-configurable deep FIFOs.
-
pio_midi_uart_lib
Library adds up to 4 PIO-based UARTs configured for MIDI to a Rasberry Pi Pico or
Pico W. The MIDI OUT transmitter is open-drain, so it interfaces better with the
MIDI OUT circuit than the built-in UART. The MIDI IN only interrupts and enques
data received with no error. Uses ring_buffer_lib
to add user configurable deep FIFOs.
- pico-w-ble-midi-lib
A MIDI 1.0 Bluetooth LE GATT service server and client.
-
fork of tinyusb This was as far as I know the first public
USB MIDI Host driver for the Raspberry Pi Pico. It has been superceded for most uses by
this pull request that better uses the built-in hardware for bulk endpoint transfers
and also fixes bugs that were preventing the driver from supporting USB hubs. However, this fork
does contain hooks for caching the USB device descriptor of attached USB devices; these hooks allow
the pico-usb-midi-filter and
pico-usb-midi-processor projects
to make the USB descriptor on the Pico's device port exactly the same as the USB descriptor of the
MIDI device attached to the Pico-PIO-USB host port. If the TinyUSB project merges a pull reequest
for the USB MIDI Host driver, this fork will be mostly unnecessary.
Other Software Libraries
SSD1306 OLED UI
-
pico-ssd1306-mono-graphics-lib
Raspberry Pi Pico SSD1306 graphics library that can manage multiple displays at the same time. The drivers
are non-blocking and optimized for speed. They only redraw the parts of the display that need to be redrawn.
You can update 9 displays simultaneously every 23ms or so. The library supports drawing dots, lines, rectangles
(filled or unfilled), circles (filled or unfilled) and fixed-pitch characters 8pt, 12pt, 16pt or 24pt. It
supports clipping rectangles, 0, 90, 180 and 270 screen rotation. It can generate screen dumps. The library
works without RTOS support.
-
pico-mono-ui-lib
A simple monochrome UI library for a small mono screen and the Raspberry Pi Pico. This library supports
multiple screen navigation, scrollable menus, button navigation, HID keyboard navigation, text entry,
and number adjustment menu items. Values modified in the UI can be serialized to JSON.
Non-volatile storage
-
fork of littlefs-lib
This fork modified the Pico littlefs-lib to add support for running littlefs
on RP2040 core 0 whilst core 1 is also active doing something else.
Misc
-
pico-c-utilities
A collection of C & C++ functions for console I/O and other useful things for the Raspberry Pi Pico.
This library right now only has one function in it: int getsn(char* cp, int size).
- pico-usb-host-msc-demo
Demo code provides a command line interface for managing up to 4 USB Mass Storage Class
devices connected via a USB hub to a single Pico or Pico W. The code is different from
the MSC demo provided with the tinyusb stack.
- cdc_stdio_lib
Library allows a pico-sdk application that uses TinyUSB to add USB CDC stdio support.
For example, if you are using the RP2040's USB port as a USB MIDI device,
you can add a CDC class serial port interface as well. The stdio calls like printf
will route output to the USB port, etc.
Other Projects
Most of these are simple demo programs for testing libraries.
Check out
my GitHub site to see for yourself.