Module: MIDIMessage::SystemMessage

Included in:
SystemCommon, SystemRealtime
Defined in:
lib/midi-message/system_message.rb

Overview

MIDI System message

Instance Method Summary collapse

Instance Method Details

#strip_redundant_nibble(byte) ⇒ Integer

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

Parameters:

  • byte (Integer)

    The byte to strip of a redundant 0xF

Returns:

  • (Integer)

    The remaining nibble



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

def strip_redundant_nibble(byte)
  byte > 0xF ? (byte & 0x0F) : byte
end