FANDOM


Sample mapper

Sample Mapper

Used to scale, offsets and/or invert decimal values.

They are mostly used to scale input sampler outputs

Video

Input/Output Description Data Type
>sample The input value decimal
>sample_min The lower and upper borders to specify the sample range decimal
>sample_max decimal
>mapped_min The lower and upper borders to specify the mapped range decimal
>mapped_max decimal
>invert Flips <mapped with <inverted boolean
<mapped The scaled output value decimal
<inverted The inverted scaled output value decimal

FormulasEdit

Lerp

Sample mapper applies linear interpolation between two points: (sample_min; mapped_min) and (sample_max; mapped_max).

$ \begin{alignat}{2} {\color{White}Y = }&\ {\color{White}Y_1 + (Y_2 - Y_1) * \frac{(X - X_1)}{(X_2 - X_1)}} {\color{YellowOrange}} \\ {\color{White}Y_{inv} = }&\ {\color{White}Y_2 + (Y_1 - Y_2) * \frac{(X - X_1)}{(X_2 - X_1)}} \\ \end{alignat} $

$ \begin{alignat}{7} {\color{White}X = }& {\color{White}\text{ sample}} {\color{YellowOrange}} \\ {\color{White}Y = }& {\color{White}\text{ mapped}} \\ {\color{White}Y_{inv} = }& {\color{White}\text{ inverted}} \\ {\color{White}X_1 = }& {\color{White}\text{ sample min}} \\ {\color{White}X_2 = }& {\color{White}\text{ sample max}} \\ {\color{White}Y_1 = }& {\color{White}\text{ mapped min}} \\ {\color{White}Y_2 = }& {\color{White}\text{ mapped max}} \\ \end{alignat} $