# brer-rabbit/zoxnoxious architecture

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

- Interactive diagram: https://gitdiagram.com/brer-rabbit/zoxnoxious
- Repository: https://github.com/brer-rabbit/zoxnoxious

## Overview

Key Components to Include:

##### Hardware Layer
- Synthesizer Cards (showing expandability up to 8 slots)
- Backplane (central connection point)
- Raspberry Pi Controller
- Physical connections (I2C, SPI, analog signals)

##### Software Layer
- VCV Rack Plugin System
- Raspberry Pi Host Software
- Card Drivers
- USB Audio/MIDI Interface

##### Use a Multi-Layer Approach
- Top Layer: User Interface (VCV Rack)
- Middle Layer: Control System (Raspberry Pi)
- Bottom Layer: Hardware Components (Cards & Backplane)

##### Component Relationships
- Data flow from VCV Rack → USB → Raspberry Pi
- Control signals from Pi → Cards
- Audio/MIDI routing paths
- Inter-card communication through backplane

##### Detailed Subsystems

a. VCV Rack Plugin Section:
- [VCV Rack Modules] → [Plugin Interface] → [USB Communication]

b. Raspberry Pi Control Section:
- [USB Audio/MIDI] → [Card Manager] → [Card Drivers] → [I2C/SPI Controllers]

c. Hardware Section:
- [Backplane] ↔ [Card Slots (1-8)] → [Analog Outputs]

##### Specific Elements
- Card expansion slots (6 physical, 8 logical)
- Supported card types (AS3340, AS3372, SSI2130/AS3394)
- Signal routing matrix
- Control voltage paths
- Digital control interfaces

##### Technical Details
- Protocol specifications (I2C, SPI)
- Signal types (CV, Gate, Audio)
- Interface standards (USB Audio, USB MIDI)

##### Implementation Notes
- Use standardized symbols for electronic components
- Notes about expansion capabilities
- Physical/logical separation clearly

##### System expandability

Keep the abstraction level appropriate by:
- Showing major components without internal details
- Focusing on interfaces between subsystems
- Highlighting the modular nature of the design
- Emphasizing the hardware/software boundary

- Component symbols
- Protocol indicators
- Signal path types

This will create a comprehensive yet understandable representation of the Zoxnoxious system architecture that clearly shows both hardware and software interactions while maintaining focus on the system's modular nature and expansion capabilities.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style Definitions
    classDef software fill:#b3d1ff,stroke:#333,stroke-width:1px
    classDef hardware fill:#ffd9b3,stroke:#333,stroke-width:1px
    classDef protocol fill:#b3ffb3,stroke:#333,stroke-width:1px
    classDef signal fill:#e6b3ff,stroke:#333,stroke-width:1px

    %% VCV Rack Layer
    subgraph VCV
        VCV["VCV Rack Plugin System"]
        PD["PoleDancer Module"]
        Z3340["Zoxnoxious3340 Module"]
        Z3372["Zoxnoxious3372 Module"]
        Z5524["Zoxnoxious5524 Module"]
        
        VCV --> PD & Z3340 & Z3372 & Z5524
    end

    %% Raspberry Pi Layer
    subgraph RPI["Raspberry Pi Control System"]
        USB["USB Audio/MIDI Interface"]
        CM["Card Manager"]
        TM["Tune Manager"]
        HOST["Host Controller"]
        CD["Card Drivers"]
        
        HOST --> USB
        HOST --> CM
        HOST --> TM
        CM --> CD
    end

    %% Hardware Layer
    subgraph HW["Hardware Components"]
        BP["Backplane"]
        CS1["Card Slot 1 (AS3340 VCO)"]
        CS2["Card Slot 2 (AS3372 Signal)"]
        CS3["Card Slot 3 (SSI2130/AS3394)"]
        CS4["Additional Slots..."]
        
        BP --> CS1 & CS2 & CS3 & CS4
    end

    %% Inter-layer Connections
    VCV --> |USB MIDI| USB
    USB --> HOST
    CD --> |I2C/SPI| BP

    %% Component Classes
    class VCV,PD,Z3340,Z3372,Z5524,USB,CM,TM,HOST,CD software
    class BP,CS1,CS2,CS3,CS4 hardware

    %% Click Events
    click VCV "https://github.com/brer-rabbit/zoxnoxious/blob/main/vcv_rack/src/plugin.cpp"
    click Z3340 "https://github.com/brer-rabbit/zoxnoxious/blob/main/vcv_rack/src/Zoxnoxious3340.cpp"
    click Z3372 "https://github.com/brer-rabbit/zoxnoxious/blob/main/vcv_rack/src/Zoxnoxious3372.cpp"
    click Z5524 "https://github.com/brer-rabbit/zoxnoxious/blob/main/vcv_rack/src/Zoxnoxious5524.cpp"
    click CD "https://github.com/brer-rabbit/zoxnoxious/tree/main/raspberry_pi/lib/src"
    click CS1 "https://github.com/brer-rabbit/zoxnoxious/tree/main/kicad/z3340"
    click CS2 "https://github.com/brer-rabbit/zoxnoxious/tree/main/kicad/z3372"
    click CS3 "https://github.com/brer-rabbit/zoxnoxious/tree/main/kicad/z5524"
    click BP "https://github.com/brer-rabbit/zoxnoxious/tree/main/kicad/vca_backplane"
    click CM "https://github.com/brer-rabbit/zoxnoxious/blob/main/raspberry_pi/include/card_manager.h"
    click TM "https://github.com/brer-rabbit/zoxnoxious/blob/main/raspberry_pi/include/tune_mgr.h"
    click HOST "https://github.com/brer-rabbit/zoxnoxious/blob/main/raspberry_pi/src/zoxnoxiousd.c"
    click USB "https://github.com/brer-rabbit/zoxnoxious/blob/main/raspberry_pi/src/zalsa.c"

    %% Legend
    subgraph Legend
        L1["Software Component"]:::software
        L2["Hardware Component"]:::hardware
        L3["Digital Control Flow"]
        L4["Hardware Connection"]
    end
```
