Constructor
new MinMax()
- Source:
Example
import * as lfo from 'waves-lfo/common';
const eventIn = new lfo.source.EventIn({
frameSize: 512,
frameType: 'signal',
sampleRate: 0,
});
const minMax = new lfo.operator.MinMax();
const logger = new lfo.sink.Logger({ data: true });
eventIn.connect(minMax);
minMax.connect(logger);
eventIn.start()
// create a frame
const signal = new Float32Array(512);
for (let i = 0; i < 512; i++)
signal[i] = i + 1;
eventIn.process(null, signal);
> [1, 512];
Methods
inputSignal(data) → {Array}
Use the MinMax
operator in standalone
mode (i.e. outside of a graph).
Parameters:
Name | Type | Description |
---|---|---|
data |
Float32Array | Array | Input signal. |
- Source:
Returns:
- Min and max values.
- Type
- Array
Example
const minMax = new MinMax();
minMax.initStream({ frameType: 'signal', frameSize: 10 });
minMax.inputSignal([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
> [0, 5]