# baconpaul/six-sines architecture

> Architecture diagram of the GitHub repository baconpaul/six-sines, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/baconpaul/six-sines
- Repository: https://github.com/baconpaul/six-sines

## Overview

##### Main Components

a. Plugin Host Integration Layer
- CLAP plugin interface (src/clap directory)
- Audio processing pipeline
- MIDI/MPE input handling

b. Synthesis Engine Core (src/dsp and src/synth directories)
- Voice management system
- Modulation matrix
- Signal processing components
- Patch management system

c. User Interface Layer (src/ui directory)
- Editor components
- Parameter bindings
- Preset management
- Visual feedback system

##### Key Architectural Elements

**[Host DAW]**
- ↕
**[Plugin Interface Layer (CLAP)]**
- ↕
**[Synthesis Engine]**
- ↓
**[Voice Management]**
- ↓
**[Modulation Matrix]**
- ↕
**[UI Layer]**

##### Specific Implementation Details to Highlight

a. Core Components:
- Matrix node system (matrix_node.h)
- Sine table implementation (sintable.h)
- Voice management (voice.h, voice_values.h)
- Modulation matrix (mod_matrix.h)
- Patch system (patch.h)

b. UI Components:
- Main editor panel
- Matrix panel
- Source panel
- Mixer panel
- Preset manager

##### Important Relationships

- Data flow between the modulation matrix and voice engine
- Parameter automation paths
- Preset loading/saving workflow
- Audio signal path
- Control signal path

##### Technical Details

- Integration with SST libraries (shown as external dependencies)
- CLAP plugin architecture
- Resource management for factory patches
- MPE support system

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Host
        DAW[DAW Host]
    end

    subgraph Interface
        CLAP["CLAP Plugin Interface"]:::plugin
        MIDI["MIDI/MPE Handler"]:::control
    end

    subgraph Engine
        SynthEngine["Synthesizer Engine"]:::core
        VoiceManager["Voice Management System"]:::core
        ModMatrix["Modulation Matrix"]:::core
        SignalProc["Signal Processing Core"]:::core
        PatchMgr["Patch Management"]:::data
    end

    subgraph UI
        Editor["Main Editor Interface"]:::ui
        MatrixPanel["Matrix Panel"]:::ui
        SourcePanel["Source Panel"]:::ui
        MixerPanel["Mixer Panel"]:::ui
        PresetMgr["Preset Manager"]:::ui
        ParamBindings["Parameter Bindings"]:::ui
        ModComponents["Modulation Components"]:::ui
    end

    subgraph Resources
        Factory["Factory Patches"]:::data
    end

    %% Connections
    DAW <--> CLAP
    CLAP <--> SynthEngine
    MIDI --> SynthEngine
    
    SynthEngine --> VoiceManager
    VoiceManager <--> ModMatrix
    ModMatrix <--> SignalProc
    
    SynthEngine <--> PatchMgr
    PatchMgr <--> PresetMgr
    PresetMgr --> Factory
    
    Editor --> MatrixPanel
    Editor --> SourcePanel
    Editor --> MixerPanel
    Editor --> PresetMgr
    
    ParamBindings --> ModComponents
    ModComponents --> ModMatrix
    
    %% Styles
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef control fill:#4CAF50,stroke:#2E7D32,color:white
    classDef ui fill:#FF9800,stroke:#F57C00,color:white
    classDef data fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef plugin fill:#607D8B,stroke:#455A64,color:white

    %% Click Events
    click CLAP "https://github.com/baconpaul/six-sines/blob/main/src/clap/six-sines-clap.cpp"
    click VoiceManager "https://github.com/baconpaul/six-sines/blob/main/src/synth/voice.h"
    click ModMatrix "https://github.com/baconpaul/six-sines/blob/main/src/synth/mod_matrix.h"
    click SignalProc "https://github.com/baconpaul/six-sines/blob/main/src/dsp/matrix_node.h"
    click PatchMgr "https://github.com/baconpaul/six-sines/blob/main/src/synth/patch.h"
    click Editor "https://github.com/baconpaul/six-sines/blob/main/src/ui/six-sines-editor.h"
    click MatrixPanel "https://github.com/baconpaul/six-sines/blob/main/src/ui/matrix-panel.h"
    click SourcePanel "https://github.com/baconpaul/six-sines/blob/main/src/ui/source-panel.h"
    click MixerPanel "https://github.com/baconpaul/six-sines/blob/main/src/ui/mixer-panel.h"
    click PresetMgr "https://github.com/baconpaul/six-sines/blob/main/src/ui/preset-manager.h"
    click Factory "https://github.com/baconpaul/six-sines/tree/main/resources/factory_patches"
    click SynthEngine "https://github.com/baconpaul/six-sines/blob/main/src/synth/synth.h"
    click ParamBindings "https://github.com/baconpaul/six-sines/blob/main/src/ui/patch-data-bindings.h"
    click ModComponents "https://github.com/baconpaul/six-sines/blob/main/src/ui/modulation-components.h"
```
