waveshaper 16p scope

Waveshape visualizer for waveshaper 16p objects
Author: Sputnki
License: BSD
Github: sptnk/effect/waveshaper 16p scope.axo

Inlets

frac32buffer wave coefficients

Outlets

None

Displays

int8array128.vbar wave

Declaration
int8_t w[128];
int32_t coefs[17];

int8_t x = 0;
Init
for (int i = 0; i < 128; i++)
  w[i] = 0;

coefs[0] = 0;
Control Rate
int32_t i;

for (i = 0; i < 16; i++)
  coefs[i + 1] = inlet_coefs[i];

for (i = 0; i < 128; i++)
  disp_wave[i] = w[i];

x++;
if (x > 15)
  x = 0;

int32_t q_i = coefs[x + 1] >> 21;
int32_t q_i_1 = coefs[x] >> 21;

w[64 + 4 * x] = q_i_1 + ((q_i - q_i_1) >> 2);
w[65 + 4 * x] = q_i_1 + ((q_i - q_i_1) >> 1);
w[66 + 4 * x] = q_i_1 + ((q_i - q_i_1) * 3 >> 2);
w[67 + 4 * x] = q_i_1 + (q_i - q_i_1);

w[60 - 4 * x] = -w[67 + 4 * x];
w[61 - 4 * x] = -w[66 + 4 * x];
w[62 - 4 * x] = -w[65 + 4 * x];
w[63 - 4 * x] = -w[64 + 4 * x];

Privacy

© 2024 Zrna Research