[CM] Cmdist Digest, Vol 156, Issue 4

James Hearon j_hearon at hotmail.com
Wed May 12 10:17:31 PDT 2021


re: repeating envs
Thank you for the corrections.  I don't think I would have been able to figure out the part about deletion of lambda, map-channel in the strum definition.  Working now.
Regards,
Jim
________________________________
From: cmdist-bounces at ccrma.Stanford.EDU <cmdist-bounces at ccrma.Stanford.EDU> on behalf of cmdist-request at ccrma.Stanford.EDU <cmdist-request at ccrma.Stanford.EDU>
Sent: Tuesday, May 11, 2021 9:00 AM
To: cmdist at ccrma.Stanford.EDU <cmdist at ccrma.Stanford.EDU>
Subject: Cmdist Digest, Vol 156, Issue 4

Send Cmdist mailing list submissions to
        cmdist at ccrma.stanford.edu

To subscribe or unsubscribe via the World Wide Web, visit
        https://cm-mail.stanford.edu/mailman/listinfo/cmdist
or, via email, send a message with subject or body 'help' to
        cmdist-request at ccrma.stanford.edu

You can reach the person managing the list at
        cmdist-owner at ccrma.stanford.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cmdist digest..."


Today's Topics:

   1. repeating envs (James Hearon)
   2. Re: repeating envs (bil at ccrma.Stanford.EDU)


----------------------------------------------------------------------

Message: 1
Date: Tue, 11 May 2021 17:46:52 +0000
From: James Hearon <j_hearon at hotmail.com>
To: "cmdist at ccrma.Stanford.EDU" <cmdist at ccrma.Stanford.EDU>
Subject: [CM] repeating envs
Message-ID:
        <BYAPR10MB2536B22218DE8275BFF87290E5539 at BYAPR10MB2536.namprd10.prod.outlook.com>

Content-Type: text/plain; charset="iso-8859-1"

Hi,
The lambda function, from the manual, for repeating an env seems like a useful thing, but I cannot seem to find the magic to make it repeat.  I'm wondering how you would use it for the polyshape gen fm parameter? Or is that not how it's supposed to work?
Regards,
Jim

(define (strum e)
  (map-channel (lambda (y)
(if (> (mus-location e) (mus-length e)) ; mus-length = dur
    (mus-reset e))     ; start env again (default is to stick at the last value)
(* y (env e)))))

(with-sound (:srate 48000 :channels 1 :play #t)
  (let ((gen (make-polyshape 100.0 :partials (list 1 .5  2 .25  3 .125  4 .125)))
(strum (make-env '(0 0  .25  0.01  .5  0.2 1  0.0) :scaler 1.0 :duration 1 :base .53))
        )
    (do ((i 0 (+ i 1)))
        ((= i 96000))
      (outa i (* .5 (polyshape gen 0.95 (env strum))))
      )))

--------------------
make-pulsed-env, and pulsed-env work fine, however.

(with-sound (:srate 48000 :channels 1 :play #t)
  (let ((gen (make-polyshape 100.0 :partials (list 1 .5  2 .25  3 .125  4 .125)))
        (jsenvel (make-pulsed-env '(0 0  .25  0.01  .5  0.2 1  0.0)  1.0  1.0))
        )
    (do ((i 0 (+ i 1)))
        ((= i 96000))
      (outa i (* .5 (polyshape gen 0.95 (pulsed-env jsenvel))))
      )))

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20210511/452cef39/attachment-0001.html>

------------------------------

Message: 2
Date: Tue, 11 May 2021 11:32:40 -0700
From: bil at ccrma.Stanford.EDU
To: James Hearon <j_hearon at hotmail.com>
Cc: "cmdist at ccrma.Stanford.EDU" <cmdist at ccrma.Stanford.EDU>
Subject: Re: [CM] repeating envs
Message-ID: <f9ab6a125ecba5078937c93d1435e564 at ccrma.stanford.edu>
Content-Type: text/plain; charset=US-ASCII; format=flowed

I think you're close -- this slightly edited version
seems to work:

(define (strum e)
   (if (> (mus-location e) (mus-length e))
       (mus-reset e))
   (env e))

(with-sound (:srate 48000 :channels 1 :play #t)
   (let ((gen (make-polyshape 100.0 :partials (list 1 .5  2 .25  3 .125
4 .125)))
        (strum-env (make-env '(0 0  .25  0.01  .5  0.2 1  0.0) :scaler 1.0
:duration 1 :base .53))
         )
     (do ((i 0 (+ i 1)))
         ((= i 96000))
       (outa i (* .5 (polyshape gen 0.95 (strum strum-env))))
       )))

In your code, you had two things named "strum", and
the map-channel wasn't needed.



------------------------------

_______________________________________________
Cmdist mailing list
Cmdist at ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


End of Cmdist Digest, Vol 156, Issue 4
**************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20210512/47a86aaf/attachment.html>


More information about the Cmdist mailing list