Class: MIDIMessage::SystemExclusive::Command

Inherits:
Object
  • Object
show all
Includes:
MIDIMessage::SystemExclusive
Defined in:
lib/midi-message/messages.rb

Overview

A SysEx command message A command message is identified by having a status byte equal to 0x12

Constant Summary collapse

TypeByte =
0x12

Constants included from MIDIMessage

ChannelPressure, Controller, PolyAftertouch, PolyPressure, PolyphonicPressure, VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from MIDIMessage::SystemExclusive

included, new

Methods included from MIDIMessage

parse, with_context

Constructor Details

#initialize(address, data, options = {}) ⇒ Command

Returns a new instance of Command.



159
160
161
162
163
164
165
166
167
# File 'lib/midi-message/messages.rb', line 159

def initialize(address, data, options = {})
  # store as a byte if it's a single byte
  @data = if data.kind_of?(Array) && data.length == 1
    data.first
  else
    data
  end
  initialize_sysex(address, options)
end

Instance Attribute Details

#dataObject Also known as: value

Returns the value of attribute data.



154
155
156
# File 'lib/midi-message/messages.rb', line 154

def data
  @data
end