def test_2(self): # sf = SimpleFormat(midis = [52, 51, 70, 100, 110, 107, 90, 80, 70, 60, 50, 40, 30]) sf = SimpleFormat(midis=[62, 72, 50]) sf.auto_clef() sf.to_stream_voice().add_to_score(self.score) result_path = path + '_test_2' self.score.write(path=result_path) TestScore().assert_template(result_path=result_path)
def test_3(self): # sf = SimpleFormat(midis = [52, 51, 70, 100, 110, 107, 90, 80, 70, 60, 50, 40, 30]) sf = SimpleFormat( midis=[50, 60, 70, 80, 90, 100, 110, 100, 90, 80, 70, 60, 50]) sf.auto_clef(clefs=[ALTO_CLEF, TREBLE_CLEF, HIGH_TREBLE_CLEF]) sf.to_stream_voice().add_to_score(self.score) result_path = path + '_test_3' self.score.write(path=result_path) TestScore().assert_template(result_path=result_path)
def test_11(self): r_sf = SimpleFormat( quarter_durations=[0.25, 2.25, 0.5, 1, 2, Fraction(1, 3), Fraction(4, 3), Fraction(1, 3), 1], midis=[60, 61, 54, 63]) l_sf = SimpleFormat(quarter_durations=[4, 5], midis=[72, 53]) r_sf.chords[1].manual_staff_number = 2 r_sf.auto_clef() l_sf.auto_clef() r_sf.to_stream_voice().add_to_score(self.score, part_number=1, staff_number=1) l_sf.to_stream_voice().add_to_score(self.score, part_number=1, staff_number=2) xml_path = path + '_test_11.xml' self.score.write(xml_path) self.assertCompareFiles(xml_path)
def test_6(self): midis = [51.5, 51.5, 50.5, 48.5, 49.5, 48.5, 50.0, 50.0, 49.5, 49.0] durations = [ Fraction(255, 56), Fraction(6525, 3136), Fraction(6075, 3136), Fraction(2475, 3136), Fraction(2145, 3136), Fraction(2805, 3136), Fraction(1815, 3136), Fraction(65, 56), Fraction(2015, 1568), Fraction(1625, 1568) ] simpleformat = SimpleFormat(midis=midis, quarter_durations=durations) simpleformat.auto_clef() voice = simpleformat.to_stream_voice(1) voice.add_to_score(self.score) result_path = path + '_test_6' self.score.max_division = 7 self.score.accidental_mode = 'modern' self.score.write(result_path) TestScore().assert_template(result_path=result_path)
def test_12(self): r_sf_2 = SimpleFormat( quarter_durations=[0.25, 2.25, 0.5, 1, 2, Fraction(1, 3), Fraction(4, 3), Fraction(1, 3), 1], midis=[60, 61, 54, 63]) r_sf_1 = SimpleFormat( quarter_durations=[0.25, 2.25, 0.5, 1, 2, Fraction(1, 3), Fraction(4, 3), Fraction(1, 3), 1], midis=[70, 71, 64, 73]) l_sf_1 = SimpleFormat(quarter_durations=[4, 5], midis=[50, 35]) l_sf_2 = SimpleFormat(quarter_durations=[5, 4], midis=[44, 60]) r_sf_2.auto_clef() r_sf_1.auto_clef() l_sf_1.auto_clef() l_sf_2.auto_clef() r_sf_1.to_stream_voice(2).add_to_score(self.score, part_number=1, staff_number=1) r_sf_2.to_stream_voice(1).add_to_score(self.score, part_number=1, staff_number=1) l_sf_1.to_stream_voice(2).add_to_score(self.score, part_number=1, staff_number=2) l_sf_2.to_stream_voice(1).add_to_score(self.score, part_number=1, staff_number=2) xml_path = path + '_test_12.xml' self.score.write(xml_path) self.assertCompareFiles(xml_path)