Skip to content

Make `musicxml2ly` support `<staff-lines>`

Werner Lemberg requested to merge dev/wl/musicxml2ly-staff-lines into master

This commit is on top of !2319 (merged), so please only look at the top seven commits.

  • musicxml2ly: Better code spacing in output for \time and related commands

    Avoid emitting two spaces in a row, or insert a space between two adjacent commands that usually get separated.

  • 22b-Staff-Notestyles.xml: Add missing <slash-type> elements

    Fixes issue #4929 (closed).

  • 22b-Staff-Notestyles.xml: Use two lyric lines

    This improves legibility, making it easier to see which longer text belongs to which note.

  • musicxmp.ly: Fix typo

    Introduced in commit 85d50b72.

  • musicxml2ly: Merge handling of clefs and staff lines

    We need this for a forthcoming commit that rewrites the handling of staff lines.

    While doing so, also fix the handling of value 0 for staff-lines: this now correctly suppresses the display of staff lines.

  • musicxml2ly: Rewrite clef and staff line support to handle <staff-lines>

    Up to now, musicxml2ly didn't correctly represent MusicXML's ideas of staff lines. This commit fixes this, handling the following issues.

    • Im MusicXML, staff lines are counted from bottom to top. For example, if we have a treble clef and only a single staff line, the displayed staff line must be for pitch e' (in LilyPond notation). Consequently, a treble clef's center loop touches the line from above. Exceptions to that positioning scheme are the percussion and tab clefs, which both get centered vertically on the number of displayed staff lines.

    • We no longer create RhythmicStaff and DrumStaff contexts. For the former, there is no guarantee that notes are always placed on its single staff line (which RhythmicStaff enforces). For the latter, MusicXML doesn't provide a set of pre-defined 'drums' that could be used in \drummode, and DrumStaff also squeezes normal pitches to be positioned on its middle staff line.

    • In LilyPond, the vertical position of a clef on a staff and the displayed pitches are tightly intervowen. To correctly translate MusicXML pitches to LilyPond pitches it is necessary to set the clef before adjusting the staff line parameters. A previous commit already prepared the co-handling of clefs and staff lines; this commit completes it, mainly by mapping to a function \staffLines, which performs the necessary details.

    • The <staff-lines> element is now supported, too.

    Also extend the corresponding regression test.

Edited by Werner Lemberg

Merge request reports