Text file format for coll object

alb's icon

When I try to 'read' a .txt file to load it into a coll I receive an error message:
coll: Run.txt: errors in text file in line 1

I think the issue may lie with the formatting in the text file since I get the same error message when I use the 'read' message in the Max Help examples.

RunTest.maxpat
Max Patch

0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18
0.18

Run.txt
text/plain 1.25 KB

Roman Thilenius's icon

0.18? what should coll do with that?

alb's icon

I'm trying to replicate the simple text file that the Max Examples uses.
Here is another file that I would like to use for pitch and/or velocity.

I simply want to be able to get the coll file to read the text. Then I will experiment with what I can apply it to. Ultimately I will turn it into MIDI and send it to the Kyma System.

Run_16aug2019.txt
text/plain 40.68 KB

Roman Thilenius's icon

coll only reads a certain format of text, it is more a little database than a text object.

there should be an example in its helpfile.

each line needs an index (symbol or number), after a comma you can store arbitrary data, and any line must end with a semicolon

if you want to store numbers like "20.32" in coll, it could to look like that:

1, 20.32;
2, 20.32;
3, 20.32;
4, 20.32;
metadata, use this with your kyma system and dont forget to add velocity values;

because coll is not able to check if the data in a file is correct you might want to read the text file in using the [text] object - and then convert the data in max until it is ready for storage in coll, detonate, seq, dict, umenu or whatever.

alb's icon

Thanks!

Your assurance that I needed to enter the data into a text object first and then into the coll helped. And the suggestion to try detonate etc is also a nice tip.

Since I was unable to get the text object to read my .txt file without spaces, I am using a workaround to populate the coll by asking the text to use only odd numbered entries. This looks inefficient, but works fine for my goal which is to populate the coll and then be able to access the data in the coll.

Any further suggestions for more elegant programming would be appreciated.

DataCollTest.maxpat
Max Patch

Source Audio's icon

Having data in coll or text object makes no difference.
Text object prepends set on output, so all You need is to
insert zl slice 1 and use right outlet.
Text gives You number of lines using query message (same as length message to coll)
and outputs any line using line $1 message.
So why would You want to first pump that text lines into coll ?
have a look at this little comparison :

Max Patch
Copy patch and select New From Clipboard in Max.


alb's icon

Thanks.
I can use the text object and the zl slice object.
The only issue is that when I want to recall a specifically indexed data in the text object, I have to use odd numbers since all the even indexed entries are empty.

Would you have any idea how people create their .txt files from excel without getting the gaps?
If not, no worries. You have been a great help!

Source Audio's icon

save as msdos formated text or Windows formated text
makes no gaps between lines


alb's icon

Thanks. Got it.