sineGS

sine wave oscillator with a krate sync input to sync the oscillator to a gate. eg. very useful for a neat kick-punch
Author: Remco van der Most
License: BSD
Github: sss/osc/sineGS.axo

Inlets

frac32.bipolar pitch

frac32buffer frequency

frac32 phase

bool32 sync

Outlets

frac32buffer phase

frac32buffer.bipolar sine wave

Parameters

frac32.s.map.pitch pitch

frac32.u.map.gain phase

Declaration
uint32_t Phase;
bool strg;
int32_t step;
int32_t prev;
Init
Phase = 0;
Control Rate
int32_t freq;
MTOFEXTENDED(param_pitch + inlet_pitch, freq);
if ((inlet_sync > 0) && !strg) {
  strg = 1;
  Phase = 0;
} else if (inlet_sync == 0) {
  strg = 0;
}

step = (freq - prev) >> 4;
int32_t I = prev;
prev = freq;
int32_t phase = (param_phase << 1) + (inlet_phase << 4);
Audio Rate
I += step;
Phase += I + inlet_freq;
int32_t r;
int32_t p2 = Phase + phase;
SINE2TINTERP(p2, r)
outlet_wave = (r >> 4);
outlet_phase = Phase;

Privacy

© 2024 Zrna Research