diff --git a/examples/Plugins/AUv3SynthPluginDemo.h b/examples/Plugins/AUv3SynthPluginDemo.h index 8b58bd22b0..ff2dd341cf 100644 --- a/examples/Plugins/AUv3SynthPluginDemo.h +++ b/examples/Plugins/AUv3SynthPluginDemo.h @@ -317,8 +317,8 @@ public: currentRecording (1, 1), currentProgram (0) { // initialize parameters - addParameter (isRecordingParam = new AudioParameterBool ("isRecording", "Is Recording", false)); - addParameter (roomSizeParam = new AudioParameterFloat ("roomSize", "Room Size", 0.0f, 1.0f, 0.5f)); + addParameter (isRecordingParam = new AudioParameterBool ({ "isRecording", 1 }, "Is Recording", false)); + addParameter (roomSizeParam = new AudioParameterFloat ({ "roomSize", 1 }, "Room Size", 0.0f, 1.0f, 0.5f)); formatManager.registerBasicFormats(); diff --git a/examples/Plugins/ArpeggiatorPluginDemo.h b/examples/Plugins/ArpeggiatorPluginDemo.h index 831e949d8a..803630f1b1 100644 --- a/examples/Plugins/ArpeggiatorPluginDemo.h +++ b/examples/Plugins/ArpeggiatorPluginDemo.h @@ -60,7 +60,7 @@ public: Arpeggiator() : AudioProcessor (BusesProperties()) // add no audio buses at all { - addParameter (speed = new AudioParameterFloat ("speed", "Arpeggiator Speed", 0.0, 1.0, 0.5)); + addParameter (speed = new AudioParameterFloat ({ "speed", 1 }, "Arpeggiator Speed", 0.0, 1.0, 0.5)); } //============================================================================== diff --git a/examples/Plugins/AudioPluginDemo.h b/examples/Plugins/AudioPluginDemo.h index f4acc5236e..3b19e8c0f9 100644 --- a/examples/Plugins/AudioPluginDemo.h +++ b/examples/Plugins/AudioPluginDemo.h @@ -182,8 +182,8 @@ public: JuceDemoPluginAudioProcessor() : AudioProcessor (getBusesProperties()), state (*this, nullptr, "state", - { std::make_unique ("gain", "Gain", NormalisableRange (0.0f, 1.0f), 0.9f), - std::make_unique ("delay", "Delay Feedback", NormalisableRange (0.0f, 1.0f), 0.5f) }) + { std::make_unique (ParameterID { "gain", 1 }, "Gain", NormalisableRange (0.0f, 1.0f), 0.9f), + std::make_unique (ParameterID { "delay", 1 }, "Delay Feedback", NormalisableRange (0.0f, 1.0f), 0.5f) }) { // Add a sub-tree to store the state of our UI state.state.addChild ({ "uiState", { { "width", 400 }, { "height", 200 } }, {} }, -1, nullptr); diff --git a/examples/Plugins/DSPModulePluginDemo.h b/examples/Plugins/DSPModulePluginDemo.h index edfa54256c..b141df5bef 100644 --- a/examples/Plugins/DSPModulePluginDemo.h +++ b/examples/Plugins/DSPModulePluginDemo.h @@ -240,6 +240,7 @@ public: int getCurrentIRSize() const { return irSize; } using Parameter = AudioProcessorValueTreeState::Parameter; + using Attributes = AudioProcessorValueTreeStateParameterAttributes; // This struct holds references to the raw parameters, so that we don't have to search // the APVTS (involving string comparisons and map lookups!) every time a parameter @@ -261,45 +262,52 @@ public: template static Param& addToLayout (Group& layout, Ts&&... ts) { - auto param = std::make_unique (std::forward (ts)...); + auto param = new Param (std::forward (ts)...); auto& ref = *param; - add (layout, std::move (param)); + add (layout, rawToUniquePtr (param)); return ref; } - static String valueToTextFunction (float x) { return String (x, 2); } + static String valueToTextFunction (float x, int) { return String (x, 2); } static float textToValueFunction (const String& str) { return str.getFloatValue(); } - static String valueToTextPanFunction (float x) { return getPanningTextForValue ((x + 100.0f) / 200.0f); } + static auto getBasicAttributes() + { + return Attributes().withStringFromValueFunction (valueToTextFunction) + .withValueFromStringFunction (textToValueFunction); + } + + static auto getDbAttributes() { return getBasicAttributes().withLabel ("dB"); } + static auto getMsAttributes() { return getBasicAttributes().withLabel ("ms"); } + static auto getHzAttributes() { return getBasicAttributes().withLabel ("Hz"); } + static auto getPercentageAttributes() { return getBasicAttributes().withLabel ("%"); } + static auto getRatioAttributes() { return getBasicAttributes().withLabel (":1"); } + + static String valueToTextPanFunction (float x, int) { return getPanningTextForValue ((x + 100.0f) / 200.0f); } static float textToValuePanFunction (const String& str) { return getPanningValueForText (str) * 200.0f - 100.0f; } struct MainGroup { explicit MainGroup (AudioProcessorParameterGroup& layout) : inputGain (addToLayout (layout, - ID::inputGain, + ParameterID { ID::inputGain, 1 }, "Input", - "dB", NormalisableRange (-40.0f, 40.0f), 0.0f, - valueToTextFunction, - textToValueFunction)), + getDbAttributes())), outputGain (addToLayout (layout, - ID::outputGain, + ParameterID { ID::outputGain, 1 }, "Output", - "dB", NormalisableRange (-40.0f, 40.0f), 0.0f, - valueToTextFunction, - textToValueFunction)), + getDbAttributes())), pan (addToLayout (layout, - ID::pan, + ParameterID { ID::pan, 1 }, "Panning", - "", NormalisableRange (-100.0f, 100.0f), 0.0f, - valueToTextPanFunction, - textToValuePanFunction)) {} + Attributes().withStringFromValueFunction (valueToTextPanFunction) + .withValueFromStringFunction (textToValuePanFunction))) {} Parameter& inputGain; Parameter& outputGain; @@ -310,57 +318,46 @@ public: { explicit DistortionGroup (AudioProcessorParameterGroup& layout) : enabled (addToLayout (layout, - ID::distortionEnabled, + ParameterID { ID::distortionEnabled, 1 }, "Distortion", - true, - "")), + true)), type (addToLayout (layout, - ID::distortionType, + ParameterID { ID::distortionType, 1 }, "Waveshaper", StringArray { "std::tanh", "Approx. tanh" }, 0)), inGain (addToLayout (layout, - ID::distortionInGain, + ParameterID { ID::distortionInGain, 1 }, "Gain", - "dB", NormalisableRange (-40.0f, 40.0f), 0.0f, - valueToTextFunction, - textToValueFunction)), + getDbAttributes())), lowpass (addToLayout (layout, - ID::distortionLowpass, + ParameterID { ID::distortionLowpass, 1 }, "Post Low-pass", - "Hz", NormalisableRange (20.0f, 22000.0f, 0.0f, 0.25f), 22000.0f, - valueToTextFunction, - textToValueFunction)), + getHzAttributes())), highpass (addToLayout (layout, - ID::distortionHighpass, + ParameterID { ID::distortionHighpass, 1 }, "Pre High-pass", - "Hz", NormalisableRange (20.0f, 22000.0f, 0.0f, 0.25f), 20.0f, - valueToTextFunction, - textToValueFunction)), + getHzAttributes())), compGain (addToLayout (layout, - ID::distortionCompGain, + ParameterID { ID::distortionCompGain, 1 }, "Compensat.", - "dB", NormalisableRange (-40.0f, 40.0f), 0.0f, - valueToTextFunction, - textToValueFunction)), + getDbAttributes())), mix (addToLayout (layout, - ID::distortionMix, + ParameterID { ID::distortionMix, 1 }, "Mix", - "%", NormalisableRange (0.0f, 100.0f), 100.0f, - valueToTextFunction, - textToValueFunction)), + getPercentageAttributes())), oversampler (addToLayout (layout, - ID::distortionOversampler, + ParameterID { ID::distortionOversampler, 1 }, "Oversampling", StringArray { "2X", "4X", @@ -384,34 +381,27 @@ public: { explicit MultiBandGroup (AudioProcessorParameterGroup& layout) : enabled (addToLayout (layout, - ID::multiBandEnabled, + ParameterID { ID::multiBandEnabled, 1 }, "Multi-band", - false, - "")), + false)), freq (addToLayout (layout, - ID::multiBandFreq, + ParameterID { ID::multiBandFreq, 1 }, "Sep. Freq.", - "Hz", NormalisableRange (20.0f, 22000.0f, 0.0f, 0.25f), 2000.0f, - valueToTextFunction, - textToValueFunction)), + getHzAttributes())), lowVolume (addToLayout (layout, - ID::multiBandLowVolume, + ParameterID { ID::multiBandLowVolume, 1 }, "Low volume", - "dB", NormalisableRange (-40.0f, 40.0f), 0.0f, - valueToTextFunction, - textToValueFunction)), + getDbAttributes())), highVolume (addToLayout (layout, - ID::multiBandHighVolume, + ParameterID { ID::multiBandHighVolume, 1 }, "High volume", - "dB", NormalisableRange (-40.0f, 40.0f), 0.0f, - valueToTextFunction, - textToValueFunction)) {} + getDbAttributes())) {} AudioParameterBool& enabled; Parameter& freq; @@ -423,23 +413,19 @@ public: { explicit ConvolutionGroup (AudioProcessorParameterGroup& layout) : cabEnabled (addToLayout (layout, - ID::convolutionCabEnabled, + ParameterID { ID::convolutionCabEnabled, 1 }, "Cabinet", - false, - "")), + false)), reverbEnabled (addToLayout (layout, - ID::convolutionReverbEnabled, + ParameterID { ID::convolutionReverbEnabled, 1 }, "Reverb", - false, - "")), + false)), reverbMix (addToLayout (layout, - ID::convolutionReverbMix, + ParameterID { ID::convolutionReverbMix, 1 }, "Reverb Mix", - "%", NormalisableRange (0.0f, 100.0f), 50.0f, - valueToTextFunction, - textToValueFunction)) {} + getPercentageAttributes())) {} AudioParameterBool& cabEnabled; AudioParameterBool& reverbEnabled; @@ -450,42 +436,33 @@ public: { explicit CompressorGroup (AudioProcessorParameterGroup& layout) : enabled (addToLayout (layout, - ID::compressorEnabled, + ParameterID { ID::compressorEnabled, 1 }, "Comp.", - false, - "")), + false)), threshold (addToLayout (layout, - ID::compressorThreshold, + ParameterID { ID::compressorThreshold, 1 }, "Threshold", - "dB", NormalisableRange (-100.0f, 0.0f), 0.0f, - valueToTextFunction, - textToValueFunction)), + getDbAttributes())), ratio (addToLayout (layout, - ID::compressorRatio, + ParameterID { ID::compressorRatio, 1 }, "Ratio", - ":1", NormalisableRange (1.0f, 100.0f, 0.0f, 0.25f), 1.0f, - valueToTextFunction, - textToValueFunction)), + getRatioAttributes())), attack (addToLayout (layout, - ID::compressorAttack, + ParameterID { ID::compressorAttack, 1 }, "Attack", - "ms", NormalisableRange (0.01f, 1000.0f, 0.0f, 0.25f), 1.0f, - valueToTextFunction, - textToValueFunction)), + getMsAttributes())), release (addToLayout (layout, - ID::compressorRelease, + ParameterID { ID::compressorRelease, 1 }, "Release", - "ms", NormalisableRange (10.0f, 10000.0f, 0.0f, 0.25f), 100.0f, - valueToTextFunction, - textToValueFunction)) {} + getMsAttributes())) {} AudioParameterBool& enabled; Parameter& threshold; @@ -498,42 +475,33 @@ public: { explicit NoiseGateGroup (AudioProcessorParameterGroup& layout) : enabled (addToLayout (layout, - ID::noiseGateEnabled, + ParameterID { ID::noiseGateEnabled, 1 }, "Gate", - false, - "")), + false)), threshold (addToLayout (layout, - ID::noiseGateThreshold, + ParameterID { ID::noiseGateThreshold, 1 }, "Threshold", - "dB", NormalisableRange (-100.0f, 0.0f), -100.0f, - valueToTextFunction, - textToValueFunction)), + getDbAttributes())), ratio (addToLayout (layout, - ID::noiseGateRatio, + ParameterID { ID::noiseGateRatio, 1 }, "Ratio", - ":1", NormalisableRange (1.0f, 100.0f, 0.0f, 0.25f), 10.0f, - valueToTextFunction, - textToValueFunction)), + getRatioAttributes())), attack (addToLayout (layout, - ID::noiseGateAttack, + ParameterID { ID::noiseGateAttack, 1 }, "Attack", - "ms", NormalisableRange (0.01f, 1000.0f, 0.0f, 0.25f), 1.0f, - valueToTextFunction, - textToValueFunction)), + getMsAttributes())), release (addToLayout (layout, - ID::noiseGateRelease, + ParameterID { ID::noiseGateRelease, 1 }, "Release", - "ms", NormalisableRange (10.0f, 10000.0f, 0.0f, 0.25f), 100.0f, - valueToTextFunction, - textToValueFunction)) {} + getMsAttributes())) {} AudioParameterBool& enabled; Parameter& threshold; @@ -546,26 +514,21 @@ public: { explicit LimiterGroup (AudioProcessorParameterGroup& layout) : enabled (addToLayout (layout, - ID::limiterEnabled, + ParameterID { ID::limiterEnabled, 1 }, "Limiter", - false, - "")), + false)), threshold (addToLayout (layout, - ID::limiterThreshold, + ParameterID { ID::limiterThreshold, 1 }, "Threshold", - "dB", NormalisableRange (-40.0f, 0.0f), 0.0f, - valueToTextFunction, - textToValueFunction)), + getDbAttributes())), release (addToLayout (layout, - ID::limiterRelease, + ParameterID { ID::limiterRelease, 1 }, "Release", - "ms", NormalisableRange (10.0f, 10000.0f, 0.0f, 0.25f), 100.0f, - valueToTextFunction, - textToValueFunction)) {} + getMsAttributes())) {} AudioParameterBool& enabled; Parameter& threshold; @@ -576,39 +539,32 @@ public: { explicit DirectDelayGroup (AudioProcessorParameterGroup& layout) : enabled (addToLayout (layout, - ID::directDelayEnabled, + ParameterID { ID::directDelayEnabled, 1 }, "DL Dir.", - false, - "")), + false)), type (addToLayout (layout, - ID::directDelayType, + ParameterID { ID::directDelayType, 1 }, "DL Type", StringArray { "None", "Linear", "Lagrange", "Thiran" }, 1)), value (addToLayout (layout, - ID::directDelayValue, + ParameterID { ID::directDelayValue, 1 }, "Delay", - "smps", NormalisableRange (0.0f, 44100.0f), 0.0f, - valueToTextFunction, - textToValueFunction)), + getBasicAttributes().withLabel ("smps"))), smoothing (addToLayout (layout, - ID::directDelaySmoothing, + ParameterID { ID::directDelaySmoothing, 1 }, "Smooth", - "ms", NormalisableRange (20.0f, 10000.0f, 0.0f, 0.25f), 200.0f, - valueToTextFunction, - textToValueFunction)), + getMsAttributes())), mix (addToLayout (layout, - ID::directDelayMix, + ParameterID { ID::directDelayMix, 1 }, "Delay Mix", - "%", NormalisableRange (0.0f, 100.0f), 50.0f, - valueToTextFunction, - textToValueFunction)) {} + getPercentageAttributes())) {} AudioParameterBool& enabled; AudioParameterChoice& type; @@ -621,55 +577,44 @@ public: { explicit DelayEffectGroup (AudioProcessorParameterGroup& layout) : enabled (addToLayout (layout, - ID::delayEffectEnabled, + ParameterID { ID::delayEffectEnabled, 1 }, "DL Effect", - false, - "")), + false)), type (addToLayout (layout, - ID::delayEffectType, + ParameterID { ID::delayEffectType, 1 }, "DL Type", StringArray { "None", "Linear", "Lagrange", "Thiran" }, 1)), value (addToLayout (layout, - ID::delayEffectValue, + ParameterID { ID::delayEffectValue, 1 }, "Delay", - "ms", NormalisableRange (0.01f, 1000.0f), 100.0f, - valueToTextFunction, - textToValueFunction)), + getMsAttributes())), smoothing (addToLayout (layout, - ID::delayEffectSmoothing, + ParameterID { ID::delayEffectSmoothing, 1 }, "Smooth", - "ms", NormalisableRange (20.0f, 10000.0f, 0.0f, 0.25f), 400.0f, - valueToTextFunction, - textToValueFunction)), + getMsAttributes())), lowpass (addToLayout (layout, - ID::delayEffectLowpass, + ParameterID { ID::delayEffectLowpass, 1 }, "Low-pass", - "Hz", NormalisableRange (20.0f, 22000.0f, 0.0f, 0.25f), 22000.0f, - valueToTextFunction, - textToValueFunction)), + getHzAttributes())), mix (addToLayout (layout, - ID::delayEffectMix, + ParameterID { ID::delayEffectMix, 1 }, "Delay Mix", - "%", NormalisableRange (0.0f, 100.0f), 50.0f, - valueToTextFunction, - textToValueFunction)), + getPercentageAttributes())), feedback (addToLayout (layout, - ID::delayEffectFeedback, + ParameterID { ID::delayEffectFeedback, 1 }, "Feedback", - "dB", NormalisableRange (-100.0f, 0.0f), -100.0f, - valueToTextFunction, - textToValueFunction)) {} + getDbAttributes())) {} AudioParameterBool& enabled; AudioParameterChoice& type; @@ -684,50 +629,39 @@ public: { explicit PhaserGroup (AudioProcessorParameterGroup& layout) : enabled (addToLayout (layout, - ID::phaserEnabled, + ParameterID { ID::phaserEnabled, 1 }, "Phaser", - false, - "")), + false)), rate (addToLayout (layout, - ID::phaserRate, + ParameterID { ID::phaserRate, 1 }, "Rate", - "Hz", NormalisableRange (0.05f, 20.0f, 0.0f, 0.25f), 1.0f, - valueToTextFunction, - textToValueFunction)), + getHzAttributes())), depth (addToLayout (layout, - ID::phaserDepth, + ParameterID { ID::phaserDepth, 1 }, "Depth", - "%", NormalisableRange (0.0f, 100.0f), 50.0f, - valueToTextFunction, - textToValueFunction)), + getPercentageAttributes())), centreFrequency (addToLayout (layout, - ID::phaserCentreFrequency, + ParameterID { ID::phaserCentreFrequency, 1 }, "Center", - "Hz", NormalisableRange (20.0f, 20000.0f, 0.0f, 0.25f), 600.0f, - valueToTextFunction, - textToValueFunction)), + getHzAttributes())), feedback (addToLayout (layout, - ID::phaserFeedback, + ParameterID { ID::phaserFeedback, 1 }, "Feedback", - "%", NormalisableRange (0.0f, 100.0f), 50.0f, - valueToTextFunction, - textToValueFunction)), + getPercentageAttributes())), mix (addToLayout (layout, - ID::phaserMix, + ParameterID { ID::phaserMix, 1 }, "Mix", - "%", NormalisableRange (0.0f, 100.0f), 50.0f, - valueToTextFunction, - textToValueFunction)) {} + getPercentageAttributes())) {} AudioParameterBool& enabled; Parameter& rate; @@ -741,50 +675,39 @@ public: { explicit ChorusGroup (AudioProcessorParameterGroup& layout) : enabled (addToLayout (layout, - ID::chorusEnabled, + ParameterID { ID::chorusEnabled, 1 }, "Chorus", - false, - "")), + false)), rate (addToLayout (layout, - ID::chorusRate, + ParameterID { ID::chorusRate, 1 }, "Rate", - "Hz", NormalisableRange (0.05f, 20.0f, 0.0f, 0.25f), 1.0f, - valueToTextFunction, - textToValueFunction)), + getHzAttributes())), depth (addToLayout (layout, - ID::chorusDepth, + ParameterID { ID::chorusDepth, 1 }, "Depth", - "%", NormalisableRange (0.0f, 100.0f), 50.0f, - valueToTextFunction, - textToValueFunction)), + getPercentageAttributes())), centreDelay (addToLayout (layout, - ID::chorusCentreDelay, + ParameterID { ID::chorusCentreDelay, 1 }, "Center", - "ms", NormalisableRange (1.0f, 100.0f, 0.0f, 0.25f), 7.0f, - valueToTextFunction, - textToValueFunction)), + getMsAttributes())), feedback (addToLayout (layout, - ID::chorusFeedback, + ParameterID { ID::chorusFeedback, 1 }, "Feedback", - "%", NormalisableRange (0.0f, 100.0f), 50.0f, - valueToTextFunction, - textToValueFunction)), + getPercentageAttributes())), mix (addToLayout (layout, - ID::chorusMix, + ParameterID { ID::chorusMix, 1 }, "Mix", - "%", NormalisableRange (0.0f, 100.0f), 50.0f, - valueToTextFunction, - textToValueFunction)) {} + getPercentageAttributes())) {} AudioParameterBool& enabled; Parameter& rate; @@ -798,39 +721,32 @@ public: { explicit LadderGroup (AudioProcessorParameterGroup& layout) : enabled (addToLayout (layout, - ID::ladderEnabled, + ParameterID { ID::ladderEnabled, 1 }, "Ladder", - false, - "")), + false)), mode (addToLayout (layout, - ID::ladderMode, + ParameterID { ID::ladderMode, 1 }, "Mode", StringArray { "LP12", "LP24", "HP12", "HP24", "BP12", "BP24" }, 1)), cutoff (addToLayout (layout, - ID::ladderCutoff, + ParameterID { ID::ladderCutoff, 1 }, "Frequency", - "Hz", NormalisableRange (10.0f, 22000.0f, 0.0f, 0.25f), 1000.0f, - valueToTextFunction, - textToValueFunction)), + getHzAttributes())), resonance (addToLayout (layout, - ID::ladderResonance, + ParameterID { ID::ladderResonance, 1 }, "Resonance", - "%", NormalisableRange (0.0f, 100.0f), 0.0f, - valueToTextFunction, - textToValueFunction)), + getPercentageAttributes())), drive (addToLayout (layout, - ID::ladderDrive, + ParameterID { ID::ladderDrive, 1 }, "Drive", - "dB", NormalisableRange (0.0f, 40.0f), 0.0f, - valueToTextFunction, - textToValueFunction)) {} + getDbAttributes())) {} AudioParameterBool& enabled; AudioParameterChoice& mode; diff --git a/examples/Plugins/GainPluginDemo.h b/examples/Plugins/GainPluginDemo.h index ac8348e831..964cbecb0d 100644 --- a/examples/Plugins/GainPluginDemo.h +++ b/examples/Plugins/GainPluginDemo.h @@ -59,7 +59,7 @@ public: : AudioProcessor (BusesProperties().withInput ("Input", AudioChannelSet::stereo()) .withOutput ("Output", AudioChannelSet::stereo())) { - addParameter (gain = new AudioParameterFloat ("gain", "Gain", 0.0f, 1.0f, 0.5f)); + addParameter (gain = new AudioParameterFloat ({ "gain", 1 }, "Gain", 0.0f, 1.0f, 0.5f)); } //============================================================================== diff --git a/examples/Plugins/InterAppAudioEffectPluginDemo.h b/examples/Plugins/InterAppAudioEffectPluginDemo.h index 4435dcf8b8..fd82480f16 100644 --- a/examples/Plugins/InterAppAudioEffectPluginDemo.h +++ b/examples/Plugins/InterAppAudioEffectPluginDemo.h @@ -122,7 +122,7 @@ public: .withInput ("Input", AudioChannelSet::stereo(), true) .withOutput ("Output", AudioChannelSet::stereo(), true)), parameters (*this, nullptr, "InterAppAudioEffect", - { std::make_unique ("gain", "Gain", NormalisableRange (0.0f, 1.0f), 1.0f / 3.14f) }) + { std::make_unique (ParameterID { "gain", 1 }, "Gain", NormalisableRange (0.0f, 1.0f), 1.0f / 3.14f) }) { } diff --git a/examples/Plugins/NoiseGatePluginDemo.h b/examples/Plugins/NoiseGatePluginDemo.h index 06f3bdd21f..791e9b2d58 100644 --- a/examples/Plugins/NoiseGatePluginDemo.h +++ b/examples/Plugins/NoiseGatePluginDemo.h @@ -59,8 +59,8 @@ public: .withOutput ("Output", AudioChannelSet::stereo()) .withInput ("Sidechain", AudioChannelSet::stereo())) { - addParameter (threshold = new AudioParameterFloat ("threshold", "Threshold", 0.0f, 1.0f, 0.5f)); - addParameter (alpha = new AudioParameterFloat ("alpha", "Alpha", 0.0f, 1.0f, 0.8f)); + addParameter (threshold = new AudioParameterFloat ({ "threshold", 1 }, "Threshold", 0.0f, 1.0f, 0.5f)); + addParameter (alpha = new AudioParameterFloat ({ "alpha", 1 }, "Alpha", 0.0f, 1.0f, 0.8f)); } //============================================================================== diff --git a/examples/Plugins/ReaperEmbeddedViewPluginDemo.h b/examples/Plugins/ReaperEmbeddedViewPluginDemo.h index 2d5b2659b9..596b1930e3 100644 --- a/examples/Plugins/ReaperEmbeddedViewPluginDemo.h +++ b/examples/Plugins/ReaperEmbeddedViewPluginDemo.h @@ -190,7 +190,7 @@ class ReaperEmbeddedViewDemo : public AudioProcessor, public: ReaperEmbeddedViewDemo() { - addParameter (gain = new AudioParameterFloat ("gain", "Gain", 0.0f, 1.0f, 0.5f)); + addParameter (gain = new AudioParameterFloat ({ "gain", 1 }, "Gain", 0.0f, 1.0f, 0.5f)); startTimerHz (60); }