Constructor
new OnOff(options)
Parameters:
Name | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Override default parameters. Properties
|
- Source:
Example
import * as lfo from 'waves-lfo/common';
const frames = [
{ time: 0, data: [1, 2] },
{ time: 1, data: [3, 4] },
{ time: 2, data: [5, 6] },
];
const eventIn = new EventIn({
frameSize: 2,
frameRate: 0,
frameType: 'vector',
});
const onOff = new OnOff();
const logger = new Logger({ data: true });
eventIn.connect(onOff);
onOff.connect(logger);
eventIn.start();
eventIn.processFrame(frames[0]);
> [0, 1]
// bypass subgraph
onOff.setState('off');
eventIn.processFrame(frames[1]);
// re-open subgraph
onOff.setState('on');
eventIn.processFrame(frames[2]);
> [5, 6]
Methods
setState(state)
Set the state of the OnOff
.
Parameters:
Name | Type | Description |
---|---|---|
state |
String | New state of the operator ( |
- Source: