Forums > MaxMSP

saving data as .text


Joe
August 7, 2013 | 11:11 am

Hey guys

Just wondering if someone could assist me with an issue I am having with saving data to a text file on closing the max patch.

I am trying to compile a list of data (numbers which will be gathered over a period of say 10 minutes), so the data needs to be compiled in a system of pairs. So when opened on the text file it might look something like this:

4 1
4 1
4 1

I thought I managed to sort this by using pack 0 0 (not sure if that works)

I have tested the patch, and save it as a .text file but when I open it, it is blank. So I am unsure if the problem is with the method of packing the data into pairs or with saving/opening the .text file.

Cheers

– Pasted Max Patch, click to expand. –


Joe
August 8, 2013 | 4:51 am

Okay, I have a slightly updated version which is now saving data correctly. The only problem now is it is not saving ALL the data. It only saves the first two numbers of the list. How can I make it to make a list in the same 4, 1 format? So in theory it could look like this;

4, 1. 4, 1. 4, 1. 4, 1.

cheers

– Pasted Max Patch, click to expand. –

August 8, 2013 | 3:15 pm

The [coll] object needs a unique index number so if you send it a list beginning with 4 each time it will overwrite the previous data stored at index 4. You can either set a unique index using something like [counter] to increment the index with each new piece of data you send or switch to using [text] as shown in this example:

<code>

– Pasted Max Patch, click to expand. –

</code>

The "cr" stands for carriage return and tells the [text] object to start the next input on a new line.



Joe
August 10, 2013 | 7:30 am

thanks mate, that system works fine. I have now adopted it to save a number to a time

see what you think

– Pasted Max Patch, click to expand. –


Joe
August 26, 2013 | 10:13 am

Is it possible to pre-determine the name of the file that is being saved?

so all the user has to do is press save and choose a location


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