-
Notifications
You must be signed in to change notification settings - Fork 0
Chunking
Chunking enables model inference on long audio by splitting it into windows and reconstructing the output.
Source pointers
-
patchbay_backend/chunking.py– chunk plan + overlap-add -
patchbay_backend/pipeline.py– uses the plan, runs per-chunk inference
PATCHBAY’s current behavior is explicit:
- If
max_len_sis not set (None): the full file is processed in one pass. - If
max_len_sis set: chunking is enabled.-
overlap_sis optional; if omitted a conservative default is applied.
-
- If
overlap_sis provided withoutmax_len_s: overlap is ignored and a note is written to the optional log file.
This avoids surprising “auto chunking” based on duration.
-
Max chunk length (seconds)
Window size passed into the model (converted to samples via the model sample rate). -
Overlap (seconds)
Shared region between consecutive chunks. Overlap helps reduce boundary artifacts.
Given:
-
chunk_len(samples) -
overlap(samples) step = chunk_len - overlap
Chunk windows are:
- chunk 1:
[0, chunk_len) - chunk 2:
[step, step + chunk_len) - ...
The last chunk is clipped to the end of the file.
Outputs are reconstructed with a simple linear crossfade in the overlap region:
- for the non-overlap part: copy samples directly
- for overlap: blend previous and current chunk with a linear ramp
Intuition:
- overlap is where “seams” happen
- a crossfade reduces clicks/level jumps at boundaries
Good starting points (typical speech/music):
- Max length: 20s
- Overlap: 2s
For difficult material or short, rare events:
- Reduce max length (e.g. 10–15s)
- Increase overlap slightly (e.g. 2–4s)
Anchor modes can append/prepend example spans to each chunk. If you use these modes, ensure your max length has enough headroom (the prompt is part of the model input).
See Anchor Prompting Internals.
Last updated: 2026-01-24
PATCHBAY • MIT License • Wiki content is intended to match PATCHBAY 0.1.x.
- Home
- Installation
- Quickstart
- User Guide
- Input & Anchors
- Description & Run
- Output
- Export & Files
- Runtime Settings
- Settings & Persistence
- FAQ
- Troubleshooting
- Architecture
- Data Flow
- Backend Interface
- Anchor Algorithms
- Chunking & Reconstruction
- Logging & Debugging
- Parameter Persistence