# eli7vh/felucca architecture

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

- Interactive diagram: https://gitdiagram.com/eli7vh/felucca
- Repository: https://github.com/eli7vh/felucca

## Overview

WaveLoop Kit/Felucca is standalone multi-engine synthesizer firmware for the M-VAVE FM-1, with MiniLab 3 MIDI control, on-device sequencing and editing, persistent projects and presets, USB/MIDI, browser emulation, and firmware update support. The main workflow is panel or MIDI input into performance and sequencing controls, which select engine voices and effects for audio output; UI drawing presents device state. Persistence and browser/update paths are separate supporting branches. Some subsystem links are documented in the README; unsampled implementation details are not inferred.

Main entry points: [`firmware/src/ui.c`](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/ui.c) (Device UI), [`firmware/src/engines.c`](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/engines.c) (Engine selection), [`firmware/src/main.c`](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/main.c) (Firmware runtime), [`web/emu/felucca_web.c`](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/web/emu/felucca_web.c) (Browser emulator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Panel and UI"]
  node_input["Panel input<br/>[fm1_input.h]"]
  node_ui["Device UI<br/>[ui.c]"]
  node_ui_input["UI input<br/>[ui_input.c]"]
  node_ui_draw["UI drawing<br/>[ui_draw.c]"]
  node_ui_graph["UI graphs<br/>[ui_graph.c]"]
  node_ui_layer["Quick layers<br/>[ui_layer.c]"]
  node_ui_menu["Settings menu<br/>[ui_menu.c]"]
  node_main["Firmware runtime<br/>[main.c]"]
end

subgraph group_music["Performance and sound"]
  node_sequencer["Sequencer and songs<br/>[seq.c]"]
  node_performance["Keys and chords<br/>[perform.c]"]
  node_modulation["Modulation<br/>[mod.c]"]
  node_engine_registry["Engine selection<br/>[engines.c]"]
  node_fm6["FM6 engine<br/>[eng_fm6.c]"]
  node_fm6_core["FM6 synthesis core<br/>[fm6_core.c]"]
  node_grain["Grain engine<br/>[eng_grain.c]"]
  node_slice["Slice engine<br/>[eng_slice.c]"]
  node_drum_voice["Drum voices<br/>[drum_voice.c]"]
  node_audio["Audio rendering<br/>[audio.c]"]
  node_fx["Effects<br/>[fx.c]"]
end

subgraph group_state["Projects and persistence"]
  node_project["Projects and presets<br/>[project.c]"]
  node_storage[("Persistent storage<br/>[storage.c]")]
end

subgraph group_connectivity["USB and browser"]
  node_usb["USB and MIDI<br/>[usb.c]"]
  node_midi_uart["TRS MIDI<br/>[midi_uart.c]"]
  node_web_emu["Browser emulator<br/>[felucca_web.c]"]
  node_worklet["Audio worklet<br/>[worklet.js]"]
  node_backup["Web backup<br/>[fm1backup.js]"]
  node_web_ota["Web updater<br/>[fm1ota.js]"]
  node_loader["Device update loader<br/>[loader.c]"]
  node_loader_core["Update image writer<br/>[ldr_core.c]"]
end

node_player(("Player / MIDI controller"))

node_player -->|"plays controls"| node_input
node_input -.->|"scans input"| node_ui_input
node_ui_input -.->|"dispatches actions"| node_ui
node_ui -.->|"renders screens"| node_ui_draw
node_ui -.->|"shows graphs"| node_ui_graph
node_ui -.->|"opens layers"| node_ui_layer
node_ui -.->|"opens settings"| node_ui_menu
node_main -.->|"runs interface"| node_ui
node_player -->|"records patterns"| node_sequencer
node_player -->|"plays notes"| node_performance
node_player -->|"controls parameters"| node_modulation
node_sequencer -.->|"selects track sound"| node_engine_registry
node_performance -.->|"triggers sound"| node_engine_registry
node_engine_registry -->|"dispatches engines"| node_fm6
node_engine_registry -->|"dispatches engines"| node_grain
node_engine_registry -->|"dispatches engines"| node_slice
node_engine_registry -->|"dispatches drums"| node_drum_voice
node_fm6 -->|"uses synthesis core"| node_fm6_core
node_engine_registry -.->|"renders tracks"| node_audio
node_audio -->|"processes effects"| node_fx
node_ui -.->|"edits presets"| node_project
node_project -->|"loads and saves"| node_storage
node_main -.->|"boots persistence"| node_storage
node_player -->|"sends MIDI"| node_usb
node_player -->|"sends TRS MIDI"| node_midi_uart
node_web_emu -->|"runs audio in"| node_worklet
node_web_emu -->|"runs firmware"| node_main
node_player -->|"backs up device"| node_backup
node_player -->|"starts update"| node_web_ota
node_web_ota -.->|"transfers firmware"| node_loader
node_loader -->|"writes image"| node_loader_core

click node_input "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/hal/fm1_input.h"
click node_ui "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/ui.c"
click node_ui_input "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/ui_input.c"
click node_ui_draw "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/ui_draw.c"
click node_ui_graph "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/ui_graph.c"
click node_ui_layer "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/ui_layer.c"
click node_ui_menu "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/ui_menu.c"
click node_main "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/main.c"
click node_sequencer "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/seq.c"
click node_performance "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/perform.c"
click node_modulation "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/mod.c"
click node_engine_registry "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/engines.c"
click node_fm6 "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/eng_fm6.c"
click node_fm6_core "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/fm6_core.c"
click node_grain "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/eng_grain.c"
click node_slice "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/eng_slice.c"
click node_drum_voice "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/drum_voice.c"
click node_audio "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/audio.c"
click node_fx "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/fx.c"
click node_project "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/project.c"
click node_storage "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/storage.c"
click node_usb "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/usb.c"
click node_midi_uart "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/midi_uart.c"
click node_web_emu "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/web/emu/felucca_web.c"
click node_worklet "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/web/emu/worklet.js"
click node_backup "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/web/fm1backup.js"
click node_web_ota "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/web/fm1ota.js"
click node_loader "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/loader/loader.c"
click node_loader_core "https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/loader/ldr_core.c"

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_input,node_ui,node_ui_input,node_ui_draw,node_ui_graph,node_ui_layer,node_ui_menu,node_main toneBlue
class node_sequencer,node_performance,node_modulation,node_engine_registry,node_fm6,node_fm6_core,node_grain,node_slice,node_drum_voice,node_audio,node_fx toneAmber
class node_project,node_storage toneMint
class node_usb,node_midi_uart,node_web_emu,node_worklet,node_backup,node_web_ota,node_loader,node_loader_core toneRose
class node_player toneIndigo
```

## Components

### Panel and UI

- [Panel input](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/hal/fm1_input.h): `firmware/hal/fm1_input.h`
- [Device UI](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/ui.c): `firmware/src/ui.c`
- [UI input](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/ui_input.c): `firmware/src/ui_input.c`
- [UI drawing](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/ui_draw.c): `firmware/src/ui_draw.c`
- [UI graphs](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/ui_graph.c): `firmware/src/ui_graph.c`
- [Quick layers](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/ui_layer.c): `firmware/src/ui_layer.c`
- [Settings menu](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/ui_menu.c): `firmware/src/ui_menu.c`
- [Firmware runtime](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/main.c): `firmware/src/main.c`

### Performance and sound

- [Sequencer and songs](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/seq.c): `firmware/src/seq.c`
- [Keys and chords](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/perform.c): `firmware/src/perform.c`
- [Modulation](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/mod.c): `firmware/src/mod.c`
- [Engine selection](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/engines.c): `firmware/src/engines.c`
- [FM6 engine](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/eng_fm6.c): `firmware/src/eng_fm6.c`
- [FM6 synthesis core](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/fm6_core.c): `firmware/src/fm6_core.c`
- [Grain engine](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/eng_grain.c): `firmware/src/eng_grain.c`
- [Slice engine](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/eng_slice.c): `firmware/src/eng_slice.c`
- [Drum voices](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/drum_voice.c): `firmware/src/drum_voice.c`
- [Audio rendering](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/audio.c): `firmware/src/audio.c`
- [Effects](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/fx.c): `firmware/src/fx.c`

### Projects and persistence

- [Projects and presets](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/project.c): `firmware/src/project.c`
- [Persistent storage](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/storage.c): `firmware/src/storage.c`

### USB and browser

- [USB and MIDI](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/usb.c): `firmware/src/usb.c`
- [TRS MIDI](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/src/midi_uart.c): `firmware/src/midi_uart.c`
- [Browser emulator](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/web/emu/felucca_web.c): `web/emu/felucca_web.c`
- [Audio worklet](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/web/emu/worklet.js): `web/emu/worklet.js`
- [Web backup](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/web/fm1backup.js): `web/fm1backup.js`
- [Web updater](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/web/fm1ota.js): `web/fm1ota.js`
- [Device update loader](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/loader/loader.c): `firmware/loader/loader.c`
- [Update image writer](https://github.com/eli7vh/felucca/blob/codex/standalone-minilab-midi/firmware/loader/ldr_core.c): `firmware/loader/ldr_core.c`

### Other components

- **Player / MIDI controller**

## Connections

- Player / MIDI controller → Panel input: plays controls
- Panel input → UI input: scans input
- UI input → Device UI: dispatches actions
- Device UI → UI drawing: renders screens
- Device UI → UI graphs: shows graphs
- Device UI → Quick layers: opens layers
- Device UI → Settings menu: opens settings
- Firmware runtime → Device UI: runs interface
- Player / MIDI controller → Sequencer and songs: records patterns
- Player / MIDI controller → Keys and chords: plays notes
- Player / MIDI controller → Modulation: controls parameters
- Sequencer and songs → Engine selection: selects track sound
- Keys and chords → Engine selection: triggers sound
- Engine selection → FM6 engine: dispatches engines (evidence: `firmware/src/engines.c`)
- Engine selection → Grain engine: dispatches engines (evidence: `firmware/src/engines.c`)
- Engine selection → Slice engine: dispatches engines (evidence: `firmware/src/engines.c`)
- Engine selection → Drum voices: dispatches drums (evidence: `firmware/src/engines.c`)
- FM6 engine → FM6 synthesis core: uses synthesis core (evidence: `firmware/src/eng_fm6.c`)
- Engine selection → Audio rendering: renders tracks
- Audio rendering → Effects: processes effects
- Device UI → Projects and presets: edits presets
- Projects and presets → Persistent storage: loads and saves
- Firmware runtime → Persistent storage: boots persistence
- Player / MIDI controller → USB and MIDI: sends MIDI
- Player / MIDI controller → TRS MIDI: sends TRS MIDI
- Browser emulator → Audio worklet: runs audio in
- Browser emulator → Firmware runtime: runs firmware (evidence: `web/emu/felucca_web.c`)
- Player / MIDI controller → Web backup: backs up device
- Player / MIDI controller → Web updater: starts update
- Web updater → Device update loader: transfers firmware
- Device update loader → Update image writer: writes image (evidence: `firmware/loader/loader.c`)
