def _adapt_right_hand(right: lily.NOventLine, vm) -> None: tw.swap_duration(0, 1, F(5, 16), right) tw.split_by_structure(17, 4, right, vm, adapt_by_changed_structure=True) tw.rest(19, right) tw.split(22, right, F(1, 8), F(3, 16)) right[23].pitch = right[21].pitch right[29].optional_some_pitches = None right[49].optional_some_pitches = None tw.postpone(1, F(1, 4) + F(1, 16), right) tw.prolong(1, F(1, 8), right) tw.prolong(3, F(1, 8), right) right[2].pitch = [ji.r(3, 2), ji.r(2, 1)] right[4].pitch = [ji.r(7, 12), ji.r(35, 64)] right[5].pitch = [ji.r(7, 3), ji.r(14, 9), ji.r(35, 24)] right[6].pitch = [ji.r(7, 9), ji.r(7, 12), ji.r(1, 2)] right[7].pitch = [ji.r(7, 3), ji.r(35, 12), ji.r(35, 16)] tw.crop(7, right, F(1, 4)) right[8].pitch = [ji.r(7, 4), ji.r(7, 3), ji.r(2, 1)] right[9].pitch = [ji.r(7, 3), ji.r(14, 9), ji.r(35, 24)] right[10].pitch = [ji.r(7, 12), ji.r(35, 64)] tw.prolong(10, F(1, 8), right) right[11].pitch = [ji.r(14, 9), ji.r(7, 3), ji.r(2, 1)] for n in range(4, 12): right[n].volume = 0.67 right[13].pitch = [ji.r(64, 63), ji.r(256, 189)] tw.prolong(14, F(1, 8), right) right[14].pitch = [ji.r(7, 3), ji.r(35, 16), ji.r(35, 12)] right[15].pitch = [ji.r(7, 4), ji.r(2, 1), ji.r(7, 3)] right[16].pitch = [ji.r(288, 245), ji.r(48, 49)] tw.eat(16, 17, right) right[17].pitch = [ji.r(192, 245), ji.r(256, 245)] tw.eat(17, 18, right) right[18].pitch = [ji.r(64, 63), ji.r(256, 189)] tw.eat(18, 19, right) right[19].pitch = [ji.r(36, 49)] right[20].pitch = [ji.r(256, 245)]
def _adapt_left_hand(left: lily.NOventLine, vm) -> None: tw.swap_duration(9, 10, F(1, 4), left) tw.swap_duration(20, 21, F(1, 4), left) tw.swap_duration(30, 31, F(1, 4), left) tw.swap_duration(40, 41, F(1, 4), left) for n in (6, 8, 10, 16, 18, 21, 27, 29, 31, 37, 39, 41): left[n].pitch = [left[n].pitch[0].register(keyboard.SYMBOLIC_GONG_OCTAVE)] left[n].pedal = attachments.Pedal(False) left[n].volume = 0.43 left[n].ottava = attachments.Ottava(-1) tw.split(41, left, F(1, 4), F(1, 4)) tw.split(31, left, F(1, 4), F(1, 4)) tw.split(21, left, F(1, 4), F(1, 4)) tw.split(10, left, F(1, 4), F(1, 4)) tw.swap_duration(20, 19, F(1, 16), left) tw.crop(3, left, F(1, 16)) left[3].pitch = [ji.r(7, 8)] left[10].pitch = [ ji.r(35, 24).register(keyboard.SYMBOLIC_GONG_OCTAVE), ji.r(35, 128), ] left[10].ottava = attachments.Ottava(-1) left[10].arpeggio = None tw.add_kenong(12, left, ji.r(14, 9)) left[13].pitch = [ ji.r(64, 63).register(keyboard.SYMBOLIC_GONG_OCTAVE), ji.r(64, 63), ji.r(128, 189), ] tw.crop(15, left, F(1, 16)) left[16].pitch = [ji.r(7, 8)]
def _adapt_cello2(cello: lily.NOventLine, vm) -> None: tw.crop(12, cello, F(2, 8), F(1, 16), F(3, 16)) cello[12].pitch = [ji.r(1, 2)] tw.set_pizz(12, cello) cello[14].pitch = [ji.r(7, 12)] tw.set_arco(14, cello) cello[21].glissando = None cello[21].pitch = [ji.r(256, 189).register(-1)] tw.swap_duration(20, 21, F(1, 16), cello) tw.set_arco(24, cello) tw.crop(24, cello, F(2, 8) + F(1, 16), F(1, 16), F(1, 8)) tw.change_octave(24, -1, cello) cello[26].acciaccatura = None tw.set_pizz(26, cello) tw.rest(25, cello) tw.prolong(28, F(1, 32), cello) tw.crop(29, cello, F(3, 4), F(1, 8)) cello[30].pitch = [ji.r(1, 1)] cello[30].natural_harmonic = attachments.NaturalHarmonic() tw.set_pizz(30, cello) tw.crop(31, cello, F(3, 8), F(1, 8) + F(3, 4)) cello[32].pitch = [ji.r(72, 49)] tw.set_arco(32, cello) tw.add_artifical_harmonic(32, ji.r(72, 49).register(-2), cello) # cello[32].ornamentation = attachments.OrnamentationUp(2) # tw.postpone(33, F(1, 8), cello) # cello[34].glissando = None tw.rest(33, cello) tw.rest(34, cello) tw.crop(33, cello, F(1, 16), F(1, 16), F(1, 16), F(1, 16), F(1, 4)) cello[34].pitch = [ji.r(1, 2)] cello[35].pitch = [ji.r(7, 12)] cello[36].pitch = [ji.r(7, 12)] cello[37].pitch = [ji.r(7, 24)] for n in range(34, 38): tw.set_pizz(n, cello) cello[38].pitch = [ji.r(72, 49).register(-2)] tw.set_arco(38, cello) for n in range(38, 40): tw.change_octave(n, 1, cello) tw.rest_many((41, 42, 44), cello) cello[46].pitch = [ji.r(7, 12)] tw.set_arco(46, cello) tw.swap_duration(45, 46, F(1, 8), cello) tw.shorten(46, F(2, 4) + F(1, 8), cello) tw.change_octave(42, 1, cello) tw.shorten(42, F(1, 4), cello) tw.set_arco(42, cello) print("len(cello)", len(cello)) tw.rest_many((46, 45, 44), cello) tw.crop( 43, cello, F(1, 8), F(3, 8), F(3, 16), F(1, 16), F(3, 16), F(1, 16), F(3, 8) ) cello[44].pitch = [ji.r(7, 12)] cello[45].pitch = [ji.r(1, 2)] cello[46].pitch = [ji.r(7, 12)] cello[47].pitch = [ji.r(8, 15)] cello[49].pitch = [ji.r(7, 12)] tw.split(44, cello, F(1, 4), F(1, 8)) for n in (44, 45, 46, 47, 48, 50): tw.set_pizz(n, cello) tw.set_arco(44, cello) tw.shorten(44, F(1, 16), cello) tw.add_glissando(44, (-1, 0, 0), cello, durations=[F(1, 8), F(1, 16)])
def _adapt_violin(violin: lily.NOventLine, vm) -> None: tw.detach_optional_events(violin) violin[13].acciaccatura = None violin[12].acciaccatura = None tw.add_glissando( 12, (0, 0, 1), violin, verse_maker=vm, adapt_by_changed_structure=True ) tw.prolong(14, F(3, 8), violin) tw.split( 13, violin, F(1, 4), F(1, 8), F(1, 8), ) # tw.rest(14, violin) # violin[14].string_contact_point = attachments.StringContactPoint('pizzicato') # violin[14].volume = 2 tw.add_glissando( 15, (0, 1), violin, verse_maker=vm, adapt_by_changed_structure=True ) violin[16].ornamentation = attachments.OrnamentationUp(2) tw.prolong(1, F(1, 8), violin) tw.change_octave(1, -1, violin) violin[1].acciaccatura = None for n in (2, 6, 8): violin[n].acciaccatura = None tw.add_glissando( n, (1, 0, 0, 0), violin, verse_maker=vm, adapt_by_changed_structure=True ) tw.add_glissando( 2, (-1, 0, 0, -1), violin, verse_maker=vm, adapt_by_changed_structure=True ) tw.add_glissando( 8, (1, 0, 0, -1), violin, verse_maker=vm, adapt_by_changed_structure=True ) violin[4].string_contact_point = attachments.StringContactPoint("arco") tw.split(9, violin, F(1, 16), F(1, 16)) tw.rest(9, violin) tw.prolong(10, F(3, 16), violin) tw.swap_duration(10, 9, F(1, 16), violin) violin[10].volume = 2.4 tw.add_acciaccatura(17, ji.r(35, 32), violin, add_glissando=True) violin[25].ornamentation = attachments.OrnamentationDown(3) violin[36].acciaccatura = None tw.add_glissando( 38, (2, 0, 0, -1), violin, verse_maker=vm, adapt_by_changed_structure=True ) violin[32].volume = 1.6 violin[34].string_contact_point = attachments.StringContactPoint("arco") violin[34].volume = 0.69 tw.swap_duration(36, 35, F(1, 8), violin) tw.prolong(34, F(1, 8), violin) tw.add_glissando( 34, (0, 0, -1), violin, durations=[F(3, 16), F(1, 16)], ) tw.add_glissando( 36, (1, 0, 0), violin, durations=[F(1, 8), F(1, 8)], ) tw.crop(0, violin, F(2, 4) + F(1, 8)) violin[1].pitch = [ji.r(48, 35)] tw.set_pizz(1, violin) violin[6].pitch = [ji.r(7, 9)] tw.set_pizz(6, violin) # tw.crop(8, violin, F(1, 16)) # violin[8].pitch = [ji.r(8, 9)] violin[10].pitch = [ji.r(7, 9)] tw.set_pizz(10, violin) tw.shorten(11, F(1, 16), violin) tw.crop(12, violin, F(2, 16), F(1, 16), F(1, 16)) violin[13].pitch = [ji.r(8, 9)] violin[14].pitch = [ji.r(7, 9)] tw.set_pizz(13, violin) tw.set_pizz(14, violin)
def _adapt_cello(cello: lily.NOventLine, vm) -> None: tw.detach_optional_events(cello) cello[1].natural_harmonic = attachments.NaturalHarmonic() tw.change_octave(3, 1, cello, change_main_pitches=False) tw.change_octave(3, -2, cello, change_acciaccatura_pitches=False) cello[4].string_contact_point = attachments.StringContactPoint("pizzicato") cello[4].volume = 1 tw.change_octave(4, 1, cello, change_main_pitches=False) tw.change_octave(5, -2, cello, change_acciaccatura_pitches=False) tw.change_octave(6, -2, cello, change_acciaccatura_pitches=False) cello[9].volume = 0.6 cello[9].string_contact_point = attachments.StringContactPoint("arco") for n in (9, 11, 13): cello[n].artifical_harmonic = None tw.change_octave(n, -1, cello, change_acciaccatura_pitches=False) cello[13].glissando = None tw.swap_duration(10, 9, F(5, 32), cello) tw.swap_duration(11, 10, F(1, 16), cello) tw.add_glissando( 9, (0, 0, -1), cello, durations=[F(4, 16), F(3, 32)], ) tw.add_glissando( 10, (0, 0, 1), cello, durations=[F(1, 32) + F(1, 8) + F(3, 16), F(1, 16)], ) cello[14].hauptstimme = attachments.Hauptstimme(False, False) tw.rest(16, cello) tw.change_octave(16, 1, cello) tw.add_glissando( 16, (0, 0, -2), cello, durations=[F(3, 16), F(1, 16)], ) for n in (19, 20): cello[n].artifical_harmonic = None cello[n].acciaccatura = None cello[n].glissando = None cello[n].volume = 0.3 tw.change_octave(n, -2, cello) tw.split( 21, cello, F(7, 4) + F(1, 8), F(5, 8) + F(2, 4), ) cello[21].pitch = [ji.r(7, 24)] cello[21].string_contact_point = attachments.StringContactPoint("pizzicato") cello[21].volume = 1.87 tw.split_by_structure(21, 6, cello, vm, adapt_by_changed_structure=True) for n in range(21, 21 + 6): if n % 3 == 0: cello[n].pitch = [ji.r(1, 4)] cello[21].pitch = [ji.r(8, 15)] cello[22].pitch = [ji.r(1, 2)] for n in (21, 22, 23): cello[n].string_contact_point = attachments.StringContactPoint("arco") cello[n].volume = 0.3 cello[23].volume = 0.6 tw.add_acciaccatura(19, ji.r(256, 189).register(-2), cello, add_glissando=True) tw.add_glissando( 21, (0, -1), cello, durations=[F(3, 16)], ) tw.add_glissando( 22, (0, 0, -1), cello, durations=[F(3, 16), F(1, 8)], ) cello[6].pitch = [ji.r(7, 12)] cello[6].acciaccatura = None tw.set_arco(6, cello) tw.shorten(7, F(3, 32), cello) tw.crop(8, cello, F(3, 4), F(2, 4), F(2, 16), F(2, 16)) cello[9].pitch = [ji.r(7, 12)] tw.set_pizz(9, cello) cello[11].pitch = [ji.r(7, 12)] tw.set_pizz(11, cello) tw.shorten(1, F(3, 32), cello) cello[2].pitch = [ji.r(16, 15)] tw.set_pizz(2, cello) # tw.crop( # 12, cello, F(1, 8), F(1, 8), F(1, 8), F(1, 8), F(1, 8), F(1, 8), F(1, 8), F(1, 8)) tw.crop(12, cello, F(5, 4)) cello[12].pitch = [ji.r(256, 189).register(-1)] tw.split_by_structure(12, 6, cello, vm, adapt_by_changed_structure=True) cello[13].pitch = [ji.r(7, 6).register(-1)] cello[14].pitch = [ji.r(1, 1).register(-1)] cello[15].pitch = [ji.r(7, 6).register(-1)] cello[16].pitch = [ji.r(72, 49).register(-1)] cello[17].pitch = [ji.r(384, 245).register(-1)] # cello[18].pitch = [ji.r(72, 49).register(-1)] # for n in (13, 15, 17, 19): for n in range(12, 19): cello[n].glissando = None cello[n].acciaccatura = None # tw.set_pizz(n, cello) # cello[n].volume = 0.6 tw.set_arco(n, cello) cello[n].volume = 0.3 # tw.set_arco(12, cello) # cello[12].volume = 0.3 # tw.postpone(12, F(1, 8), cello) tw.add_glissando(12, (0, 0, -1), cello, durations=[F(1, 8), F(1, 8)])
def _adapt_keyboard(left: lily.NOventLine, right: lily.NOventLine, vm) -> None: tw.swap_duration(0, 1, F(7, 32), right) tw.prolong(1, F(2, 8), right) # right[2].pitch = [ji.r(256, 245)] tw.swap_duration(7, 8, F(1, 16), right) tw.prolong(8, F(1, 8), right) tw.rest_many((14, 15, 17), right) tw.prolong(12, F(3, 4), right) tw.crop(13, right, F(3, 4), F(2, 4)) # tw.change_octave(12, -1, right) right[13].pitch = [ji.r(3, 4)] right[14].pitch = [ji.r(72, 49).register(-1)] tw.swap_duration(17, 18, F(2, 4), right) tw.swap_duration(20, 21, F(1, 16), right) tw.rest(28, right) right[26].optional_some_pitches = None tw.prolong(26, F(2, 4) + F(1, 16), right) tw.rest(28, right) tw.swap_duration(32, 31, F(1, 16), right) tw.rest(32, right) tw.swap_duration(31, 32, F(1, 8), right) tw.prolong(28, F(1, 32), right) right[28].optional_some_pitches = None for n in (38, 39, 40, 42): right[n].optional_some_pitches = None tw.swap_duration(45, 44, F(1, 32), right) for n in (46,): right[n].optional_some_pitches = None # tw.swap_duration(48, 49, F(1, 4), right) tw.rest(49, right) right[49].pitch = [ji.r(16, 5)] right[50].pitch.append(ji.r(1, 2)) right[51].pitch = [ji.r(7, 3), ji.r(7, 4), ji.r(35, 12)] right[51].optional_some_pitches = None tw.change_octave(52, 1, right) right[52].pitch.append(ji.r(48, 35).register(1)) tw.shorten(55, F(7, 16), right) tw.crop(45, right, F(1, 2), position=False) right[46].pitch = [ji.r(35, 24)] tw.crop(46, right, F(3, 8)) tw.rest(47, right) tw.rest_many((59, 60, 61, 63), right) tw.crop( 58, right, F(2, 4), F(2, 4), F(2, 4), F(2, 4), F(4, 4), F(1, 4), F(3, 4), F(4, 4), ) right[58].pitch = [ji.r(48, 49).register(-1)] right[59].pitch = [ji.r(384, 245).register(-1)] right[60].pitch = [ji.r(8, 5)] right[61].pitch = [ji.r(256, 245)] right[62].pitch = [ji.r(48, 49).register(-1)] right[63].pitch = [ji.r(1, 1).register(-1)] right[64].pitch = [ji.r(7, 6).register(1)] right[65].pitch = [ji.r(4, 3).register(-1), ji.r(1, 2)] """ """ right[56].pitch = [ji.r(7, 3)] # tw.rest(57, right) # print("right", len(right)) ############################################### # left hand # ############################################### tw.crop(6, left, F(1, 8)) tw.add_kenong(7, left) left[7].volume = 1 left[16].arpeggio = attachments.Arpeggio(abjad.enums.Down) tw.rest_many((19, 20, 21, 22, 23, 24, 25, 26), left) for n in (17, 18): left[n].optional = None left[n].volume = 0.75 tw.crop(19, left, *([F(1, 4)] * 9)) current_idx = 19 for n, pitch in ((4, ji.r(35, 24)), (3, ji.r(3, 2)), (2, ji.r(72, 49))): is_first = True for _ in range(n): if is_first: tw.add_gong(current_idx, left, pitch) is_first = False else: tw.add_kenong(current_idx, left, pitch) left[current_idx].volume = 1 current_idx += 1 left[30].arpeggio = attachments.Arpeggio(abjad.enums.Down) tw.rest_many((31, 32), left) tw.split(31, left, F(1, 4), F(1, 4)) tw.add_kenong(31, left, ji.r(3, 2)) tw.add_kenong(32, left, ji.r(35, 24)) left[34].arpeggio = attachments.Arpeggio(abjad.enums.Up) tw.rest_many((36, 38, 39, 40), left) tw.eat(35, 36, left) tw.eat(36, 37, left) tw.eat(36, 37, left) tw.eat(17, 18, left) tw.add_kenong(17, left, ji.r(288, 245)) left[17].volume = 1.3 # tw.make_solo_gong(36, left) tw.rest(36, left) left[37].arpeggio = attachments.Arpeggio(abjad.enums.Up) left[39].arpeggio = attachments.Arpeggio(abjad.enums.Up) tw.rest_many((38, 39), left) tw.eat(37, 38, left) tw.eat(38, 39, left) tw.rest(39, left) left[39].ottava = attachments.Ottava(0) left[39].pedal = attachments.Pedal(False) left[41].pedal = attachments.Pedal(True) left[42].arpeggio = attachments.Arpeggio(abjad.enums.Up) tw.make_solo_gong(44, left) tw.rest(43, left) tw.swap_duration(42, 43, F(1, 16), left) left[45].arpeggio = attachments.Arpeggio(abjad.enums.Up) left[58].optional = None left[58].volume = 0.75 # tw.crop(59, left, F(1, 4), F(1, 4)) tw.swap_duration(60, 59, F(1, 8), left) tw.add_gong(60, left, ji.r(72, 49)) left[60].optional = None left[60].volume = 1 tw.crop(42, left, F(1, 8)) tw.add_kenong(43, left, ji.r(64, 63)) left[43].volume = 1 left[43].arpeggio = None left[44].ottava = attachments.Ottava(0) tw.swap_duration(48, 47, F(1, 8), left) tw.add_kenong(47, left, ji.r(64, 63)) tw.add_kenong(48, left, ji.r(14, 9)) left[47].volume = 1 left[48].volume = 1 tw.eat(48, 49, left) left[42].pitch = list(sorted(left[42].pitch)[:1]) left[42].arpeggio = None tw.swap_duration(49, 50, F(2, 8), left) tw.add_kenong(50, left, ji.r(256, 245)) left[50].volume = 1 left[54].pitch = list(sorted(left[54].pitch)[:1]) left[56].pitch = list(sorted(left[56].pitch)[:1]) tw.rest(64, left) tw.swap_duration(64, 63, F(1, 4), left) # left[64].arpeggio = attachments.Arpeggio(abjad.enums.Down) left[64].arpeggio = None left[64].volume = 1 tw.eat(62, 63, left) left[62].volume = 0.43 tw.split(62, left, *([F(1, 4)] * int(left[62].delay // F(1, 4)))) tw.split(60, left, F(3, 8), F(2, 8)) left[61].ottava = attachments.Ottava(0) left[61].pedal = attachments.Pedal(False) left[61].volume = 0.5 tw.split(61, left, F(1, 16), F(1, 16), F(1, 16), F(1, 16)) left[61].pitch = [ji.r(64, 63)] left[62].pitch = [ji.r(35, 32).register(0)] left[63].pitch = [ji.r(64, 63)] left[64].pitch = [ji.r(7, 9)] left[68].arpeggio = attachments.Arpeggio(abjad.enums.Up) tw.eat(69, 70, left) tw.swap_duration(69, 70, F(1, 8), left) tw.add_kenong(70, left, ji.r(8, 5)) left[78].volume = 0.5 tw.crop(78, left, F(3, 16)) left[80].volume = 0.5 left[80].arpeggio = None tw.crop(80, left, F(1, 16), F(1, 16), F(1, 16)) left[79].pitch = [ji.r(7, 9)] left[80].pitch = [ji.r(4, 7)] left[81].pitch = [ji.r(35, 24).register(-1)] tw.copy_pitch(80, 82, left) left[83].pitch = [ji.r(35, 32).register(0)] left[84].pitch = [ji.r(35, 24).register(-1)] tw.crop(84, left, F(1, 16), F(1, 16)) left[85].pitch = [ji.r(4, 7).register(-1)] left[86].pitch = [ji.r(64, 63).register(-1)] tw.rest(83, left) tw.rest(86, left) tw.make_solo_gong(71, left) left[71].pedal = attachments.Pedal(True) tw.swap_duration(57, 58, F(1, 8), left) tw.rest_many((80, 81, 82, 84, 85, 87, 88, 89, 90, 91, 92, 93), left) tw.crop(80, left, F(1, 4), F(2, 4), F(2, 4), F(2, 4), F(3, 4), F(2, 4), F(3, 4)) tw.add_kenong(80, left, ji.r(288, 245)) tw.add_kenong(81, left, ji.r(384, 245)) tw.add_kenong(82, left, ji.r(8, 5)) tw.add_kenong(83, left, ji.r(256, 245)) tw.add_kenong(84, left, ji.r(72, 49)) tw.add_kenong(85, left, ji.r(7, 6)) tw.add_kenong(86, left, ji.r(1, 1)) tw.add_kenong(87, left, ji.r(1, 1)) # for n in reversed(tuple(range(80, 87))): # tw.crop(n, left, *([F(1, 8)] * int(left[n].delay // float(F(1, 8))))) tw.crop(75, left, F(1, 8)) left[76].ottava = attachments.Ottava(0) left[76].pedal = attachments.Pedal(False) tw.crop(76, left, F(1, 16), F(3, 16), F(1, 8)) left[76].pitch = [ji.r(1, 1)] left[77].pitch = [ji.r(7, 8)] left[78].pitch = [ji.r(7, 6)] left[79].pitch = [ji.r(4, 3)] left[80].pitch = [ji.r(72, 49)] # left[81].pitch = [ji.r(256, 245), ji.r(384, 245)] left[81].pitch = [] left[81].volume = 0.65 left[81].ottava = attachments.Ottava(0) left[82].pitch = [ji.r(288, 245)] tw.swap_duration(82, 83, F(1, 16), left) left[83].volume = 0.75 left[83].pitch = [ji.r(256, 245)] tw.eat(83, 84, left) # tw.crop(83, left, F(1, 8)) # left[84].pitch = [ji.r(144, 245), ji.r(24, 49)] tw.eat(80, 81, left) print("left", len(left)) tw.crop(82, left, F(1, 8)) tw.add_gong(83, left, ji.r(288, 245)) # left[85].pedal = attachments.Pedal(True) tw.crop(90, left, F(6, 8)) tw.add_gong(91, left, ji.r(14, 9)) tw.swap_duration(80, 81, F(1, 8), left) tw.crop(81, left, F(1, 8)) # tw.crop(83, left, F(1, 16)) left[82].pitch = [ji.r(256, 245)] left[83].pitch = [ji.r(35, 48)] # left[84].pitch = [ji.r(288, 245).register(-1)] tw.crop(0, left, F(2, 8), F(1, 8)) left[1].pitch = [ji.r(7, 24)] left[2].pitch = [ji.r(35, 128)] tw.crop(4, left, F(1, 4), F(1, 8), F(1, 8)) left[5].pitch = [ji.r(12, 49)] left[6].pitch = [ji.r(96, 245)] left[7].pedal = attachments.Pedal(True) right[-1].fermata = attachments.Fermata("longfermata") left[-1].fermata = attachments.Fermata("longfermata")
def _adapt_cello(cello: lily.NOventLine, vm) -> None: tw.change_octave(1, 1, cello) cello[1].optional = False cello[1].volume = 0.6 tw.prolong(1, F(2, 8), cello) tw.crop(1, cello, F(1, 8), position=False) cello[2].acciaccatura = None cello[2].string_contact_point = PIZZ cello[2].pitch = [ji.r(1, 2)] cello[2].volume = 1.2 # tw.change_octave(4, 1, cello) cello[4].volume = 0.6 cello[5].pitch = [ji.r(7, 12)] # cello[5].string_contact_point = PIZZ # cello[5].volume = 1.9 cello[5].string_contact_point = ARCO cello[5].volume = 0.5 cello[6].volume = 0.56 cello[6].natural_harmonic = attachments.NaturalHarmonic() tw.change_octave(6, 2, cello) cello[9].acciaccatura = None tw.shorten(9, F(3, 32), cello) tw.crop(7, cello, F(1, 16)) tw.swap_duration(9, 8, F(1, 16), cello) cello[8].pitch = [ji.r(72, 49).register(-1)] cello[8].string_contact_point = ARCO cello[8].volume = 0.5 cello[9].glissando = None cello[12].acciaccatura = None tw.copy_pitch(10, 12, cello) tw.crop(11, cello, F(1, 16), position=False) cello[12].string_contact_point = ARCO cello[12].volume = 0.5 cello[12].pitch = [ji.r(72, 49).register(-1)] tw.crop(13, cello, F(1, 8), position=False) tw.prolong(14, F(1, 8), cello) cello[14].pitch = [ji.r(7, 6).register(-1)] tw.rest_many((15, 17, 18, 20, 21, 23), cello) tw.crop(15, cello, F(3, 4), F(3, 4), F(2, 4)) cello[16].pitch = [ji.r(12, 7).register(-2)] cello[17].pitch = [ji.r(72, 49).register(-1)] for n in (16, 17): cello[n].string_contact_point = ARCO cello[n].volume = 0.5 tw.prolong(14, F(3, 4), cello) tw.rest_many((18, 19, 21, 23), cello) tw.crop( 17, cello, F(7, 4) + F(1, 8), F(1, 4), F(1, 8), F(1, 4), F(1, 4), F(1, 2), F(1, 4), ) cello[18].pitch = [ji.r(12, 7).register(-1)] cello[19].pitch = [ji.r(7, 6).register(-1)] cello[20].pitch = [ji.r(16, 15).register(-1)] cello[22].pitch = [ji.r(1, 1).register(-1)] cello[23].pitch = [ji.r(7, 6).register(-2)] for n in (18, 19, 20, 23): cello[n].string_contact_point = PIZZ cello[n].volume = 1.2 for n in (22,): cello[n].string_contact_point = ARCO cello[n].volume = 0.4 tw.swap_duration(25, 24, F(1, 4), cello) tw.prolong(25, F(1, 16), cello) tw.crop(26, cello, F(1, 8)) tw.change_octave(27, -1, cello) cello[27].string_contact_point = PIZZ cello[27].volume = 1.2 tw.rest_many((29, 31), cello) tw.crop(22, cello, F(1, 8), position=False) cello[23].string_contact_point = PIZZ cello[23].volume = 2 cello[23].pitch = [ji.r(1, 4)] tw.prolong(28, F(1, 8) + F(3, 4), cello) cello[29].pitch = [ji.r(1, 4)] cello[29].volume = 2 cello[29].string_contact_point = PIZZ [tw.eat(29, 30, cello) for _ in range(2)] tw.crop(28, cello, F(1, 8)) cello[29].pitch = [ji.r(16, 15).register(-2)] tw.swap_duration(32, 33, F(1, 8), cello) cello[33].pitch = [ji.r(256, 189).register(-1)] cello[33].volume = 0.3 cello[33].string_contact_point = ARCO # tw.add_artifical_harmonic(33, ji.r(256, 189).register(-2), cello) tw.swap_duration(34, 33, F(1, 16), cello) tw.crop(33, cello, F(1, 8)) tw.rest(33, cello) cello[36].pitch = [ji.r(384, 245).register(-1)] cello[36].volume = 0.4 cello[36].string_contact_point = ARCO cello[31].ornamentation = attachments.OrnamentationUp(3) for n in (34, 35, 36): cello[n].string_contact_point = PIZZ cello[n].volume = 1.5 for n in (40, 41, 43): cello[n].acciaccatura = None tw.change_octave(n, -1, cello) cello[n].artifical_harmonic = None tw.crop(52, cello, F(1, 8), F(2, 16), F(2, 16), F(3, 8)) cello[55].pitch = [ji.r(72, 49).register(-1)] cello[55].volume = 0.6 cello[55].string_contact_point = ARCO tw.prolong(43, F(1, 32), cello) tw.prolong(38, F(1, 8), cello) tw.crop(43, cello, F(1, 8)) cello[43].pitch = [ji.r(384, 245).register(-1)] cello[44].pitch = [ji.r(6, 7)] for n in (38, 39, 43, 44, 45): cello[n].string_contact_point = PIZZ cello[n].volume = 1.4 for n in (48, 52, 53, 54): if n == 53: cello[n].pitch = [ji.r(384, 245).register(-1)] else: cello[n].pitch = [ji.r(6, 7)] cello[n].volume = 0.4 cello[n].string_contact_point = ARCO # tw.eat(53, 54, cello) # tw.add_glissando(51, (0, 0, 2), cello, durations=[F(3, 16), F(1, 8)]) # tw.add_glissando(52, (0, -2), cello) cello[51].acciaccatura = None tw.shorten(51, F(1, 8), cello) [tw.rest(58, cello) for _ in range(3)] tw.crop( 57, cello, F(1, 4), F(1, 8), F(1, 8), F(1, 16), F(3, 16), F(1, 8), F(1, 8), position=False, ) for n, pitch in ( (58, ji.r(7, 6)), (59, ji.r(1, 1)), (60, ji.r(16, 15)), (61, ji.r(1, 1)), (62, ji.r(1, 4)), ): if n != 62: tw.add_artifical_harmonic(n, pitch + ji.r(1, 2), cello) cello[n].pitch = [pitch + ji.r(2, 1)] if n == 62: cello[n].string_contact_point = PIZZ cello[n].volume = 1.6 else: cello[n].string_contact_point = ARCO cello[n].volume = 0.4 cello[63].pitch = [ji.r(8, 15)] cello[63].string_contact_point = PIZZ cello[63].volume = 1.25 for n in (64, 67): cello[n].string_contact_point = ARCO cello[n].volume = 0.45 tw.split(64, cello, F(3, 16), F(1, 16)) cello[64].pitch = [ji.r(7, 12)] cello[65].pitch = [ji.r(1, 2)] cello[67].pitch = [ji.r(384, 245).register(-1)] cello[68].pitch = [ji.r(72, 49).register(-1)] cello[70].acciaccatura = None tw.change_octave(70, 1, cello) cello[71].pitch = [ji.r(72, 49).register(-1)] cello[71].string_contact_point = ARCO cello[71].volume = 0.45 [tw.eat(71, 72, cello) for _ in range(2)] tw.crop(71, cello, F(1, 8)) cello[72].pitch = [ji.r(384, 245).register(-1)] tw.shorten(73, F(3, 16), cello) cello[75].optional = None cello[75].acciaccatura = None cello[75].string_contact_point = PIZZ cello[75].volume = 1.5 tw.swap_duration(74, 75, F(1, 16), cello) cello[56].string_contact_point = PIZZ cello[56].volume = 1.5 tw.crop(56, cello, F(1, 8)) cello[56].pitch = [ji.r(384, 245).register(-1)] cello[55].pitch = [ji.r(72, 49).register(-1)] tw.rest(51, cello) cello[63].string_contact_point = PIZZ cello[63].volume = 1.4 tw.rest_many((74, 76, 78, 80), cello) print("cello", len(cello)) tw.prolong(72, F(1, 16) + F(1, 4), cello) tw.crop( 73, cello, F(2, 4), F(1, 4), F(1, 4), F(2, 4), F(1, 4), F(1, 4), F(1, 4), F(2, 4), F(7, 4), ) tw.swap_duration(72, 71, F(1, 16), cello) cello[72].pitch = [ji.r(72, 49).register(1)] cello[73].pitch = [ji.r(384, 245).register(0)] cello[75].pitch = [ji.r(16, 15).register(0)] cello[76].pitch = [ji.r(384, 245).register(0)] cello[78].pitch = [ji.r(12, 7).register(0)] cello[79].pitch = [ji.r(72, 49).register(0)] cello[80].pitch = [ji.r(7, 6).register(0)] cello[81].pitch = [ji.r(1, 1).register(0)] for n in (72, 73, 75, 76, 78, 79, 80, 81): cello[n].string_contact_point = attachments.StringContactPoint( "molto sul tasto" ) cello[n].volume = 0.3 cello[72].string_contact_point = attachments.StringContactPoint("sul tasto") cello[69].pitch = [ji.r(7, 6).register(0)] tw.change_octave(75, 1, cello) for n in (72, 73, 75, 76, 78, 79): tw.add_artifical_harmonic(n, cello[n].pitch[0] - ji.r(4, 1), cello) cello[81].natural_harmonic = attachments.NaturalHarmonic() """ tw.postpone(72, F(1, 8), cello) """ tw.crop(0, cello, F(1, 8), F(1, 8)) cello[1].pitch = [ji.r(1, 2)] cello[2].pitch = [ji.r(7, 12)] tw.set_pizz(1, cello) tw.set_pizz(2, cello) tw.swap_duration(2, 3, F(1, 32), cello) tw.crop(5, cello, F(1, 4)) cello[5].pitch = [ji.r(3, 7)] tw.set_pizz(5, cello) for n in range(15, 20): cello[n].string_contact_point = attachments.StringContactPoint("sul tasto") cello[25].string_contact_point = attachments.StringContactPoint("arco ordinario") for n in range(29, 31): cello[n].string_contact_point = attachments.StringContactPoint("arco sul tasto") cello[n].dynamic = attachments.Dynamic('ppp') cello[31].dynamic = attachments.Dynamic('pp') for n in range(34, 36): cello[n].string_contact_point = attachments.StringContactPoint("arco ordinario")
def _adapt_viola(viola: lily.NOventLine, vm) -> None: viola[1].pitch = viola[1].pitch[:1] viola[1].choose = False viola[1].optional = False viola[1].volume = 0.65 tw.prolong(1, F(1, 4), viola) tw.crop(1, viola, F(1, 4)) viola[1].pitch = [ji.r(35, 48)] viola[2].string_contact_point = PIZZ viola[2].volume = 2 tw.crop(3, viola, F(1, 4)) viola[4].pitch = [ji.r(48, 49).register(-2)] viola[6].pitch = [ji.r(4, 7)] viola[8].pitch = [ji.r(35, 48)] tw.prolong(9, F(1, 4), viola) tw.crop(9, viola, F(1, 8), F(1, 8), F(3, 16), F(1, 16)) viola[9].pitch = [ji.r(48, 49)] viola[11].pitch = [ji.r(35, 48)] viola[12].pitch = [ji.r(4, 7)] for n in (4, 5, 6, 7, 8, 9, 10, 11, 12): if n < 9: tw.change_octave(n, 1, viola) viola[n].string_contact_point = ARCO viola[n].volume = 0.75 viola[n].optional = None viola[n].acciaccatura = None # tw.add_glissando(9, (0, -1), viola) tw.change_octave(13, -1, viola) viola[13].optional = None viola[13].volume = 0.65 tw.crop(14, viola, F(1, 4)) viola[14].pitch = [ji.r(48, 49)] viola[14].volume = 2 viola[14].string_contact_point = PIZZ viola[16].acciaccatura = None tw.rest_many((18, 20), viola) tw.prolong(16, F(1, 4), viola) tw.crop(17, viola, F(3, 4), F(2, 4)) viola[17].pitch = [ji.r(4, 7)] viola[18].pitch = [ji.r(48, 49)] for n in (17, 18): viola[n].string_contact_point = ARCO viola[n].volume = 0.5 viola[22].acciaccatura = None viola[24].acciaccatura = None tw.shorten(24, F(3, 16), viola) for n in (22, 23, 24): tw.change_octave(n, 1, viola) viola[n].glissando = None viola[n].string_contact_point = PIZZ viola[n].volume = 1 tw.swap_duration(23, 21, F(1, 8), viola) tw.crop(25, viola, F(1, 4), F(1, 2), F(1, 4)) viola[26].pitch = [ji.r(4, 5)] viola[26].string_contact_point = ARCO viola[26].volume = 0.6 viola[27].pitch = [ji.r(7, 8)] viola[27].string_contact_point = PIZZ viola[27].volume = 1 tw.rest(20, viola) tw.crop(26, viola, F(1, 8), position=False) viola[27].pitch = [ji.r(7, 8)] viola[27].volume = 0.7 viola[27].string_contact_point = ARCO viola[28].acciaccatura = None viola[29].string_contact_point = PIZZ viola[29].volume = 1.9 tw.crop(24, viola, F(1, 8), position=False) viola[25].string_contact_point = PIZZ viola[25].volume = 1.9 viola[25].pitch = [ji.r(8, 7)] tw.prolong(30, F(3, 4), viola) viola[31].string_contact_point = PIZZ viola[31].volume = 2 viola[31].pitch = [ji.r(7, 8)] tw.crop(30, viola, F(1, 8)) tw.crop(32, viola, F(1, 8), position=False) viola[33].pitch = [ji.r(7, 4).register(-1)] viola[33].string_contact_point = ARCO viola[33].volume = 0.7 viola[36].pitch = [ji.r(8, 5).register(-1)] viola[36].string_contact_point = ARCO viola[36].volume = 0.7 tw.eat(36, 37, viola) viola[34].glissando = None tw.add_glissando(34, (0, 0, 2), viola, durations=[F(1, 4), F(1, 8)]) # tw.change_octave(35, -1, viola) tw.split_by_structure(36, 3, viola, vm, adapt_by_changed_structure=True) viola[37].pitch = [ji.r(256, 245).register(-1)] viola[38].pitch = [ji.r(8, 5).register(-1)] # viola[40].pitch = [ji.r(8, 7).register(-1)] for n in ( 37, 38, ): viola[n].volume = 0.55 viola[n].string_contact_point = ARCO tw.change_octave(42, -1, viola) viola[44].acciaccatura = None tw.crop(35, viola, F(1, 8)) for n in (36, 37, 38): viola[n].string_contact_point = PIZZ viola[n].volume = 1.4 tw.eat(34, 35, viola) tw.add_glissando(34, (0, 0, 2, 2), viola, durations=[F(1, 4), F(1, 8), F(1, 8)]) tw.crop(52, viola, F(2, 4) + F(1, 8), F(2, 8)) viola[53].pitch = [ji.r(48, 49)] # viola[53].ornamentation = attachments.OrnamentationUp(1) for n in (46, 47, 49, 53): if n == 53: viola[n].string_contact_point = PIZZ viola[n].volume = 1.5 else: viola[n].string_contact_point = ARCO viola[n].volume = 0.66 viola[n].optional = None viola[51].optional = None viola[51].choose = None viola[51].volume = 0.66 viola[51].pitch = [ji.r(256, 245)] tw.swap_duration(41, 42, F(1, 16), viola) viola[41].pitch = [ji.r(4, 7)] tw.swap_duration(40, 41, F(1, 8), viola) for n in (40, 41): viola[n].string_contact_point = PIZZ viola[n].volume = 1.4 tw.add_glissando(38, (0, 0, -2), viola, durations=[F(1, 8), F(1, 8)]) tw.split(43, viola, F(1, 4), F(1, 8), F(1, 8)) for n in (44, 45, 46): viola[n].volume = 1.5 viola[n].string_contact_point = PIZZ viola[45].pitch = [ji.r(8, 7)] viola[46].pitch = [ji.r(4, 3)] tw.change_octave(59, 1, viola) tw.crop(59, viola, F(1, 8)) viola[60].pitch = [ji.r(4, 3)] viola[60].string_contact_point = PIZZ viola[60].volume = 1.25 viola[62].string_contact_point = ARCO viola[62].volume = 0.5 viola[62].optional = None tw.prolong(62, F(1, 8), viola) tw.crop(62, viola, F(1, 8), F(1, 8)) viola[63].pitch = [ji.r(35, 48)] viola[64].pitch = [ji.r(7, 8)] viola[65].string_contact_point = ARCO viola[65].volume = 0.5 viola[65].pitch = [ji.r(48, 49)] viola[66].acciaccatura = None tw.change_octave(66, 1, viola) tw.split_by_structure(69, 2, viola, vm, adapt_by_changed_structure=True) viola[69].pitch = [ji.r(4, 3)] viola[70].pitch = [ji.r(48, 49)] viola[71].pitch = [ji.r(256, 245).register(-1)] viola[71].string_contact_point = ARCO viola[71].volume = 0.5 tw.rest(72, viola) tw.rest(73, viola) tw.crop(72, viola, F(1, 4) + F(3, 16), F(1, 16)) viola[73].pitch = [ji.r(35, 24).register(-1)] viola[73].string_contact_point = PIZZ viola[73].volume = 1.4 tw.rest(52, viola) tw.crop(51, viola, F(1, 16), position=False) viola[52].pitch = [ji.r(256, 245)] viola[52].string_contact_point = PIZZ viola[52].volume = 1.5 viola[60].pitch = [ji.r(7, 8)] viola[60].string_contact_point = PIZZ viola[60].volume = 1.5 tw.rest_many((72, 74, 76, 78), viola) tw.crop( 71, viola, F(1, 4) + F(3, 4), F(2, 4), F(2, 4), F(4, 4), F(4, 4), F(2, 4), F(2, 4), ) viola[71].pitch = [ji.r(48, 49).register(0)] viola[72].pitch = [ji.r(8, 5).register(0)] viola[73].pitch = [ji.r(256, 245).register(0)] viola[74].pitch = [ji.r(48, 49).register(-1)] viola[75].pitch = [ji.r(7, 4).register(-1)] viola[76].pitch = [ji.r(8, 5).register(-1)] viola[77].pitch = [ji.r(4, 3).register(-1)] for n in range(71, 78): viola[n].string_contact_point = attachments.StringContactPoint( "molto sul tasto" ) viola[n].volume = 0.3 viola[71].string_contact_point = attachments.StringContactPoint("sul tasto") tw.change_octave(69, 1, viola) tw.change_octave(70, 2, viola) viola[67].pitch = [ji.r(8, 7)] tw.set_arco(67, viola) tw.eat(68, 67, viola) # tw.crop(67, viola, F(1, 8), position=False) # viola[68].pitch = [ji.r(8, 5)] """ tw.postpone(71, F(1, 4), viola) """ print("viola", len(viola)) viola[-1].fermata = attachments.Fermata("longfermata") tw.crop(2, viola, F(1, 4)) viola[3].pitch = [ji.r(48, 49)] tw.set_pizz(3, viola) for n in range(16, 19): viola[n].string_contact_point = attachments.StringContactPoint("arco sul tasto") viola[24].string_contact_point = attachments.StringContactPoint("arco ordinario") for n in range(28, 30): viola[n].string_contact_point = attachments.StringContactPoint("arco sul tasto") viola[n].dynamic = attachments.Dynamic('ppp') viola[30].dynamic = attachments.Dynamic('pp') for n in range(33, 35): viola[n].string_contact_point = attachments.StringContactPoint("arco ordinario")