The type read-only property of the MIDIPort interface returns the type of the port, indicating whether this is an input or output MIDI port.
type
external MIDIPortType get type;