@stringsync/vexml
Version:
MusicXML to Vexflow
22 lines (21 loc) • 711 B
JavaScript
import { UP_DOWN_STOP_CONTINUE } from './enums';
/**
* The <octave-shift> element indicates where notes are shifted up or down from their performed values because of
* printing difficulty.
*
* See https://www.w3.org/2021/06/musicxml40/musicxml-reference/elements/octave-shift/
*/
export class OctaveShift {
element;
constructor(element) {
this.element = element;
}
/** Returns the octave shift type. Defaults to 'up'. */
getType() {
return this.element.attr('type').withDefault('up').enum(UP_DOWN_STOP_CONTINUE);
}
/** Returns the size of the octave shift. Defaults to 8. */
getSize() {
return this.element.attr('size').withDefault(8).int();
}
}