BASS.NET API for the Un4seen BASS Audio LibraryMidiInputDeviceGetMidiPorts Method BASS.NET API for the Un4seen BASS Audio Library
Returns all available Midi input port IDs.

Namespace: radio42.Multimedia.Midi
Assembly: Bass.Net (in Bass.Net.dll) Version:

public static int[] GetMidiPorts()

Return Value

Type: Int32
An array of int representing the available Midi port IDs.

The values returned equals the deviceID, which might be used with the constructor of this class.

This method returns all available deviceIDs representing a Midi input port. You might use each ID with the GetDeviceDescription(Int32) method to retrieve the name of the respective Midi input device.


List all Midi input ports (devices which might be used with this class):
Dim inPorts As Integer() = MidiInputDevice.GetMidiPorts()
Dim port As Integer
For Each port In  inPorts
  Dim name As String = MidiInputDevice.GetDeviceDescription(port)
  Console.WriteLine("{0}={1}", port, name)
Next port
int[] inPorts = MidiInputDevice.GetMidiPorts();
foreach (int port in inPorts)
  string name = MidiInputDevice.GetDeviceDescription(port);
  Console.WriteLine("{0}={1}", port, name);
See Also