Example #1
0
def ev_funcs(env, drums=False):
    debug_log("ev_funcs")
    if is_module(env):
        env = env.__dict__
    funcs = get_funcs(env).items()
    random.shuffle(funcs)
    for func_name, func in funcs:
        debug_log("  top of loop")
        debug_log("func", func)
        if coinflip():
            times = 1
        else:
            times = options(1, 2, 4)
        for x in range(times):
            if drums:
                events = midi.zipe(ev_func(func),
                                   midi.ev_drums(dur=DURATION),
                                   dont_finish={1})
            else:
                events = ev_func(func)
            for e in events:
                yield e
        debug_log("  maybe delay!")
        for e in ev_maybe_delay():
            debug_log("  yes delay!")
            yield e
Example #2
0
def ev_goof_around(env, drums=False, overall_drums=False):
    while True:
        if overall_drums:
            events = midi.zipe(
                ev_funcs(env, drums=drums),
                midi.ev_drums(dur=DURATION),
            )
        else:
            events = ev_funcs(env, drums=drums)
        for e in events:
            yield e
Example #3
0
def ev_funcs(env, drums=False):
    if is_module(env):
        env = env.__dict__
    funcs = get_funcs(env).items()
    random.shuffle(funcs)
    for func_name,func in funcs:
        debug_log("func",func)
        if coinflip():
            times = 1
        else:
            times = options(1,2,4)
        for x in range(times):
            if drums:
                events = midi.zipe(
                    ev_func(func),
                    midi.ev_drums(dur=DURATION),
                    dont_finish={1}
                )
            else:
                events = ev_func(func)
            for e in events:
                yield e
        for e in ev_maybe_delay():
            yield e