Module: MIDIMessage::SystemMessage
- Included in:
- SystemCommon, SystemRealtime
- Defined in:
- lib/midi-message/system_message.rb
Overview
Common MIDI system message behavior
Class Method Summary collapse
Instance Method Summary collapse
-
#strip_redundant_nibble(byte) ⇒ Fixnum
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.
Class Method Details
.included(base) ⇒ Object
6 7 8 |
# File 'lib/midi-message/system_message.rb', line 6 def self.included(base) base.send(:include, Message) end |
Instance Method Details
#strip_redundant_nibble(byte) ⇒ Fixnum
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
15 16 17 |
# File 'lib/midi-message/system_message.rb', line 15 def strip_redundant_nibble(byte) byte > 0xF ? (byte & 0x0F) : byte end |