Skip to content

Commit

Permalink
minor changes to SynthsiserVoice implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
hsetlik committed Apr 24, 2021
1 parent 7429d4b commit e74ba3d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Binary file modified .DS_Store
Binary file not shown.
18 changes: 9 additions & 9 deletions Source/FmVoice.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,23 @@ class FmVoice : public juce::SynthesiserVoice
{
printf("Voice #: %d -- %d total jumps\n", voiceIndex, numJumps);
}
bool canPlaySound(juce::SynthesiserSound* sound)
bool canPlaySound(juce::SynthesiserSound* sound) override
{
return dynamic_cast<FmSound*>(sound) != nullptr;
}

void startNote (int midiNoteNumber,
float velocity,
juce::SynthesiserSound *sound,
int currentPitchWheelPosition)
int currentPitchWheelPosition) override
{
fundamental = convert::mtof(midiNoteNumber);
for(Operator* i : operators)
{
i->envelope.triggerOn();
}
}
void stopNote (float velocity, bool allowTailOff)
void stopNote (float velocity, bool allowTailOff) override
{
for(Operator* i : operators)
{
Expand All @@ -70,17 +70,17 @@ class FmVoice : public juce::SynthesiserVoice
i->updateSampleRate(newRate);
}
}
void pitchWheelMoved(int newPitchWheelVal) {}
void pitchWheelMoved(int newPitchWheelVal) override {}
//=============================================
void controllerMoved(int controllerNumber, int controllerValue) {}
void controllerMoved(int controllerNumber, int controllerValue) override{}
//===============================================
void aftertouchChanged (int newAftertouchValue) {}
void aftertouchChanged (int newAftertouchValue) override{}
//==============================================
void channelPressureChanged (int newChannelPressureValue) {}
void channelPressureChanged (int newChannelPressureValue) override{}
//===============================================
void renderNextBlock (juce::AudioBuffer<float> &outputBuffer, int startSample, int numSamples);
void renderNextBlock (juce::AudioBuffer<float> &outputBuffer, int startSample, int numSamples) override;
//==============================================
void setCurrentPlaybackSampleRate (double newRate)
void setCurrentPlaybackSampleRate (double newRate) override
{
setSampleRate(newRate);
}
Expand Down

0 comments on commit e74ba3d

Please sign in to comment.