@stringsync/vexml
Version:
MusicXML to Vexflow
25 lines (24 loc) • 762 B
JavaScript
import { PEDAL_TYPES } from './enums';
/**
* The <pedal> element represents piano pedal marks, including damper and sostenuto pedal marks.
*
* See https://www.w3.org/2021/06/musicxml40/musicxml-reference/elements/pedal/
*/
export class Pedal {
element;
constructor(element) {
this.element = element;
}
/** Returns the type of pedal. Defaults to 'start'. */
getType() {
return this.element.attr('type').withDefault('start').enum(PEDAL_TYPES);
}
/** Whether to show pedal signs. Defaults to false. */
sign() {
return this.element.attr('sign').str() === 'yes';
}
/** Whether to show pedal lines. Defaults to false. */
line() {
return this.element.attr('line').str() === 'yes';
}
}