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)
|
||||
{
|
||||
// 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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -182,8 +182,8 @@ public:
|
|||
JuceDemoPluginAudioProcessor()
|
||||
: AudioProcessor (getBusesProperties()),
|
||||
state (*this, nullptr, "state",
|
||||
{ std::make_unique<AudioParameterFloat> ("gain", "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 { "gain", 1 }, "Gain", NormalisableRange<float> (0.0f, 1.0f), 0.9f),
|
||||
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
|
||||
state.state.addChild ({ "uiState", { { "width", 400 }, { "height", 200 } }, {} }, -1, nullptr);
|
||||
|
|
|
|||
|
|
@ -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 <typename Param, typename Group, typename... 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;
|
||||
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<Parameter> (layout,
|
||||
ID::inputGain,
|
||||
ParameterID { ID::inputGain, 1 },
|
||||
"Input",
|
||||
"dB",
|
||||
NormalisableRange<float> (-40.0f, 40.0f),
|
||||
0.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getDbAttributes())),
|
||||
outputGain (addToLayout<Parameter> (layout,
|
||||
ID::outputGain,
|
||||
ParameterID { ID::outputGain, 1 },
|
||||
"Output",
|
||||
"dB",
|
||||
NormalisableRange<float> (-40.0f, 40.0f),
|
||||
0.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getDbAttributes())),
|
||||
pan (addToLayout<Parameter> (layout,
|
||||
ID::pan,
|
||||
ParameterID { ID::pan, 1 },
|
||||
"Panning",
|
||||
"",
|
||||
NormalisableRange<float> (-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<AudioParameterBool> (layout,
|
||||
ID::distortionEnabled,
|
||||
ParameterID { ID::distortionEnabled, 1 },
|
||||
"Distortion",
|
||||
true,
|
||||
"")),
|
||||
true)),
|
||||
type (addToLayout<AudioParameterChoice> (layout,
|
||||
ID::distortionType,
|
||||
ParameterID { ID::distortionType, 1 },
|
||||
"Waveshaper",
|
||||
StringArray { "std::tanh", "Approx. tanh" },
|
||||
0)),
|
||||
inGain (addToLayout<Parameter> (layout,
|
||||
ID::distortionInGain,
|
||||
ParameterID { ID::distortionInGain, 1 },
|
||||
"Gain",
|
||||
"dB",
|
||||
NormalisableRange<float> (-40.0f, 40.0f),
|
||||
0.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getDbAttributes())),
|
||||
lowpass (addToLayout<Parameter> (layout,
|
||||
ID::distortionLowpass,
|
||||
ParameterID { ID::distortionLowpass, 1 },
|
||||
"Post Low-pass",
|
||||
"Hz",
|
||||
NormalisableRange<float> (20.0f, 22000.0f, 0.0f, 0.25f),
|
||||
22000.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getHzAttributes())),
|
||||
highpass (addToLayout<Parameter> (layout,
|
||||
ID::distortionHighpass,
|
||||
ParameterID { ID::distortionHighpass, 1 },
|
||||
"Pre High-pass",
|
||||
"Hz",
|
||||
NormalisableRange<float> (20.0f, 22000.0f, 0.0f, 0.25f),
|
||||
20.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getHzAttributes())),
|
||||
compGain (addToLayout<Parameter> (layout,
|
||||
ID::distortionCompGain,
|
||||
ParameterID { ID::distortionCompGain, 1 },
|
||||
"Compensat.",
|
||||
"dB",
|
||||
NormalisableRange<float> (-40.0f, 40.0f),
|
||||
0.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getDbAttributes())),
|
||||
mix (addToLayout<Parameter> (layout,
|
||||
ID::distortionMix,
|
||||
ParameterID { ID::distortionMix, 1 },
|
||||
"Mix",
|
||||
"%",
|
||||
NormalisableRange<float> (0.0f, 100.0f),
|
||||
100.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getPercentageAttributes())),
|
||||
oversampler (addToLayout<AudioParameterChoice> (layout,
|
||||
ID::distortionOversampler,
|
||||
ParameterID { ID::distortionOversampler, 1 },
|
||||
"Oversampling",
|
||||
StringArray { "2X",
|
||||
"4X",
|
||||
|
|
@ -384,34 +381,27 @@ public:
|
|||
{
|
||||
explicit MultiBandGroup (AudioProcessorParameterGroup& layout)
|
||||
: enabled (addToLayout<AudioParameterBool> (layout,
|
||||
ID::multiBandEnabled,
|
||||
ParameterID { ID::multiBandEnabled, 1 },
|
||||
"Multi-band",
|
||||
false,
|
||||
"")),
|
||||
false)),
|
||||
freq (addToLayout<Parameter> (layout,
|
||||
ID::multiBandFreq,
|
||||
ParameterID { ID::multiBandFreq, 1 },
|
||||
"Sep. Freq.",
|
||||
"Hz",
|
||||
NormalisableRange<float> (20.0f, 22000.0f, 0.0f, 0.25f),
|
||||
2000.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getHzAttributes())),
|
||||
lowVolume (addToLayout<Parameter> (layout,
|
||||
ID::multiBandLowVolume,
|
||||
ParameterID { ID::multiBandLowVolume, 1 },
|
||||
"Low volume",
|
||||
"dB",
|
||||
NormalisableRange<float> (-40.0f, 40.0f),
|
||||
0.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getDbAttributes())),
|
||||
highVolume (addToLayout<Parameter> (layout,
|
||||
ID::multiBandHighVolume,
|
||||
ParameterID { ID::multiBandHighVolume, 1 },
|
||||
"High volume",
|
||||
"dB",
|
||||
NormalisableRange<float> (-40.0f, 40.0f),
|
||||
0.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)) {}
|
||||
getDbAttributes())) {}
|
||||
|
||||
AudioParameterBool& enabled;
|
||||
Parameter& freq;
|
||||
|
|
@ -423,23 +413,19 @@ public:
|
|||
{
|
||||
explicit ConvolutionGroup (AudioProcessorParameterGroup& layout)
|
||||
: cabEnabled (addToLayout<AudioParameterBool> (layout,
|
||||
ID::convolutionCabEnabled,
|
||||
ParameterID { ID::convolutionCabEnabled, 1 },
|
||||
"Cabinet",
|
||||
false,
|
||||
"")),
|
||||
false)),
|
||||
reverbEnabled (addToLayout<AudioParameterBool> (layout,
|
||||
ID::convolutionReverbEnabled,
|
||||
ParameterID { ID::convolutionReverbEnabled, 1 },
|
||||
"Reverb",
|
||||
false,
|
||||
"")),
|
||||
false)),
|
||||
reverbMix (addToLayout<Parameter> (layout,
|
||||
ID::convolutionReverbMix,
|
||||
ParameterID { ID::convolutionReverbMix, 1 },
|
||||
"Reverb Mix",
|
||||
"%",
|
||||
NormalisableRange<float> (0.0f, 100.0f),
|
||||
50.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)) {}
|
||||
getPercentageAttributes())) {}
|
||||
|
||||
AudioParameterBool& cabEnabled;
|
||||
AudioParameterBool& reverbEnabled;
|
||||
|
|
@ -450,42 +436,33 @@ public:
|
|||
{
|
||||
explicit CompressorGroup (AudioProcessorParameterGroup& layout)
|
||||
: enabled (addToLayout<AudioParameterBool> (layout,
|
||||
ID::compressorEnabled,
|
||||
ParameterID { ID::compressorEnabled, 1 },
|
||||
"Comp.",
|
||||
false,
|
||||
"")),
|
||||
false)),
|
||||
threshold (addToLayout<Parameter> (layout,
|
||||
ID::compressorThreshold,
|
||||
ParameterID { ID::compressorThreshold, 1 },
|
||||
"Threshold",
|
||||
"dB",
|
||||
NormalisableRange<float> (-100.0f, 0.0f),
|
||||
0.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getDbAttributes())),
|
||||
ratio (addToLayout<Parameter> (layout,
|
||||
ID::compressorRatio,
|
||||
ParameterID { ID::compressorRatio, 1 },
|
||||
"Ratio",
|
||||
":1",
|
||||
NormalisableRange<float> (1.0f, 100.0f, 0.0f, 0.25f),
|
||||
1.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getRatioAttributes())),
|
||||
attack (addToLayout<Parameter> (layout,
|
||||
ID::compressorAttack,
|
||||
ParameterID { ID::compressorAttack, 1 },
|
||||
"Attack",
|
||||
"ms",
|
||||
NormalisableRange<float> (0.01f, 1000.0f, 0.0f, 0.25f),
|
||||
1.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getMsAttributes())),
|
||||
release (addToLayout<Parameter> (layout,
|
||||
ID::compressorRelease,
|
||||
ParameterID { ID::compressorRelease, 1 },
|
||||
"Release",
|
||||
"ms",
|
||||
NormalisableRange<float> (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<AudioParameterBool> (layout,
|
||||
ID::noiseGateEnabled,
|
||||
ParameterID { ID::noiseGateEnabled, 1 },
|
||||
"Gate",
|
||||
false,
|
||||
"")),
|
||||
false)),
|
||||
threshold (addToLayout<Parameter> (layout,
|
||||
ID::noiseGateThreshold,
|
||||
ParameterID { ID::noiseGateThreshold, 1 },
|
||||
"Threshold",
|
||||
"dB",
|
||||
NormalisableRange<float> (-100.0f, 0.0f),
|
||||
-100.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getDbAttributes())),
|
||||
ratio (addToLayout<Parameter> (layout,
|
||||
ID::noiseGateRatio,
|
||||
ParameterID { ID::noiseGateRatio, 1 },
|
||||
"Ratio",
|
||||
":1",
|
||||
NormalisableRange<float> (1.0f, 100.0f, 0.0f, 0.25f),
|
||||
10.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getRatioAttributes())),
|
||||
attack (addToLayout<Parameter> (layout,
|
||||
ID::noiseGateAttack,
|
||||
ParameterID { ID::noiseGateAttack, 1 },
|
||||
"Attack",
|
||||
"ms",
|
||||
NormalisableRange<float> (0.01f, 1000.0f, 0.0f, 0.25f),
|
||||
1.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getMsAttributes())),
|
||||
release (addToLayout<Parameter> (layout,
|
||||
ID::noiseGateRelease,
|
||||
ParameterID { ID::noiseGateRelease, 1 },
|
||||
"Release",
|
||||
"ms",
|
||||
NormalisableRange<float> (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<AudioParameterBool> (layout,
|
||||
ID::limiterEnabled,
|
||||
ParameterID { ID::limiterEnabled, 1 },
|
||||
"Limiter",
|
||||
false,
|
||||
"")),
|
||||
false)),
|
||||
threshold (addToLayout<Parameter> (layout,
|
||||
ID::limiterThreshold,
|
||||
ParameterID { ID::limiterThreshold, 1 },
|
||||
"Threshold",
|
||||
"dB",
|
||||
NormalisableRange<float> (-40.0f, 0.0f),
|
||||
0.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getDbAttributes())),
|
||||
release (addToLayout<Parameter> (layout,
|
||||
ID::limiterRelease,
|
||||
ParameterID { ID::limiterRelease, 1 },
|
||||
"Release",
|
||||
"ms",
|
||||
NormalisableRange<float> (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<AudioParameterBool> (layout,
|
||||
ID::directDelayEnabled,
|
||||
ParameterID { ID::directDelayEnabled, 1 },
|
||||
"DL Dir.",
|
||||
false,
|
||||
"")),
|
||||
false)),
|
||||
type (addToLayout<AudioParameterChoice> (layout,
|
||||
ID::directDelayType,
|
||||
ParameterID { ID::directDelayType, 1 },
|
||||
"DL Type",
|
||||
StringArray { "None", "Linear", "Lagrange", "Thiran" },
|
||||
1)),
|
||||
value (addToLayout<Parameter> (layout,
|
||||
ID::directDelayValue,
|
||||
ParameterID { ID::directDelayValue, 1 },
|
||||
"Delay",
|
||||
"smps",
|
||||
NormalisableRange<float> (0.0f, 44100.0f),
|
||||
0.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getBasicAttributes().withLabel ("smps"))),
|
||||
smoothing (addToLayout<Parameter> (layout,
|
||||
ID::directDelaySmoothing,
|
||||
ParameterID { ID::directDelaySmoothing, 1 },
|
||||
"Smooth",
|
||||
"ms",
|
||||
NormalisableRange<float> (20.0f, 10000.0f, 0.0f, 0.25f),
|
||||
200.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getMsAttributes())),
|
||||
mix (addToLayout<Parameter> (layout,
|
||||
ID::directDelayMix,
|
||||
ParameterID { ID::directDelayMix, 1 },
|
||||
"Delay Mix",
|
||||
"%",
|
||||
NormalisableRange<float> (0.0f, 100.0f),
|
||||
50.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)) {}
|
||||
getPercentageAttributes())) {}
|
||||
|
||||
AudioParameterBool& enabled;
|
||||
AudioParameterChoice& type;
|
||||
|
|
@ -621,55 +577,44 @@ public:
|
|||
{
|
||||
explicit DelayEffectGroup (AudioProcessorParameterGroup& layout)
|
||||
: enabled (addToLayout<AudioParameterBool> (layout,
|
||||
ID::delayEffectEnabled,
|
||||
ParameterID { ID::delayEffectEnabled, 1 },
|
||||
"DL Effect",
|
||||
false,
|
||||
"")),
|
||||
false)),
|
||||
type (addToLayout<AudioParameterChoice> (layout,
|
||||
ID::delayEffectType,
|
||||
ParameterID { ID::delayEffectType, 1 },
|
||||
"DL Type",
|
||||
StringArray { "None", "Linear", "Lagrange", "Thiran" },
|
||||
1)),
|
||||
value (addToLayout<Parameter> (layout,
|
||||
ID::delayEffectValue,
|
||||
ParameterID { ID::delayEffectValue, 1 },
|
||||
"Delay",
|
||||
"ms",
|
||||
NormalisableRange<float> (0.01f, 1000.0f),
|
||||
100.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getMsAttributes())),
|
||||
smoothing (addToLayout<Parameter> (layout,
|
||||
ID::delayEffectSmoothing,
|
||||
ParameterID { ID::delayEffectSmoothing, 1 },
|
||||
"Smooth",
|
||||
"ms",
|
||||
NormalisableRange<float> (20.0f, 10000.0f, 0.0f, 0.25f),
|
||||
400.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getMsAttributes())),
|
||||
lowpass (addToLayout<Parameter> (layout,
|
||||
ID::delayEffectLowpass,
|
||||
ParameterID { ID::delayEffectLowpass, 1 },
|
||||
"Low-pass",
|
||||
"Hz",
|
||||
NormalisableRange<float> (20.0f, 22000.0f, 0.0f, 0.25f),
|
||||
22000.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getHzAttributes())),
|
||||
mix (addToLayout<Parameter> (layout,
|
||||
ID::delayEffectMix,
|
||||
ParameterID { ID::delayEffectMix, 1 },
|
||||
"Delay Mix",
|
||||
"%",
|
||||
NormalisableRange<float> (0.0f, 100.0f),
|
||||
50.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getPercentageAttributes())),
|
||||
feedback (addToLayout<Parameter> (layout,
|
||||
ID::delayEffectFeedback,
|
||||
ParameterID { ID::delayEffectFeedback, 1 },
|
||||
"Feedback",
|
||||
"dB",
|
||||
NormalisableRange<float> (-100.0f, 0.0f),
|
||||
-100.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)) {}
|
||||
getDbAttributes())) {}
|
||||
|
||||
AudioParameterBool& enabled;
|
||||
AudioParameterChoice& type;
|
||||
|
|
@ -684,50 +629,39 @@ public:
|
|||
{
|
||||
explicit PhaserGroup (AudioProcessorParameterGroup& layout)
|
||||
: enabled (addToLayout<AudioParameterBool> (layout,
|
||||
ID::phaserEnabled,
|
||||
ParameterID { ID::phaserEnabled, 1 },
|
||||
"Phaser",
|
||||
false,
|
||||
"")),
|
||||
false)),
|
||||
rate (addToLayout<Parameter> (layout,
|
||||
ID::phaserRate,
|
||||
ParameterID { ID::phaserRate, 1 },
|
||||
"Rate",
|
||||
"Hz",
|
||||
NormalisableRange<float> (0.05f, 20.0f, 0.0f, 0.25f),
|
||||
1.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getHzAttributes())),
|
||||
depth (addToLayout<Parameter> (layout,
|
||||
ID::phaserDepth,
|
||||
ParameterID { ID::phaserDepth, 1 },
|
||||
"Depth",
|
||||
"%",
|
||||
NormalisableRange<float> (0.0f, 100.0f),
|
||||
50.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getPercentageAttributes())),
|
||||
centreFrequency (addToLayout<Parameter> (layout,
|
||||
ID::phaserCentreFrequency,
|
||||
ParameterID { ID::phaserCentreFrequency, 1 },
|
||||
"Center",
|
||||
"Hz",
|
||||
NormalisableRange<float> (20.0f, 20000.0f, 0.0f, 0.25f),
|
||||
600.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getHzAttributes())),
|
||||
feedback (addToLayout<Parameter> (layout,
|
||||
ID::phaserFeedback,
|
||||
ParameterID { ID::phaserFeedback, 1 },
|
||||
"Feedback",
|
||||
"%",
|
||||
NormalisableRange<float> (0.0f, 100.0f),
|
||||
50.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getPercentageAttributes())),
|
||||
mix (addToLayout<Parameter> (layout,
|
||||
ID::phaserMix,
|
||||
ParameterID { ID::phaserMix, 1 },
|
||||
"Mix",
|
||||
"%",
|
||||
NormalisableRange<float> (0.0f, 100.0f),
|
||||
50.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)) {}
|
||||
getPercentageAttributes())) {}
|
||||
|
||||
AudioParameterBool& enabled;
|
||||
Parameter& rate;
|
||||
|
|
@ -741,50 +675,39 @@ public:
|
|||
{
|
||||
explicit ChorusGroup (AudioProcessorParameterGroup& layout)
|
||||
: enabled (addToLayout<AudioParameterBool> (layout,
|
||||
ID::chorusEnabled,
|
||||
ParameterID { ID::chorusEnabled, 1 },
|
||||
"Chorus",
|
||||
false,
|
||||
"")),
|
||||
false)),
|
||||
rate (addToLayout<Parameter> (layout,
|
||||
ID::chorusRate,
|
||||
ParameterID { ID::chorusRate, 1 },
|
||||
"Rate",
|
||||
"Hz",
|
||||
NormalisableRange<float> (0.05f, 20.0f, 0.0f, 0.25f),
|
||||
1.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getHzAttributes())),
|
||||
depth (addToLayout<Parameter> (layout,
|
||||
ID::chorusDepth,
|
||||
ParameterID { ID::chorusDepth, 1 },
|
||||
"Depth",
|
||||
"%",
|
||||
NormalisableRange<float> (0.0f, 100.0f),
|
||||
50.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getPercentageAttributes())),
|
||||
centreDelay (addToLayout<Parameter> (layout,
|
||||
ID::chorusCentreDelay,
|
||||
ParameterID { ID::chorusCentreDelay, 1 },
|
||||
"Center",
|
||||
"ms",
|
||||
NormalisableRange<float> (1.0f, 100.0f, 0.0f, 0.25f),
|
||||
7.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getMsAttributes())),
|
||||
feedback (addToLayout<Parameter> (layout,
|
||||
ID::chorusFeedback,
|
||||
ParameterID { ID::chorusFeedback, 1 },
|
||||
"Feedback",
|
||||
"%",
|
||||
NormalisableRange<float> (0.0f, 100.0f),
|
||||
50.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getPercentageAttributes())),
|
||||
mix (addToLayout<Parameter> (layout,
|
||||
ID::chorusMix,
|
||||
ParameterID { ID::chorusMix, 1 },
|
||||
"Mix",
|
||||
"%",
|
||||
NormalisableRange<float> (0.0f, 100.0f),
|
||||
50.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)) {}
|
||||
getPercentageAttributes())) {}
|
||||
|
||||
AudioParameterBool& enabled;
|
||||
Parameter& rate;
|
||||
|
|
@ -798,39 +721,32 @@ public:
|
|||
{
|
||||
explicit LadderGroup (AudioProcessorParameterGroup& layout)
|
||||
: enabled (addToLayout<AudioParameterBool> (layout,
|
||||
ID::ladderEnabled,
|
||||
ParameterID { ID::ladderEnabled, 1 },
|
||||
"Ladder",
|
||||
false,
|
||||
"")),
|
||||
false)),
|
||||
mode (addToLayout<AudioParameterChoice> (layout,
|
||||
ID::ladderMode,
|
||||
ParameterID { ID::ladderMode, 1 },
|
||||
"Mode",
|
||||
StringArray { "LP12", "LP24", "HP12", "HP24", "BP12", "BP24" },
|
||||
1)),
|
||||
cutoff (addToLayout<Parameter> (layout,
|
||||
ID::ladderCutoff,
|
||||
ParameterID { ID::ladderCutoff, 1 },
|
||||
"Frequency",
|
||||
"Hz",
|
||||
NormalisableRange<float> (10.0f, 22000.0f, 0.0f, 0.25f),
|
||||
1000.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getHzAttributes())),
|
||||
resonance (addToLayout<Parameter> (layout,
|
||||
ID::ladderResonance,
|
||||
ParameterID { ID::ladderResonance, 1 },
|
||||
"Resonance",
|
||||
"%",
|
||||
NormalisableRange<float> (0.0f, 100.0f),
|
||||
0.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)),
|
||||
getPercentageAttributes())),
|
||||
drive (addToLayout<Parameter> (layout,
|
||||
ID::ladderDrive,
|
||||
ParameterID { ID::ladderDrive, 1 },
|
||||
"Drive",
|
||||
"dB",
|
||||
NormalisableRange<float> (0.0f, 40.0f),
|
||||
0.0f,
|
||||
valueToTextFunction,
|
||||
textToValueFunction)) {}
|
||||
getDbAttributes())) {}
|
||||
|
||||
AudioParameterBool& enabled;
|
||||
AudioParameterChoice& mode;
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ public:
|
|||
.withInput ("Input", AudioChannelSet::stereo(), true)
|
||||
.withOutput ("Output", AudioChannelSet::stereo(), true)),
|
||||
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())
|
||||
.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));
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue