Forums > MaxMSP

convert text to ascii then separated message

April 27, 2014 | 12:58 pm

I would like to convert text to ascii then separated with the character position message:

example:

hello

104 101 108 108 111 (for this I know, "atoi")

1 104, 2 101, 3 108, 4 108, 5 111

thank you


April 27, 2014 | 1:10 pm

[listfunnel 1]

– Pasted Max Patch, click to expand. –

April 27, 2014 | 1:31 pm

thank you ! very quick answers

I do not understand how to retrieve the various messages in print

this pacth, only O (last group message) is sent to unpack, how to send the entire word a letter after the other?

– Pasted Max Patch, click to expand. –
  • This reply was modified 4 months by  kimlicrea.
  • This reply was modified 4 months by  kimlicrea.

April 27, 2014 | 4:05 pm

No.. all of the letters in hello are converted to ascii, indexed from 1 and then output in a stream of pairs.

[unpack] receives all of the ascii values one after the other.

What may be confusing is that while [print] shows all of the pairs that were sent, a message box or number box will only display the last pair (in this case 111 – letter O). That’s because the initial letter values are overwritten by subsequent letter values.

Hope that makes sense.


April 27, 2014 | 4:17 pm

my pacth is for converting a text color square

if [unpack] receives all of the ascii values one after the other, how to unpack that retransmit the entire data pacth?

thank you very much , for you help


April 27, 2014 | 6:52 pm

Hmmm I don’t quite understand what you are asking. Values sent one after the other already are ‘unpacked’. [listfunnel] indexes the values of a list and outputs each position/character one pair at a time.

You can use [routepass 1 2 3 4 5] which will output each ascii pair from a separate outlet. Then you can process each letter independently.

I messed around with your patch. You might find some changes useful. Consider using a single coll to manage letter color data. It’s easier than dozens of [select] objects.

– Pasted Max Patch, click to expand. –

April 28, 2014 | 1:32 am

really thank you for your help , and you work

coll is more appropriate than select, thank you

what I would like is: all letters become square and form a pattern.
In the pacth that you corrected me, there is only one square at a time and the second clears the first.

thanks again


April 28, 2014 | 5:17 pm

I used [t l clear] to clear the LCD before passing each list of ascii numbers (each word) and another to clear the LCD after each letter is drawn. Delete the second one to draw complete words.

You also need to experiment with pack and pak so that your lists are passed at the right times. I messed with it some more but I don’t know what patterns you want to make. Hope it helps.

– Pasted Max Patch, click to expand. –

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