[CM] problem with list construction for rhythms

Aykut Caglayan aykut_caglayan at yahoo.com
Fri Jun 16 13:09:43 PDT 2017


'sprout' is sprouting a 'process'.
My suggestion:

(define (make-rhy-list length)
  ;; first create your rhythm list and assign it to a variable
  (let ((rhy-list (loop with rhy = (list) repeat length
              do
              (set! rhy (concat rhy (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))))
              finally (return rhy))))
    ;;use the rhythm list within a process
    (process for i in rhy-list
             do
             ;;you might want to send it through midi
             (send "mp:midi" :dur i)
             (wait i))))

(sprout (make-rhy-list 2))

> Message: 2
> Date: Fri, 16 Jun 2017 11:58:15 +0200
> From: Nikolaj Tollenaar <nikoltoll at gmail.com>
> To: cmdist at ccrma.Stanford.EDU
> Subject: [CM] problem with list construction for rhythms
> Message-ID:
> 	<CAM4zxbXpu=e5brMrN8f1-mj2NpAbAHT8YShFhMUSYDssP+L2BQ at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
> 
> Dear all,
> 
> I'm trying to construct a rhythm value list through this function:
> 
> (define (make-rhy-list length)
>   ;; chooses random groupings of values
>        (loop with rhy = (list) repeat length
>               do
>               (set! rhy (concat rhy (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))))
>               finally (return rhy)))
> 
> But, when I use these in a sprout, all notes are played simultaneously.
> 
> (define rhy-lst1 (make-rhy-list 20))
> (sprout (play-pattern (make-cycle '(70 72 80 88)) (make-cycle rhy-lst1) 160
> 115 0.9))
> 
> Why is this and what can I do about it?
> 
> If I use the single element construction, sprout works as expected.
> 
> Like so:
> 
> (define (make-rhy-list length)
>   ;; chooses random single values
>   (loop for key from 1 to length
>         collect (pick '(1/4 1/4 1/4 1/8 1/8 1/16 1/2 1/2))))
> 
> Greetings,
> 
> Nikolaj
> 
> 



More information about the Cmdist mailing list