def worker(gens, tick): while time.time() < started + (60 * 15): dsp.delay(dsp.stf(dsp.rand(2, 20))) if dsp.rand(0, 100) > 50: if dsp.rand(0, 100) > 80: voice_id, generator_name = settings.add_voice("pp re qu") dsp.log("") dsp.log("starting pulsar voice %s" % voice_id) elif dsp.rand(0, 100) > 50: voice_id, generator_name = settings.add_voice("ch re qu") dsp.log("") dsp.log("starting chirp voice %s" % voice_id) else: voice_id, generator_name = settings.add_voice("bo re qu") dsp.log("") dsp.log("starting boone voice %s" % voice_id) playback_process = mp.Process(name=voice_id, target=rt.out, args=(gens[generator_name], tick)) playback_process.start() dsp.delay(dsp.stf(dsp.rand(6, 35))) dsp.log("") dsp.log("stopping voice %s" % voice_id) settings.voice(voice_id, "loop", 0)
def automate(ctl): sh = ctl.get('midi').get('sh') i = ctl.get('iterations') sh.noteon(64) dsp.delay(dsp.mstf(dsp.rand(200, 500))) sh.noteoff(64) dsp.log(i)
def grid(tick, bpm): os.nice(0) bpm = dsp.mstf(dsp.bpm2ms(bpm)) count = 0 while True: tick.set() tick.clear() dsp.delay(bpm) count += 1
def worker(gens, tick): while time.time() < started + (60 * 9): dsp.delay(dsp.stf(dsp.rand(2, 20))) if dsp.rand(0, 100) > 60: if dsp.rand(0, 100) > 60: voice_id, generator_name = settings.add_voice('sh re qu') dsp.log('') dsp.log('starting shimmer voice %s' % voice_id) else: voice_id, generator_name = settings.add_voice('dr re qu') dsp.log('') dsp.log('starting drone voice %s' % voice_id) playback_process = mp.Process(name=voice_id, target=rt.out, args=(gens[generator_name], tick)) playback_process.start() dsp.delay(dsp.stf(dsp.rand(6, 35))) dsp.log('') dsp.log('stopping voice %s' % voice_id) settings.voice(voice_id, 'loop', 0)