supersquare b

seven detuned square wave oscillators Non-bandwith limited. Fixed so it is bipolar.
Author: Oscar Abraham
License: BSD
Github: oscar/osc/supersquare b.axo

Inlets

frac32.bipolar pitch

Outlets

frac32buffer.bipolar supersaw wave

Parameters

frac32.s.map.pitch pitch

Declaration
int32_t osc_p[7];
Init
int i;
for (i = 0; i < 7; i++)
  osc_p[i] = 0;
Control Rate
uint32_t f0;
uint32_t f[6];
MTOFEXTENDED(param_pitch + inlet_pitch, f0);
int i, j;
f[0] = ___SMMLA(f0, -0x05432123, f0);
f[1] = ___SMMLA(f0, -0x03111111, f0);
f[2] = ___SMMLA(f0, -0x01020304, f0);
f[3] = ___SMMLA(f0, 0x01030450, f0);
f[4] = ___SMMLA(f0, 0x03212121, f0);
f[5] = ___SMMLA(f0, 0x05542211, f0);

for (j = 0; j < BUFSIZE; j++) {
  osc_p[6] += f0;
  if (osc_p[6] > 0)
    outlet_wave[j] = (1 << 24);
  else
    outlet_wave[j] = -(1 << 24);
  for (i = 0; i < 6; i++) {
    osc_p[i] += f[i];
    if (osc_p[i] > 0)
      outlet_wave[j] += (1 << 24);
    else
      outlet_wave[j] += -(1 << 24);
  }
}

Privacy

© 2024 Zrna Research