Class: MIDIEvents::SystemRealtime
- Inherits:
-
Object
- Object
- MIDIEvents::SystemRealtime
- Includes:
- SystemMessage
- Defined in:
- lib/midi-events/messages.rb
Overview
MIDI System-Realtime message
Constant Summary collapse
- ID =
(0x8..0xF).freeze
- DISPLAY_NAME =
'System Realtime'.freeze
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(*args) ⇒ SystemRealtime
constructor
A new instance of SystemRealtime.
-
#strip_redundant_nibble(byte) ⇒ Fixnum
included
from SystemMessage
In the case of something like SystemCommon.new(0xF2, 0x00, 0x08), the first nibble F is redundant because all system messages start with 0xF and it can be assumed.
Constructor Details
#initialize(*args) ⇒ SystemRealtime
Returns a new instance of SystemRealtime.
137 138 139 140 141 142 143 |
# File 'lib/midi-events/messages.rb', line 137 def initialize(*args) = args.last.is_a?(Hash) ? args.pop : {} @const = [:const] id = @const.nil? ? args.first : @const.value id = strip_redundant_nibble(id) (SystemMessage::STATUS, id) end |
Instance Method Details
#id ⇒ Object
145 146 147 |
# File 'lib/midi-events/messages.rb', line 145 def id @status[1] end |
#strip_redundant_nibble(byte) ⇒ Fixnum Originally defined in module SystemMessage
In the case of something like SystemCommon.new(0xF2, 0x00, 0x08), the first nibble F is redundant because all system messages start with 0xF and it can be assumed. However, the this method looks to see if this has occurred and strips the redundancy