Forums > MaxMSP

flexible buffer bank

February 9, 2007 | 11:11 am

Hi list,
I’m trying to build a patch that automatically creates just as many different buffers as I want (between 30 and 100). I need a dynamic and quick way to load and reload buffer’s banks and I wanted to optimize the patch in order to just have the ammount of buffers I need and freeing the not used memory. Is there a way to do it without scripting? The only way I suspected it would work was poly~, but so far as I know it is not possible to have a different buffer in every instance of the same poly object.
Any tips?
Thank you,

alberto bernal


February 9, 2007 | 12:44 pm

> The only way I suspected it would work was poly~, but so far as I
> know it is not possible to have a different buffer in every
> instance of the same poly object.

yes, it’s possible :
you can rename the buffer~ in every instance of the poly~ using
thispoly~ :

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 60 154 44 196617 receive;
#P newex 106 130 107 196617 sprintf set buffer_%i;
#P number 106 112 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 106 71 48 196617 loadbang;
#P newex 106 91 52 196617 thispoly~;
#P newex 106 178 78 196617 buffer~ default;
#P fasten 4 0 5 0 111 150 65 150;
#P connect 4 0 0 0;
#P fasten 5 0 0 0 65 174 111 174;
#P connect 3 0 4 0;
#P connect 1 0 3 0;
#P connect 2 0 1 0;
#P window clipboard copycount 6;

and then, send messages to each buffer~ with :
send buffer_1, send buffer_2,…

> Is there a way to do it without scripting?

but scripting is probably more flexible… why don’t you want to use
it ?

Mathieu Chamagne

http://www.maxobjects.com

http://mathieu.chamagne.free.fr


February 9, 2007 | 2:37 pm

>> The only way I suspected it would work was poly~, but so far as I
>> know it is not possible to have a different buffer in every
>> instance of the same poly object.

Won’t #0 naming work for you?

Easier than scripting, btw.

————– http://www.bek.no/~pcastine/Litter/ ————-
Peter Castine +–> Litter Power & Litter Bundle for Jitter
Universal Binaries on the way
iCE: Sequencing, Recording &
Interface Building for |home | chez nous|
Max/MSP Extremely cool |bei uns | i nostri|
http://www.dspaudio.com/ http://www.castine.de


February 11, 2007 | 11:54 am

thank you peter and mathieu for your answers. thispoly~is perfect for it and the patch is now working.


Viewing 4 posts - 1 through 4 (of 4 total)