[CM] problem with list construction for rhythms

Nikolaj Tollenaar nikoltoll at gmail.com
Fri Jun 16 22:47:07 PDT 2017


Thank you for your response, but this is not the problem. I see I forgot to
include my play-pattern function that includes the process (sorry for that):

(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))
             )))

The problem arises when I want to use this pattern based composition.
make-cycle on the rhythm list made through concat doesn't work (all notes
played simultaneously), whereas the rhythm list made through collect *does*
work (music plays).

I am using Grace 3.9.0 on Windows.

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virusvrij.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

2017-06-16 22:09 GMT+02:00 Aykut Caglayan <aykut_caglayan at yahoo.com>:

> '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@
> 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
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/mailman/private/cmdist/attachments/20170617/82b140c3/attachment.html>


More information about the Cmdist mailing list