Table of Contents

Namespace Celeritas.Core.Notation

Classes

MusicXmlIo

Imports MusicXML into the engine's NoteBuffer / NoteEvent model.

This pass handles the common core of score-partwise: pitched notes (step/octave/alter), rests, chords (<chord/>), per-measure <divisions>, multiple measures, multiple parts (merged into one time line), <backup>/ <forward> cursor moves, and tie merging (a <tie> chain becomes one sustained note). Times are converted to the engine's whole-note units.

Multi-voice parts import correctly because voice timing rides on <backup>/ <forward>, and dynamics (<dynamics> marks and <sound dynamics>) set note velocity (and single-voice export writes velocity back as <sound dynamics>). Compressed .mxl archives are unwrapped and the score-timewise layout is transposed to partwise on import; grace notes are approximated as short notes at the following beat. Remaining boundaries: tuplet grouping metadata (<time-modification>) is ignored, though tuplet durations import exactly; and an <unpitched> note (a hit on a percussion staff) is not imported — it takes up its time and yields no note, since the engine holds pitches and a drum has none. Export bars the timeline into measures of the requested meter (4/4 unless one is given) and splits notes crossing a barline into tied segments.

Pitches are sounding pitches. A transposing instrument's part is written at written pitch and declares the difference in <attributes><transpose> (<chromatic> semitones plus <octave-change> octaves); import adds that offset to every note of the part from the point the element appears — per staff, when the element carries a number — so a B♭ clarinet's written D5 imports as the C5 it sounds. Export writes concert pitch and no <transpose>, since the buffer holds nothing else.