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 /// 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. /// Spectral Compressor. In the polynomial below, this is the intercept.
#[id = "tresh_global"] #[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 /// 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 /// 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 /// value, where `x = log2(center_frequency) - log2(bin_frequency)`. In other words, this is
/// evaluated in the log/log domain for decibels and octaves. /// evaluated in the log/log domain for decibels and octaves.
#[id = "thresh_center_freq"] #[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. /// The slope for the curve, in the log/log domain. See the polynomial above.
#[id = "thresh_curve_slope"] #[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, 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 /// 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 /// into a v-shaped curve, while negative values attenuate everything outside of the center
/// frequency. See the polynomial above. /// frequency. See the polynomial above.
#[id = "thresh_curve_curve"] #[id = "thresh_curve_curve"]
curve_curve: FloatParam, pub curve_curve: FloatParam,
} }
/// Contains the compressor parameters for both the upwards and downwards compressor banks. /// Contains the compressor parameters for both the upwards and downwards compressor banks.
@ -121,17 +121,17 @@ pub struct CompressorParams {
param_id_prefix: &'static str, param_id_prefix: &'static str,
/// The compression threshold relative to the target curve. /// 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. /// The compression ratio. At 1.0 the compressor is disengaged.
ratio: FloatParam, pub ratio: FloatParam,
/// The compression knee width, in decibels. /// 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 /// 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 /// 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 /// rather than linearly over the compressors. If this is set to 1.0, then the ratios will be
/// the same for every compressor. /// the same for every compressor.
high_freq_ratio_rolloff: FloatParam, pub high_freq_ratio_rolloff: FloatParam,
} }
unsafe impl Params for CompressorParams { 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 /// Global parameters. These could just live in this struct but I wanted a separate generic UI
/// just for these. /// just for these.
#[nested = "global"] #[nested = "global"]
global: Arc<GlobalParams>, pub global: Arc<GlobalParams>,
/// Parameters controlling the compressor thresholds and curves. /// Parameters controlling the compressor thresholds and curves.
#[nested = "threshold"] #[nested = "threshold"]
threshold: Arc<compressor_bank::ThresholdParams>, pub threshold: Arc<compressor_bank::ThresholdParams>,
/// Parameters for the upwards and downwards compressors. /// Parameters for the upwards and downwards compressors.
#[nested = "compressors"] #[nested = "compressors"]
compressors: compressor_bank::CompressorBankParams, pub compressors: compressor_bank::CompressorBankParams,
} }
/// Global parameters controlling the output stage and all compressors. /// Global parameters controlling the output stage and all compressors.
#[derive(Params)] #[derive(Params)]
struct GlobalParams { pub struct GlobalParams {
/// Makeup gain applied after the IDFT in the STFT process. If automatic makeup gain is enabled, /// 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. /// then this acts as an offset on top of that. This is stored as linear gain.
#[id = "output"] #[id = "output"]
output_gain: FloatParam, pub output_gain: FloatParam,
// TODO: Bring this back, and with values that make more sense // 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. // /// Try to automatically compensate for gain differences with different input gain, threshold, and ratio values.
// #[id = "auto_makeup"] // #[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 /// 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. /// applying the output gain. In other words, the dry signal is not gained in any way.
#[id = "dry_wet"] #[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 /// 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. /// plugin and it will thus just eat up headroom.
#[id = "dc_filter"] #[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). /// The size of the FFT window as a power of two (to prevent invalid inputs).
#[id = "stft_window"] #[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 /// The amount of overlap to use in the overlap-add algorithm as a power of two (again to
/// prevent invalid inputs). /// prevent invalid inputs).
#[id = "stft_overlap"] #[id = "stft_overlap"]
overlap_times_order: IntParam, pub overlap_times_order: IntParam,
/// The compressor's attack time in milliseconds. Controls both upwards and downwards /// The compressor's attack time in milliseconds. Controls both upwards and downwards
/// compression. /// compression.
#[id = "attack"] #[id = "attack"]
compressor_attack_ms: FloatParam, pub compressor_attack_ms: FloatParam,
/// The compressor's release time in milliseconds. Controls both upwards and downwards /// The compressor's release time in milliseconds. Controls both upwards and downwards
/// compression. /// compression.
#[id = "release"] #[id = "release"]
compressor_release_ms: FloatParam, pub compressor_release_ms: FloatParam,
} }
impl Default for SpectralCompressor { impl Default for SpectralCompressor {