def play(): oort.wait(random.choice(range(10))*0.1) 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
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 end_piece(): oort.wait(30) global playing playing = False
def change_chord(): global chord while playing: oort.wait(choice((4,6))) chord = [x+randint(-1,1) for x in chord]