Overview Clamps Packages CM Dictionary Clamps Dictionary Fomus
Next: m-lin-dev , Previous: m-exp-zero-rev-fn , Up: M , Home: Overview

Clamps Dictionary

m-lin

Function

(m-lin x min max)

Return the linear interpolation for a MIDI value in the range [min..max] as a float value.

Arguments

x An input value in the range [0..127] to be interpolated.
min The output value for x = 0.
max The output value for x = 127.

Examples

#+BEGIN_SRC lisp
(m-lin 0 10 20) ; => 10.0

(m-lin 64 10 20) ; => 15.039371

(m-lin 127 10 20)  ; => 20.0

#+ENDSRC

Author: Orm Finnendahl

Created: 2025-02-18 Di 12:58

Validate