sin_ph_b

Sine LFO, bipolar, lin-ip, pitch input, phase input, phase reset
Author: Are Leistad
License: BSD
Github: drj/lfo/phase_sine.axo

IO Variants: 2


Variant: 1

Inlets

frac32.bipolar Pitch input

frac32.bipolar Phase input

bool32.rising Reset phase

Outlets

frac32.bipolar Sine wave

Parameters

frac32.s.map.lfopitch pitch

Declaration
uint32_t phase;
int32_t old_reset;
Init
phase = 0;
old_reset = 0;
Control Rate
if (inlet_reset && !old_reset) {
  phase = 0;
} else {
  int32_t freq;
  MTOFEXTENDED(param_pitch + inlet_pitch, freq);
  phase += freq >> 2;
}
old_reset = inlet_reset;

int32_t sine;
SINE2TINTERP(phase + (inlet_phase << 4), sine)
outlet_sine = (sine >> 4);

Variant: 2

Inlets

frac32.bipolar Pitch input

frac32.bipolar Phase input

bool32.rising Reset phase

Outlets

frac32.positive Sine wave

Parameters

frac32.s.map.lfopitch pitch

Declaration
uint32_t phase;
uint32_t old_reset;
Init
phase = 0;
old_reset = 0;
Control Rate
if (inlet_reset && !old_reset) {
  phase = 0;
} else {
  int32_t freq;
  MTOFEXTENDED(param_pitch + inlet_pitch, freq);
  phase += freq >> 2;
}
old_reset = inlet_reset;

int32_t sine;
SINE2TINTERP(phase + (inlet_phase << 4), sine)
outlet_sine = (sine >> 5) + (1 << 26);

Privacy

© 2024 Zrna Research