Sizing
ci / checks (push) Successful in 47m22s

This commit is contained in:
khodowany
2026-09-30 02:49:54 -05:00
parent 923b7f14e2
commit 7cad6db980
17 changed files with 1443 additions and 1298 deletions
+12
View File
@@ -33,6 +33,18 @@ def shape(event):
return tuple(sorted((p['tablature']['string'], p['tablature']['fret']) for p in event['pitches']))
class ElectricVoicingTests(unittest.TestCase):
def test_mixed_pickup_bar_links_each_role_to_its_original_passage(self):
chord = harmony('C7')
pickup = note('pickup', 3, chord, (2, 3, 1, 3), melody=True)
outgoing = note('outgoing', 0, chord, (5, 3, 5, 3))
target = note('target', 0, chord, (10, 9, 11, 8))
mixed = measure([outgoing, pickup])
source = [measure([], [chord]), measure([], [harmony('G7')]), measure([], [chord])]
origins = [generator.electric.MeasureOrigin(fractions.Fraction(8), 'accompaniment', mixed, end=fractions.Fraction(3)), generator.electric.MeasureOrigin(fractions.Fraction(-3), 'melody', mixed, start=fractions.Fraction(3)), generator.electric.MeasureOrigin(fractions.Fraction(0), 'accompaniment', measure([target]))]
links = generator.electric.link_voicings(source, origins)
self.assertEqual(len(links), 1)
self.assertIs(links[0].target, target)
self.assertEqual(links[0].references, (pickup,))
def test_corresponding_melody_shapes_change_within_one_harmony(self):
chord = harmony('C7')
first = note('melody-1', 1, chord, (2, 3, 1, 3), melody=True, duration=2)