Skip to main content

Args

Struct Args 

Source
pub struct Args {
Show 54 fields pub num_filters: usize, pub curve: Option<PathBuf>, pub target: Option<PathBuf>, pub sample_rate: f64, pub max_db: f64, pub min_db: f64, pub max_q: f64, pub min_q: f64, pub min_freq: f64, pub max_freq: f64, pub output: Option<PathBuf>, pub speaker: Option<String>, pub version: Option<String>, pub measurement: Option<String>, pub curve_name: String, pub algo: String, pub population: usize, pub maxeval: usize, pub refine: bool, pub local_algo: String, pub bo_initial_samples: usize, pub bo_batch_size: usize, pub bo_posterior_std_threshold: f64, pub bo_acquisition: String, pub bo_ehvi: bool, pub min_spacing_oct: f64, pub spacing_weight: f64, pub smoothness_weight: f64, pub smoothness_exponent: f64, pub smoothness_schroeder_hz: Option<f64>, pub smoothness_modal_scale: f64, pub smooth: bool, pub smooth_n: usize, pub loss: LossType, pub peq_model: PeqModel, pub peq_model_list: bool, pub algo_list: bool, pub tolerance: f64, pub atolerance: f64, pub recombination: f64, pub strategy: String, pub strategy_list: bool, pub adaptive_weight_f: f64, pub adaptive_weight_cr: f64, pub no_parallel: bool, pub parallel_threads: usize, pub seed: Option<u64>, pub qa: Option<f64>, pub driver1: Option<PathBuf>, pub driver2: Option<PathBuf>, pub driver3: Option<PathBuf>, pub driver4: Option<PathBuf>, pub crossover_type: String, pub preset: Option<String>,
}
Expand description

Shared CLI arguments for AutoEQ binaries.

Fields§

§num_filters: usize

Number of IIR filters to use for optimization.

§curve: Option<PathBuf>

Path to the input curve CSV file (format: frequency,spl). Required unless speaker, version, and measurement are provided for API data.

§target: Option<PathBuf>

Path to the optional target curve CSV file (format: frequency,spl). If not provided, a flat 0 dB target is assumed.

§sample_rate: f64

The sample rate for the IIR filters.

§max_db: f64

Maximum absolute dB gain allowed for each filter.

§min_db: f64

Minimum signed dB gain allowed for each filter (the cut bound).

§max_q: f64

Maximum Q factor allowed for each filter.

§min_q: f64

Minimum Q factor allowed for each filter.

§min_freq: f64

Minimum frequency allowed for each filter.

§max_freq: f64

Maximum frequency allowed for each filter.

§output: Option<PathBuf>

Output PNG file for plotting results.

§speaker: Option<String>

Speaker name for API data fetching.

§version: Option<String>

Version for API data fetching.

§measurement: Option<String>

Measurement type for API data fetching.

§curve_name: String

Curve name inside CEA2034 plots to use (only when –measurement CEA2034) e.g., “Listening Window”, “On Axis”, “Early Reflections”. Default: Listening Window

§algo: String

Optimization algorithm to use (e.g., autoeq:isres, autoeq:cobyla)

§population: usize

Optional population size for population-based algorithms (e.g., ISRES)

§maxeval: usize

Maximum number of evaluations for the optimizer

§refine: bool

Whether to run a local refinement after global optimization

§local_algo: String

Local optimizer to use for refinement (e.g., cobyla)

§bo_initial_samples: usize

Bayesian optimization Sobol hot-start samples (0 = automatic)

§bo_batch_size: usize

Bayesian optimization batch size for parallel expensive evaluations (0 = automatic)

§bo_posterior_std_threshold: f64

Bayesian optimization posterior-std threshold for local-refiner handoff (0 disables)

§bo_acquisition: String

Bayesian optimization acquisition: ei, qei, or thompson

§bo_ehvi: bool

Use Monte-Carlo qEHVI Bayesian optimization for multi-objective data

§min_spacing_oct: f64

Minimum spacing between filter center frequencies in octaves (0 disables)

§spacing_weight: f64

Weight for the spacing penalty in the objective function

§smoothness_weight: f64

Second-difference penalty weight on the correction curve (dB/decade^2). 0 disables. Suggested starting point: 0.05.

§smoothness_exponent: f64

L_p exponent for smoothness penalty (1.0 = TV^2/sparsifier, 2.0 = L2).

§smoothness_schroeder_hz: Option<f64>

Schroeder cutoff for relaxed smoothness in the modal region.

§smoothness_modal_scale: f64

Modal-region weight multiplier (0 = exempt modal region entirely).

§smooth: bool

Enable smoothing (regularization) of the inverted target curve

§smooth_n: usize

Smoothing level as 1/N octave (N in [1..24]). Example: N=6 => 1/6 octave smoothing

§loss: LossType

Loss function to optimize (flat or score).

§peq_model: PeqModel

PEQ model that defines the filter structure

§peq_model_list: bool

Display list of available PEQ models with descriptions and exit.

§algo_list: bool

Display list of available optimization algorithms with descriptions and exit.

§tolerance: f64

Optimization tolerance (tol parameter for DE algorithm)

§atolerance: f64

Absolute tolerance (atol parameter for DE algorithm)

§recombination: f64

Recombination probability for DE algorithm (0.0 to 1.0)

§strategy: String

DE strategy to use (e.g., best1bin, rand1bin, currenttobest1bin, adaptive)

§strategy_list: bool

Display list of available DE strategies and exit.

§adaptive_weight_f: f64

Adaptive weight for F parameter (DE adaptive strategies only)

§adaptive_weight_cr: f64

Adaptive weight for CR parameter (DE adaptive strategies only)

§no_parallel: bool

Disable parallel evaluation for DE algorithm (default: parallel is enabled)

§parallel_threads: usize

Number of threads to use for parallel evaluation (0 = use all available cores)

§seed: Option<u64>

Random seed for deterministic optimization (default: random seed for each run) Setting this makes optimization results reproducible

§qa: Option<f64>

Quality assurance mode with optional threshold: suppress normal output, show summary line and analysis If a threshold is provided (e.g., –qa 0.4), also perform QA analysis

§driver1: Option<PathBuf>

Path to first driver measurement CSV file (for multi-driver optimization with –loss drivers-flat)

§driver2: Option<PathBuf>

Path to second driver measurement CSV file (for multi-driver optimization with –loss drivers-flat)

§driver3: Option<PathBuf>

Path to third driver measurement CSV file (for multi-driver optimization with –loss drivers-flat)

§driver4: Option<PathBuf>

Path to fourth driver measurement CSV file (for multi-driver optimization with –loss drivers-flat)

§crossover_type: String

Crossover type for multi-driver optimization (butterworth2, linkwitzriley2, linkwitzriley4)

§preset: Option<String>

Use a named preset that sets all optimizer parameters at once. Available presets: quick, balanced, max-quality, score (speakers only). Individual parameter flags override preset values when both are specified.

Implementations§

Source§

impl Args

Source

pub fn effective_peq_model(&self) -> PeqModel

Get the effective PEQ model

Source

pub fn uses_highpass_first(&self) -> bool

Check if the first filter should be a highpass (for compatibility)

Source

pub fn speaker_defaults() -> Args

Create Args with speaker optimization defaults

These defaults are tuned for typical speaker EQ optimization using CEA2034 measurements from spinorama.org.

Source

pub fn headphone_defaults() -> Args

Create Args with headphone optimization defaults

These defaults are tuned for headphone EQ optimization using frequency response measurements and Harman target curves.

Source

pub fn roomeq_defaults() -> Args

Create Args with room EQ optimization defaults

These defaults are tuned for room correction, focusing on low frequencies where room modes are most problematic.

Source

pub fn apply_preset(&mut self)

Apply a named preset, setting optimizer parameters to tuned values. Call this after parsing CLI args. Parameters explicitly set by the user are not tracked by clap, so this method overwrites all optimizer fields. The caller should parse args, call apply_preset(), then override any fields they want to customize.

NOTE: These preset values are intentionally duplicated from sotf-player::autoeq::presets because the autoeq crate cannot depend on sotf-player. Keep values in sync when updating presets.

Available presets:

  • quick: 5 filters, fast (pop 40, maxeval 2000, no refine)
  • balanced: 7 filters, good balance (pop 80, maxeval 5000, refine)
  • max-quality: 10 filters, best results (pop 200, maxeval 20000, ls-pk-hs, refine)
  • score: 7 filters, listener preference score (speaker-score loss)
Source

pub fn display_preset_list() -> !

Display available presets and exit.

Trait Implementations§

Source§

impl Args for Args

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl Clone for Args

Source§

fn clone(&self) -> Args

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CommandFactory for Args

Source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
Source§

impl Debug for Args

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl From<&Args> for PlotConfig

Source§

fn from(args: &Args) -> Self

Converts to this type from the input type.
Source§

impl FromArgMatches for Args

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Args, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Args, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for Args

Source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
Source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
Source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
Source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
Source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error. Read more
Source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

Auto Trait Implementations§

§

impl Freeze for Args

§

impl RefUnwindSafe for Args

§

impl Send for Args

§

impl Sync for Args

§

impl Unpin for Args

§

impl UnsafeUnpin for Args

§

impl UnwindSafe for Args

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> MaybeParallel for T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more