sineSnc

sine wave oscillator with an krate sync input for use in basekicks, where you want to sync the start of the sine (0) at each trigger to keep the full impact of the punch without a click.
Author: Remco van der Most
License: BSD
Github: sss/osc/sineSnc.axo

Inlets

frac32.bipolar pitch

frac32buffer frequency

bool32 sync

Outlets

frac32buffer phase

frac32buffer.bipolar sine wave

Parameters

frac32.s.map.pitch pitch

Declaration
uint32_t Phase;
bool strg;
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;
}
Audio Rate
Phase += freq + inlet_freq;
int32_t r;
int32_t p2 = Phase;
SINE2TINTERP(p2, r)
outlet_wave = (r >> 4);
outlet_phase = Phase;

Privacy

© 2024 Zrna Research