1
0
Fork 0

Mark SC parameter struct fields as pub

This commit is contained in:
Robbert van der Helm 2022-07-25 14:13:54 +02:00
parent 7f12c9f362
commit 4f8d5160de
2 changed files with 19 additions and 19 deletions

View file

@ -85,22 +85,22 @@ pub struct ThresholdParams {
/// signal is gained by the inverse of this value. This replaces the input gain in the original
/// Spectral Compressor. In the polynomial below, this is the intercept.
#[id = "tresh_global"]
threshold_db: FloatParam,
pub threshold_db: FloatParam,
/// The center frqeuency for the target curve when sidechaining is not enabled. The curve is a
/// polynomial `threshold_db + curve_slope*x + curve_curve*(x^2)` that evaluates to a decibel
/// value, where `x = log2(center_frequency) - log2(bin_frequency)`. In other words, this is
/// evaluated in the log/log domain for decibels and octaves.
#[id = "thresh_center_freq"]
center_frequency: FloatParam,
pub center_frequency: FloatParam,
/// The slope for the curve, in the log/log domain. See the polynomial above.
#[id = "thresh_curve_slope"]
curve_slope: FloatParam,
pub curve_slope: FloatParam,
/// The, uh, 'curve' for the curve, in the logarithmic domain. This is the third coefficient in
/// the quadratic polynomial and controls the parabolic behavior. Positive values turn the curve
/// into a v-shaped curve, while negative values attenuate everything outside of the center
/// frequency. See the polynomial above.
#[id = "thresh_curve_curve"]
curve_curve: FloatParam,
pub curve_curve: FloatParam,
}
/// Contains the compressor parameters for both the upwards and downwards compressor banks.
@ -121,17 +121,17 @@ pub struct CompressorParams {
param_id_prefix: &'static str,
/// The compression threshold relative to the target curve.
threshold_offset_db: FloatParam,
pub threshold_offset_db: FloatParam,
/// The compression ratio. At 1.0 the compressor is disengaged.
ratio: FloatParam,
pub ratio: FloatParam,
/// The compression knee width, in decibels.
knee_width_db: FloatParam,
pub knee_width_db: FloatParam,
/// A `[0, 1]` scaling factor that causes the compressors for the higher registers to have lower
/// ratios than the compressors for the lower registers. The scaling is applied logarithmically
/// rather than linearly over the compressors. If this is set to 1.0, then the ratios will be
/// the same for every compressor.
high_freq_ratio_rolloff: FloatParam,
pub high_freq_ratio_rolloff: FloatParam,
}
unsafe impl Params for CompressorParams {

View file

@ -84,23 +84,23 @@ pub struct SpectralCompressorParams {
/// Global parameters. These could just live in this struct but I wanted a separate generic UI
/// just for these.
#[nested = "global"]
global: Arc<GlobalParams>,
pub global: Arc<GlobalParams>,
/// Parameters controlling the compressor thresholds and curves.
#[nested = "threshold"]
threshold: Arc<compressor_bank::ThresholdParams>,
pub threshold: Arc<compressor_bank::ThresholdParams>,
/// Parameters for the upwards and downwards compressors.
#[nested = "compressors"]
compressors: compressor_bank::CompressorBankParams,
pub compressors: compressor_bank::CompressorBankParams,
}
/// Global parameters controlling the output stage and all compressors.
#[derive(Params)]
struct GlobalParams {
pub struct GlobalParams {
/// Makeup gain applied after the IDFT in the STFT process. If automatic makeup gain is enabled,
/// then this acts as an offset on top of that. This is stored as linear gain.
#[id = "output"]
output_gain: FloatParam,
pub output_gain: FloatParam,
// TODO: Bring this back, and with values that make more sense
// /// Try to automatically compensate for gain differences with different input gain, threshold, and ratio values.
// #[id = "auto_makeup"]
@ -108,28 +108,28 @@ struct GlobalParams {
/// How much of the dry signal to mix in with the processed signal. The mixing is done after
/// applying the output gain. In other words, the dry signal is not gained in any way.
#[id = "dry_wet"]
dry_wet_ratio: FloatParam,
pub dry_wet_ratio: FloatParam,
/// Sets the 0-20 Hz bin to 0 since this won't have a lot of semantic meaning anymore after this
/// plugin and it will thus just eat up headroom.
#[id = "dc_filter"]
dc_filter: BoolParam,
pub dc_filter: BoolParam,
/// The size of the FFT window as a power of two (to prevent invalid inputs).
#[id = "stft_window"]
window_size_order: IntParam,
pub window_size_order: IntParam,
/// The amount of overlap to use in the overlap-add algorithm as a power of two (again to
/// prevent invalid inputs).
#[id = "stft_overlap"]
overlap_times_order: IntParam,
pub overlap_times_order: IntParam,
/// The compressor's attack time in milliseconds. Controls both upwards and downwards
/// compression.
#[id = "attack"]
compressor_attack_ms: FloatParam,
pub compressor_attack_ms: FloatParam,
/// The compressor's release time in milliseconds. Controls both upwards and downwards
/// compression.
#[id = "release"]
compressor_release_ms: FloatParam,
pub compressor_release_ms: FloatParam,
}
impl Default for SpectralCompressor {