native_bridge: recalibrate after preset restore, reject 3rd live VST2 instance

This commit is contained in:
2026-08-20 10:50:11 +07:00
parent 4932bb88db
commit 588c0da32d
3 changed files with 81 additions and 4 deletions
@@ -158,6 +158,11 @@ public:
void setBypassed(bool on) { isBypassed_.store(on); }
bool isBypassed() const { return isBypassed_.load(); }
// Re-run output calibration after a preset/chunk restore (calibrate() in
// assign() runs BEFORE the preset exists - VST2 like Qin probes silent and
// stays at makeup=1.0, quieter than VSTi calibrated after restore).
float recalibrate(uint32_t channel, double sampleRate, uint32_t blockSize);
private:
static std::unique_ptr<INativeInstrument> create_instrument(InstrumentType type);
// Probe-render 3 notes sau khi load, do peak, tinh makeup de note don ra