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_mono.wip | 90 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 objects/faust/phaser_mono.wip (limited to 'objects/faust/phaser_mono.wip') diff --git a/objects/faust/phaser_mono.wip b/objects/faust/phaser_mono.wip new file mode 100644 index 0000000..9966c00 --- /dev/null +++ b/objects/faust/phaser_mono.wip @@ -0,0 +1,90 @@ + + virtual void instanceInit(int samplingFreq) { + } + virtual void compute (int count, FAUSTFLOAT** input, FAUSTFLOAT** output) { + // TODO: find replacements for: expf, cosf, sinf + // values must be scaled to fit into the range expected by arm_{cos,sin}_q31 + // they all take radians! + // cosf --> 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 = 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 fSlow11 = ___SMMUL(TAU, param_fslider5); + int32_t fSlow12 = (__SMMUL(TAU, MAX(param_fslider5, param_fslider6)) - 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(1, fSlow0); + + int32_t* input0 = input[0]; + int32_t* input1 = input[1]; + int32_t* output0 = output[0]; + int32_t* output1 = output[1]; + + for (int i=0; i