@stringsync/vexml
Version:
MusicXML to Vexflow
21 lines (20 loc) • 580 B
JavaScript
import { START_STOP } from './enums';
/**
* The `<hammer-on>` element is used in guitar and fretted instrument notation.
*
* See https://www.w3.org/2021/06/musicxml40/musicxml-reference/elements/hammer-on/
*/
export class HammerOn {
element;
constructor(element) {
this.element = element;
}
/** Returns the number of the hammer-on. Defaults to null. */
getNumber() {
return this.element.attr('number').int();
}
/** Returns the type of hammer-on. */
getType() {
return this.element.attr('type').enum(START_STOP);
}
}