<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Michael,</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
re: code ex.</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof ContentPasted2" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
There was no overarching algorithm or AI. (I wish there were...things could be easier). Just using Bill's great variety of insts and gens to create sounds derived from the manual, and then mixing them. Also using Michael Scholz's inf-snd.el and emacs as
editor. Here's an example.</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Best Regards,</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Jim<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
;instrument to create sounds</div>
<div class="elementToProof ContentPasted1" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
(define (pulsed-envtest beg dur amp)
<div class="ContentPasted1"> (let ((start (seconds->samples beg))</div>
<div class="ContentPasted1"> (stop (seconds->samples (+ beg dur)))</div>
<div class="ContentPasted1"> (rnd1 (abs(mus-random 5)))</div>
<div class="ContentPasted1"> (e (make-pulsed-env '(0 1 1 1 2 0) .01 1)) </div>
<div class="ContentPasted1"> (frq (make-env '(0 1 1 0) :duration dur :scaler (hz->radians 70)))
</div>
<div class="ContentPasted1"> (ampf (make-env '(0 0 .1 1 20 1 20.1 0) :duration dur :scaler amp))</div>
<div class="ContentPasted1"> (gen1 (make-polywave 300 '(1 0.8 2 .07 3 .13)))</div>
<div class="ContentPasted1"> (rnd2 (make-rand-interp 150 (hz->radians 20))) </div>
<div class="ContentPasted1"> )</div>
<div class="ContentPasted1"> (do ((i start (+ i 1)))</div>
<div class="ContentPasted1"> ((= i stop))</div>
<div class="ContentPasted1"> (outa i (* (env ampf)</div>
<div class="ContentPasted1"> (pulsed-env e (*(env frq)rnd1 ) )</div>
<div class="ContentPasted1"> (polywave gen1 (rand-interp rnd2))))))) </div>
<div><br class="ContentPasted1">
</div>
(with-sound (:play #t) (pulsed-envtest 0 6 .95))<br>
</div>
<div class="elementToProof ContentPasted0" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof ContentPasted0" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
; then mixes...</div>
<div class="elementToProof ContentPasted0" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
;;/////////////////////////////
<div>;;/////////////////////////////</div>
<div>;;STEREO vers.</div>
<div>;show files from a folder. load a file from the list.</div>
<div>;add a number of mixes at random times.</div>
<div>;render, getting ready to save file.</div>
<div>;;/////////////////////////////</div>
<div>;;/////////////////////////////</div>
<div>;the list of files</div>
<div>(sound-files-in-directory "/opt/snd-23/test/")</div>
<div><br>
</div>
<div>;prints the list</div>
<div>(let* ((mylist (sound-files-in-directory "/opt/snd-23/test/")))mylist)</div>
<div><br>
</div>
<div>;get the length of the list</div>
<div>(let* (( mylist (sound-files-in-directory "/opt/snd-23/test/")) ;declare a list</div>
<div>)</div>
<div>(length mylist)</div>
<div>)</div>
<div>;-----------</div>
<div>;sets all mixes to blue</div>
<div>(set! (mix-color) (make-color 0 0 1)) </div>
<div>;-----------</div>
<div>;; OPEN A STEREO SOUND for inspection, if needed.</div>
<div>(begin</div>
<div>(open-sound "/opt/snd-23/test/mywave.wav")</div>
<div>)</div>
<div><br>
</div>
<div>(play)</div>
<div><br>
</div>
<div>(close-sound #t)</div>
<div>;--------------------------</div>
<div>;displays the path, first filename, and opens the first file in the list</div>
<div>;then ADDS MIXES</div>
<div>(let* (( mypath "/opt/snd-23/test/")</div>
<div> ( mylist (sound-files-in-directory "/opt/snd-23/test/")) ;declare a list</div>
<div> ( myframples 0)</div>
<div> ( ranframples 0)</div>
<div> ( startnum 1) ;*starting mix number*</div>
<div> ( nummixes 5) ;*number of mixes (nummixes - startnum)</div>
<div> )</div>
<div>(format #t " ~A\n" mypath)</div>
<div>(format #t " ~A\n" (list-ref mylist 0))</div>
<div>(string-append mypath (list-ref mylist 0))</div>
<div>(open-sound (string-append mypath (list-ref mylist 9 ))) ;first opened snd</div>
<div>(set! myframples (framples *snd-opened-sound*))</div>
<div>(format #t "~A\n" myframples )</div>
<div> (do ((i startnum (+ i 1))) </div>
<div> ((>= i (+ startnum nummixes))) </div>
<div>(set! ranframples (random myframples))</div>
<div>(normalized-mix (string-append mypath(list-ref mylist i)) ranframples #t 0 0) ;note #t for stereo</div>
<div>))</div>
</body>
</html>