# abhinav-kumar-singh/micmorph architecture

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

- Interactive diagram: https://gitdiagram.com/abhinav-kumar-singh/micmorph
- Repository: https://github.com/abhinav-kumar-singh/micmorph

## Overview

MicMorph is a Tauri desktop app that captures a physical microphone, shifts pitch in real time, and routes the result to a virtual microphone for calling apps. The main workflow runs from UI controls through Tauri commands into the audio engine and SoundTouch processor. The README documents preview, presets, tray controls, local settings, and virtual-driver setup; the excerpts show the main UI, command, engine, processor, device, and tray links. Some platform-specific activity monitoring and installer internals are only partially evidenced, so uncertain connections are omitted.

Main entry points: [`src-tauri/src/audio/engine.rs`](https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/audio/engine.rs) (Audio engine), [`src/main.js`](https://github.com/abhinav-kumar-singh/micmorph/blob/main/src/main.js) (MicMorph UI), [`src-tauri/src/commands.rs`](https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/commands.rs) (Tauri commands), [`src-tauri/src/main.rs`](https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/main.rs) (Tauri app and tray)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_ui["MicMorph UI<br/>[main.js]"]
end

subgraph group_backend["App control"]
  node_commands["Tauri commands<br/>[commands.rs]"]
  node_app["Tauri app and tray<br/>[main.rs]"]
  node_usage["Usage and settings<br/>[commands.rs]"]
  node_config[("Local config<br/>[commands.rs]")]
end

subgraph group_audio["Audio processing"]
  node_devices["Audio devices<br/>[devices.rs]"]
  node_engine["Audio engine<br/>[engine.rs]"]
  node_processor["Pitch processor<br/>[processor.rs]"]
end

subgraph group_system["System integration"]
  node_virtual["Virtual audio driver"]
  node_driver["Driver installer<br/>[commands.rs]"]
  node_activity["Virtual-device activity check<br/>[mac_usage.rs]"]
  node_platform_activity["Windows activity fallback<br/>[win_usage.rs]"]
end

node_user(("User"))
node_microphone(("Physical microphone"))
node_preview(("Headphone preview"))
node_calling(("Calling or streaming app"))

node_user -->|"controls"| node_ui
node_ui -->|"invokes commands"| node_commands
node_app -->|"registers commands"| node_commands
node_app -->|"emits tray events"| node_ui
node_ui -->|"receives tray events"| node_app
node_commands -->|"queries devices"| node_devices
node_commands -->|"starts and controls"| node_engine
node_engine -->|"finds virtual output"| node_devices
node_engine -->|"feeds and retrieves samples"| node_processor
node_microphone -->|"provides audio"| node_engine
node_engine -->|"routes processed audio"| node_virtual
node_virtual -->|"provides microphone input"| node_calling
node_engine -->|"plays live preview"| node_preview
node_commands -->|"tracks usage"| node_usage
node_usage -->|"loads and saves"| node_config
node_ui -->|"requests installation"| node_driver
node_driver -->|"installs driver"| node_virtual
node_activity -->|"checks activity"| node_virtual
node_platform_activity -.->|"checks activity"| node_virtual

click node_ui "https://github.com/abhinav-kumar-singh/micmorph/blob/main/src/main.js"
click node_commands "https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/commands.rs"
click node_app "https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/main.rs"
click node_usage "https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/commands.rs"
click node_config "https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/commands.rs"
click node_devices "https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/audio/devices.rs"
click node_engine "https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/audio/engine.rs"
click node_processor "https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/audio/processor.rs"
click node_driver "https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/commands.rs"
click node_activity "https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/audio/mac_usage.rs"
click node_platform_activity "https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/audio/win_usage.rs"

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_user,node_preview toneBlue
class node_commands,node_app,node_usage,node_config toneAmber
class node_devices,node_engine,node_processor toneMint
class node_virtual,node_driver,node_activity,node_platform_activity toneRose
class node_microphone,node_calling toneIndigo
```

## Components

### Desktop interface

- [MicMorph UI](https://github.com/abhinav-kumar-singh/micmorph/blob/main/src/main.js): `src/main.js`

### App control

- [Tauri commands](https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/commands.rs): `src-tauri/src/commands.rs`
- [Tauri app and tray](https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/main.rs): `src-tauri/src/main.rs`
- [Usage and settings](https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/commands.rs): `src-tauri/src/commands.rs`
- [Local config](https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/commands.rs): `src-tauri/src/commands.rs`

### Audio processing

- [Audio devices](https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/audio/devices.rs): `src-tauri/src/audio/devices.rs`
- [Audio engine](https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/audio/engine.rs): `src-tauri/src/audio/engine.rs`
- [Pitch processor](https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/audio/processor.rs): `src-tauri/src/audio/processor.rs`

### System integration

- **Virtual audio driver**
- [Driver installer](https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/commands.rs): `src-tauri/src/commands.rs`
- [Virtual-device activity check](https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/audio/mac_usage.rs): `src-tauri/src/audio/mac_usage.rs`
- [Windows activity fallback](https://github.com/abhinav-kumar-singh/micmorph/blob/main/src-tauri/src/audio/win_usage.rs): `src-tauri/src/audio/win_usage.rs`

### Other components

- **User**
- **Physical microphone**
- **Headphone preview**
- **Calling or streaming app**

## Connections

- User → MicMorph UI: controls (evidence: `README.md`)
- MicMorph UI → Tauri commands: invokes commands (evidence: `src/main.js`)
- Tauri app and tray → Tauri commands: registers commands (evidence: `src-tauri/src/main.rs`)
- Tauri app and tray → MicMorph UI: emits tray events (evidence: `src-tauri/src/main.rs`)
- MicMorph UI → Tauri app and tray: receives tray events (evidence: `src/main.js`)
- Tauri commands → Audio devices: queries devices (evidence: `src-tauri/src/commands.rs`)
- Tauri commands → Audio engine: starts and controls (evidence: `src-tauri/src/commands.rs`)
- Audio engine → Audio devices: finds virtual output (evidence: `src-tauri/src/audio/engine.rs`)
- Audio engine → Pitch processor: feeds and retrieves samples (evidence: `src-tauri/src/audio/engine.rs`)
- Physical microphone → Audio engine: provides audio (evidence: `README.md`)
- Audio engine → Virtual audio driver: routes processed audio (evidence: `README.md`)
- Virtual audio driver → Calling or streaming app: provides microphone input (evidence: `README.md`)
- Audio engine → Headphone preview: plays live preview (evidence: `README.md`)
- Tauri commands → Usage and settings: tracks usage (evidence: `src-tauri/src/commands.rs`)
- Usage and settings → Local config: loads and saves (evidence: `src-tauri/src/commands.rs`)
- MicMorph UI → Driver installer: requests installation (evidence: `src/main.js`)
- Driver installer → Virtual audio driver: installs driver (evidence: `src-tauri/src/commands.rs`)
- Virtual-device activity check → Virtual audio driver: checks activity (evidence: `src-tauri/src/audio/mac_usage.rs`)
- Windows activity fallback → Virtual audio driver: checks activity
