load "tap-detect.sal" load "instr.sal" function tapstoscore() begin with taps = extract-taps("./tapping.wav") set pitchList = {a3 a4 b4 b5 c3 c5 d5 d4 e3 e4 f4 f5} set *newScore* = nil loop for x in taps set time = nth(0,x) set pitch = nth(random(length(pitchList)), pitchList) set velocity = linear-to-vel(nth(1,x)) set event = list(time, 0.2, list(quote(simple-note), :pitch, pitch, :vel, velocity)) set *newScore* &= event end return *newScore* end variable *tapscore* = tapstoscore() function f4() play timed-seq(*tapscore*)