Training Model
This commit is contained in:
@@ -23,7 +23,6 @@ import generator.model
|
||||
import generator.musicxml
|
||||
import generator.playback
|
||||
import tests.arrangement_fixtures
|
||||
import tests.rhythm_fixtures
|
||||
import tests.test_accompaniment
|
||||
import tests.test_musicxml
|
||||
|
||||
@@ -41,7 +40,7 @@ class EngravingTests(unittest.TestCase):
|
||||
def test_tab_omits_rests_but_keeps_standard_notation(self):
|
||||
content = tests.test_musicxml.xml_note('E', 2, 'half', octave=5) + '<note><rest/><duration>2</duration><type>half</type></note>'
|
||||
source = tests.test_musicxml.parse(tests.test_musicxml.xml_score(content))
|
||||
document = tests.arrangement_fixtures.section_document(source, 'electric', rhythms=tests.rhythm_fixtures.library())
|
||||
document = tests.arrangement_fixtures.section_document(source, 'electric')
|
||||
layout = self.layout(document)
|
||||
self.assertEqual(len(self.primitives(layout, 'rest')), 1)
|
||||
self.assertEqual(self.primitives(layout, 'tab-rest'), [])
|
||||
@@ -91,7 +90,7 @@ class EngravingTests(unittest.TestCase):
|
||||
def test_guitar_pages_always_pair_systems_including_tall_passages(self):
|
||||
content = tests.test_musicxml.xml_note('E', octave=5)
|
||||
source = tests.test_musicxml.parse(tests.test_accompaniment.xml_bars([content] * 32))
|
||||
document = tests.arrangement_fixtures.section_document(source, 'electric', rhythms=tests.rhythm_fixtures.library())
|
||||
document = tests.arrangement_fixtures.section_document(source, 'electric')
|
||||
layout = self.layout(document)
|
||||
self.assert_paired_pages(layout)
|
||||
self.assertEqual(layout.style.space, 10)
|
||||
@@ -146,7 +145,7 @@ class EngravingTests(unittest.TestCase):
|
||||
source = tests.test_musicxml.parse(tests.test_accompaniment.xml_bars([content] * 8, divisions=2))
|
||||
documents = [generator.musicxml.load_musicxml(pathlib.Path('tests/fixtures/notation.xml')),
|
||||
tests.test_musicxml.parse(tests.test_musicxml.xml_score(tied)),
|
||||
tests.arrangement_fixtures.section_document(source, 'electric', rhythms=tests.rhythm_fixtures.library())]
|
||||
tests.arrangement_fixtures.section_document(source, 'electric')]
|
||||
checked = 0
|
||||
for sampling in (1, 2, 3, 4):
|
||||
for document in documents:
|
||||
@@ -382,11 +381,11 @@ class EngravingTests(unittest.TestCase):
|
||||
percussion = '<note><unpitched><display-step>C</display-step><display-octave>5</display-octave></unpitched><duration>4</duration><type>whole</type><notehead>x</notehead></note>'
|
||||
source = tests.test_musicxml.parse(tests.test_musicxml.xml_score(percussion, attributes='<clef><sign>percussion</sign></clef>'))
|
||||
self.assertEqual(self.primitives(self.layout(source), 'head')[0].value, 'noteheadXWhole')
|
||||
tab = tests.arrangement_fixtures.section_document(tests.test_musicxml.parse(tests.test_musicxml.xml_score(tests.test_musicxml.xml_note('E', octave=5))), 'electric', rhythms=tests.rhythm_fixtures.library())
|
||||
tab = tests.arrangement_fixtures.section_document(tests.test_musicxml.parse(tests.test_musicxml.xml_score(tests.test_musicxml.xml_note('E', octave=5))), 'electric')
|
||||
self.assertEqual(self.primitives(self.layout(tab), 'tab')[0].value, '12')
|
||||
def test_generated_tab_shares_columns_and_systems_without_duplicating_music(self):
|
||||
content = ''.join(tests.test_musicxml.xml_note('G', 1, 'eighth') for _ in range(8))
|
||||
source = tests.arrangement_fixtures.section_document(tests.test_musicxml.parse(tests.test_accompaniment.xml_bars([content] * 8, divisions=2)), 'electric', rhythms=tests.rhythm_fixtures.library())
|
||||
source = tests.arrangement_fixtures.section_document(tests.test_musicxml.parse(tests.test_accompaniment.xml_bars([content] * 8, divisions=2)), 'electric')
|
||||
layout = self.layout(source)
|
||||
systems = [s for page in layout.pages for s in page.systems]
|
||||
self.assertGreater(len(systems), 1)
|
||||
@@ -402,7 +401,7 @@ class EngravingTests(unittest.TestCase):
|
||||
self.assertEqual(len(generator.playback.compile_timeline(source)['events']), 64)
|
||||
def test_generated_tab_ties_and_barline_styles(self):
|
||||
content = tests.test_musicxml.xml_note('E', 2, 'half', extra='<tie type="start"/>') + tests.test_musicxml.xml_note('E', 2, 'half', extra='<tie type="stop"/>') + '<barline location="right"><bar-style>dashed</bar-style></barline>'
|
||||
source = tests.arrangement_fixtures.section_document(tests.test_musicxml.parse(tests.test_musicxml.xml_score(content)), 'electric', rhythms=tests.rhythm_fixtures.library())
|
||||
source = tests.arrangement_fixtures.section_document(tests.test_musicxml.parse(tests.test_musicxml.xml_score(content)), 'electric')
|
||||
layout = self.layout(source)
|
||||
self.assertEqual(len(self.primitives(layout, 'tab_tie')), 1)
|
||||
self.assertEqual(len(self.primitives(layout, 'barline')), len(self.primitives(layout, 'tab_barline')))
|
||||
|
||||
Reference in New Issue
Block a user