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
+7 -7
View File
@@ -16,7 +16,7 @@ import generator.model
import generator.musicxml
import generator.parts
import generator.pitch
import generator.playback
import tests.score_events
import tests.arrangement_fixtures
import tests.solo_fixtures
import tests.test_musicxml
@@ -51,7 +51,7 @@ class PartGenerationTests(unittest.TestCase):
if onset < fractions.Fraction(3, 2):
self.assertLessEqual(onset + generator.model.fraction(note['duration']), fractions.Fraction(3, 2))
self.assertLessEqual({generator.model.pitch_number(p) % 12 for p in note['pitches']}, {0, 4, 7} if onset < fractions.Fraction(3, 2) else {0, 5, 9})
self.assertTrue(generator.playback.compile_timeline(result)['events'])
self.assertTrue(tests.score_events.timeline(result)['events'])
def test_harmony_carry_and_explicit_silence(self):
content = xml_harmony(offset=1) + xml_harmony(kind='none', offset=2) + xml_harmony('F', offset=3) + tests.test_musicxml.xml_note()
source = tests.test_musicxml.xml_score(content).replace('</measure></part>', '</measure><measure number="2">' + tests.test_musicxml.xml_note() + '</measure><measure number="3">' + xml_harmony(kind='none') + tests.test_musicxml.xml_note() + '</measure><measure number="4">' + tests.test_musicxml.xml_note() + '</measure></part>')
@@ -75,10 +75,10 @@ class PartGenerationTests(unittest.TestCase):
bar = xml_harmony() + ''.join(tests.test_musicxml.xml_note(duration=1, kind='quarter') for _ in range(4))
xml = tests.test_musicxml.xml_score(bar).replace('</part>', ''.join(f'<measure number="{i}">{bar}</measure>' for i in range(2, 13)) + '</part>')
result = tests.arrangement_fixtures.section_document(tests.test_musicxml.parse(xml), 'acoustic')
self.assertEqual(len(result['staves'][0]['measures']),12)
self.assertEqual(len(result['staves'][0]['measures']), 12)
generator.model.validate_document(result)
self.assertTrue(generator.playback.compile_timeline(result)['events'])
self.assertTrue(any(n['kind']=='rest' for m in result['staves'][0]['measures'] for n in generator.score.measure_notes(m)))
self.assertTrue(tests.score_events.timeline(result)['events'])
self.assertTrue(any(n['kind'] == 'rest' for m in result['staves'][0]['measures'] for n in generator.score.measure_notes(m)))
def test_melody_written_pitch_rhythm_rests_and_cross_bar_ties_are_preserved(self):
content = ''
content += tests.test_musicxml.xml_note(duration=2, kind='quarter', alter=1, extra='<tie type="start"/>')
@@ -115,7 +115,7 @@ class PartGenerationTests(unittest.TestCase):
self.assertEqual(notes[0]['pitches'][0]['tie_to'], notes[1]['pitches'][0]['id'])
self.assertEqual(notes[1]['pitches'][0]['tie_to'], notes[2]['pitches'][0]['id'])
if builder is tests.arrangement_fixtures.section_document:
events = generator.playback.compile_timeline(result)['events']
events = tests.score_events.timeline(result)['events']
self.assertEqual([(generator.model.fraction(e['onset']), generator.model.fraction(e['duration']), generator.model.fraction(e['pitch'])) for e in events], [(0, 6, 61 if part == 'electric' else 49), (fractions.Fraction(13, 2), fractions.Fraction(3, 2), 63 if part == 'electric' else 51)])
self.assertEqual(source, before)
def test_song_slug_collisions_fail_before_writes(self):
@@ -146,7 +146,7 @@ class PartGenerationTests(unittest.TestCase):
unittest.mock.patch('generator.engraving.pipeline.engrave_tree'),
unittest.mock.patch('generator.pico_artwork.generate_titles'),
unittest.mock.patch('generator.catalog.build_catalog'),
unittest.mock.patch('generator.playback.compile_tree'),
unittest.mock.patch('generator.performance.copy_audio', return_value=[]),
):
generator.__main__.generate_assets(args)
# Role catalog loading is replaced by this infrastructure fixture. The