-
Notifications
You must be signed in to change notification settings - Fork 7.7k
feat(usb): allow the MIDI constructor to define a device name #11720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This PR will allow the user to modify the MIDI USB Device Name (device descriptor). Fomer API continues to be valid and the default device name is "TinyUSB MIDI". The user can change the device name by passing a string to the constructor, declaring it like this `USBMIDI myMIDI("MyDeviceName");
👋 Hello SuGlider, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Github is having some issues. CI should pass after it normalizes.
imageTest Results
76 files 76 suites 13m 11s ⏱️
38 tests 38 ✅ 0 💤 0 ❌
241 runs 241 ✅ 0 💤 0 ❌
Results for commit 4bca706.
♻️ This comment has been updated with latest results.
Updated MIDI device initialization to use default constructor.
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds the ability to define a custom USB MIDI device name through multiple methods while maintaining backward compatibility. The default device name remains "TinyUSB MIDI" but can now be overridden via constructor parameter or compile-time macro.
Key changes:
- Adds a new USBMIDI constructor that accepts a device name parameter
- Implements a priority system for device naming (constructor > macro > default)
- Adds a compile-time macro SET_USB_MIDI_DEVICE_NAME() for setting device names
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
libraries/USB/src/USBMIDI.h | Adds new constructor, destructor, and device name management methods |
libraries/USB/src/USBMIDI.cpp | Implements device name logic with memory management and priority handling |
libraries/USB/examples/MIDI/MidiInterface/MidiInterface.ino | Demonstrates macro-based device naming |
libraries/USB/examples/MIDI/MidiController/MidiController.ino | Demonstrates constructor-based device naming |
cores/esp32/Arduino.h | Defines the SET_USB_MIDI_DEVICE_NAME macro and default name constant |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Description of Change
This PR will allow the user to modify the MIDI USB Device Name (device descriptor). Fomer API continues to be valid and the default device name is "TinyUSB MIDI".
The user can change the device name by passing a string to the constructor, declaring it like this `USBMIDI myMIDI("MyDeviceName");
Setting the MIDI device name follow an order:
Tests scenarios
ESP32-S3 | ESP32-S2 using USB OTG mode with UART for
Serial
:USB CDC On Boot: "Disabled"
Upload Mode: "UART0 / Hardware CDC"
USB Mode: "USB OTG (TinyUSB)"
2 USB Cables, one for UART and the other for USB, connected to the USB Host (PC).
For testing please go to https://hardwaretester.com/midi
Allow the browser to select the MIDI device for the name and MIDI commands
Related links
closes #11714