jacques-menu / musicformats

The code base, documentation and examples of textual music scores formats handling and conversions tools
Mozilla Public License 2.0
2 stars 2 forks source link

xml2ly: Cryptic warning for old tremolo code #8

Open lemzwerg opened 5 months ago

lemzwerg commented 5 months ago

[ef5018a8347cc3762c2f0b401e6389e186ff1cba]

Consider the MusicXML file in the attached archive and process it with

xml2ly tremolo.xml > tremolo.ly

This old tremolo code makes xml2ly emit a very cryptic message (\ inserted by me to increase readability), followed by another, very similar message:

*** MSR INTERNAL warning *** tremolo.xml:81: \
measure [Measure 2, kMeasureKindUnknown***, \
Part_P1_Staff_1_Voice_1, fMeasureOrdinalNumberInVoice: 2, \
fMeasurePuristNumber: 2, fMeasureDebugNumber: '5', \
2 elements, line 81] \
is kMeasureRepeatContext_UNKNOWN_ [Measure 2, \
kMeasureKindUnknown***, Part_P1_Staff_1_Voice_1, \
fMeasureOrdinalNumberInVoice: 2, fMeasurePuristNumber: 2, \
fMeasureDebugNumber: '5', \
2 elements, line 81], \
line 81 -- measure 2/3, part: \
Part_P1 ("P1", "MusicXML Part"), staff: 1, voice: 1

The MusicXML code for bar 2 (i.e., the tremolo between two notes) is probably faulty; at least it doesn't conform to MusicXML 4.0, AFAICS. It would be nice if xml2ly (a) would emit a more friendly warning or error message, and (b) would insert a \barNumberCheck inspite of the internal error – starting from that very place, all checks are now off by one, causing follow-up warnings from LilyPond.

Here is what xml2ly produces:

    \tuplet 3/2 { b'4 b' b' } r  | % 2
    \barNumberCheck #2
    \repeat tremolo 2 {b'16 b' }
    r4 b'4 ( b' b' )  | % 3
    \barNumberCheck #3

Additionally, it should rather be \repeat tremolo 4 { b'16 b' } to get the right number of beats.

tremolo.zip