textmode.synth.js / ModulatedArray / fit
Method: fit()
ts
fit(low, high): ModulatedArray;Fit (remap) array values to a new range.
Takes the minimum and maximum values in the array and linearly maps them to the specified low and high values. All intermediate values are scaled proportionally. The original array is not modified.
Preserves any modulation settings (speed, smooth, ease, offset) from the original array.
Parameters
| Parameter | Type | Description |
|---|---|---|
low | number | New minimum value |
high | number | New maximum value |
Returns
A new ModulatedArray with remapped values