Separate out transmogrifier settings
This commit is contained in:
parent
20dfc0c378
commit
7392fcfbdb
3 changed files with 53 additions and 15 deletions
10
plugin.cc
10
plugin.cc
|
@ -1,6 +1,11 @@
|
|||
#include "plugin.hh"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "util.hh"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace Dynamite {
|
||||
void Drive::run(uint32_t n_samples) {
|
||||
const float coeff = dbCo(*p(p_drive));
|
||||
|
@ -8,6 +13,8 @@ namespace Dynamite {
|
|||
const float gainCoeff = dbCo(*p(p_gain));
|
||||
const float mix = *p(p_mix);
|
||||
const float algoMix = *p(p_algorithm_mix);
|
||||
const float transmogrifier = dbCo(*p(p_transmogrify_gain));
|
||||
const float transmogrifyThreshold = dbCo(*p(p_transmogrify_threshold));
|
||||
|
||||
const float *input = p(p_audio_in);
|
||||
float *output = p(p_audio_out);
|
||||
|
@ -23,9 +30,10 @@ namespace Dynamite {
|
|||
|
||||
dist = dist * gainCoeff;
|
||||
|
||||
float transmogrifier = threshCoeff * gainCoeff;
|
||||
float transmogrified = (input[pos] < 0 ? -transmogrifier : transmogrifier);
|
||||
|
||||
if(abs(input[pos]) < transmogrifyThreshold) transmogrified = 0;
|
||||
|
||||
output[pos] = (mix * ((algoMix * transmogrified) + ((1.0 - algoMix) * dist))) + ((1.0 - mix) * input[pos] * gainCoeff);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue