Forums > MaxMSP

split numbers

September 22, 2009 | 10:15 pm

How do you solve this?

let’s say you have the number 567
and you wnat to slice i up to 5 6 7 so you can send i to a
select object to test it.

Many thanks

/Fredrik


September 22, 2009 | 10:40 pm

regexp allows you to do that.

– Pasted Max Patch, click to expand. –

September 23, 2009 | 9:58 am

many thanks

/Fredrik


September 23, 2009 | 10:29 am

You can also use [% 10], [% 100], and other modulo and division operators to separate out individual digits. In some circumstances this can be easier than regexp.


September 23, 2009 | 10:35 pm

Yet another way would be to use atoi and then subtract 48 from all elements in the list using vexpr.


September 24, 2009 | 9:20 am

Thanks all. You are very kind!



Joe
August 21, 2013 | 8:37 am

Hi

I am trying something similar, but producing bangs to messages after selecting a number. However, it is only selecting the first digit and not the remaining two numbers.

Is it even possible to do this with a delay 500 between each bang?

– Pasted Max Patch, click to expand. –

August 21, 2013 | 1:00 pm

@Joe: [zl queue]

-

– Pasted Max Patch, click to expand. –

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