Skip to content

08_13 - Products

Complete AudioLab product implementations showcasing L4 and L5 plugin architectures.

๐Ÿ“ฆ Products Overview

This module contains: - Product Templates: Reusable templates for creating new plugins - TS_Compressor: Professional dynamics compressor (L4) - TS_Reverb: Algorithmic reverb (L4) - TS_MasterSuite: Complete mastering chain (L5)

๐Ÿ—‚๏ธ Directory Structure

08_13_products/
โ”œโ”€โ”€ 08_13_00_product_templates/    # Templates & schemas
โ”‚   โ”œโ”€โ”€ l4_template/                # L4 plugin template
โ”‚   โ”œโ”€โ”€ l5_template/                # L5 suite template
โ”‚   โ”œโ”€โ”€ schemas/                    # Manifest schemas & examples
โ”‚   โ””โ”€โ”€ README.md                   # Template usage guide
โ”‚
โ”œโ”€โ”€ TS_Compressor/                  # L4: Dynamics compressor
โ”‚   โ”œโ”€โ”€ include/
โ”‚   โ”‚   โ””โ”€โ”€ TS_Compressor.hpp
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ””โ”€โ”€ TS_Compressor.cpp
โ”‚   โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ presets/factory/
โ”‚   โ”œโ”€โ”€ product_manifest.json
โ”‚   โ””โ”€โ”€ CMakeLists.txt
โ”‚
โ”œโ”€โ”€ TS_Reverb/                      # L4: Algorithmic reverb
โ”‚   โ”œโ”€โ”€ include/
โ”‚   โ”‚   โ””โ”€โ”€ TS_Reverb.hpp
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ””โ”€โ”€ TS_Reverb.cpp
โ”‚   โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ presets/factory/
โ”‚   โ”œโ”€โ”€ product_manifest.json
โ”‚   โ””โ”€โ”€ CMakeLists.txt
โ”‚
โ”œโ”€โ”€ TS_MasterSuite/                 # L5: Mastering suite
โ”‚   โ”œโ”€โ”€ include/
โ”‚   โ”‚   โ””โ”€โ”€ TS_MasterSuite.hpp
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ””โ”€โ”€ TS_MasterSuite.cpp
โ”‚   โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ presets/factory/
โ”‚   โ”œโ”€โ”€ product_manifest.json
โ”‚   โ””โ”€โ”€ CMakeLists.txt
โ”‚
โ””โ”€โ”€ README.md                       # This file

๐ŸŽ›๏ธ Product Catalog

TS_Compressor (L4)

Type: L4 Simple Plugin Category: Dynamics Description: Professional dynamics compressor with RMS/Peak detection

Features: - RMS and Peak detection modes - Smooth envelope following - Makeup gain compensation - Real-time metering - 12 factory presets

Parameters: - Threshold (-60 to 0 dB) - Ratio (1:1 to 20:1) - Attack (0.1 to 100 ms) - Release (10 to 1000 ms) - Makeup Gain (-12 to +24 dB) - Detector (Peak/RMS) - Bypass

Use Cases: - Vocal compression - Drum processing - Mix bus glue - Mastering

Factory Presets: 1. Init 2. Vocal Smooth 3. Vocal Aggressive 4. Bus Glue 5. Drum Punch 6. Drum Bus 7. Bass Tighten 8. Master Glue 9. Brick Wall 10. Parallel NY 11. Gentle Touch 12. Pumping Effect


TS_Reverb (L4)

Type: L4 Simple Plugin Category: Reverb Description: Algorithmic reverb based on Freeverb algorithm

Features: - 8 parallel comb filters per channel - 4 series allpass filters for diffusion - Stereo width control - Real-time parameter updates - 12 factory presets

Parameters: - Size (0 to 100%) - Decay (0 to 100%) - Damping (0 to 100%) - Mix (0 to 100%) - Bypass

Use Cases: - Room ambience - Hall reverb - Plate emulation - Creative effects

Factory Presets: 1. Init 2. Small Room 3. Medium Room 4. Large Hall 5. Cathedral 6. Bright Plate 7. Dark Plate 8. Vocal Reverb 9. Drum Ambience 10. Shimmer 11. Tight Space 12. Infinite


TS_MasterSuite (L5)

Type: L5 Suite Plugin Category: Mastering Description: Complete mastering chain with EQ, Compressor, and Limiter

Features: - 3 slot serial processing chain - Individual slot enable/bypass - Global master volume control - Integrated EQ โ†’ Comp โ†’ Limiter workflow - 5 factory presets

Slots: 1. SimpleEQ: Low/High shelf filters 2. SimpleCompressor: Mastering compression 3. SimpleLimiter: Ceiling limiter

Parameters: - Master Volume (-60 to +12 dB) - Slot Enables (3x) - EQ: Low Freq, Low Gain, High Freq, High Gain - Comp: Threshold, Ratio, Attack, Release - Limiter: Ceiling, Release

Use Cases: - Complete mastering workflow - Final mix processing - Loudness maximization - Streaming preparation

Factory Presets: 1. Default Chain 2. Transparent Master 3. Warm Master 4. Loud Master 5. Gentle Touch

๐Ÿš€ Quick Start

Using a Product

#include "TS_Compressor.hpp"

using namespace audiolab::products;

// Create compressor
auto compressor = std::make_unique<TS_Compressor>(44100.0, 512);

// Set parameters
compressor->setParameterValue("threshold", 0.5f); // -20 dB
compressor->setParameterValue("ratio", 0.4f);     // ~4:1

// Load preset
compressor->loadFactoryPreset(1); // "Vocal Smooth"

// Process audio
compressor->process(input_buffer, output_buffer, num_samples);

// Get metering
float gr = compressor->getGainReduction(); // Current GR in dB

Creating a New Product

  1. Copy template:

    cp -r 08_13_00_product_templates/l4_template/ MyNewPlugin/
    

  2. Customize code:

  3. Replace [PRODUCT_NAME] with your class name
  4. Replace [PRODUCT_ID] with unique ID
  5. Implement DSP in process()
  6. Add parameters in initParameters()

  7. Create manifest:

  8. Copy example manifest from schemas/
  9. Fill in product info
  10. Define parameters
  11. Add factory presets

  12. Build and test:

    cd MyNewPlugin
    mkdir build && cd build
    cmake .. -DCMAKE_BUILD_TYPE=Release
    cmake --build .
    

See 08_13_00_product_templates/README.md for detailed instructions.

๐Ÿ—๏ธ Architecture

L4 Plugin Architecture

Input โ†’ Parameters โ†’ DSP Processing โ†’ Output
                โ†“
           Preset System

Key Components: - IProcessor: Audio processing interface - IParameterable: Parameter management - IPresetable: Preset loading/saving - Real-time safety guaranteed - Zero allocations in audio thread

L5 Suite Architecture

Input โ†’ Slot 0 (EQ) โ†’ Slot 1 (Comp) โ†’ Slot 2 (Lim) โ†’ Output
            โ†“              โ†“              โ†“
        Bypass         Bypass         Bypass
            โ†“              โ†“              โ†“
     Global Parameters โ† Master Volume

Key Components: - SlotManager: Manages plugin slots - InterPluginRouter: Routes audio between slots - GlobalParameterController: Suite-level parameters - Individual slot enable/disable - Aggregated parameter system

๐Ÿ“‹ Product Manifests

Each product includes a product_manifest.json file that describes:

  • Product Info: Name, ID, version, manufacturer
  • Plugin Type: L4 or L5
  • I/O Configuration: Channels, side-chain, MIDI
  • Parameters: Full parameter definitions
  • Presets: Factory preset list
  • DSP Config: Latency, tail length, optimizations
  • L5 Config: Slot definitions (L5 only)
  • UI Config: Window size, theme
  • System Requirements: Platform, sample rate limits

Example:

{
  "product_info": {
    "name": "TS Compressor",
    "id": "TS_Compressor",
    "version": "1.0.0"
  },
  "plugin_type": "L4",
  "parameters": [...],
  "presets": {...}
}

๐Ÿงช Testing

Each product includes unit tests:

# Build tests
cd TS_Compressor/tests
mkdir build && cd build
cmake ..
cmake --build .

# Run tests
./test_ts_compressor.exe

Test Coverage: - Parameter ranges and scaling - DSP accuracy - Preset loading - Real-time safety validation - Multiple sample rates - Various block sizes

๐ŸŽจ Best Practices

Real-Time Safety

โœ… GOOD:

// Pre-allocate in prepare()
void prepare(double sr, size_t max_block) {
    buffers_.resize(max_block);
}

// Use pre-allocated in process()
void process(...) {
    std::fill(buffers_.begin(), buffers_.end(), 0.0f);
}

โŒ BAD:

void process(...) {
    std::vector<float> temp(num_samples); // Allocation!
    auto ptr = new float[num_samples];     // Allocation!
}

Parameter Smoothing

// Smooth parameter changes to avoid clicks
const float alpha = 1.0f - std::exp(-1.0f / (0.01f * sample_rate_));
smooth_value += alpha * (target_value - smooth_value);

Factory Presets

  • Provide 10-12 musically useful presets
  • Cover common use cases
  • Include at least one "Init" preset
  • Organize by category
  • Test all presets thoroughly

๐Ÿ“Š Performance

CPU Usage (@ 44.1kHz, 512 samples)

Product CPU % Latency Memory
TS_Compressor <1% 0 samples ~50 KB
TS_Reverb ~2% 0 samples ~200 KB
TS_MasterSuite ~3% 0 samples ~300 KB

All products are real-time safe and can run multiple instances without issues.

๐Ÿ”— Dependencies

Required Modules: - 04_CORE/04_01_core_interfaces - IProcessor, IParameterable, IPresetable - 04_CORE/04_05_buffer_management - AudioBuffer - 04_CORE/04_08_parameter_system - Parameter class

Optional Modules: - 08_10_l4_plugin_architecture - L4 architecture details - 08_11_l5_suite_architecture - L5 architecture details - 08_01_composition_tools - Template system

๐Ÿ› ๏ธ Development Workflow

  1. Design: Define DSP algorithm and parameters
  2. Prototype: Use template to create skeleton
  3. Implement: Add DSP processing logic
  4. Parameters: Define all user controls
  5. Presets: Create 10+ factory presets
  6. Test: Unit tests for all functionality
  7. Optimize: Profile and optimize performance
  8. Document: User manual and developer guide
  9. Package: Use 08_14_asset_selection for distribution

๐Ÿ“š Resources

Documentation

Examples

Core Systems

๐ŸŽฏ Next Steps

After implementing products:

  1. 08_14 - Asset Selection: Package products for distribution
  2. 08_15 - Version Management: Manage product versions
  3. Testing: Comprehensive testing with real audio
  4. Optimization: Profile and optimize DSP code
  5. Documentation: Complete user manuals
  6. QA: Quality assurance and bug fixes
  7. Release: Prepare for distribution

โœ… Completion Checklist

  • Product templates created
  • Manifest schema defined
  • TS_Compressor implemented
  • TS_Reverb implemented
  • TS_MasterSuite implemented
  • Factory presets defined
  • Product manifests created
  • Unit tests written
  • Integration tests passed
  • Performance benchmarked
  • Documentation complete
  • Ready for packaging

Status: โœ… Implementation Complete (3/3 products) Total Products: 3 (2 L4 + 1 L5) Total Presets: 29 factory presets Code Quality: Real-time safe, zero allocations

Ready for testing and packaging! ๐ŸŽ‰