Has anyone gotten the exercise to add a 3rd oscillator working in the Intro to DSP tutorial?
I just duplicated the step to add the 2nd:
I get an error stating:
juce::dsp::gain has no member “setFrequency”
void noteStarted() override
{
auto velocity = getCurrentlyPlayingNote().noteOnVelocity.asUnsignedFloat();
auto freqHz = (float)getCurrentlyPlayingNote().getFrequencyInHertz();
processorChain.get<osc1Index>().setFrequency(freqHz, true);
processorChain.get<osc1Index>().setLevel(velocity);
processorChain.get<osc2Index>().setFrequency(freqHz * 1.01f, true);
processorChain.get<osc2Index>().setLevel(velocity);
processorChain.get<osc3Index>().setFrequency(freqHz * -1.01f, true);
processorChain.get<osc3Index>().setLevel(velocity);
}
void notePitchbendChanged() override
{
auto freqHz = (float)getCurrentlyPlayingNote().getFrequencyInHertz();
processorChain.get<osc1Index>().setFrequency(freqHz);
processorChain.get<osc2Index>().setFrequency(freqHz * 1.01f);
processorChain.get<osc3Index>().setFrequency(freqHz * -1.01f);
}
enum
{
osc1Index,
osc2Index,
osc3Index,
masterGainIndex
};
I looked through the code and looked for typos, or if there were some limit to t he amount of voices, oscillators etc, but didn’t find anything.
Has anyone worked this out?