sine window

Adjustable sine-shaped window. Pretty heavyweight
Author: Sputnki
License: BSD
Github: sptnk/math/sine window.axo

Inlets

frac32buffer in

Outlets

frac32buffer out

Parameters

frac32.u.map determines the size of the sine shaped flanks

Declaration
int32_t r1;
int32_t r2;
Control Rate
float halfsize = param_size >> 1;
float halfsize_compl = (1 << 27) - halfsize;
Audio Rate
float arg1 = 1073741824.0f * (inlet_in / halfsize);
float arg2 = (1 + (inlet_in - halfsize_compl) / halfsize) * 1073741824.0f;

SINE2TINTERP(((int32_t)arg1), r1);
SINE2TINTERP(((int32_t)arg2), r2);

if (inlet_in < 0 || inlet_in > 1 << 27) {
  outlet_out = 0;
} else if (inlet_in < halfsize) {
  outlet_out = r1 >> 4;
} else if (inlet_in > halfsize_compl) {
  outlet_out = r2 >> 4;
} else
  outlet_out = 1 << 27;

Privacy

© 2024 Zrna Research