- num diffusion steps is template param
- Contructor: use initializer list for delays per diffusion step
- added param for feedback delay min and max
This commit is contained in:
2025-11-09 22:32:20 +01:00
parent e481f5215e
commit 8cfd39f245
2 changed files with 7 additions and 6 deletions
+6 -5
View File
@@ -4,6 +4,7 @@
#include <cstdlib>
#include <delay/buffer_multi.hpp>
#include <common/mix.hpp>
#include <initializer_list>
template<typename T, size_t numCh>
class Delay
@@ -109,18 +110,18 @@ class Diffusor
}
};
template<typename T, uint numCh>
template<typename T, uint numCh, uint numSteps>
class Reverb
{
std::array<Diffusor<T, numCh>, 3> m_diffusors;
std::vector<Diffusor<T, numCh>> m_diffusors;
Delay<T, numCh> m_feedbackDly;
T fb_dly_out[numCh];
T fb_gain;
public:
Reverb(uint maxDelay)
: m_diffusors({maxDelay, maxDelay, maxDelay})
, m_feedbackDly(9600, 4800)
Reverb(std::initializer_list<Diffusor<T, numCh>> maxDelay, uint fb_dly_min, uint fb_dly_max)
: m_diffusors(maxDelay)
, m_feedbackDly(fb_dly_max, fb_dly_min)
, fb_gain(0)
{
for (int c=0; c < numCh; c++)
+1 -1
View File
@@ -136,7 +136,7 @@ void test_reverb()
std::cout << "----------------------------------------------" << std::endl;
std::cout << "test_reverb()" << std::endl;
Reverb<double, 8> rev(32);
Reverb<double, 8, 3> rev({32}, 1, 2);
float data_in[10] = {1, 2, 3, 4, 5, 6, 7,8, 9, 10};
float data_out[10] = {0, 0, 0, 0, 0, 0, 0,0, 0, 0};