Skip to content

Instantly share code, notes, and snippets.

@Xenakios
Created February 13, 2024 20:15
Show Gist options
  • Save Xenakios/78ec6cabbc2c4c870193c46302c7ba7d to your computer and use it in GitHub Desktop.
Save Xenakios/78ec6cabbc2c4c870193c46302c7ba7d to your computer and use it in GitHub Desktop.
FixedMatrix<Config> m;
FixedMatrix<Config>::RoutingTable rt;
auto source0 = Config::SourceIdentifier{Config::SourceIdentifier::SI::LFO1};
auto source1 = Config::SourceIdentifier{Config::SourceIdentifier::SI::LFO2};
auto source2 = Config::SourceIdentifier{Config::SourceIdentifier::SI::LFO3};
auto source3 = Config::SourceIdentifier{Config::SourceIdentifier::SI::LFO4};
auto source4 = Config::SourceIdentifier{Config::SourceIdentifier::SI::BKENV1};
auto target0 = Config::TargetIdentifier{0};
auto target1 = Config::TargetIdentifier{1};
auto target2 = Config::TargetIdentifier{2};
auto target3 = Config::TargetIdentifier{3};
auto target4 = Config::TargetIdentifier{4};
auto target5 = Config::TargetIdentifier{5, 0, 0};
float sourceValues[5] = {0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
m.bindSourceValue(source0, sourceValues[0]);
m.bindSourceValue(source1, sourceValues[1]);
m.bindSourceValue(source2, sourceValues[2]);
m.bindSourceValue(source3, sourceValues[3]);
m.bindSourceValue(source4, sourceValues[4]);
float targetValues[6] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
m.bindTargetBaseValue(target0, targetValues[0]);
m.bindTargetBaseValue(target1, targetValues[1]);
m.bindTargetBaseValue(target2, targetValues[2]);
m.bindTargetBaseValue(target3, targetValues[3]);
m.bindTargetBaseValue(target4, targetValues[4]);
m.bindTargetBaseValue(target5, targetValues[5]);
rt.updateRoutingAt(0, source0, target0, 0.5);
rt.updateRoutingAt(1, source1, target0, 0.1);
rt.updateRoutingAt(2, source0, target1, 1.0);
rt.updateRoutingAt(3, source1, target2, 1.0);
rt.updateRoutingAt(4, source2, target3, 0.3);
rt.updateRoutingAt(5, source4, target5, 1.0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment