# maxethan2/react-synth architecture

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

- Interactive diagram: https://gitdiagram.com/maxethan2/react-synth
- Repository: https://github.com/maxethan2/react-synth

## Overview

This is a React/Tone.js browser synthesizer. The main workflow is to play notes from the on-screen keyboard or USB MIDI, shape the sound with oscillator, mixer, filter/LFO, and ADSR controls, then optionally save a sequence for playback or choose a preset. Routing also exposes About and not-found pages. The Synth page owns most audio behavior and coordinates the controls. Several edges reflect documented capabilities or the source index; unsampled implementation details are not inferred.

Main entry points: [`src/pages/Synth.js`](https://github.com/maxethan2/react-synth/blob/master/src/pages/Synth.js) (Synth runtime), [`src/App.js`](https://github.com/maxethan2/react-synth/blob/master/src/App.js) (Route app), [`src/pages/About.js`](https://github.com/maxethan2/react-synth/blob/master/src/pages/About.js) (About page), [`src/Midi.js`](https://github.com/maxethan2/react-synth/blob/master/src/Midi.js) (USB MIDI input)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["App and Pages"]
  node_app["Route app<br/>[App.js]"]
  node_about["About page<br/>[About.js]"]
  node_notfound["Not-found page<br/>[NoPage.js]"]
  node_navbar["Navigation<br/>[NavBar.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
end

subgraph group_sound["Sound Engine"]
  node_synth["Synth runtime<br/>[Synth.js]"]
  node_oscui["Oscillator controls<br/>[OscSelector.jsx]"]
  node_envelope["ADSR controls<br/>[Evnvelope.jsx]"]
end

subgraph group_controls["Performance Controls"]
  node_keyboard["On-screen keyboard<br/>[KeyBoard.jsx]"]
  node_midi["USB MIDI input<br/>[Midi.js]"]
end

subgraph group_patches["Presets and Sequencing"]
  node_sequencerui["Sequencer controls<br/>[Sequencer.jsx]"]
  node_presetui["Preset selector<br/>[PresetBank.jsx]"]
  node_presetdata["Preset definitions"]
end

node_user(("Synth player"))

node_user -->|"opens app"| node_app
node_app -->|"routes to"| node_synth
node_app -->|"routes to"| node_about
node_app -->|"routes to"| node_notfound
node_synth -->|"renders"| node_oscui
node_synth -->|"renders"| node_envelope
node_synth -->|"renders"| node_keyboard
node_synth -->|"starts MIDI"| node_midi
node_midi -->|"dispatches notes"| node_synth
node_synth -->|"renders"| node_sequencerui
node_synth -->|"renders"| node_presetui
node_synth -->|"uses presets"| node_presetdata
node_synth -->|"renders"| node_navbar
node_synth -->|"renders"| node_footer
node_about -->|"renders"| node_navbar
node_about -->|"renders"| node_footer
node_notfound -->|"renders"| node_navbar
node_user -->|"plays notes"| node_keyboard
node_user -.->|"sends MIDI"| node_midi
node_user -.->|"records and plays"| node_sequencerui
node_user -.->|"selects patch"| node_presetui

click node_app "https://github.com/maxethan2/react-synth/blob/master/src/App.js"
click node_synth "https://github.com/maxethan2/react-synth/blob/master/src/pages/Synth.js"
click node_about "https://github.com/maxethan2/react-synth/blob/master/src/pages/About.js"
click node_notfound "https://github.com/maxethan2/react-synth/blob/master/src/pages/NoPage.js"
click node_oscui "https://github.com/maxethan2/react-synth/blob/master/src/Components/OscSelector.jsx"
click node_envelope "https://github.com/maxethan2/react-synth/blob/master/src/Components/Evnvelope.jsx"
click node_keyboard "https://github.com/maxethan2/react-synth/blob/master/src/Components/KeyBoard.jsx"
click node_midi "https://github.com/maxethan2/react-synth/blob/master/src/Midi.js"
click node_sequencerui "https://github.com/maxethan2/react-synth/blob/master/src/Components/Sequencer.jsx"
click node_presetui "https://github.com/maxethan2/react-synth/blob/master/src/Components/PresetBank.jsx"
click node_presetdata "https://github.com/maxethan2/react-synth/blob/master/src/TempPresetStorage.js"
click node_navbar "https://github.com/maxethan2/react-synth/blob/master/src/Components/NavBar.jsx"
click node_footer "https://github.com/maxethan2/react-synth/blob/master/src/Components/Footer.jsx"

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_app,node_about,node_notfound,node_navbar,node_footer toneBlue
class node_synth,node_oscui,node_envelope toneAmber
class node_keyboard,node_midi toneMint
class node_sequencerui,node_presetui,node_presetdata toneRose
class node_user toneIndigo
```

## Components

### App and Pages

- [Route app](https://github.com/maxethan2/react-synth/blob/master/src/App.js): `src/App.js`
- [About page](https://github.com/maxethan2/react-synth/blob/master/src/pages/About.js): `src/pages/About.js`
- [Not-found page](https://github.com/maxethan2/react-synth/blob/master/src/pages/NoPage.js): `src/pages/NoPage.js`
- [Navigation](https://github.com/maxethan2/react-synth/blob/master/src/Components/NavBar.jsx): `src/Components/NavBar.jsx`
- [Footer](https://github.com/maxethan2/react-synth/blob/master/src/Components/Footer.jsx): `src/Components/Footer.jsx`

### Sound Engine

- [Synth runtime](https://github.com/maxethan2/react-synth/blob/master/src/pages/Synth.js): `src/pages/Synth.js`
- [Oscillator controls](https://github.com/maxethan2/react-synth/blob/master/src/Components/OscSelector.jsx): `src/Components/OscSelector.jsx`
- [ADSR controls](https://github.com/maxethan2/react-synth/blob/master/src/Components/Evnvelope.jsx): `src/Components/Evnvelope.jsx`

### Performance Controls

- [On-screen keyboard](https://github.com/maxethan2/react-synth/blob/master/src/Components/KeyBoard.jsx): `src/Components/KeyBoard.jsx`
- [USB MIDI input](https://github.com/maxethan2/react-synth/blob/master/src/Midi.js): `src/Midi.js`

### Presets and Sequencing

- [Sequencer controls](https://github.com/maxethan2/react-synth/blob/master/src/Components/Sequencer.jsx): `src/Components/Sequencer.jsx`
- [Preset selector](https://github.com/maxethan2/react-synth/blob/master/src/Components/PresetBank.jsx): `src/Components/PresetBank.jsx`
- [Preset definitions](https://github.com/maxethan2/react-synth/blob/master/src/TempPresetStorage.js): `src/TempPresetStorage.js`

### Other components

- **Synth player**

## Connections

- Synth player → Route app: opens app
- Route app → Synth runtime: routes to (evidence: `src/App.js`)
- Route app → About page: routes to (evidence: `src/App.js`)
- Route app → Not-found page: routes to (evidence: `src/App.js`)
- Synth runtime → Oscillator controls: renders (evidence: `src/pages/Synth.js`)
- Synth runtime → ADSR controls: renders (evidence: `src/pages/Synth.js`)
- Synth runtime → On-screen keyboard: renders (evidence: `src/pages/Synth.js`)
- Synth runtime → USB MIDI input: starts MIDI (evidence: `src/pages/Synth.js`)
- USB MIDI input → Synth runtime: dispatches notes (evidence: `src/Midi.js`)
- Synth runtime → Sequencer controls: renders (evidence: `src/pages/Synth.js`)
- Synth runtime → Preset selector: renders (evidence: `src/pages/Synth.js`)
- Synth runtime → Preset definitions: uses presets (evidence: `src/pages/Synth.js`)
- Synth runtime → Navigation: renders (evidence: `src/pages/Synth.js`)
- Synth runtime → Footer: renders (evidence: `src/pages/Synth.js`)
- About page → Navigation: renders (evidence: `src/pages/About.js`)
- About page → Footer: renders (evidence: `src/pages/About.js`)
- Not-found page → Navigation: renders (evidence: `src/pages/NoPage.js`)
- Synth player → On-screen keyboard: plays notes (evidence: `src/Components/KeyBoard.jsx`)
- Synth player → USB MIDI input: sends MIDI (evidence: `README.md`)
- Synth player → Sequencer controls: records and plays (evidence: `README.md`)
- Synth player → Preset selector: selects patch (evidence: `README.md`)
