pass sample by reference
This commit is contained in:
@@ -5,11 +5,9 @@ class wavefolder {
|
||||
public:
|
||||
float amount = 1.f;
|
||||
|
||||
float process_sample(float& _sample)
|
||||
void process_sample(float& _sample)
|
||||
{
|
||||
if (amount > 1.f) { return fold(_sample * amount); }
|
||||
|
||||
return 0.f;
|
||||
if (amount > 1.f) { _sample = fold(_sample * amount); }
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
// drifts and sounds better!
|
||||
if (envelope.is_busy()) {
|
||||
float osc = oscillator.process_sample(trigger, frequency, pm);
|
||||
osc = wavefolding.process_sample(osc);
|
||||
m_wavefolder.process_sample(osc);
|
||||
return osc * env * velocity;
|
||||
} else {
|
||||
return 0.;
|
||||
|
||||
Reference in New Issue
Block a user