Module: MIDIEvents::Constant
- Defined in:
- lib/midi-events/constant.rb
Overview
MIDI constant lookups and mappings
Provides a flexible system for referring to MIDI messages by their human-readable names instead of numeric values. For example, "C4" for MIDI note 60, or "Bank Select" for MIDI control change 0.
Constants are loaded from a YAML dictionary (midi.yml) and organized into groups (Notes, Control Changes, Status bytes, etc.).
Defined Under Namespace
Modules: Loader, Name, Status Classes: Group, Map, MessageBuilder
Class Method Summary collapse
-
.find(group_name, const_name) ⇒ MIDIEvents::Constant::Map?
Get a Mapping object for the specified constant.
-
.value(group_name, const_name) ⇒ Object
Get the value of the specified constant.
Class Method Details
.find(group_name, const_name) ⇒ MIDIEvents::Constant::Map?
Get a Mapping object for the specified constant
29 30 31 32 |
# File 'lib/midi-events/constant.rb', line 29 def self.find(group_name, const_name) group = Group[group_name] group.find(const_name) end |
.value(group_name, const_name) ⇒ Object
Get the value of the specified constant
38 39 40 41 |
# File 'lib/midi-events/constant.rb', line 38 def self.value(group_name, const_name) map = find(group_name, const_name) map.value end |