unreal.MIDIDeviceManager

class unreal.MIDIDeviceManager(outer: Object | None = None, name: Name | str = 'None')

Bases: BlueprintFunctionLibrary

MIDIDevice Manager

C++ Source:

  • Plugin: MIDIDevice

  • Module: MIDIDevice

  • File: MIDIDeviceManager.h

classmethod create_midi_device_controller(device_id, midi_buffer_size=1024) MIDIDeviceController

Creates an instance of a MIDI device controller that can be used to interact with a connected MIDI device

Parameters:
  • device_id (int32) – The ID of the MIDI device you want to talk to. Call “Find MIDI Devices” to enumerate the available devices.

  • midi_buffer_size (int32) – How large the buffer size (in number of MIDI events) should be for incoming MIDI data. Larger values can incur higher latency costs for incoming events, but don’t set it too low or you’ll miss events and your stuff will sound bad.

Returns:

If everything goes okay, a valid MIDI device controller object will be returned. If anything goes wrong, a null reference will be returned.

Return type:

MIDIDeviceController

classmethod create_midi_device_input_controller(device_id, midi_buffer_size=1024) MIDIDeviceInputController

Creates an instance of a MIDI device controller that can be used to interact with a connected MIDI device

Parameters:
  • device_id (int32) – The ID of the MIDI device you want to talk to. Call “Find MIDI Devices” to enumerate the available devices.

  • midi_buffer_size (int32) – How large the buffer size (in number of MIDI events) should be for incoming MIDI data. Larger values can incur higher latency costs for incoming events, but don’t set it too low or you’ll miss events and your stuff will sound bad.

Returns:

If everything goes okay, a valid MIDI device controller object will be returned. If anything goes wrong, a null reference will be returned.

Return type:

MIDIDeviceInputController

classmethod create_midi_device_output_controller(device_id) MIDIDeviceOutputController

Creates an instance of a MIDI output device controller that can be used to interact with a connected MIDI device

Parameters:

device_id (int32) – The ID of the MIDI device you want to talk to. Call “Find MIDI Devices” to enumerate the available devices.

Returns:

If everything goes okay, a valid MIDI device controller object will be returned. If anything goes wrong, a null reference will be returned.

Return type:

MIDIDeviceOutputController

classmethod find_all_midi_device_info() -> (out_midi_input_devices=Array[MIDIDeviceInfo], out_midi_output_devices=Array[MIDIDeviceInfo])

Enumerates all of the MIDI input and output devices and reports back useful infos such as IDs and names of those devices. This operation is a little expensive so only do it once at startup, or if you think that a new device may have been connected.

Returns:

out_midi_input_devices (Array[MIDIDeviceInfo]): A list of available MIDI Input devices

out_midi_output_devices (Array[MIDIDeviceInfo]): A list of available MIDI Output devices

Return type:

tuple

classmethod find_midi_devices() Array[FoundMIDIDevice]

Enumerates all of the connected MIDI devices and reports back with the IDs and names of those devices. This operation is a little expensive so only do it once at startup, or if you think that a new device may have been connected.

Returns:

out_midi_devices (Array[FoundMIDIDevice]): A list of available MIDI devices

Return type:

Array[FoundMIDIDevice]

classmethod get_default_midi_input_device_id() int32

Retrieves the default MIDI input device ID. Call “Find All MIDI Device Info” beforehand to enumerate the available input devices.

Returns:

device_id (int32): The Device ID of the MIDI input device with that name.

Return type:

int32

classmethod get_default_midi_output_device_id() int32

Retrieves the default MIDI output device ID. Call “Find All MIDI Device Info” beforehand to enumerate the available input devices.

Returns:

device_id (int32): The Device ID of the MIDI output device with that name.

Return type:

int32

classmethod get_midi_input_device_id_by_name(device_name) int32

Retrieves the MIDI input device ID by name. Call “Find All MIDI Device Info” beforehand to enumerate the available input devices.

Parameters:

device_name (str) – The Name of the MIDI device you want to talk to.

Returns:

device_id (int32): The Device ID of the MIDI device with that name.

Return type:

int32

classmethod get_midi_output_device_id_by_name(device_name) int32

Retrieves the MIDI output device ID by name. Call “Find All MIDI Device Info” beforehand to enumerate the available output devices.

Parameters:

device_name (str) – The Name of the MIDI device you want to talk to.

Returns:

device_id (int32): The Device ID of the MIDI output device associated with that name.

Return type:

int32

classmethod shut_down_all_midi_devices() None

Shuts down any existing midi devices to ensure no dangling streams are left, and mark any input or output controller for cleanup