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]

Create a cyclic tuning from cents

Cents(0.0) should be excluded and the last interval is the period

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]

Formats the value using the given formatter.

impl Clone for CyclicTuning
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Tuning for CyclicTuning
[src]

Returns the reference pitch of the tuning

Returns the pitch of a step

Returns an interval from one step to another