# hugelton/pendel architecture

> Architecture diagram of the GitHub repository hugelton/pendel, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hugelton/pendel
- Repository: https://github.com/hugelton/pendel

## Overview

Pendel is Pocket AMP firmware for a guitar-effects unit with a tape looper. The main workflow is audio input through three configurable effect slots, an amp stage, and the tape loop, while the app handles controls and presents status on the device screen. Metronome and tuner are distinct supporting audio features; the browser simulator runs the shared application, and installation is also a documented user capability. Some DSP orchestration and installer wiring is unsampled, so only documented or indexed relationships are shown.

Main entry points: [`src/app/app.c`](https://github.com/hugelton/pendel/blob/main/src/app/app.c) (Pendel app), [`src/dsp/pd_effects.c`](https://github.com/hugelton/pendel/blob/main/src/dsp/pd_effects.c) (Effects slots), [`src/dsp/pd_modules.c`](https://github.com/hugelton/pendel/blob/main/src/dsp/pd_modules.c) (Input conditioning), [`firmware/pa/main.c`](https://github.com/hugelton/pendel/blob/main/firmware/pa/main.c) (Board runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Runtime platforms"]
  node_pocketamp["Pocket AMP"]
  node_firmware["Board runtime<br/>[main.c]"]
  node_sim["Browser simulator<br/>[sim_api.c]"]
end

subgraph group_application["App and interface"]
  node_app["Pendel app<br/>[app.c]"]
  node_screens["Screens and model<br/>[ui.c]"]
  node_renderer["Strip renderer<br/>[gfx.c]"]
end

subgraph group_audio["Audio processing"]
  node_input["Input conditioning<br/>[pd_modules.c]"]
  node_effects["Effects slots<br/>[pd_effects.c]"]
  node_amp["Amp stage<br/>[pd_effects.c]"]
  node_looper[("Tape looper<br/>[pd_looper.c]")]
  node_rack["Rack routing<br/>[pd_rack.c]"]
  node_osc["Oscillator primitives<br/>[pd_osc.c]"]
  node_metro["Metronome<br/>[pd_metro.c]"]
  node_tuner["Tuner<br/>[pd_tuner.c]"]
end

subgraph group_install["Installation"]
  node_installer["Web installer<br/>[paota.js]"]
  node_installtool["Install utility<br/>[pa_install.py]"]
end

node_player(("Instrument input"))
node_computer(("Computer browser"))

node_player -->|"audio input"| node_pocketamp
node_pocketamp -->|"runs firmware"| node_firmware
node_firmware -->|"calls app"| node_app
node_sim -->|"shares application"| node_app
node_app -->|"fills model"| node_screens
node_screens -->|"draws strips"| node_renderer
node_app -.->|"conditions input"| node_input
node_app -.->|"configures rack"| node_rack
node_player -->|"signal path"| node_input
node_input -->|"feeds effects"| node_effects
node_effects -->|"feeds amp"| node_amp
node_amp -->|"feeds tape"| node_looper
node_effects -->|"uses oscillator"| node_osc
node_app -->|"controls loop"| node_looper
node_app -.->|"metronome feature"| node_metro
node_app -.->|"tuner feature"| node_tuner
node_computer -->|"opens installer"| node_installer
node_installer -->|"installs firmware"| node_pocketamp
node_computer -->|"runs installer"| node_installtool

click node_firmware "https://github.com/hugelton/pendel/blob/main/firmware/pa/main.c"
click node_sim "https://github.com/hugelton/pendel/blob/main/sim/sim_api.c"
click node_app "https://github.com/hugelton/pendel/blob/main/src/app/app.c"
click node_screens "https://github.com/hugelton/pendel/blob/main/src/ui/ui.c"
click node_renderer "https://github.com/hugelton/pendel/blob/main/src/ui/gfx.c"
click node_input "https://github.com/hugelton/pendel/blob/main/src/dsp/pd_modules.c"
click node_effects "https://github.com/hugelton/pendel/blob/main/src/dsp/pd_effects.c"
click node_amp "https://github.com/hugelton/pendel/blob/main/src/dsp/pd_effects.c"
click node_looper "https://github.com/hugelton/pendel/blob/main/src/dsp/pd_looper.c"
click node_rack "https://github.com/hugelton/pendel/blob/main/src/dsp/pd_rack.c"
click node_osc "https://github.com/hugelton/pendel/blob/main/src/dsp/pd_osc.c"
click node_metro "https://github.com/hugelton/pendel/blob/main/src/dsp/pd_metro.c"
click node_tuner "https://github.com/hugelton/pendel/blob/main/src/dsp/pd_tuner.c"
click node_installer "https://github.com/hugelton/pendel/blob/main/web/paota.js"
click node_installtool "https://github.com/hugelton/pendel/blob/main/tools/pa_install.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pocketamp,node_firmware,node_sim,node_computer toneBlue
class node_app,node_screens,node_renderer toneAmber
class node_input,node_effects,node_amp,node_looper,node_rack,node_osc,node_metro,node_tuner toneMint
class node_installer,node_installtool toneRose
class node_player toneIndigo
```

## Components

### Runtime platforms

- **Pocket AMP**
- [Board runtime](https://github.com/hugelton/pendel/blob/main/firmware/pa/main.c): `firmware/pa/main.c`
- [Browser simulator](https://github.com/hugelton/pendel/blob/main/sim/sim_api.c): `sim/sim_api.c`

### App and interface

- [Pendel app](https://github.com/hugelton/pendel/blob/main/src/app/app.c): `src/app/app.c`
- [Screens and model](https://github.com/hugelton/pendel/blob/main/src/ui/ui.c): `src/ui/ui.c`
- [Strip renderer](https://github.com/hugelton/pendel/blob/main/src/ui/gfx.c): `src/ui/gfx.c`

### Audio processing

- [Input conditioning](https://github.com/hugelton/pendel/blob/main/src/dsp/pd_modules.c): `src/dsp/pd_modules.c`
- [Effects slots](https://github.com/hugelton/pendel/blob/main/src/dsp/pd_effects.c): `src/dsp/pd_effects.c`
- [Amp stage](https://github.com/hugelton/pendel/blob/main/src/dsp/pd_effects.c): `src/dsp/pd_effects.c`
- [Tape looper](https://github.com/hugelton/pendel/blob/main/src/dsp/pd_looper.c): `src/dsp/pd_looper.c`
- [Rack routing](https://github.com/hugelton/pendel/blob/main/src/dsp/pd_rack.c): `src/dsp/pd_rack.c`
- [Oscillator primitives](https://github.com/hugelton/pendel/blob/main/src/dsp/pd_osc.c): `src/dsp/pd_osc.c`
- [Metronome](https://github.com/hugelton/pendel/blob/main/src/dsp/pd_metro.c): `src/dsp/pd_metro.c`
- [Tuner](https://github.com/hugelton/pendel/blob/main/src/dsp/pd_tuner.c): `src/dsp/pd_tuner.c`

### Installation

- [Web installer](https://github.com/hugelton/pendel/blob/main/web/paota.js): `web/paota.js`
- [Install utility](https://github.com/hugelton/pendel/blob/main/tools/pa_install.py): `tools/pa_install.py`

### Other components

- **Instrument input**
- **Computer browser**

## Connections

- Instrument input → Pocket AMP: audio input (evidence: `README.md`)
- Pocket AMP → Board runtime: runs firmware (evidence: `firmware/pa/main.c`)
- Board runtime → Pendel app: calls app (evidence: `firmware/pa/main.c`)
- Browser simulator → Pendel app: shares application
- Pendel app → Screens and model: fills model
- Screens and model → Strip renderer: draws strips (evidence: `src/ui/ui.c`)
- Pendel app → Input conditioning: conditions input
- Pendel app → Rack routing: configures rack
- Instrument input → Input conditioning: signal path (evidence: `README.md`)
- Input conditioning → Effects slots: feeds effects (evidence: `README.md`)
- Effects slots → Amp stage: feeds amp (evidence: `README.md`)
- Amp stage → Tape looper: feeds tape (evidence: `README.md`)
- Effects slots → Oscillator primitives: uses oscillator (evidence: `src/dsp/pd_effects.c`)
- Pendel app → Tape looper: controls loop (evidence: `src/app/app.c`)
- Pendel app → Metronome: metronome feature
- Pendel app → Tuner: tuner feature
- Computer browser → Web installer: opens installer (evidence: `README.md`)
- Web installer → Pocket AMP: installs firmware (evidence: `README.md`)
- Computer browser → Install utility: runs installer (evidence: `README.md`)
