# USB MIDI Host Messenger

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/130/816/medium800/hacks_host-9790b.jpg?1718806985)

https://youtu.be/nuCQyhRjh_M

Ever wanted to plug your modern, USB-only MIDI keyboard into a synth that only has a classic DIN-5 or TRS 3.5mm MIDI input but you can't? Shouldn't there be a simple cable to convert USB to classic MIDI? It turns out, hosting a USB device is difficult, but you can build the USB MIDI Host Messenger to solve this key problem!

The USB MIDI Host Messenger solves the problem of how to connect USB MIDI keyboards and other controllers with classic synths and drum machines without inserting a whole dang computer in the middle. Plus, you can use it to filter MIDI messages in order to re-map MIDI channels, expand your Program Change choices, and spy on CC values.

The USB Host Feather RP2040 takes care of it all, running a single Arduino sketch. You can even build upon the code further to add more features such as CC re-mapping, note scale quantization, keyboard splitting, or even even build chord modes and arpeggiators.

![](https://cdn-learn.adafruit.com/assets/assets/000/130/818/medium800/hacks_host-9870c.jpg?1718807686)

## Parts
### Adafruit Feather RP2040 with USB Type A Host

[Adafruit Feather RP2040 with USB Type A Host](https://www.adafruit.com/product/5723)
You're probably really used to microcontroller boards with USB, but what about a dev board with two? Two is more than one, so that makes it twice as good! And the&nbsp; **Adafruit Feather RP2040 with USB Host** is **&nbsp;** definitely double-the-fun of our other Feather...

In Stock
[Buy Now](https://www.adafruit.com/product/5723)
[Related Guides to the Product](https://learn.adafruit.com/products/5723/guides)
![Angled shot of black rectangular microcontroller with USB C and USB A connectors at both ends.](https://cdn-shop.adafruit.com/640x480/5723-00.jpg)

### Adafruit MIDI FeatherWing Kit

[Adafruit MIDI FeatherWing Kit](https://www.adafruit.com/product/4740)
Turn your Feather into a song-bird with this musically-enabled FeatherWing that adds MIDI input and output jacks to just about any Feather. You get both input and output DIN-5 MIDI jacks, a 3V optically isolator so you can interface with MIDI on 3.3V logic/power microcontrollers, and two...

In Stock
[Buy Now](https://www.adafruit.com/product/4740)
[Related Guides to the Product](https://learn.adafruit.com/products/4740/guides)
![Angled shot of a Adafruit MIDI FeatherWing Kit. ](https://cdn-shop.adafruit.com/640x480/4740-04.jpg)

### Assembled Adafruit FeatherWing OLED

[Assembled Adafruit FeatherWing OLED](https://www.adafruit.com/product/3045)
A Feather board without ambition is a Feather board without FeatherWings! This is the **Assembled FeatherWing OLED** : it adds a 128x32 monochrome OLED plus 3 user buttons to _any_ Feather main board. Comes fully assembled so you can connect a FeatherWing on top of your...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3045)
[Related Guides to the Product](https://learn.adafruit.com/products/3045/guides)
![Angled shot of black, rectangular, OLED display breakout with headers.](https://cdn-shop.adafruit.com/640x480/3045-07.jpg)

### Adafruit Quad 2x2 FeatherWing Kit with Headers

[Adafruit Quad 2x2 FeatherWing Kit with Headers](https://www.adafruit.com/product/4253)
This is the **FeatherWing Quad 2x2** - a prototyping add-on and more for all Feather boards. This is similar to our [FeatherWing Proto](https://www.adafruit.com/products/2884) except there are four! The magic of the Quad comes when you want to connect your Feather to...

In Stock
[Buy Now](https://www.adafruit.com/product/4253)
[Related Guides to the Product](https://learn.adafruit.com/products/4253/guides)
![Angled shot of a Adafruit Quad 2x2 FeatherWing Kit with Headers installed. ](https://cdn-shop.adafruit.com/640x480/4253-02.jpg)

### Breadboard-friendly SPDT Slide Switch

[Breadboard-friendly SPDT Slide Switch](https://www.adafruit.com/product/805)
These nice switches are perfect for use with breadboard and perfboard projects. They have 0.1" spacing and snap in nicely into a solderless breadboard. They're easy to switch no matter what size fingers you have, but not so easy that they'll get flipped by accident. Work great as...

In Stock
[Buy Now](https://www.adafruit.com/product/805)
[Related Guides to the Product](https://learn.adafruit.com/products/805/guides)
![Small, black, SPDT slide switch.](https://cdn-shop.adafruit.com/640x480/805-03.jpg)

### Part: Lithium Ion Polymer Battery
quantity: 1
3.7v 2500mAh
[Lithium Ion Polymer Battery](https://www.adafruit.com/product/328)

### Part: Black Nylon Machine Screw and Stand-off Set
quantity: 1
M2.5 Thread
[Black Nylon Machine Screw and Stand-off Set](https://www.adafruit.com/product/3299)

### Part: Little Rubber Bumper Feet
quantity: 1
Pack of 4
[Little Rubber Bumper Feet](https://www.adafruit.com/product/550)

# USB MIDI Host Messenger

## Arduino IDE Setup

The [**Arduino**  **Philhower core**](https://github.com/earlephilhower/arduino-pico) provides support for RP2040 microcontroller boards. This page covers getting your Arduino IDE set up to include your board.

## Arduino IDE Download

The first thing you will need to do is to download the latest release of the Arduino IDE. The Philhower core requires **version 1.8** &nbsp;or higher.

[Arduino IDE Download](https://www.arduino.cc/en/software)
Download and install it to your computer.

Once installed, open the Arduino IDE.

## Adding the Philhower Board Manager URL

In the Arduino IDE, navigate to the **Preferences** window. You can access it through **File \> Preferences** on Windows&nbsp;or&nbsp;Linux, or **Arduino \> Preferences** on OS X.

The **Preferences** window will open.

In the **Additional Boards Manager URLs** field, you'll want to add a new URL. The list of URLs is comma separated, and&nbsp;_you will only have to add each&nbsp;URL once._ The URLs point to index files that the Board Manager uses to build the list of available & installed boards.

Copy the following URL.

`https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json`

Add the URL to the the **Additional Boards Manager URLs** field (highlighted in red below).

![](https://cdn-learn.adafruit.com/assets/assets/000/107/121/medium800/rp2040_arduino_ide_setup_Arduino_Template_preferences_window.png?1638917398)

Click **OK** to save and close **Preferences**.

## Add Board Support Package

In the Arduino IDE, click on **Tools \> Board \> Boards Manager**. If you have previously selected a board, the **Board** menu item may have a board name after it.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/260/medium800/arduino_compatibles_Untitled1b.png?1759870723)

In the **Boards Manager** , search for RP2040. Scroll down to the **Raspberry Pi Pico/RP2040/RP2350 by Earle F Philhower, III** entry. Click **Install** to install it. If it was previously installed, look to make sure you have the latest version.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/261/medium800/arduino_compatibles_b.png?1759870757)

Warning: 

Once installation is complete, click **Close** to close the Boards Manager.

## Choose Your Board

In the **Tools \> Boards** menu, you should now see **Raspberry Pi RP2040 Boards** (possibly followed by a version number).

![](https://cdn-learn.adafruit.com/assets/assets/000/140/259/medium800/arduino_compatibles_Untitled1a.png?1759870630)

Navigate to the **Raspberry Pi Pico RP2040/RP2350** menu. You will see the available boards listed.

Navigate to the&nbsp; **Raspberry Pi RP2040 Boards&nbsp;** menu and choose&nbsp; **Adafruit Feather RP2040 USB Host**.

![](https://cdn-learn.adafruit.com/assets/assets/000/120/447/medium800/hacks_usbHostBoard.jpg?1682364973)

Danger: 

Now you're ready to begin using Arduino with your RP2040 board!

## Troubleshooting

If you have any strange errors after updating the **Raspberry Pi Pico/RP2040 by Earle F Philhower, III** board support package (BSP) from the boards manager you may need to start with a fresh install of the BSP. Close out of the Arduino IDE and navigate to your Arduino packages folder: **C:\Users\[username]\AppData\Local\Arduino15\packages&nbsp;**and delete the **/rp2040** folder. After that, open the Arduino IDE and follow the steps above for installing the BSP. The errors should not occur.&nbsp;

# USB MIDI Host Messenger

## Arduino Usage

Now that you've set up the Arduino IDE with the Philhower RP2040 Arduino core, you're ready to start using Arduino with your RP2040.

## RP2040 Arduino Pins

There is no pin remapping for Arduino on the RP2040. Therefore, the pin names on the top of the board are **not** the pin names used for Arduino. The Arduino pin names are the RP2040 GPIO pin names.

To find the Arduino pin name, check the PrettyPins diagram found on the Pinouts page. Each GPIO pin in the diagram has a&nbsp; **GPIOx** &nbsp;pin name listed, where&nbsp; **x** &nbsp;is the pin number. The Arduino pin name is the number following&nbsp; **GPIO**. For example,&nbsp; **GPIO1&nbsp;** would be Arduino pin&nbsp;`1`.

The Feather RP2040 USB Host has the GPIO pin names listed on the back of the board as **x** , where&nbsp; **x** &nbsp;is the pin number.&nbsp;So, for example, pin **5** &nbsp;would be Arduino pin `5`.

## Choose Your Board

Navigate to the **Tools \> Boards \>**  **Raspberry Pi RP2040 Boards** menu. The Raspberry PI RP2040 Boards menu name may be followed by a version number.

Choose&nbsp; **Feather RP2040 USB Host** &nbsp;from the menu.

![](https://cdn-learn.adafruit.com/assets/assets/000/120/448/medium800/hacks_usbHostBoard.jpg?1682365134)

## Load the Blink Sketch
Begin by plugging in your board to your computer, and wait a moment for it to be recognised by the OS. It will create a COM/serial port that you can now select from the **Tools \> Port** menu dropdown.

Open the Blink sketch by clicking through **File \> Examples \> 01.Basics \> Blink**.

![](https://cdn-learn.adafruit.com/assets/assets/000/140/281/medium800/arduino_compatibles_blink.png?1759934058)

Click Upload. A successful upload will result in text similar to the following.

![](https://cdn-learn.adafruit.com/assets/assets/000/107/151/medium800/rp2040_arduino_usage_Arduino_Template_RP2040_successful.png?1638996375)

Once complete, the little red LED will begin blinking once every second! Try changing up the `delay()` timing to change the rate at which the LED blinks.

## Manually Enter the Bootloader

If you get into a state with the bootloader where you can no longer upload a sketch, or you have uploaded code that crashes and doesn't auto-reboot into the bootloader, you may have to manually enter the bootloader.

To enter the bootloader, hold down the **BOOT**** &nbsp;button**, and while continuing to hold it (don't let go!), press and release the&nbsp;**reset button **.&nbsp;** Continue to hold the BOOT button until the RPI-RP2 drive appears!**

Once the RPI-RP2 drive shows up, your board is in bootloader mode. There will not be a port available in bootloader mode, this is expected.

Once you see RPI-RP2 drive, make sure you are no longer holding down any buttons (reset or boot0 button).

Now, click Upload on your sketch to try again.

# USB MIDI Host Messenger

## Code the Messenger

The Arduino code for the project is available as a pre-compiled .UF2 file that you can drag and drop onto your USB Host Feather RP2040 board.

[USB_MIDI_Host_Messenger_Arduino.uf2](https://cdn-learn.adafruit.com/assets/assets/000/130/741/original/USB_MIDI_Host_Messenger_Arduino.uf2?1718720196)
## Load the UF2

**Click the link above to download the UF2 file.**

Save it wherever is convenient for you.

![hacks_uf2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/742/medium640/hacks_uf2.jpg?1718720373)

To enter the bootloader, hold down the&nbsp; **BOOT**** &nbsp;button**, and while continuing to hold it (don't let go!), press and release the&nbsp;**reset button **.&nbsp;** Continue to hold the BOOT button until the RPI-RP2 drive appears!**

Once you see **RPI-RP2** drive, release the BOOT button. You should longer be holding down any buttons (reset or boot0 button).

You will see a new disk drive appear called&nbsp; **RPI-RP2&nbsp;**

Drag the **USB\_MIDI\_Host\_Messenger\_Arduino.uf2** &nbsp;file to **RPI-RP2&nbsp;**

This will take a few moments and then the board will restart -- the **RPI-RP2** drive will disappear from your computer's list of drives and then the code will run on the Feather.

![hacks_drive.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/743/medium640/hacks_drive.jpg?1718720707)

## Customize

If you'd like to look at the code or customize it further, you can download the Arduino sketch file below.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/USB_MIDI_Host_Messenger/USB_MIDI_Host_Messenger.ino

## How It Works

This sketch uses the [**EZ\_USB\_MIDI\_HOST** library](https://github.com/rppicomidi/EZ_USB_MIDI_HOST/tree/main) by&nbsp; **rppicomidi.&nbsp;** It was derived from the PIO example code [here](https://github.com/rppicomidi/EZ_USB_MIDI_HOST/blob/main/examples/arduino/EZ_USB_MIDI_HOST_PIO_example/EZ_USB_MIDI_HOST_PIO_example.ino).

Tod Kurt modified it to add USB MIDI forwarding (so incoming MIDI messages are received and then re-sent to a computer over the Feather's primary (non-Host) USB port.

John Park added the classic MIDI messaging output over UART, as well as message filtering to re-map MIDI channels, and OLED display/UI functionality.

### Initial Setup and Libraries

**Libraries**

- `SPI.h` and `Wire.h` for SPI and I2C communication.
- `Adafruit_GFX.h` and `Adafruit_SSD1306.h` for OLED display control.
- `MIDI.h` for MIDI communication.
- `pio_usb.h` and `EZ_USB_MIDI_HOST.h` for USB host support.

**OLED Display Configuration**

- Configures the OLED display with specified width, height, reset pin, and I2C address.
- Initializes the display and sets initial text.

**Button Configuration**

- Configures three buttons (A, B, C) with debounce logic to ensure reliable button presses.

**MIDI Configuration**

- Defines USB and UART MIDI interfaces.
- Sets up USB host and MIDI handling with callbacks for various MIDI messages.

### MIDI Message Handling

The code includes a series of callback functions to handle various MIDI messages, including:

- `onNoteOff`
- `onNoteOn`
- `onPolyphonicAftertouch`
- `onControlChange`
- `onProgramChange`
- `onAftertouch`
- `onPitchBend`
- `onSysEx`
- `onSMPTEqf`
- `onSongPosition`
- `onSongSelect`
- `onTuneRequest`
- `onMidiClock`
- `onMidiStart`
- `onMidiContinue`
- `onMidiStop`
- `onActiveSense`
- `onSystemReset`
- `onMidiTick`
- `onMidiInWriteFail`

Each of these functions forwards the MIDI message to both the USB and UART MIDI interfaces and updates the OLED display as needed. The `midiPanic` function is designed to send Note Off messages for all notes, effectively stopping all sound.

### Core1 Setup and Loop

The Feather RP2040 has dual cores. The code sets up Core1 to handle the USB host stack:

- Initializes USB host configuration for MIDI devices.
- Runs the USB host task in a loop to manage MIDI device connections and data transfer.

### Core0 Setup and Loop

Core0 handles the main program logic:

- Initializes Serial communication and the OLED display.
- Sets up the buttons and their debounce logic.
- Begins the MIDI interfaces and configures them to not echo messages (`turnThruOff`).

The main loop on Core0 handles:

- Reading and processing button states to change the output MIDI channel, program change banks, and to send a MIDI panic message.
- Blinking an LED to indicate the program is running.
- Handling USB MIDI input and output.

### Button Functionality

- **Button A:** Changes the output MIDI channel (1-16).
- **Button B:** Changes the program change bank in groups of 8.
- **Button C:** Sends a MIDI panic message, turning off all notes.

### How it Works Together

**Initialization**

- Both cores are initialized, setting up USB host and MIDI interfaces.
- OLED display shows the initial message and sets up text properties.

**Main Loop**

- USB MIDI messages are read and processed, triggering appropriate callbacks.
- Button states are read and debounced. Button presses change MIDI settings or trigger panic.
- The OLED display is updated with the current MIDI channel, program bank, or control change as messages are received or settings are changed.

**MIDI Message Handling**

- Incoming MIDI messages are forwarded to both USB and UART MIDI interfaces.
- Messages are also displayed on the OLED screen and printed to the Serial monitor for debugging.

# USB MIDI Host Messenger

## Build the Messenger

![](https://cdn-learn.adafruit.com/assets/assets/000/130/734/medium800/hacks_messenger.jpg?1718686916)

## Quad 2x2 FeatherWing Prep

Solder socket headers into the Quad FeatherWing.

You'll add a slide switch to turn the Messenger on and off by shorting the Feather enable pin to ground.

Then, solder in the slide switch with enough height from the board to bend the switch sideways 90º as shown.&nbsp;

Solder a short length of wire from the common (center) leg of the switch to **GND** and another from the top leg to the **Enable** pin (marked **En** ) on the FeatherWing.&nbsp;

![hacks_host-9838.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/751/medium640/hacks_host-9838.jpg?1718767551)

![hacks_host-9839.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/752/medium640/hacks_host-9839.jpg?1718767749)

## Standoffs

Insert four M2.5 x 12mm M-F hex standoffs from under the Quad FeatherWing into the four corner mounting holes. Screw M2.4 x 6mm F-F hex standoffs on top of them. These will be used to fasten the board to the case.

Next, screw in seven M2.5 x 6mm hex standoffs onto the remaining mounting holes using seven M2.5 x 4mm screws. These will be used to secure the three Feather/FeatherWing positions we'll be populating, as shown.&nbsp;&nbsp;

![hacks_host-9840.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/753/medium640/hacks_host-9840.jpg?1718767910)

![hacks_host-9841.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/754/medium640/hacks_host-9841.jpg?1718768046)

![hacks_host-9842.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/755/medium640/hacks_host-9842.jpg?1718768248)

![hacks_host-9843.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/756/medium640/hacks_host-9843.jpg?1718768259)

## MIDI FeatherWing

Solder in the DIN-5 MIDI jacks onto the MIDI FeatherWing. Then solder the header pins underneath.

Insert the MIDI FeatherWing into the Quad FeatherWing as shown.

![hacks_host-9846.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/757/medium640/hacks_host-9846.jpg?1718768283)

![](https://cdn-learn.adafruit.com/assets/assets/000/130/764/medium800/hacks_host-9847.jpg?1718768378)

## Feather RP2040 and Battery

Solder header pins under the USB Host Feather RP2040.

Plug the LiPo battery into the Feather, then insert the Feather into the Quad FeatherWing.

![hacks_host-9826.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/767/medium640/hacks_host-9826.jpg?1718768383)

![hacks_host-9848.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/768/medium640/hacks_host-9848.jpg?1718768438)

![](https://cdn-learn.adafruit.com/assets/assets/000/130/769/medium800/hacks_host-9849.jpg?1718768589)

## OLED FeatherWing

Solder header pins under the OLED FeatherWing.

Insert it into the Quad FeatherWing as shown.

I used a piece of polyamide tape to add a nice amber tint to the OLED. This is optional. But just barely.

![hacks_host-9850.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/770/medium640/hacks_host-9850.jpg?1718768785)

## Screws

The MIDI and USB ports will be subjected to some force as you insert and remove cables, so it's a good idea to screw them into place and save the header pins from too much strain.

Use twelve M2.5 x 6mm screws to fasten them into the hex standoffs we prepared earlier.

![hacks_host-9852.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/771/medium640/hacks_host-9852.jpg?1718768908)

![](https://cdn-learn.adafruit.com/assets/assets/000/130/782/medium800/hacks_host-9853.jpg?1718769053)

[MIDI Host Case](https://cdn-learn.adafruit.com/assets/assets/000/130/819/original/midi_host_case.stl?1718812586)
## 3D Printed Case

You can optionally print a simple case to house the boards. The .stl file above can be printed in PLA at 0.2mm layer height.

Adhere a short length of double-stick foam tape to the inside of the case to secure the battery.

Then, fit the board in, being mindful of the switch so it notches into the side hole.

![hacks_host-9854.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/785/medium640/hacks_host-9854.jpg?1718770703)

![hacks_host-9855.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/786/medium640/hacks_host-9855.jpg?1718770710)

![hacks_host-9856.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/787/medium640/hacks_host-9856.jpg?1718770718)

![hacks_host-9857.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/788/medium640/hacks_host-9857.jpg?1718770727)

### No 3D Printing Required

Alternatively, you can use the cutting guide linked below as a template to simply drill holes in a cigar box, take-out food container, or other box of your choosing.

[MIDI Host Case Template](https://cdn-learn.adafruit.com/assets/assets/000/130/820/original/midi_host_case.pdf?1718812960)
## Case Screws

Fasten the board to the case with four M2.5 x 6mm screws from underneath.

Please ignore the uneven first layer of my print and the slightly curled corner. Thank you.

You can optionally adhere rubber bumper feet to prevent sliding.

![hacks_host-9859.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/791/medium640/hacks_host-9859.jpg?1718770891)

![hacks_host-9858.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/792/medium640/hacks_host-9858.jpg?1718770899)

![](https://cdn-learn.adafruit.com/assets/assets/000/130/789/medium800/hacks_host-9861.jpg?1718770855)

# USB MIDI Host Messenger

## Use the Messenger

![](https://cdn-learn.adafruit.com/assets/assets/000/130/800/medium800/hacks_host-9790.jpg?1718774690)

## MIDI Cable

Plug in a MIDI cable to the MIDI FeatherWing output jack.

The other end of the MIDI cable will plug into your synthesizer, in this case a 1010music nanobox fireball via a DIN-5 to 3.5mm TRS adapter.

![hacks_host-9868.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/793/medium640/hacks_host-9868.jpg?1718774526)

![hacks_host-9869.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/794/medium640/hacks_host-9869.jpg?1718774569)

![](https://cdn-learn.adafruit.com/assets/assets/000/130/804/medium800/hacks_host-9793.jpg?1718774802)

## USB Host Cable

Plug in the USB MIDI keyboard's cable into the host port on the Feather.

![hacks_host-9870.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/795/medium640/hacks_host-9870.jpg?1718774588)

![](https://cdn-learn.adafruit.com/assets/assets/000/130/799/medium800/hacks_host-9872.jpg?1718774671)

The USB host port will provide power to the MIDI keyboard/controller, as well as establish the connection for data.

![](https://cdn-learn.adafruit.com/assets/assets/000/130/805/medium800/hacks_host-9790.jpg?1718774873)

## MIDI Out Channel

Press the A button on the OLED FeatherWing to change the MIDI out channel. In this case it has been set to channel 2. You can increment up to 16 and then it will roll back around to 1.

![hacks_host-9795.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/806/medium640/hacks_host-9795.jpg?1718775000)

![hacks_host-9796.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/807/medium640/hacks_host-9796.jpg?1718775011)

## Program Change

Your MIDI keyboard/controller may have buttons for sending Program Change messages. These are used to change the patch preset. The Messenger can increment the Program Change values in sets of eight to make it quicker to try different sounds.&nbsp;

Press the B button to increment the Program Change number by eight, up to 127, and then back to the beginning.

![hacks_host-9800.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/808/medium640/hacks_host-9800.jpg?1718775088)

![hacks_host-9801.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/809/medium640/hacks_host-9801.jpg?1718775101)

## CC Number

When you adjust a CC knob or slider the Messenger will show which CC number has been changed. This is useful in figuring out which knobs are controlling different parameters.

![hacks_host-9803.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/810/medium640/hacks_host-9803.jpg?1718775279)

![hacks_host-9804.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/811/medium640/hacks_host-9804.jpg?1718775285)

## MIDI Panic

If a MIDI note ever gets stuck you can send a MIDI panic to shut off all notes. Press the C button on the OLED FeatherWing to send MIDI panic.

![hacks_host-9802.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/812/medium640/hacks_host-9802.jpg?1718775401)

## Play Notes

As you play keys on your MIDI keyboard the Messenger will display the in-coming channel \> out-going channel, and the note number. A small `o` shows up when the note is pressed and disappears when that same note number is released.

![hacks_host-9805.gif](https://cdn-learn.adafruit.com/assets/assets/000/130/813/medium640thumb/hacks_host-9805.jpg?1718776957)

## Data/Charging/USB MIDI Out

You can plug a USB C cable into the primary USB port of the Feather in order to charge the connected battery, update the firmware, or to forward the filtered MIDI messages along to a connected software synth on a computer (as well as still sending over UART classic MIDI).

![hacks_host-9871.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/814/medium640/hacks_host-9871.jpg?1718805507)

https://youtu.be/nuCQyhRjh_M

## Customization

This is just a small sampling of the filtering and modification you can do with the USB MIDI Host Messenger. The code could be update to do more advanced things such as:

- CC# re-mapping and value inversion
- Note scale quantization
- Keyboard splitting to send low notes over a different channel to a bass-line synth
- Automatic note harmonizer
- Arpeggiators
- MIDI clock source
- Velocity randomizer
- CC LFO
- Very tiny sheet music display

Enjoy cooking up new uses for your USB MIDI Host Messenger!

&nbsp;


## Featured Products

### Adafruit Feather RP2040 with USB Type A Host

[Adafruit Feather RP2040 with USB Type A Host](https://www.adafruit.com/product/5723)
You're probably really used to microcontroller boards with USB, but what about a dev board with two? Two is more than one, so that makes it twice as good! And the&nbsp; **Adafruit Feather RP2040 with USB Host** is **&nbsp;** definitely double-the-fun of our other Feather...

In Stock
[Buy Now](https://www.adafruit.com/product/5723)
[Related Guides to the Product](https://learn.adafruit.com/products/5723/guides)
### Adafruit MIDI FeatherWing Kit

[Adafruit MIDI FeatherWing Kit](https://www.adafruit.com/product/4740)
Turn your Feather into a song-bird with this musically-enabled FeatherWing that adds MIDI input and output jacks to just about any Feather. You get both input and output DIN-5 MIDI jacks, a 3V optically isolator so you can interface with MIDI on 3.3V logic/power microcontrollers, and two...

In Stock
[Buy Now](https://www.adafruit.com/product/4740)
[Related Guides to the Product](https://learn.adafruit.com/products/4740/guides)
### Adafruit FeatherWing OLED - 128x32 OLED Add-on For Feather

[Adafruit FeatherWing OLED - 128x32 OLED Add-on For Feather](https://www.adafruit.com/product/2900)
A Feather board without ambition is a Feather board without FeatherWings! This is the **FeatherWing OLED** : it adds a 128x32 monochrome OLED plus 3 user buttons to _any_ Feather main board. Using our [Feather Stacking...](https://www.adafruit.com/products/2830)

In Stock
[Buy Now](https://www.adafruit.com/product/2900)
[Related Guides to the Product](https://learn.adafruit.com/products/2900/guides)
### Adafruit Quad 2x2 FeatherWing Kit with Headers

[Adafruit Quad 2x2 FeatherWing Kit with Headers](https://www.adafruit.com/product/4253)
This is the **FeatherWing Quad 2x2** - a prototyping add-on and more for all Feather boards. This is similar to our [FeatherWing Proto](https://www.adafruit.com/products/2884) except there are four! The magic of the Quad comes when you want to connect your Feather to...

In Stock
[Buy Now](https://www.adafruit.com/product/4253)
[Related Guides to the Product](https://learn.adafruit.com/products/4253/guides)
### Lithium Ion Polymer Battery - 3.7v 2500mAh

[Lithium Ion Polymer Battery - 3.7v 2500mAh](https://www.adafruit.com/product/328)
Lithium-ion polymer (also known as 'lipo' or 'lipoly') batteries are thin, light, and powerful. The output ranges from 4.2V when completely charged to 3.7V. This battery has a capacity of **2500mAh** for a total of about 10 Wh. If you need a smaller battery, <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/328)
[Related Guides to the Product](https://learn.adafruit.com/products/328/guides)
### Little Rubber Bumper Feet - Pack of 4

[Little Rubber Bumper Feet - Pack of 4](https://www.adafruit.com/product/550)
Keep your electronics from going barefoot, give them little rubber feet! These small sticky bumpers are our favorite accessory for any electronic kit or device. They are sticky, but not impossible to remove. They're small enough to fit onto any board, and have just enough height to give...

In Stock
[Buy Now](https://www.adafruit.com/product/550)
[Related Guides to the Product](https://learn.adafruit.com/products/550/guides)
### Breadboard-friendly SPDT Slide Switch

[Breadboard-friendly SPDT Slide Switch](https://www.adafruit.com/product/805)
These nice switches are perfect for use with breadboard and perfboard projects. They have 0.1" spacing and snap in nicely into a solderless breadboard. They're easy to switch no matter what size fingers you have, but not so easy that they'll get flipped by accident. Work great as...

In Stock
[Buy Now](https://www.adafruit.com/product/805)
[Related Guides to the Product](https://learn.adafruit.com/products/805/guides)
### Black Nylon Machine Screw and Stand-off Set – M2.5 Thread

[Black Nylon Machine Screw and Stand-off Set – M2.5 Thread](https://www.adafruit.com/product/3299)
Totaling 380 pieces, this **M2.5 Screw Set** &nbsp;is a must-have for your workstation.&nbsp;You'll have enough screws, nuts, and hex standoffs to fuel your maker tendencies&nbsp;for days on end! M2.5 size screws fit almost all of the Adafruit breakout/dev board mounting holes...

In Stock
[Buy Now](https://www.adafruit.com/product/3299)
[Related Guides to the Product](https://learn.adafruit.com/products/3299/guides)

## Related Guides

- [Adafruit OLED FeatherWing](https://learn.adafruit.com/adafruit-oled-featherwing.md)
- [Adafruit MIDI FeatherWing](https://learn.adafruit.com/adafruit-midi-featherwing.md)
- [Adafruit Feather RP2040 with USB Type A Host](https://learn.adafruit.com/adafruit-feather-rp2040-with-usb-type-a-host.md)
- [Stand for Feather ESP32 with Reverse TFT](https://learn.adafruit.com/stand-for-feather-esp32-with-reverse-tft.md)
- [Feather Waveform Generator in CircuitPython](https://learn.adafruit.com/waveform-generator.md)
- [CircuitPython Powered Sip & Puff with ST LPS33HW Pressure Sensor](https://learn.adafruit.com/st-lps33-and-circuitpython-sip-and-puff.md)
- [LED Protest Sign](https://learn.adafruit.com/led-protest-sign.md)
- [Chilled Drinkibot](https://learn.adafruit.com/chilled-drinkibot.md)
- [Feather Fingerboard](https://learn.adafruit.com/feather-fingerboard.md)
- [RP2040 RunCPM Emulator with USB Keyboard & HDMI screen](https://learn.adafruit.com/rp2040-runcpm-emulator-with-usb-keyboard-hdmi-screen.md)
- [MatrixPortal CircuitPython Animated Message Board](https://learn.adafruit.com/matrixportal-circuitpython-animated-message-board.md)
- [Mini Pinball Table with Gemma M0](https://learn.adafruit.com/mini-pinball-table-with-gemma-m0.md)
- [3D Print Ratcatcher 2 Controller Device](https://learn.adafruit.com/3d-print-ratcatcher-2-controller-device-wand.md)
- [Using LoraWAN and The Things Network with Feather](https://learn.adafruit.com/the-things-network-for-feather.md)
- [Feather TFT STEMMA Case](https://learn.adafruit.com/feather-tft-stemma-case.md)
- [PyPortal Case](https://learn.adafruit.com/pyportal-case.md)
- [ESP32-S3 BLE RS-232 Controller](https://learn.adafruit.com/esp32-s3-ble-rs232-controller.md)
