What is the optional "name" used for in makeMidiInput() in MIDI Remote API

I am just curious and trying to understand some of the syntax in the statement…

var midiInput = deviceDriver.mPorts.makeMidiInput()

in the API Reference, it says:

Obviously, the name argument is optional but I have two questions.

First, is there anyway that the API Reference indicates that the argument is optional?

“name” looks to be in bold whereas other arguments seem mostly in normal weight text but I am not sure… It seems some conventions use square brackets [ … ] to indicate optional arguments.

Second, what is the purpose of supplying the “name” string? The returned object doesn’t have a name property or any apparent way to access it. Perhaps you can refer to it by “name” in some way I am not aware of. It isn’t really important, I know, but I am just curious.

JL

In order for the API to distinguish MIDI ports recognition properly, when we use multiple MIDI in/outs. Have a look at this post: Multiple Ports not recognized - #8 by Jochen_Trappe

1 Like