poly~ args use

10ff's icon

Hey guys,

for a granular synthesis patch I wrote a simple "grainer patch" responsible for creating a grain from a sound file loaded into a buffer object. I am using the patch within another patch via the poly~ object with a bunch of voices/instances. Since I want the grainer patch responsible for the whole grain-creation I would like to use it with different buffers i.e. sound files, which are defined outside the grainer patch. How do I tell one instance of the grain patch to use another buffer (at the moment this is hard coded). I had a look at the rgrano patch from the max examples - but I don't fully understand the concept behind "args #0" etc.

Thanks!

Rob Ramirez's icon

not entirely sure what you're trying to achieve, but maybe i can offer some advice.

the args #0 means that a poly~ object is inside an abstraction. the poly~ object takes an argument, which is probably used to create send/receive pairs and give the poly~ a buffer name to reference. #0 tells max to create a unique identifier string. inside a single instance of an abstraction, wherever #0 is found, it will be replaced with the unique string. inside another instance of that same abstraction, a different unique string is created and replaced. the poly~ is using that string as an arg to all it's voices.

anywho, if i'm using a poly~ to load different samples, i will generally name them something like "polybuf_1.aif", "polybuf_2.aif" etc. that way you can simply use [thispoly~] - [sprintf polybuf_%i.aif] - [prepend replace] to automatically load your buffers.

10ff's icon

Okay, I see I got it wrong with the sharp.
I'll try it with the sprintf object, that's what I was looking for.

Thanks, robtherich!