# marcentella/plainchord architecture

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

- Interactive diagram: https://gitdiagram.com/marcentella/plainchord
- Repository: https://github.com/marcentella/plainchord

## Overview

PlainChord is a browser-based guitar-learning reference: users explore chord progressions and transition difficulty, learn tablature techniques, or import and play their own tabs. Its main flow runs from tab input through a shared tab model to visual rendering and optional audio playback. The README also documents glossary, theme, and audio chord-detection capabilities. Relationships for unsampled modules are included only where the SOURCE INDEX or README supports them; the development synth page is excluded as a prototype.

Main entry points: [`app/acordes/page.tsx`](https://github.com/marcentella/plainchord/blob/main/app/acordes/page.tsx) (Chord Library), [`app/tablatura/page.tsx`](https://github.com/marcentella/plainchord/blob/main/app/tablatura/page.tsx) (Tab Import Page), [`lib/chords.ts`](https://github.com/marcentella/plainchord/blob/main/lib/chords.ts) (Chord Library Data), [`lib/tab.ts`](https://github.com/marcentella/plainchord/blob/main/lib/tab.ts) (Tab Data Model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning UI"]
  node_home["Landing Page<br/>[page.tsx]"]
  node_layout["App Layout<br/>[layout.tsx]"]
  node_theme["Theme Controls<br/>[PalettePicker.tsx]"]
  node_glossary["Technique Glossary<br/>[page.tsx]"]
  node_glossary_detail["Glossary Detail"]
end

subgraph group_chords["Chord Learning"]
  node_chord_page["Chord Library<br/>[page.tsx]"]
  node_progression_input["Progression Input"]
  node_chord_data["Chord Library Data<br/>[chords.ts]"]
  node_chord_diagram["Chord Diagram<br/>[ChordDiagram.tsx]"]
  node_fretboard["Fretboard View<br/>[Fretboard.tsx]"]
  node_transition["Transition Difficulty"]
  node_transition_badge["Difficulty Badge"]
  node_playalong["Chord Play-Along"]
end

subgraph group_tabs["Tab Practice"]
  node_tab_page["Tab Import Page<br/>[page.tsx]"]
  node_tab_parser["Text Tab Parser<br/>[parseTab.ts]"]
  node_gp_import["Guitar Pro Import<br/>[importGuitarPro.ts]"]
  node_tab_model["Tab Data Model<br/>[tab.ts]"]
  node_tab_history[("Tab History<br/>[tabHistory.ts]")]
  node_tab_renderer["Tab Renderer<br/>[TabRenderer.tsx]"]
  node_technique_popup["Technique Popup<br/>[TechniquePopup.tsx]"]
  node_playhead["Playhead Timing<br/>[usePlayhead.ts]"]
end

subgraph group_shared["Shared Domain and Audio"]
  node_detection["Chord Detection<br/>[chordDetection.ts]"]
  node_mic["Microphone Input<br/>[micInput.ts]"]
  node_audio_playback["Audio Playback"]
  node_synth_worker["Synth Worker<br/>[synthWorker.ts]"]
  node_worklet["Audio Worklet<br/>[synth-worklet.js]"]
  node_tone_chain["Tone Processing<br/>[toneChain.ts]"]
  node_glossary_data["Glossary Data<br/>[glossary.ts]"]
end

node_learner(("Learner"))

node_learner -->|"opens"| node_home
node_learner -->|"explores chords"| node_chord_page
node_learner -->|"learns notation"| node_glossary
node_learner -->|"imports tabs"| node_tab_page
node_layout -->|"renders"| node_theme
node_chord_page -->|"renders"| node_progression_input
node_chord_page -->|"looks up chords"| node_chord_data
node_chord_page -->|"renders"| node_chord_diagram
node_chord_page -->|"shows difficulty"| node_transition_badge
node_chord_page -->|"starts play-along"| node_playalong
node_chord_diagram -->|"reads chord"| node_chord_data
node_chord_diagram -->|"renders on"| node_fretboard
node_transition_badge -->|"displays result"| node_transition
node_transition -->|"uses chord data"| node_chord_data
node_playalong -->|"opens microphone"| node_mic
node_playalong -->|"analyzes frames"| node_detection
node_detection -->|"ranks candidates"| node_chord_data
node_glossary -->|"renders entries"| node_glossary_detail
node_glossary -->|"reads entries"| node_glossary_data
node_tab_page -->|"parses text"| node_tab_parser
node_tab_page -->|"imports files"| node_gp_import
node_tab_page -->|"saves history"| node_tab_history
node_tab_page -->|"renders tab"| node_tab_renderer
node_tab_parser -->|"produces model"| node_tab_model
node_gp_import -->|"produces model"| node_tab_model
node_tab_renderer -->|"reads tab"| node_tab_model
node_tab_renderer -->|"shows techniques"| node_technique_popup
node_technique_popup -->|"looks up symbols"| node_glossary_data
node_tab_page -->|"controls playback"| node_playhead
node_playhead -->|"coordinates audio"| node_audio_playback
node_playhead -->|"times tab beats"| node_tab_model
node_audio_playback -->|"sends commands"| node_synth_worker
node_audio_playback -->|"configures tone"| node_tone_chain
node_synth_worker -->|"streams samples"| node_worklet

click node_home "https://github.com/marcentella/plainchord/blob/main/app/page.tsx"
click node_layout "https://github.com/marcentella/plainchord/blob/main/app/layout.tsx"
click node_theme "https://github.com/marcentella/plainchord/blob/main/components/PalettePicker.tsx"
click node_glossary "https://github.com/marcentella/plainchord/blob/main/app/glosario/page.tsx"
click node_glossary_detail "https://github.com/marcentella/plainchord/blob/main/components/GlossaryEntryDetail.tsx"
click node_chord_page "https://github.com/marcentella/plainchord/blob/main/app/acordes/page.tsx"
click node_progression_input "https://github.com/marcentella/plainchord/blob/main/components/ChordProgressionInput.tsx"
click node_chord_data "https://github.com/marcentella/plainchord/blob/main/lib/chords.ts"
click node_chord_diagram "https://github.com/marcentella/plainchord/blob/main/components/ChordDiagram.tsx"
click node_fretboard "https://github.com/marcentella/plainchord/blob/main/components/Fretboard.tsx"
click node_transition "https://github.com/marcentella/plainchord/blob/main/lib/transitionDifficulty.ts"
click node_transition_badge "https://github.com/marcentella/plainchord/blob/main/components/TransitionBadge.tsx"
click node_playalong "https://github.com/marcentella/plainchord/blob/main/lib/useChordPlayAlong.ts"
click node_detection "https://github.com/marcentella/plainchord/blob/main/lib/chordDetection.ts"
click node_mic "https://github.com/marcentella/plainchord/blob/main/lib/micInput.ts"
click node_tab_page "https://github.com/marcentella/plainchord/blob/main/app/tablatura/page.tsx"
click node_tab_parser "https://github.com/marcentella/plainchord/blob/main/lib/parseTab.ts"
click node_gp_import "https://github.com/marcentella/plainchord/blob/main/lib/importGuitarPro.ts"
click node_tab_model "https://github.com/marcentella/plainchord/blob/main/lib/tab.ts"
click node_tab_history "https://github.com/marcentella/plainchord/blob/main/lib/tabHistory.ts"
click node_tab_renderer "https://github.com/marcentella/plainchord/blob/main/components/TabRenderer.tsx"
click node_technique_popup "https://github.com/marcentella/plainchord/blob/main/components/TechniquePopup.tsx"
click node_playhead "https://github.com/marcentella/plainchord/blob/main/lib/usePlayhead.ts"
click node_audio_playback "https://github.com/marcentella/plainchord/blob/main/lib/useAudioPlayback.ts"
click node_synth_worker "https://github.com/marcentella/plainchord/blob/main/lib/synth/synthWorker.ts"
click node_worklet "https://github.com/marcentella/plainchord/blob/main/public/synth-worklet.js"
click node_tone_chain "https://github.com/marcentella/plainchord/blob/main/lib/toneChain.ts"
click node_glossary_data "https://github.com/marcentella/plainchord/blob/main/lib/glossary.ts"

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_home,node_layout,node_theme,node_glossary,node_glossary_detail toneBlue
class node_chord_page,node_progression_input,node_chord_data,node_chord_diagram,node_fretboard,node_transition,node_transition_badge,node_playalong toneAmber
class node_tab_page,node_tab_parser,node_gp_import,node_tab_model,node_tab_history,node_tab_renderer,node_technique_popup,node_playhead toneMint
class node_detection,node_mic,node_audio_playback,node_synth_worker,node_worklet,node_tone_chain,node_glossary_data toneRose
class node_learner toneIndigo
```

## Components

### Learning UI

- [Landing Page](https://github.com/marcentella/plainchord/blob/main/app/page.tsx): `app/page.tsx`
- [App Layout](https://github.com/marcentella/plainchord/blob/main/app/layout.tsx): `app/layout.tsx`
- [Theme Controls](https://github.com/marcentella/plainchord/blob/main/components/PalettePicker.tsx): `components/PalettePicker.tsx`
- [Technique Glossary](https://github.com/marcentella/plainchord/blob/main/app/glosario/page.tsx): `app/glosario/page.tsx`
- [Glossary Detail](https://github.com/marcentella/plainchord/blob/main/components/GlossaryEntryDetail.tsx): `components/GlossaryEntryDetail.tsx`

### Chord Learning

- [Chord Library](https://github.com/marcentella/plainchord/blob/main/app/acordes/page.tsx): `app/acordes/page.tsx`
- [Progression Input](https://github.com/marcentella/plainchord/blob/main/components/ChordProgressionInput.tsx): `components/ChordProgressionInput.tsx`
- [Chord Library Data](https://github.com/marcentella/plainchord/blob/main/lib/chords.ts): `lib/chords.ts`
- [Chord Diagram](https://github.com/marcentella/plainchord/blob/main/components/ChordDiagram.tsx): `components/ChordDiagram.tsx`
- [Fretboard View](https://github.com/marcentella/plainchord/blob/main/components/Fretboard.tsx): `components/Fretboard.tsx`
- [Transition Difficulty](https://github.com/marcentella/plainchord/blob/main/lib/transitionDifficulty.ts): `lib/transitionDifficulty.ts`
- [Difficulty Badge](https://github.com/marcentella/plainchord/blob/main/components/TransitionBadge.tsx): `components/TransitionBadge.tsx`
- [Chord Play-Along](https://github.com/marcentella/plainchord/blob/main/lib/useChordPlayAlong.ts): `lib/useChordPlayAlong.ts`

### Tab Practice

- [Tab Import Page](https://github.com/marcentella/plainchord/blob/main/app/tablatura/page.tsx): `app/tablatura/page.tsx`
- [Text Tab Parser](https://github.com/marcentella/plainchord/blob/main/lib/parseTab.ts): `lib/parseTab.ts`
- [Guitar Pro Import](https://github.com/marcentella/plainchord/blob/main/lib/importGuitarPro.ts): `lib/importGuitarPro.ts`
- [Tab Data Model](https://github.com/marcentella/plainchord/blob/main/lib/tab.ts): `lib/tab.ts`
- [Tab History](https://github.com/marcentella/plainchord/blob/main/lib/tabHistory.ts): `lib/tabHistory.ts`
- [Tab Renderer](https://github.com/marcentella/plainchord/blob/main/components/TabRenderer.tsx): `components/TabRenderer.tsx`
- [Technique Popup](https://github.com/marcentella/plainchord/blob/main/components/TechniquePopup.tsx): `components/TechniquePopup.tsx`
- [Playhead Timing](https://github.com/marcentella/plainchord/blob/main/lib/usePlayhead.ts): `lib/usePlayhead.ts`

### Shared Domain and Audio

- [Chord Detection](https://github.com/marcentella/plainchord/blob/main/lib/chordDetection.ts): `lib/chordDetection.ts`
- [Microphone Input](https://github.com/marcentella/plainchord/blob/main/lib/micInput.ts): `lib/micInput.ts`
- [Audio Playback](https://github.com/marcentella/plainchord/blob/main/lib/useAudioPlayback.ts): `lib/useAudioPlayback.ts`
- [Synth Worker](https://github.com/marcentella/plainchord/blob/main/lib/synth/synthWorker.ts): `lib/synth/synthWorker.ts`
- [Audio Worklet](https://github.com/marcentella/plainchord/blob/main/public/synth-worklet.js): `public/synth-worklet.js`
- [Tone Processing](https://github.com/marcentella/plainchord/blob/main/lib/toneChain.ts): `lib/toneChain.ts`
- [Glossary Data](https://github.com/marcentella/plainchord/blob/main/lib/glossary.ts): `lib/glossary.ts`

### Other components

- **Learner**

## Connections

- Learner → Landing Page: opens
- Learner → Chord Library: explores chords
- Learner → Technique Glossary: learns notation
- Learner → Tab Import Page: imports tabs
- App Layout → Theme Controls: renders (evidence: `app/layout.tsx`)
- Chord Library → Progression Input: renders (evidence: `app/acordes/page.tsx`)
- Chord Library → Chord Library Data: looks up chords (evidence: `app/acordes/page.tsx`)
- Chord Library → Chord Diagram: renders (evidence: `app/acordes/page.tsx`)
- Chord Library → Difficulty Badge: shows difficulty (evidence: `app/acordes/page.tsx`)
- Chord Library → Chord Play-Along: starts play-along (evidence: `app/acordes/page.tsx`)
- Chord Diagram → Chord Library Data: reads chord (evidence: `components/ChordDiagram.tsx`)
- Chord Diagram → Fretboard View: renders on (evidence: `components/ChordDiagram.tsx`)
- Difficulty Badge → Transition Difficulty: displays result (evidence: `components/TransitionBadge.tsx`)
- Transition Difficulty → Chord Library Data: uses chord data (evidence: `lib/transitionDifficulty.ts`)
- Chord Play-Along → Microphone Input: opens microphone (evidence: `lib/useChordPlayAlong.ts`)
- Chord Play-Along → Chord Detection: analyzes frames (evidence: `lib/useChordPlayAlong.ts`)
- Chord Detection → Chord Library Data: ranks candidates (evidence: `lib/chordDetection.ts`)
- Technique Glossary → Glossary Detail: renders entries (evidence: `app/glosario/page.tsx`)
- Technique Glossary → Glossary Data: reads entries (evidence: `app/glosario/page.tsx`)
- Tab Import Page → Text Tab Parser: parses text (evidence: `app/tablatura/page.tsx`)
- Tab Import Page → Guitar Pro Import: imports files (evidence: `app/tablatura/page.tsx`)
- Tab Import Page → Tab History: saves history (evidence: `app/tablatura/page.tsx`)
- Tab Import Page → Tab Renderer: renders tab (evidence: `app/tablatura/page.tsx`)
- Text Tab Parser → Tab Data Model: produces model (evidence: `lib/parseTab.ts`)
- Guitar Pro Import → Tab Data Model: produces model (evidence: `lib/importGuitarPro.ts`)
- Tab Renderer → Tab Data Model: reads tab (evidence: `components/TabRenderer.tsx`)
- Tab Renderer → Technique Popup: shows techniques (evidence: `components/TabRenderer.tsx`)
- Technique Popup → Glossary Data: looks up symbols (evidence: `components/TechniquePopup.tsx`)
- Tab Import Page → Playhead Timing: controls playback (evidence: `app/tablatura/page.tsx`)
- Playhead Timing → Audio Playback: coordinates audio (evidence: `lib/usePlayhead.ts`)
- Playhead Timing → Tab Data Model: times tab beats (evidence: `lib/usePlayhead.ts`)
- Audio Playback → Synth Worker: sends commands (evidence: `lib/useAudioPlayback.ts`)
- Audio Playback → Tone Processing: configures tone (evidence: `lib/useAudioPlayback.ts`)
- Synth Worker → Audio Worklet: streams samples (evidence: `lib/synth/synthWorker.ts`)
