SNDC_BINOP

NAME
SYNOPSIS
PROCESSING

NAME

binop - Binary operation between two buffers or numbers.

SYNOPSIS

Inputs:

input0 [BUFFER|FLOAT] [REQUIRED]: input #0.

input1 [BUFFER|FLOAT] [REQUIRED]: input #1.

operator [STRING] [REQUIRED]: operator: ’add’, ’sub’, ’mul’, ’div’, ’min’, ’max’.

Outputs:

out [BUFFER]: result, input0 ’operator’ input1.

PROCESSING

Combines the two input buffer according to the specified binary operation.

The output buffer will have the same duration and sampling rate as input0.

The algorithm will iterate through all samples of input0 and add, subtract, multiply, divide, take the minimum or maximum of either the current sample of input0 and an interpolated value of input1. In that way, input0 and input1 are not interchangeable.

Suppose input0 has 44100 samples and input1 has two samples, the first sample of input0 will be combined with the first sample of input1, the last sample of input0 with the last sample of input1 and every other sample in input0 will be combined with a corresponding interpolation between the two samples of input1. The resulting output will have 44100 samples.

If we were to swap input0 and input1, the resulting output would have two samples.