# codygeary/cvfunk-modules architecture

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

- Interactive diagram: https://gitdiagram.com/codygeary/cvfunk-modules
- Repository: https://github.com/codygeary/cvfunk-modules

## Overview

##### Main Components

a) Module Layer:
- 21 modules into functional categories:
- Sequencers (Penta Sequencer, Decima, Syncro)
- Audio Processors (Tri Delay, Pressed Duck, Preeeeeeeeeeessed Duck)
- Modulators (Hex Mod, Envelope Array, Magnets)
- Visualizers (Signals, Flower Patch)
- Utilities (Nona, Morta, Ranges)
- Oscillators (Ouros, Step Wave)

b) Core Infrastructure:
- VCV Rack Plugin API Interface (represented by plugin.cpp and plugin.hpp)
- Resource Management (res/ directory for fonts)
- Preset Management System (presets/ directory structure)

##### Architectural Relationships to Highlight

**VCV Rack Host**
- ↕
**Plugin Interface Layer (plugin.cpp/hpp)**
- ↕
**Module Implementation Layer (individual .cpp files)**
- ↕
**Resource/Asset Layer (res/, presets/)**

##### Specific Design Elements

- Rectangles: Individual modules
- Hexagons: Core plugin infrastructure
- Circles: Resource components
- Diamonds: External interfaces

- Blue: Audio processing modules
- Green: Control voltage generators
- Orange: Utility modules
- Purple: Visualization modules
- Gray: Infrastructure components

##### Important Connections

- Preset loading/saving paths
- Resource usage connections
- Audio signal flow paths
- CV (Control Voltage) signal paths

##### Technical Details

- C++ as the implementation language
- VCV Rack SDK version compatibility
- Key dependencies (like DSP libraries)
- Build system requirements (referenced in Makefile)

##### Implementation Details

Implementation patterns:
- DSP algorithms (Filter6pButter.h)
- UI components (chord_display.hpp, digital_display.hpp)
- Resource management patterns
- Preset handling system

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Host["VCV Rack Host"]
        RackAPI[VCV Rack API]
    end

    subgraph Interface["Plugin Interface Layer"]
        Plugin["Plugin Interface"]:::core
    end

    subgraph Modules["Module Implementation Layer"]
        subgraph Sequencers["Sequencer Modules"]
            Penta["Penta Sequencer"]:::seq
            Decima["Decima"]:::seq
            Syncro["Syncro"]:::seq
        end

        subgraph AudioProc["Audio Processors"]
            TriDelay["Tri Delay"]:::audio
            PressedDuck["Pressed Duck"]:::audio
            PreeeeDuck["Preeeeeeeeeeessed Duck"]:::audio
        end

        subgraph Modulators["Modulator Modules"]
            HexMod["Hex Mod"]:::mod
            EnvArray["Envelope Array"]:::mod
            Magnets["Magnets"]:::mod
        end

        subgraph Visual["Visualizer Modules"]
            Signals["Signals"]:::vis
            FlowerPatch["Flower Patch"]:::vis
        end

        subgraph Utils["Utility Modules"]
            Nona["Nona"]:::util
            Morta["Morta"]:::util
            Ranges["Ranges"]:::util
        end

        subgraph Osc["Oscillator Modules"]
            Ouros["Ouros"]:::osc
            StepWave["Step Wave"]:::osc
        end
    end

    subgraph Resources["Resource Layer"]
        Fonts[("Font Resources")]:::res
        DSPAlgo["DSP Algorithms"]:::impl
        UIComps["UI Components"]:::impl
        Presets[("Preset Storage")]:::res
    end

    %% Connections
    RackAPI <--> Plugin
    Plugin --> Sequencers
    Plugin --> AudioProc
    Plugin --> Modulators
    Plugin --> Visual
    Plugin --> Utils
    Plugin --> Osc
    
    Modules --> Resources

    %% Click Events
    click Plugin "https://github.com/codygeary/CVfunk-Modules/blob/main/src/plugin.cpp"
    click Penta "https://github.com/codygeary/CVfunk-Modules/blob/main/src/PentaSequencer.cpp"
    click Decima "https://github.com/codygeary/CVfunk-Modules/blob/main/src/Decima.cpp"
    click Syncro "https://github.com/codygeary/CVfunk-Modules/blob/main/src/Syncro.cpp"
    click TriDelay "https://github.com/codygeary/CVfunk-Modules/blob/main/src/TriDelay.cpp"
    click PressedDuck "https://github.com/codygeary/CVfunk-Modules/blob/main/src/PressedDuck.cpp"
    click PreeeeDuck "https://github.com/codygeary/CVfunk-Modules/blob/main/src/PreeeeeeeeeeessedDuck.cpp"
    click HexMod "https://github.com/codygeary/CVfunk-Modules/blob/main/src/HexMod.cpp"
    click EnvArray "https://github.com/codygeary/CVfunk-Modules/blob/main/src/EnvelopeArray.cpp"
    click Magnets "https://github.com/codygeary/CVfunk-Modules/blob/main/src/Magnets.cpp"
    click Signals "https://github.com/codygeary/CVfunk-Modules/blob/main/src/Signals.cpp"
    click FlowerPatch "https://github.com/codygeary/CVfunk-Modules/blob/main/src/FlowerPatch.cpp"
    click Nona "https://github.com/codygeary/CVfunk-Modules/blob/main/src/Nona.cpp"
    click Morta "https://github.com/codygeary/CVfunk-Modules/blob/main/src/Morta.cpp"
    click Ranges "https://github.com/codygeary/CVfunk-Modules/blob/main/src/Ranges.cpp"
    click Ouros "https://github.com/codygeary/CVfunk-Modules/blob/main/src/Ouros.cpp"
    click StepWave "https://github.com/codygeary/CVfunk-Modules/blob/main/src/StepWave.cpp"
    click Fonts "https://github.com/codygeary/CVfunk-Modules/tree/main/res/fonts"
    click DSPAlgo "https://github.com/codygeary/CVfunk-Modules/blob/main/src/Filter6pButter.h"
    click UIComps "https://github.com/codygeary/CVfunk-Modules/blob/main/src/chord_display.hpp"

    %% Styles
    classDef core fill:#666,stroke:#333,stroke-width:2px
    classDef seq fill:#4CAF50,stroke:#2E7D32
    classDef audio fill:#2196F3,stroke:#1976D2
    classDef mod fill:#FF9800,stroke:#F57C00
    classDef vis fill:#9C27B0,stroke:#7B1FA2
    classDef util fill:#607D8B,stroke:#455A64
    classDef osc fill:#E91E63,stroke:#C2185B
    classDef res fill:#795548,stroke:#5D4037
    classDef impl fill:#9E9E9E,stroke:#616161

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Sequencers"]:::seq
        L3["Audio Processors"]:::audio
        L4["Modulators"]:::mod
        L5["Visualizers"]:::vis
        L6["Utilities"]:::util
        L7["Oscillators"]:::osc
        L8[("Resources")]:::res
        L9["Implementation"]:::impl
    end
```
