IO Variants: 2
Variant: 1
frac32.bipolar Pitch input
frac32.bipolar phase input
bool32.rising Reset phase
frac32.bipolar Triangle wave
frac32.s.map.lfopitch pitch
uint32_t phase;
uint32_t old_reset;
__attribute__((always_inline)) __STATIC_INLINE int32_t ___ABS(int32_t op1) {
int32_t result;
__ASM volatile("movs %0, %1\n"
"it mi\n"
"rsbmi %0, %0, #0"
: "=r"(result)
: "r"(op1));
return (result);
};
phase = 0;
old_reset = 0;
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 saw = ((phase + (inlet_phase << 4)) >> 4) - (1 << 27);
outlet_tri = (1 << 27) - ___ABS(saw << 1);
Variant: 2
frac32.bipolar Pitch Input
frac32.bipolar phase input
bool32.rising Reset phase
frac32.positive Triangle wave
frac32.s.map.lfopitch pitch
uint32_t phase;
uint32_t old_reset;
__attribute__((always_inline)) __STATIC_INLINE int32_t ___ABS(int32_t op1) {
int32_t result;
__ASM volatile("movs %0, %1\n"
"it mi\n"
"rsbmi %0, %0, #0"
: "=r"(result)
: "r"(op1));
return (result);
};
phase = 0;
old_reset = 0;
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 saw = ((phase + (inlet_phase << 4)) >> 4) - (1 << 27);
outlet_tri = (1 << 27) - ___ABS(saw);