load "tap-detect.sal" load "instr.sal" set data = extract-taps("tapping.wav", plot-flag: #t) function my-build-sexpr(my-velocity, my-pitch) begin set pitcharr = list(65, 65, 67, 68, 65, 60, 65, 65, 67, 68) set my-pitch = my-pitch % 10 set my-pitch = nth(my-pitch, pitcharr) return list(quote(my-note), keyword(pitch), my-pitch, keyword(vel), my-velocity) end function my-sevent(start-time, velocity, my-pitch) begin return list(start-time, 0.6, my-build-sexpr(velocity, my-pitch)) end function my-build-score(data, my-pitch) begin if length(data) = 0 then return list() else return cons(my-sevent(nth(0, nth(0, data)), nth(1, nth(0,data)), my-pitch), my-build-score(remove(nth(0, data), data), my-pitch + 1)) end set *tapscore* = my-build-score(data, 0) function F4() play timed-seq(*tapscore*)