Skip to content

Commit

Permalink
Bipolar feedback had broken fb-drag-to-on (#129)
Browse files Browse the repository at this point in the history
so fix that by adding an onPullFromDef
  • Loading branch information
baconpaul authored Jan 16, 2025
1 parent ffc09bb commit b1f522c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ui/matrix-panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ MatrixPanel::MatrixPanel(SixSinesEditor &e) : jcmp::NamedPanel("Matrix"), HasEdi
Slabels[i]->setText("Op " + std::to_string(i + 1) + " " + u8"\U000021A9");
addAndMakeVisible(*Slabels[i]);

SknobsData[i]->under->onPullFromMin = [i, w = juce::Component::SafePointer(this)]()
SknobsData[i]->under->onPullFromDef = [i, w = juce::Component::SafePointer(this)]()
{
if (!w)
return;
Expand Down
8 changes: 7 additions & 1 deletion src/ui/patch-data-bindings.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ struct PatchContinuous : jdat::Continuous
if (onPullFromMin)
onPullFromMin();
}

if (p->value == p->meta.defaultVal && f != p->value)
{
if (onPullFromDef)
onPullFromDef();
}
p->value = f;
editor.uiToAudio.push({Synth::UIToAudioMsg::Action::SET_PARAM, pid, f});
editor.flushOperator();
Expand All @@ -105,7 +111,7 @@ struct PatchContinuous : jdat::Continuous
jdat::Discrete *tsPowerPartner{nullptr};
void setTemposyncPowerPartner(jdat::Discrete *d) { tsPowerPartner = d; }

std::function<void()> onPullFromMin{nullptr};
std::function<void()> onPullFromMin{nullptr}, onPullFromDef{nullptr};

using cubic_t = sst::jucegui::component_adapters::CubicThrowRescaler<PatchContinuous>;
};
Expand Down

0 comments on commit b1f522c

Please sign in to comment.