Class: MIDIMessage::SystemCommon

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

Overview

MIDI System-Common message

Instance Attribute Summary collapse

Attributes included from ShortMessage

#name, #status, #verbose_name

Instance Method Summary collapse

Methods included from ShortMessage

#initialize_short_message, #to_a, #to_hex_s

Constructor Details

#initialize(*a) ⇒ SystemCommon

Returns a new instance of SystemCommon.



16
17
18
19
20
21
22
# File 'lib/midi-message/system_message.rb', line 16

def initialize(*a)
  options = a.last.kind_of?(Hash) ? a.pop : {}
  @const = options[:const]
  @data = [a[1], a[2]]
  second_nibble = @const.nil? ? a[0] : @const.value 
  initialize_short_message(0xF, second_nibble)
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



14
15
16
# File 'lib/midi-message/system_message.rb', line 14

def data
  @data
end