Note
Pre-Release Version: This is an early pre-release / beta build under active development and testing by HiFiFreak. DSP tuning, circuit modeling calibration, and user feedback are actively being evaluated.
Important
Nominative Fair Use Disclaimer: FreakTube Mastering is an independent software project developed by HiFiFreak. All product names, trademarks, and registered trademarks (including McIntosh and MC275) are property of their respective owners. Reference to these names and historical patents is strictly for educational, technical, and historical circuit identification purposes and implies no affiliation, sponsorship, or endorsement.
FreakTube Mastering is a professional, high-fidelity stereo mastering audio plugin engineered by HiFiFreak. Modeled after classic American vacuum tube amplification and Gordon Gow's patented 50% Unity-Coupled Bifilar-Wound Output Transformer topology. Featuring genuine 12AX7 twin-triode harmonic excitation, KT88 push-pull 50% cathode-plate unity-coupled circuit dynamics, additive low-frequency Iron Core Flux saturation, and illuminated vintage phosphor emerald green analog VU meters with authentic mechanical D'Arsonval needle ballistics calibrated specifically for digital mastering (Peak dBFS and standard VU scales).
- Vacuum Tube & Transformer Circuit Modeling
- DSP Signal Flow
- Mastering Benchmarks & Dynamic Analysis (Funk Master Case Study)
- Pre-Release Binaries & Installation
- Controls & Parameter Reference
- Comprehensive Code Reference (Every Function Explained)
- Building from Source
- License & Credits
FreakTube achieves ultra-low distortion (
-
Twin-Triode Input Stage (12AX7 Class-A):
Provides linear voltage amplification while introducing subtle, velvety second-order harmonics (
$H_2 \approx -45\text{ dB}$ ) that impart depth, dimensional air, and acoustic presence. - 50% Unity-Coupled Output Stage (US Patent 2,477,074): The KT88 beam power tetrodes are loaded equally across their plates and cathodes using bifilar windings. This creates 50% inherent local negative feedback, eliminating switching notch distortion and delivering high damping factor and transparent analog dynamics.
-
Bifilar-Wound Iron Core Output Transformer:
Physical magnetic flux
$\Phi$ is inversely proportional to frequency ($\Phi \propto \frac{V}{\omega}$ ). Consequently, high frequencies pass through cleanly without intermodulation distortion, while deep bass notes swing large magnetic flux, saturating the core into warm, authoritative 3rd-harmonic punch and analog weight.
flowchart LR
In[Audio In L/R] --> Over8x[8x Oversampling FIR]
Over8x --> Stage1[Stage 1: 12AX7 Triode Input Warmth]
Stage1 --> Stage2[Stage 2: KT88 Push-Pull Unity-Coupled]
Stage2 --> Stage3[Stage 3: Bifilar Iron Core Flux Saturation]
Stage3 --> Stage4[Stage 4: 10 Hz DC Blocker]
Stage4 --> Down8x[Downsampling FIR]
Down8x --> Telemetry[Dual Meter Telemetry L/R]
Down8x --> Out[Master Out L/R]
- Digital Gain Staging: Zero digital headroom loss. Internal signal levels are strictly calibrated so input 0 dBFS (-14.6 LUFS) exits at -0.2 dBFS (-14.6 LUFS) with analog peak soft-limiting and zero volume explosion.
- 8x Oversampling: Half-band equiripple FIR filter stages eliminate high-frequency aliasing fold-over from non-linear waveshaping.
- Phase-Accurate Stereo Handling: Independent stereo channels with thread-safe atomic telemetry for dual needle tracking.
To evaluate FreakTube's circuit dynamics under demanding mastering conditions, a highly dynamic, unmastered funk mix (featuring aggressive slap bass, open transient snare rimshots, and punchy brass hits) was analyzed before and after processing through FreakTube Mastering (Weight set to 17.60, Warmth engaged):
Plugin Active (Weight: 17.60, Warmth: ON)
| Metric | Dry (Plugin OFF) | FreakTube Active (Weight 17.60) |
Delta / Real-World Impact |
|---|---|---|---|
| Peak Level |
0.0 dBFS (clipping risk)
|
-1.6 dBFS |
|
| True Peak (Inter-Sample) |
0.0 dBTP (clipping risk)
|
-1.6 dBTP |
|
| Integrated Loudness | -15.1 LUFS |
-15.4 LUFS |
|
| Loudness Range (LRA) | 6.9 LU |
5.9 LU |
|
| Max Short-Term Loudness | -11.5 LUFS |
-12.1 LUFS |
|
| Max Momentary Loudness | -10.7 LUFS |
-11.3 LUFS |
-
Headroom Recovery & Analog Peak Softening (
$-1.6\text{ dB}$ ):-
The Challenge: In modern digital mastering, aggressive funk bass transients and snare rimshots frequently produce sharp, unmusical peaks that spike to
$0.0\text{ dBFS} / 0.0\text{ dBTP}$ , tripping digital overs. - The Circuit Response: As peaks hit the KT88 unity-coupled push-pull stage and saturate the bifilar transformer iron core, excess transient excursions are softly cushioned into warm second- and third-order harmonics rather than hard-clipped.
-
The Result:
$1.6\text{ dB}$ of headroom is restored, providing ample inter-sample headroom for streaming encoding (Spotify, Apple Music AAC) without flattening punch or dynamics.
-
The Challenge: In modern digital mastering, aggressive funk bass transients and snare rimshots frequently produce sharp, unmusical peaks that spike to
-
Transparent Gain Staging (Only
$0.3\text{ LUFS}$ Delta):- Perceived loudness shifts by only
$0.3\text{ LUFS}$ (from$-15.1$ to$-15.4\text{ LUFS}$ ). The internal level compensation curve ($outLevelComp$ ) ensures you judge the genuine harmonic color, not psychoacoustic volume differences.
- Perceived loudness shifts by only
-
Mastering Analog "Glue" (
$\text{LRA } 6.9 \to 5.9\text{ LU}$ ):- The Loudness Range decreases by
$1.0\text{ LU}$ . - The rhythm section (kick, snare, bassline) locks together into a cohesive pocket, giving the master the warmth, body, and density of classic vinyl-era analog master tapes.
- The Loudness Range decreases by
-
Low-End Iron Core Flux Saturation (
$< 250\text{ Hz}$ ):- In the active spectrogram, the low-frequency band beneath
$200\text{ Hz}$ exhibits denser, more continuous harmonic warmth. The modeled transformer core laminations saturate smoothly, giving the bass guitar tactile girth and presence.
- In the active spectrogram, the low-frequency band beneath
-
Aliasing Rejection via 8x FIR Equiripple Oversampling:
- The high end above
$10\text{ kHz}$ remains open, airy, and free of ultrasonic foldover artifacts or harsh digital glare.
- The high end above
Pre-compiled 64-bit release binaries are packaged as standalone archives and available under GitHub Releases:
| Platform | Package Archive | Contents | Compatibility |
|---|---|---|---|
| Windows x64 | FreakTubeMastering-Windows-x64.zip |
• FreakTube Mastering.vst3 bundle• FreakTube Mastering.exe standalone |
Windows 10/11 x64 (All major DAWs & Standalone) |
| Linux x64 | FreakTubeMastering-Linux-x64.tar.gz |
• FreakTube Mastering.lv2 bundle (libFreakTubeMastering.so)• FreakTubeMastering standalone |
Linux x64 (Ardour, Carla, Mixbus, Reaper & Standalone) |
- Download & Extract: Download
FreakTubeMastering-Windows-x64.zipfrom the Releases page and unzip it. - VST3 Plugin: Copy the
FreakTube Mastering.vst3folder into your system VST3 directory:Open your DAW (e.g., Harrison Mixbus, Reaper, Cubase, Studio One, Ableton) and rescan plugins.C:\Program Files\Common Files\VST3\ - Standalone App: Double-click
FreakTube Mastering.exeto run immediately without a DAW.
- Download: Download
FreakTubeMastering-Linux-x64.tar.gzfrom the Releases page. - Install Native LV2 Bundle:
(Or install system-wide for all users:
# Extract the LV2 bundle to your user directory mkdir -p ~/.lv2 tar -xzvf FreakTubeMastering-Linux-x64.tar.gz -C ~/.lv2/ "FreakTube Mastering.lv2"
sudo cp -r "FreakTube Mastering.lv2" /usr/lib/lv2/) - Standalone Application:
# Extract and launch the native standalone player tar -xzvf FreakTubeMastering-Linux-x64.tar.gz FreakTubeMastering chmod +x FreakTubeMastering ./FreakTubeMastering - Rescan in DAW: Launch your Linux DAW (Ardour, Carla, Harrison Mixbus, or Reaper) and rescan plugins.
Note
Mixbus12 have outdated libfreelibrary, here is a quick FIX:
# 1. Back up Mixbus's bundled FreeType files
sudo mv /opt/Mixbus-12.0.1/lib/libfreetype.so.6 /opt/Mixbus-12.0.1/lib/libfreetype.so.6.bak
sudo mv /opt/Mixbus-12.0.1/lib/libfreetype.so /opt/Mixbus-12.0.1/lib/libfreetype.so.bak 2>/dev/null || true
# 2. Symlink CachyOS's system FreeType
sudo ln -s /usr/lib/libfreetype.so.6 /opt/Mixbus-12.0.1/lib/libfreetype.so.6
sudo ln -s /usr/lib/libfreetype.so /opt/Mixbus-12.0.1/lib/libfreetype.so| Control | Parameter ID | Range | Default | Description |
|---|---|---|---|---|
| TUBE DRIVE (dB) | DRIVE |
0.0 dB to +24.0 dB
|
0.0 dB |
Controls input overdrive into the triode and beam power tube stages. At 0 dB, processing is clean and transparent; higher values saturate softly into vintage analog compression. |
| WEIGHT | IRON |
5.0 to 30.0
|
10.0 |
Controls the magnetic core flux saturation of the bifilar transformer. At 5, response is pristine; at 30, it delivers heavy low-end authority, punch, and warm 3rd-harmonic bloom. |
| OUTPUT TRIM(dB) | OUT_GAIN |
-24.0 dB to +12.0 dB
|
0.0 dB |
Master output trim/makeup gain. |
| POWER / ACTIVE | POWER |
On / Off |
On |
True bypass toggle. Recessed tactile push-button with illuminated emerald halo and pilot lamp. |
| WARMTH | WARMTH |
On / Off |
On |
Engages the twin-triode Class-A harmonic saturation stage ( |
This section provides a complete, line-by-line explanation of every function, class, and method implemented across the codebase.
Models the magnetic core saturation, hysteresis relaxation, and frequency-dependent flux density of the Gordon Gow bifilar output transformer.
(Note: Rather than using a naive numerical differential solver—which causes mathematical instability at audio sample rates—the transformer engine directly implements physical magnetic flux laws ($\Phi \propto \frac{V}{\omega}$), additive low-frequency harmonic bloom, and soft transformer core ceiling limiting).
-
Purpose: Initializes the transformer DSP for a given sample rate (including oversampled rates such as
$352.8\text{ kHz}$ ). -
Operations:
- Stores
fs = sampleRate. - Calls
reset()to clear all delay memory. - Calls
updateCoefficients()to recalculate filter and saturation constants.
- Stores
- Purpose: Clears all internal delay line states to prevent clicks or residual energy when audio playback stops.
- Operations: Zeroes
lowFlux1,lowFlux2, andhystState.
- Purpose: Thread-safe parameter update from the audio processor.
-
Operations:
- Clamps
ironValbetween5.0fand30.0f. - Checks if value changed by
$> 0.01\text{f}$ to avoid redundant floating-point recomputations. - Calls
updateCoefficients()when changed.
- Clamps
- Purpose: Processes a single audio sample through the 6-stage physical transformer engine.
-
Signal Flow:
-
Core Flux Extraction: Passes
inputVoltagethrough a smooth 2-pole lowpass filter (lowFlux1,lowFlux2) with cutoff around$260\text{ Hz} - 420\text{ Hz}$ . High frequencies are ignored by the magnetic core, while bass swings large flux. -
Magnetic Saturation: Drives the extracted flux through
std::tanh(coreFlux * coreDrive), generating predominantly 3rd-order odd harmonics. -
Harmonic Injection: Calculates the harmonic difference
harmonics = (satFlux - coreFlux) * ironHarmonicGainand injects it additively intoinputVoltage. -
Peak Limiting: Softly rounds peaks exceeding
0.85fusing asymptotic compression ($0.85 + 0.12 \cdot \tanh(\text{excess} \times 3.5)$) preventing digital clipping. -
Magnetic Hysteresis: Implements physical core relaxation lag (
hystState += hystAlpha * (saturated - hystState)), blending$(1 - \text{hystMix}) \cdot \text{saturated} + \text{hystMix} \cdot \text{hystState}$ to produce authentic low-frequency phase heft. -
Level Compensation: Multiplies by
outLevelCompto guarantee exact integrated loudness consistency ($\pm 0.1\text{ LUFS}$ ) across all Iron settings.
-
Core Flux Extraction: Passes
-
Purpose: Dynamically computes filter coefficients and drive scalers based on
ironWeight. -
Operations:
- Normalizes
normIron = (ironWeight - 5.0) / 25.0(range 0.0 to 1.0). - Sets corner frequency
$f_{\text{lp}} = 260 + 160 \cdot \text{normIron}\text{ Hz}$ . - Computes bilinear lowpass alpha:
$\alpha_{\text{lp}} = \min(0.95, \frac{2\pi f_{\text{lp}}}{f_s})$ . - Scales
coreDrive = 1.2 + 2.0 * normIron($1.2\times$ at Iron 5 to$3.2\times$ at Iron 30). - Scales
ironHarmonicGain = 0.08 + 0.34 * normIron. - Sets hysteresis relaxation pole (
$400\text{ Hz}$ ) and mix ratio ($0.03$ to$0.10$ ). - Calculates loudness compensation scaler:
$\text{outLevelComp} = \frac{1.0}{1.0 + 0.08 \cdot \text{normIron}}$ .
- Normalizes
Precision 1-pole high-pass filter removing sub-audible DC drift (
- Purpose: Sets up the high-pass pole coefficient.
-
Operations: Stores
$R = 1.0 - \frac{2\pi \cdot 10.0}{f_s}$ , with$R \approx 0.99986$ at$352.8\text{ kHz}$ . Callsreset().
- Purpose: Clears filter delay registers
x1 = 0andy1 = 0.
-
Purpose: Implements the standard DC-blocking difference equation:
$$y[n] = x[n] - x[n-1] + R \cdot y[n-1]$$ - Returns: Clean, DC-free AC audio signal.
The master audio processor handling lifecycle, threading, parameters, and multi-channel oversampled audio processing.
- Purpose: Constructs the 5 core parameters managed by
AudioProcessorValueTreeState(APVTS):DRIVE: Float range0.0to24.0 dB, default0.0 dB.IRON(Display:Weight): Float range5.0to30.0 %, default10.0 %.OUT_GAIN: Float range-24.0to+12.0 dB, default0.0 dB.POWER: Boolean toggle, defaulttrue.WARMTH: Boolean toggle, defaulttrue.
- Purpose: Prepares DSP blocks for playback.
-
Operations:
- Initializes 8x oversampler with maximum block size:
oversampler.initProcessing(samplesPerBlock). - Reports filter latency to the DAW host:
setLatencySamples(...). - Prepares left/right
BifilarTransformerandDCBlockerinstances at the oversampled rate ($8 \times f_s$ ).
- Initializes 8x oversampler with maximum block size:
- Purpose: Real-time DSP audio loop executed on the DAW audio thread.
-
Operations:
- Checks channel and sample count; exits early if empty.
- Reads atomic pointers
powerParamandwarmthParam. -
Bypass Handling: If
POWERis off, computes dry RMS levels for meters and passes audio through un-processed with 0 CPU overhead. - Reads
driveParam,outGainParam, andironWeightParam. - Updates left and right transformer parameters:
transformerL.setParameters(ironWidth). - Applies digital gain staging:
buffer.applyGain(driveGain). - 8x Oversampling: Upsamples audio block using half-band FIR filters.
-
Per-Sample Non-Linear Processing:
-
Stage 1 (Triode Warmth): If
WARMTHis enabled, injects soft asymmetrical 2nd-harmonic triode curvature ($x + 0.025 \cdot x |x|$ ). -
Stage 2 (Unity-Coupled Stage): Models push-pull beam power tetrode dynamics with
$50%$ local feedback ($y = \frac{x}{\sqrt{1 + 0.18 x^4}}$ ). -
Stage 3 (Bifilar Transformer): Processes through
transformerL.processSample()/transformerR.processSample(). -
Stage 4 (DC Blocker): Strips sub-audio DC drift via
dcBlockerL.processSample().
-
Stage 1 (Triode Warmth): If
-
8x Downsampling: Reconstructs original sample rate via
oversampler.processSamplesDown(block). - Applies master
outGain. -
Telemetry: Computes independent Left and Right RMS levels, converts to decibels, applies attack (0.8) and release (0.1) smoothing, and stores to
meterL,meterR, andrmsLevelOut.
- Purpose: Serializes and deserializes the plugin state to/from XML for DAW project recall and preset management.
Custom JUCE LookAndFeel class rendering authentic vintage hi-fi hardware controls.
- Purpose: Custom graphics routine rendering machined aluminum rotary knobs.
- Visual Structure:
- Outer drop-shadow.
- Dark gunmetal knurled ring with 36 distinct circumferential grip notches.
- Polished beveled chrome chamfer ring.
- Concentric brushed aluminum face with subtle concentric rings.
- Dark circular center cap.
- High-contrast illuminated emerald green pointer indicator line and terminal dot.
- Purpose: Custom graphics routine rendering luxury tactile illuminated push-buttons.
- Visual Structure:
- Recessed dark aluminum button bezel with subtle 3D drop-shadow and metallic rim.
- Inner tactile button cap with active/inactive state handling:
- Active (ON): Depressed cap surrounded by neon-emerald halo glow, illuminated border, and bright incandescent pilot jewel lamp with filament glow.
- Inactive (OFF): Smoked obsidian cap with dark unlit pilot lamp and brushed metallic silver-gray typography.
- Crisp status typography with responsive hover highlight.
The user interface managing components, layout, and 60 FPS meter physics.
- Purpose: Initializes the UI, applies
FreakTubeLookAndFeel, configures rotary sliders, binds APVTS slider/button attachments, sets fixed dimensions (780 × 480 px), and starts the 60 Hz timer.
- Purpose: 60 FPS callback updating analog meter needle physics.
-
Ballistics Engine:
- Reads
meterLandmeterRfrom the audio processor. - Normalizes
$-40\text{ dBFS}$ to$+3\text{ dBFS}$ to a$[0.0, 1.0]$ angle fraction. - Simulates physical needle ballistics using a second-order spring-mass-damping model at 60 FPS (
$180\text{ rad/s}^2$ acceleration spring,$16\text{ s}^{-1}$ velocity damping). - Calls
repaint()to trigger smooth, flutter-free needle animation.
- Reads
- Purpose: Renders an individual analog VU meter movement.
-
Visual Elements:
- Deep obsidian black outer frame with brushed titanium inner bezel trim.
-
Vintage Phosphor-Green Illuminated Face: Rich luminous emerald-green gradient (
#03bb60to#013318) with diffuse corner lamp incandescent glow highlights. -
Upper Peak Arc (
$R = 120.0\text{ px}$ ): Centered"PEAK dBFS"title at$Y = +20$ , scale numbers (-30, -20, -14, -8, -4, 0, +2 dBFS) placed along the arc, with high-contrast bright white overload sector ($0$ to$+2\text{ dBFS}$ ). -
Spacious Mid-Corridor (
$R = 107.0\text{ px}$ ): Decibel VU numbers (-20, -10, -6, -3, -1, 0, +1, +3) positioned cleanly between the two arcs with zero collision. -
Lower VU Arc (
$R = 94.0\text{ px}$ ): Lowered mastering arc with centered"VU (-18 REF)"reference title at$Y = +94$ . -
Channel Label: Centered at
$Y = \text{bottom} - 40$ ("LEFT CHANNEL"/"RIGHT CHANNEL"), safely clear of the needle pivot hub. - D'Arsonval Needle: Razor-sharp tapered black aluminum needle with crisp pure white pointer tip, needle shadow for 3D depth, and circular pivot cap.
- Specular Glare: Translucent diagonal glass reflection simulating heavy luxury faceplate cover.
- Purpose: Renders the master chassis background.
- Visual Elements:
- Deep obsidian black high-gloss glass faceplate (edge-to-edge).
- Luxury beveled chassis edge trim.
- Modern bold Sans-Serif
"FreakTube"logo with soft illuminated emerald glow (no italics). - Bold Sans-Serif subtitle
"STEREO MASTERING". - Dual analog emerald green VU meters (Left and Right).
- Polished dark chrome horizontal separator bar.
- Emerald illuminated index markings surrounding each rotary control.
- Purpose: Positions all interactive UI elements across the 780 × 480 viewport.
-
Layout Geometry:
-
powerButton: Centered directly beneath the Left VU meter ($X = 125, W = 150, H = 34$ ). -
warmthButton: Centered directly beneath the Right VU meter ($X = 505, W = 150, H = 34$ ). - Rotary sliders: Left
TUBE DRIVE($X = 170$ ), CenterWEIGHT($X = 390$ ), RightOUTPUT TRIM($X = 610$ ).
-
- CMake 3.20 or newer
- C++17 compliant compiler (MSVC 2022 / Clang-cl / GCC)
- JUCE 7.x (included in repository)
# 1. Generate build configuration
cmake -B cmake-build-release -DCMAKE_BUILD_TYPE=Release
# 2. Compile all targets (VST3, Standalone)
cmake --build cmake-build-release --config Release# 1. Install prerequisites (Debian / Ubuntu / Mint)
sudo apt update
sudo apt install build-essential cmake ninja-build libasound2-dev libx11-dev libxinerama-dev libxext-dev libfreetype6-dev libgl1-mesa-dev libfontconfig1-dev libxrandr-dev libxcursor-dev libxi-dev libxcomposite-dev
# 2. Configure Release build
cmake -B cmake-build-release -G Ninja -DCMAKE_BUILD_TYPE=Release
# 3. Compile LV2 and Standalone targets
cmake --build cmake-build-release --target FreakTubeMastering_LV2 FreakTubeMastering_Standalone -j$(nproc)All compiled binaries will be generated in:
cmake-build-release/FreakTubeMastering_artefacts/Release/
- Developer: HiFiFreak
- Framework: Built with JUCE 7 (Community Open Source Edition).
- License: Released under the GNU General Public License v3.0 (GNU GPLv3) in compliance with JUCE's open-source licensing terms. See the
LICENSEfile for the full license text. - DSP & Architecture: Modeled after classic 50% unity-coupled vacuum tube amplification and bifilar transformer core saturation physics.
- Intended Use: High-fidelity stereo audio mastering, analog coloration, and dynamic peak control.

