UNPKG

@stringsync/vexml

Version:

MusicXML to Vexflow

25 lines (24 loc) 784 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Part = void 0; const measure_1 = require("./measure"); /** * The top level of musical organization below the Score that contains a sequence of Measures. * * See https://www.w3.org/2021/06/musicxml40/musicxml-reference/elements/part-partwise/ */ class Part { element; constructor(element) { this.element = element; } /** Returns the ID of the part or an empty string if missing. */ getId() { return this.element.attr('id').withDefault('').str(); } /** Returns an array of measures in the order they appear. */ getMeasures() { return this.element.all('measure').map((element) => new measure_1.Measure(element)); } } exports.Part = Part;