Adafruit_TinyUSB, MIDI, how can I change the device name?

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
fapplin
 
Posts: 31
Joined: Mon Sep 23, 2013 8:47 am

Adafruit_TinyUSB, MIDI, how can I change the device name?

Post by fapplin »

I use these 2 lines of code when creating a MIDI USB device with a Raspberry Pi Pico (using Arduino IDE). I do it in my initialization routine (see below). The changes are recognized when I start up a MIDI application in Linux or Android (as XYZDevice) and I can use the device. In Windows, it shows up in Windows Device Manager as an Audio device (as it should as XYZDevice), but Windows MIDI applications don't see it at all. Can someone tell me if there's something more I need to do for Windows?

Code: Select all

  USBDevice.setManufacturerDescriptor("XYZ MIDI Mfg                ");
  USBDevice.setProductDescriptor         ("XYZDevice                     ");

Code: Select all


// USB MIDI object
Adafruit_USBD_MIDI usb_midi;
//
// Create a new instance of the Arduino MIDI Library,
// and attach usb_midi as the transport.
MIDI_CREATE_INSTANCE(Adafruit_USBD_MIDI, usb_midi, MIDI);

KISIMidi::KISIMidi()
{
} //end constructor

KISIMidi::~KISIMidi()
{
} //end destructor

void KISIMidi::initialize()
{
#if defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_RP2040)
  // Manual begin() is required on core without built-in support for TinyUSB such as mbed rp2040
  TinyUSB_Device_Init(0);
#endif


  USBDevice.setManufacturerDescriptor("XYZ MIDI Mfg                ");
  USBDevice.setProductDescriptor         ("XYZDevice                     ");
  
  MIDI.begin(MIDI_CHANNEL_OMNI);
  MIDI.turnThruOff();

  Serial2.setRX(5);
  Serial2.setTX(4);
  Serial2.begin(31250);

  pinMode(MIDI_LED, OUTPUT);

  while ( !TinyUSBDevice.mounted() ) delay(1);

}

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”