brianhouse / braid

Polyrhythms in Python: a sequencer and musical notation system for monophonic MIDI synths
http://braid.live
GNU General Public License v3.0
47 stars 6 forks source link

Global triggers not working #12

Open brianhouse opened 5 years ago

brianhouse commented 5 years ago

t.trigger form works well, but naked trigger does not perform as expected

measures = [    [[K, K, K, K], 2],
                [[H, H, H, H], 1],
                [[S, S, S, S], 3]
                ]

t = Thread(10)
t.add('measure')

def advance():
    next_measure = t.measure % len(measures)
    t.pattern, cycles = measures[next_measure]
    trigger(advance, cycles)
    t.measure += 1

trigger(advance, 0)

play()