Function
(shufflelist {keyword value}*)
Returns a random ordering of list according to the keyword arguments specified to the function.
shuffle supports the following keyword arguments:
:copy boolean:start integer:end integer:state random-state*random-state*.;; The shuffle function. (shuffle '(a b c d e)) ⇒ (b a e d c) (shuffle '(a b c d e)) ⇒ (c e b a d) (shuffle '(a b c d e) :start 2) ⇒ (a b e d c) (shuffle '(a b c d e) :start 2) ⇒ (a b d e c) ;; Shuffling notes. (define (play-shuffle reps notes rate ) (let ((len (length notes))) (process for i below reps for j = (mod i len) when (= j 0) ; need to reshuffle? do (shuffle notes :copy #f) output (new midi :time (now) :keynum (list-ref notes j) :duration (* rate 1.5) :amplitude (interp j 0 .4 (- len 1) .8)) wait rate))) (events (play-shuffle 60 (note '(c d ef f g a bf c5)) .1) "test.mid") ⇒ "test.mid"