def test_1(self): instrument = TreeInstrument(name='banjo', abbreviation='bjo', number=2) instrument.standard_clefs = ALTO_CLEF sf = SimpleFormat(quarter_durations=[1, 2, 3, 1, 2, 3, 1, 2, 3]) score = TreeScoreTimewise() sf.to_stream_voice(2).add_to_score(score) sf.transpose(5) sf.to_stream_voice(1).add_to_score(score) score.get_score_parts()[0].instrument = instrument xml_path = path + '_test_1.xml' score.write(xml_path) self.assertCompareFiles(xml_path)
def test_1(self): xml_path = path + '_test_1.xml' harmonics = SimpleFormat() for i in range(1, 17): partial_midi = Midi(round(self.horn.get_partial_midi_value(i) * 2) / 2) if i % 7 == 0: partial_midi.accidental.mode = 'flat' if i % 11 == 0: partial_midi.accidental.mode = 'sharp' if i % 13 == 0: partial_midi.accidental.mode = 'flat' chord = TreeChord(midis=partial_midi) chord.add_words(i) harmonics.add_chord(chord) harmonics.to_stream_voice().add_to_score(self.score, part_number=2) harmonics.transpose(self.horn.transposition) harmonics.to_stream_voice().add_to_score(self.score, part_number=1) self.score.accidental_mode = 'modern' self.score.write(xml_path) TestScore().assert_template(xml_path)