phasor_pm_s_u

Phasor with phase and sync inputs, unipolar s-rate
Author: Are Leistad
License: BSD
Github: drj/osc/saw_sin_sync.axo

IO Variants: 4


Variant: 1

Inlets

frac32.bipolar Pitch input

frac32buffer.bipolar phase input

frac32buffer.bipolar phase reset input

Outlets

frac32buffer.positive Phasor output

Parameters

frac32.s.map.pitch pitch

Declaration
uint32_t phase;
int32_t old_sync;
int32_t freq;
Init
phase = 0;

phase = 0;
old_sync = 0;
Control Rate
MTOFEXTENDED(param_pitch + inlet_pitch, freq);
Audio Rate
if (inlet_sync > 0 && old_sync <= 0) {
  phase = 0;
} else {
  phase += freq;
}
old_sync = inlet_sync;

outlet_out = (phase + (inlet_phase << 4)) >> 5;

Variant: 2

Inlets

frac32.bipolar Pitch input

frac32buffer.bipolar phase input

frac32buffer.bipolar phase reset input

Outlets

frac32buffer.bipolar Phasor output

Parameters

frac32.s.map.pitch pitch

Declaration
uint32_t phase;
int32_t old_sync;
int32_t freq;
Init
phase = 0;

phase = 0;
old_sync = 0;
Control Rate
MTOFEXTENDED(param_pitch + inlet_pitch, freq);
Audio Rate
if (inlet_sync > 0 && old_sync <= 0) {
  phase = 0;
} else {
  phase += freq;
}
old_sync = inlet_sync;

outlet_out = ((phase + (inlet_phase << 4)) >> 4) - (1 << 27);

Variant: 3

Inlets

frac32buffer.bipolar phase input

frac32buffer.bipolar phase reset input

frac32.bipolar Pitch input

Outlets

frac32buffer.bipolar Sine output

Parameters

frac32.s.map.pitch pitch

Declaration
uint32_t phase;
int32_t old_sync;
int32_t freq;
Init
phase = 0;
old_sync = 0;
Control Rate
MTOFEXTENDED(param_pitch + inlet_pitch, freq);
Audio Rate
if (inlet_sync > 0 && old_sync <= 0) {
  phase = 0;
} else {
  phase += freq;
}
old_sync = inlet_sync;

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

Variant: 4

Inlets

frac32.bipolar Pitch input

frac32buffer.bipolar phase input

frac32buffer.bipolar phase reset input

Outlets

frac32buffer.positive Sine output

Parameters

frac32.s.map.pitch pitch

Declaration
uint32_t phase;
int32_t old_sync;
int32_t freq;
Init
phase = 0;
old_sync = 0;
Control Rate
MTOFEXTENDED(param_pitch + inlet_pitch, freq);
Audio Rate
if (inlet_sync > 0 && old_sync <= 0) {
  phase = 0;
} else {
  phase += freq;
}
old_sync = inlet_sync;

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

Privacy

© 2024 Zrna Research