The <swing> element

Parent element: <sound>

The <swing> element specifies whether or not to use swing playback, where consecutive on-beat / off-beat eighth or 16th notes are played with unequal nominal durations.

The <first> and <second> elements are positive integers that specify the ratio between durations of consecutive notes. For example, a <first> element with a value of 2 and a <second> element with a value of 1 applied to eighth notes specifies a quarter note / eighth note tuplet playback, where the first note is twice as long as the second note. Ratios should be specified with the smallest integers possible. For example, a ratio of 6 to 4 should be specified as 3 to 2 instead.

The <swing> element has no effect for playback of grace notes, notes where a <type> element is not present, and notes where the specified <duration> is different than the nominal value associated with the specified <type>. If a swung note has attack and release attributes, those values modify the swung playback.

https://www.w3.org/2021/06/musicxml40/musicxml-reference/elements/swing/

Hierarchy

  • Swing

Implements

Constructors

Properties

attributes: SwingAttributes
contents: SwingContents
schema: {
    attributes: {};
    contents: readonly [{
        label: "value";
        type: "label";
        value: {
            choices: readonly [typeof Straight, {
                label: "alternate-swing";
                type: "label";
                value: readonly [{
                    type: "required";
                    value: typeof First;
                }, {
                    type: "required";
                    value: typeof Second;
                }, {
                    type: "optional";
                    value: typeof SwingType;
                }];
            }];
            type: "choices";
        };
    }, {
        type: "optional";
        value: typeof SwingStyle;
    }];
    name: "swing";
} = Swing.schema

Type declaration

  • Readonly attributes: {}
    • Readonly contents: readonly [{
          label: "value";
          type: "label";
          value: {
              choices: readonly [typeof Straight, {
                  label: "alternate-swing";
                  type: "label";
                  value: readonly [{
                      type: "required";
                      value: typeof First;
                  }, {
                      type: "required";
                      value: typeof Second;
                  }, {
                      type: "optional";
                      value: typeof SwingType;
                  }];
              }];
              type: "choices";
          };
      }, {
          type: "optional";
          value: typeof SwingStyle;
      }]
    • Readonly name: "swing"
    schema: {
        attributes: {};
        contents: readonly [{
            label: "value";
            type: "label";
            value: {
                choices: readonly [typeof Straight, {
                    label: "alternate-swing";
                    type: "label";
                    value: readonly [{
                        type: "required";
                        value: typeof First;
                    }, {
                        type: "required";
                        value: typeof Second;
                    }, {
                        type: "optional";
                        value: typeof SwingType;
                    }];
                }];
                type: "choices";
            };
        }, {
            type: "optional";
            value: typeof SwingStyle;
        }];
        name: "swing";
    } = ...

    Type declaration

    • Readonly attributes: {}
      • Readonly contents: readonly [{
            label: "value";
            type: "label";
            value: {
                choices: readonly [typeof Straight, {
                    label: "alternate-swing";
                    type: "label";
                    value: readonly [{
                        type: "required";
                        value: typeof First;
                    }, {
                        type: "required";
                        value: typeof Second;
                    }, {
                        type: "optional";
                        value: typeof SwingType;
                    }];
                }];
                type: "choices";
            };
        }, {
            type: "optional";
            value: typeof SwingStyle;
        }]
      • Readonly name: "swing"

      Methods

      Generated using TypeDoc