Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion OrcaChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class OrcaChannel {
OrcaTonegen* tonegen;
Filter* filter1;
Filter* filter2;
Filter* filter3;

ADSR *adsr;

Expand All @@ -35,9 +36,12 @@ class OrcaChannel {
this->config = config;
this->lfo = lfo;
this->modWheel = modWheel;
double noResonance = 0.0;
tonegen = new OrcaTonegen(&note, &config->samplerate, &config->range, &modifyAmount, &pulseWidth, &config->pulseMix, &config->sawMix, &config->subMix, &config->subType, &config->noiseMix);
filter1 = new Filter( &config->samplerate, &filterOctave, &config->filterResonance, &config->filterLfo);
filter2 = new Filter( &config->samplerate, &filterOctave, &config->filterResonance, &config->filterLfo);
filter3 = new Filter( &config->samplerate, &filterOctave, &noResonance, &config->filterLfo);

adsr = new ADSR(&config->samplerate, &config->attack, &config->decay, &config->sustain, &config->release);
};

Expand Down Expand Up @@ -84,7 +88,7 @@ class OrcaChannel {
}

const double raw_tone = tonegen->Tick();
const double filtered = filter1->Tick(filter2->Tick(raw_tone));
const double filtered = filter1->Tick(filter2->Tick(filter2->Tick(raw_tone)));

const double attenuation = 1.0 - envelope;
const double enveloped = filtered * envelope * velocity;
Expand Down