# audiokit/audiokitsynthone architecture

> Architecture diagram of the GitHub repository audiokit/audiokitsynthone, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/audiokit/audiokitsynthone
- Repository: https://github.com/audiokit/audiokitsynthone

## Overview

##### Project Type and Purpose
- AudioKit Synth One is a full-featured iOS audio synthesizer app.
- It is built as an Xcode workspace combining Swift-based UI code, Objective-C/C++ DSP kernels, CocoaPods for the AudioKit framework, an optional Ableton Link SDK, and a OneSignal notification extension.

##### File Structure Analysis
- Top-level:
- AudioKitSynthOne.xcworkspace & .xcodeproj – Xcode workspace integrating source and pods
- Podfile / Podfile.lock – CocoaPods dependencies (AudioKit, OneSignal, etc.)
- OneSignalNotificationServiceExtension/ – separate target for push notifications
- Source root “AudioKitSynthOne/”: subdivided into logical feature folders:
- UI panels: About, Effects, Envelopes, Generators, Header, Keyboard, Presets, Sequencer, TouchPad, Tunings
- Shared UI controls: Controls/Buttons, Knobs, Stepper
- Global managers & navigation: Manager/, Navigation/
- DSP engine: DSP/ (Conductor.swift, audio unit bridge, DSP Kernel C++ files, note state, sequencer, TAAE threading)
- Link integration: Link/ (Ableton Link wrapper files)
- MIDI handling: MIDI/
- Presets data: Presets/Data/*.json
- Settings & app-wide utilities: Settings/, Helpers.swift
- Translations & assets: Assets/, Translations/, .lproj folders
- Build configurations: swiftlint, Travis CI, crowdin config, Podspecs.

##### README Insights
- Uses AudioKit for low-level DSP; pods must be installed first.
- Ableton Link support is optional, enabled via build flag and SDK folder.
- OneSignal extension is a separate binary target.
- Code is modularized by feature with folder-level READMEs, consistent MVC/delegation patterns.

##### Main Components
A. Front-end UI Layer (Swift UIViewControllers & custom controls)
- Feature Panels (GeneratorsPanelController, EffectsPanelController, etc.)
- Shared Controls (Buttons, Knobs, Steppers)
- Navigation & Manager classes orchestrate view embedding and delegation
B. Application Controller Layer
- Manager.swift orchestrates parameter change propagation, view updates, push notifications
- MIDI Manager & Link Manager handle real-time MIDI events and Ableton Link synchronization
C. Audio Engine Layer
- Conductor.swift – central coordinator calling into DSP Kernel
- Audio Unit Bridge (S1AudioUnit.h/.mm) exports AUv3 plugin interface
- DSP Kernel (S1DSPKernel.cpp/.mm) implements audio processing graph
- Bandlimited Wavetables, NoteState, Sequencer components supply data to kernel
- TAAE submodule handles thread-safe audio data passing
D. Data Persistence & Assets
- PresetDataManager loading/saving JSON preset banks
- TuningBank & default tunings JSON
- Assets.xcassets for UI images
E. External Services
- CocoaPods dependencies: AudioKit framework, OneSignal SDK
- Optional Ableton Link SDK wrapped under Link/
- OneSignalNotificationServiceExtension running separately under notifications target

##### Relationships & Data Flows
- UI Panel → Manager (delegation) → Conductor → DSP Kernel → Audio Hardware
- Manager / Link Manager listens to Ableton Link timeline → updates Conductor tempo
- MIDI inputs → MIDI Manager → Conductor → DSP Kernel
- Preset editor UI → PresetDataManager → JSON store
- Push notifications handled in extension → delivered to main app via system APIs

##### Architectural Patterns & Design Principles
- Layered MVC-style separation: UI Views/Controllers, Managers, Engine
- Delegation patterns between Manager and feature views
- Single Conductor singleton coordinating all audio parameter changes
- Thread-safe message queue (TAAE) for real-time audio thread communication
- Feature modules encapsulated in folders with per-module README

##### Technologies & Frameworks
- Swift (UI, Managers, wrapping code)
- Objective-C / C++ (Audio Unit, DSP kernel)
- AudioKit (pod-provided DSP building blocks)
- Ableton Link SDK (optional tempo sync)
- OneSignal SDK (push notifications)
- CocoaPods, Xcode workspace, Travis CI

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% UI Layer
    subgraph "Mobile UI Layer"
        direction TB
        GP["GeneratorsPanelController"]:::ui
        EP["EffectsPanelController"]:::ui
        EnP["EnvelopesPanelController"]:::ui
        SP["SequencerPanelController"]:::ui
        TP["TouchPadPanelController"]:::ui
        TuP["TuningsPanelController"]:::ui
        KS["KeyboardSettingsViewController"]:::ui
        PV["PresetsViewController"]:::ui
        AV["AboutViewController"]:::ui
        HV["HeaderViewContoller"]:::ui

        subgraph "Shared Controls"
            direction TB
            Btn["Buttons"]:::ui
            Knb["Knobs"]:::ui
            Stp["Steppers"]:::ui
        end
    end

    %% Controllers & Managers
    subgraph "Application Controller Layer"
        direction TB
        Mgr["Manager.swift"]:::ctrl
        Nav["Navigation"]:::ctrl
        MIDI["MIDI Manager"]:::ctrl
        LinkM["Ableton Link Manager"]:::ctrl
        Push["PushNotification Delegate"]:::ctrl
    end

    %% Audio Engine
    subgraph "Real-Time Audio Engine Layer"
        direction TB
        Conductor["Conductor.swift"]:::engine
        AUBridge["S1AudioUnit (AUv3 Bridge)"]:::engine
        DSP["DSP Kernel"]:::engine
        WTable["Bandlimited Wavetables"]:::engine
        NoteSt["NoteState"]:::engine
        SeqEng["Internal Sequencer"]:::engine
        TAAE["TAAE Threading"]:::engine
    end

    %% Data & Assets
    subgraph "Data Persistence & Assets"
        direction TB
        PDM["PresetDataManager"]:::data
        JSON["Presets JSON Banks"]:::data
        TBnk["TuningBank & Defaults"]:::data
        Assets["Assets Catalog"]:::data
    end

    %% External Services
    subgraph "External Services & SDKs"
        direction TB
        Pods["CocoaPods Dependencies"]:::ext
        LinkSDK["Ableton Link SDK"]:::ext
        NSExt["OneSignal Notification Extension"]:::ext
    end

    %% Relationships
    GP -->|delegates to| Mgr
    EP -->|delegates to| Mgr
    EnP -->|delegates to| Mgr
    SP -->|delegates to| Mgr
    TP -->|delegates to| Mgr
    TuP -->|delegates to| Mgr
    KS -->|delegates to| Mgr
    PV -->|delegates to| Mgr
    AV -->|delegates to| Mgr
    HV -->|delegates to| Mgr

    Btn -->|used by| GP
    Knb -->|used by| EP
    Stp -->|used by| EnP

    Mgr -->|orchestrates| Conductor
    MIDI -->|sends events| Conductor
    LinkM -->|syncs tempo| Conductor
    Push -->|handles notifications| Mgr

    Conductor -->|calls| DSP
    Conductor -->|loads AU| AUBridge

    DSP -->|uses| WTable
    DSP -->|uses| NoteSt
    DSP -->|uses| SeqEng
    DSP -->|communicates via| TAAE

    PV -->|loads/saves| PDM
    PDM -->|reads/writes| JSON

    TuP -->|loads| TBnk

    Assets -->|provides| GP

    Pods -->|provides AudioKit & OneSignal| Conductor
    LinkSDK -->|used by| LinkM
    NSExt -->|push target| Push

    %% Click Events
    click GP "https://github.com/audiokit/audiokitsynthone/blob/master/AudioKitSynthOne/Generators/GeneratorsPanelController.swift"
    click EP "https://github.com/audiokit/audiokitsynthone/blob/master/AudioKitSynthOne/Effects/EffectsPanelController.swift"
    click EnP "https://github.com/audiokit/audiokitsynthone/blob/master/AudioKitSynthOne/Envelopes/EnvelopesPanelController.swift"
    click SP "https://github.com/audiokit/audiokitsynthone/blob/master/AudioKitSynthOne/Sequencer/SequencerPanelController.swift"
    click TP "https://github.com/audiokit/audiokitsynthone/blob/master/AudioKitSynthOne/TouchPad/TouchPadPanelController.swift"
    click TuP "https://github.com/audiokit/audiokitsynthone/blob/master/AudioKitSynthOne/Tunings/TuningsPanelController/TuningsPanelController.swift"
    click KS "https://github.com/audiokit/audiokitsynthone/blob/master/AudioKitSynthOne/Keyboard/KeyboardSettingsViewController.swift"
    click PV "https://github.com/audiokit/audiokitsynthone/blob/master/AudioKitSynthOne/Presets/PresetsViewController/PresetsViewController.swift"
    click AV "https://github.com/audiokit/audiokitsynthone/blob/master/AudioKitSynthOne/About/AboutViewController.swift"
    click HV "https://github.com/audiokit/audiokitsynthone/blob/master/AudioKitSynthOne/Header/HeaderViewContoller.swift"
    click Btn "https://github.com/audiokit/audiokitsynthone/tree/master/AudioKitSynthOne/Controls/Buttons/"
    click Knb "https://github.com/audiokit/audiokitsynthone/tree/master/AudioKitSynthOne/Controls/Knobs/"
    click Stp "https://github.com/audiokit/audiokitsynthone/tree/master/AudioKitSynthOne/Controls/Stepper/"
    click Mgr "https://github.com/audiokit/audiokitsynthone/blob/master/AudioKitSynthOne/Manager/Manager.swift"
    click Nav "https://github.com/audiokit/audiokitsynthone/tree/master/AudioKitSynthOne/Navigation/"
    click MIDI "https://github.com/audiokit/audiokitsynthone/blob/master/AudioKitSynthOne/MIDI/Manager+MIDIListener.swift"
    click LinkM "https://github.com/audiokit/audiokitsynthone/blob/master/AudioKitSynthOne/Link/ABLLinkManager.swift"
    click Push "https://github.com/audiokit/audiokitsynthone/blob/master/AudioKitSynthOne/Manager/Manager+PushNotification.swift"
    click Conductor "https://github.com/audiokit/audiokitsynthone/blob/master/AudioKitSynthOne/DSP/Conductor.swift"
    click AUBridge "https://github.com/audiokit/audiokitsynthone/blob/master/AudioKitSynthOne/DSP/Audio Unit/S1AudioUnit.h"
    click DSP "https://github.com/audiokit/audiokitsynthone/tree/master/AudioKitSynthOne/DSP/Kernel/"
    click WTable "https://github.com/audiokit/audiokitsynthone/tree/master/AudioKitSynthOne/DSP/BandlimitedWavetables/"
    click NoteSt "https://github.com/audiokit/audiokitsynthone/blob/master/AudioKitSynthOne/DSP/Note State/S1NoteState.hpp"
    click SeqEng "https://github.com/audiokit/audiokitsynthone/tree/master/AudioKitSynthOne/DSP/Sequencer/"
    click TAAE "https://github.com/audiokit/audiokitsynthone/tree/master/AudioKitSynthOne/DSP/TAAE/"
    click PDM "https://github.com/audiokit/audiokitsynthone/blob/master/AudioKitSynthOne/Presets/PresetDataManager.swift"
    click JSON "https://github.com/audiokit/audiokitsynthone/tree/master/AudioKitSynthOne/Presets/Data/"
    click TBnk "https://github.com/audiokit/audiokitsynthone/blob/master/AudioKitSynthOne/Tunings/Model/TuningBank.swift"
    click Assets "https://github.com/audiokit/audiokitsynthone/tree/master/AudioKitSynthOne/Assets/Assets.xcassets/"
    click Pods "https://github.com/audiokit/audiokitsynthone/tree/master/Podfile"
    click LinkSDK "https://github.com/audiokit/audiokitsynthone/tree/master/AudioKitSynthOne/Link/"
    click NSExt "https://github.com/audiokit/audiokitsynthone/tree/master/OneSignalNotificationServiceExtension/"
    
    %% Styles
    classDef ui fill:#E0F7FA,stroke:#006064,color:#006064
    classDef ctrl fill:#E8F5E9,stroke:#1B5E20,color:#1B5E20
    classDef engine fill:#FFF3E0,stroke:#E65100,color:#E65100
    classDef data fill:#FFFDE7,stroke:#F9A825,color:#F9A825
    classDef ext fill:#ECEFF1,stroke:#455A64,color:#455A64
```
