MidiIoPortInfo

Returns information about one or more MIDI ports. For example, this can retrieve how many MIDI Out ports are available, and/or retrieve information about a given port such as its name.

Synopsis

info = MidiIoPortInfo(option, portID)

Args

option determines what type of information is returned, and is one of the following:

Option Meaning
'COUNT' (Count) Return a count of how many MIDI ports are available. This counts only Out or In MIDI ports, depending upon the IN option below. The count of MIDI Out ports does not include MIDI Mapper.
'NAME' (Name) Return a port's name.
'MID' (Manufacturer ID) Return a port's Manufacturer ID (number).
'PID' (Product ID) Return a port's Product ID (number).
'CHANNELS' (Channels) Return a listing of which of the 16 MIDI channels are supported by a port. The first MIDI channel is numbered 1. The listing includes all supported MIDI channel numbers, each separated by a space, and in ascending order.
'POLY' (Polyphony) Return the number of simultaneously sounding voices (ie, notes) a port supports.
'PARTS' (Parts) Return the number of multi-timbral parts a port supports. Each part can be set to its own MIDI channel.
'IN' (Input) Return the above information for a MIDI In (rather than Out) port. This option can be used in conjunction with one of the above options, with a | character separating them. For example, to count all MIDI In ports, pass an option of 'IN|COUNT'.

If option is omitted, it defaults to 'NAME'.

portID is the ID (number) of the desired port about which to get information. If omitted, then information is retrieved for the last port that you opened with MidiIoOpenPort(). portID is not applicable to the 'COUNT' option.

Returns

The requested information if successful, or an empty string if there an error.

Notes

If you pass a non-numeric value for portID, then a SYNTAX condition is raised. CONDITION('E') returns error number 40.12 and CONDITION('D') returns the message MIDIIOPORTINFO argument 2; must be a whole number; found "<badarg>" where <badarg> is what you erroneously passed.

If you pass a value for option which is not one of the allowable ones, then a REXX SYNTAX condition is raised. CONDITION('E') returns error number 40.28 and CONDITION('D') returns the message MIDIIOPORTINFO argument 1, option must start with one of "<options>"; found "<badchoice>" where <options> are the allowable choices and <badchoice> is what you erroneously passed.

Examples

/* Print the name of the MIDI Out port that you last
 * opened (could be the currently open port). */
SAY MidiIoPortInfo()
See List/Open/Close a port for how to list information about all of the available ports.