Class: MicroMIDI::Instructions::SysEx

Inherits:
Object
  • Object
show all
Defined in:
lib/micromidi/instructions/sysex.rb,
lib/micromidi/instructions/shorthand.rb

Instance Method Summary collapse

Constructor Details

#initialize(state) ⇒ SysEx

Returns a new instance of SysEx.

Parameters:


8
9
10
# File 'lib/micromidi/instructions/sysex.rb', line 8

def initialize(state)
  @state = state
end

Instance Method Details

#sysex_command(address, data, options = {}) ⇒ MIDIMessage::SystemExclusive::Command Also known as: command, sc

Create a sysex command message

Parameters:

  • address (Fixnum)
  • data (Array<Fixnum>)
  • options (Hash) (defaults to: {})

Options Hash (options):

  • :node (MIDIMessage::SystemExclusive::Node) — default: also :sysex_node

Returns:

  • (MIDIMessage::SystemExclusive::Command)

18
19
20
21
# File 'lib/micromidi/instructions/sysex.rb', line 18

def sysex_command(address, data, options = {})
  properties = sysex_properties(options)
  MIDIMessage::SystemExclusive::Command.new(address, data, :node => properties[:sysex_node])
end

#sysex_message(data, options = {}) ⇒ MIDIMessage::SystemExclusive::Message Also known as: sysex, sx

Create a generic sysex message

Parameters:

  • data (Array<Fixnum>)
  • options (Hash) (defaults to: {})

Options Hash (options):

  • :node (MIDIMessage::SystemExclusive::Node) — default: also :sysex_node

Returns:

  • (MIDIMessage::SystemExclusive::Message)

41
42
43
44
# File 'lib/micromidi/instructions/sysex.rb', line 41

def sysex_message(data, options = {})
  properties = sysex_properties(options)
  MIDIMessage::SystemExclusive::Message.new(data, :node => properties[:sysex_node])
end

#sysex_request(address, size, options = {}) ⇒ MIDIMessage::SystemExclusive::Request Also known as: request, sr

Create a sysex request message

Parameters:

  • address (Fixnum)
  • size (Fixnum)
  • options (Hash) (defaults to: {})

Options Hash (options):

  • :node (MIDIMessage::SystemExclusive::Node) — default: also :sysex_node

Returns:

  • (MIDIMessage::SystemExclusive::Request)

30
31
32
33
# File 'lib/micromidi/instructions/sysex.rb', line 30

def sysex_request(address, size, options = {})
  properties = sysex_properties(options)
  MIDIMessage::SystemExclusive::Request.new(address, size, :node => properties[:sysex_node])
end