module PortMIDI
Overview
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.
Defined in:
port_midi/port_midi.crConstant Summary
-
VERSION =
"0.1.0"
Class Method Summary
-
.bytes(event : LibPortMIDI::Event) : StaticArray(UInt8, 4)
Returns an array of the four bytes contained in a PortMidi event.
-
.bytes(message : UInt32) : StaticArray(UInt8, 4)
Returns an array of the four bytes contained in a PortMidi message.
-
.count_devices : Int32
Returns the number of attached MIDI input and output devices.
-
.data1(message : UInt32) : UInt8
Extracts the first data byte from a PortMidi message.
-
.data2(message : UInt32) : UInt8
Extracts the second data byte from a PortMidi message.
-
.get_default_input_device_id : Int32
Returns the default input device ID, as defined by PortMidi.
-
.get_default_output_device_id : Int32
Returns the default output device ID, as defined by PortMidi.
-
.get_device_info(device_id : Int32) : DeviceInfo
Returns a
DeviceInfofor device device_id. -
.get_error_text(errnum : LibPortMIDI::PmError) : String
Returns the error message that corresponds to
errnum. -
.init
Initializes the PortMidi system.
-
.list_all_devices
Lists all MIDI inputs and outputs, along with the port numbers that need to be passed to
LibPortMIDI. -
.message(status, data1, data2) : UInt32
Creates a PortMidi message from three MIDI bytes.
-
.raise_error(err : LibPortMIDI::PmError, msg : String)
Given err, creates and raises an instance of the corresponding
Exceptionsubclass with the given msg. -
.status(message : UInt32) : UInt8
Extracts the status byte from a PortMidi message.
-
.terminate
Terminates PortMidi.
Class Method Detail
Returns an array of the four bytes contained in a PortMidi event.
Returns an array of the four bytes contained in a PortMidi message.
Returns the default input device ID, as defined by PortMidi.
Returns the default output device ID, as defined by PortMidi.
Returns a DeviceInfo for device device_id.
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?.
Lists all MIDI inputs and outputs, along with the port numbers that need
to be passed to LibPortMIDI.
Given err, creates and raises an instance of the corresponding
Exception subclass with the given msg.