;; brownian-motion.sal -- Brownian motion pitch sequence ;; (c) 2008 by Roger B. Dannenberg define function brownian-motion(start, number-of-notes) loop with roll-die = make-random({-3 -2 -1 0 1 2 3}), the-list repeat number-of-notes for note = start then note + next(roll-die) set the-list @= note finally return reverse(the-list) end print brownian-motion(60, 16)