@@ -1,15 +1,14 @@
|
||||
import generator.score
|
||||
import generator.validation
|
||||
import copy
|
||||
import fractions
|
||||
import unittest
|
||||
|
||||
import generator.accompaniment
|
||||
import generator.acoustic_voicing
|
||||
import generator.arrange.generate
|
||||
import generator.fretboard
|
||||
import generator.guitar
|
||||
import generator.harmony
|
||||
import generator.model
|
||||
import generator.parts
|
||||
import tests.score_events
|
||||
import tests.arrangement_fixtures
|
||||
import tests.test_accompaniment
|
||||
@@ -20,7 +19,7 @@ class GuitarPartTests(unittest.TestCase):
|
||||
def section(self, content, part='electric', divisions=1):
|
||||
source = tests.test_musicxml.parse(tests.test_musicxml.xml_score(content, divisions=divisions))
|
||||
result = tests.arrangement_fixtures.section_document(source, part)
|
||||
generator.model.validate_document(result)
|
||||
generator.validation.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', 'CM/E'):
|
||||
@@ -50,7 +49,7 @@ class GuitarPartTests(unittest.TestCase):
|
||||
self.assertTrue(all({p.midi % 12 for p in c} == {0, 7} for c in candidates))
|
||||
def test_acoustic_uses_bass_and_three_upper_notes(self):
|
||||
result = self.section(tests.test_parts.xml_harmony() + tests.test_musicxml.xml_note(), 'acoustic')
|
||||
generator.model.validate_document(result)
|
||||
generator.validation.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']]
|
||||
self.assertTrue(sounding)
|
||||
@@ -99,7 +98,7 @@ class GuitarPartTests(unittest.TestCase):
|
||||
second = tests.test_parts.xml_harmony(root) + tests.test_musicxml.xml_note('E', octave=4, extra='<tie type="stop"/>')
|
||||
source = tests.test_musicxml.parse(tests.test_accompaniment.xml_bars([first, second]))
|
||||
result = tests.arrangement_fixtures.section_document(source, 'electric')
|
||||
generator.model.validate_document(result)
|
||||
generator.validation.validate_document(result)
|
||||
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')
|
||||
|
||||
Reference in New Issue
Block a user