๐๏ธ L5 Parameter Hierarchy¶
๐ Overview¶
The L5 Parameter Hierarchy provides parameter management for complex L5 suite plugins with multiple slots, global controls, and sophisticated routing.
L5 suites contain multiple plugins (slots) with: - Global parameters (master volume, input/output gain) - Slot-specific parameters (per-plugin controls) - Routing parameters (signal flow, sends/returns)
๐ Components¶
08_03_01_l5_hierarchy/
โโโ include/
โ โโโ GlobalParameterManager.hpp โ Global parameters
โ โโโ SlotParameterManager.hpp โ Slot parameters
โ โโโ RoutingParameterManager.hpp โ Signal routing
โ โโโ HierarchyNavigator.hpp โ Unified access
โ
โโโ src/
โ โโโ GlobalParameterManager.cpp โ Implementation
โ
โโโ examples/
โ โโโ channel_strip_example.cpp โ Complete example
โ
โโโ CMakeLists.txt โ Build configuration
๐ฏ Quick Start¶
L5 Suite Architecture¶
L5 Master Suite
โโโ [GLOBAL PARAMETERS]
โ โโโ Master Volume
โ โโโ Input Gain
โ โโโ Output Gain
โ
โโโ [SLOT 0] "Channel Strip"
โ โโโ EQ Plugin
โ โ โโโ Low Freq
โ โ โโโ Low Gain
โ โโโ Compressor Plugin
โ โโโ Threshold
โ โโโ Ratio
โ
โโโ [SLOT 1] "Effects"
โ โโโ Reverb Plugin
โ โโโ Room Size
โ โโโ Damping
โ
โโโ [ROUTING]
โโโ Input โ Slot 0
โโโ Slot 0 โ Slot 1 (30% send)
โโโ Slot 1 โ Output
Creating Global Parameters¶
#include "GlobalParameterManager.hpp"
GlobalParameterManager globalParams;
// Register global parameters
auto* masterVol = new Parameter("master_volume", "Master Volume", -60.0f, 12.0f, 0.0f);
auto* inputGain = new Parameter("input_gain", "Input Gain", -24.0f, 24.0f, 0.0f);
globalParams.registerParameter(masterVol);
globalParams.registerParameter(inputGain);
// Link global parameters to slots
globalParams.linkToSlots("master_volume", {0, 1, 2});
// When master_volume changes, all linked slots are notified
globalParams.setParameterValue("master_volume", -3.0f);
Creating Slots¶
#include "SlotParameterManager.hpp"
// Create slot
SlotParameterManager slot0(0, "Channel Strip");
// Add plugins to slot
slot0.addPlugin("eq", eqPluginHost);
slot0.addPlugin("comp", compPluginHost);
// Access parameters
slot0.setParameterValue("eq.low_gain", 3.0f);
slot0.setParameterValue("comp.threshold", -20.0f);
// Get all parameters from slot
std::vector<Parameter*> params = slot0.getAllParameters();
Routing Configuration¶
#include "RoutingParameterManager.hpp"
RoutingParameterManager routing;
// Serial chain: Slot 0 โ Slot 1
routing.addConnection(0, 1, RoutingTopology::Serial, 1.0f);
// Reverb send: Slot 1 โ Slot 2 (40% send level)
routing.addConnection(1, 2, RoutingTopology::SendReturn, 0.4f);
// Get processing order (topological sort)
std::vector<int> order = routing.getProcessingOrder();
// Result: [0, 1, 2]
// Check for routing cycles
if (!routing.isValid()) {
std::cerr << "Routing contains cycles!\n";
}
Unified Navigation¶
#include "HierarchyNavigator.hpp"
HierarchyNavigator nav;
// Register managers
nav.setGlobalManager(&globalParams);
nav.setRoutingManager(&routing);
nav.addSlotManager(0, &slot0);
nav.addSlotManager(1, &slot1);
// Access global parameter
float masterVol = nav.getGlobalParameter("master_volume");
// Access slot parameter
float threshold = nav.getSlotParameter(0, "comp.threshold");
// Search across all scopes
float value = nav.findParameter("room_size"); // Finds in any slot
// Get complete hierarchy as tree
ParameterTree* tree = nav.buildCompleteTree();
std::cout << "Total parameters: " << tree->getTotalParameters() << "\n";
๐๏ธ Detailed Components¶
GlobalParameterManager¶
Manages suite-wide parameters that affect multiple slots.
Features: - Parameter registration/unregistration - Slot linking (broadcast changes) - Parameter change callbacks - Observable/Messageable (from 04_CORE)
Example Use Cases: - Master volume control - Global bypass - Input/output gain staging - Suite-level modulation sources
SlotParameterManager¶
Manages parameters for a single slot (which can contain multiple plugins).
Features:
- Plugin registration
- Parameter path resolution ("plugin_id.param_id")
- Global parameter integration
- Parameter tree generation
Example Use Cases: - Channel strip (EQ โ Comp โ Limit) - Effects chain (Chorus โ Delay โ Reverb) - Parallel processing (Dry/Wet mix)
RoutingParameterManager¶
Manages signal flow between slots.
Routing Topologies: - Serial: Chain processing (A โ B โ C) - Parallel: Summed processing (A + B โ C) - SendReturn: Auxiliary sends (A โ B @ 30%) - Sidechain: Control signals (A controls B)
Features: - Cycle detection (DAG validation) - Topological sort (processing order) - Connection gain control - Enable/bypass per connection
HierarchyNavigator¶
Unified interface for accessing the entire hierarchy.
Benefits: - Single point of access - Automatic scope resolution - Complete tree generation - Simplified parameter queries
๐ฎ Routing Examples¶
Serial Chain¶
routing.addConnection(-1, 0); // Input โ Slot 0
routing.addConnection(0, 1); // Slot 0 โ Slot 1
routing.addConnection(1, 2); // Slot 1 โ Slot 2
routing.addConnection(2, -2); // Slot 2 โ Output
Parallel Processing¶
routing.addConnection(-1, 0, RoutingTopology::Parallel);
routing.addConnection(-1, 1, RoutingTopology::Parallel);
routing.addConnection(0, -2);
routing.addConnection(1, -2);
Send/Return¶
Input โ Slot 0 (Dry) โโโโโโโโโโโ Output
โ โ
โโ Slot 1 (Reverb) โโโโโโ
(30% send) (50% return)
routing.addConnection(-1, 0); // Input โ Dry
routing.addConnection(0, -2); // Dry โ Output
routing.addConnection(0, 1, RoutingTopology::SendReturn, 0.3f); // 30% send
routing.addConnection(1, -2, RoutingTopology::Serial, 0.5f); // 50% return
๐งช Testing¶
cd tests
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
./test_l5_hierarchy
โก Performance¶
| Operation | Complexity | Typical Time |
|---|---|---|
getGlobalParameter() |
O(1) | ~50ns |
getSlotParameter() |
O(1) | ~100ns |
findParameter() |
O(n) | ~500ns |
getProcessingOrder() |
O(V+E) | ~1ฮผs per 10 slots |
buildCompleteTree() |
O(n) | ~10ฮผs per 100 params |
๐ Dependencies¶
- 08_00 - Plugin Infrastructure (IParameterHost)
- 08_03_00 - Aggregation System (ParameterTree)
๐ Related¶
- 08_03_00_aggregation_system - Parameter grouping
- 08_03_02_modulation_matrix - Modulation routing
Status: โ Complete Version: 1.0.0 Last Updated: 2025-10-09