@stringsync/vexml
Version:
MusicXML to Vexflow
31 lines (30 loc) • 924 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Bend = void 0;
/**
* The `<bend>` element is used in guitar notation and tablature. A single note with a bend and release will contain two
* `<bend>` elements: the first to represent the bend and the second to represent the release.
*
* See https://www.w3.org/2021/06/musicxml40/musicxml-reference/elements/bend/
*/
class Bend {
element;
constructor(element) {
this.element = element;
}
/** Returns the number of semitones to bend. */
getAlter() {
return this.element.first('bend-alter')?.content().float() ?? 1;
}
/** Returns the type of bend. */
getType() {
if (this.element.first('pre-bend')) {
return 'pre-bend';
}
if (this.element.first('release')) {
return 'release';
}
return 'normal';
}
}
exports.Bend = Bend;