From 8a4bca986c57062e96f1e58281b3eff52a856ee6 Mon Sep 17 00:00:00 2001 From: rekado Date: Tue, 6 Sep 2016 22:13:03 +0200 Subject: Initial commit. --- objects/faust/phaser_stereo_optimised.axo | 180 ++++++++++++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 objects/faust/phaser_stereo_optimised.axo (limited to 'objects/faust/phaser_stereo_optimised.axo') diff --git a/objects/faust/phaser_stereo_optimised.axo b/objects/faust/phaser_stereo_optimised.axo new file mode 100644 index 0000000..c16ac7d --- /dev/null +++ b/objects/faust/phaser_stereo_optimised.axo @@ -0,0 +1,180 @@ + + + Phaser Stereo (from Faust) hand-optimised + Ricardo Wurmus + GPL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (b) ? (a) : (b)) + #define cosf arm_cos_q31 + #define intTAU 0x00c90fdb + /*"6.283185307179586f"*/ +]]> + + arm_cos_q31 + // sinf --> arm_sin_q31 + + int32_t fSlow0 = param_fcheckbox0 ? 0x00200000 /*"1"*/ : (param_fslider0>>1); + int32_t fSlow1 = param_fcheckbox1 ? __QSUB(0, fSlow0) : fSlow0; + // TODO: find replacement for expf + // e ^ -1 * const1 * pi * slider3 + // It's a value between 0.72 and 1.0, but for now we pretend it's just the value of fslider3. + // float fSlow4 = expf((fConst1 * (0 - (3.141592653589793f * float(fslider3))))); + int32_t fSlow4 = 0x00200000; //param_fslider3; + int32_t fSlow5 = ___SMMUL(fSlow4, fSlow4); + int32_t fSlow6 = ___SMMUL(fConst2, param_fslider4); + int32_t fSlow7 = arm_cos_q31(fSlow6); + int32_t fSlow8 = arm_sin_q31(fSlow6); + int32_t fSlow9 = __QSUB(0, fSlow8); + + int32_t minFreq; + MTOF(param_fslider5, minFreq); + int32_t maxFreq; + MTOF(param_fslider6, maxFreq); + + int32_t fSlow11 = ___SMMUL(intTAU, minFreq); + int32_t fSlow12 = __QSUB(___SMMUL(intTAU, MAX(minFreq, maxFreq)), fSlow11) >>1; + int32_t fSlow15 = __QSUB(0, fSlow4<<1); + int32_t fSlow14 = ___SMMUL(fConst1, param_fslider7); + int32_t fSlow16 = ___SMMUL(fSlow14, param_fslider7); + int32_t fSlow17 = ___SMMUL(fSlow16, param_fslider7); + int32_t fSlow18 = ___SMMUL(fSlow17, param_fslider7); + int32_t fSlow19 = __QSUB(0x00200000 /*"1.0"*/, fSlow0); + + const int32_t* input0 = inlet_in; + const int32_t* input1 = inlet_in; + int32_t* output0 = outlet_left; + int32_t* output1 = outlet_right; + + for (int i=0; i + + -- cgit v1.2.3