Class: MicroMIDI::Instructions::SysEx

Inherits:
Object
  • Object
show all
Includes:
MIDIMessage
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.



11
12
13
# File 'lib/micromidi/instructions/sysex.rb', line 11

def initialize(state)
  @state = state
end

Instance Method Details

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

create a sysex command



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

def sysex_command(address, data, options = {})
  options[:sysex_node] ||= options[:node]
  props = @state.message_properties(options, :sysex_node)
  SystemExclusive::Command.new(address, data, :node => props[:sysex_node])
end

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

create an indeterminate sysex message



32
33
34
35
36
# File 'lib/micromidi/instructions/sysex.rb', line 32

def sysex_message(data, options = {})
  options[:sysex_node] ||= options[:node]
  props = @state.message_properties(options, :sysex_node)
  SystemExclusive::Message.new(data, :node => props[:sysex_node])
end

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

create a sysex request



24
25
26
27
28
# File 'lib/micromidi/instructions/sysex.rb', line 24

def sysex_request(address, size, options = {})
  options[:sysex_node] ||= options[:node]
  props = @state.message_properties(options, :sysex_node)
  SystemExclusive::Request.new(address, size, :node => props[:sysex_node])        
end