Module: Musa::Transcriptors::FromGDV::ToMIDI
- Defined in:
- lib/musa-dsl/transcription/from-gdv-to-midi.rb
Overview
MIDI-specific GDV transcriptors for playback output.
Transcribes GDV events to MIDI playback format by expanding ornaments and articulations into explicit note sequences. Unlike MusicXML transcription, MIDI transcription generates the actual notes to be played.
MIDI vs MusicXML Approach
MIDI transcription expands ornaments for playback:
- MIDI: Ornaments become explicit note sequences with calculated durations
- MusicXML: Ornaments preserved as notation symbols
Supported Ornaments & Articulations
- Appogiatura (
:appogiatura): Grace note before main note - Mordent (
.mor): Quick alternation with adjacent note - Turn (
.turn): Four-note figure circling main note - Trill (
.tr): Rapid alternation with upper note - Staccato (
.st): Shortened note duration
Duration Factor
Many ornaments use a configurable duration_factor (default 1/4) to determine
ornament note durations relative to base_duration:
ornament_duration = base_duration * duration_factor
Usage
transcriptor = Musa::Transcription::Transcriptor.new(
Musa::Transcriptors::FromGDV::ToMIDI.transcription_set(duration_factor: 1/8r),
base_duration: 1/4r,
tick_duration: 1/96r
)
result = transcriptor.transcript(gdv_event)
Transcription Set
The transcription_set returns transcriptors applied in order:
Appogiatura- Expand appogiatura grace notesMordent- Expand mordent ornamentsTurn- Expand turn ornamentsTrill- Expand trill ornamentsStaccato- Apply staccato articulationBase- Process base/rest markers
Defined Under Namespace
Classes: Appogiatura, Mordent, Staccato, Trill, Turn
Class Method Summary collapse
-
.transcription_set(duration_factor: nil) ⇒ Array<FeatureTranscriptor>
Returns standard transcription set for MIDI output.
Class Method Details
.transcription_set(duration_factor: nil) ⇒ Array<FeatureTranscriptor>
Returns standard transcription set for MIDI output.
Creates array of transcriptors for processing GDV to MIDI playback format, expanding all ornaments to explicit note sequences.
95 96 97 98 99 100 101 102 |
# File 'lib/musa-dsl/transcription/from-gdv-to-midi.rb', line 95 def self.transcription_set(duration_factor: nil) [ Appogiatura.new, Mordent.new(duration_factor: duration_factor), Turn.new, Trill.new(duration_factor: duration_factor), Staccato.new, Base.new ] end |