Last active
April 26, 2020 07:15
-
-
Save shimpe/0cfc3131cfab2dd8f0bff0f482e29fc6 to your computer and use it in GitHub Desktop.
testing vexflow in supercollider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
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; | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
also see abcjs based example: https://gist.github.com/shimpe/811da9442a57b81b00a914e62cdda831