<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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);">
Hi, <br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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>
</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 style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
(define (strum e)
<div> (map-channel (lambda (y)</div>
<div>(if (> (mus-location e) (mus-length e)) ; mus-length = dur</div>
<div> (mus-reset e)) ; start env again (default is to stick at the last value)</div>
<div>(* y (env e)))))</div>
<div><br>
</div>
<div>(with-sound (:srate 48000 :channels 1 :play #t)</div>
<div> (let ((gen (make-polyshape 100.0 :partials (list 1 .5 2 .25 3 .125 4 .125)))</div>
<div>(strum (make-env '(0 0 .25 0.01 .5 0.2 1 0.0) :scaler 1.0 :duration 1 :base .53))</div>
<div> )</div>
<div> (do ((i 0 (+ i 1)))</div>
<div> ((= i 96000))</div>
<div> (outa i (* .5 (polyshape gen 0.95 (env strum))))</div>
))) <br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
--------------------</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
make-pulsed-env, and pulsed-env work fine, however.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
(with-sound (:srate 48000 :channels 1 :play #t)
<div> (let ((gen (make-polyshape 100.0 :partials (list 1 .5 2 .25 3 .125 4 .125)))</div>
<div> (jsenvel (make-pulsed-env '(0 0 .25 0.01 .5 0.2 1 0.0) 1.0 1.0))</div>
<div> )</div>
<div> (do ((i 0 (+ i 1)))</div>
<div> ((= i 96000))</div>
<div> (outa i (* .5 (polyshape gen 0.95 (pulsed-env jsenvel))))</div>
))) <br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
</body>
</html>