Welcome to %s forums

BrainModular Users Forum

Login Register

expand/compress array element values?

I need help on a Patch
Post Reply
soundmind
Member
Posts: 236
Contact:

Unread post by soundmind » 07 Feb 2010, 06:18

I know that there is an array expand/compress module but it is only for array length. is there a way to do the same with the values of the elements within the array? i am trying to use one array to edit the values in multiple arrays all with different min/max values but i want the resulting arrays to maintain the shape of the first one.. thanks.

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 07 Feb 2010, 09:57

you have at least two way to achieve this :

with a mapper curve :
-You set min in, max in, min ou and max out, with a linear mapping.

with a A*in+B module (affine transformation) :
-Set A to (max out - min out)
-Set in with the array data
-Set B to min out

hope it help
Martin FLEURENT - Usine Developer - SDK maintainer

Clearscreen
Member
Posts: 482
Location: Australia
Contact:

Unread post by Clearscreen » 08 Feb 2010, 02:29

it's worth remembering all the math modules work on arrays... comes in very very handy at times :)

soundmind
Member
Posts: 236
Contact:

Unread post by soundmind » 09 Feb 2010, 02:14

Thanks for the info martin. i did not know it was that easy.
Clearscreen wrote:it's worth remembering all the math modules work on arrays... comes in very very handy at times :)
definitely good to know this.

thanks for all the help.

Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests