[CM] src in strereo

Bret Battey bbattey@u.washington.edu
Mon, 17 May 2004 14:19:35 -0700


Alin,

When I first started using CLM, I was frustrated at not having stereo 
generators or many stereo instruments available. I put in a lot of time 
designing stereo instruments. But after spending more time with CLM, my 
thinking changed. I've changed most of my soundfile processing 
instruments back to being mono, but always with a parameter that can be 
passed to indicate which channel of the soundfile I wish to process. 
This simplifies instrument design greatly, and leaves me a lot more 
flexibility as I then use external processing (dlocsig via its 
move-sound wrapper, usually) to position the file.

That means I have two instrument calls if I do want to process a stereo 
sound -- one for the left channel and one for the right -- so it could 
be seen as less efficient in that sense. But it keeps me from having to 
continually go inside and redesign stereo instruments to provide a 
specific stereo effect I didn't visualize when I first designed the 
instrument.

So the key is to designate what channel you want to read from in your 
open-input call:

(definstrument resamp (beg dur file &key channel)
     (let* (...
       	   (f-a (open-input file :channel channel))
		...
            (rdA (make-src :input f-a))
etc.

If you really want a stereo instrument, define two open-inputs:

(f-a (open-input file :channel 0))
(f-b (open-input file :channel 1))

and two src's:

(rdA (make-src :input f-a))
(rdB (make-src :input f-b))


Bret Battey                                     http://BatHatMedia.com
----------------------------------------------------------------------
Research Associate
Center for Digital Arts and Experimental Media
University of Washington, Seattle    http://www.washington.edu/dxarts/



On May 17, 2004, at 9:10 AM, alin weiller wrote:

> Hi, is there any to use src with a stereo file?
>
> Thanks
>
> A-LIN
>
> Plus simple, plus fiable, plus rapide : découvrez le nouveau Caramail 
> - http://www.caramail.lycos.fr
>
>