functions¶
ampdb(amp)
¶
clip(val, min_val, max_val)
¶
cpsmidi(frequency)
¶
lincurve(value, in_min, in_max, out_min, out_max, curve=0)
¶
Linear-to-curve transform
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
float
|
Input value to transform |
required |
in_min
|
float
|
Minimum of input range (linear) |
required |
in_max
|
float
|
Maximum of input range (linear) |
required |
out_min
|
float
|
Minimum of output range |
required |
out_max
|
float
|
Maximum of output range |
required |
curve
|
float
|
Curve parameter curve = 0: linear curve > 0: exponential-like (steep at end) curve < 0: logarithmic-like (steep at start) |
0
|
Returns:
| Type | Description |
|---|---|
float
|
Curved output value |
Source code in mmm_utils/functions.py
linexp(value, in_min, in_max, out_min, out_max)
¶
Linear-to-exponential transform
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
float
|
Input value to transform |
required |
in_min
|
float
|
Minimum of input range (linear) |
required |
in_max
|
float
|
Maximum of input range (linear) |
required |
out_min
|
float
|
Minimum of output range (exponential) |
required |
out_max
|
float
|
Maximum of output range (exponential) |
required |
Returns:
| Type | Description |
|---|---|
float
|
Exponentially scaled output value |
Source code in mmm_utils/functions.py
linlin(value, in_min, in_max, out_min, out_max)
¶
Linear-linear transform: map value from input range to output range
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
float
|
Input value to transform |
required |
in_min
|
float
|
Minimum of input range |
required |
in_max
|
float
|
Maximum of input range |
required |
out_min
|
float
|
Minimum of output range |
required |
out_max
|
float
|
Maximum of output range |
required |
Returns:
| Type | Description |
|---|---|
float
|
Transformed value in output range |
Source code in mmm_utils/functions.py
midicps(midi_note)
¶
scale(val=0, in_min=0, in_max=1, out_min=0, out_max=1)
¶
Scale a value from one range to another.