pull/277/head
DJLevel3 2025-01-17 13:26:24 -05:00
rodzic f478277d7e
commit 800952ba0b
3 zmienionych plików z 8 dodań i 7 usunięć

Wyświetl plik

@ -68,7 +68,7 @@ public:
"Frequency", "Frequency",
"Controls how many times per second the image is drawn, thereby controlling the pitch of the sound. Lower frequencies result in more-accurately drawn images, but more flickering, and vice versa.", "Controls how many times per second the image is drawn, thereby controlling the pitch of the sound. Lower frequencies result in more-accurately drawn images, but more flickering, and vice versa.",
"frequency", "frequency",
VERSION_HINT, 220.0, 0.0, 12000.0, 0.1 VERSION_HINT, 220.0, 0.0, 4200.0
) )
); );
@ -77,7 +77,7 @@ public:
"Trace Length", "Trace Length",
"Defines how much of the frame is drawn per cycle. This has the effect of 'tracing' out the image from a single dot when animated. By default, we draw the whole frame, corresponding to a value of 1.0.", "Defines how much of the frame is drawn per cycle. This has the effect of 'tracing' out the image from a single dot when animated. By default, we draw the whole frame, corresponding to a value of 1.0.",
"traceLength", "traceLength",
VERSION_HINT, 1.0, 0.0, 1.0, 0.01f, 0.005 VERSION_HINT, 1.0, 0.0, 1.0, 0.001, 0.001
) )
); );
std::shared_ptr<Effect> traceStart = std::make_shared<Effect>( std::shared_ptr<Effect> traceStart = std::make_shared<Effect>(
@ -85,7 +85,7 @@ public:
"Trace Start", "Trace Start",
"Defines how far into the frame the drawing is started at. This has the effect of 'tracing' out the image from a single dot when animated. By default, we start drawing from the beginning of the frame, so this value is 0.0.", "Defines how far into the frame the drawing is started at. This has the effect of 'tracing' out the image from a single dot when animated. By default, we start drawing from the beginning of the frame, so this value is 0.0.",
"traceStart", "traceStart",
VERSION_HINT, 0.0, 0.0, 1.0, 0.01f, 0.005 VERSION_HINT, 0.0, 0.0, 1.0, 0.001, 0.001
) )
); );

Wyświetl plik

@ -69,7 +69,7 @@ void Effect::animateValues(double volume) {
actualValues[i] = ((float)rand() / RAND_MAX) * (maxValue - minValue) + minValue; actualValues[i] = ((float)rand() / RAND_MAX) * (maxValue - minValue) + minValue;
break; break;
default: default:
double weight = (parameter->smoothValueChange > 1.0 || parameter->smoothValueChange < SMOOTHING_SPEED_MIN) ? (1.0) : (parameter->smoothValueChange.load()); double weight = (parameter->smoothValueChange > 1.0 || parameter->smoothValueChange < SMOOTHING_SPEED_MIN) ? (1.0) : (parameter->smoothValueChange.load()) * 192000 / sampleRate;
double newValue; double newValue;
if (parameter->sidechain != nullptr && parameter->sidechain->getBoolValue()) { if (parameter->sidechain != nullptr && parameter->sidechain->getBoolValue()) {
newValue = volume * (maxValue - minValue) + minValue; newValue = volume * (maxValue - minValue) + minValue;

Wyświetl plik

@ -3,7 +3,7 @@
#include <JuceHeader.h> #include <JuceHeader.h>
#include "BooleanParameter.h" #include "BooleanParameter.h"
#define SMOOTHING_SPEED_CONSTANT 0.0005 #define SMOOTHING_SPEED_CONSTANT 0.0003
#define SMOOTHING_SPEED_MIN 0.0001 #define SMOOTHING_SPEED_MIN 0.0001
class FloatParameter : public juce::AudioProcessorParameterWithID { class FloatParameter : public juce::AudioProcessorParameterWithID {
@ -26,7 +26,8 @@ public:
return label; return label;
} }
// returns value in range [0, 1] // returns value in
// [0, 1]
float getNormalisedValue(float value) const { float getNormalisedValue(float value) const {
// clip value to valid range // clip value to valid range
auto min = this->min.load(); auto min = this->min.load();
@ -402,5 +403,5 @@ public:
} }
} }
EffectParameter(juce::String name, juce::String description, juce::String id, int versionHint, float value, float min, float max, float step = 0.01, double smoothValueChange = SMOOTHING_SPEED_CONSTANT) : FloatParameter(name, id, versionHint, value, min, max, step), smoothValueChange(smoothValueChange), description(description) {} EffectParameter(juce::String name, juce::String description, juce::String id, int versionHint, float value, float min, float max, float step = 0.001, double smoothValueChange = SMOOTHING_SPEED_CONSTANT) : FloatParameter(name, id, versionHint, value, min, max, step), smoothValueChange(smoothValueChange), description(description) {}
}; };