Class: Musa::Transcriptors::FromGDV::ToMusicXML::Appogiatura
- Inherits:
-
Musa::Transcription::FeatureTranscriptor
- Object
- Musa::Transcription::FeatureTranscriptor
- Musa::Transcriptors::FromGDV::ToMusicXML::Appogiatura
- Defined in:
- lib/musa-dsl/transcription/from-gdv-to-musicxml.rb
Overview
Appogiatura transcriptor for MusicXML notation.
Processes appogiatura ornaments, marking them as grace notes for MusicXML
output rather than expanding to explicit note sequences. The grace note
relationship is preserved through :grace, :graced, and :graced_by
attributes.
Appogiatura Format
Input GDV with :appogiatura key:
{
grade: 0,
duration: 1r,
appogiatura: { grade: -1, duration: 1/8r }
}
Output (array of two events):
[
{ grade: -1, duration: 1/8r, grace: true }, # Grace note
{ grade: 0, duration: 1r, graced: true, graced_by: ... } # Main note
]
MusicXML Representation
The :grace attribute indicates the note should be rendered as a grace
note in the score. The :graced_by reference allows the notation engine
to properly link the grace note to its principal note.
Process: appogiatura (neuma)neuma
Instance Method Summary collapse
-
#transcript(gdv, base_duration:, tick_duration:) ⇒ Array<Hash>, Hash
Transcribes GDV appogiatura to grace note representation.
Instance Method Details
#transcript(gdv, base_duration:, tick_duration:) ⇒ Array<Hash>, Hash
Transcribes GDV appogiatura to grace note representation.
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/musa-dsl/transcription/from-gdv-to-musicxml.rb', line 131 def transcript(gdv, base_duration:, tick_duration:) if gdv_appogiatura = gdv[:appogiatura] gdv.delete :appogiatura # TODO process with Decorators the gdv_appogiatura # TODO implement also posterior appogiatura neuma(neuma) # TODO implement also multiple appogiatura with several notes (neuma ... neuma)neuma or neuma(neuma ... neuma) gdv_appogiatura[:grace] = true gdv[:graced] = true gdv[:graced_by] = gdv_appogiatura [ gdv_appogiatura, gdv ] else gdv end end |