pub struct TabChord {Show 17 fields
pub version: Version,
pub chord: String,
pub numeral: String,
pub relativeroot: Option<String>,
pub form: Option<String>,
pub figbass: Option<String>,
pub changes: Option<String>,
pub phraseend: Option<String>,
pub pedal: Option<String>,
pub local_key: String,
pub global_key: String,
pub beat: FloatType,
pub measure: i32,
pub timesig: String,
pub volta: Option<String>,
pub length: Option<FloatType>,
pub extra: Vec<(String, String)>,
}Expand description
Every column the standard does not name is kept beside the row, as
music21 keeps its extra.
Fields§
§version: VersionWhich standard the row was read in.
chord: StringThe label the annotator wrote: the lab’s chord.
numeral: StringThe degree alone.
relativeroot: Option<String>The degree the chord is read in, written after a slash.
form: Option<String>o, +, % or M: how the chord is built over the degree.
figbass: Option<String>The figured bass under it.
changes: Option<String>The tones it adds or leaves out.
phraseend: Option<String>Whether a phrase ends here.
pedal: Option<String>The note held under it.
local_key: StringThe key in force, as a degree of the global key or as a key.
global_key: StringThe key the piece is in.
beat: FloatTypeThe beat of the measure the chord falls on, counted from one.
measure: i32The measure it falls in.
timesig: StringThe meter in force, as a ratio.
volta: Option<String>Which time through a repeat the row belongs to, where the lab’s version 2 says.
length: Option<FloatType>How long the chord sounds, where the lab’s version 1 says.
extra: Vec<(String, String)>Every other column of the row, by name.
Implementations§
Source§impl TabChord
impl TabChord
Sourcepub fn from_row(
header: &[String],
row: &[String],
version: Version,
) -> Result<Self>
pub fn from_row( header: &[String], row: &[String], version: Version, ) -> Result<Self>
A row read against a table’s own header: music21’s
populateFromRow, which reads the columns its standard names and
keeps the rest beside them.
Sourcepub fn spelled(&self, direction: Direction) -> Spelling
pub fn spelled(&self, direction: Direction) -> Spelling
The label and the keys as one of the two standards spells them:
music21’s _changeRepresentation, which writes all five back onto
the row.
Only the reading into music21 touches the label: music21 leaves a row’s chord and form alone going the other way.
Sourcepub fn label(&self) -> String
pub fn label(&self) -> String
The figure the row’s fields spell as they stand: the
figure-building half of music21’s tabToM21, which reads the row
after _changeRepresentation has had its way with it.
The lab’s version 2 writes the whole label in one column, which is the figure; version 1 writes the degree, how the chord is built over it, the figured bass and the degree it is read in, which this puts together.
Sourcepub fn key(&self) -> Result<Key>
pub fn key(&self) -> Result<Key>
The key the chord is read in: the local key as a key of its own, where the table wrote it as a degree of the global key.
§Errors
A local key that names no major or minor triad of the global one.
Sourcepub fn element(&self) -> Result<StreamElement>
pub fn element(&self) -> Result<StreamElement>
The chord the row stands for: a numeral in the key in force, or the
chord of no harmony the lab writes @none.
The sixth and the seventh of a minor key are read flat, as music21 reads a table’s.
§Errors
A label or a key the crate cannot read.
Sourcepub fn element_as_spelled(&self) -> Result<StreamElement>
pub fn element_as_spelled(&self) -> Result<StreamElement>
The same of a row as it stands, which is music21’s tabToM21
once _changeRepresentation has had its way with the row.
§Errors
A label or a key the crate cannot read.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TabChord
Available on crate feature serde only.
impl<'de> Deserialize<'de> for TabChord
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>,
impl StructuralPartialEq for TabChord
Auto Trait Implementations§
impl Forget for TabChord
impl Freeze for TabChord
impl RefUnwindSafe for TabChord
impl Send for TabChord
impl Sync for TabChord
impl Unpin for TabChord
impl UnsafeUnpin for TabChord
impl UnwindSafe for TabChord
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
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> ⓘ
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> ⓘ
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