Beispiel #1
0
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)])
Beispiel #2
0
def _adapt_violin2(violin: lily.NOventLine, vm) -> None:
    tw.crop(15, violin, F(1, 4), F(1, 8), F(1, 8))
    violin[15].pitch = [ji.r(3, 4)]
    tw.set_pizz(15, violin)

    violin[16].pitch = [ji.r(7, 9)]
    tw.set_arco(16, violin)
    violin[17].pitch = [ji.r(8, 9)]
    tw.set_arco(17, violin)

    tw.split_by_structure(23, 2, violin, vm, adapt_by_changed_structure=True)
    violin[24].acciaccatura = None
    violin[24].pitch = [ji.r(8, 9)]
    tw.set_pizz(24, violin)
    tw.crop(24, violin, F(1, 8))
    violin[25].pitch = [ji.r(7, 9)]
    tw.prolong(25, F(1, 16), violin)

    violin[26].pitch = [ji.r(288, 245)]
    tw.set_pizz(26, violin)
    violin[27].pitch = [ji.r(48, 35)]
    tw.set_pizz(27, violin)
    tw.crop(28, violin, F(1, 8), F(1, 8), F(2, 4))
    violin[28].pitch = [ji.r(288, 245)]
    tw.set_pizz(28, violin)
    violin[29].pitch = [ji.r(288, 245)]
    tw.set_arco(29, violin)
    tw.set_arco(30, violin)
    violin[30].pitch = [ji.r(48, 35)]
    tw.crop(30, violin, F(2, 8) + F(1, 16), F(1, 16), F(1, 8))
    violin[32].pitch = [ji.r(8, 9)]
    tw.set_pizz(32, violin)
    tw.rest(31, violin)

    """
    # tw.postpone(40, F(1, 4), violin)
    violin[38].ornamentation = None
    # tw.change_octave(38, 1, violin)
    tw.crop(38, violin, F(3, 8), F(1, 4))
    tw.rest(39, violin)
    tw.crop(39, violin, F(1, 4), F(1, 8), F(1, 8))
    violin[40].pitch = [ji.r(8, 9)]
    violin[41].pitch = [ji.r(7, 9)]
    tw.set_arco(40, violin)
    tw.set_arco(41, violin)

    tw.crop(42, violin, F(2, 8))
    violin[43].pitch = [ji.r(3, 4)]

    tw.crop(44, violin, F(1, 4))
    violin[44].pitch = [ji.r(64, 63)]
    tw.set_arco(44, violin)

    tw.crop(39, violin, F(1, 8))
    violin[40].pitch = [ji.r(64, 63)]
    tw.set_arco(40, violin)

    tw.crop(38, violin, F(1, 8), F(1, 8), F(1, 8))
    tw.rest(39, violin)

    tw.crop(37, violin, F(1, 4))
    violin[38].pitch = [ji.r(48, 35)]
    tw.set_arco(38, violin)
    violin[38].volume = 0.3

    tw.swap_duration(44, 43, F(1, 16), violin)
    tw.postpone(43, F(1, 16), violin)

    tw.crop(47, violin, F(1, 16))
    violin[48].pitch = [ji.r(8, 9)]
    """

    tw.shorten(38, F(3, 16), violin)
    violin[38].ornamentation = attachments.OrnamentationDown(2)

    # for n in range(41, 45):
    #     # tw.set_pizz(n, violin)
    #     tw.change_octave(n, 1, violin)

    tw.shorten(40, F(1, 16), violin)

    violin[42].acciaccatura = None
    tw.change_octave(42, -1, violin)
    tw.swap_duration(41, 42, F(1, 8), violin)
    tw.prolong(42, F(1, 4), violin)
    tw.crop(42, violin, F(3, 16), F(3, 16), F(1, 8))
    violin[43].pitch = [ji.r(7, 9)]
    violin[44].pitch = [ji.r(8, 9)]
    violin[46].pitch = [ji.r(7, 9)]
    tw.set_arco(46, violin)
    tw.prolong(46, F(1, 8), violin)
    violin[46].volume = 0.3
    tw.crop(46, violin, F(2, 16))
    violin[47].pitch = [ji.r(8, 9)]

    tw.set_pizz(47, violin)
    tw.set_pizz(46, violin)

    print("len(violin)", len(violin))

    tw.rest_many((52,), violin)
    tw.crop(51, violin, F(1, 8), F(3, 16), F(1, 16), F(3, 16), F(1, 16), F(3, 4))
    violin[51].pitch = [ji.r(7, 9)]
    violin[52].pitch = [ji.r(8, 9)]
    violin[53].pitch = [ji.r(7, 9)]
    violin[54].pitch = [ji.r(8, 9)]
    violin[55].pitch = [ji.r(35, 32)]
    violin[56].pitch = [ji.r(35, 32)]

    for n in range(51, 57):
        tw.set_pizz(n, violin)

    tw.shorten(50, F(1, 16), violin)
    tw.add_glissando(50, (1, 0, 0), violin, durations=[F(1, 8), F(1, 16)])

    tw.crop(39, violin, F(1, 16) + F(1, 4), F(1, 8))
    violin[40].pitch = [ji.r(48, 35)]
    tw.set_pizz(40, violin)
Beispiel #3
0
def _adapt_viola2(viola: lily.NOventLine, vm) -> None:
    tw.prolong(19, F(1, 32), viola)
    tw.crop(19, viola, F(1, 16), F(1, 16), F(1, 16), position=False)
    viola[21].pitch = [ji.r(8, 7)]
    viola[22].pitch = [ji.r(4, 3)]
    viola[23].pitch = [ji.r(8, 7)]

    for n in (20, 21, 22, 23):
        tw.set_pizz(n, viola)
        tw.change_octave(n, -1, viola)

    tw.rest_many((26, 27), viola)
    tw.prolong(24, F(1, 32), viola)
    tw.crop(25, viola, F(1, 8), F(2, 8) + F(1, 16), F(1, 16), F(1, 8))
    viola[26].pitch = [ji.r(4, 5)]
    tw.set_arco(26, viola)
    viola[28].pitch = [ji.r(2, 3)]
    tw.set_pizz(28, viola)
    tw.rest(27, viola)

    tw.set_pizz(33, viola)
    tw.change_octave(33, 1, viola)
    tw.prolong(33, F(5, 32), viola)
    tw.postpone(33, F(1, 8), viola)

    # print(viola[33:36])

    tw.crop(34, viola, F(1, 4) + F(1, 16), F(2, 16), F(1, 16))
    viola[35].pitch = [ji.r(48, 49)]
    viola[36].pitch = [ji.r(256, 245)]

    viola[37].pitch = [ji.r(48, 49)]
    viola[37].acciaccatura = None

    viola[38].pitch = [ji.r(256, 245)]
    tw.crop(38, viola, F(1, 16))
    viola[39].pitch = [ji.r(8, 7)]
    viola[40].acciaccatura = None
    tw.swap_duration(40, 39, F(1, 8), viola)

    tw.crop(41, viola, F(1, 8), F(1, 4))
    viola[41].pitch = [ji.r(7, 8)]
    viola[42].pitch = [ji.r(35, 48)]

    for n in (35, 36, 39, 41, 42):
        tw.set_arco(n, viola)

    viola[43].ornamentation = None
    tw.crop(43, viola, F(1, 8))
    viola[43].pitch = [ji.r(48, 49)]

    tw.shorten(42, F(1, 16), viola)
    viola[47].pitch = [ji.r(2, 3)]
    # tw.shorten(47, F(1, 32), viola)
    viola[48].pitch = [ji.r(35, 48)]
    tw.set_arco(46, viola)
    tw.set_arco(48, viola)
    tw.prolong(55, F(1, 32), viola)
    # tw.crop(55, viola, F(1, 16))
    viola[54].pitch = [ji.r(35, 48)]

    tw.split_by_structure(48, 2, viola, vm, adapt_by_changed_structure=True)
    viola[49].pitch = [ji.r(2, 3)]
    tw.set_pizz(49, viola)

    tw.rest_many((56, 55, 53, 52), viola)
    tw.crop(
        51,
        viola,
        F(1, 8),
        F(1, 4),
        F(1, 8),
        F(1, 8),
        F(1, 8),
        F(3, 16),
        F(1, 16),
        F(1, 8),
        F(1, 8),
        F(1, 8),
        F(1, 8),
        F(1, 8),
        F(1, 8),
    )
    viola[52].pitch = [ji.r(35, 48)]
    viola[54].pitch = [ji.r(2, 3)]
    viola[56].pitch = [ji.r(2, 3)]
    viola[57].pitch = [ji.r(7, 8)]
    viola[58].pitch = [ji.r(35, 48)]

    for n in range(59, 64):
        viola[n].pitch = [ji.r(7, 8)]

    for n in (51, 53, 55, 56, 57, 58, 59, 60, 61, 62):
        if n == 51:
            tw.set_arco(n + 1, viola)
        else:
            tw.set_pizz(n + 1, viola)

    for idx, value in enumerate(np.linspace(1.1, 0.2, 5)):
        viola[59 + idx].volume = float(value)

    tw.shorten(52, F(1, 16), viola)
    tw.add_glissando(52, (1, 0, 0), viola, durations=[F(1, 8), F(1, 16)])
Beispiel #4
0
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)
Beispiel #5
0
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)])
Beispiel #6
0
def _adapt_viola(viola: lily.NOventLine, vm) -> None:
    tw.detach_optional_events(viola)

    tw.swap_duration(0, 1, F(1, 16), viola)
    tw.add_glissando(
        1, (-1, 0, 0), viola, durations=(F(1, 16), F(3, 16)),
    )
    viola[2].choose = None
    viola[2].volume = 0.5
    viola[2].pitch = viola[2].pitch[:1]
    tw.prolong(2, F(1, 32), viola)
    viola[5].pitch = [ji.r(7, 8)]
    for n in (5, 6):
        viola[n].string_contact_point = attachments.StringContactPoint("arco")
        viola[n].volume = 0.5

    # tw.change_octave(12, -1, viola)
    viola[12].pitch = [ji.r(48, 49)]
    # tw.swap_duration(11, 12, F(1, 8), viola)
    tw.prolong(12, F(5, 32), viola)
    tw.add_glissando(
        12, (-1, 0, 0), viola, durations=[F(1, 8), F(1, 4)],
    )
    # tw.split(11, viola, F(1, 8), F(1, 16))
    viola[11].pitch = [ji.r(7, 8)]
    viola[11].volume = 0.5
    viola[11].string_contact_point = attachments.StringContactPoint("arco")

    tw.change_octave(14, 1, viola)

    for n in (18, 19, 21, 22, 24):
        tw.change_octave(n, -1, viola)
        viola[n].string_contact_point = attachments.StringContactPoint("pizzicato")
        viola[n].volume = 1

    viola[25].string_contact_point = attachments.StringContactPoint("arco")
    viola[25].volume = 0.5
    tw.change_octave(25, -1, viola)

    tw.rest(24, viola)

    for n in (29, 30, 33, 35, 36, 38, 39):
        tw.change_octave(n, -1, viola)

    viola[39].string_contact_point = attachments.StringContactPoint("arco")
    viola[39].volume = 0.6

    tw.rest(31, viola)

    viola[32].acciaccatura = None
    tw.prolong(32, F(1, 32), viola)
    tw.add_glissando(
        32, (0, 0, -1), viola, durations=[F(3, 16), F(1, 16)],
    )

    viola[28].ornamentation = attachments.OrnamentationUp(2)

    tw.crop(3, viola, F(1, 4) + F(3, 16), F(1, 16), F(1, 4), F(1, 4))
    viola[4].pitch = [ji.r(35, 48)]
    viola[5].pitch = [ji.r(35, 48)]
    viola[6].pitch = [ji.r(7, 8)]
    tw.set_pizz(4, viola)
    tw.set_pizz(5, viola)
    tw.set_pizz(6, viola)
    viola[6].volume = 1.5

    tw.rest(12, viola)
    tw.prolong(10, F(1, 32), viola)
    tw.crop(11, viola, F(1, 8) + F(1, 16), F(1, 16), F(1, 8))
    viola[12].pitch = [ji.r(7, 8)]
    tw.set_pizz(12, viola)
    viola[13].pitch = [ji.r(2, 3)]
    tw.set_pizz(13, viola)

    tw.postpone(14, F(1, 8), viola)
Beispiel #7
0
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")
Beispiel #8
0
def _adapt_violin(violin: lily.NOventLine, vm) -> None:
    tw.change_octave(4, 1, violin)
    tw.change_octave(5, 1, violin)
    tw.change_octave(6, -1, violin)
    tw.change_octave(7, -1, violin)
    violin[7].optional = None
    violin[7].volume = 1.2
    tw.split_by_structure(5, 3, violin, vm, adapt_by_changed_structure=True)
    violin[6].pitch = [ji.r(16, 9).register(0)]
    tw.split_by_structure(3, 2, violin, vm, adapt_by_changed_structure=True)
    tw.split_by_structure(1, 2, violin, vm, adapt_by_changed_structure=True)
    violin[2].acciaccatura = None
    violin[5].acciaccatura = None

    tw.swap_duration(7, 8, F(1, 32), violin)
    tw.swap_duration(8, 9, F(3, 16), violin)
    tw.crop(10, violin, F(1, 4))
    violin[11].acciaccatura = None
    violin[11].pitch = [ji.r(48, 35)]

    tw.crop(9, violin, F(1, 16), F(1, 16))
    violin[9].pitch = [ji.r(64, 63).register(1)]
    violin[10].pitch = [ji.r(16, 9).register(0)]
    tw.add_glissando(8, (0, 1), violin)
    tw.add_glissando(9, (0, -1), violin)

    tw.crop(17, violin, F(4, 4), F(3, 4), F(2, 4))

    violin[17].pitch = [ji.r(35, 32).register(0)]
    violin[18].pitch = [ji.r(3, 2).register(-1)]
    violin[19].pitch = [ji.r(288, 245).register(0)]

    tw.crop(20, violin, F(7, 4) + F(1, 8), F(1, 4), F(1, 8))

    for n in (17, 18, 19, 21, 22):
        violin[n].string_contact_point = ARCO
        violin[n].volume = 0.5

    for n in (21, 22, 26):
        violin[n].string_contact_point = PIZZ
        violin[n].volume = 1.2

    violin[21].pitch = [ji.r(3, 2).register(0)]
    violin[22].pitch = [ji.r(35, 32).register(0)]

    for n in (24, 25, 26):
        tw.change_octave(n, 1, violin)

    tw.swap_duration(23, 24, F(1, 16), violin)
    violin[25].acciaccatura = None
    violin[26].acciaccatura = None
    tw.swap_duration(23, 24, F(1, 8), violin)
    tw.add_glissando(24, (2, 0, 0), violin, durations=[F(1, 8), F(1, 4)])
    violin[25].pitch = [ji.r(48, 35)]

    tw.prolong(26, F(1, 32), violin)
    tw.crop(27, violin, F(2, 4), F(1, 4))

    violin[28].pitch = [ji.r(35, 32)]
    violin[28].volume = 0.5
    violin[28].string_contact_point = ARCO

    tw.crop(29, violin, F(1, 4))

    violin[29].pitch = [ji.r(48, 35)]
    violin[29].volume = 1.2
    violin[29].string_contact_point = PIZZ

    tw.crop(27, violin, F(1, 8), position=False)
    violin[28].pitch = [ji.r(14, 9)]
    violin[28].volume = 0.5
    violin[28].string_contact_point = ARCO

    tw.crop(25, violin, F(1, 8), position=False)
    violin[26].pitch = [ji.r(3, 2)]
    violin[26].string_contact_point = PIZZ
    violin[26].volume = 1.2

    tw.crop(31, violin, F(1, 8))
    violin[31].pitch = [ji.r(3, 2)]

    tw.crop(31, violin, F(1, 8))

    # tw.eat(33, 34, violin)
    tw.eat(34, 35, violin)

    violin[35].optional = None

    tw.crop(35, violin, F(1, 8))

    violin[36].pitch = [ji.r(48, 35)]
    violin[36].volume = 0.4
    # violin[36].string_contact_point = ARCO
    violin[36].acciaccatura = None

    violin[39].pitch = [ji.r(3, 4)]
    violin[39].volume = 0.6
    violin[39].string_contact_point = ARCO

    tw.swap_duration(38, 39, F(3, 32), violin)
    tw.crop(39, violin, F(1, 8))
    tw.rest(40, violin)
    tw.eat(39, 38, violin)
    # tw.swap_duration(39, 40, F(1, 4), violin)

    violin[39].pitch = [ji.r(288, 245)]
    violin[39].volume = 0.6
    violin[39].string_contact_point = ARCO

    tw.swap_duration(42, 41, F(1, 16), violin)

    tw.eat(39, 40, violin)
    tw.crop(40, violin, F(1, 8))

    for n in (41, 43):
        violin[n].string_contact_point = PIZZ
        violin[n].volume = 2

    violin[41].hauptstimme = attachments.Hauptstimme(True, False)
    violin[42].hauptstimme = attachments.Hauptstimme(True, False)
    violin[43].hauptstimme = attachments.Hauptstimme(False, False)
    violin[44].hauptstimme = attachments.Hauptstimme(False, False)
    violin[45].hauptstimme = attachments.Hauptstimme(False, True)
    violin[46].hauptstimme = None

    tw.eat(39, 40, violin)
    tw.add_glissando(39, (0, 0, -2, -2), violin, durations=[F(1, 4), F(1, 8), F(1, 8)])

    tw.crop(47, violin, F(1, 8), F(2, 4) + F(4, 4), F(1, 4) + F(0, 8), F(3, 8))

    for n in (48, 50):
        violin[n].pitch = [ji.r(288, 245)]
        if n == 50:
            violin[n].string_contact_point = PIZZ
            violin[n].volume = 1.8
        else:
            violin[n].string_contact_point = ARCO
            violin[n].volume = 0.55

    tw.split_by_structure(
        48, 5, violin, vm, adapt_by_changed_structure=True, set_n_novents2rest=2
    )

    tw.crop(45, violin, F(1, 8))
    tw.crop(46, violin, F(2, 4), F(1, 8), F(1, 8))

    violin[45].pitch = [ji.r(7, 9)]

    violin[47].pitch = [ji.r(288, 245)]
    violin[48].pitch = [ji.r(48, 35)]
    violin[49].pitch = [ji.r(14, 9)]

    for n in (44, 45, 47, 48, 49):
        violin[n].volume = 1.5
        violin[n].string_contact_point = PIZZ

    # tw.swap_duration(51, 52, F(1, 8), violin)
    tw.shorten(52, F(1, 8), violin)
    tw.rest(55, violin)

    tw.rest(60, violin)
    tw.crop(59, violin, F(5, 8), F(1, 8))

    violin[60].pitch = [ji.r(48, 35)]
    violin[61].pitch = [ji.r(288, 245)]
    violin[62].pitch = [ji.r(8, 9)]

    for n in (60, 61):
        violin[60].volume = 0.4
        violin[60].string_contact_point = ARCO

    for n in (66, 67):
        violin[n].glissando = None
        violin[n].acciaccatura = None
        violin[n].string_contact_point = PIZZ
        violin[n].volume = 1.5

    tw.swap_duration(55, 56, F(1, 16), violin)
    tw.crop(56, violin, F(1, 16), F(1, 8))
    violin[56].pitch = [ji.r(3, 2)]
    violin[57].pitch = [ji.r(48, 35)]

    tw.crop(59, violin, F(1, 8), F(1, 8), position=False)

    violin[60].pitch = [ji.r(3, 4)]
    violin[61].pitch = [ji.r(8, 9)]
    violin[62].pitch = [ji.r(3, 2)]
    for n in (60, 61, 62):
        violin[n].volume = 1.5
        violin[n].string_contact_point = PIZZ

    tw.rest_many((70, 71, 72, 74), violin)

    tw.crop(
        69,
        violin,
        F(1, 32) + F(3, 4),
        F(5, 4),
        F(2, 4),
        F(1, 4),
        F(3, 4),
        F(1, 4),
        F(2, 4),
    )

    tw.swap_duration(68, 69, F(1, 32), violin)

    violin[69].pitch = [ji.r(288, 245).register(1)]
    violin[70].pitch = [ji.r(48, 35).register(0)]
    violin[71].pitch = [ji.r(288, 245).register(0)]
    violin[73].pitch = [ji.r(3, 2).register(0)]
    violin[74].pitch = [ji.r(8, 9).register(-1)]
    violin[76].pitch = [ji.r(7, 9).register(-1)]

    for n in (69, 70, 71, 73, 74, 76):
        violin[n].string_contact_point = attachments.StringContactPoint(
            "molto sul tasto"
        )
        violin[n].volume = 0.3

    violin[69].string_contact_point = attachments.StringContactPoint("sul tasto")

    # for n in (70, 71):
    #     tw.change_octave(n, 1, violin)

    violin[76].volume = 0.4

    tw.change_octave(66, 1, violin)
    tw.change_octave(68, 1, violin)
    violin[68].acciaccatura = None
    # tw.crop(68, violin, F(1, 8), position=False)
    # violin[69].pitch = [ji.r(48, 35).register(1)]

    # tw.crop(65, violin, F(1, 32), position=False)
    # violin[66].pitch = [ji.r(3, 2)]
    violin[66].pitch = [ji.r(14, 9)]
    violin[67].pitch = [ji.r(16, 9)]
    tw.set_arco(66, violin)
    tw.set_arco(67, violin)
    """
    tw.postpone(69, F(1, 16), violin)
    """

    print("violin", len(violin))
    violin[-1].fermata = attachments.Fermata("longfermata")

    tw.crop(0, violin, F(1, 8), F(1, 8))
    violin[1].pitch = [ji.r(3, 4)]
    violin[2].pitch = [ji.r(7, 9)]
    tw.set_pizz(1, violin)
    tw.set_pizz(2, violin)

    tw.swap_duration(2, 3, F(1, 32), violin)

    # tw.rest(1, violin)
    tw.eat(1, 0, violin)
    # tw.crop(4, violin, F(1, 8), F(1, 4))
    # violin[5].pitch = [ji.r(48, 35)]
    # tw.set_pizz(5, violin)

    for n in range(17, 21):
        violin[n].string_contact_point = attachments.StringContactPoint(
            "arco sul tasto"
        )

    for n in range(25, 27):
        violin[n].string_contact_point = attachments.StringContactPoint(
            "arco ordinario"
        )

    for n in range(30, 32):
        violin[n].dynamic = attachments.Dynamic('ppp')
        violin[n].string_contact_point = attachments.StringContactPoint(
            "arco sul tasto"
        )

    violin[32].dynamic = attachments.Dynamic('pp')

    for n in range(36, 38):
        violin[n].string_contact_point = attachments.StringContactPoint(
            "arco sul ponticello"
        )

    for n in range(39, 41):
        violin[n].string_contact_point = attachments.StringContactPoint("ordinario")