[CM] problem with list construction for rhythms
Taube, Heinrich K
taube at illinois.edu
Sat Jun 17 06:22:07 PDT 2017
Hi Nikolaj, ive run your example and it works for me, so offhand I’m not sure what the issue might be. Im on a mac and you are on windows, but i can’t see what difference that would make. Since you think it has something to do with concat, as a test Ive rewritten your make-rhy-list function to avoid ‘concat’ . Try this version and tell me if it works. On my mac both your version and my version of 'make-rhy-list ‘ work fine so lets see what happens on your machine.
best, Rick
(define (play-pattern pat rhy times tmpo ampl)
;; plays pattern times times, with tempo tmpo and amplitude ampl:
(let* ((dur (in-tempo 1/4 tmpo)))
(process repeat times
for x = (next pat)
for y = (next rhy)
do
(if (number? x)
(mp:midi :key x :dur dur :amp (* ampl (pick .9 .95 1 .85))))
(wait (in-tempo y tmpo))
)))
;; NEW VERSION of make-rhy-list avoids concat
(define (make-rhy-list length)
;; chooses random groupings of values
(loop repeat length
append (pick '((1/4 1/4)
(1/3 1/3 1/3)
(1/8 1/8 1/8 1/8)
(1/16 1/16 1/8 1/16 1/8 1/16 1/8)
(1/2 1/2)))))
(define rhy-lst1 (make-rhy-list 20))
(sprout (play-pattern (make-cycle '(70 72 80 88)) (make-cycle rhy-lst1) 160 115 0.9))
More information about the Cmdist
mailing list