UNPKG

@stringsync/vexml

Version:

MusicXML to Vexflow

39 lines (38 loc) 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Harmonic = void 0; /** * The `<harmonic>` element indicates natural and artificial harmonics. * * See https://www.w3.org/2021/06/musicxml40/musicxml-reference/elements/harmonic/ */ class Harmonic { element; constructor(element) { this.element = element; } /** Returns the type of harmonic. Defaults to 'unspecified'. */ getType() { if (this.element.first('natural')) { return 'natural'; } if (this.element.first('artificial')) { return 'artificial'; } return 'unspecified'; } /** Returns the pitch type of the harmonic. Defaults to 'unspecified'. */ getPitchType() { if (this.element.first('base-pitch')) { return 'base'; } if (this.element.first('touching-pitch')) { return 'touching'; } if (this.element.first('sounding-pitch')) { return 'sounding'; } return 'unspecified'; } } exports.Harmonic = Harmonic;