8class SynthAudioProcessor final :
public juce::AudioProcessor, juce::AudioProcessorValueTreeState::Listener
16 void prepareToPlay(
double sampleRate,
int samplesPerBlock)
override;
17 void releaseResources()
override;
19 bool isBusesLayoutSupported(
const BusesLayout &layouts)
const override;
21 void processBlock(juce::AudioBuffer<float> &, juce::MidiBuffer &)
override;
22 using AudioProcessor::processBlock;
25 juce::AudioProcessorEditor *createEditor()
override;
26 bool hasEditor()
const override;
29 const juce::String getName()
const override;
31 bool acceptsMidi()
const override;
32 bool producesMidi()
const override;
33 bool isMidiEffect()
const override;
34 double getTailLengthSeconds()
const override;
37 int getNumPrograms()
override;
38 int getCurrentProgram()
override;
39 void setCurrentProgram(
int index)
override;
40 const juce::String getProgramName(
int index)
override;
41 void changeProgramName(
int index,
const juce::String &newName)
override;
44 void getStateInformation(juce::MemoryBlock &destData)
override;
45 void setStateInformation(
const void *data,
int sizeInBytes)
override;
47 void parameterChanged(
const juce::String ¶meter,
float newValue)
override;
49 juce::AudioProcessorValueTreeState parameters;
50 juce::MidiKeyboardState keyboardState;
53 std::atomic<bool> requiresUpdate{
false};
54 juce::Synthesiser synth;
55 static constexpr int numOfVoices = 3;
56 juce::AudioParameterInt* oscTypeParameter;