Skip to content

๐Ÿ—๏ธ 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

Input โ†’ Slot 0 (EQ) โ†’ Slot 1 (Comp) โ†’ Slot 2 (Limiter) โ†’ Output
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

Input โ”€โ”ฌโ†’ Slot 0 (EQ) โ”€โ”€โ”€โ”ฌโ†’ Sum โ†’ Output
       โ””โ†’ Slot 1 (Comp) โ”€โ”˜
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)


Status: โœ… Complete Version: 1.0.0 Last Updated: 2025-10-09