Span
ci / checks (push) Successful in 48m23s

This commit is contained in:
khodowany
2026-10-01 00:15:35 -05:00
parent 7b60182a3d
commit ce695a626a
10 changed files with 128 additions and 59 deletions
+6 -1
View File
@@ -25,7 +25,7 @@ class GuitarPartTests(unittest.TestCase):
generator.model.validate_document(result)
return result
def test_profile_shapes_cover_defining_chord_tones(self):
for symbol in ('CM', 'Cm', 'C7', 'CmM7', 'Csus', 'Cdim7', 'Caug7', 'C7b9', 'C13', 'C5', 'CM/E'):
for symbol in ('CM', 'Cm', 'C7', 'CmM7', 'Csus', 'Cdim7', 'Caug7', 'C7b9', 'C13', 'CM/E'):
for profile in ('acoustic', 'electric'):
with self.subTest(symbol=symbol, profile=profile):
definition = generator.harmony.parse_symbol(symbol)
@@ -43,6 +43,11 @@ class GuitarPartTests(unittest.TestCase):
self.assertNotIn(0, generator.fretboard.chord_requirements(chord, respect_bass=False).required)
candidates = generator.guitar.chord_positions(generator.fretboard.chord_requirements(chord, respect_bass=False), profile='electric')
self.assertTrue(any(all(p.midi % 12 != 0 for p in c) for c in candidates))
def test_power_chord_cannot_expand_span_or_invent_upper_tones(self):
requirements = generator.fretboard.chord_requirements(generator.harmony.parse_symbol('C5'))
self.assertEqual(set(requirements.allowed), {0, 7})
self.assertFalse(generator.acoustic_voicing.candidates(requirements))
self.assertFalse(generator.guitar.chord_positions(requirements, profile='electric'))
def test_acoustic_combines_independent_rhythms_with_a_fixed_grip(self):
result = self.section(tests.test_parts.xml_harmony() + tests.test_musicxml.xml_note(), 'acoustic')
measure = result['staves'][0]['measures'][0]