3 #include "AudioConfig.h"
4 #include "AudioTools/CoreAudio/AudioEffects/AudioEffect.h"
6 # include "freertos/FreeRTOS.h"
26 template <
class StkCls,
class T>
33 this->p_instrument = &instrument;
36 void setInput(StkCls &instrument){
37 this->p_instrument = &instrument;
62 if (p_instrument!=
nullptr) {
63 result = p_instrument->tick()*max_value;
69 StkCls *p_instrument=
nullptr;
78 template <
class StkCls>
86 generator.setInput(instrument);
89 void setInput(StkCls &instrument){
90 generator.setInput(instrument);
93 void setInput(StkCls *instrument){
94 generator.setInput(*instrument);
121 STKEffect(stk::Effect &stkEffect) { p_effect = &stkEffect; }
125 float value =
static_cast<float>(in) / 32767.0;
126 return p_effect->tick(value) * 32767.0;
130 stk::Effect *p_effect =
nullptr;
141 STKChorus(
float baseDelay = 6000) : stk::Chorus(baseDelay) {}
150 float value =
static_cast<float>(in) / 32767.0;
151 return stk::Chorus::tick(value) * 32767.0;
163 STKEcho(
unsigned long maximumDelay = (
unsigned long)Stk::sampleRate())
164 : stk::Echo(maximumDelay) {}
173 float value =
static_cast<float>(in) / 32767.0;
174 return stk::Echo::tick(value) * 32767.0;
193 float value =
static_cast<float>(in) / 32767.0;
194 return stk::FreeVerb::tick(value) * 32767.0;
214 float value =
static_cast<float>(in) / 32767.0;
215 return stk::JCRev::tick(value) * 32767.0;
234 float value =
static_cast<float>(in) / 32767.0;
235 return stk::NRev::tick(value) * 32767.0;
254 float value =
static_cast<float>(in) / 32767.0;
255 return stk::PRCRev::tick(value) * 32767.0;
268 : stk::LentPitShift(periodRatio, tMax) {}
276 float value =
static_cast<float>(in) / 32767.0;
277 return stk::LentPitShift::tick(value) * 32767.0;
298 float value =
static_cast<float>(in) / 32767.0;
299 return stk::PitShift::tick(value) * 32767.0;