# ericwei97-cloud/gesture-synth architecture

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

- Interactive diagram: https://gitdiagram.com/ericwei97-cloud/gesture-synth
- Repository: https://github.com/ericwei97-cloud/gesture-synth

## Overview

Gesture Synth is a browser-based musical instrument: camera input feeds hand tracking, whose gestures are stabilized and translated into chord and expression controls for Web Audio synthesis and visual feedback. The sampled source places these responsibilities in one file, so nodes distinguish runtime stages rather than separate modules. The README documents the left-hand chord and right-hand voicing/expression roles; excerpts do not show enough detail to map each gesture to a specific musical parameter.

Main entry points: [`main.js`](https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js) (Musical State)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Camera and Tracking"]
  node_camera["Camera Capture<br/>[main.js]"]
  node_hand_tracker["Hand Tracking<br/>[main.js]"]
  node_landmarks["Hand Landmarks<br/>[main.js]"]
end

subgraph group_music["Gesture to Music"]
  node_gesture_analysis["Gesture Analysis<br/>[main.js]"]
  node_gesture_stabilizers["Gesture Stabilizers<br/>[main.js]"]
  node_musical_state["Musical State<br/>[main.js]"]
  node_chord_mapping["Chord and Key Mapping<br/>[main.js]"]
  node_expression_mapping["Expression Mapping<br/>[main.js]"]
end

subgraph group_output["Sound and Interface"]
  node_synth_engine["Synth Engine<br/>[main.js]"]
  node_audio_output["Audio Output"]
  node_visual_feedback["Visual Feedback<br/>[main.js]"]
end

node_player(("Player"))

node_player -->|"provides video"| node_camera
node_camera -->|"supplies frames"| node_hand_tracker
node_hand_tracker -->|"detects hands"| node_landmarks
node_landmarks -->|"analyzes landmarks"| node_gesture_analysis
node_gesture_analysis -->|"stabilizes gestures"| node_gesture_stabilizers
node_gesture_stabilizers -->|"produces state"| node_musical_state
node_musical_state -->|"selects chords"| node_chord_mapping
node_musical_state -->|"maps expression"| node_expression_mapping
node_expression_mapping -->|"sets expression"| node_synth_engine
node_synth_engine -->|"outputs audio"| node_audio_output
node_chord_mapping -.->|"sets notes"| node_synth_engine
node_musical_state -->|"updates display"| node_visual_feedback

click node_camera "https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js"
click node_hand_tracker "https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js"
click node_landmarks "https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js"
click node_gesture_analysis "https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js"
click node_gesture_stabilizers "https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js"
click node_musical_state "https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js"
click node_chord_mapping "https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js"
click node_expression_mapping "https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js"
click node_synth_engine "https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js"
click node_visual_feedback "https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js"

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_camera,node_hand_tracker,node_landmarks toneBlue
class node_gesture_analysis,node_gesture_stabilizers,node_musical_state,node_chord_mapping,node_expression_mapping toneAmber
class node_synth_engine,node_audio_output,node_visual_feedback toneMint
class node_player toneIndigo
```

## Components

### Camera and Tracking

- [Camera Capture](https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js): `main.js`
- [Hand Tracking](https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js): `main.js`
- [Hand Landmarks](https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js): `main.js`

### Gesture to Music

- [Gesture Analysis](https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js): `main.js`
- [Gesture Stabilizers](https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js): `main.js`
- [Musical State](https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js): `main.js`
- [Chord and Key Mapping](https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js): `main.js`
- [Expression Mapping](https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js): `main.js`

### Sound and Interface

- [Synth Engine](https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js): `main.js`
- **Audio Output**
- [Visual Feedback](https://github.com/ericwei97-cloud/gesture-synth/blob/main/main.js): `main.js`

### Other components

- **Player**

## Connections

- Player → Camera Capture: provides video (evidence: `main.js`)
- Camera Capture → Hand Tracking: supplies frames (evidence: `main.js`)
- Hand Tracking → Hand Landmarks: detects hands (evidence: `main.js`)
- Hand Landmarks → Gesture Analysis: analyzes landmarks (evidence: `main.js`)
- Gesture Analysis → Gesture Stabilizers: stabilizes gestures (evidence: `main.js`)
- Gesture Stabilizers → Musical State: produces state (evidence: `main.js`)
- Musical State → Chord and Key Mapping: selects chords (evidence: `main.js`)
- Musical State → Expression Mapping: maps expression (evidence: `main.js`)
- Expression Mapping → Synth Engine: sets expression (evidence: `main.js`)
- Synth Engine → Audio Output: outputs audio (evidence: `main.js`)
- Chord and Key Mapping → Synth Engine: sets notes (evidence: `main.js`)
- Musical State → Visual Feedback: updates display (evidence: `main.js`)
