pub struct WeightedHexatonicBlues { /* private fields */ }Expand description
music21’s WeightedHexatonicBlues, with the randomness made explicit.
use music21_rs::{BluesForm, Pitch, WeightedHexatonicBlues};
let blues = WeightedHexatonicBlues::new(Pitch::from_name("C4")?);
let names: Vec<String> = blues.pitches(BluesForm::Hexatonic)?
.iter().map(|p| p.name()).collect();
assert_eq!(names, ["C", "E-", "F", "F#", "G", "B-", "C"]);
let names: Vec<String> = blues.pitches(BluesForm::Pentatonic)?
.iter().map(|p| p.name()).collect();
assert_eq!(names, ["C", "E-", "F", "G", "B-", "C"]);Implementations§
Source§impl WeightedHexatonicBlues
impl WeightedHexatonicBlues
Sourcepub fn pitches(&self, form: BluesForm) -> Result<Vec<Pitch>>
pub fn pitches(&self, form: BluesForm) -> Result<Vec<Pitch>>
Returns the pitches of one form, from the tonic through its octave.
Sourcepub fn scale(&self, form: BluesForm) -> Result<StepScale>
pub fn scale(&self, form: BluesForm) -> Result<StepScale>
Returns one form as a StepScale, for degree and interval access.
Sourcepub fn form_for_seed(seed: u64) -> BluesForm
pub fn form_for_seed(seed: u64) -> BluesForm
Picks a form from seed, the way music21 picks one at random.
Deterministic for a given seed, so a caller who wants music21’s behaviour can supply entropy and a caller who wants a reproducible result can supply a constant. The two forms are equally likely.
Trait Implementations§
Source§impl Clone for WeightedHexatonicBlues
impl Clone for WeightedHexatonicBlues
Source§fn clone(&self) -> WeightedHexatonicBlues
fn clone(&self) -> WeightedHexatonicBlues
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WeightedHexatonicBlues
impl Debug for WeightedHexatonicBlues
Source§impl PartialEq for WeightedHexatonicBlues
impl PartialEq for WeightedHexatonicBlues
Source§fn eq(&self, other: &WeightedHexatonicBlues) -> bool
fn eq(&self, other: &WeightedHexatonicBlues) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for WeightedHexatonicBlues
Auto Trait Implementations§
impl Freeze for WeightedHexatonicBlues
impl RefUnwindSafe for WeightedHexatonicBlues
impl Send for WeightedHexatonicBlues
impl Sync for WeightedHexatonicBlues
impl Unpin for WeightedHexatonicBlues
impl UnsafeUnpin for WeightedHexatonicBlues
impl UnwindSafe for WeightedHexatonicBlues
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more