<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.&nbsp; I don't think I would have been able to figure out the part about deletion of lambda, map-channel in the strum definition.&nbsp; 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 &lt;cmdist-bounces@ccrma.Stanford.EDU&gt; on behalf of cmdist-request@ccrma.Stanford.EDU &lt;cmdist-request@ccrma.Stanford.EDU&gt;<br>
<b>Sent:</b> Tuesday, May 11, 2021 9:00 AM<br>
<b>To:</b> cmdist@ccrma.Stanford.EDU &lt;cmdist@ccrma.Stanford.EDU&gt;<br>
<b>Subject:</b> Cmdist Digest, Vol 156, Issue 4</font>
<div>&nbsp;</div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Send Cmdist mailing list submissions to<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cmdist@ccrma.stanford.edu<br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cmdist-request@ccrma.stanford.edu<br>
<br>
You can reach the person managing the list at<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cmdist-owner@ccrma.stanford.edu<br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of Cmdist digest...&quot;<br>
<br>
<br>
Today's Topics:<br>
<br>
&nbsp;&nbsp; 1. repeating envs (James Hearon)<br>
&nbsp;&nbsp; 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 &lt;j_hearon@hotmail.com&gt;<br>
To: &quot;cmdist@ccrma.Stanford.EDU&quot; &lt;cmdist@ccrma.Stanford.EDU&gt;<br>
Subject: [CM] repeating envs<br>
Message-ID:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;BYAPR10MB2536B22218DE8275BFF87290E5539@BYAPR10MB2536.namprd10.prod.outlook.com&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<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.&nbsp; 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>
&nbsp; (map-channel (lambda (y)<br>
(if (&gt; (mus-location e) (mus-length e)) ; mus-length = dur<br>
&nbsp;&nbsp;&nbsp; (mus-reset e))&nbsp;&nbsp;&nbsp;&nbsp; ; 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>
&nbsp; (let ((gen (make-polyshape 100.0 :partials (list 1 .5&nbsp; 2 .25&nbsp; 3 .125&nbsp; 4 .125)))<br>
(strum (make-env '(0 0&nbsp; .25&nbsp; 0.01&nbsp; .5&nbsp; 0.2 1&nbsp; 0.0) :scaler 1.0 :duration 1 :base .53))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br>
&nbsp;&nbsp;&nbsp; (do ((i 0 (+ i 1)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((= i 96000))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (outa i (* .5 (polyshape gen 0.95 (env strum))))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )))<br>
<br>
--------------------<br>
make-pulsed-env, and pulsed-env work fine, however.<br>
<br>
(with-sound (:srate 48000 :channels 1 :play #t)<br>
&nbsp; (let ((gen (make-polyshape 100.0 :partials (list 1 .5&nbsp; 2 .25&nbsp; 3 .125&nbsp; 4 .125)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (jsenvel (make-pulsed-env '(0 0&nbsp; .25&nbsp; 0.01&nbsp; .5&nbsp; 0.2 1&nbsp; 0.0)&nbsp; 1.0&nbsp; 1.0))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br>
&nbsp;&nbsp;&nbsp; (do ((i 0 (+ i 1)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((= i 96000))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (outa i (* .5 (polyshape gen 0.95 (pulsed-env jsenvel))))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )))<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<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>&gt;<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 &lt;j_hearon@hotmail.com&gt;<br>
Cc: &quot;cmdist@ccrma.Stanford.EDU&quot; &lt;cmdist@ccrma.Stanford.EDU&gt;<br>
Subject: Re: [CM] repeating envs<br>
Message-ID: &lt;f9ab6a125ecba5078937c93d1435e564@ccrma.stanford.edu&gt;<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>
&nbsp;&nbsp; (if (&gt; (mus-location e) (mus-length e))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (mus-reset e))<br>
&nbsp;&nbsp; (env e))<br>
<br>
(with-sound (:srate 48000 :channels 1 :play #t)<br>
&nbsp;&nbsp; (let ((gen (make-polyshape 100.0 :partials (list 1 .5&nbsp; 2 .25&nbsp; 3 .125&nbsp; <br>
4 .125)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (strum-env (make-env '(0 0&nbsp; .25&nbsp; 0.01&nbsp; .5&nbsp; 0.2 1&nbsp; 0.0) :scaler 1.0 <br>
:duration 1 :base .53))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br>
&nbsp;&nbsp;&nbsp;&nbsp; (do ((i 0 (+ i 1)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((= i 96000))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (outa i (* .5 (polyshape gen 0.95 (strum strum-env))))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )))<br>
<br>
In your code, you had two things named &quot;strum&quot;, 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>