Training Model

This commit is contained in:
khodowany
2026-10-05 19:44:33 -05:00
parent db7966a430
commit e7180e557b
6603 changed files with 8919 additions and 523063 deletions
+2 -32
View File
@@ -12,7 +12,6 @@ from generator.solo import analysis, profiles, placement, types, harmonic
from tests.solo_fixtures import song
from tests.solo_fixtures import note
from tests.solo_fixtures import choices
import tests.rhythm_fixtures
def events(measure):
@@ -21,37 +20,8 @@ def events(measure):
for v in measure['voices'] for n in v['notes'])
class ReusableAccompaniment(unittest.TestCase):
def test_corresponding_bars_repeat_rhythm_pitch_and_fingering(self):
source=song(count=12,chords=('CM7','Dm7','G7'))
library=tests.rhythm_fixtures.library()
prepared=generator.parts.prepare_document(source)
plans=generator.arrange.generate.plan_arrangement(prepared,library)
for part in ('acoustic','electric'):
result=generator.arrange.generate._arrange_document(prepared,part,plans)
seen={};offset=0;checked=0
sections=generator.arrange.form.full_arrangement_sections(source['staves'][0]['measures'],part)
for section in sections:
for j,m in enumerate(result['staves'][0]['measures'][offset:offset+section.measure_count]):
if section.role!='accompaniment':continue
key=section.source_measure_index+j
if key in seen:
self.assertEqual(events(m),seen[key]);checked+=1
seen[key]=events(m)
self.assertFalse(any('tie_from' in p or 'tie_to' in p for v in m['voices'] for n in v['notes'] for p in n['pitches']))
offset+=section.measure_count
self.assertGreater(checked,12)
generator.model.validate_document(result)
def test_excerpt_rhythms_retain_form_phase(self):
source=generator.parts.prepare_document(song(count=13,chords=('CM7',)))
plans=generator.arrange.generate.plan_arrangement(source,tests.rhythm_fixtures.library())
for lane in ('acoustic_bass','acoustic_upper','electric'):
full=getattr(plans[1],lane)
self.assertEqual(getattr(plans[0],lane),full[-8:])
self.assertEqual(getattr(plans[6],lane),full[-8:])
self.assertEqual(getattr(plans[3],lane),full)
self.assertEqual(getattr(plans[4],lane),full)
class SoloInstrumentAndIdentity(unittest.TestCase):
@@ -71,5 +41,5 @@ class SoloInstrumentAndIdentity(unittest.TestCase):
def test_soft_overlapping_registers_do_not_inherit_a_mandatory_octave(self):
source=analysis.analyze(generator.parts.prepare_document(song(count=4,chords=('CM7',))))
acoustic=profiles.for_part('acoustic',source);electric=profiles.for_part('electric',source)
self.assertLess(electric.reference-acoustic.reference,12)
self.assertIsNone(electric.reference);self.assertIsNone(acoustic.reference)
self.assertEqual(acoustic.melody_range,electric.melody_range)