Initial release — InstaShadow mastering compressor v1.0

Dual-stage compressor (optical + VCA) with output transformer saturation.
- Port-Hamiltonian T4B opto-cell model with implicit trapezoidal integration
- Feed-forward VCA with 7 ratios, 6 attack/release presets, Dual release mode
- 3 transformer types (Nickel/Iron/Steel) with 4x oversampled waveshaping
- Analog-style needle VU meters, horizontal GR meters
- Sidechain HPF, stereo link, independent section bypass
- Full state save/restore, CI/CD for Windows/macOS/Linux
This commit is contained in:
hariel1985
2026-03-27 16:03:24 +01:00
commit a587a43ff9
33 fájl változott, egészen pontosan 2417 új sor hozzáadva és 0 régi sor törölve

41
Source/VCACompressor.h Normal file
Fájl megtekintése

@@ -0,0 +1,41 @@
#pragma once
#include <cmath>
#include <algorithm>
class VCACompressor
{
public:
VCACompressor();
void prepare (double sampleRate);
void reset();
// Process one sample: sidechainDb = input level in dB
// Returns gain in linear scale (0..1)
float processSample (float sidechainDb, float thresholdDb, float ratio,
float attackSec, float releaseSec, bool dualRelease);
float getGainReductionDb() const { return currentGrDb; }
private:
double sr = 44100.0;
// Gain smoothing state (dB domain)
double smoothedGrDb = 0.0;
// Dual release state
double dualFastEnv = 0.0; // fast release envelope
double dualSlowEnv = 0.0; // slow release envelope
bool wasCompressing = false;
float currentGrDb = 0.0f;
// Soft-knee width
static constexpr float kneeWidthDb = 6.0f;
// Gain computer: returns desired GR in dB (negative value)
float computeGainReduction (float inputDb, float thresholdDb, float ratio) const;
// Coefficient helpers
double makeCoeff (double timeSec) const;
};