musicxml/elements/
shake.rs

1use crate::datatypes::{
2  AboveBelow, Color, FontFamily, FontSize, FontStyle, FontWeight, Percent, StartNote, Tenths, TrillBeats, TrillStep,
3  TwoNoteTurn, YesNo,
4};
5use alloc::{string::String, vec::Vec};
6use musicxml_internal::*;
7use musicxml_macros::*;
8
9/// Attributes pertaining to the [Shake] element.
10#[derive(Debug, Default, PartialEq, Eq, AttributeDeserialize, AttributeSerialize)]
11pub struct ShakeAttributes {
12  /// If yes, the trill accelerates during playback. It is no if not specified.
13  pub accelerate: Option<YesNo>,
14  /// The number of distinct notes during playback, counting the starting note but not the two-note turn. It is 3 if not specified.
15  pub beats: Option<TrillBeats>,
16  /// Indicates the color of an element.
17  pub color: Option<Color>,
18  /// Changes the computation of the default horizontal position.
19  /// The origin is changed relative to the left-hand side of the note or the musical position within the bar.
20  /// Positive x is right and negative x is left.
21  ///
22  /// This attribute provides higher-resolution positioning data than the [Offset][super::Offset] element.
23  /// Applications reading a MusicXML file that can understand both features should generally rely on this attribute for its greater accuracy.
24  pub default_x: Option<Tenths>,
25  /// Changes the computation of the default vertical position.
26  /// The origin is changed relative to the top line of the staff. Positive y is up and negative y is down.
27  ///
28  /// This attribute provides higher-resolution positioning data than the `placement` attribute.
29  /// Applications reading a MusicXML file that can understand both attributes should generally rely on this attribute for its greater accuracy.
30  pub default_y: Option<Tenths>,
31  /// A comma-separated list of font names.
32  pub font_family: Option<FontFamily>,
33  /// One of the CSS sizes or a numeric point size.
34  pub font_size: Option<FontSize>,
35  /// Normal or italic style.
36  pub font_style: Option<FontStyle>,
37  /// Normal or bold weight.
38  pub font_weight: Option<FontWeight>,
39  /// The percentage of the way through the duration for landing on the last beat. It is 24 if not specified.
40  pub last_beat: Option<Percent>,
41  /// Indicates whether something is above or below another element, such as a note or a notation.
42  pub placement: Option<AboveBelow>,
43  /// Changes the horizontal position relative to the default position, either as computed by the individual program, or as overridden by the `default_x` attribute.
44  /// 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.
45  pub relative_x: Option<Tenths>,
46  /// Changes the vertical position relative to the default position, either as computed by the individual program, or as overridden by the `default_y` attribute.
47  /// Positive y is up and negative y is down. It should be interpreted in the context of the `placement` attribute if that is present.
48  pub relative_y: Option<Tenths>,
49  /// The percentage of the way through the duration for landing on the second beat. It is 12 if not specified.
50  pub second_beat: Option<Percent>,
51  /// The starting note for playback, relative to the current note. It is main if not specified.
52  pub start_note: Option<StartNote>,
53  /// The alternating note for playback, relative to the current note. It is whole if not specified.
54  pub trill_step: Option<TrillStep>,
55  /// Specifies the two-note turn included at the end of the trill, if any. It is none if not specified.
56  pub two_note_turn: Option<TwoNoteTurn>,
57}
58
59/// The [Shake] element has a similar appearance to an [InvertedMordent][super::InvertedMordent] element.
60///
61/// ![Shake](https://hedgetechllc.github.io/musicxml/musicxml/elements/shake.png)
62#[derive(Debug, PartialEq, Eq, ElementDeserialize, ElementSerialize)]
63pub struct Shake {
64  /// Element-specific attributes
65  pub attributes: ShakeAttributes,
66  /// Element-specific content
67  pub content: (),
68}