Skip to main content

Config

Struct Config 

Source
pub struct Config {
Show 22 fields pub bars: usize, pub min_hz: f32, pub max_hz: f32, pub bass_lo_hz: f32, pub bass_hi_hz: f32, pub mid_hi_hz: f32, pub high_hi_hz: f32, pub floor_db: f32, pub tilt_db_per_octave: f32, pub tilt_ref_hz: f32, pub bar_attack: f32, pub bar_release: f32, pub peak_hold: f32, pub peak_fall: f32, pub pulse_release: f32, pub bass_average: f32, pub hit_threshold: f32, pub hit_refractory: f32, pub hit_release: f32, pub fft_size: usize, pub chroma_lo_hz: f32, pub chroma_hi_hz: f32,
}
Expand description

分析の設定。既定値は、スペクトラムのバーと低音の脈動の見え方を決める(変えると、使うアプリの 見た目がすべて変わる)。値が不正なとき(範囲が逆・0 以下など)は Analyzer::new が直す。

Fields§

§bars: usize

バーの本数。

§min_hz: f32

バーにする周波数の範囲(Hz)。

§max_hz: f32§bass_lo_hz: f32

低音の範囲(Hz)。キックとベースの基音のあたり。脈動と、低域の帯域に使う。

§bass_hi_hz: f32§mid_hi_hz: f32

中域の上端(Hz)。低域の上端(Config::bass_hi_hz)からここまでが中域。

§high_hi_hz: f32

高域の上端(Hz)。中域の上端からここまでが高域。

§floor_db: f32

下限(dB、負の値)。これ以下は 0、0dBFS の正弦波が 1。

§tilt_db_per_octave: f32

バーの持ち上げ(dB/オクターブ)。Config::tilt_ref_hz より高いバーを足し、低いバーを引く。 音楽の高域は低域より小さいので、0 のままだと右側のバーがほとんど動かない。ピンクノイズが 平らに見えるのが 3、0 で持ち上げなし。

§tilt_ref_hz: f32

持ち上げの基準の周波数(Hz)。この高さのバーは変わらない。

§bar_attack: f32

バーが立ち上がる時定数(秒)。

§bar_release: f32

バーが戻る時定数(秒)。

§peak_hold: f32

ピークの印を止めておく時間(秒)。

§peak_fall: f32

ピークの印が落ちる速さ(1 秒あたりの高さ。1 なら全高を 1 秒で落ちる)。

§pulse_release: f32

脈動が戻る時定数(秒)。立ち上がりは即座。

§bass_average: f32

ふだんの低音を追う速さ(60 フレーム/秒のときの 1 フレームあたりの残り率。0〜1、大きいほど遅い)。 帯域ごとの「ふだんの強さ」も同じ速さで追う。

§hit_threshold: f32

ビートとみなす、ふだんの強さからの立ち上がり(0〜1 の強さの差)。小さいほど敏感。

§hit_refractory: f32

同じ帯域でビートを続けて拾わない間隔(秒)。

§hit_release: f32

ビートの印が戻る時定数(秒)。立ち上がりは即座。

§fft_size: usize

FFT の窓の長さ(サンプル数)。2 の冪(そうでなければ大きいほうの冪に直す)で、 MIN_FFT_SIZE〜MAX_FFT_SIZE。長いほど周波数の刻みが細かく(低音・音名が読みやすく)なり、 動きは遅れる。Analyzer::update に渡す波形の長さがこの値になる。

§chroma_lo_hz: f32

音名(Frame::chroma)を読む周波数の範囲(Hz)。低い音は窓が短いと刻みが粗くて音名を取り違えるので、 既定は A2(110Hz)から。

§chroma_hi_hz: f32

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Self

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 Copy for Config

Source§

impl Debug for Config

Source§

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

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

impl Default for Config

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Config

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Config

Auto Trait Implementations§

§

impl Forget for Config

§

impl Freeze for Config

§

impl Move for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnsafeUnpin for Config

§

impl UnwindSafe for Config

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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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.