Class: Select

Select

Select one or several indexes from a vector input. If only one index is selected, the output will be of type scalar, otherwise the output will be a vector containing the selected indexes.

Constructor

new Select(options)

Parameters:
Name Type Description
options Object

Override default values.

Properties
Name Type Description
index Number

Index to select from the input frame.

indexes Array.<Number>

Indices to select from the input frame, if defined, take precedance over option.index.

Source:
Example
import * as lfo from 'waves-lfo/common';

const eventIn = new lfo.source.EventIn({
  frameType: 'vector',
  frameSize: 3,
});

const select = new lfo.operator.Select({
  indexes: [2, 0],
});

eventIn.start();
eventIn.process(0, [0, 2, 4]);
> [4, 0]
eventIn.process(0, [1, 3, 5]);
> [5, 1]