Struct pitch_calc::scaled_perc::ScaledPerc [] [src]

pub struct ScaledPerc(pub Perc, pub ScaleWeight);

Pitch representation in the form of a scaled percentage between the min and max hz.

Methods

impl ScaledPerc
[src]

fn new(perc: Perc) -> ScaledPerc

A constructor for a ScaledPerc that uses the default weight.

fn scaled_perc(&self) -> Perc

Return the value as a scaled percentage.

fn scale_weight(&self) -> ScaleWeight

Return the scale weight.

fn hz(&self) -> Hz

Convert to the unit value of the equivalent frequency in Hz.

fn to_hz(&self) -> Hz

Convert to the equivalent frequency in Hz.

fn letter_octave(&self) -> (Letter, Octave)

Convert to (Letter, Octave) tuple.

fn letter(&self) -> Letter

Convert to Letter.

fn octave(&self) -> Octave

Convert to Octave.

fn to_letter_octave(&self) -> LetterOctave

Convert to LetterOctave.

fn mel(&self) -> Mel

Convert to the unit value of a Mel.

fn to_mel(&self) -> Mel

Convert to a Mel struct.

fn perc(&self) -> Perc

Convert to the unit value of a Perc struct.

fn to_perc(&self) -> Perc

Convert to Perc.

fn step(&self) -> Step

Convert to the unit value of a Step.

fn to_step(&self) -> Step

Convert to a floating point MIDI-esque Step.

Trait Implementations

impl Decodable for ScaledPerc
[src]

fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<ScaledPerc, __D::Error>

impl Encodable for ScaledPerc
[src]

fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>

impl Clone for ScaledPerc
[src]

fn clone(&self) -> ScaledPerc

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl Copy for ScaledPerc
[src]

impl Debug for ScaledPerc
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Add for ScaledPerc
[src]

type Output = ScaledPerc

The resulting type after applying the + operator

fn add(self, rhs: ScaledPerc) -> ScaledPerc

The method for the + operator

impl Sub for ScaledPerc
[src]

type Output = ScaledPerc

The resulting type after applying the - operator

fn sub(self, rhs: ScaledPerc) -> ScaledPerc

The method for the - operator

impl Mul for ScaledPerc
[src]

type Output = ScaledPerc

The resulting type after applying the * operator

fn mul(self, rhs: ScaledPerc) -> ScaledPerc

The method for the * operator

impl Div for ScaledPerc
[src]

type Output = ScaledPerc

The resulting type after applying the / operator

fn div(self, rhs: ScaledPerc) -> ScaledPerc

The method for the / operator

impl Rem for ScaledPerc
[src]

type Output = ScaledPerc

The resulting type after applying the % operator

fn rem(self, rhs: ScaledPerc) -> ScaledPerc

The method for the % operator

impl Neg for ScaledPerc
[src]

type Output = ScaledPerc

The resulting type after applying the - operator

fn neg(self) -> ScaledPerc

The method for the unary - operator

impl PartialEq for ScaledPerc
[src]

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

This method tests for self and other values to be equal, and is used by ==. Read more

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

This method tests for !=.

impl Eq for ScaledPerc
[src]

impl PartialOrd for ScaledPerc
[src]

fn partial_cmp(&self, other: &ScaledPerc) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more

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

This method tests less than (for self and other) and is used by the < operator. Read more

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

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

This method tests greater than (for self and other) and is used by the > operator. Read more

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for ScaledPerc
[src]

fn cmp(&self, other: &ScaledPerc) -> Ordering

This method returns an Ordering between self and other. Read more