There are plenty of ways to develop MIDI 1.0 applications on microcontrollers, such as the well-respected non-TinyUSB MIDI 1.0 library by Fourty Seven Effects library. That's great for general Arduino projects. However, here we're going to to continue in the direction we started in Part 1 and Part 2 of this blog series -- so now we're going to look into using Earle's MIDI examples that leverage TinyUSB to implement MIDI 1.0 on the RP2040 and RP2350.
Pico SDK MIDI 1.0 Examples (including TinyUSB)
The following are examples for creating a MIDI 1.0 session on the RP2350 using the Pico SDK. Remember that the inclusion of Pico SDK's MIDIUSB.h or USB.h will also include the TinyUSB library.
As discussed on the GitHub page, Pico SDK's MIDIUSB is a fork of the Arduino-libraries/MIDIUSB for the RP2040 and RP2350 and, unlike the general main library, leverages TinyUSB.
Phil Schatzmann's MIDI 1.0 Example (2021)
Phil Schatzmann has done some really interesting audio / MIDI work and wrote up an example on his MIDI 1.0 page, dates back to 2021
#include "Arduino.h"
#include "USB.h"
USBMidi midi = USBMidi::instance();
int note;
void setup() {
Serial1.begin();
midi.begin();
Serial1.println("setup ended");
}
void loop() {
midi.noteOff(note);
note = 58 + rand() % 14;
Serial1.print("playing note ");
Serial1.println(note);
midi.noteOn(note);
delay(1000);
}
Disappointingly, in 2026, it doesn't compile with the Arduino 2 IDE. It likely did back in 2021 but the software libraries it depends on are a moving target, so time to look at alternatives and maybe update his example based on the current state of the USB and MIDI libraries.
Earle Philhower MIDI Write Example
Earle Philhower has done a lot of work on the Pico SDK, including updating the MIDI elements to take advantage of TinyUSB. His MIDI 1.0 Write example does work. The Multitrack Studio Lite application picked up the single note being sent, over and over, as shown below.

Back to Schatzmann's example
The fix for the first example is straight-forward based on Earle's example because we take advantage of the MidiUSB.sendMIDI() method in Pico SDK's MIDIUSB.h
// SchatzmannMIDIEx1_update.ino
//
// Phil's example (modified based on Earle's MIDI 1.0 out example)
//
// https://www.pschatzmann.ch/home/2021/02/15/usb-midi-on-the-arduino-pico/
#include "Arduino.h"
#include "MIDIUSB.h" //#include "USB.h"
//USBMidi midi = USBMidi::instance();
void setup() {
//Serial.tud_cdc_line_coding_cb(uint8_t itf, const void *p_line_coding)
Serial.begin(115200);
}
void loop() {
// Set the channel, pitch (randomly) and velocity for the note.
uint8_t channel = 0;
uint8_t pitch = 58 + rand() % 14;
uint8_t velocity = 64;
/* note off*/
midiEventPacket_t noteOff = {0x08, (uint8_t)(0x80 | channel), pitch, velocity};
MidiUSB.sendMIDI(noteOff);
/* note on */
delay(500);
midiEventPacket_t noteOn = {0x09, (uint8_t)(0x90 | channel), pitch, velocity};
MidiUSB.sendMIDI(noteOn);
delay(500);
}
Looking through the current state of the Pico SDK, it's clear that the sendMIDI() method uses the MIDI_.writePacket() method which, itself, leverages TinyUSB's tud_midi_packet_write() method.
Conclusion
Within the Arduino framework the Pico SDK is capable of basic MIDI 1.0 transmission and leverages TinyUSB to do so.
Next: More USB with TinyUSB and the Pico SDK
Okay, so we're confirming the importance of TinyUSB for Arduino programming with the Pico SDK, even without the Adafruit implementation of TinyUSB. Next, in Part 4 and beyond, let's look at more of Earle's MIDI 1.0 examples, as well as other typical USB applications (CDC, HDI, etc.) that work with the Pico SDK and TinyUSB.

James Andrew Smith is a Professional Engineer and Associate Professor in the Electrical Engineering and Computer Science Department of York University’s Lassonde School, with degrees in Electrical and Mechanical Engineering from the University of Alberta and McGill University. Previously a program director in biomedical engineering, his research background spans robotics, locomotion, human birth, music and engineering education. While on sabbatical in 2018-19 with his wife and kids he lived in Strasbourg, France and he taught at the INSA Strasbourg and Hochschule Karlsruhe and wrote about his personal and professional perspectives. James is a proponent of using social media to advocate for justice, equity, diversity and inclusion as well as evidence-based applications of research in the public sphere. You can find him on Twitter. You can find him on BlueSky. Originally from Québec City, he now lives in Toronto, Canada.
