Skip to content

Commit

Permalink
additive or multiplicative modulation is per row as data
Browse files Browse the repository at this point in the history
- Additive or multiplicative modulation is per row as data
- Right now all rows default to additive for all targets
- Right Mouse menu in depth slider lets you switch for all targets

Addresses #1057
Addresses #1356
  • Loading branch information
baconpaul committed Sep 20, 2024
1 parent d61538b commit cf2fb61
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 25 deletions.
50 changes: 27 additions & 23 deletions src-ui/app/edit-screen/components/ModPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -835,29 +835,33 @@ template <typename GZTrait> struct ModRow : juce::Component, HasEditor
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();
} );

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,8 @@ 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}, {"appm", t.applicationMode}};
{"srcLE", t.sourceLagExp}, {"srVLE", t.sourceViaLagExp},
{"appm", t.applicationMode}};
if (SC_STREAMING_FOR_IN_PROCESS)
addToObject<val_t>(v, "extraPayload", t.extraPayload);
}
Expand Down

0 comments on commit cf2fb61

Please sign in to comment.