xorsaw_osc

Xor saw wave oscillator
Author: JLS
License: BSD
Github: jls/osc/xorsaw_osc.axo

Inlets

frac32.bipolar pitch 1

frac32.bipolar pitch 2

Outlets

frac32buffer.bipolar Xor saw

Parameters

frac32.s.map.pitch pitch1

frac32.s.map.pitch pitch2

Declaration
int32_t osc_p1;
int32_t osc_p2;
Init
osc_p1 = 0;
osc_p2 = 0;
Control Rate
uint32_t freq1;
uint32_t freq2;

MTOFEXTENDED(param_pitch1 + inlet_pitch1, freq1);
MTOFEXTENDED(param_pitch2 + inlet_pitch2, freq2);

int j;

for (j = 0; j < BUFSIZE; j++) {

  osc_p1 += freq1;
  osc_p2 += freq2;

  outlet_wave[j] = ((osc_p1) >> 5) ^ ((osc_p2) >> 5);
}

Privacy

© 2024 Zrna Research