"atoi" object's limitation?

Isshin's icon

Does anyone notice that "atoi" object has limitation with the numbers of characters it can convert into ASCII code?

Dear Experienced Max Users

Hi,
I'm an entry level Max 5 user and have been facing a problem I can't solve for the last few weeks.
I would like to ask you for some help or the answer for whether Im hitting the wall the software just doesn't let me solve.
(By the way I'm not a native English speaker, so apologies in advance for my poor/confusing expressions. Also this is the first time attempt positing a question in forum, so I may make mistakes with How,,,,,Thank you!!)

My project is to convert a long string of texts into integers so that I can use them as another source of event I wanna cause.
As I was experimenting the patch with several different strings of texts (some of them are 2000 letters with spaces, some are like 9000), I recognized the resulted converted ASCII codes output from the "atoi-object" were cut-off in the middle when I tried with over 5000 characters.
(It seems up to 4000 characters are working fine, but after 4096th (or somewhere around) character, the "atoi" just does not output anything but drops the rest.)

You can also see the symptom that the string is left out (or unconverted n' not-output) in the middle when converting back the partially-yet-successfully-output-ASCII-codes into texts with "itoa" object.

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

Here's what my patch looks like:

I am using a message object to past and send the source strings of texts to atoi object, getting and showing the resulted ASCII codes in another message object. The "listfunnel" and "counter" are used in order to know the #s of ASCII codes (and the #s of characters used in the texts) the string contains, and in order to store them with the "coll" object so that I can use the indexed data latter on.

Again, as long as the texts were made of less than 4000 characters (including space) it seems fine, but the problem is at the case I try convert ones constructed with over 4100 characters,,,,, like 10000.

(BTW, just for the crediting purpose, the text is one entry from the Anne Franc's diary)

Thank you for reading!!

Best

LiamCormacGould's icon

why not break the text into smaller parts and process each part individually. index parts (i.e. text 'A' consists of indexes 1, 2 and 3) and then reassemble them afterwards? a lot of objects in MAX have a limit on the number of items they can process or store in a list.

Isshin's icon

Hi, LiamCormacGould

Thank you for your response!

Right, that'll be the last method I would take, but honestly, I was looking for the way to do it without breaking them once,,,, since it'll affect the main idea of the entire project....
At least I learned that's one of the nature numbers of MAX objects have.

Thank you again, LiamCormacGould

Best

Isshin

LiamCormacGould's icon

there might be a way to not break them up. I'm just not sure what it is :) maybe java type things could do that but I'm no java man.

Floating Point's icon
Max Patch
Copy patch and select New From Clipboard in Max.

this works better but needs tweaking:

Isshin's icon

Hi, again, LiamCormacGould

Thank you for another response!
Well, i'm no Java man neither but thanks for your advise anyways!
WIll try some other way!

Hi, Terry McDermott

Thank you for your patch!
I gotta learn zl object deeper to understand and modify it to make it work for my project.
SInce I'm a slow learner, it may take time a bit, so I first would like to say thank you here, n' will see what I can do with your suggestion.

Thank you both!!

Best

Isshin

Floating Point's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Hey, I just realised you can use [spell]:

no arbitrary limits there

Floating Point's icon
Max Patch
Copy patch and select New From Clipboard in Max.

and instead of using coll you can use funbuff (seems to go past the 4096 limit):

Isshin's icon

Hi again TerryMcDermott

Sorry for my belated reply.
and Thank you so much for your latest patch,

You just solved my problem!
Technically, to fully understand how you did that, I need to learn all those objects are working especially with all the arguments you added.

But let me just say thank you first here, you really saved my project.
I really appreciate it.

Best Regards, Terry.

Isshin