buffer info mono or stereo

kingyorts@yahoo.com's icon

hello,
how can i get an info from a buffer about the number of channels of the latest uploaded audio file.
im using a stereo play~ object. when im loading a mono file to the buffer only the first channel of play~ is playing , and i want to automatically send the output also to the second channel.
info~ doesn't give number of channels information
any suggestion?
tnx,
/. g

Emmanuel Jourdan's icon

On 6 juin 07, at 19:15, giori Politi wrote:

> how can i get an info from a buffer about the number of channels of
> the latest uploaded audio file.
> im using a stereo play~ object. when im loading a mono file to the
> buffer only the first channel of play~ is playing , and i want to
> automatically send the output also to the second channel.
> info~ doesn't give number of channels information

you can use sfinfo~, or even better send the getChannels message to
"mxj buf.Op".

ej

Mike S's icon

Is there a way to copy 1 channel of a buffer to the other channel of the same buffer with buf.Op?

I'm currently working with stereo buffers and playback, so I would like to duplicate the mono channel, prefereably without any uzi'ing. I had a little go with 'copyFrom buffer 1' and 'copyInto buffer 2' but I don't think you can reference channels like that?

Mike S's icon

bamp

Samuel Freeman's icon
Max Patch
Copy patch and select New From Clipboard in Max.

how about something like this ?

Mike S's icon

I'm using that method at the moment, but its in a poly so thats 16 selectorz~ that I don't really need. I guess it'll do for now.

Tj Shredder's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Are two *~ cheap enough? If play~ could do it on its own it would cost the same I guess:

Tj Shredder's icon
Max Patch
Copy patch and select New From Clipboard in Max.

A single multiplication would do it as well of course:

Mike S's icon

Thanks Stefan, I ended up using the single multiplication solution

Mike S's icon

Hello old thread,

Looks like I have the same problem.

Can I copy a mono buffer in to a separate stereo buffer with mxj buf.Op?

Is it a case of something I've missed in the helpfile, or will some extra Java be needed?

Mike S's icon

Anyone?

I have two buffers, the playback buffer should always be stereo, and the source buffer can be mono or stereo.

I have the condition: if source buffer is mono, copy source buffer to both playback buffer channels.

I don't understand how to do this with mxj buf.OP. When I use the "copyFrom" and the source buffer is mono, it appears to be copied to both channels (see attached). Peek~ appears to show that the mono sample has been copied to both channels (also attached). However when I come to play the audio, it is only coming from one channel.

Peek~ and Poke~ are too slow, and beachball when used with uzi, so they are out of the proverbial window. I also can't afford more signal objects at the processing stage.

Screen-Shot-2013-05-23-at-11.19.47.png
png
Screen-Shot-2013-05-23-at-11.10.17.png
png
tada's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Hello Mike! At first i want you to know you are not alone...
If you use max 5 the code below should do the job...
But with max 6 the buffer~ is unfortunately VERY buggy..
So the same code doesn t work in max 6 and sometimes even crashes max.
At least you can copy a mono buffer to stereo and convert the mono file to stereo.
I have contact with cycling 74 and they told me that they know about it
and they work to find a solution (but is not easy for some reasons).

Mike S's icon

That looks great!

I'm working on Max 5 so this won't be a problem.

Thanks a lot :D

do.while's icon

as for the Max 6 users ,its a cute discovery that the [polybuffer] once set to 2 channels will open mono files automatically in both channels . this is very very helpful !