Class: MIDIMessage::SystemExclusive::Command

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/midi-message/system_exclusive.rb

Overview

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

Constant Summary collapse

TypeByte =

alias_method :value=, :data=

0x12

Constants included from Base

Base::EndByte, Base::StartByte

Instance Attribute Summary collapse

Attributes included from Base

#address, #checksum, #node

Instance Method Summary collapse

Methods included from Base

#name, #to_a, #to_hex_s, #to_numeric_byte_array, #type_byte

Constructor Details

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

Returns a new instance of Command.



89
90
91
92
93
# File 'lib/midi-message/system_exclusive.rb', line 89

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

Instance Attribute Details

#dataObject Also known as: value

Returns the value of attribute data.



83
84
85
# File 'lib/midi-message/system_exclusive.rb', line 83

def data
  @data
end