square cheap

square wave oscillator Non-bandwith limited, cheap sound
Author: Johannes Taelman
License: BSD
Github: osc/square cheap.axo

Inlets

frac32.bipolar pitch

Outlets

frac32buffer.bipolar square wave, non-anti-aliased

Parameters

frac32.s.map.pitch pitch

Declaration
int32_t osc_p;
Init
osc_p = 0;
Control Rate
uint32_t freq;
MTOFEXTENDED(param_pitch + inlet_pitch, freq);
int j;
for (j = 0; j < BUFSIZE; j++) {
  osc_p += freq;
  if (osc_p > 0) {
    outlet_wave[j] = (1 << 26);
  } else {
    outlet_wave[j] = -(1 << 26);
  }
}

Privacy

© 2024 Zrna Research