sin_2_p

Dual phase sine LFO, unipolar, 0 and 120 degrees, lin-ip, pitch input, phase reset
Author: Are Leistad
License: BSD
Github: drj/lfo/dual_sine.axo

IO Variants: 4


Variant: 1

Inlets

frac32.bipolar pitch

bool32.rising reset phase

Outlets

frac32.positive 0 deg sine wave

frac32.positive 120 deg 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, sine)
outlet_0 = (sine >> 5) + (1 << 26);

SINE2TINTERP(phase - 0x55555555, sine)
outlet_120 = (sine >> 5) + (1 << 26);

Variant: 2

Inlets

frac32.bipolar pitch

bool32.rising reset phase

Outlets

frac32.bipolar 0 deg sine wave

frac32.bipolar 120 deg 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, sine)
outlet_0 = (sine >> 4);

SINE2TINTERP(phase - 0x55555555, sine)
outlet_120 = (sine >> 4);

Variant: 3

Inlets

frac32.bipolar pitch

bool32.rising reset phase

Outlets

frac32.bipolar 0 deg sine wave

frac32.bipolar 90 deg 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, sine)
outlet_0 = (sine >> 4);

SINE2TINTERP(phase - 0x40000000, sine)
outlet_90 = (sine >> 4);

Variant: 4

Inlets

bool32.rising reset phase

frac32.bipolar pitch

Outlets

frac32.positive 0 deg sine wave

frac32.positive 90 deg 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, sine)
outlet_0 = (sine >> 5) + (1 << 26);

SINE2TINTERP(phase - 0x40000000, sine)
outlet_90 = (sine >> 5) + (1 << 26);

Privacy

© 2024 Zrna Research