Is there anyway to smooth the values of an array?
From a set of value A to a set of value B for example....
smooth and array
-
23fx23
- Member
- Posts: 2548
any ideas how to make by script or patch something that would smooth 'over steps', mean not morph between two sets but
ie if a 16 step as first step 1 and all other 0 the smooth result would be a ramp down where step 1 is 0,8, 2 is 0,7, 3is 0,6 ect..
kind of the beavior of smooth module but instead of being related to time can be applied to a static array,
steps orders acting as time, dk if im clear. ie transform some spikes contrasted cloud array to round more sined..?
'blur' the array... a square wavform becoming a rounded triangle..
i fail a bit to visualise the approach..
ie if a 16 step as first step 1 and all other 0 the smooth result would be a ramp down where step 1 is 0,8, 2 is 0,7, 3is 0,6 ect..
kind of the beavior of smooth module but instead of being related to time can be applied to a static array,
steps orders acting as time, dk if im clear. ie transform some spikes contrasted cloud array to round more sined..?
'blur' the array... a square wavform becoming a rounded triangle..
i fail a bit to visualise the approach..
-
bsork
- Site Admin
- Posts: 1334
- Location: Asker, Norway
@23fx23: What you describe looks to me like something you would get by rounding the intermediate values - at least if you consider the steps to be of equal "size". If that's the case, some simple integer math will do the trick:
Assuming input and outputs values between 0 and 1: output = round(input * 100 / number_of_steps) * current_step / 100
Assuming input and outputs values between 0 and 1: output = round(input * 100 / number_of_steps) * current_step / 100
Bjørn S
