Enum redact_composer_musical::Scale
source · pub enum Scale {
Major,
NaturalMinor,
MelodicMinor,
HarmonicMinor,
}
Expand description
Sequence of intervals spanning 12 semitones or one octave.
Variants§
Major
let (w, h) = (Interval(2), Interval(1)); // w = Whole-step, h = Half-step
assert_eq!(Scale::Major.interval_steps(), vec![w, w, h, w, w, w, h]);
assert_eq!(Scale::Major.interval_steps().into_iter().sum::<Interval>(), Interval::Octave);
NaturalMinor
let (w, h) = (Interval(2), Interval(1)); // w = Whole-step, h = Half-step
assert_eq!(Scale::NaturalMinor.interval_steps(), vec![w, h, w, w, h, w, w]);
assert_eq!(Scale::NaturalMinor.interval_steps().into_iter().sum::<Interval>(), Interval::Octave);
MelodicMinor
let (w, h) = (Interval(2), Interval(1)); // w = Whole-step, h = Half-step
assert_eq!(Scale::MelodicMinor.interval_steps(), vec![w, h, w, w, w, w, h]);
assert_eq!(Scale::MelodicMinor.interval_steps().into_iter().sum::<Interval>(), Interval::Octave);
HarmonicMinor
let (w, h) = (Interval(2), Interval(1)); // w = Whole-step, h = Half-step
assert_eq!(Scale::HarmonicMinor.interval_steps(), vec![w, h, w, w, h, w + h, h]);
assert_eq!(Scale::HarmonicMinor.interval_steps().into_iter().sum::<Interval>(), Interval::Octave);
Implementations§
Trait Implementations§
source§impl IntervalStepSequence for Scale
impl IntervalStepSequence for Scale
source§fn interval_steps(&self) -> Vec<Interval>
fn interval_steps(&self) -> Vec<Interval>
Provides a sequence of intervals, representing the interval deltas from one to the next.
source§impl PartialEq for Scale
impl PartialEq for Scale
impl Copy for Scale
impl Eq for Scale
impl StructuralPartialEq for Scale
Auto Trait Implementations§
impl Freeze for Scale
impl RefUnwindSafe for Scale
impl Send for Scale
impl Sync for Scale
impl Unpin for Scale
impl UnwindSafe for Scale
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more