Language note: This README is written in English, but the codebase itself β all inline comments, variable/function names, print statements, and the Colab notebook's documentation β is written in French.
PFX Extractor is a hybrid (local + cloud GPU) toolchain for audio post-production professionals. It creates a production-FX stem from raw location recordings: synchronized physical sounds such as footsteps, clothing, props, manipulations, and impacts are preserved, while human sounds, roomtone, exterior traffic, weather, music, and other ambience are reduced.
To avoid needing a powerful local machine, the app uses a "Drive Bridge" architecture: a lightweight local web interface syncs your files to Google Drive, Google Colab's GPU servers do the heavy processing, and the local interface then retrieves the finished result.
- Dual-model AI separation β Runs both BS-RoFormer and MDX23C on every clip and blends their "Instrumental" (non-vocal) outputs with a configurable weighted mix (
RATIO_ROFORMER, default 60% RoFormer / 40% MDX23C β RoFormer tends to produce cleaner splits with fewer artifacts for PFX work). - Configurable AI overlap (
AI_OVERLAP) β Controls how much adjacent inference segments overlap. Higher overlap smooths the separation mask over time, reducing audible "pumping" on busy or noisy material, at the cost of extra GPU time.
- Sound-event detector, decoupled from the separation models β The pipeline runs YAMNet on the untouched merged audio before denoising or source separation. It catches non-lexical human sounds and also distinguishes production effects from ambience and other content that does not belong in the PFX stem.
- Exact, exhaustive class partition β All 521 YAMNet/AudioSet indices are assigned explicitly to one of six non-overlapping roles. The notebook validates the expected group counts and aborts if the model taxonomy changes. Substring matching (
hum,run, etc.) is no longer used. - Separate thresholded masks β Raw class maxima no longer drive gain directly. Human, ambience, outside-PFX, and PFX-protection evidence use independent soft thresholds and attack/release envelopes:
- Human removal (
DUCK_DEPTH_HUMAIN) β voices, vocalizations, breathing, physiological sounds, and applause. - Ambience removal (
DUCK_DEPTH_AMBIANCE) β nature/weather, roadway traffic, roomtone-like noise, static, and hum. - Outside-PFX removal (
DUCK_DEPTH_HORS_PFX) β music, TV/radio content, vehicles, sirens, and low-frequency/vibration classes. - PFX protection (
PROTECTION_PFX) β footsteps, cloth, props, manipulations, impacts, tools, and other production effects reduce denoise and mask depth locally; restoration of raw audio is capped below 100%. - Contextual classes β isolated foreground animals and short electronic tones are preserved, while persistent/diffuse occurrences are routed to removal using temporal persistence.
- Context-only classes β
Inside,Outside,Reverberation,Echo,Field recording, andSilencenever drive a local gain curve.
- Human removal (
- Memory-bounded processing β Frame-level YAMNet masks are cached and interpolated in 30-second blocks, avoiding several full-resolution mask arrays on long recordings.
- Adaptive pre-denoise (
NIVEAU_DENOISE_POURCENTAGE,DENOISE_ADAPTATIF) β A spectral noise-reduction pass runs before AI separation.DENOISE_ADAPTATIFtoggles between a stationary noise profile (steadier, better for consistent room tone) and an adaptive one (better suited to noisy, variable exterior scenes β traffic, wind β where a stationary profile can cause audible "pumping").
- Automatic Lav/Boom time-alignment β Cross-correlates paired microphone recordings (e.g.
Lav-01.wav/Boom-01.wav) of the same take and time-aligns them to integer-sample accuracy before processing. - Alignment confidence safeguard β Computes a normalized correlation confidence score for every proposed alignment. If two clips grouped together turn out to have no real acoustic relationship (e.g. an ambiguous filename accidentally groups two unrelated takes), the alignment is skipped and the clip is copied through untouched rather than being corrupted by a meaningless time-shift.
- Snowball Merge β Temporarily concatenates short clips from the same take/family until they reach the minimum duration required for stable AI inference (5s), while recording every source boundary. After processing, the merged result is split back into one output per original clip, preserving each clip's name, duration, and BWF timecode.
- BWF Timecode preservation β Reads the original Broadcast Wave
time_referencemetadata and re-injects it into the final processed file viaffmpeg, so the output stays perfectly aligned on your editing timeline. - Template-driven Pro Tools delivery β The local interface can turn the WAV files currently stored in
work/processedinto a self-contained Pro Tools delivery: one.ptxsession plus anAudio Filesfolder, wrapped in a downloadable ZIP. Placement uses each file's BWF timestamp, so it is sample-accurate rather than clip-relative. - Deterministic track routing β Processed filenames must follow
<family>-Gain_<number>_PFX_Ready.wav. Files are sorted alphabetically; the first family is routed toPFX 01, the second toPFX 02, and a third family is rejected explicitly. Same-track overlaps are preserved, including one-sample boundary overlaps. - Smart Cache & Fallback β Silent/empty clips are automatically skipped rather than crashing the batch; if the AI separator fails on a given file, the pipeline falls back to passing the clip through unprocessed rather than losing it.
- Compute cost tracking β Prints an estimated Compute Units cost at the end of each Colab session.
- Lightweight Gradio UI (
app_local.py) β Drop raw.wavfiles, upload to Drive, open the Colab notebook, download the finished WAV files, and create the Pro Tools delivery, all from a local browser tab. - One-click cache clearing β Wipes both local working files and the corresponding Drive folders, with an explicit confirmation step before anything is deleted.
- Configurable Colab link β Point the "Open Google Colab" button at a new notebook version at any time via the "βοΈ Advanced Settings" panel, without touching code.
- Local interface (Gradio) β
app_local.pyruns on your machine. You drop raw files in;drive_auth.pyhandles Google Drive authentication and syncs them up. - Cloud backend (Colab) β
Colab_Backend_PFX_V3_0.ipynbruns on Google's GPU servers. It downloads the raw files, aligns/merges/denoises them, runs the dual AI separation + YAMNet multi-mask pipeline, and uploads the finished PFX tracks back to Drive. - Retrieval and Pro Tools assembly β One frontend action downloads the processed WAV files from Drive without creating an intermediate WAV archive.
protools_export.pythen applies PFX Extractor's filename sorting and track-routing policy and calls the genericpt_api1.3.8+ template builder. The browser receives a single ZIP containing the.ptxsession and itsAudio Filesfolder. A localtemplate.ptxat the repository root is used by default; an alternate compatible template can be selected in Advanced Settings.
- Python 3.10+
- Git, used by
pipto install the pinnedpt_apidependency from GitHub. - A Google account with access to Google Drive and Google Colaboratory.
Clone this repository, then install the local interface's dependencies:
pip install -r requirements.txtrequirements.txt installs the validated pt_api release directly from the immutable Git tag v1.3.8. PFX Extractor resolves the runtime in this order: PT_API_PATH, the installed pt_api module, then a sibling repository named pt_api next to this repository. The final option remains a development fallback; normal installations use the pinned package.
After pulling a revision that changes requirements.txt into an existing virtual environment, update it once with:
.\.venv\Scripts\python.exe -m pip install -r requirements.txtPlace a compatible native Pro Tools template at the repository root as template.ptx. This proprietary file is intentionally excluded by .gitignore and must be provisioned separately on every installation that needs PTX export. The validated local template is an empty mono 48 kHz / 23.976 fps session with uniquely named PFX 01 and PFX 02 tracks and the imported-media prototype required by pt_api.
For the local app to write to your Google Drive:
- Go to the Google Cloud Console.
- Create OAuth 2.0 credentials (type "Desktop app").
- Download the file, rename it
credentials.json, and place it at the root of this project.
- Start the local interface β Double-click
start.bat(or runpython app_local.py). The interface opens in your browser. - Send your files β Drop your
.wavtracks in the interface and click "Upload vers Google Drive". - Run the AI processing β Click "Ouvrir Google Colab". In Colab, adjust the parameters in the control panel cell if needed, then run every cell in
Colab_Backend_PFX_V3_0.ipynbin order. - Retrieve the Pro Tools result β Once Colab finishes, go back to the local interface and click "TΓ©lΓ©charger les fichiers traitΓ©s en ZIP". This single action downloads the WAV files from Drive, creates the Pro Tools session, and downloads the final ZIP. The default template routes the first filename family to
PFX 01and a second family toPFX 02; Advanced Settings can override the template or session name. Unpack the returned ZIP before opening its.ptxfile. - Clean up β Use the red "Effacer la cache" button to clear your Drive and local working folders, generated Pro Tools deliveries, and prepare the next session.
The validated local template and builder currently target mono, 48 kHz, 23.976 fps sessions. Input WAV files must be mono 48 kHz, 32-bit float WAVE_EXTENSIBLE files with valid BWF metadata and must respect the format limits documented by pt_api. Export is transactional: an error does not publish an incomplete delivery.
All processing parameters live in a single control-panel cell at the top of the notebook β nothing else needs to be edited by hand.
| Parameter | Default | What it does |
|---|---|---|
NIVEAU_DENOISE_POURCENTAGE |
58% | Strength of the pre-denoise pass applied before AI separation. |
DENOISE_ADAPTATIF |
On | Adaptive (non-stationary) vs. stationary noise profile β adaptive is more robust on noisy/variable exterior scenes. |
RATIO_ROFORMER |
0.60 | Blend weight between RoFormer and MDX23C outputs. |
AI_OVERLAP |
12 | Overlap between AI inference segments β higher values smooth the separation mask over time (less pumping, more GPU time). |
DUCK_DEPTH_HUMAIN |
75% | Strength of human-sound removal (speech, vocalizations, breathing, physiological sounds, applause). |
DUCK_DEPTH_AMBIANCE |
70% | Strength of ambience removal (nature/weather, traffic, roomtone-like noise, static, hum). |
DUCK_DEPTH_HORS_PFX |
85% | Strength of non-PFX content removal (music, TV/radio, vehicles, sirens, low-frequency/vibration classes). |
PROTECTION_PFX |
70% | Local protection of footsteps, cloth, props, manipulations, impacts, and tools; capped at 90%. |
The defaults are deliberately strong enough to create a useful PFX stem without turning the masks into hard gates. At full mask confidence and without overlapping PFX protection, they yield approximately β12.0 dB for human content, β10.5 dB for ambience, and β16.5 dB for outside-PFX content. With a full PFX-protection event, the corresponding reductions relax to roughly β7.3 dB, β2.9 dB, and β6.4 dB, preserving physical transients.
Recommended starting ranges are 70β80% human, 60β75% ambience, 80β90% outside-PFX, and 60β75% PFX protection. NIVEAU_DENOISE_POURCENTAGE=58, adaptive denoise, RATIO_ROFORMER=0.60, and AI_OVERLAP=12 remain the balanced defaults; final tuning should be based on a representative production-sound batch rather than a single clip.
V3.0
- Replaced YAMNet keyword matching and raw-max ducking with an exact 521-class partition, separate thresholded masks, contextual animal/tone handling, and block-based PFX protection.
- Added independent controls for human, ambience, and outside-PFX removal, plus capped PFX restoration.
- Hardened separator parameter validation, lag conventions, sample-rate handling, and Snowball re-splitting/timecode delivery.
- Added self-contained Pro Tools session delivery from processed BWF files through the generic
pt_api1.3.8+ template builder. - Validated the complete Pro Tools path on a real 62-file batch: generation, native opening, playback, Save As, closing, and reopening all succeeded without warning.
V2.1
- Added a normalized-confidence safeguard to the auto-alignment step, preventing unrelated clips from being corrupted by a forced (meaningless) time-shift.
- Removed the A/B comparison-file generation feature β each clip now produces a single
_PFX_Ready.wavoutput.
V2.0
- Replaced the V1.x sidechain (which relied on the AI separator's own discarded "Vocals" stem β a dead end, since the models detect essentially no vocal content on non-lexical sounds like sighs) with an independent YAMNet-based sound-event detector.
- Added bodytalk protection during denoise, driven by the same detector.
- Added
DENOISE_ADAPTATIFand increased defaultAI_OVERLAPto reduce pumping artifacts on noisy exterior scenes. - Retired the local
dsp_local.pyDSP module β all processing is now centralized in the Colab notebook.
PFX Extractor v3.0 - 2026 Designed by SΓ©bastien BΓ©dard