Trying to connect my Esp32-S3 to a Midi USB channel

Hello, I'm trying to find a library or github project in order to connect my esp32-s3 wroom to a MIDI-Keyboard. the keyboard has a usb c data cable that I assume is used to connect to an ipad or mac to run a synth software.

The goal is for the esp32 to be able to handle keyboard inputs such that the esp32 is able to connect to a bluetooth speaker to play the notes. I'm not looking to create a synthesizer, I'm just trying to play notes via an esp32.

Are there any additional hardware/software considerations that I have to take into account? The reason why I'm not using just an Ipad is because this is for a school project and we're supposed to use an esp32 to play notes.

You'll need a library that supports MIDI over USB using the USB Host role. AFAIK, this is not supported out-of-the-box in the arduino-esp32 core, but there are some GitHub projects like this one: esp32-usb-host-demos/examples/usbhmidi/usbhmidi.ino at main · touchgadget/esp32-usb-host-demos · GitHub (very low-level, lots of assembly required).
What's your programming background? What do you already know about USB?

What you just described is a synthesizer :slight_smile:

Which year? What are the goals of the class?

  1. Ok, well, that kinda sucks. Maybe it's easier if I just use an iPad instead. But I would still like to learn how to do this. What hardware would I need?
  2. Programming experience: Very basic Arduino with photosensors and ESP32. Basic Python and C++ up to simple data structures like linked lists, stacks, queues, and binary trees.
  3. First year project.
  1. An ESP32-S3 meets the USB Host requirements, but unfortunately it does not support Bluetooth Classic. A standard ESP32 with an additional USB Host shield or a secondary USB-capable microcontroller could work.
  2. You'll need some low-level C++, and be prepared to study the USB and Bluetooth standards documents!
  3. It's an interesting project for sure, but I'd make sure to have some plans ready in case some of the parts prove too much work. Start simple: e.g. play a sine wave on the Bluetooth speaker (you should be able to find some A2DP examples), then add some push buttons to trigger different sine waves, then test the USB by itself (without Bluetooth), read the USB descriptors, then correctly enumerate the device, then add Bulk support so you can send MIDI packets, then add a MIDI parser, and finally start combine it with the Bluetooth.