module

PortMIDI

A wrapper around the non-stream-specific LibPortMIDI C bindings, plus some convenience functions for packing and unpacking PortMidi messages and to output midi device information.

Constants

VERSION = "0.1.0"

Class methods

bytes(event : LibPortMIDI::Event) : StaticArray(UInt8, 4)

Returns an array of the four bytes contained in a PortMidi event.

Source
bytes(message : UInt32) : StaticArray(UInt8, 4)

Returns an array of the four bytes contained in a PortMidi message.

Source
count_devices

Returns the number of attached MIDI input and output devices.

Source
data1(message : UInt32) : UInt8

Extracts the first data byte from a PortMidi message.

Source
data2(message : UInt32) : UInt8

Extracts the second data byte from a PortMidi message.

Source
get_default_input_device_id

Returns the default input device ID, as defined by PortMidi.

Source
get_default_output_device_id

Returns the default output device ID, as defined by PortMidi.

Source
get_device_info(device_id : Int32) : DeviceInfo

Returns a DeviceInfo for device device_id.

Source
get_error_text(errnum : LibPortMIDI::PmError) : String

Returns the error message that corresponds to errnum. Note that calling this method clears the error flag used by the code underlying PmStream#host_error?.

Source
init

Initializes the PortMidi system.

Source
list_all_devices

Lists all MIDI inputs and outputs, along with the port numbers that need to be passed to LibPortMIDI.

Source
message(status, data1, data2) : UInt32

Creates a PortMidi message from three MIDI bytes.

Source
raise_error(err : LibPortMIDI::PmError, msg : String)

Given err, creates and raises an instance of the corresponding Exception subclass with the given msg.

Source
status(message : UInt32) : UInt8

Extracts the status byte from a PortMidi message.

Source
terminate

Terminates PortMidi.

Source

Nested types