From fce86b22a2367f1be1f9aae5e1ba3d18d1371b74 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Tue, 8 Dec 2020 22:26:17 +0900 Subject: Renaming of files in preparation for code style tools. Signed-off-by: Michele Calgaro --- arts/modules/effects/freeverb/allpass.cpp | 2 +- arts/modules/effects/freeverb/allpass.h | 48 +++++++++++++++++ arts/modules/effects/freeverb/allpass.hpp | 48 ----------------- arts/modules/effects/freeverb/comb.cpp | 2 +- arts/modules/effects/freeverb/comb.h | 55 +++++++++++++++++++ arts/modules/effects/freeverb/comb.hpp | 55 ------------------- arts/modules/effects/freeverb/revmodel.cpp | 2 +- arts/modules/effects/freeverb/revmodel.h | 87 ++++++++++++++++++++++++++++++ arts/modules/effects/freeverb/revmodel.hpp | 87 ------------------------------ 9 files changed, 193 insertions(+), 193 deletions(-) create mode 100644 arts/modules/effects/freeverb/allpass.h delete mode 100644 arts/modules/effects/freeverb/allpass.hpp create mode 100644 arts/modules/effects/freeverb/comb.h delete mode 100644 arts/modules/effects/freeverb/comb.hpp create mode 100644 arts/modules/effects/freeverb/revmodel.h delete mode 100644 arts/modules/effects/freeverb/revmodel.hpp (limited to 'arts/modules/effects/freeverb') diff --git a/arts/modules/effects/freeverb/allpass.cpp b/arts/modules/effects/freeverb/allpass.cpp index ca4d8bc5..850337e3 100644 --- a/arts/modules/effects/freeverb/allpass.cpp +++ b/arts/modules/effects/freeverb/allpass.cpp @@ -4,7 +4,7 @@ // http://www.dreampoint.co.uk // This code is public domain -#include "allpass.hpp" +#include "allpass.h" allpass::allpass() { diff --git a/arts/modules/effects/freeverb/allpass.h b/arts/modules/effects/freeverb/allpass.h new file mode 100644 index 00000000..853c7d41 --- /dev/null +++ b/arts/modules/effects/freeverb/allpass.h @@ -0,0 +1,48 @@ +// Allpass filter declaration +// +// Written by Jezar at Dreampoint, June 2000 +// http://www.dreampoint.co.uk +// This code is public domain + +#ifndef _allpass_ +#define _allpass_ +#include "denormals.h" + +class allpass +{ +public: + allpass(); + void setbuffer(float *buf, int size); + inline float process(float inp); + void mute(); + void setfeedback(float val); + float getfeedback(); +// private: + float feedback; + float *buffer; + int bufsize; + int bufidx; +}; + + +// Big to inline - but crucial for speed + +inline float allpass::process(float input) +{ + float output; + float bufout; + + bufout = buffer[bufidx]; + undenormalise(bufout); + + output = -input + bufout; + buffer[bufidx] = input + (bufout*feedback); + + if(++bufidx>=bufsize) bufidx = 0; + + return output; +} + +#endif//_allpass + +//ends diff --git a/arts/modules/effects/freeverb/allpass.hpp b/arts/modules/effects/freeverb/allpass.hpp deleted file mode 100644 index 853c7d41..00000000 --- a/arts/modules/effects/freeverb/allpass.hpp +++ /dev/null @@ -1,48 +0,0 @@ -// Allpass filter declaration -// -// Written by Jezar at Dreampoint, June 2000 -// http://www.dreampoint.co.uk -// This code is public domain - -#ifndef _allpass_ -#define _allpass_ -#include "denormals.h" - -class allpass -{ -public: - allpass(); - void setbuffer(float *buf, int size); - inline float process(float inp); - void mute(); - void setfeedback(float val); - float getfeedback(); -// private: - float feedback; - float *buffer; - int bufsize; - int bufidx; -}; - - -// Big to inline - but crucial for speed - -inline float allpass::process(float input) -{ - float output; - float bufout; - - bufout = buffer[bufidx]; - undenormalise(bufout); - - output = -input + bufout; - buffer[bufidx] = input + (bufout*feedback); - - if(++bufidx>=bufsize) bufidx = 0; - - return output; -} - -#endif//_allpass - -//ends diff --git a/arts/modules/effects/freeverb/comb.cpp b/arts/modules/effects/freeverb/comb.cpp index c05f5069..62be706d 100644 --- a/arts/modules/effects/freeverb/comb.cpp +++ b/arts/modules/effects/freeverb/comb.cpp @@ -4,7 +4,7 @@ // http://www.dreampoint.co.uk // This code is public domain -#include "comb.hpp" +#include "comb.h" comb::comb() { diff --git a/arts/modules/effects/freeverb/comb.h b/arts/modules/effects/freeverb/comb.h new file mode 100644 index 00000000..4a73b615 --- /dev/null +++ b/arts/modules/effects/freeverb/comb.h @@ -0,0 +1,55 @@ +// Comb filter class declaration +// +// Written by Jezar at Dreampoint, June 2000 +// http://www.dreampoint.co.uk +// This code is public domain + +#ifndef _comb_ +#define _comb_ + +#include "denormals.h" + +class comb +{ +public: + comb(); + void setbuffer(float *buf, int size); + inline float process(float inp); + void mute(); + void setdamp(float val); + float getdamp(); + void setfeedback(float val); + float getfeedback(); +private: + float feedback; + float filterstore; + float damp1; + float damp2; + float *buffer; + int bufsize; + int bufidx; +}; + + +// Big to inline - but crucial for speed + +inline float comb::process(float input) +{ + float output; + + output = buffer[bufidx]; + undenormalise(output); + + filterstore = (output*damp2) + (filterstore*damp1); + undenormalise(filterstore); + + buffer[bufidx] = input + (filterstore*feedback); + + if(++bufidx>=bufsize) bufidx = 0; + + return output; +} + +#endif //_comb_ + +//ends diff --git a/arts/modules/effects/freeverb/comb.hpp b/arts/modules/effects/freeverb/comb.hpp deleted file mode 100644 index 4a73b615..00000000 --- a/arts/modules/effects/freeverb/comb.hpp +++ /dev/null @@ -1,55 +0,0 @@ -// Comb filter class declaration -// -// Written by Jezar at Dreampoint, June 2000 -// http://www.dreampoint.co.uk -// This code is public domain - -#ifndef _comb_ -#define _comb_ - -#include "denormals.h" - -class comb -{ -public: - comb(); - void setbuffer(float *buf, int size); - inline float process(float inp); - void mute(); - void setdamp(float val); - float getdamp(); - void setfeedback(float val); - float getfeedback(); -private: - float feedback; - float filterstore; - float damp1; - float damp2; - float *buffer; - int bufsize; - int bufidx; -}; - - -// Big to inline - but crucial for speed - -inline float comb::process(float input) -{ - float output; - - output = buffer[bufidx]; - undenormalise(output); - - filterstore = (output*damp2) + (filterstore*damp1); - undenormalise(filterstore); - - buffer[bufidx] = input + (filterstore*feedback); - - if(++bufidx>=bufsize) bufidx = 0; - - return output; -} - -#endif //_comb_ - -//ends diff --git a/arts/modules/effects/freeverb/revmodel.cpp b/arts/modules/effects/freeverb/revmodel.cpp index 23a766cc..3688dd34 100644 --- a/arts/modules/effects/freeverb/revmodel.cpp +++ b/arts/modules/effects/freeverb/revmodel.cpp @@ -4,7 +4,7 @@ // http://www.dreampoint.co.uk // This code is public domain -#include "revmodel.hpp" +#include "revmodel.h" revmodel::revmodel() { diff --git a/arts/modules/effects/freeverb/revmodel.h b/arts/modules/effects/freeverb/revmodel.h new file mode 100644 index 00000000..aec39dfe --- /dev/null +++ b/arts/modules/effects/freeverb/revmodel.h @@ -0,0 +1,87 @@ +// Reverb model declaration +// +// Written by Jezar at Dreampoint, June 2000 +// http://www.dreampoint.co.uk +// This code is public domain + +#ifndef _revmodel_ +#define _revmodel_ + +#include "comb.h" +#include "allpass.h" +#include "tuning.h" + +class revmodel +{ +public: + revmodel(); + void mute(); + void processmix(float *inputL, float *inputR, float *outputL, float *outputR, long numsamples, int skip); + void processreplace(float *inputL, float *inputR, float *outputL, float *outputR, long numsamples, int skip); + void setroomsize(float value); + float getroomsize(); + void setdamp(float value); + float getdamp(); + void setwet(float value); + float getwet(); + void setdry(float value); + float getdry(); + void setwidth(float value); + float getwidth(); + void setmode(float value); + float getmode(); +private: + void update(); +private: + float gain; + float roomsize,roomsize1; + float damp,damp1; + float wet,wet1,wet2; + float dry; + float width; + float mode; + + // The following are all declared inline + // to remove the need for dynamic allocation + // with its subsequent error-checking messiness + + // Comb filters + comb combL[numcombs]; + comb combR[numcombs]; + + // Allpass filters + allpass allpassL[numallpasses]; + allpass allpassR[numallpasses]; + + // Buffers for the combs + float bufcombL1[combtuningL1]; + float bufcombR1[combtuningR1]; + float bufcombL2[combtuningL2]; + float bufcombR2[combtuningR2]; + float bufcombL3[combtuningL3]; + float bufcombR3[combtuningR3]; + float bufcombL4[combtuningL4]; + float bufcombR4[combtuningR4]; + float bufcombL5[combtuningL5]; + float bufcombR5[combtuningR5]; + float bufcombL6[combtuningL6]; + float bufcombR6[combtuningR6]; + float bufcombL7[combtuningL7]; + float bufcombR7[combtuningR7]; + float bufcombL8[combtuningL8]; + float bufcombR8[combtuningR8]; + + // Buffers for the allpasses + float bufallpassL1[allpasstuningL1]; + float bufallpassR1[allpasstuningR1]; + float bufallpassL2[allpasstuningL2]; + float bufallpassR2[allpasstuningR2]; + float bufallpassL3[allpasstuningL3]; + float bufallpassR3[allpasstuningR3]; + float bufallpassL4[allpasstuningL4]; + float bufallpassR4[allpasstuningR4]; +}; + +#endif//_revmodel_ + +//ends diff --git a/arts/modules/effects/freeverb/revmodel.hpp b/arts/modules/effects/freeverb/revmodel.hpp deleted file mode 100644 index ca6c89a0..00000000 --- a/arts/modules/effects/freeverb/revmodel.hpp +++ /dev/null @@ -1,87 +0,0 @@ -// Reverb model declaration -// -// Written by Jezar at Dreampoint, June 2000 -// http://www.dreampoint.co.uk -// This code is public domain - -#ifndef _revmodel_ -#define _revmodel_ - -#include "comb.hpp" -#include "allpass.hpp" -#include "tuning.h" - -class revmodel -{ -public: - revmodel(); - void mute(); - void processmix(float *inputL, float *inputR, float *outputL, float *outputR, long numsamples, int skip); - void processreplace(float *inputL, float *inputR, float *outputL, float *outputR, long numsamples, int skip); - void setroomsize(float value); - float getroomsize(); - void setdamp(float value); - float getdamp(); - void setwet(float value); - float getwet(); - void setdry(float value); - float getdry(); - void setwidth(float value); - float getwidth(); - void setmode(float value); - float getmode(); -private: - void update(); -private: - float gain; - float roomsize,roomsize1; - float damp,damp1; - float wet,wet1,wet2; - float dry; - float width; - float mode; - - // The following are all declared inline - // to remove the need for dynamic allocation - // with its subsequent error-checking messiness - - // Comb filters - comb combL[numcombs]; - comb combR[numcombs]; - - // Allpass filters - allpass allpassL[numallpasses]; - allpass allpassR[numallpasses]; - - // Buffers for the combs - float bufcombL1[combtuningL1]; - float bufcombR1[combtuningR1]; - float bufcombL2[combtuningL2]; - float bufcombR2[combtuningR2]; - float bufcombL3[combtuningL3]; - float bufcombR3[combtuningR3]; - float bufcombL4[combtuningL4]; - float bufcombR4[combtuningR4]; - float bufcombL5[combtuningL5]; - float bufcombR5[combtuningR5]; - float bufcombL6[combtuningL6]; - float bufcombR6[combtuningR6]; - float bufcombL7[combtuningL7]; - float bufcombR7[combtuningR7]; - float bufcombL8[combtuningL8]; - float bufcombR8[combtuningR8]; - - // Buffers for the allpasses - float bufallpassL1[allpasstuningL1]; - float bufallpassR1[allpasstuningR1]; - float bufallpassL2[allpasstuningL2]; - float bufallpassR2[allpasstuningR2]; - float bufallpassL3[allpasstuningL3]; - float bufallpassR3[allpasstuningR3]; - float bufallpassL4[allpasstuningL4]; - float bufallpassR4[allpasstuningR4]; -}; - -#endif//_revmodel_ - -//ends -- cgit v1.2.3