# torvalds/guitarpedal architecture

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

- Interactive diagram: https://gitdiagram.com/torvalds/guitarpedal
- Repository: https://github.com/torvalds/guitarpedal

## Overview

##### Project type and purpose
- This is a hardware hobby project using KiCad for analog guitar-pedal PCB design plus supporting mechanical models and documentation.
- Purpose: iterate through multiple enclosure form factors (1590A, 1590B, 1590LB) and circuit variants (Base, Plain, Boost, Pots), simulate with SPICE, then generate PCB and 3D enclosure outputs.

##### File structure
- Top-level design dirs (1590A, 1590B, 1590LB): each contains sub-folders for schematic/layout variants (Base, Plain, Boost).
- Libraries:
- Mylib.pretty – custom footprint modules (.kicad_mod, .step).
- symbols – symbol library (.kicad_sym).
- spice – SPICE models & subfolders.
- Mechanical models: Models/… .scad files for 3D parts.
- Enclosure: mechanical drill templates (Enclosure/Drill-1590B.txt) and Template/1590B.scad.
- Documentation: Markdown notes under Documentation/Passthrough.
- Project metadata: README.md, LICENSE, .gitignore.

##### README for additional insights
- Mixed-signal analog focus with discrete-component front ends (JFET followers).
- Iterative mechanical constraints driving enclosure choices.
- Simulation and layout outputs used for PCB manufacturing (JLCPCB, OSH Park, PCBWAY).

##### Detail but avoid overthinking
- Major folders/flows as separate blocks
- Reuse (library blocks feeding multiple design variants)
- Enclosure-board co-design loop
- Key outputs (simulation reports, Gerbers, BOM, 3D prints) and consumers

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Design Variants
    subgraph "Design Variants" 
        classDef electrical fill:#ccffcc,stroke:#333,stroke-width:1px
        subgraph "1590A/Base"
            Base_SCH["Base.kicad_sch"]:::electrical
            Base_PCB["Base.kicad_pcb"]:::electrical
        end
        subgraph "1590A/Plain"
            Plain_SCH["Plain.kicad_sch"]:::electrical
            Plain_PCB["Plain.kicad_pcb"]:::electrical
        end
        subgraph "1590B/Base"
            B2_SCH["Base.kicad_sch"]:::electrical
            B2_PCB["Base.kicad_pcb"]:::electrical
        end
        subgraph "1590LB/Boost"
            LB_SCH["Boost.kicad_sch"]:::electrical
            LB_PCB["Boost.kicad_pcb"]:::electrical
        end
        subgraph "Pots"
            Pots_SCH["Pots.kicad_sch"]:::electrical
            Pots_PCB["Pots.kicad_pcb"]:::electrical
        end
    end

    %% Shared Libraries
    subgraph "Shared Libraries"
        classDef libs fill:#cce5ff,stroke:#333,stroke-width:1px
        Footprints["Mylib.pretty (footprints)"]:::libs
        Symbols["symbols/Mylib.kicad_sym"]:::libs
    end

    %% Simulation
    subgraph "SPICE Simulation"
        classDef sim fill:#ffebcc,stroke:#333,stroke-width:1px
        Global_SPICE["Global spice/*.lib"]:::sim
        Variant_SPICE["Variant-specific spice folders"]:::sim
        Global_SPICE --> Variant_SPICE
        Variant_SPICE -->|feeds| Simulation["Simulation Reports"]:::sim
        Simulation -->|validate| Base_SCH
        Simulation -->|validate| Plain_SCH
        Simulation -->|validate| B2_SCH
        Simulation -->|validate| LB_SCH
        Simulation -->|validate| Pots_SCH
    end

    %% Mechanical Models
    subgraph "Mechanical CAD"
        classDef mech fill:#eeeeee,stroke:#333,stroke-width:1px
        Models["Models/*.scad"]:::mech
        Templates["Template/1590B.scad"]:::mech
        Drill["Enclosure/Drill-1590B.txt"]:::mech
        Models -->|import| LB_PCB
        Templates -->|drill guides| Drill
    end

    %% Documentation
    subgraph "Documentation"
        classDef doc fill:#ffd9b3,stroke:#333,stroke-width:1px
        Notes["Documentation/Passthrough/Notes.md"]:::doc
        README["README.md"]:::doc
        LICENSE["LICENSE"]:::doc
        GITIGNORE[".gitignore"]:::doc
        Notes -->|references| Base_SCH
        README -->|overview| Footprints
    end

    %% PCB Output & External
    Gerbers["Gerber Set"]:::electrical
    BOM["BOM"]:::electrical
    Gerbers -->|to| PCB_Fab["JLCPCB / OSH Park / PCBWAY"]:::external
    BOM -->|to| Suppliers["Mouser / Tayda"]:::external
    Base_PCB -->|generate| Gerbers
    Plain_PCB -->|generate| Gerbers
    B2_PCB -->|generate| Gerbers
    LB_PCB -->|generate| Gerbers
    Pots_PCB -->|generate| Gerbers

    %% Connections from Libraries
    Symbols -->|symbols| Base_SCH
    Symbols -->|symbols| Plain_SCH
    Symbols -->|symbols| B2_SCH
    Symbols -->|symbols| LB_SCH
    Symbols -->|symbols| Pots_SCH
    Footprints -->|footprints| Base_PCB
    Footprints -->|footprints| Plain_PCB
    Footprints -->|footprints| B2_PCB
    Footprints -->|footprints| LB_PCB
    Footprints -->|footprints| Pots_PCB

    %% Click Events
    click Base_SCH "https://github.com/torvalds/guitarpedal/blob/main/1590A/Base/Base.kicad_sch"
    click Plain_SCH "https://github.com/torvalds/guitarpedal/blob/main/1590A/Plain/Plain.kicad_sch"
    click B2_SCH "https://github.com/torvalds/guitarpedal/blob/main/1590B/Base/Base.kicad_sch"
    click LB_SCH "https://github.com/torvalds/guitarpedal/blob/main/1590LB/Boost/Boost.kicad_sch"
    click Pots_SCH "https://github.com/torvalds/guitarpedal/blob/main/Pots/Pots.kicad_sch"
    click Base_PCB "https://github.com/torvalds/guitarpedal/blob/main/1590A/Base/Base.kicad_pcb"
    click Plain_PCB "https://github.com/torvalds/guitarpedal/blob/main/1590A/Plain/Plain.kicad_pcb"
    click B2_PCB "https://github.com/torvalds/guitarpedal/blob/main/1590B/Base/Base.kicad_pcb"
    click LB_PCB "https://github.com/torvalds/guitarpedal/blob/main/1590LB/Boost/Boost.kicad_pcb"
    click Pots_PCB "https://github.com/torvalds/guitarpedal/blob/main/Pots/Pots.kicad_pcb"
    click Footprints "https://github.com/torvalds/guitarpedal/tree/main/Mylib.pretty/"
    click Symbols "https://github.com/torvalds/guitarpedal/blob/main/symbols/Mylib.kicad_sym"
    click Global_SPICE "https://github.com/torvalds/guitarpedal/blob/main/spice/BC846A.lib"
    click Variant_SPICE "https://github.com/torvalds/guitarpedal/tree/main/1590A/Base/spice"
    click Models "https://github.com/torvalds/guitarpedal/blob/main/Models/CK-6.35-308.scad"
    click Templates "https://github.com/torvalds/guitarpedal/blob/main/Template/1590B.scad"
    click Drill "https://github.com/torvalds/guitarpedal/blob/main/Enclosure/Drill-1590B.txt"
    click Notes "https://github.com/torvalds/guitarpedal/blob/main/Documentation/Passthrough/Notes.md"
    click README "https://github.com/torvalds/guitarpedal/blob/main/README.md"
    click LICENSE "https://github.com/torvalds/guitarpedal/tree/main/LICENSE"
    click GITIGNORE "https://github.com/torvalds/guitarpedal/blob/main/.gitignore"

    %% Styles
    class Suppliers external
    class PCB_Fab external
    class Simulation sim
    class Footprints libs
    class Symbols libs
    class Models mech
    class Templates mech
    class Drill mech
    class Notes doc
    class README doc
    class LICENSE doc
    class GITIGNORE doc
    class Gerbers electrical
    class BOM electrical
    class Base_SCH,Plain_SCH,B2_SCH,LB_SCH,Pots_SCH electrical
    class Base_PCB,Plain_PCB,B2_PCB,LB_PCB,Pots_PCB electrical
```
