Skip to content

Data Flow

mzuelch edited this page Jan 25, 2026 · 3 revisions

PATCHBAY’s end-to-end data flow is: Audio → Preprocess → Chunk plan → Anchor prompting → Model inference → Reconstruction → Postprocess → Export.

Pipeline overview

flowchart TD
  A[Audio input] --> B[Decode / normalize dtype]
  B --> C{Input AudioFX?}
  C -- yes --> D[Apply input effects]
  C -- no --> E[Continue]
  D --> F[Chunk planning]
  E --> F
  F --> G[Anchor prompting per chunk]
  G --> H[Inference per chunk]
  H --> I["Reconstruction (overlap-add)"]
  I --> J{Output AudioFX?}
  J -- yes --> K[Apply effects per stream]
  J -- no --> L[Export]
  K --> L
Loading
  1. Load & decode audio

    • Input audio is loaded and converted to a floating point waveform (multi-channel supported).
    • Optional resampling to the model’s expected sample rate is performed.
  2. (Optional) Input AudioFX

    • Any AudioFX assigned to the input stream is applied before chunking (see AudioFX Plugins).
  3. Chunk planning

  4. Anchor prompting

  5. Model inference

  6. Reconstruction

    • Chunk outputs are stitched back into full-length target/residual using overlap-add with windowing.
    • See Chunking & Reconstruction.
  7. (Optional) Output AudioFX

    • AudioFX can be applied separately to target and residual streams (and persisted per stream).
    • See AudioFX Plugin API.
  8. Write outputs

    • target.wav and residual.wav (or user-selected paths) are written.
    • See Export & Files.

Where this is implemented

  • Orchestration: patchbay_backend/pipeline.py
  • Chunking: patchbay_backend/chunking.py
  • Anchors: patchbay_backend/anchors.py
  • SAM-Audio adapter: patchbay_backend/separator.py
  • GUI worker: patchbay_desktop_gui/gui/worker.py

Last updated: 2026-01-24

Clone this wiki locally