Moselle had about 4-5 various functions to map one quantity into another: a linear interpolater/fader, an exponential one, an equal-stairstep function.
I've stepped back and figured out exactly what functions I need as a whole and came up with a family of 36 in total.
Select() -- equal-width stairsteps
LinFade() -- linear interpolation
ExpFade() -- exponential interpolation
PowFade() -- equal power fade (for uncorrelated audio signals, especially)
Curve() -- a curved mapping, convex or concave, based on the "bias" function used in computer animation
SCurve() -- an S-shaped curved mapping, convex or concave, based on the "gain" function used in computer animation.
These six each come in a "normal" version, where inputs below the minimum are just treated as minimum, and inputs above the maximum are just treated as the maximum. They also come in a "Loop" version, where values higher than the maximum are just wrapped around to the minimum and vice versa. As an example, LinFade( -1.5, Osc1, Osc2) would still give you Osc1. LinFadeLoop( -1.5, Osc1, Osc2) would loop around to give you a midpoint.
Then the above twelve functions (the six listed plus their loop versions) all come in three versions. 1) the "normal" version which assumes the input is between 0 and 1 (or for loops, at least assume 0 is the first item and 1 has looped you all the way around to the first item again). 2) the "N" version that assumes your input is between 0 and the number of items on the list minus one. 3) an "X" version that lets you specify the X values. Examples: LinFade( X, Osc1, Osc2, Osc3 ) would give you Osc 1, 2, 3, for values 0 .5 and 1. LinFadeN() would give them to you for values 0, 1, and 2. Then LinFadeX( x, 0, Osc1, .9, Osc2, 1, Osc3 ) would give you Osc 1, 2, 3 for inputs 0, .9, and 1.
In the future I can see adding "best fit" polynomial curves, splines, and so on, but I need to do some other stuff.
Current Project
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Who is online
Users browsing this forum: No registered users and 11 guests