UNPKG

@stringsync/vexml

Version:

MusicXML to Vexflow

29 lines (28 loc) 740 B
import * as vexflow from 'vexflow'; import { Rect } from '../spatial'; export class Dynamics { config; log; document; key; constructor(config, log, document, key) { this.config = config; this.log = log; this.document = document; this.key = key; } render() { const dynamics = this.document.getDynamics(this.key); const vexflowTextDynamics = new vexflow.TextDynamics({ text: dynamics.dynamicType, duration: '4', }); return { type: 'dynamics', key: this.key, rect: Rect.empty(), dynamicType: dynamics.dynamicType, vexflowNote: vexflowTextDynamics, }; } }