< Back to IRCAM Forum

iteration - creating many variations of a sound

Hello Modalys users! I’ve been working on trying to create subtle variations of a single instrument and write the results to a multichannel aiff file. I can’t quite figure out how to handle references.

For example, i figured out how to write the same output to many channels:

;; wm johnson  
;; the goal here is to bounce many files with subtle variation between them  

(new)  

(setf my-string (make-object 'mono-string))  
(setf force-access(make-access my-string (const 0.3) 'trans0))  
(setf out-access (make-access my-string (const 0.05) 'trans0))  

; the loop  
(loop  
 for i from 1 to 10  
 do   
   
 (make-point-output out-access (- i 1))  

)  
(make-connection 'force force-access (const 1))  

(run 5)  

; file output  
(save-aiff "/Users/wmjohnson/Documents/Modalys/blog/iteration/results/output.aiff")

Now, I realize that in order to make these output channels different they would have to be connected to unique accesses, presumably on different strings if I want the materials to be different for each sound output. I’ve played with lists a bit, but what I want to figure out is essentially

  
; the loop  
(loop  
 for i from 1 to 10  
 do   
   
 ;make unique string  
 ;make access to that unique string  
 (make-point-output out-access (- i 1))  
 ;apply force to that unique string   

)  

Thanks for your help!
~wm. johnson

So I found one possible solution (thanks to John Burnett):

; (mapcar f l) - where f is a function (here i created a basic block of an instrument in a function) and l is a list (of arguments)  

(new)  
(setf count 0)  
(defun make-inst (l ten)  
  "create a basic mono-string setup with length"  
  (setf my-string (make-object 'mono-string (length l) (tension ten)))  
  (setf string-access (make-access my-string (const 0.5) 'trans0))  
  (make-connection 'force string-access (const 1) 'trans0)  
  (make-point-output string-access count)  
  (setf count (+ count 1))  
)  

(mapcar 'make-inst '(0.56 1 8) '(200 1000 600) )  

(run 5)  
(play)  
(save-aiff "/Users/wmjohnson/Documents/Modalys/results/mapcar/out.aiff")  

Hope this helps! Would love to see if anyone has any different ideas!