ringosc

Ringmoduling sine wave oscillator
Author: Remco van der Most
License: BSD
Github: sss/osc/ringosc.axo

Inlets

frac32.bipolar pitch

frac32buffer frequency

frac32buffer phase

frac32 mod

frac32 frq

Outlets

frac32buffer.bipolar sine wave

Parameters

frac32.s.map.pitch pitch

frac32.s.map mod

frac32.s.map freq

Declaration
uint32_t Phase;
int32_t ring;
int32_t hp;
int32_t val;
int32_t lp;
int32_t lal;
Init
Phase = 0;
val = 0;
Control Rate
int32_t freq;
MTOFEXTENDED(param_pitch + inlet_pitch, freq);
int32_t f;
MTOFEXTENDED(inlet_pitch + param_freq + inlet_frq, f);
Audio Rate
Phase += freq + inlet_freq;
int32_t r;
int32_t p2 = Phase + (inlet_phase << 4);
SINE2TINTERP(p2 + (___SMMUL(lal << 3, (param_mod + inlet_mod) << 3) << 2), r)
ring = ___SMMUL(
    r >> 2,
    (___SMMUL(r >> 1, (___SMMUL((lal) << 3, param_mod << 3)) - (r >> 2))) << 2);

val = ___SMMLA((ring - val) << 1, freq, val);
hp = ring - val;
lal = ___SMMLA((hp - lal) << 1, f, lal);

outlet_wave = (lal + (r >> 4)) >> 2;

Privacy

© 2024 Zrna Research