Rename sliders and variables appropriately

pull/277/head
DJLevel3 2025-01-17 09:36:33 -05:00
rodzic 7d3a1f491b
commit 4874f3ff1f
4 zmienionych plików z 34 dodań i 34 usunięć

Wyświetl plik

@ -121,8 +121,8 @@ OscirenderAudioProcessor::OscirenderAudioProcessor() {
} }
)); ));
toggleableEffects.push_back(custom); toggleableEffects.push_back(custom);
toggleableEffects.push_back(traceMax); toggleableEffects.push_back(traceLength);
toggleableEffects.push_back(traceMin); toggleableEffects.push_back(traceStart);
for (int i = 0; i < toggleableEffects.size(); i++) { for (int i = 0; i < toggleableEffects.size(); i++) {
auto effect = toggleableEffects[i]; auto effect = toggleableEffects[i];

Wyświetl plik

@ -72,20 +72,20 @@ public:
) )
); );
std::shared_ptr<Effect> traceMax = std::make_shared<Effect>( std::shared_ptr<Effect> traceLength = std::make_shared<Effect>(
new EffectParameter( new EffectParameter(
"Trace max", "Trace Length",
"Defines the maximum proportion of the image that is drawn before skipping to the next frame. This has the effect of 'tracing' out the image from a single dot when animated. By default, we draw until the end of the frame, so this value is 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.",
"traceMax", "traceLength",
VERSION_HINT, 0.75, 0.0, 1.0 VERSION_HINT, 1.0, 0.0, 1.0
) )
); );
std::shared_ptr<Effect> traceMin = std::make_shared<Effect>( std::shared_ptr<Effect> traceStart = std::make_shared<Effect>(
new EffectParameter( new EffectParameter(
"Trace min", "Trace Start",
"Defines the proportion of the image that drawing starts from. 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.",
"traceMin", "traceStart",
VERSION_HINT, 0.25, 0.0, 1.0 VERSION_HINT, 0.0, 0.0, 1.0
) )
); );

Wyświetl plik

@ -2,8 +2,8 @@
#include "../PluginProcessor.h" #include "../PluginProcessor.h"
ShapeVoice::ShapeVoice(OscirenderAudioProcessor& p) : audioProcessor(p) { ShapeVoice::ShapeVoice(OscirenderAudioProcessor& p) : audioProcessor(p) {
actualTraceMin = audioProcessor.traceMin->getValue(); actualTraceStart = audioProcessor.traceStart->getValue();
actualTraceMax = audioProcessor.traceMax->getValue(); actualTraceLength = audioProcessor.traceLength->getValue();
} }
bool ShapeVoice::canPlaySound(juce::SynthesiserSound* sound) { bool ShapeVoice::canPlaySound(juce::SynthesiserSound* sound) {
@ -86,13 +86,13 @@ void ShapeVoice::renderNextBlock(juce::AudioSampleBuffer& outputBuffer, int star
} }
for (auto sample = startSample; sample < startSample + numSamples; ++sample) { for (auto sample = startSample; sample < startSample + numSamples; ++sample) {
bool traceMinEnabled = audioProcessor.traceMin->enabled->getBoolValue(); bool traceStartEnabled = audioProcessor.traceStart->enabled->getBoolValue();
bool traceMaxEnabled = audioProcessor.traceMax->enabled->getBoolValue(); bool traceLengthEnabled = audioProcessor.traceLength->enabled->getBoolValue();
// update length increment // update length increment
double traceMax = traceMaxEnabled ? actualTraceMax : 1.0; double traceLen = traceLengthEnabled ? actualTraceLength : 1.0;
double traceMin = traceMinEnabled ? actualTraceMin : 0.0; double traceMin = traceStartEnabled ? actualTraceStart : 0.0;
double proportionalLength = (traceMax) * frameLength; double proportionalLength = traceLen * frameLength;
lengthIncrement = juce::jmax(proportionalLength / (audioProcessor.currentSampleRate / actualFrequency), MIN_LENGTH_INCREMENT); lengthIncrement = juce::jmax(proportionalLength / (audioProcessor.currentSampleRate / actualFrequency), MIN_LENGTH_INCREMENT);
OsciPoint channels; OsciPoint channels;
@ -147,14 +147,14 @@ void ShapeVoice::renderNextBlock(juce::AudioSampleBuffer& outputBuffer, int star
outputBuffer.addSample(0, sample, x * gain); outputBuffer.addSample(0, sample, x * gain);
} }
double traceMinValue = audioProcessor.traceMin->getActualValue(); double traceStartValue = audioProcessor.traceStart->getActualValue();
double traceMaxValue = audioProcessor.traceMax->getActualValue(); double traceLengthValue = audioProcessor.traceLength->getActualValue();
traceMaxValue = traceMaxEnabled ? traceMaxValue : 1.0; traceLengthValue = traceLengthEnabled ? traceLengthValue : 1.0;
traceMinValue = traceMinEnabled ? traceMinValue : 0.0; traceStartValue = traceStartEnabled ? traceStartValue : 0.0;
actualTraceMax = traceMaxValue; actualTraceLength = traceLengthValue;
actualTraceMin = traceMinValue; actualTraceStart = traceStartValue;
if (actualTraceMin < 0) { if (actualTraceStart < 0) {
actualTraceMin = 0; actualTraceStart = 0;
} }
if (!renderingSample) { if (!renderingSample) {
@ -163,8 +163,8 @@ void ShapeVoice::renderNextBlock(juce::AudioSampleBuffer& outputBuffer, int star
double drawnFrameLength = frameLength; double drawnFrameLength = frameLength;
bool willLoopOver = false; bool willLoopOver = false;
if (traceMaxEnabled || traceMinEnabled) { if (traceLengthEnabled || traceStartEnabled) {
drawnFrameLength *= actualTraceMax + actualTraceMin; drawnFrameLength *= actualTraceLength + actualTraceStart;
} }
if (!renderingSample && frameDrawn >= drawnFrameLength) { if (!renderingSample && frameDrawn >= drawnFrameLength) {
@ -178,11 +178,11 @@ void ShapeVoice::renderNextBlock(juce::AudioSampleBuffer& outputBuffer, int star
// TODO: updateFrame already iterates over all the shapes, // TODO: updateFrame already iterates over all the shapes,
// so we can improve performance by calculating frameDrawn // so we can improve performance by calculating frameDrawn
// and shapeDrawn directly. frameDrawn is simply actualTraceMin * frameLength // and shapeDrawn directly. frameDrawn is simply actualTraceStart * frameLength
// but shapeDrawn is the amount of the current shape that has been drawn so // but shapeDrawn is the amount of the current shape that has been drawn so
// we need to iterate over all the shapes to calculate it. // we need to iterate over all the shapes to calculate it.
if (traceMinEnabled) { if (traceStartEnabled) {
while (frameDrawn < actualTraceMin * frameLength) { while (frameDrawn < actualTraceStart * frameLength) {
incrementShapeDrawing(); incrementShapeDrawing();
} }
} }

Wyświetl plik

@ -27,8 +27,8 @@ private:
OscirenderAudioProcessor& audioProcessor; OscirenderAudioProcessor& audioProcessor;
std::vector<std::unique_ptr<Shape>> frame; std::vector<std::unique_ptr<Shape>> frame;
std::atomic<ShapeSound*> sound = nullptr; std::atomic<ShapeSound*> sound = nullptr;
double actualTraceMin; double actualTraceStart;
double actualTraceMax; double actualTraceLength;
double frameLength = 0.0; double frameLength = 0.0;
int currentShape = 0; int currentShape = 0;