Questions about usbMIDI...

Status
Not open for further replies.
Hello All,

Before my question, I'd just like to say that I love Teensy for many reasons, particularly for making USB class drivers so easily accessible. In fact I am using Teensys for most of my projects now. However sometimes I get frustrated by the documentation, for example:

"Using USB MIDI" tutorial page describes a generic send() method which is perfect for my purposes. The page lists it with four arguments.

Code:
usbMIDI.send(type, data1, data2, channel);

However the compiler (Mac OS X / Arduino iDE 1.8.7 / Teensyduino 1.44 / Teensy LC) refuses to compile with that method signature. Instead it suggests another candidate with a fifth argument named cable. Digging inside the Arduino application package contents I found two definitions of this method, within different folders/files

/Applications/Arduino.app/Contents/Java/hardware/teensy/avr/cores/usb_midi/usb_api.h
/Applications/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/usb_midi.h

In the first one the function is a no-op if (cable > 0). In the other file the value is limited by MIDI_NUM_CABLES. Couldn't find anything else about the 'cable' argument. I managed to compile and run my code using a fifth argument with value zero, but I am still very confused about many things:
,
0) what is the 'cable" argument ? Is this meant for MIDI devices with multiple ports?
1) Why does the tutorial show only four arguments?
2) Isn't there a code reference page we could turn to when encountering such issues? (Teensy's "Reference" link only shows pin layouts for the various boards...)
3) If we are supposed to look it up in the source code, how do we know which files to look in? Is there a correct place to look, other than inside application contents?
4) Are there any reference documentation projects for the Teensy underway (I enjoy writing technical manuals and would love to join the effort)?

Thank You all in advance for your attention and sorry for the length of the message.
Any help will be highly appreciated.

Carlos.
 
Status
Not open for further replies.
Back
Top