Trait tune::tuning::Scale

source ·
pub trait Scale {
    // Required methods
    fn sorted_pitch_of(&self, degree: i32) -> Pitch;
    fn find_by_pitch_sorted(&self, pitch: Pitch) -> Approximation<i32>;

    // Provided method
    fn as_sorted_tuning(self) -> SortedTuning<Self>
       where Self: Sized { ... }
}
Expand description

A Scale is a tuning whose Pitches can be accessed in a sorted manner.

Accessing pitches in order can be important, e.g. when handling pitches in a certain frequency window.

Required Methods§

source

fn sorted_pitch_of(&self, degree: i32) -> Pitch

Returns the Pitch at the given scale degree in the current Scale.

source

fn find_by_pitch_sorted(&self, pitch: Pitch) -> Approximation<i32>

Finds a closest scale degree Approximation for the given Pitch in the current Scale.

Provided Methods§

source

fn as_sorted_tuning(self) -> SortedTuning<Self>
where Self: Sized,

Wraps self in a type adapter s.t. it can be used in functions that are generic over Tuning<i32>.

Implementations on Foreign Types§

source§

impl<S: Borrow<Scl>, K: Borrow<KbmRoot>> Scale for (S, K)

source§

impl<S: Scale + ?Sized> Scale for &S

impl forwarding for references.

Implementors§