Forums > MaxMSP

How to: bang a message to repeat itself a specified number of times

Apr 21 2012 | 8:50 pm

I would like to be able to type a sequence of numbers into a [textedit], then upon banging the object, send a specified number of copies of the [textedit] text to a message box. For example, I have a 32 bar multislider, and want to be able to type four numbers into a box – which will then repeat itself across the 32 steps upon bang. Attached is an example of the [multislider] in the state I would like it to be in upon typing the four number phrase into a box.

-- Pasted Max Patch, click to expand. --

Apr 21 2012 | 10:20 pm

Do you need to specify the number of repeats at run time, or just hard code them?

If the latter then a combination of [t l l l …] and an appropriately sized [pack ] will see you right.

If the former, then some combination of [uzi], [zl reg] and [zl group]?

Apr 21 2012 | 10:39 pm

I am not really familiar with that language, however, I can explain through an example

I require [1 2 3 4 1 2 3 4] to be outputted in a single message for an input of [1 2 3 4] and a specified repetition of two – rather than the message [1 2 3 4] being sent in two separate instances.

Would this be requiring a repetition of run time or hard code?

Apr 21 2012 | 10:51 pm

I understand now. I am after a specified number of repeats at run time. I will use the packing system.

Apr 22 2012 | 10:11 pm

[zl group] is your best bet, I think. be sure to specify a large list length if it will be using long lists, the default is 256 I think. so,

[zl 2048 group]

will let you store up to 2048 list members in your repeating sequence. [uzi] will do the repetition for you…very quickly.

Apr 23 2012 | 2:06 pm

[zl len] -> length of the list

(specified number of repeats) * (length of the list) = argument for [zl group]

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

Forums > MaxMSP