reading text files

Mar 1, 2006 at 2:25pm

reading text files

Greetings;

i’m a student and this semester for an academic project, i must use
max msp in order to read 2 separate text files with letters… i’ve
made a patch that reads lines sequencially, yet the list is a sequence
of genomes (C,G,T,A letters) and the format is in a few letters per
line. i could make it work, yet i would spend weeks formatting the text
in order to have a letter per line.
my question is if there is a method to read letter by letter from an
external text file, and read a letter every 3 seconds.. this i know it
can be controled with a metro, yet i don’t work well with lists or
external files.

i hope someone can help me out sorting this problem out.

Many thanks,

Bruno Gustavo Costa

Check Out the new free AIM(R) Mail — 2 GB of storage and
industry-leading spam and email virus protection.

#24660
Mar 1, 2006 at 2:53pm

Hey, havent tried this myself, but you will probably find something that would good for the job in the L-objects (you should be able to find these on maxobjects.com.
Hope they help
T

#71756
Mar 1, 2006 at 3:05pm

Try this. It needs Peter Elsea’s Lobjects, and probably needs some
cleaning up, but you’ll get the idea.

M

max v2;
#N vpatcher 434 117 1129 609;
#P window setfont “Sans Serif” 9.;
#P message 288 164 50 196617 read;
#P comment 188 58 33 196617 start;
#P message 233 57 50 196617 0;
#P newex 266 375 32 196617 itoa;
#P window linecount 2;
#P comment 317 388 132 196617 dumps next line when queue is empty;
#P window linecount 1;
#N counter;
#X flags 0 0;
#P newobj 356 64 50 196617 counter;
#P window linecount 0;
#P newex 406 313 50 196617;
#P window linecount 1;
#P comment 128 337 132 196617 slow ‘em down;
#P comment 130 311 132 196617 spit ‘em out;
#P window linecount 2;
#P newex 267 330 50 196617 Lqueue 3000;
#P window linecount 1;
#P newex 268 307 50 196617 iter;
#P message 340 345 503 196617 72 111 119 108;
#P window linecount 2;
#P newex 338 308 51 196617 prepend set;
#P window linecount 1;
#P newex 268 283 51 196617 atoi;
#P newex 268 261 51 196617 route set;
#P number 358 224 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 332 264 199 196617 Howl;
#P number 268 109 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 268 128 45 196617 line $1;
#P newex 268 199 100 196617 text text_lyrics.txt;
#B color 5;
#P message 304 222 28 196617 set;
#P user hslider 268 85 20 25 5 1 1 0;
#P newex 266 399 32 196617 print;
#P comment 132 285 132 196617 make characters into a list;
#P connect 14 0 20 0;
#P connect 20 0 1 0;
#P connect 13 0 14 0;
#P connect 21 0 2 0;
#P connect 18 0 2 0;
#P connect 2 0 6 0;
#P connect 6 0 5 0;
#P connect 23 0 4 0;
#P connect 5 0 4 0;
#P connect 4 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 13 0;
#P connect 3 0 7 0;
#P connect 4 0 7 0;
#P connect 10 0 11 0;
#P connect 11 0 12 0;
#P fasten 14 1 18 0 312 380 497 380 497 34 361 34;
#P connect 4 2 8 0;
#P pop;

#71757
Mar 4, 2006 at 11:41pm

This patch you made works perfectly, yet the first line is repeated
twice… i’ve tried to add a minimum cont value of 1 to the counter
object, changed the start to 1 yet, it keeps repeating the first line.
is there a way to bypass this repetition?

#71758
Mar 5, 2006 at 2:53pm

The patch works.
Obrigado professor.

#71759

You must be logged in to reply to this topic.