# marzac/zekit architecture

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

- Interactive diagram: https://gitdiagram.com/marzac/zekit
- Repository: https://github.com/marzac/zekit

## Overview

ZeKit is an embedded firmware project for a DIY paraphonic synthesizer. Its principal workflow is user or MIDI input being handled by firmware and producing synthesized audio; the source tree also identifies sequencing, waveform, UI, persistence, and device setup responsibilities. The README confirms the firmware is built and flashed to the board, but the sampled source does not show runtime call relationships, so those links are marked unverified. The schematics provide the hardware context.

Main entry points: [`Firmware/main.c`](https://github.com/marzac/zekit/blob/main/Firmware/main.c) (Firmware Entry), [`Firmware/audio.c`](https://github.com/marzac/zekit/blob/main/Firmware/audio.c) (Audio Engine), [`Firmware/setup.c`](https://github.com/marzac/zekit/blob/main/Firmware/setup.c) (Device Setup), [`Firmware/ui.c`](https://github.com/marzac/zekit/blob/main/Firmware/ui.c) (User Interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Input and Control"]
  node_ui["User Interface<br/>[ui.c]"]
  node_midi["MIDI Handling<br/>[midi.c]"]
  node_sequencer["Music Sequencer<br/>[mseq.c]"]
end

subgraph group_synthesis["Sound Generation"]
  node_audio_engine["Audio Engine<br/>[audio.c]"]
  node_waveforms["Waveform Data<br/>[waves.c]"]
end

subgraph group_platform["Device Platform"]
  node_firmware_entry["Firmware Entry<br/>[main.c]"]
  node_device_setup["Device Setup<br/>[setup.c]"]
  node_interrupts["Interrupt Handling<br/>[interrupts.c]"]
  node_fault_traps["Fault Traps<br/>[traps.c]"]
  node_board_config["Board Configuration<br/>[config.h]"]
  node_pin_mapping["Pin Mapping<br/>[pins.h]"]
  node_state_store[("State Storage<br/>[store.c]")]
  node_firmware_image["Firmware Image"]
end

subgraph group_hardware["Hardware"]
  node_synth_board{{"Synthesizer Board"}}
end

node_musician(("Musician"))
node_midi_source(("MIDI Source"))

node_musician -.->|"controls"| node_ui
node_midi_source -.->|"sends MIDI"| node_midi
node_firmware_entry -.->|"initializes"| node_device_setup
node_firmware_entry -.->|"runs"| node_ui
node_firmware_entry -.->|"runs"| node_midi
node_firmware_entry -.->|"runs"| node_sequencer
node_firmware_entry -.->|"runs"| node_audio_engine
node_firmware_entry -.->|"uses"| node_interrupts
node_firmware_entry -.->|"uses"| node_fault_traps
node_device_setup -.->|"configures"| node_board_config
node_device_setup -.->|"configures"| node_pin_mapping
node_ui -.->|"accesses state"| node_state_store
node_midi -.->|"dispatches events"| node_sequencer
node_sequencer -.->|"provides events"| node_audio_engine
node_audio_engine -.->|"uses"| node_waveforms
node_audio_engine -.->|"outputs audio"| node_synth_board
node_firmware_image -->|"flashed to"| node_synth_board

click node_firmware_entry "https://github.com/marzac/zekit/blob/main/Firmware/main.c"
click node_device_setup "https://github.com/marzac/zekit/blob/main/Firmware/setup.c"
click node_interrupts "https://github.com/marzac/zekit/blob/main/Firmware/interrupts.c"
click node_fault_traps "https://github.com/marzac/zekit/blob/main/Firmware/traps.c"
click node_board_config "https://github.com/marzac/zekit/blob/main/Firmware/config.h"
click node_pin_mapping "https://github.com/marzac/zekit/blob/main/Firmware/pins.h"
click node_ui "https://github.com/marzac/zekit/blob/main/Firmware/ui.c"
click node_midi "https://github.com/marzac/zekit/blob/main/Firmware/midi.c"
click node_sequencer "https://github.com/marzac/zekit/blob/main/Firmware/mseq.c"
click node_state_store "https://github.com/marzac/zekit/blob/main/Firmware/store.c"
click node_audio_engine "https://github.com/marzac/zekit/blob/main/Firmware/audio.c"
click node_waveforms "https://github.com/marzac/zekit/blob/main/Firmware/waves.c"
click node_firmware_image "https://github.com/marzac/zekit/tree/main/Firmware"
click node_synth_board "https://github.com/marzac/zekit/tree/main/Schematics"

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_ui,node_midi,node_sequencer toneBlue
class node_audio_engine,node_waveforms toneAmber
class node_firmware_entry,node_device_setup,node_interrupts,node_fault_traps,node_board_config,node_pin_mapping,node_state_store,node_firmware_image toneMint
class node_synth_board toneRose
class node_musician,node_midi_source toneIndigo
```

## Components

### Input and Control

- [User Interface](https://github.com/marzac/zekit/blob/main/Firmware/ui.c): `Firmware/ui.c`
- [MIDI Handling](https://github.com/marzac/zekit/blob/main/Firmware/midi.c): `Firmware/midi.c`
- [Music Sequencer](https://github.com/marzac/zekit/blob/main/Firmware/mseq.c): `Firmware/mseq.c`

### Sound Generation

- [Audio Engine](https://github.com/marzac/zekit/blob/main/Firmware/audio.c): `Firmware/audio.c`
- [Waveform Data](https://github.com/marzac/zekit/blob/main/Firmware/waves.c): `Firmware/waves.c`

### Device Platform

- [Firmware Entry](https://github.com/marzac/zekit/blob/main/Firmware/main.c): `Firmware/main.c`
- [Device Setup](https://github.com/marzac/zekit/blob/main/Firmware/setup.c): `Firmware/setup.c`
- [Interrupt Handling](https://github.com/marzac/zekit/blob/main/Firmware/interrupts.c): `Firmware/interrupts.c`
- [Fault Traps](https://github.com/marzac/zekit/blob/main/Firmware/traps.c): `Firmware/traps.c`
- [Board Configuration](https://github.com/marzac/zekit/blob/main/Firmware/config.h): `Firmware/config.h`
- [Pin Mapping](https://github.com/marzac/zekit/blob/main/Firmware/pins.h): `Firmware/pins.h`
- [State Storage](https://github.com/marzac/zekit/blob/main/Firmware/store.c): `Firmware/store.c`
- [Firmware Image](https://github.com/marzac/zekit/tree/main/Firmware): `Firmware`

### Hardware

- [Synthesizer Board](https://github.com/marzac/zekit/tree/main/Schematics): `Schematics`

### Other components

- **Musician**
- **MIDI Source**

## Connections

- Musician → User Interface: controls
- MIDI Source → MIDI Handling: sends MIDI
- Firmware Entry → Device Setup: initializes
- Firmware Entry → User Interface: runs
- Firmware Entry → MIDI Handling: runs
- Firmware Entry → Music Sequencer: runs
- Firmware Entry → Audio Engine: runs
- Firmware Entry → Interrupt Handling: uses
- Firmware Entry → Fault Traps: uses
- Device Setup → Board Configuration: configures
- Device Setup → Pin Mapping: configures
- User Interface → State Storage: accesses state
- MIDI Handling → Music Sequencer: dispatches events
- Music Sequencer → Audio Engine: provides events
- Audio Engine → Waveform Data: uses
- Audio Engine → Synthesizer Board: outputs audio
- Firmware Image → Synthesizer Board: flashed to (evidence: `README.md`)
