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

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



However, there may not be a standard file format for soundfiles... so perhaps this tricky.

Anyone know?

Josh

******************************************
Joshua Parmenter
joshp@xxxxxxxxxxxxxxxx
Post-Doctoral Research Associate - Center for Digital Arts and Experimental Media
Raitt Hall - University of Washington
Seattle, Washington 98195

http://www.dxarts.washington.edu
http://www.realizedsound.net/josh/


On Jun 5, 2006, at 9:10 PM, Joshua Parmenter wrote:

I wonder how hard it would be to add an argument to b_allocRead for number of channels and which one to read? nil, nil - read all (what it does now), otherwise - check header for number of channels and read the appropriate values... has anyone else ever constructed OSC messages? Or perhaps a new message? b_allocReadChannel?

I'll take a look at the source, maybe this is possible?

Josh

******************************************
Joshua Parmenter
joshp@xxxxxxxxxxxxxxxx
Post-Doctoral Research Associate - Center for Digital Arts and Experimental Media
Raitt Hall - University of Washington
Seattle, Washington 98195

http://www.dxarts.washington.edu
http://www.realizedsound.net/josh/


On Jun 5, 2006, at 8:26 PM, blackrain wrote:

Totally right James, I missed the last part of the message.
All the synthdefs in the examples I sent fan BufRd's out. however you
can add an argument, like you mention, to grab one channel or even mix
them down.

cheers,

x

On 6/5/06, James Harkins <jamshark70@xxxxxxxxx> wrote:


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

: jamshark70@xxxxxxxxxxxxxxxxx

: http://www.dewdrop-world.net

.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:




"Come said the Muse,

Sing me a song no poet has yet chanted,

Sing me the universal."  -- Whitman

_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users



_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users

_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users