Class: MIDIMessage::SystemCommon

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

Overview

MIDI System-Common message

Constant Summary collapse

ID =
0x1..0x6
DISPLAY_NAME =
"System Common"

Constants included from SystemMessage

MIDIMessage::SystemMessage::STATUS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SystemMessage

included, #strip_redundant_nibble

Constructor Details

#initialize(*args) ⇒ SystemCommon

Returns a new instance of SystemCommon.



134
135
136
137
138
139
140
141
# File 'lib/midi-message/messages.rb', line 134

def initialize(*args)
  options = args.last.kind_of?(Hash) ? args.pop : {}
  @const = options[:const]
  id = @const.nil? ? args.shift : @const.value
  id = strip_redundant_nibble(id)
  initialize_message(SystemMessage::STATUS, id)
  @data = args.slice(0..1)
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



132
133
134
# File 'lib/midi-message/messages.rb', line 132

def data
  @data
end