Class: MIDIMessage::SystemCommon
- Inherits:
-
Object
- Object
- MIDIMessage::SystemCommon
- Includes:
- ShortMessage
- Defined in:
- lib/midi-message/system_message.rb
Overview
MIDI System-Common message
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Attributes included from ShortMessage
Instance Method Summary collapse
-
#initialize(*a) ⇒ SystemCommon
constructor
A new instance of SystemCommon.
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) = a.last.kind_of?(Hash) ? a.pop : {} @const = [:const] @data = [a[1], a[2]] second_nibble = @const.nil? ? a[0] : @const.value (0xF, second_nibble) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
14 15 16 |
# File 'lib/midi-message/system_message.rb', line 14 def data @data end |