om-sharp
om-sharp copied to clipboard
XML import/export
Todo:
- import
- export
- Menus in score editors
MusicXML Import done and commited in: c6fa2e94
Notes about MusicXML export
Most of the code is already there (in musicxml-export.lisp) but needs some cleanup and rewriting (and testing!).
In particular: the whole duration/subdivision system (e.g. for groups, beams, etc.) needs to be rewritten. There is no more extent/qvalue in OM# musical objects: in principle this is all more "flat" and simple, with the slots "symbolic-date" and "symbolic-dur" that are bound to chords and rests according to the tree at initializing/updating the voice. The resulting code for export-musicxml should be much simpler / more readable than the current one.
Related threads:
- https://discussion.forum.ircam.fr/t/exporting-musicxml/20728/19
- https://github.com/cac-t-u-s/om-sharp-users/issues/19
- https://github.com/cac-t-u-s/om-sharp-users/issues/65
https://github.com/cac-t-u-s/om-sharp/issues/352
@smoge moving your comment and pointer here:
For reference, if the module is the same one from openmusic, this discussion is relevant, and points out some problems that need attention (for example: dorico supports musixml 3+, and some applications have problems with rationals, that would need to be checked again today) https://discussion.forum.ircam.fr/t/xml-and-dorico/2449/3
Thanks. I think there is no point in "disputing" the correct implementation.
Since musicxml is a bad standard, one must be pragmatic. I think we should avoid using rational numbers, this way we avoid some problems. And also, it would be important to adopt the musicxml3 or musicxml4 standard, for dorico compatibility. I believe nested tuplets just works on musescore and dorico:
<measure number="23">
<note>
<pitch>
<step>C</step>
<octave>5</octave>
</pitch>
<duration>24</duration>
<voice>1</voice>
<type>quarter</type>
<time-modification>
<actual-notes>3</actual-notes>
<normal-notes>2</normal-notes>
</time-modification>
<stem default-y="-50">down</stem>
<notations>
<tuplet bracket="yes" number="1" placement="above" type="start"/>
</notations>
</note>
<note>
<pitch>
<step>B</step>
<octave>4</octave>
</pitch>
<duration>24</duration>
<voice>1</voice>
<type>quarter</type>
<time-modification>
<actual-notes>3</actual-notes>
<normal-notes>2</normal-notes>
</time-modification>
<stem default-y="-55">down</stem>
</note>
<note>
<pitch>
<step>A</step>
<octave>4</octave>
</pitch>
<duration>8</duration>
<voice>1</voice>
<type>eighth</type>
<time-modification>
<actual-notes>9</actual-notes>
<normal-notes>4</normal-notes>
<normal-type>quarter</normal-type>
</time-modification>
<stem default-y="10">up</stem>
<beam number="1">begin</beam>
<notations>
<tuplet number="2" bracket="no" placement="above" type="start">
<tuplet-actual>
<tuplet-number>3</tuplet-number>
<tuplet-type>eighth</tuplet-type>
</tuplet-actual>
<tuplet-normal>
<tuplet-number>1</tuplet-number>
<tuplet-type>quarter</tuplet-type>
</tuplet-normal>
</tuplet>
</notations>
</note>
<note>
<pitch>
<step>G</step>
<octave>4</octave>
</pitch>
<duration>8</duration>
<voice>1</voice>
<type>eighth</type>
<time-modification>
<actual-notes>9</actual-notes>
<normal-notes>4</normal-notes>
<normal-type>quarter</normal-type>
</time-modification>
<stem default-y="8">up</stem>
<beam number="1">continue</beam>
</note>
<note>
<pitch>
<step>F</step>
<octave>4</octave>
</pitch>
<duration>8</duration>
<voice>1</voice>
<type>eighth</type>
<time-modification>
<actual-notes>9</actual-notes>
<normal-notes>4</normal-notes>
<normal-type>quarter</normal-type>
</time-modification>
<stem default-y="5">up</stem>
<beam number="1">end</beam>
<notations>
<tuplet number="1" type="stop"/>
<tuplet number="2" type="stop"/>
</notations>
</note>
</measure>