Constructor
new Multiplier(options)
Parameters:
Name | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | override default values Properties
|
- Source:
Example
import * as lfo from 'waves-lfo/common';
const eventIn = new lfo.operator.EventIn({
type: 'vector',
frameSize: 2,
frameRate: 0,
});
const scaler = new lfo.operator.Multiplier({ factor: 0.1 });
eventIn.connect(scaler);
eventIn.process(null, [2, 3]);
> [0.2, 0.3]
Methods
inputSignal(data) → {Array}
Use the Multiplier
operator in standalone mode.
Parameters:
Name | Type | Description |
---|---|---|
data |
Float32Array | Array | Input signal. |
- Source:
Returns:
- Scaled signal.
- Type
- Array
Example
const scaler = new Multiplier({ factor: 0.1 });
scaler.initStream({ frameType: 'signal', frameSize: 2 });
scaler.inputVector([1, 2]);
> [0.1, 0.2]
inputVector(data) → {Array}
Use the Multiplier
operator in standalone mode.
Parameters:
Name | Type | Description |
---|---|---|
data |
Float32Array | Array | Input vector |
- Source:
Returns:
- Scaled values
- Type
- Array
Example
const scaler = new Multiplier({ factor: [2, 4] });
scaler.initStream({ frameType: 'vector', frameSize: 2 });
scaler.inputVector([3, 2]);
> [6, 8]