Class: MIDIEvents::SystemCommon

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

Overview

MIDI System-Common message

Constant Summary collapse

ID =
(0x1..0x6).freeze
DISPLAY_NAME =
'System Common'.freeze

Constants included from SystemMessage

MIDIEvents::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.



118
119
120
121
122
123
124
125
# File 'lib/midi-events/messages.rb', line 118

def initialize(*args)
  options = args.last.is_a?(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.



116
117
118
# File 'lib/midi-events/messages.rb', line 116

def data
  @data
end