USB type 8x8

Status
Not open for further replies.

mark63

Active member
hi all,

this is my first post. I got a teensy 4.1 which seems just great.
I got through the installation steps and i did a lot of reading (forum, samples, links,etc.) to get familiar with USB and MIDI.
Lucky the samples are small and simple.
The goal is simple : i want to have 8 virtual MIDI cables and use the 8 uarts to send/receive the data at the highest possible baud. Looking at the samples that seems to be doable.
But in Arduino i have the choice to select USB type 16x16 or 4x4. And some variants with serial.
There is no choice for 8x8.
Now if i understand correct, if i select 16x16 there are 16 virtual in and 16 virtual out cables created. These show up on MIDIOX just fine.
I do not need to use the host function to connected MIDI devices. I just need the virtual cables. But since my device will use 8 cables. I do not want to have 16.
So is there a way to remove the others? Where is the code that defines/creates these cables?
Or is it possible to add an entry for 8x8. and how ?

And i wonder why there is no simpler control over how many virtual cables are created and the combination of usb devices.

thanks for any help
mark
 
Yes. Using Win10, IDE1.8.15 TD1.54 here.

In Windows\Program Files(x86)\Arduino\hardware\teensy\avr\cores\teensy4\usbdesc.h
Starting at line 400 you will see #defines for the various usbMIDI Types.

Add this:-

Code:
#elif defined(USB_MIDI8)
  #define VENDOR_ID		0x16C0
  #define PRODUCT_ID		0x0485
  #define BCD_DEVICE		0x0214
  #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','1','6'}
  #define PRODUCT_NAME_LEN	14
  #define EP0_SIZE		64
  #define NUM_ENDPOINTS         3
  #define NUM_INTERFACE		2
  #define SEREMU_INTERFACE      1	// Serial emulation
  #define SEREMU_TX_ENDPOINT    2
  #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       8
  #define MIDI_TX_ENDPOINT      3
  #define MIDI_TX_SIZE_12       64
  #define MIDI_TX_SIZE_480      512
  #define MIDI_RX_ENDPOINT      3
  #define MIDI_RX_SIZE_12       64
  #define MIDI_RX_SIZE_480      512
  #define ENDPOINT2_CONFIG	ENDPOINT_RECEIVE_INTERRUPT + ENDPOINT_TRANSMIT_INTERRUPT
  #define ENDPOINT3_CONFIG	ENDPOINT_RECEIVE_BULK + ENDPOINT_TRANSMIT_BULK

Re #define BCD_DEVICE

Multi-Cable usbMidi types need a unique BCD_DEVICE. I'm using 0x214 here and 0x213 for MIDIx2.

Next, to make appear in the IDE's Tools Menu:-

In Windows\Program Files(x86)\Arduino\hardware\teensy\avr\boards.txt

Starting Line 55 you will see content relevant to the various usbMIDI options for the T4.1. Add this:-

Code:
teensy41.menu.usb.midi8=MIDIx8
teensy41.menu.usb.midi.build.usbtype=USB_MIDI8
teensy41.menu.usb.midi8.fake_serial=teensy_gateway
Restart the IDE for the changes to take effect.

These changes will be clobbered if you update/reinstall TD.
 
Hello MatrixRat,

thank you very much for your quick and detailed reply. that was exact what i was looking for. I understand that an update will overwrite files.
thanks again !

mark
 
Status
Not open for further replies.
Back
Top