musicxml/elements/
bass_step.rs

1use crate::datatypes::{Color, FontFamily, FontSize, FontStyle, FontWeight, Step, Tenths, Token};
2use alloc::{string::String, vec::Vec};
3use musicxml_internal::*;
4use musicxml_macros::*;
5
6/// Attributes pertaining to the [BassStep] element.
7#[derive(Debug, Default, PartialEq, Eq, AttributeDeserialize, AttributeSerialize)]
8pub struct BassStepAttributes {
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  /// Changes the horizontal position relative to the default position, either as computed by the individual program, or as overridden by the `default_x` attribute.
33  /// 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.
34  pub relative_x: Option<Tenths>,
35  /// Changes the vertical position relative to the default position, either as computed by the individual program, or as overridden by the `default_y` attribute.
36  /// Positive y is up and negative y is down. It should be interpreted in the context of the `placement` attribute if that is present.
37  pub relative_y: Option<Tenths>,
38  /// Indicates how the bass should appear in a score if not using the element contents.
39  pub text: Option<Token>,
40}
41
42/// The [BassStep] element represents the pitch step of the bass of the current chord within the [Harmony][super::Harmony] element.
43#[derive(Debug, PartialEq, Eq, ElementDeserialize, ElementSerialize)]
44#[rename("bass-step")]
45pub struct BassStep {
46  /// Element-specific attributes
47  pub attributes: BassStepAttributes,
48  /// Element-specific content
49  pub content: Step,
50}