Exemple #1
0
def struggle_r(trk, bt):
    """Generate the first part of the right hand"""
    bl = bt
    cr = bt / 2
    w = bt * 2
    r = bt * 4
    bl, cr, w, r = int(bl), int(cr), int(w), int(r)

    trk = add_notes(trk, [[60], [65], [68], [65]], [cr, cr, cr, cr + w])
    trk = add_notes(trk, [[61], [65], [68], [60], [65], [68]],
                    [cr, cr, bl, cr, cr, bl])
    trk = add_notes(trk, [[58], [63], [67], [63]], [cr, cr, cr, cr + w + cr])
    trk = add_notes(trk, [[56], [61], [65], [60]], [cr, cr, cr, cr + w])
    trk = add_notes(trk, [[65], [68], [65]], [cr, cr, cr + w])
    trk = add_notes(trk, [[61], [65], [68], [60], [65], [68]],
                    [cr, cr, bl, cr, cr, bl])
    trk = add_notes(trk, [[58], [63], [67], [63]], [cr, cr, cr, cr + w + r])
    trk = add_notes(trk, [[58], [65], [68], [65]], [cr, cr, cr, cr + w + r])
    trk = add_notes(trk, [[58], [63], [67], [63]], [cr, cr, cr, cr + w + r])

    trk = first_partr(trk, bt)

    trk = d_crochesr(trk, bt)

    trk = motif1r(trk, bt)

    trk = motif2r(trk, bt)

    trk = first_partr(trk, bt)

    trk = d_crochesr(trk, bt)

    return trk
Exemple #2
0
def motif1(trk, bt, notes, nb):
    """Produce the first motif"""
    c = int(bt / 2)
    cc = int(bt / 4)
    for i in range(nb):
        trk = add_notes(trk, notes, [c, cc, cc, cc, cc, c])
    return trk
Exemple #3
0
def d_croche(trk, bt, pattern, nb=4):
    """Generate a pattern of double croches"""
    cc = int(bt / 4)
    pat = []
    for i in range(nb):
        pat += pattern
    trk = add_notes(trk, pat, [cc for i in range(4 * nb)])
    return trk
Exemple #4
0
def motif2(trk, bt, ns, nb):
    """Produce the first motif"""
    c = int(bt / 2)
    cc = int(bt / 4)
    for i in range(nb):
        trk = add_notes(trk, [ns[0], ns[0], ns[1], ns[0], ns[1], ns[2]],
                        [c, cc, c, cc, cc, cc])
    return trk
Exemple #5
0
def struggle_l(trk, bt):
    """Generate the first part of the right hand"""
    bl = bt
    cr = bt / 2
    w = bt * 2
    r = bt * 4
    bl, cr, w, r = int(bl), int(cr), int(w), int(r)

    trk = add_notes(trk, [[-1] for i in range(12)], [r for i in range(12)])

    trk = add_notes(trk, [[65 - 12] for i in range(36)],
                    [bl for i in range(36)])
    trk = motif0(trk, 65 - 12, bt, 6)
    trk = motif0(trk, 63 - 12, bt, 6)
    trk = motif0(trk, 70 - 24, bt, 6)
    trk = motif0(trk, 63 - 24, bt, 10)

    trk = d_crochesl(trk, bt)

    trk = motifls(trk, bt)

    trk = motifls(trk, bt)

    trk = add_notes(trk, [[53]], [bl])
    trk = add_couples(trk, [53 - 12], [[-1]] + [[53] for i in range(14)],
                      [bl for i in range(15)])
    trk = add_notes(trk, [[53]], [bl])
    trk = add_couples(trk, [53 - 12], [[-1]] + [[53], [53]],
                      [bl for i in range(3)])
    trk = add_couples(trk, [53 - 12], [[53] for i in range(12)],
                      [bl for i in range(12)])
    trk = add_notes(trk, [[53]], [bl])
    trk = add_couples(trk, [53 - 12], [[-1]] + [[53], [53]],
                      [bl for i in range(3)])
    trk = add_notes(trk, [[53]], [bl])
    trk = add_couples(trk, [53 - 12], [[-1]] + [[53] for i in range(6)],
                      [bl for i in range(7)])
    trk = add_notes(trk, [[63 - 12]], [bl])
    trk = add_couples(trk, [63 - 24], [[-1]] + [[63 - 12] for i in range(6)],
                      [bl for i in range(7)])
    trk = add_notes(trk, [[70 - 24]], [bl])
    trk = add_couples(trk, [70 - 24], [[-1]] + [[70 - 12] for i in range(6)],
                      [bl for i in range(7)])
    trk = add_notes(trk, [[63 - 12]], [bl])
    trk = add_couples(trk, [63 - 24], [[-1]] + [[63 - 12] for i in range(10)],
                      [bl for i in range(11)])

    trk = d_crochesl(trk, bt)

    return trk
Exemple #6
0
def pre7r(trk, bt):
    cl = int(bt/2)
    c = int(bt/4)
    bp = cl + int(cl/2)
    bl = int(2*bt)

    trk = add_notes(trk, [[64], [61+12], [62+12], [62, 67+1, 71],
                          [62, 67+1, 71],[62, 67+1, 71]],
                    [bt, bp, c, bt, bt, bl] )

    trk = add_notes(trk, [[62+12, 66+12], [60+12, 63+12], [61+12, 64+12],
                          [61+12, 69+12], [61+12, 69+12], [61+12, 69+12]],
                    [bt, bp, c, bt, bt, 2*bt])

    trk = add_notes(trk, [[64, 61+12], [62, 70], [62, 71]],
                          [bt, bp, c])
    trk = add_couples(trk, [62], [[66, 62+12], [66, 62+12], [66, 62+12]]
                      ,[bt, bt, bl])

    trk = add_notes(trk, [[62, 68], [62, 68], [61, 69], [61, 61 + 12],
                          [61, 61+12], [61, 61+12]],
                    [bt, bp, c, bt, bt, bl])

    trk = add_notes(trk, [[64]], [bt])
    trk = add_couples(trk, [64, 68], [[61+12], [62+12]], [bp, c])
    trk = add_notes(trk, [[62, 68, 71],  [62, 68, 71], [62, 68, 71]],
                    [bt, bt, bl])

    trk = add_notes(trk, [[62+12, 66+12], [72, 63+12], [61+12, 64+12],
                          [61+12, 64+12, 69+12, 61+24],
                          [61+12, 64+12, 69+12, 61+24],
                          [70, 61+12, 64+12, 70+12, 61+24]],
                    [bt, bp, c, bt, bt, bl])

    trk = add_notes(trk, [[70, 61+12], [70, 61+12], [71, 62+12],
                          [71, 66+12],
                          [70, 66+12],
                          [68, 66+12]],
                    [bt, bp, c, bt, bt, bl])

    trk = add_notes(trk, [[62, 68], [62, 71], [61, 69]],
                    [bt, bp, c])
    trk = add_couples(trk, [69], [[61+12, 69+12], [61+12, 69+12], [61+12, 69+12]],
                      [bt, bt, bl])
    return trk
Exemple #7
0
def gno1_r(trk, bt, second=False):

    trk = add_notes(trk, [[-1], [66 + 12], [69 + 12], [67 + 12], [66 + 12],
                          [61 + 12], [71], [61 + 12], [62 + 12], [69], [66]],
                    [bt * 13, bt, bt, bt, bt, bt, bt, bt, bt, 3 * bt, 12 * bt])
    trk = add_notes(trk, [[-1], [66 + 12], [69 + 12], [67 + 12], [66 + 12],
                          [61 + 12], [71], [61 + 12], [62 + 12], [69]],
                    [bt for i in range(9)] + [3 * bt])
    trk = add_notes(
        trk, [[61 + 12], [66 + 12], [64], [69], [71], [60 + 12], [64 + 12],
              [62 + 12], [71], [62 + 12], [60 + 12], [71]],
        [3 * bt, 3 * bt, 9 * bt, bt, bt, bt, bt, bt, bt, bt, bt, bt])
    trk = add_notes(trk,
                    [[62 + 12], [62 + 12], [64 + 12], [65 + 12], [67 + 12],
                     [69 + 12], [60 + 12], [62 + 12], [64 + 12], [62 + 12],
                     [71], [62 + 12], [62 + 12]],
                    [5 * bt] + [bt for i in range(10)] + [5 * bt, bt])
    if not second:
        trk = add_notes(
            trk, [[67 + 12], [66 + 12], [71], [69], [71], [61 + 12], [62 + 12],
                  [64 + 12], [61 + 12], [62 + 12], [64 + 12], [66],
                  [60, 64, 69, 60 + 12], [62, 66, 69, 62]],
            [3 * bt, 3 * bt] + [bt
                                for i in range(9)] + [3 * bt, 3 * bt, 3 * bt])
    else:
        trk = add_notes(
            trk, [[67 + 12], [65 + 12], [71], [60 + 12], [65 + 12], [64 + 12],
                  [62 + 12], [60 + 12], [64 + 12], [62 + 12], [60 + 12], [65],
                  [60, 64, 69, 60 + 12], [62, 65, 69, 62]],
            [3 * bt, 3 * bt] + [bt
                                for i in range(9)] + [3 * bt, 3 * bt, 3 * bt])

    return trk
Exemple #8
0
def pre7l(trk, bt):
    bl = int(2*bt)
    d_pat = [bt, bt, bt, bl, bt]
    trk = add_notes(trk, [[-1]], [bt])
    trk = add_notes(trk, [[64-24], [64-12, 64],  [64-12, 64], [64-12, 64],
                          [-1]],
                    d_pat)
    trk = add_notes(trk, [[69-24], [69-12, 64],  [69-12, 64], [69-12, 64],
                          [-1]],
                    d_pat)
    trk = add_notes(trk, [[64-24], [64-12, 71-12],  [64-12, 71-12],
                          [64-12, 71-12],
                          [-1]],
                    d_pat)

    trk = add_notes(trk, [[64-24], [64-12, 64],  [64-12, 64], [64-12, 64],
                          [-1]],
                    d_pat)

    trk = add_notes(trk, [[69-36], [64-12, 69-12, 64],
                          [64-12, 69-12, 64],
                          [69-12, 69-12, 64], [-1]],
                    d_pat)

    trk = add_notes(trk, [[69-24], [69-12, 64, 69], [69-12, 64, 69],
                          [66-12, 64, 61, 66],
                          [-1]],
                    d_pat)
    trk = add_notes(trk, [[71-36], [66-12, 62], [66-12, 71-12, 62],
                          [66-12, 71-12, 62], [-1]],
                    d_pat)
    trk = add_notes(trk, [[69-36], [64-12, 69-12, 64],
                          [64-12, 69-12, 64],
                          [69-12, 64], [-1]],
                    d_pat)
    return trk
Exemple #9
0
def first_partr(trk, bt):
    bl = bt
    cr = bt / 2
    w = bt * 2
    r = bt * 4
    bl, cr, w, r = int(bl), int(cr), int(w), int(r)

    trk = add_notes(trk, [[-1], [60], [65], [68], [65]],
                    [cr, cr, cr, cr, w + cr])
    trk = add_notes(trk, [[61], [65], [68], [60], [65], [68]],
                    [cr, cr, bl, cr, cr, bl])
    trk = add_notes(trk, [[58], [63], [67], [63]], [cr, cr, cr, w + cr])
    trk = add_notes(trk, [[56], [61], [65], [60]], [cr, cr, cr, w + cr])
    trk = add_notes(trk, [[65], [68], [65]], [cr, cr, cr + w])
    trk = add_notes(trk, [[-1], [61], [65], [68], [60], [65], [68]],
                    [cr, cr, cr, bl, cr, cr, bl])
    trk = add_notes(trk, [[58], [63], [67], [63]], [cr, cr, cr, w + cr])
    trk = add_notes(trk, [[56], [61], [65], [60]], [cr, cr, cr, w + cr])
    trk = add_notes(trk, [[65], [68], [65]], [cr, cr, cr + w])
    trk = add_notes(trk, [[60], [65], [68], [65]], [cr, cr, cr, cr + w])
    trk = add_notes(trk, [[61], [65], [68], [60], [65], [68]],
                    [cr, cr, bl, cr, cr, bl])
    trk = add_notes(trk, [[58], [63], [67], [63]], [cr, cr, cr, cr + w + r])
    trk = add_notes(trk, [[58], [65], [68], [65]], [cr, cr, cr, cr + w + r])
    trk = add_notes(trk, [[58], [63], [67], [63]],
                    [cr, cr, cr, cr + w + r + r])
    return trk
Exemple #10
0
def motif0(trk, n, bt, l):
    trk = add_notes(trk, [[n]], [2 * bt])
    trk = add_couples(trk, [n - 12], [[-1]] + [[n] for i in range(l - 1)],
                      [bt for i in range(l)])
    return trk
Exemple #11
0
def gno1_l(trk, bt, second=False):
    for i in range(8):
        trk = add_couples(trk, [67 - 24], [[-1], [71 - 12, 62, 66]],
                          [bt, 2 * bt])
        trk = add_couples(trk, [62 - 24], [[-1], [69 - 12, 61, 66]],
                          [bt, 2 * bt])

    trk = add_couples(trk, [66 - 24], [[-1], [69 - 12, 61, 66]], [bt, 2 * bt])
    trk = add_couples(trk, [71 - 36], [[-1], [71 - 12, 62, 66]], [bt, 2 * bt])
    trk = add_couples(trk, [64 - 24], [[-1], [71 - 12, 69 - 12]], [bt, 2 * bt])
    trk = add_couples(trk, [64 - 24], [[-1], [71 - 12, 62, 67]], [bt, 2 * bt])
    trk = add_couples(trk, [62 - 24], [[-1], [65 - 12, 69 - 12, 62]],
                      [bt, 2 * bt])
    trk = add_couples(trk, [69 - 36], [[-1], [69 - 12, 60, 64]], [bt, 2 * bt])
    trk = add_couples(trk, [62 - 24], [[-1], [67 - 12, 71 - 12, 64]],
                      [bt, 2 * bt])
    trk = add_couples(trk, [62 - 24], [[-1], [62 - 12, 67 - 12, 71 - 12, 64]],
                      [bt, 2 * bt])

    trk = add_couples(trk, [62 - 24], [[-1], [60 - 24, 64 - 12, 69 - 12, 62]],
                      [bt, 2 * bt])
    trk = add_couples(trk, [62 - 24], [[-1], [60 - 24, 66 - 12, 69 - 12, 62]],
                      [bt, 2 * bt])
    trk = add_couples(trk, [62 - 24], [[-1], [69 - 12, 60, 65]], [bt, 2 * bt])
    trk = add_couples(trk, [62 - 24], [[-1], [69 - 12, 60, 64]], [bt, 2 * bt])
    trk = add_couples(trk, [62 - 24], [[-1], [62 - 12, 67 - 12, 71 - 12, 64]],
                      [bt, 2 * bt])
    trk = add_couples(trk, [62 - 24], [[-1], [60 - 12, 64 - 12, 69, 62]],
                      [bt, 2 * bt])
    trk = add_couples(trk, [62 - 24], [[-1], [60 - 12, 66 - 12, 69, 62]],
                      [bt, 2 * bt])

    if not second:
        trk = add_couples(trk, [64 - 24], [[-1], [71 - 12, 64, 67]],
                          [bt, 2 * bt])
        trk = add_couples(trk, [66 - 24], [[-1], [69 - 12, 61, 66]],
                          [bt, 2 * bt])
        trk = add_couples(trk, [71 - 36], [[-1], [71 - 12, 62, 66]],
                          [bt, 2 * bt])
        trk = add_couples(trk, [64 - 24], [[-1], [61, 64, 69]], [bt, 2 * bt])
        trk = add_couples(trk, [64 - 24], [[-1], [69 - 12, 61, 66, 69]],
                          [bt, 2 * bt])
        trk = add_couples(
            trk, [64 - 24],
            [[-1], [71 - 24, 69 - 12, 62], [64 - 12, 71 - 12, 62, 67]],
            [bt, bt, bt])
        trk = add_notes(trk, [[69 - 24, 67 - 12]], [3 * bt])
        trk = add_notes(trk, [[62 - 24, 69 - 12, 62 - 12]], [3 * bt])
    else:
        trk = add_couples(trk, [64 - 24], [[-1], [71 - 12, 64, 67]],
                          [bt, 2 * bt])
        trk = add_couples(trk, [64 - 24], [[-1], [69 - 12, 62, 65, 69]],
                          [bt, 2 * bt])
        trk = add_couples(trk, [64 - 24], [[-1], [69 - 12, 60, 65]],
                          [bt, 2 * bt])
        trk = add_couples(trk, [64 - 24], [[-1], [60, 64, 69]], [bt, 2 * bt])
        trk = add_couples(trk, [64 - 24], [[-1], [69 - 12, 60, 65, 69]],
                          [bt, 2 * bt])
        trk = add_couples(
            trk, [64 - 24],
            [[-1], [71 - 24, 69 - 12, 62], [64 - 12, 71 - 12, 62, 67]],
            [bt, bt, bt])
        trk = add_notes(trk, [[69 - 24, 67 - 12]], [3 * bt])
        trk = add_notes(trk, [[62 - 24, 69 - 12, 62 - 12]], [3 * bt])
    return trk