[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Read single channel of external file into buffer



thanks all for your answers
my synth is now built around two BufRd UGens, one for mono files and the other for stereo

Best,

-- 
Axel
Jazzmutant

Le 6 juin 06 à 04:53, James Harkins a écrit :

On Jun 5, 2006, at 9:43 PM, blackrain wrote:

Hi Axel,
These are two approaches; The first one uses  several predefined
synthdefs - as many as the number of channels you want to deal with.
The second approach generates the synthdef accordingly to the number
of channels needed.
I have added a couple of ideas of how to load soundfiles into a
buffers array as well.

From BufRd help:

warning: if you supply a bufnum of a buffer that has a different
numChannels then [sic] you have specified to the BufRd, it will
fail silently.

I thought Axel was asking how to play only one channel out of a multichannel sound file. So if you have a stereo file and do BufRd.ar(1, ...), you'll get no sound.

At present there is no easy way to load a pre selected channel of a sound file. However you can use PlayBuf or BufRd to play back all the channels, and choose only the channel you need for the output.

stereoSig = BufRd.ar(2, ...);
Out.ar(outbus, stereoSig[0])  // play only the left channel

hjh

: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman

_______________________________________________
sc-users mailing list