[how to] va-advanced buffer techniques

Tiago Morgado's icon

hello everyone.. hope you are all having a great night programming in MaxMSP: given a list like the following, in which I have pointers to a buffer stored with the help of a snapshot~ object and a zl stream 2, to a buffer~/record~, how do I create like messages to record the files from the buffer pointers into a wav or aiff name by giving it a name like sampname_$1_$2, in which the $1 and $2 symbols would be iterated points in a one bi-dimensional vector, considering $1 as a number that already exists in a analysis system that comes from 0 to 127, and $2 as an iterated point in a list of 10 values for an instance. also, how do I iterate and save the list 2nd list (127 values ranging from 1 to 10) with the patch? and also how to rewrite files after the first iteration cycle (imagine it as [127][10])?
if possible, I would prefer not to do this with mxj~. also, how to instantly load the mentioned files into a polybuffer~, immediately after recording them. thanks in advance tiago

0, 0 0.;
1, 0. 0.;
2, 0. 10332.880859;
3, 10332.880859 15325.169922;
4, 15325.169922 20317.460938;
5, 20317.460938 24729.251953;
6, 24729.251953 36107.03125;

seejayjames's icon

[sprintf] will deal with inserting numbers into a symbol, so that there are no spaces. if you use a message box with $1 $2 it adds spaces to make a list. so:

sprintf sampname_%u_%u

where %u = "unsigned int", there are many others, like %s for symbol. check sprintf helpfile. if you want floats (probably not in the name), use the appropriate % symbol. sprintf is also indispensable for formatting filepaths with spaces etc...

...IMO there should be a "tips and tricks" area of the Forum with most frequently asked things, and filepaths/sprintf mangling of symbols should be on there. Very necessary and not that intuitive at first, and many questions about it crop up.

Tiago Morgado's icon

I know this thing of sprintf, and I actually do very complex stuff with lists, thanks, you didn't get the quesiton

Tiago Morgado's icon
Max Patch
Copy patch and select New From Clipboard in Max.
Tiago Morgado's icon
Max Patch
Copy patch and select New From Clipboard in Max.

in relation to the list thing, it's here, solved, so now I just need to know how to record the selected portion of the buffer into the audiofile thru the described method and to immediately load the file into a polybuffer~ also I need to get a way of overwriting the files after an iteration cycle (1-10).. thanks

Tiago Morgado's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I kept elaborating my solution to the list solution and right now i've got this.. it's just that I am stuck in some point of the data flow and I am not being able to debug this.. so it's not iterating, and I am not being able of making a prepend store of a list to the coll index.. help is appreciated, aswell relation to he issue previously described of "in relation to the list thing, it's here, solved, so now I just need to know how to record the selected portion of the buffer into the audiofile thru the described method and to immediately load the file into a polybuffer~ also I need to get a way of overwriting the files after an iteration cycle (1-10).. thanks"