Forums > MaxMSP

Splicing a symbol into separate characters

May 13, 2011 | 9:16 am

I’m working on a patch for the generation of serial protection codes. I have a nice algorithm that spits out 16 one character digits (1 3 4 2 5 etc) in a list. With [tosymbol] I change it into a single line of code without the spaces.

The next step would be to turn this line of code back into a list, but how do I extract seperate symbols out of a bigger symbol? To be more exact, how can I get the nth character out of a symbol?


May 13, 2011 | 9:32 am

Never mind, worked it out! Combination of [atoi] and subtracting 48 through [zl iter 1]!


May 13, 2011 | 9:33 am
– Pasted Max Patch, click to expand. –

The zl object is great for list related stuff.


May 13, 2011 | 9:38 am

staxas, [zl] is your friend..

– Pasted Max Patch, click to expand. –

rob

edit: too late again :)


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