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