
As I continue exploring MIDI on Arduino wth 32bit processors like the RP2350, it's clear that there are a lot of people interested in and working on sound and music applications with microcontrollers, including Phil Schatzman (Arduino MIDI, Arduino Audio Tools, and Synthesis Toolkit). While many of his projects don't use TinyUSB under-the-hood, his latest release, USB Audio Class 2.0, does. (GitHub)
So, while TinyUSB underlies a lot of audio / music projects with Arduino, it is a complicated library and difficult to get one's head around. And beyond library, USB, by itself is pretty complicated. Back in the late 1990s my friends and I considered using USB for a video camera in a robotics project, but we stuck with a 25-pin "parallel port" instead because it was simpler. Today, we take USB for granted because it's everywhere but we ignore the fact that there is a lot of software smarts allowing for it to work so well. When programming an embedded system to use USB, we have to consider the details that regular people don't. So before looking at MIDI travelling over USB, let's just get some USB basics running.
I'm assuming that you've downloaded the Adafruit TinyUSB implementation on to your Arduino IDE. Then, select your board and the USB port that it's coming in through (or identified on). As shown above, you also need to explicitly select to use the TinyUSB stack as opposed to any other USB stack that may have been selected by default by the IDE.
Let's try something really simple (at least on the surface). Since all USB devices have identification information associated with them, like a manufacturer's name, let's modify that so that the computer thinks that it's made by "Acme Corporation":
// Bring in the TinyUSB variant by Adafruit.
#include "Adafruit_TinyUSB.h"
void setup() {
// Start up TinyUSB on the Arduino (RP2350)
if(!TinyUSBDevice.isInitialized()){
TinyUSBDevice.begin(0);
}
// Rename the manufacturer so that your computer sees it as from ACME Corp.
TinyUSBDevice.setManufacturerDescriptor("ACMECorp");
}
void loop() {
// put your main code here, to run repeatedly:
// nothing in the loop... for now.
}
Compile, then upload to the board. Then, go into the system settings for your computer and get a report as to what is connected on the USB bus of the computer. In my case, it comes up like this:

And there we have it. A simple TInyUSB application on an Arduino-compatible microcontroller. In reality, the application is complex but that complexity is hidden by TinyUSB and the implementation by Adafruit.

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.
