Skip to content

Commit

Permalink
Add finale-specific test for handling <forward> note tags
Browse files Browse the repository at this point in the history
  • Loading branch information
TimFelixBeyer authored Dec 26, 2024
1 parent 652b393 commit cdf3359
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion music21/musicxml/test_xmlToM21.py
Original file line number Diff line number Diff line change
Expand Up @@ -1247,9 +1247,20 @@ def testHiddenRests(self):
from music21 import corpus
from music21.musicxml import testPrimitive

# With most software, <forward> tags should map to no objects at all
# Voice 1: Half note, <forward> (quarter), quarter note
# Voice 2: <forward> (half), quarter note, <forward> (quarter)
s = converter.parse(testPrimitive.hiddenRests)
s = converter.parse(testPrimitive.hiddenRestsNoFinale)
v1, v2 = s.recurse().voices
# No rests should have been added
self.assertFalse(v1.getElementsByClass(note.Rest))
self.assertFalse(v2.getElementsByClass(note.Rest))

# Finale uses <forward> tags to represent hidden rests,
# so we want to have rests here
# Voice 1: Half note, <forward> (quarter), quarter note
# Voice 2: <forward> (half), quarter note, <forward> (quarter)
s = converter.parse(testPrimitive.hiddenRestsFinale)
v1, v2 = s.recurse().voices
self.assertEqual(v1.duration.quarterLength, v2.duration.quarterLength)

Expand Down

0 comments on commit cdf3359

Please sign in to comment.