Skip to content

Commit

Permalink
Add Mult Swap Checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
baconpaul committed Sep 20, 2024
1 parent 7a43260 commit d61538b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 10 deletions.
40 changes: 31 additions & 9 deletions src-ui/app/edit-screen/components/ModPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,16 +353,13 @@ template <typename GZTrait> struct ModRow : juce::Component, HasEditor
}
}

if (row.target.has_value())
if (row.applicationMode == sst::basic_blocks::mod_matrix::ApplicationMode::MULTIPLICATIVE)
{
if (GZTrait::isMultiplicative(*(row.target)))
{
a2->glyph = sst::jucegui::components::GlyphPainter::MODULATION_MULTIPLICATIVE;
}
else
{
a2->glyph = sst::jucegui::components::GlyphPainter::MODULATION_ADDITIVE;
}
a2->glyph = sst::jucegui::components::GlyphPainter::MODULATION_MULTIPLICATIVE;
}
else
{
a2->glyph = sst::jucegui::components::GlyphPainter::MODULATION_ADDITIVE;
}

repaint();
Expand Down Expand Up @@ -837,6 +834,31 @@ template <typename GZTrait> struct ModRow : juce::Component, HasEditor
p.addSeparator();
p.addCustomItem(-1, std::make_unique<ModDepthTypein>(editor, this));

p.addSeparator();
auto &route =parent->routingTable.routes[index];

p.addItem("Additive Application", true, route.applicationMode == sst::basic_blocks::mod_matrix::ApplicationMode::ADDITIVE,
[w = juce::Component::SafePointer(this)]() {
if (!w)
return;
auto &route =w->parent->routingTable.routes[w->index];
route.applicationMode = sst::basic_blocks::mod_matrix::ApplicationMode::ADDITIVE;

w->pushRowUpdate(true);
w->refreshRow();
} );
p.addItem("Multiplicative Application", true, route.applicationMode == sst::basic_blocks::mod_matrix::ApplicationMode::MULTIPLICATIVE,
[w = juce::Component::SafePointer(this)]() {
if (!w)
return;
auto &route =w->parent->routingTable.routes[w->index];
route.applicationMode = sst::basic_blocks::mod_matrix::ApplicationMode::MULTIPLICATIVE ;

w->pushRowUpdate(true);
w->refreshRow();
} );


p.showMenuAsync(editor->defaultPopupMenuOptions());
}
};
Expand Down
3 changes: 2 additions & 1 deletion src/json/modulation_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ SC_STREAMDEF(scxt::voice::modulation::Matrix::RoutingTable::Routing, SC_FROM({
{"sourceVia", t.sourceVia}, {"target", t.target},
{"curve", t.curve}, {"depth", t.depth},
{"srcLMS", t.sourceLagMS}, {"srVLMS", t.sourceViaLagMS},
{"srcLE", t.sourceLagExp}, {"srVLE", t.sourceViaLagExp}};
{"srcLE", t.sourceLagExp}, {"srVLE", t.sourceViaLagExp}, {"appm", t.applicationMode}};
if (SC_STREAMING_FOR_IN_PROCESS)
addToObject<val_t>(v, "extraPayload", t.extraPayload);
}
Expand All @@ -211,6 +211,7 @@ SC_STREAMDEF(scxt::voice::modulation::Matrix::RoutingTable::Routing, SC_FROM({
findOrSet(v, "srVLMS", 0, result.sourceViaLagMS);
findOrSet(v, "srcLE", true, result.sourceLagExp);
findOrSet(v, "srVLE", true, result.sourceViaLagExp);
findOrSet(v, "appm", 0, result.applicationMode);
}));

SC_STREAMDEF(scxt::voice::modulation::Matrix::RoutingTable, SC_FROM({
Expand Down
2 changes: 2 additions & 0 deletions src/modulation/voice_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ struct MatrixConfig
{
return scxt::modulation::ModulationCurves::getCurveOperator(id);
}

// FIX ME make this default named and in the base and accessible to the ui
static std::unordered_set<TargetIdentifier> multiplicativeTargets;
static void setIsMultiplicative(const TargetIdentifier &ti)
{
Expand Down

0 comments on commit d61538b

Please sign in to comment.