pub struct FiguredBassScale { /* private fields */ }Expand description
The key a figured bass is counted in: a tonic and a mode.
use music21_rs::Pitch;
use music21_rs::figuredbass::Notation;
use music21_rs::figuredbass::scale::FiguredBassScale;
let c_major = FiguredBassScale::default();
let first_inversion = Notation::parse("6")?;
let names = c_major.pitch_names(&Pitch::from_name("D3")?, &first_inversion)?;
assert_eq!(names, ["D", "F", "B"]);Implementations§
Source§impl FiguredBassScale
impl FiguredBassScale
Sourcepub fn new(tonic: Pitch, mode: FiguredBassMode) -> Result<Self>
pub fn new(tonic: Pitch, mode: FiguredBassMode) -> Result<Self>
Sourcepub fn mode(&self) -> FiguredBassMode
pub fn mode(&self) -> FiguredBassMode
The mode it is in.
Sourcepub fn key_signature(&self) -> &KeySignature
pub fn key_signature(&self) -> &KeySignature
The key signature the tonic and mode are written with: music21’s
keySig.
Sourcepub fn pitch_names(
&self,
bass: &Pitch,
notation: &Notation,
) -> Result<Vec<String>>
pub fn pitch_names( &self, bass: &Pitch, notation: &Notation, ) -> Result<Vec<String>>
The names of the notes bass and notation stand for, the bass
first and the rest in the order the figures give them: music21’s
getPitchNames.
A bass the scale does not carry is read as the scale’s own note on its letter, spelled as the key signature spells it, which is how a chromatic bass is still counted from.
§Errors
A bass whose letter the scale cannot find, or a figure its modifier cannot be applied to.
Sourcepub fn sample_pitches(
&self,
bass: &Pitch,
notation: &Notation,
) -> Result<Vec<Pitch>>
pub fn sample_pitches( &self, bass: &Pitch, notation: &Notation, ) -> Result<Vec<Pitch>>
Every note bass and notation stand for from the bass up to, but
not including, the octave above it: the closest the chord can be
voiced. music21’s getSamplePitches.
§Errors
Trait Implementations§
Source§impl Clone for FiguredBassScale
impl Clone for FiguredBassScale
Source§impl Debug for FiguredBassScale
impl Debug for FiguredBassScale
Source§impl Default for FiguredBassScale
impl Default for FiguredBassScale
Source§impl<'de> Deserialize<'de> for FiguredBassScale
Available on crate feature serde only.
impl<'de> Deserialize<'de> for FiguredBassScale
Available on crate feature
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for FiguredBassScale
impl PartialEq for FiguredBassScale
Auto Trait Implementations§
impl Freeze for FiguredBassScale
impl RefUnwindSafe for FiguredBassScale
impl Send for FiguredBassScale
impl Sync for FiguredBassScale
impl Unpin for FiguredBassScale
impl UnsafeUnpin for FiguredBassScale
impl UnwindSafe for FiguredBassScale
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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