Skip to content
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

MIDI: support virtual wires/plug #31

Merged
merged 1 commit into from
Oct 7, 2019
Merged

MIDI: support virtual wires/plug #31

merged 1 commit into from
Oct 7, 2019

Conversation

kaysievers
Copy link
Contributor

Allow to specify the number of virtual wires/plugs to be created for
the MIDI interface.

Initializing the MIDI device with:
Adafruit_USBD_MIDI usb_midi(3);

xports a single device with three separate ports/jacks/wires.
The ID (4 bit) of the jack/port is carried in the header packet of
the USB MIDI wire message.

--
This change requires the following change to the tinyusb core:
adafruit/ArduinoCore-samd#179

Allow to specify the number of virtual wires/plugs to be created for
the MIDI interface.

Initializing the MIDI device with:
  Adafruit_USBD_MIDI usb_midi(3);

xports a single device with three separate ports/jacks/wires.
The ID (4 bit) of the jack/port is carried in the header packet of
the USB MIDI wire message.
@hathach
Copy link
Member

hathach commented Oct 5, 2019

Thank you for the PR and your patient, I fixed the travis build by syncing the nrf52 usb repo with the core PR. Can you include the multiple jack example that you mention #27 (comment) here to the PR as well. That will make it easier for user to get started.

@kaysievers
Copy link
Contributor Author

kaysievers commented Oct 5, 2019

Can you include the multiple jack example that you mention #27 (comment)

The current byte-stream API in the library just drops the USB protocol bytes which are needed to make use of the virtual wires/ports. The API needs to be changed to not mangle the USB packets. The example will not work correctly otherwise.

I think we should only include it with the next change, when we convert the API to a packet interface?

I have not submitted it yet, it needs some cleanup. I just split out this PR, to make it smaller.

I'll clean this up next and submit it:
https://github.com/kaysievers/ArduinoCore-samd/tree/tinyusb-midi-packets
https://github.com/kaysievers/Adafruit_TinyUSB_Arduino/tree/midi-packet-interface

@hathach
Copy link
Member

hathach commented Oct 7, 2019

Can you include the multiple jack example that you mention #27 (comment)

The current byte-stream API in the library just drops the USB protocol bytes which are needed to make use of the virtual wires/ports. The API needs to be changed to not mangle the USB packets. The example will not work correctly otherwise.

I think we should only include it with the next change, when we convert the API to a packet interface?

I have not submitted it yet, it needs some cleanup. I just split out this PR, to make it smaller.

I'll clean this up next and submit it:
https://github.com/kaysievers/ArduinoCore-samd/tree/tinyusb-midi-packets
https://github.com/kaysievers/Adafruit_TinyUSB_Arduino/tree/midi-packet-interface

Got it, I am looking forward to your next PR

@hathach hathach merged commit b42a2bb into adafruit:master Oct 7, 2019
@kaysievers kaysievers deleted the midi-jacks branch October 7, 2019 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants