musicxml/elements/
unstress.rs

1use crate::datatypes::{AboveBelow, Color, FontFamily, FontSize, FontStyle, FontWeight, Tenths};
2use alloc::{string::String, vec::Vec};
3use musicxml_internal::*;
4use musicxml_macros::*;
5
6/// Attributes pertaining to the [Unstress] element.
7#[derive(Debug, Default, PartialEq, Eq, AttributeDeserialize, AttributeSerialize)]
8pub struct UnstressAttributes {
9  /// Indicates the color of an element.
10  pub color: Option<Color>,
11  /// Changes the computation of the default horizontal position.
12  /// The origin is changed relative to the left-hand side of the note or the musical position within the bar.
13  /// Positive x is right and negative x is left.
14  ///
15  /// This attribute provides higher-resolution positioning data than the [Offset][super::Offset] element.
16  /// Applications reading a MusicXML file that can understand both features should generally rely on this attribute for its greater accuracy.
17  pub default_x: Option<Tenths>,
18  /// Changes the computation of the default vertical position.
19  /// The origin is changed relative to the top line of the staff. Positive y is up and negative y is down.
20  ///
21  /// This attribute provides higher-resolution positioning data than the `placement` attribute.
22  /// Applications reading a MusicXML file that can understand both attributes should generally rely on this attribute for its greater accuracy.
23  pub default_y: Option<Tenths>,
24  /// A comma-separated list of font names.
25  pub font_family: Option<FontFamily>,
26  /// One of the CSS sizes or a numeric point size.
27  pub font_size: Option<FontSize>,
28  /// Normal or italic style.
29  pub font_style: Option<FontStyle>,
30  /// Normal or bold weight.
31  pub font_weight: Option<FontWeight>,
32  /// Indicates whether something is above or below another element, such as a note or a notation.
33  pub placement: Option<AboveBelow>,
34  /// Changes the horizontal position relative to the default position, either as computed by the individual program, or as overridden by the `default_x` attribute.
35  /// Positive x is right and negative x is left. It should be interpreted in the context of the [Offset][super::Offset] element or directive attribute if those are present.
36  pub relative_x: Option<Tenths>,
37  /// Changes the vertical position relative to the default position, either as computed by the individual program, or as overridden by the `default_y` attribute.
38  /// Positive y is up and negative y is down. It should be interpreted in the context of the `placement` attribute if that is present.
39  pub relative_y: Option<Tenths>,
40}
41
42/// The [Unstress] element indicates an unstressed note.
43///
44/// ![Unstress](https://hedgetechllc.github.io/musicxml/musicxml/elements/unstress.png)
45///
46/// It is often notated using a u-shaped symbol.
47#[derive(Debug, PartialEq, Eq, ElementDeserialize, ElementSerialize)]
48pub struct Unstress {
49  /// Element-specific attributes
50  pub attributes: UnstressAttributes,
51  /// Element-specific content
52  pub content: (),
53}