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

Thread: Limit MIDI to just two ports?

  1. #1
    Junior Member
    Join Date
    Feb 2018

    Limit MIDI to just two ports?

    Good day,

    I am working on a project that uses midi and requires 2 ports. Everything is tested and functional using the MIDIx4 profile for teensy. However, in this particular case the additional two ports are not used and may lead to confusion by the end user. Is there a straight forward way to limit the teensy to just two ports? Or do I need start digging through the library code for a workaround?
    Just to clarify this is being used as a USB MIDI device and I would like only two ports to be available when teensy shows up in the operating system.

    Thank you in advance,
    Last edited by Ando_Shy; 10-19-2019 at 02:16 AM. Reason: Missing detail

  2. #2
    Senior Member vjmuzik's Avatar
    Join Date
    Apr 2017
    Easiest way to do it without changing a bunch of things is to edit usb_desc.h, but if you ever needed to change it again you would have to edit that again. A while ago for my personal use I added an additional dropdown menu for selecting the number of midi ports I wanted, but I haven't updated it for the new Teensyduino and it requires changing a few files to support it.

    Here's an example of changing the number of ports for the MIDIx4 profile, the relevant line is highlighted in red, simply change that number from 1 to 16. Your operating system most likely won't register the change by itself since it will have already been cached for 4 ports, but if you change the serial number at the same time it will get registered as a new device and you will see the change take effect.

    #elif defined(USB_MIDI4)
      #define VENDOR_ID		0x16C0
      #define PRODUCT_ID		0x0485
      #define BCD_DEVICE		0x0211
      #define MANUFACTURER_NAME	{'T','e','e','n','s','y','d','u','i','n','o'}
      #define MANUFACTURER_NAME_LEN	11
      #define PRODUCT_NAME		{'T','e','e','n','s','y',' ','M','I','D','I','x','4'}
      #define PRODUCT_NAME_LEN	13
      #define EP0_SIZE		64
      #define NUM_ENDPOINTS         4
      #define NUM_USB_BUFFERS	16
      #define NUM_INTERFACE		2
      #define SEREMU_INTERFACE      1	// Serial emulation
      #define SEREMU_TX_ENDPOINT    1
      #define SEREMU_TX_SIZE        64
      #define SEREMU_TX_INTERVAL    1
      #define SEREMU_RX_ENDPOINT    2
      #define SEREMU_RX_SIZE        32
      #define SEREMU_RX_INTERVAL    2
      #define MIDI_INTERFACE        0	// MIDI
      #define MIDI_NUM_CABLES       4
      #define MIDI_TX_ENDPOINT      3
      #define MIDI_TX_SIZE          64
      #define MIDI_RX_ENDPOINT      4
      #define MIDI_RX_SIZE          64

  3. #3
    Junior Member
    Join Date
    Feb 2018
    thank you vjmuzik!
    I'll give this a try and report back with the results.

  4. #4
    This solution work, because I just ran into a similar problem. thank you

Posting Permissions

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