saw r

saw wave LFO, rising slope, pitch input, phase reset
Author: Johannes Taelman
License: BSD
Github: lfo/saw r.axo

Inlets

frac32.bipolar pitch

bool32.rising reset phase

Outlets

frac32.positive saw wave

bool32.pulse sync output

Parameters

frac32.s.map.lfopitch pitch

Declaration
uint32_t Phase;
int32_t pPhase;
uint32_t r;
Init
Phase = 0;
pPhase = 0;
r = 1;
Control Rate
{
  if (inlet_reset && r) {
    Phase = 0;
    r = 0;
  } else {
    if (!inlet_reset)
      r = 1;
    int32_t freq;
    MTOFEXTENDED(param_pitch + inlet_pitch, freq);
    Phase += freq >> 2;
  }
  outlet_sync = (((int32_t)Phase) >= 0) && (pPhase < 0);
  outlet_wave = (Phase >> 5);
  pPhase = Phase;
}

Privacy

© 2024 Zrna Research