Programmatically set number of channels in buffer~
Is there any way to set the number of channels in a buffer~ object from another object - either a max method or another (safe) method is fine. I am resizing the buffer~ at the same time.
Thanks
Alex
Unlike what the reference says... (which is already fixed), the size message can be also use to change the number of channels (1, 2 or 4):
Hi EJ. Thanks. I should have said I'm interested in resizing the buffer in samples. This sort of seems to work, but seems like the display doesn't catch up properly..
RIght. I can confirm the issue. the sizeinsamps doesn't refresh the buffer window. size works fine though in the meantime. It has been fixed for the next incremental.
nice coincidence: I am also busy with a c external today which changes the content and number of channels of buffers (in a seperate thread)
it works fine, changes and loads the channels correctly, though the waveform~ which appears when you doubleclick the buffer~ is not correctly updated:
-if it was 1 channel and now is 2 channels it will only display the left channel
-if it was 2 channels and now is 1 channel it will display the left channel twice
I do see that it responds on my 'dirty' message that I send to the maxobject and I properly set the b_oldnchans, is there something else I should do to ensure a proper waveform~ update?
EJ, did you also correct the reference for sizeinsamps?
BTW, when I try to create a size message thru the contextual menu of buffer~ leftmost inlet, I get a sendbox size $1 $2 message!
p
Thanks for the report, Patrick. I've fixed the size/sendbox thing for a future version of Max.
Cheers,
Tim
so?... how do you properly change and update the channels?