Module: MIDIEvents::Constant::Status

Extended by:
Status
Included in:
Status
Defined in:
lib/midi-events/constant.rb

Overview

Shortcuts for dealing with MIDI status bytes

Provides quick lookup of status byte values by their human-readable names (e.g., "Note On" => 0x9).

Examples:

MIDIEvents::Constant::Status['Note On']  # => 0x9
MIDIEvents::Constant::Status['Control Change']  # => 0xB

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.find(status_name) ⇒ Integer? Also known as: []

Find a status byte value by its name

Parameters:

  • status_name (String, Symbol)

    The name of the status (e.g., "Note On")

Returns:

  • (Integer, nil)

    The status nibble value or nil if not found



257
258
259
260
# File 'lib/midi-events/constant.rb', line 257

def find(status_name)
  const = Constant.find('Status', status_name)
  const&.value
end

Instance Method Details

#find(status_name) ⇒ Integer? Also known as: []

Find a status byte value by its name

Parameters:

  • status_name (String, Symbol)

    The name of the status (e.g., "Note On")

Returns:

  • (Integer, nil)

    The status nibble value or nil if not found



257
258
259
260
# File 'lib/midi-events/constant.rb', line 257

def find(status_name)
  const = Constant.find('Status', status_name)
  const&.value
end