# mgantlett/ketshat architecture

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

- Interactive diagram: https://gitdiagram.com/mgantlett/ketshat
- Repository: https://github.com/mgantlett/ketshat

## Overview

##### Project type and purpose
- This is a single‐page, front-end web application (no backend/service-oriented microservices).

##### File structure
- Top level files only:
- index.html – the UI shell
- styles.css – presentation (layout, dark theme, responsiveness)
- app.js – all application logic (audio graph building, UI event handling, presets)
- No server code, no build scripts, no external dependencies besides the browser APIs.

##### README for additional insights
- Lists main audio features: noise generators (white, pink, brown, metallic), distortion, biquad filters, modulation (tremolo, filter sweep), visualization, preset persistence.
- Technology stack is pure HTML/CSS/JS + Web Audio API.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Browser Environment"
        subgraph "UI Layer"
            indexHTML["UI Shell & Controls<br/>(index.html)"]:::ui
            stylesCSS["Presentation & Theming<br/>(styles.css)"]:::ui
        end

        subgraph "Controller & Persistence"
            Controller["Controller Layer<br/>(app.js)"]:::controller
            Preset["Preset Manager<br/>(localStorage)"]:::persistence
        end

        subgraph "Audio Engine Graph"
            Noise["Noise Source Module"]:::audio
            Distortion["Distortion Module"]:::audio
            Biquad["Biquad Filter Module"]:::audio
            Modulation["Modulation Module<br/>(Tremolo & Filter Sweep)"]:::audio
            Destination["Audio Destination (speakers)"]:::audio
            Analyser["Analyser Node"]:::audio
        end

        Visualization["Visualization Module<br/>(Waveform Canvas/SVG)"]:::visual

    end

    %% Control flow
    indexHTML -->|"user events"| Controller
    stylesCSS --> Controller
    Controller -->|"configure nodes"| Noise
    Controller -->|"configure nodes"| Distortion
    Controller -->|"configure nodes"| Biquad
    Controller -->|"configure nodes"| Modulation
    Controller <-->|"save/load presets"| Preset

    %% Audio signal flow
    Noise --> Distortion
    Distortion --> Biquad
    Biquad --> Modulation
    Modulation --> Destination
    Modulation --> Analyser
    Analyser --> Visualization

    %% Click Events
    click indexHTML "https://github.com/mgantlett/ketshat/blob/master/index.html"
    click stylesCSS "https://github.com/mgantlett/ketshat/blob/master/styles.css"
    click Controller "https://github.com/mgantlett/ketshat/blob/master/app.js"
    click Preset "https://github.com/mgantlett/ketshat/blob/master/app.js"
    click Noise "https://github.com/mgantlett/ketshat/blob/master/app.js"
    click Distortion "https://github.com/mgantlett/ketshat/blob/master/app.js"
    click Biquad "https://github.com/mgantlett/ketshat/blob/master/app.js"
    click Modulation "https://github.com/mgantlett/ketshat/blob/master/app.js"
    click Destination "https://github.com/mgantlett/ketshat/blob/master/app.js"
    click Analyser "https://github.com/mgantlett/ketshat/blob/master/app.js"
    click Visualization "https://github.com/mgantlett/ketshat/blob/master/app.js"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef controller fill:#FFD700,stroke:#000,stroke-width:1px
    classDef persistence fill:#FFFACD,stroke:#000,stroke-width:1px
    classDef audio fill:#90EE90,stroke:#000,stroke-width:1px
    classDef visual fill:#DDA0DD,stroke:#000,stroke-width:1px
```
