<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span id="" title="" class="">re: repeating envs</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span id="" title="" class="">Thank you</span> 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.<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Regards,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Jim<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> cmdist-bounces@ccrma.Stanford.EDU <cmdist-bounces@ccrma.Stanford.EDU> on behalf of cmdist-request@ccrma.Stanford.EDU <cmdist-request@ccrma.Stanford.EDU><br>
<b>Sent:</b> Tuesday, May 11, 2021 9:00 AM<br>
<b>To:</b> cmdist@ccrma.Stanford.EDU <cmdist@ccrma.Stanford.EDU><br>
<b>Subject:</b> Cmdist Digest, Vol 156, Issue 4</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Send Cmdist mailing list submissions to<br>
cmdist@ccrma.stanford.edu<br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="https://cm-mail.stanford.edu/mailman/listinfo/cmdist">https://cm-mail.stanford.edu/mailman/listinfo/cmdist</a><br>
or, via email, send a message with subject or body 'help' to<br>
cmdist-request@ccrma.stanford.edu<br>
<br>
You can reach the person managing the list at<br>
cmdist-owner@ccrma.stanford.edu<br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of Cmdist digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. repeating envs (James Hearon)<br>
2. Re: repeating envs (bil@ccrma.Stanford.EDU)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Tue, 11 May 2021 17:46:52 +0000<br>
From: James Hearon <j_hearon@hotmail.com><br>
To: "cmdist@ccrma.Stanford.EDU" <cmdist@ccrma.Stanford.EDU><br>
Subject: [CM] repeating envs<br>
Message-ID:<br>
<BYAPR10MB2536B22218DE8275BFF87290E5539@BYAPR10MB2536.namprd10.prod.outlook.com><br>
<br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hi,<br>
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?<br>
Regards,<br>
Jim<br>
<br>
(define (strum e)<br>
(map-channel (lambda (y)<br>
(if (> (mus-location e) (mus-length e)) ; mus-length = dur<br>
(mus-reset e)) ; start env again (default is to stick at the last value)<br>
(* y (env e)))))<br>
<br>
(with-sound (:srate 48000 :channels 1 :play #t)<br>
(let ((gen (make-polyshape 100.0 :partials (list 1 .5 2 .25 3 .125 4 .125)))<br>
(strum (make-env '(0 0 .25 0.01 .5 0.2 1 0.0) :scaler 1.0 :duration 1 :base .53))<br>
)<br>
(do ((i 0 (+ i 1)))<br>
((= i 96000))<br>
(outa i (* .5 (polyshape gen 0.95 (env strum))))<br>
)))<br>
<br>
--------------------<br>
make-pulsed-env, and pulsed-env work fine, however.<br>
<br>
(with-sound (:srate 48000 :channels 1 :play #t)<br>
(let ((gen (make-polyshape 100.0 :partials (list 1 .5 2 .25 3 .125 4 .125)))<br>
(jsenvel (make-pulsed-env '(0 0 .25 0.01 .5 0.2 1 0.0) 1.0 1.0))<br>
)<br>
(do ((i 0 (+ i 1)))<br>
((= i 96000))<br>
(outa i (* .5 (polyshape gen 0.95 (pulsed-env jsenvel))))<br>
)))<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20210511/452cef39/attachment-0001.html">https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20210511/452cef39/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Tue, 11 May 2021 11:32:40 -0700<br>
From: bil@ccrma.Stanford.EDU<br>
To: James Hearon <j_hearon@hotmail.com><br>
Cc: "cmdist@ccrma.Stanford.EDU" <cmdist@ccrma.Stanford.EDU><br>
Subject: Re: [CM] repeating envs<br>
Message-ID: <f9ab6a125ecba5078937c93d1435e564@ccrma.stanford.edu><br>
Content-Type: text/plain; charset=US-ASCII; format=flowed<br>
<br>
I think you're close -- this slightly edited version<br>
seems to work:<br>
<br>
(define (strum e)<br>
(if (> (mus-location e) (mus-length e))<br>
(mus-reset e))<br>
(env e))<br>
<br>
(with-sound (:srate 48000 :channels 1 :play #t)<br>
(let ((gen (make-polyshape 100.0 :partials (list 1 .5 2 .25 3 .125 <br>
4 .125)))<br>
(strum-env (make-env '(0 0 .25 0.01 .5 0.2 1 0.0) :scaler 1.0 <br>
:duration 1 :base .53))<br>
)<br>
(do ((i 0 (+ i 1)))<br>
((= i 96000))<br>
(outa i (* .5 (polyshape gen 0.95 (strum strum-env))))<br>
)))<br>
<br>
In your code, you had two things named "strum", and<br>
the map-channel wasn't needed.<br>
<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
Cmdist mailing list<br>
Cmdist@ccrma.stanford.edu<br>
<a href="https://cm-mail.stanford.edu/mailman/listinfo/cmdist">https://cm-mail.stanford.edu/mailman/listinfo/cmdist</a><br>
<br>
<br>
End of Cmdist Digest, Vol 156, Issue 4<br>
**************************************<br>
</div>
</span></font></div>
</body>
</html>