# shorepine/amy architecture

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

- Interactive diagram: https://gitdiagram.com/shorepine/amy
- Repository: https://github.com/shorepine/amy

## Overview

AMY is an embeddable fixed-point synthesizer with Python and other bindings. A typical workflow is to send wire messages or events, configure MIDI or synth voices, render audio, and send samples to a host or hardware audio output. The map retains the documented synth families, effects, sequencing, presets, and platform interfaces. Several source files were not sampled, so some subsystem boundaries follow README capabilities; edges are limited to documented or excerpted relationships.

Main entry points: [`src/amy.c`](https://github.com/shorepine/amy/blob/main/src/amy.c) (Synth Engine), [`src/amy.h`](https://github.com/shorepine/amy/blob/main/src/amy.h) (Event and Wire API), [`amy/__init__.py`](https://github.com/shorepine/amy/blob/main/amy/__init__.py) (Python API), [`src/pcm.c`](https://github.com/shorepine/amy/blob/main/src/pcm.c) (PCM Sampler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["Host Interfaces"]
  node_python["Python API<br/>[__init__.py]"]
  node_python_fm["FM Patch Tools<br/>[fm.py]"]
  node_python_juno["Juno Patch Tools<br/>[juno.py]"]
  node_godot["Godot Binding"]
  node_daisy["Daisy Platform<br/>[amy_daisy.cpp]"]
  node_web["JavaScript Bridge<br/>[amy_connector.js]"]
end

subgraph group_control["Events and MIDI"]
  node_event_api["Event and Wire API<br/>[amy.h]"]
  node_midi["MIDI Handling<br/>[amy_midi.c]"]
  node_sequencer["Clock Sequencer<br/>[sequencer.h]"]
end

subgraph group_synthesis["Synthesis Engine"]
  node_engine["Synth Engine<br/>[amy.c]"]
  node_oscillators["Oscillator Voices<br/>[oscillators.c]"]
  node_filters["Filters and Effects<br/>[filters.c]"]
  node_fm["FM Synthesis<br/>[algorithms.c]"]
  node_partials["Partial Synthesis<br/>[interp_partials.h]"]
  node_pcm["PCM Sampler<br/>[pcm.c]"]
end

subgraph group_audio["Audio and Presets"]
  node_patches["Patch Presets<br/>[patches.c]"]
  node_piano["Piano Parameters<br/>[piano_params.py]"]
  node_audio_out["Audio Output<br/>[audio_i2s.c]"]
  node_audio_buffers["Audio Buffers<br/>[buffer.h]"]
  node_pcm_data[("Built-in Samples")]
end

node_user(("Host User"))

node_user -->|"sends commands"| node_python
node_python -->|"calls native API"| node_event_api
node_python_fm -->|"creates patches"| node_python
node_python_juno -->|"creates patches"| node_python
node_godot -->|"binds C API"| node_event_api
node_daisy -->|"submits events"| node_event_api
node_web -.->|"sends commands"| node_event_api
node_event_api -->|"configures synthesis"| node_engine
node_midi -->|"controls voices"| node_engine
node_sequencer -->|"schedules events"| node_engine
node_engine -.->|"renders voices"| node_oscillators
node_engine -.->|"applies effects"| node_filters
node_engine -.->|"renders FM"| node_fm
node_engine -.->|"renders partials"| node_partials
node_engine -.->|"renders samples"| node_pcm
node_engine -->|"uses presets"| node_patches
node_engine -->|"supports piano voice"| node_piano
node_pcm -->|"reads samples"| node_pcm_data
node_engine -.->|"outputs audio"| node_audio_out
node_audio_out -->|"uses buffers"| node_audio_buffers

click node_python "https://github.com/shorepine/amy/blob/main/amy/__init__.py"
click node_python_fm "https://github.com/shorepine/amy/blob/main/amy/fm.py"
click node_python_juno "https://github.com/shorepine/amy/blob/main/amy/juno.py"
click node_godot "https://github.com/shorepine/amy/blob/main/godot/src/amy_gdextension.cpp"
click node_daisy "https://github.com/shorepine/amy/blob/main/daisy/amy_daisy.cpp"
click node_web "https://github.com/shorepine/amy/blob/main/src/amy_connector.js"
click node_event_api "https://github.com/shorepine/amy/blob/main/src/amy.h"
click node_midi "https://github.com/shorepine/amy/blob/main/src/amy_midi.c"
click node_sequencer "https://github.com/shorepine/amy/blob/main/src/sequencer.h"
click node_engine "https://github.com/shorepine/amy/blob/main/src/amy.c"
click node_oscillators "https://github.com/shorepine/amy/blob/main/src/oscillators.c"
click node_filters "https://github.com/shorepine/amy/blob/main/src/filters.c"
click node_fm "https://github.com/shorepine/amy/blob/main/src/algorithms.c"
click node_partials "https://github.com/shorepine/amy/blob/main/src/interp_partials.h"
click node_pcm "https://github.com/shorepine/amy/blob/main/src/pcm.c"
click node_patches "https://github.com/shorepine/amy/blob/main/src/patches.c"
click node_piano "https://github.com/shorepine/amy/blob/main/amy/piano_params.py"
click node_audio_out "https://github.com/shorepine/amy/blob/main/src/pico-audio/audio_i2s.c"
click node_audio_buffers "https://github.com/shorepine/amy/blob/main/src/pico-audio/buffer.h"
click node_pcm_data "https://github.com/shorepine/amy/blob/main/src/pcm_samples_gamma808.h"

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_python,node_python_fm,node_python_juno,node_godot,node_daisy,node_web,node_user toneBlue
class node_event_api,node_midi,node_sequencer toneAmber
class node_engine,node_oscillators,node_filters,node_fm,node_partials,node_pcm toneMint
class node_patches,node_piano,node_audio_out,node_audio_buffers,node_pcm_data toneRose
```

## Components

### Host Interfaces

- [Python API](https://github.com/shorepine/amy/blob/main/amy/__init__.py): `amy/__init__.py`
- [FM Patch Tools](https://github.com/shorepine/amy/blob/main/amy/fm.py): `amy/fm.py`
- [Juno Patch Tools](https://github.com/shorepine/amy/blob/main/amy/juno.py): `amy/juno.py`
- [Godot Binding](https://github.com/shorepine/amy/blob/main/godot/src/amy_gdextension.cpp): `godot/src/amy_gdextension.cpp`
- [Daisy Platform](https://github.com/shorepine/amy/blob/main/daisy/amy_daisy.cpp): `daisy/amy_daisy.cpp`
- [JavaScript Bridge](https://github.com/shorepine/amy/blob/main/src/amy_connector.js): `src/amy_connector.js`

### Events and MIDI

- [Event and Wire API](https://github.com/shorepine/amy/blob/main/src/amy.h): `src/amy.h`
- [MIDI Handling](https://github.com/shorepine/amy/blob/main/src/amy_midi.c): `src/amy_midi.c`
- [Clock Sequencer](https://github.com/shorepine/amy/blob/main/src/sequencer.h): `src/sequencer.h`

### Synthesis Engine

- [Synth Engine](https://github.com/shorepine/amy/blob/main/src/amy.c): `src/amy.c`
- [Oscillator Voices](https://github.com/shorepine/amy/blob/main/src/oscillators.c): `src/oscillators.c`
- [Filters and Effects](https://github.com/shorepine/amy/blob/main/src/filters.c): `src/filters.c`
- [FM Synthesis](https://github.com/shorepine/amy/blob/main/src/algorithms.c): `src/algorithms.c`
- [Partial Synthesis](https://github.com/shorepine/amy/blob/main/src/interp_partials.h): `src/interp_partials.h`
- [PCM Sampler](https://github.com/shorepine/amy/blob/main/src/pcm.c): `src/pcm.c`

### Audio and Presets

- [Patch Presets](https://github.com/shorepine/amy/blob/main/src/patches.c): `src/patches.c`
- [Piano Parameters](https://github.com/shorepine/amy/blob/main/amy/piano_params.py): `amy/piano_params.py`
- [Audio Output](https://github.com/shorepine/amy/blob/main/src/pico-audio/audio_i2s.c): `src/pico-audio/audio_i2s.c`
- [Audio Buffers](https://github.com/shorepine/amy/blob/main/src/pico-audio/buffer.h): `src/pico-audio/buffer.h`
- [Built-in Samples](https://github.com/shorepine/amy/blob/main/src/pcm_samples_gamma808.h): `src/pcm_samples_gamma808.h`

### Other components

- **Host User**

## Connections

- Host User → Python API: sends commands (evidence: `README.md`)
- Python API → Event and Wire API: calls native API (evidence: `amy/__init__.py`)
- FM Patch Tools → Python API: creates patches (evidence: `amy/fm.py`)
- Juno Patch Tools → Python API: creates patches (evidence: `amy/juno.py`)
- Godot Binding → Event and Wire API: binds C API (evidence: `godot/src/amy_gdextension.cpp`)
- Daisy Platform → Event and Wire API: submits events (evidence: `daisy/amy_daisy.cpp`)
- JavaScript Bridge → Event and Wire API: sends commands
- Event and Wire API → Synth Engine: configures synthesis (evidence: `README.md`)
- MIDI Handling → Synth Engine: controls voices (evidence: `README.md`)
- Clock Sequencer → Synth Engine: schedules events (evidence: `README.md`)
- Synth Engine → Oscillator Voices: renders voices
- Synth Engine → Filters and Effects: applies effects
- Synth Engine → FM Synthesis: renders FM
- Synth Engine → Partial Synthesis: renders partials
- Synth Engine → PCM Sampler: renders samples
- Synth Engine → Patch Presets: uses presets (evidence: `src/patches.c`)
- Synth Engine → Piano Parameters: supports piano voice (evidence: `README.md`)
- PCM Sampler → Built-in Samples: reads samples
- Synth Engine → Audio Output: outputs audio
- Audio Output → Audio Buffers: uses buffers (evidence: `src/pico-audio/audio_i2s.c`)
