Forums > MaxMSP

rotate a number …. or combine a list of variable length into one number

February 5, 2013 | 11:27 am

Hello everyone,

is there a way to rotate a number like this 345 -> 453 -> 534
and if not is there a way to combine a list of variable length into one number:

4 5 6 -> 456 and next 5 7 8 9 -> 5789, the problem are the annoying numbers which are stuck in the inlets when i use unjoin and then combine or sprintf %i%i.

Thank you

Robert


February 5, 2013 | 11:36 am

Hi,

You can rotate a list with [zl rot], and [combine] will merge data without spaces. What do you mean by ‘stuck’?

Yeter


February 5, 2013 | 11:51 am

yes thats what i planned but to use combine the list must be split into pieces, if i now use unjoin or unpack for this and first send in lets say 3 4 5 6
and next 2 3 4, the secound time the 6 is still "stuck" into the unjoin outlet and it will send out 2 3 4 6.

The same with combine.

If i send in the list straight into the combine module it will only output the first number…

edit, i just realized that i can use "combine 0 0 0 0 0 0 0 0" and then send the list in the first inlet, but still, it will output not just the number but also the zeros or the numbers of a longer list that has been send in before.


February 5, 2013 | 12:06 pm

sweet!!! thanks a lot nicolas, this is what i was looking for!!


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