Struct monochord::tuning::CyclicTuning
[−]
[src]
pub struct CyclicTuning { /* fields omitted */ }
A cyclic tuning is like a spiral: repeats while growing
A simple example:
let tuning = CyclicTuning::from_ratios(&[ 5.0 / 4.0, 3.0 / 2.0, 2.0_f32 ], Hz(440.0)); println!("{:?}", tuning.pitch(0).unwrap()); // => Cents(440.0) println!("{:?}", tuning.pitch(1).unwrap()); // => Cents(550.0) println!("{:?}", tuning.pitch(2).unwrap()); // => Cents(660.0) println!("{:?}", tuning.pitch(3).unwrap()); // => Cents(880.0) println!("{:?}", tuning.pitch(4).unwrap()); // => Cents(1100.0)
Methods
impl CyclicTuning
[src]
fn from_cents<'a, I: IntoIterator<Item = &'a Cents>>(
steps: I,
reference: Hz
) -> Self
steps: I,
reference: Hz
) -> Self
Create a cyclic tuning from cents
Cents(0.0)
should be excluded and the last interval is the period
fn from_ratios<'a, I: IntoIterator<Item = &'a f32>>(
steps: I,
reference: Hz
) -> Self
steps: I,
reference: Hz
) -> Self
Create a cyclic tuning from cents
1.0
should be excluded and the last interval is the period
Trait Implementations
impl Debug for CyclicTuning
[src]
impl Clone for CyclicTuning
[src]
fn clone(&self) -> CyclicTuning
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