UNPKG

@stringsync/vexml

Version:

MusicXML to Vexflow

38 lines (37 loc) 1.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Vibrato = void 0; class Vibrato { config; log; number; phase; constructor(config, log, number, phase) { this.config = config; this.log = log; this.number = number; this.phase = phase; } static create(config, log, musicXML) { let phase; switch (musicXML.wavyLine.getType()) { case 'start': phase = 'start'; break; default: phase = 'continue'; break; } const number = musicXML.wavyLine.getNumber(); return new Vibrato(config, log, number, phase); } parse(voiceEntryCtx) { if (this.phase === 'start') { return voiceEntryCtx.beginVibrato(this.number); } else { return voiceEntryCtx.continueVibrato(this.number) ?? voiceEntryCtx.beginVibrato(this.number); } } } exports.Vibrato = Vibrato;