Report the instrument's automatable parameters to the host under a frozen id table, in signal-flow order, with real units
42 of 44 ids issued: pitch key-track and Trigger length stay reserved pending a live path. Master gain reclassified Live — it never reloaded.
This commit is contained in:
@@ -52,6 +52,13 @@ float filterDriveDepthFromNorm(float norm) {
|
||||
return static_cast<float>(kFilterDriveDepthMax * n * n);
|
||||
}
|
||||
|
||||
float filterNormFromDriveDepth(float depth) {
|
||||
if (!(depth > 0.0f)) return 0.0f; // also catches NaN
|
||||
if (depth >= kFilterDriveDepthMax) return 1.0f;
|
||||
return static_cast<float>(
|
||||
std::sqrt(static_cast<double>(depth) / static_cast<double>(kFilterDriveDepthMax)));
|
||||
}
|
||||
|
||||
float filterNormFromQ(float q) {
|
||||
if (!(q > kFilterQMin)) return 0.0f;
|
||||
if (q >= kFilterQMax) return 1.0f;
|
||||
|
||||
@@ -49,4 +49,9 @@ float filterNormFromQ(float q);
|
||||
// linear rather than merely close.
|
||||
float filterDriveDepthFromNorm(float norm);
|
||||
|
||||
// Exact inverse of filterDriveDepthFromNorm; out-of-range depth clamps to 0 or 1. The analytic
|
||||
// inverse of a frozen law is not a change to it — it has the standing the two inverses above
|
||||
// already have.
|
||||
float filterNormFromDriveDepth(float depth);
|
||||
|
||||
} // namespace reasampler::instrument::engine::filter
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#include <limits>
|
||||
|
||||
namespace reasampler::instrument::engine {
|
||||
@@ -37,15 +36,4 @@ double masterGainNormFromLinear(double linear) {
|
||||
return masterGainNormFromDb(20.0 * std::log10(linear));
|
||||
}
|
||||
|
||||
void formatMasterGainLabel(double norm, char* buf, std::size_t len) {
|
||||
if (!buf || len == 0) return;
|
||||
norm = clamp01(norm);
|
||||
if (norm <= 0.0) {
|
||||
std::snprintf(buf, len, "-inf");
|
||||
return;
|
||||
}
|
||||
const double db = masterGainDbFromNorm(norm);
|
||||
std::snprintf(buf, len, "%+.1fdB", db);
|
||||
}
|
||||
|
||||
} // namespace reasampler::instrument::engine
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
namespace reasampler::instrument::engine {
|
||||
|
||||
// norm 0 is -inf (true zero); norm just above 0 starts at the finite floor kMasterGainMinDb
|
||||
@@ -31,8 +29,4 @@ double masterGainLinearFromNorm(double norm);
|
||||
// true-zero and the floor aren't representable on the knob. Out-of-range/non-finite clamps.
|
||||
double masterGainNormFromLinear(double linear);
|
||||
|
||||
// "-inf" at the bottom, else a signed one-decimal dB string ("-12.0dB", "+2.4dB").
|
||||
// Writes at most `len` bytes including the terminator.
|
||||
void formatMasterGainLabel(double norm, char* buf, std::size_t len);
|
||||
|
||||
} // namespace reasampler::instrument::engine
|
||||
|
||||
Reference in New Issue
Block a user