Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

PortMidiMBS.CountDevices as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method MIDI MBS Audio Plugin 5.2 Yes Yes Yes Yes No
Function: Counts the devices.
Example:
dim pa as new PortMidiMBS

Dim u as Integer = pa.CountDevices-1
for i as Integer = 0 to u
dim d as PortMidiDeviceInfoMBS = pa.DeviceInfo(i)
MsgBox d.Name+", "+D.InterfaceName
next
Notes: Returns 0 on any error.

Feedback, Comments & Corrections

PortMidiMBS.DefaultInputDeviceID as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method MIDI MBS Audio Plugin 5.2 Yes Yes Yes Yes No
Function: Returns the default device ID or pmNoDevice (-1) if there are no devices.
Notes:
On the PC, the user can specify a default device by setting an environment variable. For example, to use device #1.

set PM_RECOMMENDED_OUTPUT_DEVICE=1

The user should first determine the available device ID by using the supplied application "testin" or "testout".

In general, the registry is a better place for this kind of info, and with USB devices that can come and go, using integers is not very reliable for device identification. Under Windows, if PM_RECOMMENDED_OUTPUT_DEVICE (or PM_RECOMMENDED_INPUT_DEVICE) is *NOT* found in the environment, then the default device is obtained by looking for a string in the registry under: HKEY_LOCAL_MACHINE/SOFTWARE/PortMidi/Recommended_Input_Device and HKEY_LOCAL_MACHINE/SOFTWARE/PortMidi/Recommended_Output_Device for a string. The number of the first device with a substring that matches the string exactly is returned. For example, if the string in the registry is "USB", and device 1 is named "In USB MidiSport 1x1", then that will be the default input because it contains the string "USB".

In addition to the name, PmDeviceInfo has the member "interf", which is the interface name. (The "interface" is the underlying software system or API used by PortMidi to access devices. Examples areMMSystem, DirectX (not implemented), ALSA, OSS (not implemented), etc.) At present, the only Win32 interface is "MMSystem", the only Linux interface is "ALSA", and the only Max OS X interface is "CoreMIDI".
To specify both the interface and the device name in the registry, separate the two with a comma and a space, e.g.:
MMSystem, In USB MidiSport 1x1
In this case, the string before the comma must be a substring of the "interf" string, and the string after the space must be a substring of the "name" name string in order to match the device.

Note: in the current release, the default is simply the first device (the input or output device with the lowest PmDeviceID).

Feedback, Comments & Corrections

PortMidiMBS.DefaultOutputDeviceID as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method MIDI MBS Audio Plugin 5.2 Yes Yes Yes Yes No
Function: Returns the default device ID or pmNoDevice (-1) if there are no devices.
Notes:
On the PC, the user can specify a default device by setting an environment variable. For example, to use device #1.

set PM_RECOMMENDED_OUTPUT_DEVICE=1

The user should first determine the available device ID by using the supplied application "testin" or "testout".

In general, the registry is a better place for this kind of info, and with USB devices that can come and go, using integers is not very reliable for device identification. Under Windows, if PM_RECOMMENDED_OUTPUT_DEVICE (or PM_RECOMMENDED_INPUT_DEVICE) is *NOT* found in the environment, then the default device is obtained by looking for a string in the registry under: HKEY_LOCAL_MACHINE/SOFTWARE/PortMidi/Recommended_Input_Device and HKEY_LOCAL_MACHINE/SOFTWARE/PortMidi/Recommended_Output_Device for a string. The number of the first device with a substring that matches the string exactly is returned. For example, if the string in the registry is "USB", and device 1 is named "In USB MidiSport 1x1", then that will be the default input because it contains the string "USB".

In addition to the name, PmDeviceInfo has the member "interf", which is the interface name. (The "interface" is the underlying software system or API used by PortMidi to access devices. Examples areMMSystem, DirectX (not implemented), ALSA, OSS (not implemented), etc.) At present, the only Win32 interface is "MMSystem", the only Linux interface is "ALSA", and the only Max OS X interface is "CoreMIDI".
To specify both the interface and the device name in the registry, separate the two with a comma and a space, e.g.:
MMSystem, In USB MidiSport 1x1
In this case, the string before the comma must be a substring of the "interf" string, and the string after the space must be a substring of the "name" name string in order to match the device.

Note: in the current release, the default is simply the first device (the input or output device with the lowest PmDeviceID).

Feedback, Comments & Corrections

PortMidiMBS.DeviceInfo(DeviceID as Integer) as PortMidiDeviceInfoMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method MIDI MBS Audio Plugin 5.2 Yes Yes Yes Yes No
Function: Returns information about a certain device.
Example:
dim pa as new PortMidiMBS

Dim u as Integer = pa.CountDevices-1
for i as Integer = 0 to u
dim d as PortMidiDeviceInfoMBS = pa.DeviceInfo(i)
MsgBox d.Name+", "+D.InterfaceName
next
Notes: Returns nil on any error.

Feedback, Comments & Corrections

PortMidiMBS.ErrorText(ErrorNumber as Integer) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method MIDI MBS Audio Plugin 5.2 Yes Yes Yes Yes No
Function: The error text for the given error code.
Notes: Returns "" on any error.

Feedback, Comments & Corrections

PortMidiMBS.Initialize as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method MIDI MBS Audio Plugin 16.3 Yes Yes Yes Yes No
Function: Initializes the PortMidi functions.
Notes:
You call this manually to trigger initialization now.
Or you just let the plugin do it automatically when you call one of the portmidi functions.
Returns the error code. (0 = okay)

Feedback, Comments & Corrections

PortMidiMBS.ReInitialize as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method MIDI MBS Audio Plugin 9.4 Yes Yes Yes Yes No
Function: Shuts down PortMidi and initializes it again.
Notes:
As PortMidi does not recognize the attachment of new MIdi devices, you can only reinitialize.

Returns a PortMidi error code.

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Audio Plugin.




Links
MBS FileMaker Plugins