rism-digital / verovio

🎵 Music notation engraving library for MEI with MusicXML and Humdrum support and various toolkits (JavaScript, Python)
https://www.verovio.org
GNU Lesser General Public License v3.0
677 stars 184 forks source link

Support repeat symbols mixed with text #1587

Open th-we opened 4 years ago

th-we commented 4 years ago

When we have MusicXML like this:

  <direction placement="above">
    <direction-type>
      <words default-y="19" font-size="20.5" relative-x="-9">Dal </words>
    </direction-type>
    <direction-type>
      <segno font-size="20.5"/>
    </direction-type>
    <direction-type>
      <words font-family="Times New Roman"> al </words>
    </direction-type>
    <direction-type>
      <coda font-size="20.5"/>
    </direction-type>
    <offset>16</offset>
  </direction>

Verovio will only convert the first <direction-type> element and ignore all others.

<dir xml:id="dir-0000001390273857" place="above" staff="1" tstamp="3.000000" vgrp="219">Dal </dir>

This should be handled in the same way as with dynamics mixed with text (#1359).

Complete MusicXML example (Finale output).

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 3.1 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd">
<score-partwise version="3.1">
  <identification>
    <encoding>
      <software>Finale v26.2.2 for Windows</software>
      <encoding-date>2020-07-27</encoding-date>
      <supports attribute="new-system" element="print" type="yes" value="yes"/>
      <supports attribute="new-page" element="print" type="yes" value="yes"/>
      <supports element="accidental" type="yes"/>
      <supports element="beam" type="yes"/>
      <supports element="stem" type="yes"/>
    </encoding>
  </identification>
  <defaults>
    <scaling>
      <millimeters>7.2319</millimeters>
      <tenths>40</tenths>
    </scaling>
    <page-layout>
      <page-height>1545</page-height>
      <page-width>1194</page-width>
      <page-margins type="both">
        <left-margin>70</left-margin>
        <right-margin>70</right-margin>
        <top-margin>88</top-margin>
        <bottom-margin>88</bottom-margin>
      </page-margins>
    </page-layout>
    <system-layout>
      <system-margins>
        <left-margin>0</left-margin>
        <right-margin>0</right-margin>
      </system-margins>
      <system-distance>121</system-distance>
      <top-system-distance>70</top-system-distance>
    </system-layout>
    <appearance>
      <line-width type="stem">0.918</line-width>
      <line-width type="beam">5</line-width>
      <line-width type="staff">0.918</line-width>
      <line-width type="light barline">0.918</line-width>
      <line-width type="heavy barline">5</line-width>
      <line-width type="leger">1.0807</line-width>
      <line-width type="ending">0.957</line-width>
      <line-width type="wedge">0.918</line-width>
      <line-width type="enclosure">0.918</line-width>
      <line-width type="tuplet bracket">0.918</line-width>
      <note-size type="grace">60</note-size>
      <note-size type="cue">60</note-size>
      <distance type="hyphen">120</distance>
      <distance type="beam">7.5</distance>
    </appearance>
    <music-font font-family="Maestro,engraved" font-size="20.5"/>
    <word-font font-family="Times New Roman" font-size="10.25"/>
  </defaults>
  <credit page="1">
    <credit-type>part name</credit-type>
    <credit-words default-x="70" default-y="1453" font-size="12" valign="top">Score</credit-words>
  </credit>
  <part-list>
    <score-part id="P1">
      <part-name>Flute</part-name>
      <score-instrument id="P1-I1">
        <instrument-name>MusicXML Default 1</instrument-name>
      </score-instrument>
      <midi-instrument id="P1-I1">
        <midi-channel>1</midi-channel>
        <midi-program>1</midi-program>
      </midi-instrument>
    </score-part>
  </part-list>
  <!--=========================================================-->
  <part id="P1">
    <measure number="1" width="983">
      <print>
        <system-layout>
          <system-margins>
            <left-margin>70</left-margin>
            <right-margin>0</right-margin>
          </system-margins>
          <top-system-distance>211</top-system-distance>
        </system-layout>
        <measure-numbering>system</measure-numbering>
      </print>
      <attributes>
        <divisions>8</divisions>
        <key>
          <fifths>0</fifths>
          <mode>major</mode>
        </key>
        <time>
          <beats>4</beats>
          <beat-type>4</beat-type>
        </time>
        <clef>
          <sign>G</sign>
          <line>2</line>
        </clef>
      </attributes>
      <sound tempo="120"/>
      <direction placement="above">
        <direction-type>
          <words default-y="19" font-size="20.5" relative-x="-9">Dal </words>
        </direction-type>
        <direction-type>
          <segno font-size="20.5"/>
        </direction-type>
        <direction-type>
          <words font-family="Times New Roman"> al </words>
        </direction-type>
        <direction-type>
          <coda font-size="20.5"/>
        </direction-type>
        <offset>16</offset>
      </direction>
      <note>
        <rest measure="yes"/>
        <duration>32</duration>
        <voice>1</voice>
      </note>
    </measure>
  </part>
  <!--=========================================================-->
</score-partwise>
th-we commented 4 years ago

May I also draw your attention to this related issue: https://github.com/music-encoding/music-encoding/issues/520