phasor fast sync

Phasor with signal rate reset. An abrupt decrease at the sync inlet resets the phase.
Author: Jan Hofmann
License: BSD
Github: jho/osc/phasor fast sync.axo

Inlets

frac32.bipolar pitch

frac32buffer.bipolar phase reset

Outlets

frac32buffer.bipolar saw wave, non-anti-aliased

Parameters

frac32.s.map.pitch pitch

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

Privacy

© 2024 Zrna Research