Forums > MaxMSP

simple generative patch

October 16, 2012 | 11:25 pm

Hello all, I am trying to create a generative patch and I’m have some problems. My goal is to initialize 5 voices with a random number between 1 and 100, assign each voice what I call influence (i). Then the number of each voice will transform, according to the amount of influence it has, and the amount of influence each other voice has on it. So basically the value of the transformed voice should be (i) percent of the sum of the difference between it, and each other value. I feel I may not be conceptualizing this idea properly, and may have messed up in the math of the patch, as well as the order of operations in Max. If anyone has any suggestions on how to make it work I would be greatly appreciative.

– Pasted Max Patch, click to expand. –

October 17, 2012 | 9:12 am

Hi,

I’m not sure what’s happening here, but here are some ideas to make things clearer.

(i) Try replacing [trigger],[float], [- .] arrangement in [transV1] etc. with [!- 0.]
(ii) Consider passing v1 to v5 as a list which you can [unpack] at the transformation stage. You might get more control.
(iii) Maybe use some cables between patchers instead of [send]s – may make flow of control more apparent.
(iv) What are all the [del]s and [pipe]s for?

Hope this helps

Richard


October 17, 2012 | 7:23 pm

It’s an interesting idea. I found the patch quite confusing and I don’t really grasp the maths you are trying to do here. Care to talk us through it?

Lets assume there are only 3 voices:

V1 = 10 with an influence of 15;
V2 = 20 with an influence of 0;
V3 = 100 with an influence of 50;

If you show your working then I’m sure you’ll get help.


October 18, 2012 | 2:35 pm

Hey thanks for the replies, you could call influence gravity I suppose as well. So for the transformation of V1 in leafcutter’s example for instance, we would do: 20(v1) – 15(v2) = 5, and 0% of 5 = 0, so v2 would have no effect on v1, then 100 – 15 = 85, and 50% of 85 is 42.5. So we add v1s transformations with according the it being influenced by each other v, and so the transformed v1 would be 42.5. V2 then would become, 15 – 0 = 15, and 10% of 15 = 1.5 then add 100 – 0 = 100, and 50% of 100 is 50, so v2 would become 51.5. V3 then would become 86.5 is my math is correct.

The dels and pipes are to make sure the max signal flow is right.

I’ve realized some problems just by explaining the above, I added each voice’s own influence into their own transformations, I will make changes in a bit, in class right now.

Thanks


October 18, 2012 | 3:01 pm

"The dels and pipes are to make sure the max signal flow is right." …uh…please look into "trigger" object, as regards program flow in MAX. It’s how you enforce order in Max.


October 18, 2012 | 3:09 pm

Ah yes you are right, I used a bunch of triggers in the transformation subpatches, but I guess I only need one trigger with multiple f arguements, doh!


October 18, 2012 | 8:51 pm

ok its all good, here’s the working patch if interested. Thanks for the help!

– Pasted Max Patch, click to expand. –

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