Ejemplo n.º 1
0
def _adapt_left2(left: lily.NOventLine, vm) -> None:
    tw.rest_many((25, 26), left)
    tw.add_gong(25, left, ji.r(16, 15))
    tw.rest(26, left)
    left[28].pitch.append(ji.r(1, 1))
    tw.prolong(28, F(2, 4), left)
    tw.postpone(27, F(1, 16), left)
    tw.shorten(25, F(1, 4), left)
    left[26].ottava = attachments.Ottava(0)
    left[26].pedal = attachments.Pedal(False)

    left[32].pitch = [ji.r(24, 49), ji.r(144, 245)]

    tw.add_kenong(34, left, ji.r(8, 7))
    tw.add_kenong(35, left, ji.r(1, 1))
    tw.add_kenong(36, left, ji.r(7, 6))

    left[34].arpeggio = None

    left[31].ottava = attachments.Ottava(0)
    left[31].pedal = attachments.Pedal(False)
    tw.crop(31, left, *([F(1, 16)] * 4))
    left[31].pitch = [ji.r(18, 49)]
    left[32].pitch = [ji.r(96, 245)]
    left[33].pitch = [ji.r(24, 49)]
    left[34].pitch = [ji.r(128, 245)]

    tw.eat(32, 31, left)

    left[40].pitch = [ji.r(3, 4), ji.r(4, 7)]
    tw.crop(41, left, F(1, 16))
    left[41].pitch = [ji.r(7, 9)]
    left[42].pitch = [ji.r(7, 8), ji.r(7, 6)]
    left[43].pitch = [ji.r(4, 3), ji.r(7, 9)]
    # left[43].arpeggio = None

    left[46].pitch = [ji.r(7, 18), ji.r(7, 24)]

    print("left", len(left))

    tw.eat(46, 47, left)
    tw.make_solo_gong(47, left)
    tw.add_kenong(48, left, ji.r(1, 1))
    tw.add_kenong(49, left, ji.r(16, 15))

    left[48].pitch = [ji.r(1, 4)]
    left[48].volume = 0.81
    left[49].pitch = [ji.r(4, 15)]
    left[49].volume = 0.83
Ejemplo n.º 2
0
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)]
Ejemplo n.º 3
0
def add_gong(
    nth_event: int,
    novent_line: lily.NOventLine,
    pitch: ji.JIPitch = None,
    pedal: bool = True,
) -> None:
    if pitch is None:
        pitches = novent_line[nth_event].pitch
    else:
        pitches = [pitch]

    novent_line[nth_event].pitch = [
        p.register(keyboard.SYMBOLIC_GONG_OCTAVE) for p in pitches
    ]
    novent_line[nth_event].pedal = attachments.Pedal(pedal)
    novent_line[nth_event].ottava = attachments.Ottava(-1)
Ejemplo n.º 4
0
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")
Ejemplo n.º 5
0
def make_solo_gong(nth_event: int, novent_line: lily.NOventLine) -> None:
    novent_line[nth_event].arpeggio = None
    novent_line[nth_event].ottava = attachments.Ottava(-1)
    novent_line[nth_event].pitch = list(
        sorted(novent_line[nth_event].pitch)[:1])
    novent_line[nth_event].articulation_once = None