Hi All, I am new to JUCE and specifically coding an AU plugin and I’ve been closely following the JUCE tutorial for creating a basic Audio/MIDI plugin. I’ve become stuck at the following section:
Create a new public float variable called noteOnVel
in the processor class header. This is the variable that we will set with the slider.
public:
float noteOnVel;
We need to set this value whenever the slider is changed. To do this we use a slider listener callback function. Any class can inherit slider listener functionality but for the purposes of this tutorial we will add this functionality to the editor class.
Note
For a more in-depth description of listeners please see Tutorial: Listeners and Broadcasters.
Add the inheritance [2] and the default callback function [3] so the editor class looks like this:
class TutorialPluginAudioProcessorEditor : public juce::AudioProcessorEditor,
private juce::Slider::Listener // [2]
{
public:
TutorialPluginAudioProcessorEditor (TutorialPluginAudioProcessor&);
~TutorialPluginAudioProcessorEditor();
//==================================================================
// This is just a standard Juce paint method…
void paint (juce::Graphics& g) override;
void resized() override;
private:
void sliderValueChanged (juce::Slider* slider) override; // [3]
//==================================================================
// This reference is provided as a quick way for your editor to
// access the processor object that created it.
TutorialPluginAudioProcessor& audioProcessor;
juce::Slider midiVolume;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TutorialPluginAudioProcessorEditor)
};
My question is, where/how do I add the following float noteOnVel; ?
I’ve been trying to work out exactly where this should go in the processor class header as it isn’t clear in the documentation as to where or how this should be added. I hope someone can clarify this for me and thank you in advance for your help.
B