Skip to content

Instantly share code, notes, and snippets.

@shimpe
Last active April 26, 2020 07:15
Show Gist options
  • Save shimpe/0cfc3131cfab2dd8f0bff0f482e29fc6 to your computer and use it in GitHub Desktop.
Save shimpe/0cfc3131cfab2dd8f0bff0f482e29fc6 to your computer and use it in GitHub Desktop.
testing vexflow in supercollider
(
var webview = WebView().minSize_(300@200);
var browser = View(bounds:900@700).layout_(VLayout(webview));
webview.setHtml(html:"
<div id=\"myscore\"></div>
<script src=\"https://unpkg.com/vexflow/releases/vexflow-min.js\"> </script>
<script>
var vf = new Vex.Flow.Factory({
renderer: {elementId: 'myscore', width: 500, height: 200}
});
var score = vf.EasyScore();
var system = vf.System();
system.addStave({
voices: [
score.voice(score.notes('C#5/q, B4, A4, G#4', {stem: 'up'})),
score.voice(score.notes('C#4/h, C#4', {stem: 'down'}))
]
}).addClef('treble').addTimeSignature('4/4');
vf.draw();
</script>");
browser.front;
)
@shimpe
Copy link
Author

shimpe commented Apr 25, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment