[CM] :time (now) wait rate

Ben McAllister benmca at gmail.com
Sun Mar 6 17:02:08 PST 2016


Looks like you're missing some parens around your call to wait - this
does the trick for me:

(define (riff knum rhy)
  ;;generate an upward strum of notes
  (let ((rate (rhythm->seconds (/ rhy 4) 60)))
    (process repeat 5
             for k from (+ 39 (mod knum 13)) by 13
             do
             (mp:midi :key k :dur rate :amp .3 :chan 0)
             (wait rate))
))

On Thu, Mar 3, 2016 at 10:10 AM, Rob Howiler <rhowiler at presby.edu> wrote:
> Hi
> Thanks in advance for helping me with my questions.  I know I am becoming a bore with these newbie questions….
>
> Anytime I try to use :time (now) in a :mp:midi statement (or perhaps it’s the “rate” part), I get all sound at once when it should sound sequentially.  I’m defining a couple of helper apps (as per Notes from the Metalevel which I understand is outdated in some ways, language-wise.
>
> (define (bpm->seconds bpm)
>   (/ 60.0 bpm))
>
> (define (rhythm->seconds rhy tempo)
>   (* rhy 4.0 (bpm->seconds tempo)))
>
> (define (riff knum rhy)
>   ;;generate an upward strum of notes
>   (let ((rate (rhythm->seconds (/ rhy 4) 60)))
>     (process repeat 5
>              for k from (+ 39 (mod knum 13)) by 13
>              do
>              (mp:midi :key k :amp .3 :chan 0)
>              wait rate)))
> (sprout (riff 48 0.5))
>
> ….gives all sound as a chord.
>
> using (riff 48 0.5) just gives #<lambda ({time}-968)> in the listener window (the number increases sequentially each time I try to evaluate the (riff 48 0.5) expression).
>
> Also, if I use
> (define (riff knum rhy)
>   ;;generate an upward strum of notes
>   (let ((rate (rhythm->seconds (/ rhy 4) 60)))
>     (process repeat 5
>              for k from (+ 39 (mod knum 13)) by 13
>              do
>              (mp:midi :key k :time (now) :amp .3 :chan 0)
>              wait rate)))
> (riff 48 0.5) - or (sprout (riff 48 0.5))
> give me no sound with #<unspecified> in the listener window.  The :time (now) is the only thing that’s different.
>
> Thanks again for your help and patience.
> Rob
>
> ------------------------------------------------------
> Dr. Rob Howiler
> Academic Computing Services Coordinator
> Assistant Professor of Music
> rhowiler at presby.edu
> (864) 833-8324
> ------------------------------------------------------
>
>
> --
>
> ------------------------------
> <http://www.presby.edu>
>
> _______________________________________________
> Cmdist mailing list
> Cmdist at ccrma.stanford.edu
> https://cm-mail.stanford.edu/mailman/listinfo/cmdist



-- 
Ben McAllister | listenfaster.com |  @listenfaster | tuktuband.com |
c: 206.849.3183



More information about the Cmdist mailing list