musicxml/elements/root.rs
1use super::{RootAlter, RootStep};
2use alloc::{string::String, vec::Vec};
3use musicxml_internal::*;
4use musicxml_macros::*;
5
6/// Contents of the [Root] element.
7#[derive(Debug, PartialEq, Eq, ContentDeserialize, ContentSerialize)]
8pub struct RootContents {
9 /// The [RootStep] element specifies the pitch like C, D, E vs. a scale degree like 1, 2, 3.
10 pub root_step: RootStep,
11 /// The [RootAlter] element specifies the chromatic alteration of the root of the chord.
12 pub root_alter: Option<RootAlter>,
13}
14
15/// The [Root] element indicates a pitch like C, D, E vs. a scale degree like 1, 2, 3.
16///
17/// It is used with chord symbols in popular music. The [Root] element has a [RootStep] and optional [RootAlter] element similar to the
18/// [Step][super::Step] and [Alter][super::Alter] elements, but renamed to distinguish the different musical meanings.
19#[derive(Debug, PartialEq, Eq, ElementDeserialize, ElementSerialize)]
20pub struct Root {
21 /// Element-specific attributes
22 pub attributes: (),
23 #[flatten]
24 /// Element-specific content
25 pub content: RootContents,
26}