Button Flower

dnz's icon

Hi there, i'm looking at the button flower patch in examples and was wondering how does the bang object move? what is controlling them?

basically i would like to use float nr. boxes instead of the bang object that move randomly or along a line (imagine an ADSR envelop).

any help or suggestion?

laonikoss's icon

Every object has the @patching_rect attribute, which has four parameters: x-axis location, y-axis location, x-axis size, and y-axis size.

If you change the first two, you can effectively change the location of any object in a max patch.

Max Patch
Copy patch and select New From Clipboard in Max.

Here's a short example you can play around with:

From then on it's all maths, devising a function/algorithm that changes those parameters in a preferred manner (e.g. like the button flower patch - which is very complicated due to the number of parameters).

dnz's icon

ah! prepend patching_rect! thanks a lot!

best