Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.
Platforms to show: All Mac Windows Linux Cross-Platform
PortMidiMBS.CountDevices as Integer
Function:
Counts the devices.
Example:
Notes:
Returns 0 on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
shared method | MIDI | MBS Audio Plugin | 5.2 | Yes | Yes | Yes | Yes | No |
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
PortMidiMBS.DefaultInputDeviceID as Integer
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".
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).
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
shared method | MIDI | MBS Audio Plugin | 5.2 | Yes | Yes | Yes | Yes | No |
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 are | MMSystem, 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". |
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).
PortMidiMBS.DefaultOutputDeviceID as Integer
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".
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).
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
shared method | MIDI | MBS Audio Plugin | 5.2 | Yes | Yes | Yes | Yes | No |
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 are | MMSystem, 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". |
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).
PortMidiMBS.DeviceInfo(DeviceID as Integer) as PortMidiDeviceInfoMBS
Function:
Returns information about a certain device.
Example:
Notes:
Returns nil on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
shared method | MIDI | MBS Audio Plugin | 5.2 | Yes | Yes | Yes | Yes | No |
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
PortMidiMBS.ErrorText(ErrorNumber as Integer) as string
Function:
The error text for the given error code.
Notes: Returns "" on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
shared method | MIDI | MBS Audio Plugin | 5.2 | Yes | Yes | Yes | Yes | No |
Notes: Returns "" on any error.
PortMidiMBS.Initialize as Integer
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)
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
shared method | MIDI | MBS Audio Plugin | 16.3 | Yes | Yes | Yes | Yes | No |
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)
PortMidiMBS.ReInitialize as Integer
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
shared method | MIDI | MBS Audio Plugin | 9.4 | Yes | Yes | Yes | Yes | No |
Notes:
As PortMidi does not recognize the attachment of new MIdi devices, you can only reinitialize.
Returns a PortMidi error code.
The items on this page are in the following plugins: MBS Audio Plugin.
Links
MBS Xojo Plugins