Skip to content

Commit

Permalink
ENG-71 Infer $ and Ø to segno and coda on read
Browse files Browse the repository at this point in the history
Dolet seems to occasionally export $ and Ø where segno and coda symbols
ought to be exported in lyrics and staff text. This commit adds those as
special cases to the map in text2syms.
  • Loading branch information
iveshenry18 committed Jul 17, 2021
1 parent aca2536 commit ca78320
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
5 changes: 5 additions & 0 deletions importexport/musicxml/importmxmlpass2.cpp
Expand Up @@ -648,6 +648,11 @@ static QString text2syms(const QString& t)
if (string.size() > maxStringSize)
maxStringSize = string.size();
}

// Special case Dolet inference (TODO: put behind a setting or export type flag)
map.insert("$", SymId::segno);
map.insert("Ø", SymId::coda);

//qDebug("text2syms map count %d maxsz %d filling time elapsed: %d ms",
// map.size(), maxStringSize, time.elapsed());

Expand Down
23 changes: 23 additions & 0 deletions mtest/musicxml/io/testTextQuirkInference.xml
Expand Up @@ -351,6 +351,12 @@
</root>
<kind text="N.C.">none</kind>
</harmony>
<direction placement='above'>
<direction-type>
<segno />
</direction-type>
<staff>1</staff>
</direction>
<note default-x="15.50" default-y="-30.00">
<pitch>
<step>G</step>
Expand Down Expand Up @@ -617,6 +623,12 @@
<type>eighth</type>
<stem>down</stem>
</note>
<direction placement='above'>
<direction-type>
<words font-weight='bold'>D.$. al Coda</words>
</direction-type>
<staff>1</staff>
</direction>
</measure>
<measure number="6" width="260.09">
<note default-x="58.59" default-y="-20.00">
Expand Down Expand Up @@ -809,8 +821,19 @@
<voice>1</voice>
<type>eighth</type>
</note>
<direction placement='above'>
<direction-type>
<words font-weight='bold'>To Coda Ø</words>
</direction-type>
</direction>
</measure>
<measure number="9" width="235.24">
<direction placement='above'>
<direction-type>
<words font-weight='bold'>Ø Coda</words>
</direction-type>
<staff>1</staff>
</direction>
<note default-x="16.50" default-y="-30.00">
<pitch>
<step>G</step>
Expand Down
22 changes: 22 additions & 0 deletions mtest/musicxml/io/testTextQuirkInference_ref.mscx
Expand Up @@ -329,6 +329,11 @@
</voice>
</Measure>
<Measure>
<Marker>
<style>Repeat Text Left</style>
<text><sym>segno</sym></text>
<label>segno</label>
</Marker>
<voice>
<Harmony>
<name>N.C.</name>
Expand Down Expand Up @@ -405,6 +410,13 @@
</voice>
</Measure>
<Measure>
<Jump>
<style>Repeat Text Right</style>
<text><b>D.<sym>segno</sym>. al Coda</b></text>
<jumpTo>segno</jumpTo>
<playUntil>coda</playUntil>
<continueAt>codab</continueAt>
</Jump>
<voice>
<Beam>
<StemDirection>down</StemDirection>
Expand Down Expand Up @@ -602,6 +614,11 @@
</voice>
</Measure>
<Measure>
<Marker>
<style>Repeat Text Right</style>
<text><b>To Coda <sym>coda</sym></b></text>
<label>coda</label>
</Marker>
<voice>
<Beam>
<StemDirection>up</StemDirection>
Expand Down Expand Up @@ -662,6 +679,11 @@
</voice>
</Measure>
<Measure>
<Marker>
<style>Repeat Text Left</style>
<text><b><sym>coda</sym> Coda</b></text>
<label>codab</label>
</Marker>
<voice>
<Chord>
<BeamMode>no</BeamMode>
Expand Down

0 comments on commit ca78320

Please sign in to comment.