Welcome to %s forums

BrainModular Users Forum

Login Register

max value of all array

I need help on a Patch
Post Reply
joffo78
Member
Posts: 1033
Contact:

Unread post by joffo78 » 09 Mar 2011, 00:15

hello.
I have another question about manipulate values of arrays.
i know the module max value of an array witch extract the larger value of an array.
But i'd like to extract the larger value of the first value of an array the the second etc...
for example i have 4 arrays and the first value of the first array is 50 the first of the second is 45 the first of the third is 67 the first of the fourth is 25
i want to keep on a new array the value of the third (67)
the same for the second value etc


thank you.

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 09 Mar 2011, 02:07

maybe something like this?
Image

joffo78
Member
Posts: 1033
Contact:

Unread post by joffo78 » 09 Mar 2011, 09:03

Great !
This is work independently with all the values ?
yes it seems to work but i don't explain me why !

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 09 Mar 2011, 23:45

yup work for all the values. math and logical modules work with array for each individual elmts wich is great.

it's quite simple in fact. if A > B compares each independant values of A an B, and for each values, if A >B then output array element value is 1, otherwise it's 0. so if we multiply A by this output, only the values >B pass, as they are multiplied by 1. all other are 0 as they are multiplied by 0. the 'not' do the reverse thing for B, so summing result an array of the max between A and B.Same operation is made to compare C and D, then a final 3rd same operation compare the two results.

a script might be more efficient to compare more arrays, but when wiring with only math modules it's globally low cpu.
ill try to make a script if got time..

joffo78
Member
Posts: 1033
Contact:

Unread post by joffo78 » 10 Mar 2011, 02:50

thank you for your explaination and for the solution whitc was very helpful for me !
I have another problem of the same type.
but it's a little more difficult to explain.
i have to array i can crossfade between the two array to create a 3rd array. i want always to keep the max value (that can i do with your solution) but for example if the value 1 is 50 on the array 1 and 60 on the array 2, when i crossfade between the two values i don't want that the 50 of the first array go down to 25 to came up to 60 but juste go to 60 (if the value is the same on the two array they don't change at all between the crossfade).
I think is the same type of comparason but i don't manage to formulate it.

joffo78
Member
Posts: 1033
Contact:

Unread post by joffo78 » 10 Mar 2011, 07:52

Eureka i foundi it !

i made the comparason between max values and min values. i modify (with a multiply the max values and and i make a comparason between max and min values to extract the max values !!!
where my brain is going ?

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests