<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<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,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;">I'm really stuck on trying to use map-channel to replace a newly created snd file with a dsp modified version of it. I've been looking at snd-test.scm for examples but still don't have it right yet and not sure
how to craft the let/map-channel/lambda to make it work. All I get is a flat line so far.</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> I'm trying to place values in a float-vector, then modify those values and output to the editor. I know</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> (float-vector->channel im 0 fsize 0) works,</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> and I also tried sample (but very slow):</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> (do ((i 0 (+ i 1)))</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> ((= i fsize))</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> (set! (sample i) (im i)))</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> Wondering if there's an example someplace I haven't found yet for how to dsp modify a vector of values and use map-channel to output to the editor?</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"><br>
</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> Thank You,</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> Jim</span></p>
<p class="p2" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255); min-height: 17px;">
<span class="s1" style="font-kerning: none;"></span><br>
</p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;">I’ve been trying something like below…</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;">but cannot seem to get the map-channel/let/lambda part right.</span></p>
<p class="p2" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255); min-height: 17px;">
<span class="s1" style="font-kerning: none;"></span><br>
</p>
<p class="p2" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255); min-height: 17px;">
<span class="s1" style="font-kerning: none;"></span><br>
</p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> (let* ((fsize 22050)</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> (increment (/ (* 440.0 2.0 pi) fsize))</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> (im (make-float-vector fsize)) ;empy vector</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> (current-phase 0.0)</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> (val 0.0) );init var</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> (new-sound "test.snd" :size fsize) ;creates a new snd in editor</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> ;place values in a vector</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> (do ((i 0 (+ i 1)))</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> ((= i fsize))</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> (set! val (* .1 (sin current-phase)))</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> (set! current-phase (+ current-phase increment))</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> (set! (im i) val)</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> ;(format #t "~%i: ~F ~0,6F\t " i (im i) )</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> )</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> (map-channel (lambda (y)</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> (do ((i 0 (+ i 1)))</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> ((= i fsize))</span></p>
<p class="p1" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 14.7px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(33, 33, 33); -webkit-text-stroke: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span class="s1" style="font-kerning: none;"> (* (amplitude-modulation 0.5) (im i))))0 fsize))</span></p>
<br>
</div>
</body>
</html>