mirror of
https://codeberg.org/armin/mindball.git
synced 2026-09-21 04:17:19 +02:00
add FB BOOST toggle: 115% feedback max, cap default to 91%
This commit is contained in:
parent
2f4d6f8726
commit
abdb64dcde
4 changed files with 24 additions and 8 deletions
|
|
@ -34,6 +34,7 @@ public:
|
|||
bool doubleTap = false;
|
||||
bool center = false;
|
||||
bool autoPan = false;
|
||||
bool fbBoost = false;
|
||||
float panDepth = 1.0f;
|
||||
double bpm = 120.0;
|
||||
};
|
||||
|
|
@ -206,7 +207,7 @@ public:
|
|||
wetR *= gR;
|
||||
}
|
||||
|
||||
const float fb = sFeedback * 0.91f;
|
||||
const float fb = sFeedback * (p.fbBoost ? 1.15f : 0.91f);
|
||||
const float g = fb * (1.0f + 0.1f * std::pow (fb, 4.0f));
|
||||
dl.write (inL[i] + softClip (lpL.processLP (hpL.processHP (fbL * g))));
|
||||
dr.write (inR[i] + softClip (lpR.processLP (hpR.processHP (fbR * g))));
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ public:
|
|||
doubleToggle ("DOUBLE"),
|
||||
centerToggle ("CENTER"),
|
||||
autoPanToggle ("AUTO-PAN"),
|
||||
fbBoostToggle ("FB BOOST"),
|
||||
onToggle ("ON"),
|
||||
modeToggle (p.apvts),
|
||||
dryMeter ("DRY"),
|
||||
|
|
@ -31,6 +32,7 @@ public:
|
|||
doubleAtt (p.apvts, ParameterIDs::doubleTap, doubleToggle),
|
||||
centerAtt (p.apvts, ParameterIDs::center, centerToggle),
|
||||
autoPanAtt (p.apvts, ParameterIDs::autopan, autoPanToggle),
|
||||
fbBoostAtt (p.apvts, ParameterIDs::fbBoost, fbBoostToggle),
|
||||
onAtt (p.apvts, ParameterIDs::bypass, onToggle)
|
||||
{
|
||||
for (auto* c : { static_cast<juce::Component*> (&feedbackKnob), static_cast<juce::Component*> (&loCutKnob),
|
||||
|
|
@ -38,13 +40,18 @@ public:
|
|||
static_cast<juce::Component*> (&mixKnob), static_cast<juce::Component*> (&panKnob),
|
||||
static_cast<juce::Component*> (&syncToggle), static_cast<juce::Component*> (&modeToggle),
|
||||
static_cast<juce::Component*> (&doubleToggle), static_cast<juce::Component*> (¢erToggle),
|
||||
static_cast<juce::Component*> (&autoPanToggle), static_cast<juce::Component*> (&onToggle) })
|
||||
static_cast<juce::Component*> (&autoPanToggle), static_cast<juce::Component*> (&fbBoostToggle),
|
||||
static_cast<juce::Component*> (&onToggle) })
|
||||
addAndMakeVisible (c);
|
||||
|
||||
addAndMakeVisible (dryMeter);
|
||||
addAndMakeVisible (wetMeter);
|
||||
|
||||
feedbackKnob.setValueTextFunction ([] (double v) { return juce::String (juce::roundToInt (v * 100.0)) + "%"; });
|
||||
feedbackKnob.setValueTextFunction ([this] (double v)
|
||||
{
|
||||
const double maxPct = fbBoostToggle.getToggleState() ? 115.0 : 100.0;
|
||||
return juce::String (juce::roundToInt (v * maxPct)) + "%";
|
||||
});
|
||||
loCutKnob.setValueTextFunction ([] (double v) { return formatHz (v); });
|
||||
hiCutKnob.setValueTextFunction ([] (double v) { return formatHz (v); });
|
||||
timeKnob.setValueTextFunction ([this] (double v)
|
||||
|
|
@ -56,6 +63,7 @@ public:
|
|||
mixKnob.setValueTextFunction ([] (double v) { return juce::String (juce::roundToInt (v * 100.0)) + "%"; });
|
||||
panKnob.setValueTextFunction ([] (double v) { return juce::String (juce::roundToInt (v * 100.0)) + "%"; });
|
||||
onToggle.setInverted (true);
|
||||
fbBoostToggle.onClick = [this] { feedbackKnob.repaint(); };
|
||||
|
||||
syncToggle.onClick = [this]
|
||||
{
|
||||
|
|
@ -153,12 +161,16 @@ public:
|
|||
}
|
||||
|
||||
x = margin;
|
||||
const int numToggles = 7;
|
||||
const int toggleW = 80;
|
||||
const int toggleGap = (width - 2 * margin - numToggles * toggleW) / (numToggles - 1);
|
||||
for (auto* toggle : { static_cast<juce::Button*> (&onToggle), static_cast<juce::Button*> (&modeToggle),
|
||||
static_cast<juce::Button*> (&doubleToggle), static_cast<juce::Button*> (&syncToggle),
|
||||
static_cast<juce::Button*> (&autoPanToggle), static_cast<juce::Button*> (¢erToggle) })
|
||||
static_cast<juce::Button*> (&autoPanToggle), static_cast<juce::Button*> (&fbBoostToggle),
|
||||
static_cast<juce::Button*> (¢erToggle) })
|
||||
{
|
||||
toggle->setBounds (x, 146, knobW, 30);
|
||||
x += knobW + gap;
|
||||
toggle->setBounds (x, 146, toggleW, 30);
|
||||
x += toggleW + toggleGap;
|
||||
}
|
||||
|
||||
const int meterW = (width - 2 * margin - 20) / 2;
|
||||
|
|
@ -199,12 +211,12 @@ private:
|
|||
static const juce::StringArray syncDivisionNames;
|
||||
|
||||
Knob feedbackKnob, loCutKnob, hiCutKnob, timeKnob, mixKnob, panKnob;
|
||||
PillToggle syncToggle, doubleToggle, centerToggle, autoPanToggle, onToggle;
|
||||
PillToggle syncToggle, doubleToggle, centerToggle, autoPanToggle, fbBoostToggle, onToggle;
|
||||
ModeToggle modeToggle;
|
||||
LevelMeter dryMeter, wetMeter;
|
||||
|
||||
SliderAttachment feedbackAtt, loCutAtt, hiCutAtt, mixAtt, panAtt;
|
||||
ButtonAttachment syncAtt, doubleAtt, centerAtt, autoPanAtt, onAtt;
|
||||
ButtonAttachment syncAtt, doubleAtt, centerAtt, autoPanAtt, fbBoostAtt, onAtt;
|
||||
std::unique_ptr<SliderAttachment> timeAtt, timeSyncAtt;
|
||||
|
||||
juce::Label buildInfo;
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ juce::AudioProcessorValueTreeState::ParameterLayout MindballAudioProcessor::crea
|
|||
layout.add (std::make_unique<juce::AudioParameterBool> (ParameterIDs::doubleTap, "Double", false));
|
||||
layout.add (std::make_unique<juce::AudioParameterBool> (ParameterIDs::center, "Center", false));
|
||||
layout.add (std::make_unique<juce::AudioParameterBool> (ParameterIDs::autopan, "Auto-Pan", false));
|
||||
layout.add (std::make_unique<juce::AudioParameterBool> (ParameterIDs::fbBoost, "FB Boost", false));
|
||||
layout.add (std::make_unique<juce::AudioParameterFloat> (
|
||||
ParameterIDs::panDepth, "Pan Depth",
|
||||
juce::NormalisableRange<float> (0.0f, 1.0f, 0.001f, 1.0f), 1.0f));
|
||||
|
|
@ -135,6 +136,7 @@ void MindballAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, juc
|
|||
p.doubleTap = *apvts.getRawParameterValue (ParameterIDs::doubleTap) > 0.5f;
|
||||
p.center = *apvts.getRawParameterValue (ParameterIDs::center) > 0.5f;
|
||||
p.autoPan = *apvts.getRawParameterValue (ParameterIDs::autopan) > 0.5f;
|
||||
p.fbBoost = *apvts.getRawParameterValue (ParameterIDs::fbBoost) > 0.5f;
|
||||
p.panDepth = *apvts.getRawParameterValue (ParameterIDs::panDepth);
|
||||
p.bpm = bpm;
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ namespace ParameterIDs
|
|||
inline constexpr const char* center = "center";
|
||||
inline constexpr const char* autopan = "autopan";
|
||||
inline constexpr const char* panDepth = "pandepth";
|
||||
inline constexpr const char* fbBoost = "fbboost";
|
||||
inline constexpr const char* bypass = "bypass";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue