Amazing how far VF has come! But here is a question:
This jsfiddle is a one liner in D-Major. That means an F and C without a natural should is actually a F# or C#. Is there a way to automatically print the natural - and vice versa print accidentals where they should be printed - e.g. if I add a G# ?
VF = Vex.Flow;
var div = document.getElementById("boo")
var renderer = new VF.Renderer(div, VF.Renderer.Backends.SVG);
renderer.resize(500, 500);
var context = renderer.getContext();
var stave = new VF.Stave(10, 40, 300);
stave.addClef("treble").addKeySignature('D')
stave.setContext(context).draw();
var notes = [
new VF.StaveNote({ keys: ["c/4", "f/4", "a/4", "c/5"], duration: "h" }),
new VF.StaveNote({ keys: ["c#/4", "f#/4", "a/4", "d#/5"], duration: "h" }),
];
var voice = new VF.Voice().addTickables(notes);
var formatter = new VF.Formatter().joinVoices([voice]).format([voice], 300);
voice.draw(context, stave);
Thanks
Sascha