Module: Musa::Neumas::Decoders
- Defined in:
- lib/musa-dsl/neumas/neuma-decoder.rb,
lib/musa-dsl/neumas/neuma-gdv-decoder.rb,
lib/musa-dsl/neumas/neuma-gdvd-decoder.rb
Overview
Neuma decoder infrastructure for converting neuma notation to musical events.
Provides base classes for decoding neuma notation (a musical representation format) into GDV (Grade-Duration-Velocity) events. The decoder system supports differential decoding where each event is interpreted relative to the previous event.
Architecture Overview
Decoder Hierarchy
ProtoDecoder (abstract)
Key Concepts
- Differential Decoding: Each neuma is interpreted relative to previous state
- Grade:
+2means "2 steps up from last note" - Duration:
_2means "double the base duration"
Stateful Processing: Decoders maintain
@laststate for differential interpretationSubcontexts: Create independent decoder contexts for nested structures
Transcription Integration: Optional transcriptor for post-processing (ornaments, etc.)
Processing Pipeline
Neuma Input
Neuma Notation
Neumas are text-based musical notation:
"0 +2 +2 -1" # Grade sequence (scale degrees)
"_ _2 _/2" # Duration modifiers
".st .tr .mor" # Articulation/ornament modifiers
"(+1_/4)+2_" # Appogiatura (grace note) + main note
Decoders are used by the neuma parsing system:
decoder = Musa::Neumas::Decoders::NeumaDecoder.new(
scale,
base_duration: 1/4r,
transcriptor: transcriptor
)
# Parse and decode neuma string
neumas = "0 +2 +2 -1 0".to_neumas
neumas.each { |neuma| decoder.decode(neuma) }
Defined Under Namespace
Classes: Decoder, DifferentialDecoder, NeumaDecoder, NeumaDifferentialDecoder, ProtoDecoder