quadPanRotator

4 input s-rate mixer with a panning rotator each input's panning is 90 degrees shifted in respect to the former/next rate controls the rotation speed
Author: Remco van der most
License: BSD
Github: sss/mix/quadPanRotator.axo

Inlets

frac32buffer input 1

frac32buffer input 2

frac32buffer input 3

frac32buffer input 4

Outlets

frac32buffer outL

frac32buffer outR

Parameters

frac32.u.map.squaregain gain1

frac32.u.map.squaregain gain2

frac32.u.map.squaregain gain3

frac32.u.map.squaregain gain4

frac32.s.map.kpitch rate

Declaration
uint32_t phase;
Control Rate
int32_t freq;
MTOFEXTENDED(param_rate, freq)
phase += freq >> 2;
int32_t sine1;
int32_t sine2;
int32_t sine3;
int32_t sine4;
int32_t sine5;
int32_t sine6;
int32_t sine7;
int32_t sine8;
SINE2TINTERP(phase, sine1)
SINE2TINTERP(phase + (1 << 30), sine2)
SINE2TINTERP(phase + (2 << 30), sine3)
SINE2TINTERP(phase + (3 << 30), sine4)
sine1 = (sine1 >> 5) + (1 << 26);
sine2 = (sine2 >> 5) + (1 << 26);
sine3 = (sine3 >> 5) + (1 << 26);
sine4 = (sine4 >> 5) + (1 << 26);
sine5 = (1 << 27) - sine1;
sine6 = (1 << 27) - sine2;
sine7 = (1 << 27) - sine3;
sine8 = (1 << 27) - sine4;
Audio Rate
int32_t accL = 0;
int32_t accR = 0;
int32_t in1 = ___SMMUL(param_gain1, inlet_in1 << 2);
int32_t in2 = ___SMMUL(param_gain2, inlet_in2 << 2);
int32_t in3 = ___SMMUL(param_gain3, inlet_in3 << 2);
int32_t in4 = ___SMMUL(param_gain4, inlet_in4 << 2);
accL += ___SMMUL(in1 << 2, sine1 << 3);
accL += ___SMMUL(in2 << 2, sine2 << 3);
accL += ___SMMUL(in3 << 2, sine3 << 3);
accL += ___SMMUL(in4 << 2, sine4 << 3);
accR += ___SMMUL(in1 << 2, sine5 << 3);
accR += ___SMMUL(in2 << 2, sine6 << 3);
accR += ___SMMUL(in3 << 2, sine7 << 3);
accR += ___SMMUL(in4 << 2, sine8 << 3);
outlet_outL = accL;
outlet_outR = accR;

Privacy

© 2024 Zrna Research