slowsinesync

sine wave oscillator, with rising-edge sync input
Author: toneburst
License: BSD
Github: phi/osc/slowsinesync.axo

Inlets

frac32buffer frequency

frac32buffer phase

frac32buffer sync, resets oscillator phase on rising zero-crossing

int32.positive oct

frac32.bipolar pitch

Outlets

frac32buffer.bipolar sine wave

Parameters

int32.hradio oct

frac32.s.map.pitch pitch

Declaration
uint32_t Phase;
int32_t old_sync;
Init
Phase = 0;
old_sync = 0;
Control Rate
int32_t freq;
MTOFEXTENDED(param_pitch + inlet_pitch, freq);
Audio Rate
if (inlet_sync > 0 && old_sync <= 0)
  Phase = 0;
else
  Phase += ((freq + inlet_freq) >> (param_oct + inlet_oct));
old_sync = inlet_sync;

int32_t r;
int32_t p2 = Phase + (inlet_phase << 4);
SINE2TINTERP(p2, r)
outlet_wave = (r >> 4);

Privacy

© 2024 Zrna Research