Mono/Stereo Wave~/Buffer~

pm's icon

Hi there,
Since a buffer~ can load Mono or stereo file and adapt itself, using a Replace message, does anybody has ever thought of a way to make a wave~ object adapt itself to the number of channels of his dedicated buffer~? When you read a mono file in a stereo wave~, there's signal going out only from the left channel.

Info~ doesn't give the number of channel, and I never heard of an object that gives this information about a replaced buffer~.

The only way I achieved to "stereo-ize" a mono file playing through a wave~ object was with a =~ 0 that would detect when there is no signal going through the right channel. But to me, that seems a bit complex for nothing...

Anybody has an idea to solve this?

pdelges's icon

On 06-nov.-08, at 20:56, Pm B wrote:
>

> Info~ doesn't give the number of channel, and I never heard of an
> object that gives this information about a replaced buffer~.

Check [mxj buf.Op]'s help file, especially its "getChannels" message.

You can then use a [wave~ ... 4] to be able to read all type of buffers
(buffers don't have more than 4 channels) and add some routing to the
outputs, based on the now known number of channels, to suit your needs.

p