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
One row of a DCML table, read: music21’s TabChord and TabChordV2.
The columns of the two standards differ in their names and in what they
carry, and a row of either is read into this one type – what the lab’s
version 1 calls measure and beat its version 2 calls mn and
mn_onset, and counts the onset in whole notes rather than in beats.
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 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.
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 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