From 8a4bca986c57062e96f1e58281b3eff52a856ee6 Mon Sep 17 00:00:00 2001 From: rekado Date: Tue, 6 Sep 2016 22:13:03 +0200 Subject: Initial commit. --- objects/env-bp.axs | 118 +++++++ objects/env/ad m.axo | 60 ++++ objects/exp-xfade.axs | 226 ++++++++++++ objects/faust/karplus.axo | 98 ++++++ objects/faust/moog_vcf.axo | 205 +++++++++++ objects/faust/phaser_mono.wip | 90 +++++ objects/faust/phaser_mono_float.axo | 36 ++ objects/faust/phaser_mono_float.cpp | 129 +++++++ objects/faust/phaser_stereo_float.axo | 70 ++++ objects/faust/phaser_stereo_float.cpp | 215 ++++++++++++ objects/faust/phaser_stereo_optimised.axo | 180 ++++++++++ objects/limiter.axs | 126 +++++++ objects/murf.axs | 561 ++++++++++++++++++++++++++++++ objects/octaver.axs | 238 +++++++++++++ objects/pattern-editor.axs | 278 +++++++++++++++ objects/read-interp-slow.axo | 76 ++++ objects/sel b 32 pulse.axo | 29 ++ objects/sqrt-distortion.axs | 157 +++++++++ objects/wip/pitch_detect_fft.axo | 179 ++++++++++ objects/xfade-env.axs | 167 +++++++++ 20 files changed, 3238 insertions(+) create mode 100644 objects/env-bp.axs create mode 100644 objects/env/ad m.axo create mode 100644 objects/exp-xfade.axs create mode 100644 objects/faust/karplus.axo create mode 100644 objects/faust/moog_vcf.axo create mode 100644 objects/faust/phaser_mono.wip create mode 100644 objects/faust/phaser_mono_float.axo create mode 100644 objects/faust/phaser_mono_float.cpp create mode 100644 objects/faust/phaser_stereo_float.axo create mode 100644 objects/faust/phaser_stereo_float.cpp create mode 100644 objects/faust/phaser_stereo_optimised.axo create mode 100644 objects/limiter.axs create mode 100644 objects/murf.axs create mode 100644 objects/octaver.axs create mode 100644 objects/pattern-editor.axs create mode 100644 objects/read-interp-slow.axo create mode 100644 objects/sel b 32 pulse.axo create mode 100644 objects/sqrt-distortion.axs create mode 100644 objects/wip/pitch_detect_fft.axo create mode 100644 objects/xfade-env.axs (limited to 'objects') diff --git a/objects/env-bp.axs b/objects/env-bp.axs new file mode 100644 index 0000000..2d88679 --- /dev/null +++ b/objects/env-bp.axs @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + no + + + + 0 + 31 + 1280 + 769 + + \ No newline at end of file diff --git a/objects/env/ad m.axo b/objects/env/ad m.axo new file mode 100644 index 0000000..9ae76f1 --- /dev/null +++ b/objects/env/ad m.axo @@ -0,0 +1,60 @@ + + + attack decay envelope with modulation inputs + Ricardo Wurmus + GPL + env.axh + + + + + + + + + + + + + + + + + 0) && !ntrig) { + ntrig = 1; + stage = 1; +} else if (!(inlet_trig>0)) { + ntrig = 0; +} + +// decay +if (stage == 0) { + val = ___SMMLA(val,(-1<<26)+(param_d>>1)+(inlet_d>>1),val); + +// attack +} else { + int32_t a; + MTOF(- param_a - inlet_a,a); + + // shift to let val rise more slowly + a = a >> 4; + val = val + a; + + // switch to decay phase at max + if (val > 0x07FFFFFF) { + val = 0x07FFFFFF; + stage = 0; + } +} +outlet_env = val; +]]> + + diff --git a/objects/exp-xfade.axs b/objects/exp-xfade.axs new file mode 100644 index 0000000..926ddbb --- /dev/null +++ b/objects/exp-xfade.axs @@ -0,0 +1,226 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + no + + + + 0 + 31 + 1274 + 766 + + \ No newline at end of file diff --git a/objects/faust/karplus.axo b/objects/faust/karplus.axo new file mode 100644 index 0000000..60035a6 --- /dev/null +++ b/objects/faust/karplus.axo @@ -0,0 +1,98 @@ + + + Karplus (from Faust) + Ricardo Wurmus + GPL + filter.axh + + + + + + + + + + arm_math.h + + + > 2 + // now is 2^27 = 134 217 728 + // 2^32 = 4 294 967 296 + // 2^29 = 536 870 912 (3:29) + int32_t preout = int32_t(((f < 0) ? (-f) : f) * (1<<29)); + return ((f < 0) ? ~preout : preout); + } + // convert fixed point to float + // * invert bits if sign bit is set (0x08000000, or (1<<27)) + // * cast int to float + // * divide by constant to shift decimal point + // * multiply by -1 if sign bit was set + float frac32ToFloat(int32_t frac) { + bool neg = (((1<<27) & frac) != 0); + float res = (float)(neg ? frac : ~frac); + res = res / (float(1<<29)); + return (neg ? (-1 * res) : res); + } + + float fslider0; + float fVec0[2]; + float fRec1[2]; + int iRec2[2]; + float fslider1; + float fslider2; + int IOTA; + float fVec1[512]; + float fslider3; + float fRec0[3]; +]]> + + 0.0f)) - (fSlow0 * (fRec1[1] > 0.0f))); + iRec2[0] = (12345 + (1103515245 * iRec2[1])); + fVec1[IOTA&511] = ((fSlow3 * (fRec0[1] + fRec0[2])) + (fSlow2 * (iRec2[0] * (fRec1[0] > 0.0f)))); + fRec0[0] = fVec1[(IOTA-iSlow4)&511]; + +arm_float_to_q31(&fRec0[0], &output0[i], 0); +// output0[i] = floatToFrac32(fRec0[0]); + + // post processing + fRec0[2] = fRec0[1]; fRec0[1] = fRec0[0]; + IOTA = IOTA+1; + iRec2[1] = iRec2[0]; + fRec1[1] = fRec1[0]; + fVec0[1] = fVec0[0]; + } +]]> + + diff --git a/objects/faust/moog_vcf.axo b/objects/faust/moog_vcf.axo new file mode 100644 index 0000000..8abb697 --- /dev/null +++ b/objects/faust/moog_vcf.axo @@ -0,0 +1,205 @@ + + + Moog VCF (from Faust) + Ricardo Wurmus + GPL + filter.axh + + math.h + + + + + + + + + + > 2 + // now is 2^27 = 134 217 728 + // 2^32 = 4 294 967 296 + // 2^29 = 536 870 912 (3:29) + int32_t preout = int32_t(((f < 0) ? (-f) : f) * (1<<29)); + return ((f < 0) ? ~preout : preout); + } + // convert fixed point to float + // * invert bits if sign bit is set (0x08000000, or (1<<27)) + // * cast int to float + // * divide by constant to shift decimal point + // * multiply by -1 if sign bit was set + float frac32ToFloat(int32_t frac) { + bool neg = (((1<<27) & frac) != 0); + float res = (float)(neg ? frac : ~frac); + res = res / (float(1<<29)); + return (neg ? (-1 * res) : res); + } + + + float fslider0; + float fslider1; + float fslider2; + float fcheckbox0; + float fcheckbox1; + float fcheckbox2; + + float fRec0[2]; + float fRec1[2]; + float fRec2[2]; + float fRec3[2]; + float fRec4[2]; + float fRec5[2]; + float fRec6[3]; + float fRec7[3]; + float fRec8[2]; + float fRec10[2]; + float fRec11[2]; + float fRec13[2]; + float fRec14[2]; + + float fConst1; + float fConst2; + float fSqrtTwo; + inline float faustpower2(float x) { + return powf(x,2); + } + inline float faustpower4(float x) { + return powf(x,4); + } + + // template inline float faustpower(float x) { return powf(x,N); } + // template inline double faustpower(double x) { return pow(x,N); } + // template inline int faustpower(int x) { return faustpower(x) * faustpower(x); } + // template <> inline int faustpower<0>(int x) { return 1; } + // template <> inline int faustpower<1>(int x) { return x; } +]]> + + + + 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 + + Phaser Mono (from Faust) + Ricardo Wurmus + GPL + + + + + + + + + + + + + + + + ./phaser_mono_float.cpp + + + + + + diff --git a/objects/faust/phaser_mono_float.cpp b/objects/faust/phaser_mono_float.cpp new file mode 100644 index 0000000..d3cc774 --- /dev/null +++ b/objects/faust/phaser_mono_float.cpp @@ -0,0 +1,129 @@ +//----------------------------------------------------- +// name: "Phaser Mono" +// +// Code generated with Faust 0.9.67 (http://faust.grame.fr) +//----------------------------------------------------- +/* link with */ +#ifndef FAUSTPOWER +#define FAUSTPOWER +#define faustpower4(x) ((x)*(x)*(x)*(x)) +#define faustpower3(x) ((x)*(x)*(x)) +#define faustpower2(x) ((x)*(x)) +#define max(a, b) ((a) > (b) ? (a) : (b)) +#define min(a, b) ((a) < (b) ? (a) : (b)) +#endif +//---------------------------------------------------------------------------- +// FAUST generated signal processor +//---------------------------------------------------------------------------- + +#ifndef FAUSTFLOAT +#define FAUSTFLOAT float +#endif + +#ifndef FAUSTCLASS +#define FAUSTCLASS mydsp +#endif + +class Dsp { + private: + int iVec0[2]; + int iConst0; + float fConst1; + float fConst2; + FAUSTFLOAT speed; //default: 0.5f; range: 0..10 + float fConst3; + float fRec5[2]; + float fRec6[2]; + float fConst4; + float fConst5; + float fRec4[3]; + float fConst6; + float fRec3[3]; + float fConst7; + float fRec2[3]; + float fConst8; + float fRec1[3]; + float fRec0[2]; + public: + static void classInit(int samplingFreq) { + } + virtual void instanceInit(int samplingFreq) { + int fSamplingFreq = samplingFreq; + for (int i=0; i<2; i++) iVec0[i] = 0; + iConst0 = min(192000, max(1, fSamplingFreq)); + fConst1 = 0.9366460212365959; //expf((0 - (3141.592653589793f / float(iConst0)))); + fConst2 = faustpower2(fConst1); + speed = 0.5f; + fConst3 = (6.283185307179586f / float(iConst0)); + for (int i=0; i<2; i++) fRec5[i] = 0; + for (int i=0; i<2; i++) fRec6[i] = 0; + fConst4 = (2.0f / float(iConst0)); + fConst5 = (0 - (2 * fConst1)); + for (int i=0; i<3; i++) fRec4[i] = 0; + fConst6 = (4.0f / float(iConst0)); + for (int i=0; i<3; i++) fRec3[i] = 0; + fConst7 = (8.0f / float(iConst0)); + for (int i=0; i<3; i++) fRec2[i] = 0; + fConst8 = (16.0f / float(iConst0)); + for (int i=0; i<3; i++) fRec1[i] = 0; + for (int i=0; i<2; i++) fRec0[i] = 0; + } + virtual void init(int samplingFreq) { + classInit(samplingFreq); + instanceInit(samplingFreq); + } + // convert fixed point to float + // * invert bits if sign bit is set (0x08000000, or (1<<27)) + // * cast int to float + // * divide by constant to shift decimal point + // * multiply by -1 if sign bit was set + float ConvertFracToFloat(int32_t frac) { + bool neg = (((1<<27) & frac) != 0); + float res = (float)(neg ? frac : ~frac); + res = res / (float(1<<29)); + return (neg ? (-1 * res) : res); + } + + virtual void compute (int count, + const int32_t** input, + int32_t* output, + int32_t speed) { + float fSlow0 = 100; + float fSlow1 = 0.01f * fSlow0; + float fSlow2 = (fConst3 * 10*ConvertFracToFloat(speed)); + float fSlow3 = cosf(fSlow2); + float fSlow4 = sinf(fSlow2); + float fSlow5 = (0 - fSlow4); + float fSlow6 = (1 - (0.01f * fSlow0)); + const int32_t* input0 = *input; + int32_t* output0 = output; + for (int i=0; i + + Phaser Stereo (from Faust) + Ricardo Wurmus + GPL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ./phaser_stereo_float.cpp + + + + + + + diff --git a/objects/faust/phaser_stereo_float.cpp b/objects/faust/phaser_stereo_float.cpp new file mode 100644 index 0000000..9e3e587 --- /dev/null +++ b/objects/faust/phaser_stereo_float.cpp @@ -0,0 +1,215 @@ +//----------------------------------------------------- +// name: "Phaser" +// +// Code generated with Faust 0.9.67 (http://faust.grame.fr) +//----------------------------------------------------- +/* link with */ +#ifndef FAUSTPOWER +#define FAUSTPOWER +#define faustpower4(x) ((x)*(x)*(x)*(x)) +#define faustpower3(x) ((x)*(x)*(x)) +#define faustpower2(x) ((x)*(x)) +#define max(a, b) ((a) > (b) ? (a) : (b)) +#define min(a, b) ((a) < (b) ? (a) : (b)) +#endif +/************************************************************************ + ************************************************************************ + FAUST Architecture File + Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + + This is sample code. This file is provided as an example of minimal + FAUST architecture file. Redistribution and use in source and binary + forms, with or without modification, in part or in full are permitted. + In particular you can create a derived work of this FAUST architecture + and distribute that work under terms of your choice. + + This sample code is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + ************************************************************************ + ************************************************************************/ + + +/****************************************************************************** +******************************************************************************* + + VECTOR INTRINSICS + +******************************************************************************* +*******************************************************************************/ + + +/****************************************************************************** +******************************************************************************* + + ABSTRACT USER INTERFACE + +******************************************************************************* +*******************************************************************************/ + +//---------------------------------------------------------------------------- +// FAUST generated signal processor +//---------------------------------------------------------------------------- + +#ifndef FAUSTFLOAT +#define FAUSTFLOAT float +#endif + +class Dsp { +public: + int fSamplingFreq; + FAUSTFLOAT fslider0; + FAUSTFLOAT fcheckbox0; + FAUSTFLOAT fcheckbox1; + int iVec0[2]; + FAUSTFLOAT fslider1; + FAUSTFLOAT fslider2; + FAUSTFLOAT fslider3; + int iConst0; + float fConst1; + FAUSTFLOAT fslider4; + float fConst2; + float fRec5[2]; + float fRec6[2]; + FAUSTFLOAT fslider5; + FAUSTFLOAT fslider6; + FAUSTFLOAT fslider7; + float fRec4[3]; + float fRec3[3]; + float fRec2[3]; + float fRec1[3]; + float fRec0[2]; + float fRec11[3]; + float fRec10[3]; + float fRec9[3]; + float fRec8[3]; + float fRec7[2]; + + void instanceInit(int samplingFreq) { + fSamplingFreq = samplingFreq; + fslider0 = 1.0f; + fcheckbox0 = 0.0; + fcheckbox1 = 0.0; + for (int i=0; i<2; i++) iVec0[i] = 0; + fslider1 = 0.0f; + fslider2 = 0.0f; + fslider3 = 1e+03f; + iConst0 = min(192000, max(1, fSamplingFreq)); + fConst1 = (1.0f / float(iConst0)); + fslider4 = 0.5f; + fConst2 = (6.283185307179586f / float(iConst0)); + for (int i=0; i<2; i++) fRec5[i] = 0; + for (int i=0; i<2; i++) fRec6[i] = 0; + fslider5 = 1e+02f; + fslider6 = 8e+02f; + fslider7 = 1.5f; + for (int i=0; i<3; i++) fRec4[i] = 0; + for (int i=0; i<3; i++) fRec3[i] = 0; + for (int i=0; i<3; i++) fRec2[i] = 0; + for (int i=0; i<3; i++) fRec1[i] = 0; + for (int i=0; i<2; i++) fRec0[i] = 0; + for (int i=0; i<3; i++) fRec11[i] = 0; + for (int i=0; i<3; i++) fRec10[i] = 0; + for (int i=0; i<3; i++) fRec9[i] = 0; + for (int i=0; i<3; i++) fRec8[i] = 0; + for (int i=0; i<2; i++) fRec7[i] = 0; + } + void init(int samplingFreq) { + instanceInit(samplingFreq); + } + // convert fixed point to float + // * invert bits if sign bit is set (0x08000000, or (1<<27)) + // * cast int to float + // * divide by constant to shift decimal point + // * multiply by -1 if sign bit was set + float ConvertFracToFloat(int32_t frac) { + bool neg = (((1<<27) & frac) != 0); + float res = (float)(neg ? frac : ~frac); + res = res / (float(1<<29)); + return (neg ? (-1 * res) : res); + } + + void compute (int count, + const int32_t** input, + int32_t* left, + int32_t* right, + int param_fcheckbox0, + int param_fcheckbox1, + int param_fslider0, + int param_fslider1, + int param_fslider3, + int param_fslider4, + int param_fslider5, + int param_fslider6, + int param_fslider7) { + float fSlow0 = (0.5f * ((int(float(param_fcheckbox0)))?2:float(fslider0))); + float fSlow1 = ((int(float(param_fcheckbox1)))?(0 - fSlow0):fSlow0); + float fSlow2 = float(fslider1); + float fSlow3 = 10; //powf(10,(0.05f * float(fslider2))); + float fSlow4 = 0.8; //expf((fConst1 * (0 - (3.141592653589793f * float(fslider3))))); + float fSlow5 = faustpower2(fSlow4); + float fSlow6 = (fConst2 * 10*ConvertFracToFloat(param_fslider4)); + float fSlow7 = cosf(fSlow6); + float fSlow8 = sinf(fSlow6); + float fSlow9 = (0 - fSlow8); + float fSlow10 = float(fslider5); + float fSlow11 = (6.283185307179586f * fSlow10); + float fSlow12 = (0.5f * ((6.283185307179586f * max(fSlow10, float(fslider6))) - fSlow11)); + float fSlow13 = float(fslider7); + float fSlow14 = (fConst1 * fSlow13); + float fSlow15 = (0 - (2 * fSlow4)); + float fSlow16 = (fConst1 * faustpower2(fSlow13)); + float fSlow17 = (fConst1 * faustpower3(fSlow13)); + float fSlow18 = (fConst1 * faustpower4(fSlow13)); + float fSlow19 = (1 - fSlow0); + const int32_t* input0 = *input; + const int32_t* input1 = *input; + int32_t* output0 = left; + int32_t* output1 = right; + for (int i=0; i + + 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 + + diff --git a/objects/limiter.axs b/objects/limiter.axs new file mode 100644 index 0000000..e724c2a --- /dev/null +++ b/objects/limiter.axs @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + no + + + + -5 + 33 + 1290 + 772 + + \ No newline at end of file diff --git a/objects/murf.axs b/objects/murf.axs new file mode 100644 index 0000000..3c63eb2 --- /dev/null +++ b/objects/murf.axs @@ -0,0 +1,561 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + no + 1 + 8 + 32 + 8 + 8 + + + + 0 + 31 + 1280 + 769 + + \ No newline at end of file diff --git a/objects/octaver.axs b/objects/octaver.axs new file mode 100644 index 0000000..492038e --- /dev/null +++ b/objects/octaver.axs @@ -0,0 +1,238 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + no + 1 + 8 + 32 + 8 + 8 + Ricardo + GPL + + + + + 85 + 33 + 1276 + 771 + + \ No newline at end of file diff --git a/objects/pattern-editor.axs b/objects/pattern-editor.axs new file mode 100644 index 0000000..1b582c7 --- /dev/null +++ b/objects/pattern-editor.axs @@ -0,0 +1,278 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + no + + + + 0 + 33 + 1280 + 767 + + \ No newline at end of file diff --git a/objects/read-interp-slow.axo b/objects/read-interp-slow.axo new file mode 100644 index 0000000..2919a1f --- /dev/null +++ b/objects/read-interp-slow.axo @@ -0,0 +1,76 @@ + + + delay read slow, linear interpolated + Johannes Taelman + BSD + delay.axh + + + + + + + + + + + + + + + 256 (5.33ms) = 8 + 512 (10.66ms) = 9 + 1024 (21.33ms) = 10 + 2048 (42.66ms) = 11 + 4096 (85.33ms) = 12 + 8192 (170ms) = 13 + 16384 (341ms) = 14 + 32768 (682ms) = 15 +(/ 32768.0 48000) +48000 = 1000ms + + ,*/ + // Example: set LENGTHPOW to 12 + // shift tmp_d right by (- 27 12) = 15 + // This is supposed to give a number of samples in the past, before writepos + // As this runs in a loop over the input buffer we have BUFSIZE samples to process. + // Hence (- BUFSIZE + buffer_index -1) starts at -BUFSIZE and is the last sample at the end of the srate loop. + uint32_t tmp_di = attr_delayname.writepos - (tmp_d>>(27-attr_delayname.LENGTHPOW+1)) - BUFSIZE + buffer_index -1; + + // get delayed value from delay line + int32_t tmp_a1 = attr_delayname.array[tmp_di&attr_delayname.LENGTHMASK]<<16; + // get next delayed value from delay line + int32_t tmp_a2 = attr_delayname.array[(tmp_di+1)&attr_delayname.LENGTHMASK]<<16; + + // ? what does this value represent? + // shift tmp_d left by 18, then mask with max value. + uint32_t tmp_w1 = (tmp_d<<(attr_delayname.LENGTHPOW+3)) & 0x3FFFFFFF; + + // ? opposite of w1 + uint32_t tmp_w2 = (1<<30) - tmp_w1; + + // is this what's happening? + // out = (tmp_a2 * tmp_w2) + (tmp_a1 * tmp_w1) + + // multiply value with ...? + int32_t tmp_r = ___SMMUL(tmp_a1,tmp_w1); + + // ? + // multiply the values from tmp_a2 and tmp_w2, then add the value of + // tmp_r to the most significant 32 bits of the product + tmp_r = ___SMMLA(tmp_a2,tmp_w2,tmp_r); + outlet_out= tmp_a1;//tmp_r; +]]> + + diff --git a/objects/sel b 32 pulse.axo b/objects/sel b 32 pulse.axo new file mode 100644 index 0000000..33f52f0 --- /dev/null +++ b/objects/sel b 32 pulse.axo @@ -0,0 +1,29 @@ + + + select one out of 32 booleans, chainable. Pulse output. + Johannes Taelman + BSD + + + + + + + + + + + + + + + + =0)&&(inlet_in<32)) outlet_o=(in_prev!=inlet_in)&&(param_b32&(1< + + diff --git a/objects/sqrt-distortion.axs b/objects/sqrt-distortion.axs new file mode 100644 index 0000000..0853a04 --- /dev/null +++ b/objects/sqrt-distortion.axs @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + no + + + + -5 + 33 + 1280 + 767 + + \ No newline at end of file diff --git a/objects/wip/pitch_detect_fft.axo b/objects/wip/pitch_detect_fft.axo new file mode 100644 index 0000000..7692628 --- /dev/null +++ b/objects/wip/pitch_detect_fft.axo @@ -0,0 +1,179 @@ + + + spectral analyzer display using 128 input points fft + Johannes Taelman, Ricardo Wurmus + BSD + + + + + + + + + + > 2u; + + /* Run the below code for Cortex-M4 and Cortex-M3 */ + while(blkCnt > 0u) + { + /* Initialize maxVal to the next consecutive values one by one */ + maxVal1 = *pSrc++; + + maxVal2 = *pSrc++; + + /* compare for the maximum value */ + if(out < maxVal1) + { + /* Update the maximum value and its index */ + out = maxVal1; + outIndex = count + 1u; + } + + maxVal1 = *pSrc++; + + /* compare for the maximum value */ + if(out < maxVal2) + { + /* Update the maximum value and its index */ + out = maxVal2; + outIndex = count + 2u; + } + + maxVal2 = *pSrc++; + + /* compare for the maximum value */ + if(out < maxVal1) + { + /* Update the maximum value and its index */ + out = maxVal1; + outIndex = count + 3u; + } + + /* compare for the maximum value */ + if(out < maxVal2) + { + /* Update the maximum value and its index */ + out = maxVal2; + outIndex = count + 4u; + } + + count += 4u; + + /* Decrement the loop counter */ + blkCnt--; + } + + /* if (blockSize - 1u) is not multiple of 4 */ + blkCnt = (blockSize - 1u) % 4u; + +#else + + /* Run the below code for Cortex-M0 */ + q31_t maxVal1, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt, outIndex; /* loop counter */ + + /* Initialise the index value to zero. */ + outIndex = 0u; + /* Load first input value that act as reference value for comparision */ + out = *pSrc++; + + blkCnt = (blockSize - 1u); + +#endif /* #ifndef ARM_MATH_CM0_FAMILY */ + + while(blkCnt > 0u) + { + /* Initialize maxVal to the next consecutive values one by one */ + maxVal1 = *pSrc++; + + /* compare for the maximum value */ + if(out < maxVal1) + { + /* Update the maximum value and it's index */ + out = maxVal1; + outIndex = blockSize - blkCnt; + } + + /* Decrement the loop counter */ + blkCnt--; + + } + + /* Store the maximum value and its index into destination pointers */ + *pResult = out; + *pIndex = outIndex; +} + +]]> + + + + diff --git a/objects/xfade-env.axs b/objects/xfade-env.axs new file mode 100644 index 0000000..faccc3b --- /dev/null +++ b/objects/xfade-env.axs @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + no + + + + 0 + 31 + 1274 + 766 + + \ No newline at end of file -- cgit v1.2.3