musicxml/elements/time_modification.rs
1use super::{ActualNotes, NormalDot, NormalNotes, NormalType};
2use alloc::{string::String, vec::Vec};
3use musicxml_internal::*;
4use musicxml_macros::*;
5
6/// Contents of the [TimeModification] element.
7#[derive(Debug, PartialEq, Eq, ContentDeserialize, ContentSerialize)]
8pub struct TimeModificationContents {
9 /// The [ActualNotes] element specifies the number of notes in the tuplet.
10 pub actual_notes: ActualNotes,
11 /// The [NormalNotes] element specifies the number of notes in the normal, in-effect duration.
12 pub normal_notes: NormalNotes,
13 /// The [NormalType] element specifies the normal, in-effect note type.
14 pub normal_type: Option<NormalType>,
15 /// The [NormalDot] element specifies the normal, in-effect dot.
16 pub normal_dot: Vec<NormalDot>,
17}
18
19/// [TimeModification] indicates tuplets, double-note tremolos, and other durational changes.
20///
21/// A [TimeModification] element shows how the cumulative, sounding effect of tuplets and double-note tremolos compare to the written
22/// note type represented by the [Type][super::Type] and [Dot][super::Dot] elements. Nested tuplets and other notations that use more detailed
23/// information need both the [TimeModification] and [Tuplet][super::Tuplet] elements to be represented accurately.
24#[derive(Debug, PartialEq, Eq, ElementDeserialize, ElementSerialize)]
25#[rename("time-modification")]
26pub struct TimeModification {
27 /// Element-specific attributes
28 pub attributes: (),
29 #[flatten]
30 /// Element-specific content
31 pub content: TimeModificationContents,
32}