Multiple MIDIUSB endpoints on Atmega32u4

Hi! I have a USB MIDI device based on Arduino Micro and Atmega32u4. I would like the device to appear as multiple MIDI ports on the USB host side. Each port has different functionality on the controller so using different channels is not a preferred option.

To my (limited) understanding this is achieved by setting up multiple USB endpoints and interfaces. I tried to hack the PluggableUSB constructor in the MIDIUSB library, but it didn't work out.

My questions are:
-MIDIUSB creates 1 MIDI out and one MIDI in endpoint. How many additional MIDI endpoints can I add on a Micro, considering there are 6 available and some are used by other processes. Is there a way to list how many endpoints are available?

-Any hints on how to add MIDIUSB endpoints to the library is extremely appreciated.

Thank you!

Each port has different functionality on the controller

Each channel has its own set of controls.

I don’t know any way of getting multiple end points on the library.

Teensy supports up to 16 virtual MIDI cables. You can have a look at their implementation and the descriptors they use.

Pieter

PieterP:
Teensy supports up to 16 virtual MIDI cables. You can have a look at their implementation and the descriptors they use.

Thanks, that was a very useful reference! Indeed it seems that the Atmega32u4-based Teensy 2.0 does not support multiple USB MIDI cables, while higher end processors do that. It still puzzles me considering that the Atmega32u4 supports 6 endpoints according to the datasheet..