## simple generative patch

Oct 16, 2012 at 11:25pm

# simple generative patch

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. –
#64802
Oct 17, 2012 at 9:12am

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

#233691
Oct 17, 2012 at 7:23pm

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.

#233692
Oct 18, 2012 at 2:35pm

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

#233693
Oct 18, 2012 at 3:01pm

“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.

#233694
Oct 18, 2012 at 3:09pm

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!

#233695
Oct 18, 2012 at 8:51pm

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

– Pasted Max Patch, click to expand. –
#233696

You must be logged in to reply to this topic.