symbol length limit in Max 5

Adam Murray's icon

We know the 256 list limit length is gone in Max 5. That's great!

I've been having a related problem lately: I am outputting long symbols (reading in text files and passing them from MXJ objects) and they are getting truncated. Does this symbol length limit also disappear in Max 5?

Adam Murray's icon

Maybe I didn't explain well.

If I make a large string in a custom object (js, mxj, c) and try to send it out an outlet, Max cuts it off.

js is the simplest way to demonstrate (sorry if this belongs in the javascript forum):

big_send.js:

function bang() {
    s = "";
    for(i=0; i
        s += (i + ":abcdefghijklmnopqrstuvwxyzn")
    }
post("sent " + s.length + " characters")
    outlet(0, s)
}

big_receive.js

function anything() {
    post("received " + messagename.length + " charactersn")
}

Then connect them together and bang big_send:

sent 2990 characters
received 1999 characters

Will this work in Max 5?

Adam Murray's icon

In case anyone else cares about this it looks like the symbol length limit increased from 2000 to 32,767 characters in Max 5. Cool.

I can come up with a chunking strategy if I need more than that.

Joshua Kit Clayton's icon

On Apr 22, 2008, at 10:33 PM, Adam Murray wrote:
>
> In case anyone else cares about this it looks like the symbol length
> limit increased from 2000 to 32,767 characters in Max 5. Cool.

Keep in mind that symbols persist for the duration of the program, so
heavy dynamic string work is best kept in JS/Java/C or working with
parsed lists of small symbols. Perhaps more interesting is that the
256 element list limit has been upped. zl requires an extra max list
size arg to use larger lists however.

-Joshua

Adam Murray's icon

Quote: jkc wrote on Tue, 22 April 2008 22:57
----------------------------------------------------
> Keep in mind that symbols persist for the duration of the program, so
> heavy dynamic string work is best kept in JS/Java/C or working with
> parsed lists of small symbols.

Thanks for pointing that out. I was probably heading down a path where I would eat up all my resources and/or crash max.

I think I just figured out a way to pass text block names around the way jitter objects pass matrix names (i.e. pass a pointer to the data, not the data itself). That seems like a much better solution to this problem of passing large amounts of text. Wish I thought of it sooner.

Ok, back to Max 5 tutorials. Weeee :)

bnmohr's icon

What are the max 5 list and symbol maximums or are they now limitless as seems to be implied earlier in the thread? I'm in the middle of an art installation that will be completely text based (and projected via jitter with the openGL text render). I'm especially interested in any suggestions on how to work with large chunks of text, can you expand on "moving the cursor rather than the text"? I'm currently just working with textedit and text object, and a lot of regexp. FYI I'm still in 4.6 and about to jump to 5 directly because of this message length issue.

BM

Andrew Benson's icon

If you are doing a lot of work with text that requires regexp and stuff like that, you'll be well served to start using JavaScript. The support for doing string manipulation is a lot more user friendly and you don't come up against as many limitations as far as symbol-generation and list length go.

Andrew B.

bnmohr's icon

I don't know much about javascript, and I don't think this is the project to spend the time on learning. I'm not doing much manipulation, literally creating an edit box and then projecting the text. My problem right now is having a large text come out of textedit, then giving it line breaks. If I want to see each character appear, it means I have to dump the entire text output, reformat for line breaks, then send to jitter. I can't think of a more efficient way though. The regexp is both for this, and to do stemming for subject analysis. I guess at this point, the bulk of the work is done, so I feel like just sticking it out as is. Can I get a user interface like a text edit box in javascript?

Yeah, totally separately, for people searching the forums, if anyone wants a porter 2 stemmer in max, I did it, semi for fun....

BM

Emmanuel Jourdan's icon

On 5 sept. 08, at 23:02, Brian Mohr wrote:

> I don't know much about javascript, and I don't think this is the
> project to spend the time on learning. I'm not doing much
> manipulation, literally creating an edit box and then projecting the
> text. My problem right now is having a large text come out of
> textedit, then giving it line breaks. If I want to see each
> character appear, it means I have to dump the entire text output,
> reformat for line breaks, then send to jitter. I can't think of a
> more efficient way though. The regexp is both for this, and to do
> stemming for subject analysis. I guess at this point, the bulk of
> the work is done, so I feel like just sticking it out as is. Can I
> get a user interface like a text edit box in javascript?

Through the File Object, you can open textfile and read strings
directly from JavaScript. If you need string manipulation it's
probably the best way, as Andrew said.

ej

bnmohr's icon

Hi All,

I made a bad assumption reading this thread, that moving to max 5 would solve my problem. Turns out not to be the case, maybe the textedit buffer remains relatively small (2000 char?) even if max can handle list lengths that are longer? Indeed I can send huge messages from message box to message box, but my textedit output is truncated. Is there anyway to increase the buffer?

Here is the simple version of what I need: User text input (a la textedit), that can be typed, paste from clipboard, and generally edited, with mouse click cursor placement. This text (may be very large) is then stored to a text object, and also sent to iter and subsequently analyzed. What is typed, edited pasted will be projected via jitter in realtime, so I need an updated output on each change, which currently is just the ascii output of textedit banging the left inlet.

Any suggestions on how to proceed? At this point I may not have a choice but to enter javascript land, but I'm concerned about the input interface and my experience in programming vs deadline approaching, any suggestions on where I should start looking?

Again, everything is already done, if I can get untruncated, which is my desire to stay away from js. But if there's no way around it, then there's no way around it!

Cheers!
BM

Salvator's icon

Hi,

I have the same question about textedit and lengh limit in Max 5.
Anyone ?

Salvator