Playback
ci / checks (push) Failing after 23m37s

This commit is contained in:
khodowany
2026-10-05 23:41:11 -05:00
parent ffdbe48258
commit 82349cf897
104 changed files with 4095 additions and 4354 deletions
+8 -8
View File
@@ -10,7 +10,7 @@ import generator.guitar
import generator.harmony
import generator.model
import generator.parts
import generator.playback
import tests.score_events
import tests.arrangement_fixtures
import tests.test_accompaniment
import tests.test_musicxml
@@ -47,12 +47,12 @@ class GuitarPartTests(unittest.TestCase):
self.assertFalse(generator.acoustic_voicing.candidates(requirements))
self.assertFalse(generator.guitar.chord_positions(requirements, profile='electric'))
def test_sparse_acoustic_uses_compact_playable_chords(self):
result=self.section(tests.test_parts.xml_harmony()+tests.test_musicxml.xml_note(),'acoustic')
result = self.section(tests.test_parts.xml_harmony() + tests.test_musicxml.xml_note(), 'acoustic')
generator.model.validate_document(result)
generator.fretboard.validate_document(result)
sounding=[n for m in result['staves'][0]['measures'] for n in generator.score.measure_notes(m) if n['pitches']]
sounding = [n for m in result['staves'][0]['measures'] for n in generator.score.measure_notes(m) if n['pitches']]
self.assertTrue(sounding)
self.assertTrue(all(2<=len(n['pitches'])<=3 for n in sounding))
self.assertTrue(all(2 <= len(n['pitches']) <= 3 for n in sounding))
def test_explicit_bass_is_preserved_for_triads_and_extended_chords(self):
for symbol, expected in (('CM/E', 4), ('C7b9/E', 4)):
source = tests.test_musicxml.parse(tests.test_musicxml.xml_score(tests.test_musicxml.xml_note()))
@@ -77,7 +77,7 @@ class GuitarPartTests(unittest.TestCase):
for before, after in zip(first['pitches'], second['pitches']):
self.assertEqual(before['tie_to'], after['id'])
self.assertEqual(after['tablature'], before['tablature'])
self.assertEqual({generator.model.fraction(e['duration']) for e in generator.playback.compile_timeline(result)['events']}, {2})
self.assertEqual({generator.model.fraction(e['duration']) for e in tests.score_events.timeline(result)['events']}, {2})
def test_chord_change_reattacks_even_for_final_eighth(self):
content = tests.test_parts.xml_harmony() + tests.test_parts.xml_harmony('F', offset=7) + tests.test_musicxml.xml_note('G', 8, 'whole', octave=4)
result = self.section(content, divisions=2)
@@ -87,7 +87,7 @@ class GuitarPartTests(unittest.TestCase):
self.assertIn(len(note['pitches']), (3, 4))
self.assertFalse(any('tie_from' in p or 'tie_to' in p for p in note['pitches']))
self.assertEqual(generator.model.pitch_number(note['pitches'][0]), 79)
self.assertEqual({generator.model.fraction(e['onset']) for e in generator.playback.compile_timeline(result)['events']}, {0, fractions.Fraction(7, 2)})
self.assertEqual({generator.model.fraction(e['onset']) for e in tests.score_events.timeline(result)['events']}, {0, fractions.Fraction(7, 2)})
def test_cross_measure_ties_continue_only_without_a_chord_change(self):
for root in ('C', 'F'):
with self.subTest(root=root):
@@ -99,7 +99,7 @@ class GuitarPartTests(unittest.TestCase):
notes = [n for m in result['staves'][0]['measures'] for v in m['voices'] for n in v['notes']]
self.assertTrue(all(len(n['pitches']) in (3, 4) for n in notes))
self.assertEqual(bool(notes[0]['pitches'][0].get('tie_to')), root == 'C')
self.assertEqual({generator.model.fraction(e['onset']) for e in generator.playback.compile_timeline(result)['events']}, {0} if root == 'C' else {0, 4})
self.assertEqual({generator.model.fraction(e['onset']) for e in tests.score_events.timeline(result)['events']}, {0} if root == 'C' else {0, 4})
def test_split_tuplet_keeps_exact_timing_and_span_end(self):
content = tests.test_parts.xml_harmony() + tests.test_parts.xml_harmony('F', offset=10)
for index in range(3):
@@ -120,7 +120,7 @@ class GuitarPartTests(unittest.TestCase):
self.assertIn(len(first['pitches']), (3, 4))
self.assertEqual(len(second['pitches']), 1)
self.assertEqual(first['pitches'][0]['tie_to'], second['pitches'][0]['id'])
timeline = generator.playback.compile_timeline(result)['events']
timeline = tests.score_events.timeline(result)['events']
self.assertEqual(sum(generator.model.fraction(e['duration']) == 4 for e in timeline), 1)
self.assertTrue(all(generator.model.fraction(e['onset']) == 0 for e in timeline))
def test_unplayable_harmonization_preserves_low_melody(self):