[CM] :time (now) wait rate

Rob Howiler rhowiler at presby.edu
Thu Mar 3 10:10:22 PST 2016


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>



More information about the Cmdist mailing list