while playing: dur = 2 + random.randint(-10, 10)*.05 w.dur = dur*random.randint(2,4) w.pitch = oort.mtof(random.choice(scale)) w.play() oort.wait(dur) def control(): global playing global scale for _ in xrange(6): offset = random.randint(-2,2) scale = [x+offset for x in scale] oort.wait(20) playing = False w = oort.WAVETABLE() w.amp = 5000 w.wavetable = oort.maketable('wave', 1000, 1, 0.1) adsr = oort.ADSR(2, 0.5, 0.5, 2) shimmer = oort.Shimmer(amt=0.03, count=10) w.apply_behaviors(shimmer, adsr) scale = [ p+octave*12 for p in 0,2,4,6,7,9,10 for octave in 4,5,6 ] oort.sprout(control) for _ in range(2): oort.sprout(play)
def loop(): start = oort.START() start.amp = 1000 while playing: dur = randint(100, 200) * 0.001 start.dur=dur*3 start.pitch=oort.pchcps(oort.mtof(choice(chord))) start.play() oort.wait(dur) def change_chord(): global chord while playing: oort.wait(choice((4,6))) chord = [x+randint(-1,1) for x in chord] def end_piece(): oort.wait(30) global playing playing = False oort.REVERBIT(0, 0, 30, amp=1., rvbtime=10., rvbamt=1., chan0delay=.06, filtfreq=1200) oort.sprout(change_chord) oort.sprout(end_piece) for i in xrange(10): oort.sprout(loop)