-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XML: Start supporting manual Beam #120
base: master
Are you sure you want to change the base?
Conversation
Export "first" beam. This works only with regular eighth note beams. Anything else won't work. Only beam nr 1 is created and ended. But if more than one beam is involved they have to be encoded all. That means a) we have to check the number of beams at [ and ] b) we have to check at each note if it is beamed, and if so the current number of beams has to be calculated. (seems challenging)
To get more specific: {
a'8 [ b'16 a' ]
} will be exported to (excerpt) <measure number="1">
<attributes>
<divisions>8</divisions>
<time symbol="common">
<beats>4</beats>
<beat-type>4</beat-type>
</time>
<clef>
<sign>G</sign>
<line>2</line>
</clef>
</attributes>
<note>
<pitch>
<step>A</step>
<octave>4</octave>
</pitch>
<duration>4</duration>
<voice>1</voice>
<type>eighth</type>
<beam number="1">begin</beam>
</note>
<note>
<pitch>
<step>B</step>
<octave>4</octave>
</pitch>
<duration>2</duration>
<voice>1</voice>
<type>16th</type>
</note>
<note>
<pitch>
<step>A</step>
<octave>4</octave>
</pitch>
<duration>2</duration>
<voice>1</voice>
<type>16th</type>
<beam number="1">end</beam>
</note>
</measure> This correctly represents the beginning and end of the beam, and it would work if there is only one quaver beam. But MusicXML requires all intermediate states to be encoded in detail. The correct way to represent the music in XML is <note>
<pitch>
<step>A</step>
<octave>4</octave>
</pitch>
<duration>4</duration>
<voice>1</voice>
<type>eighth</type>
<beam number="1">begin</beam>
</note>
<note>
<pitch>
<step>B</step>
<octave>4</octave>
</pitch>
<duration>2</duration>
<voice>1</voice>
<type>16th</type>
<beam number="1">continue</beam>
<beam number="2">begin</beam>
</note>
<note>
<pitch>
<step>A</step>
<octave>4</octave>
</pitch>
<duration>2</duration>
<voice>1</voice>
<type>16th</type>
<beam number="1">end</beam>
<beam number="2">end</beam>
</note> In order to achieve this we'd have to keep track of |
As described in http://lists.gnu.org/archive/html/lilypond-user/2018-05/msg00128.html there is the possibility to simply encode *one* beam and add <beam>continue</beam> to each enclosed note. This is no correct MusicXML, but it will correctly be loaded by MuseScore and Verovio (test at http://www.verovio.org/musicxml.html). If we agree to stick with that halfway solution (at least for now) I think we can now (after adding a test file) merge this.
Tests for correctly handling the incorrect XML (encoding a single beam):
|
OK, it seems all major programs properly handle the subpar code exported after this Pull Request. While it is definitely not satisfying not to have a proper translation of the beaming pattern to correct MusicXML representation I think this is definitely an improvement and should be merged (other coding issues notwithstanding ...) |
@PeterBjuhr any chance to review these pull requests? I just stumbled over them again ... |
Export "first" beam.
This works only with regular eighth note beams. Anything else won't work.
Only beam nr 1 is created and ended.
But if more than one beam is involved they have to be encoded all.
That means
a) we have to check the number of beams at [ and ]
b) we have to check at each note if it is beamed, and if so
the current number of beams has to be calculated.
(seems challenging)