Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: Is it possible to rename the individual ports in MIDIx4 or MIDIx16 mode?

  1. #1
    Junior Member
    Join Date
    Dec 2020
    Posts
    10

    Is it possible to rename the individual ports in MIDIx4 or MIDIx16 mode?

    I was wondering if it's possible rename the individual ports in MIDIx4/16 mode. On my Mac they show as "Teensy MIDIx16 Port 1, Teensy MIDIx16 Port 2" etc., but as I am using Teensy as a MIDI router, it would be really nice if they could be named to match the equipment that is on that port.

    Based on a glance at the USBMIDI source, I am guessing that the answer is no, and the "Port x" suffixes are assigned by the Mac operating system, but thought it was worth asking in case anyone has any ideas/workarounds!

  2. #2
    You can use the “usb_string_midi_port1” through “usb_string_midi_port16” constants. By default, the names used are “Port *”, see usb_desc.c#L1686.

    You can define these names as shown here, for example:
    Code:
    #include "usb_names.h"
    
    struct usb_string_descriptor_struct usb_string_midi_port1 = {
            2 + 9 * 2,
            3,
            {'S', 'o', 'm', 'e', ' ', 'n', 'a', 'm', 'e'}
    };
    The first argument is 2 plus the number of characters times 2 (they're wide characters, so 2 bytes / char, and I assume an additional two bytes for a terminating null).
    The second argument is the descriptor type, and should be 3.

    I use this Python script to generate these structs more easily.

    Pieter

  3. #3
    Junior Member
    Join Date
    Dec 2020
    Posts
    10
    Ah fantastic, thanks so much! I would never have thought to search for the string as an array like that

  4. #4
    Senior Member vjmuzik's Avatar
    Join Date
    Apr 2017
    Posts
    819
    I haven’t made a pull request for T4.x so currently this only works for T3.x

  5. #5
    Junior Member
    Join Date
    Dec 2020
    Posts
    10
    Quote Originally Posted by vjmuzik View Post
    I haven’t made a pull request for T4.x so currently this only works for T3.x
    I just created a PR porting these changes to 4.x, thanks for your work on it!

  6. #6
    Member educa's Avatar
    Join Date
    Jan 2017
    Location
    Belgium
    Posts
    27
    Would this now also be implemented in 4.x ?

    Also, does MIDIx16 mean that when I plug my teensy in my macbook pro, the my DAW logic pro will see like there are 16 different usb midi cables plugged in which can all send in totaal 16 channels of data ?

  7. #7
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    9,554
    Quote Originally Posted by educa View Post
    Would this now also be implemented in 4.x ?

    Also, does MIDIx16 mean that when I plug my teensy in my macbook pro, the my DAW logic pro will see like there are 16 different usb midi cables plugged in which can all send in totaal 16 channels of data ?
    My guess is that this later PR has not be incorporated yet into Teensyduino.
    I believe it is: https://github.com/PaulStoffregen/cores/pull/526

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •