admin管理员组文章数量:1326088
How to display a dotted note with vexflow. For example dans le code suivant : new Vex.Flow.StaveNote({keys: ["c/4"], duration: "qd" }
the "d" is taken into account in the duration of the note but is not displayed in the scope
Version vexFlow : 4.2.2
src="/[email protected]/build/cjs/vexflow.js">
How to display a dotted note with vexflow. For example dans le code suivant : new Vex.Flow.StaveNote({keys: ["c/4"], duration: "qd" }
the "d" is taken into account in the duration of the note but is not displayed in the scope
Version vexFlow : 4.2.2
src="https://cdn.jsdelivr/npm/[email protected]/build/cjs/vexflow.js">
1 Answer
Reset to default 0It's a bit strange, but you have to first set in the constructor to make internal changes in StaveNote:
const note = new Vex.Flow.StaveNote({keys: ["c/4"], duration: "q", dots: 1 }
And after you have to add a modifier to display the dot, like this:
const indexOfKey = 0;
note.addModifier(new Dot(), indexOfKey)
Or like this:
Dot.buildAndAttach([note], {all: true});
{all: true}
in this case means that the dots will be displayed in all the keys if your StaveNote has multiple keys
本文标签: javascriptHow to display a dotted musical noteStack Overflow
版权声明:本文标题:javascript - How to display a dotted musical note? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742194671a2430857.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论