liushengqiang 1 year ago
parent
commit
5be9183f76
58 changed files with 3373 additions and 0 deletions
  1. 107 0
      dist/abc2svg/abc2svg-1.js
  2. 366 0
      dist/abc2svg/abcweb-1.js
  3. 1 0
      dist/abc2svg/jquery-1.11.1.min.js
  4. 820 0
      dist/abc2svg/snd-1.js
  5. 1984 0
      dist/abc2svg/xml2abc.js
  6. BIN
      dist/assets/FiraCode-Regular-f13d1ece.woff2
  7. BIN
      dist/assets/LatoLatin-Regular-ddd4ef7f.woff2
  8. BIN
      dist/assets/LatoLatin-Semibold-267eef30.woff2
  9. BIN
      dist/assets/icon_27_0-1f5f1516.png
  10. BIN
      dist/assets/icon_27_1-a2758876.png
  11. BIN
      dist/assets/icon_27_2-7d27294e.png
  12. BIN
      dist/assets/icon_27_3-1445a39a.png
  13. BIN
      dist/assets/icon_27_4-c754c0ce.png
  14. 0 0
      dist/assets/index-5dfedfba.js
  15. 0 0
      dist/assets/index-fe07ce50.css
  16. 0 0
      dist/assets/index-legacy-84e4cf84.js
  17. 0 0
      dist/assets/polyfills-legacy-0e8849b8.js
  18. BIN
      dist/favicon.ico
  19. 55 0
      dist/flexible.js
  20. 29 0
      dist/index.html
  21. 11 0
      dist/loading.svg
  22. BIN
      dist/soundFonts/flute-mp3/A4.mp3
  23. BIN
      dist/soundFonts/flute-mp3/A5.mp3
  24. BIN
      dist/soundFonts/flute-mp3/A6.mp3
  25. BIN
      dist/soundFonts/flute-mp3/Ab4.mp3
  26. BIN
      dist/soundFonts/flute-mp3/Ab5.mp3
  27. BIN
      dist/soundFonts/flute-mp3/Ab6.mp3
  28. BIN
      dist/soundFonts/flute-mp3/B4.mp3
  29. BIN
      dist/soundFonts/flute-mp3/B5.mp3
  30. BIN
      dist/soundFonts/flute-mp3/B6.mp3
  31. BIN
      dist/soundFonts/flute-mp3/Bb4.mp3
  32. BIN
      dist/soundFonts/flute-mp3/Bb5.mp3
  33. BIN
      dist/soundFonts/flute-mp3/Bb6.mp3
  34. BIN
      dist/soundFonts/flute-mp3/C4.mp3
  35. BIN
      dist/soundFonts/flute-mp3/C5.mp3
  36. BIN
      dist/soundFonts/flute-mp3/C6.mp3
  37. BIN
      dist/soundFonts/flute-mp3/C7.mp3
  38. BIN
      dist/soundFonts/flute-mp3/D4.mp3
  39. BIN
      dist/soundFonts/flute-mp3/D5.mp3
  40. BIN
      dist/soundFonts/flute-mp3/D6.mp3
  41. BIN
      dist/soundFonts/flute-mp3/Db4.mp3
  42. BIN
      dist/soundFonts/flute-mp3/Db5.mp3
  43. BIN
      dist/soundFonts/flute-mp3/Db6.mp3
  44. BIN
      dist/soundFonts/flute-mp3/E4.mp3
  45. BIN
      dist/soundFonts/flute-mp3/E5.mp3
  46. BIN
      dist/soundFonts/flute-mp3/E6.mp3
  47. BIN
      dist/soundFonts/flute-mp3/Eb4.mp3
  48. BIN
      dist/soundFonts/flute-mp3/Eb5.mp3
  49. BIN
      dist/soundFonts/flute-mp3/Eb6.mp3
  50. BIN
      dist/soundFonts/flute-mp3/F4.mp3
  51. BIN
      dist/soundFonts/flute-mp3/F5.mp3
  52. BIN
      dist/soundFonts/flute-mp3/F6.mp3
  53. BIN
      dist/soundFonts/flute-mp3/G4.mp3
  54. BIN
      dist/soundFonts/flute-mp3/G5.mp3
  55. BIN
      dist/soundFonts/flute-mp3/G6.mp3
  56. BIN
      dist/soundFonts/flute-mp3/Gb4.mp3
  57. BIN
      dist/soundFonts/flute-mp3/Gb5.mp3
  58. BIN
      dist/soundFonts/flute-mp3/Gb6.mp3

File diff suppressed because it is too large
+ 107 - 0
dist/abc2svg/abc2svg-1.js


+ 366 - 0
dist/abc2svg/abcweb-1.js

@@ -0,0 +1,366 @@
+// abc2svg - ABC to SVG translator
+// @source: https://chiselapp.com/user/moinejf/repository/abc2svg
+// Copyright (C) 2014-2023 Jean-Francois Moine - LGPL3+
+//abcweb-1.js file to include in html pages
+window.onerror = function (msg, url, line) {
+    if (typeof msg == 'string')
+        alert("window error: " + msg + "\nURL: " + url + "\nLine: " + line)
+    else if (typeof msg == 'object')
+        alert("window error: " + msg.type + ' ' + msg.target.src)
+    else
+        alert("window error: " + msg)
+    return false
+}
+var user, abcplay
+if (typeof abc2svg == "undefined")
+    var abc2svg = {}
+abc2svg.mu = ""
+abc2svg.abc_end = function () { }
+abc2svg.jsdir = document.currentScript ? document.currentScript.src.match(/.*\//) : (function () {
+    var s_a = document.getElementsByTagName('script')
+    for (var k = 0; k < s_a.length; k++) {
+        if (s_a[k].src.indexOf("abcweb") >= 0)
+            return s_a[k].src.match(/.*\//) || ''
+    }
+    return ""
+})()
+abc2svg.loadjs = function (fn, relay, onerror) {
+    var s = document.createElement('script')
+    if (/:\/\//.test(fn))
+        s.src = fn
+    else
+        s.src = abc2svg.jsdir + fn
+    s.onload = relay
+    s.onerror = function () {
+        if (onerror)
+            onerror(fn)
+        else
+            alert('error loading ' + fn)
+    }
+    document.head.appendChild(s)
+}
+function dom_loaded() {
+    var abc, src, outb, err, a_inc = {}, tune_lst = [], html, busy, playing, playconf = { onend: function () { playing = 0 } }
+    function visible() {
+        var mu, r, wh = window.innerHeight || document.documentElement.clientHeight
+        while (1) {
+            mu = abc2svg.alldiv[0]
+            if (!mu)
+                break
+            r = mu.d.getBoundingClientRect()
+            if (r.top > wh)
+                break
+            musgen(mu)
+            abc2svg.alldiv.shift()
+        }
+        if (abc2svg.alldiv.length) {
+            if (!abc2svg.onscroll) {
+                abc2svg.onscroll = visible
+                window.addEventListener("scroll", visible)
+            }
+        } else { window.removeEventListener("scroll", visible) }
+    }
+    function get_p(e) {
+        var i, j, k, r, o = '', sh = document.styleSheets, s = e.style
+        c = e.getAttribute("class")
+        if (c) {
+            c = '.' + c
+            for (i = 0; i < sh.length; i++) {
+                r = sh[i].rules
+                for (j = 0; j < r.length; j++) {
+                    if (r[j].selectorText == c)
+                        break
+                }
+                if (j < r.length)
+                    break
+            }
+            if (i < sh.length) {
+                r = r[j]
+                for (i = 0; i < r.style.length; i++) {
+                    k = r.style[i]
+                    if (k[0] == '-' && k[1] == '-')
+                        o += '%%' + k.slice(2) + ' '
+                            + r.style.getPropertyValue(k)
+                            + '\n'
+                }
+            }
+        }
+        for (i = 0; i < s.length; i++) {
+            k = s[i]
+            if (k[0] == '-' && k[1] == '-')
+                o += '%%' + k.slice(2) + ' '
+                    + s.getPropertyValue(k)
+                    + '\n'
+        }
+        return o
+    }
+    function move_music(src) {
+        var re, res, i, j, k, t, re_stop = /\n<|\n%.begin[^\s]+/g, ss = 0, out = ""
+        if (/<[^>]* class="[^"]*abc[^"]*/.test(src))
+            re = '<[^>]* class="[^"]*abc[^"]*'
+        else
+            re = '%abc-\\d|X:\\s*\\d'
+        re = new RegExp('(^|\n)(' + re + ')', 'g')
+        while (1) {
+            res = re.exec(src)
+            if (!res)
+                break
+            i = re.lastIndex - res[0].length
+            if (i > ss) {
+                out += src.slice(ss, i)
+                html = 1
+            }
+            t = res[2]
+            if (t[0] == '<') {
+                i = src.indexOf('>', i) + 1
+                j = res[2].indexOf(' ')
+                t = res[2].slice(1, j)
+                j = src.indexOf('</' + t + '>', i)
+                ss = j + t.length + 4
+            } else {
+                re_stop.lastIndex = i
+                while (1) {
+                    res = re_stop.exec(src)
+                    if (!res || res[0] == "\n<")
+                        break
+                    k = src.indexOf(res[0].replace("begin", "end"), re_stop.lastIndex)
+                    if (k < 0)
+                        break
+                    re_stop.lastIndex = k
+                }
+                if (!res || k < 0)
+                    j = src.length
+                else
+                    j = re_stop.lastIndex - 1
+                ss = j
+            }
+            out += '<script type="text/vnd.abc">\n'
+                + src.slice(i, j)
+                + '</script>\n'
+            re.lastIndex = ss
+        }
+        out += src.slice(ss)
+        if (abc2svg.page && html)
+            out += '\
+<pre class="nop" style="background:#ff8080">\
+Printing may be bad because the file contains pure HTML and %%pageheight\
+</pre>\n'
+        document.body.innerHTML = out
+    }
+    function save_music() {
+        var i, k, div, c, s, sa
+        abc2svg.music = [{ t: "", n: "mus0" }]
+        k = location.search
+        if (k) {
+            k = k.substr(1).split("&")
+            for (i = 0; i < k.length; i++)
+                abc2svg.music[0].t += "%%"
+                    + decodeURIComponent(k[i].replace('=', ' '))
+                    + '\n'
+        }
+        while (1) {
+            sa = document.getElementsByTagName('script')
+            for (i = 0; i < sa.length; i++) {
+                s = sa[i]
+                if (s.type == 'text/vnd.abc')
+                    break
+            }
+            if (i >= sa.length)
+                break
+            c = get_p(s)
+            div = document.createElement('div')
+            if (s.text.indexOf('\nX:') < 0) {
+                abc2svg.music[0].t += c + s.innerHTML
+                if (!abc2svg.music[0].d)
+                    abc2svg.music[0].d = div
+            } else { abc2svg.music.push({ n: "mus" + abc2svg.music.length, t: c + s.innerHTML, d: div }) }
+            s.parentNode.replaceChild(div, s)
+        }
+    }
+    function musgen(mu) {
+        var t = mu.t
+        if (busy) {
+            mu.w = 1
+            return
+        }
+        busy = 1
+        function render() {
+            var i, j, e
+            outb = err = ""
+            abc.tosvg(mu.n, t)
+            abc2svg.abc_end()
+            if (mu.d) {
+                if (err)
+                    outb += '<pre class="nop" style="background:#ff8080">'
+                        + err + "</pre>\n"
+                if (abc.cfmt().with_source && outb)
+                    outb = '<pre class="source">'
+                        + clean_txt(t)
+                        + '</pre>\n\
+<div class="source">\n'
+                        + outb
+                        + '</div>\n'
+                mu.d.innerHTML = outb
+                mu.d.addEventListener('click', abc2svg.playseq)
+                e = mu.d.getElementsByTagName('svg')
+                for (i = 0; i < e.length; i++) {
+                    j = e[i].getAttribute('class')
+                    if (!j)
+                        continue
+                    j = j.match(/tune(\d+)/)
+                    if (!j)
+                        continue
+                    j = j[1]
+                    tune_lst[j] = null
+                }
+            }
+            mu.w = busy = 0
+            for (i = 1; i < abc2svg.music.length; i++) {
+                if (abc2svg.music[i].w) {
+                    musgen(abc2svg.music[i])
+                    break
+                }
+            }
+        }
+        function include() {
+            var i, j, fn, r, k = 0
+            while (1) {
+                i = t.indexOf('%%abc-include ', k)
+                if (i < 0) {
+                    render()
+                    return
+                }
+                i += 14
+                j = t.indexOf('\n', i)
+                fn = t.slice(i, j).trim()
+                if (!a_inc[fn])
+                    break
+                k = j
+            }
+            r = new XMLHttpRequest()
+            r.open('GET', fn, true)
+            r.onload = function () {
+                if (r.status === 200) {
+                    a_inc[fn] = r.responseText
+                    if (abc2svg.modules.load(a_inc[fn], include))
+                        include()
+                } else {
+                    a_inc[fn] = '%\n'
+                    alert('Error getting ' + fn + '\n' + r.statusText)
+                    include()
+                }
+            }
+            r.onerror = function () {
+                a_inc[fn] = '%\n'
+                alert('Error getting ' + fn + '\n' + r.statusText)
+                include()
+            }
+            r.send()
+        }
+        if (abc2svg.modules.load(t, include))
+            include()
+    }
+    abc2svg.musgen = musgen
+    user = { read_file: function (fn) { return a_inc[fn] }, errmsg: function (msg, l, c) { err += clean_txt(msg) + '\n' }, img_out: function (p) { outb += p } }
+    function clean_txt(txt) {
+        return txt.replace(/<|>|&.*?;|&/g, function (c) {
+            switch (c) {
+                case '<': return "&lt;"
+                case '>': return "&gt;"
+                case '&': return "&amp;"
+            }
+            return c
+        })
+    }
+    abc2svg.playseq = function (evt) {
+        if (playing) {
+            abcplay.stop()
+            return
+        }
+        var i, j, svg = evt.target, e = svg
+        while (svg.tagName != 'svg') {
+            svg = svg.parentNode
+            if (!svg)
+                return
+        }
+        i = svg.getAttribute('class')
+        if (!i)
+            return
+        i = i.match(/tune(\d+)/)
+        if (!i)
+            return
+        i = i[1]
+        if (!abcplay) {
+            if (typeof AbcPlay == "undefined") {
+                abc2svg.playseq = function () { }
+                return
+            }
+            if (abc.cfmt().soundfont)
+                playconf.sfu = abc.cfmt().soundfont
+            abcplay = AbcPlay(playconf)
+        }
+        if (!tune_lst[i]) {
+            tune_lst[i] = abc.tunes[i]
+            abcplay.add(tune_lst[i][0], tune_lst[i][1], tune_lst[i][3])
+        }
+        s = tune_lst[i][0]
+        i = e.getAttribute('class')
+        if (i)
+            i = i.match(/abcr _(\d+)_/)
+        if (i) {
+            i = i[1]
+            while (s && s.istart != i)
+                s = s.ts_next
+            if (!s) {
+                alert("play bug: no such symbol in the tune")
+                return
+            }
+        }
+        while (s && !s.fname)
+            s = s.ts_next
+        for (i = 1; i < abc2svg.music.length; i++) {
+            if (abc2svg.music[i].n == s.fname)
+                break
+        }
+        abc2svg.mu = abc2svg.music[i]
+        playing = 1
+        abcplay.play(s, null)
+    }
+    src = document.body.innerHTML
+    if (!abc2svg.Abc) {
+        abc2svg.loadjs("abc2svg-1.js", dom_loaded)
+        return
+    }
+    if (src.indexOf('type="text/vnd.abc"') < 0)
+        move_music(src)
+    save_music()
+    abc = new abc2svg.Abc(user)
+    if (typeof follow == "function")
+        follow(abc, user, playconf)
+    if (abc2svg.music[0].t)
+        musgen(abc2svg.music[0])
+    abc2svg.alldiv = []
+    for (var i = 1; i < abc2svg.music.length; i++)
+        abc2svg.alldiv.push(abc2svg.music[i])
+    visible()
+}
+abc2svg.get_music = function (d) {
+    var i, mu
+    for (var i = 1; i < abc2svg.music.length; i++) {
+        mu = abc2svg.music[i]
+        if (mu.d == d)
+            return mu.t
+    }
+}
+abc2svg.set_music = function (d, t) {
+    var i, mu
+    for (var i = 1; i < abc2svg.music.length; i++) {
+        mu = abc2svg.music[i]
+        if (mu.d == d) {
+            mu.t = t
+            abc2svg.musgen(mu)
+            break
+        }
+    }
+}
+window.addEventListener("load", dom_loaded, { once: true })

File diff suppressed because it is too large
+ 1 - 0
dist/abc2svg/jquery-1.11.1.min.js


+ 820 - 0
dist/abc2svg/snd-1.js

@@ -0,0 +1,820 @@
+// abc2svg - ABC to SVG translator
+// @source: https://chiselapp.com/user/moinejf/repository/abc2svg
+// Copyright (C) 2014-2023 Jean-Francois Moine - LGPL3+
+//snd-1.js-file to include in html pages with abc2svg-1.js for playing
+function AbcPlay(i_conf){var conf=i_conf,init={},audio=ToAudio(),audio5,midi5,current,abcplay={clear:audio.clear,add:audio.add,set_sfu:function(v){if(v==undefined)
+return conf.sfu
+conf.sfu=v},set_speed:function(v){if(v==undefined)
+return conf.speed
+conf.new_speed=v},set_vol:function(v){if(v==undefined)
+return conf.gain;conf.gain=v
+if(current&&current.set_vol)
+current.set_vol(v)},play:play,stop:vf}
+function vf(){}
+function play(istart,i_iend,a_e){init.istart=istart;init.i_iend=i_iend;init.a_e=a_e
+if(midi5)
+midi5.get_outputs(play2)
+else
+play2()}
+function play2(out){var o
+if(!out)
+out=[]
+o=audio5.get_outputs()
+if(o)
+Array.prototype.push.apply(out,o)
+if(out.length==0){if(conf.onend)
+conf.onend()
+return}
+if(out.length==1){o=0}else{o=-1
+var pr="Use"
+for(var i=0;i<out.length;i++)
+pr+="\n "+i+": "+out[i]
+var res=window.prompt(pr,'0')
+if(res){o=Number(res)
+if(isNaN(o)||o<0||o>=out.length)
+o=-1}
+if(!res||o<0){if(conf.onend)
+conf.onend()
+return}}
+current=out[o]=='sf2'?audio5:midi5;abcplay.play=current.play;abcplay.stop=current.stop
+if(current.set_output)
+current.set_output(out[o]);abcplay.play(init.istart,init.i_iend,init.a_e)}
+conf.gain=0.7;conf.speed=1;(function(){var v
+try{if(!localStorage)
+return}catch(e){return}
+if(!conf.sfu){v=localStorage.getItem("sfu")
+if(v)
+conf.sfu=v}
+v=localStorage.getItem("volume")
+if(v)
+conf.gain=Number(v)})()
+if(typeof Midi5=="function")
+midi5=Midi5(conf)
+if(typeof Audio5=="function")
+audio5=Audio5(conf);return abcplay}
+if(typeof module=='object'&&typeof exports=='object')
+exports.AbcPlay=AbcPlay
+if(!abc2svg)
+var abc2svg={}
+function ToAudio(){return{add:function(first,voice_tb,cfmt){var toaud=this,C=abc2svg.C,p_time=0,abc_time=0,play_fac=C.BLEN/4*120/60,i,n,dt,d,v,s=first,rst=s,rst_fac,rsk=[],b_tim,b_typ
+function get_beat(){var s=first.p_v.meter
+if(!s.a_meter[0])
+return C.BLEN/4
+if(!s.a_meter[0].bot)
+return(s.a_meter[1]&&s.a_meter[1].top=='|')?C.BLEN/2:C.BLEN/4
+if(s.a_meter[0].bot=="8"&&s.a_meter[0].top%3==0)
+return C.BLEN/8*3
+return C.BLEN/s.a_meter[0].bot|0}
+function def_beats(){var i,s2,s3,tim,last_d,beat=get_beat(),d=first.p_v.meter.wmeasure,nb=d/beat|0,v=voice_tb.length,p_v={id:"_beats",v:v,sym:{type:C.BLOCK,v:v,subtype:"midiprog",chn:9,instr:16384,ts_prev:first}},s={type:C.NOTE,v:v,p_v:p_v,dur:beat,nhd:0,notes:[{midi:37}]}
+for(s2=first;s2;s2=s2.ts_next){if(s2.bar_type&&s2.time){nb=(2*d-s2.time)/beat|0
+last_d=beat-s2.time
+break}}
+s2=p_v.sym
+for(s3=first;s3&&!s3.time;s3=s3.ts_next){if(s3.type==C.TEMPO){s3=Object.create(s3)
+s3.v=v
+s3.p_v=p_v
+s3.prev=s3.ts_prev=s2
+s2.next=s2.ts_next=s3
+s2=s3
+play_fac=set_tempo(s2)
+break}}
+voice_tb[v]=p_v
+p_v.sym.p_v=p_v
+tim=abc_time=-d
+first.time=s2.time=tim
+if(s3)
+p_v.sym.time=tim
+for(i=0;i<nb;i++){s3=Object.create(s)
+s3.time=tim
+s3.prev=s2
+s2.next=s3
+s3.ts_prev=s2
+s2.ts_next=s3
+s2=s3
+if(last_d&&i==nb-1){s3.dur=s3.dur_orig=s3.notes[0].dur=last_d}
+tim+=beat}
+s2.ts_next=first.ts_next
+s2.ts_next.ts_prev=s2
+first.ts_next=p_v.sym}
+function build_parts(first){var i,j,c,n,v,s=first,p=s.parts,st=[],r=""
+for(i=0;i<p.length;i++){c=p[i]
+switch(c){case'.':continue
+case'(':st.push(r.length)
+continue
+case')':j=st.pop()
+if(j==undefined)
+j=r.length
+continue}
+if(c>='A'&&c<='Z'){j=r.length
+r+=c
+continue}
+n=Number(c)
+if(isNaN(n))
+break
+v=r.slice(j)
+if(r.length+v.length*n>128)
+continue
+while(--n>0)
+r+=v}
+s.parts=r
+s.p_s=[]
+while(1){if(!s.ts_next){s.part1=first
+break}
+s=s.ts_next
+if(s.part){s.part1=first
+v=s.part.text[0]
+for(i=0;i<first.parts.length;i++){if(first.parts[i]==v)
+first.p_s[i]=s}}}}
+function gen_grace(s){var g,i,n,t,d,s2,next=s.next
+if(s.sappo){d=C.BLEN/16}else if((!next||next.type!=C.NOTE)&&s.prev&&s.prev.type==C.NOTE){d=s.prev.dur/2}else{d=next.dur/12
+if(!(d&(d-1)))
+d=next.dur/2
+else
+d=next.dur/3
+if(s.p_v.key.k_bagpipe)
+d/=2
+next.time+=d
+next.dur-=d}
+n=0
+for(g=s.extra;g;g=g.next)
+n++
+d/=n*play_fac
+t=p_time
+for(g=s.extra;g;g=g.next){g.ptim=t
+g.pdur=d
+t+=d}}
+function set_tempo(s){var i,d=0,n=s.tempo_notes.length
+for(i=0;i<n;i++)
+d+=s.tempo_notes[i]
+return d*s.tempo/60}
+function set_variant(s){var d,n=s.text.match(/[1-8]-[2-9]|[1-9,.]|[^\s]+$/g)
+while(1){d=n.shift()
+if(!d)
+break
+if(d[1]=='-')
+for(i=d[0];i<=d[2];i++)
+rsk[i]=s
+else if(d>='1'&&d<='9')
+rsk[Number(d)]=s
+else if(d!=',')
+rsk.push(s)}}
+if(cfmt.chord)
+abc2svg.chord(first,voice_tb,cfmt)
+if(cfmt.playbeats)
+def_beats()
+if(s.parts)
+build_parts(s)
+rst_fac=play_fac
+while(s){if(s.noplay){s=s.ts_next
+continue}
+dt=s.time-abc_time
+if(dt!=0){p_time+=dt/play_fac
+abc_time=s.time}
+s.ptim=p_time
+if(s.part){rst=s
+rst_fac=play_fac}
+switch(s.type){case C.BAR:if(s.time!=b_tim){b_tim=s.time
+b_typ=0}
+if(s.text&&rsk.length>1&&s.text[0]!='1'){if(b_typ&1)
+break
+b_typ|=1
+set_variant(s)
+play_fac=rst_fac
+rst=rsk[0]}
+if(s.bar_type[0]==':'){if(b_typ&2)
+break
+b_typ|=2
+s.rep_p=rst
+if(rst==rsk[0])
+s.rep_v=rsk}
+if(s.text){if(s.text[0]=='1'){if(b_typ&1)
+break
+b_typ|=1
+s.rep_s=rsk=[rst]
+if(rst.bar_type&&rst.bar_type.slice(-1)!=':')
+rst.bar_type+=':'
+set_variant(s)
+rst_fac=play_fac}}else if(s.bar_type.slice(-1)==':'){if(b_typ&4)
+break
+b_typ|=4
+rst=s
+rst_fac=play_fac}else if(s.rbstop==2){if(b_typ&8)
+break
+b_typ|=8
+rst=s
+rst_fac=play_fac}
+break
+case C.GRACE:if(s.time==0&&abc_time==0){dt=0
+if(s.sappo)
+dt=C.BLEN/16
+else if(!s.next||s.next.type!=C.NOTE)
+dt=d/2
+abc_time-=dt}
+gen_grace(s)
+break
+case C.REST:case C.NOTE:d=s.dur
+if(s.next&&s.next.type==C.GRACE){dt=0
+if(s.next.sappo)
+dt=C.BLEN/16
+else if(!s.next.next||s.next.next.type!=C.NOTE)
+dt=d/2
+s.next.time-=dt
+d-=dt}
+d/=play_fac
+s.pdur=d
+v=s.v
+break
+case C.TEMPO:if(s.tempo)
+play_fac=set_tempo(s)
+break}
+s=s.ts_next}}}}
+abc2svg.play_next=function(po){function do_tie(not_s,d){var i,s=not_s.s,C=abc2svg.C,v=s.v,end_time=s.time+s.dur,repv=po.repv
+while(1){s=s.ts_next
+if(!s||s.time>end_time)
+break
+if(s.type==C.BAR){if(s.rep_p){if(!po.repn){s=s.rep_p
+end_time=s.time}}
+if(s.rep_s){if(!s.rep_s[repv])
+break
+s=s.rep_s[repv++]
+end_time=s.time}
+while(s.ts_next&&!s.ts_next.dur)
+s=s.ts_next
+continue}
+if(s.time<end_time||!s.ti2)
+continue
+i=s.notes.length
+while(--i>=0){note=s.notes[i]
+if(note.tie_s==not_s){d+=s.pdur/po.conf.speed
+return note.tie_e?do_tie(note,d):d}}}
+return d}
+function set_ctrl(po,s2,t){var i,p_v=s2.p_v,s={subtype:"midictl",p_v:p_v,v:s2.v}
+for(i in p_v.midictl){s.ctrl=Number(i)
+s.val=p_v.midictl[i]
+po.midi_ctrl(po,s,t)}
+for(s=p_v.sym;s!=s2;s=s.next){if(s.subtype=="midictl")
+po.midi_ctrl(po,s,t)
+else if(s.subtype=='midiprog')
+po.midi_prog(po,s)}
+i=po.v_c[s2.v]
+if(i==undefined)
+po.v_c[s2.v]=i=s2.v<9?s2.v:s2.v+1
+if(po.c_i[i]==undefined)
+po.c_i[i]=0
+po.p_v[s2.v]=true}
+function play_cont(po){var d,i,st,m,note,g,s2,t,maxt,now,C=abc2svg.C,s=po.s_cur
+function var_end(s){var i,s2,s3,a=s.rep_v||s.rep_s
+ti=0
+for(i=1;i<a.length;i++){s2=a[i]
+if(s2.time>ti){ti=s2.time
+s3=s2}}
+for(s=s3;s!=po.s_end;s=s.ts_next){if(s.time==ti)
+continue
+if(s.rbstop==2)
+break}
+po.repv=1
+return s}
+if(po.stop){if(po.onend)
+po.onend(po.repv)
+return}
+while(s.noplay){s=s.ts_next
+if(!s||s==po.s_end){if(po.onend)
+po.onend(po.repv)
+return}}
+t=po.stim+s.ptim/po.conf.speed
+now=po.get_time(po)
+if(po.conf.new_speed){po.stim=now-(now-po.stim)*po.conf.speed/po.conf.new_speed
+po.conf.speed=po.conf.new_speed
+po.conf.new_speed=0
+t=po.stim+s.ptim/po.conf.speed}
+maxt=t+po.tgen
+po.timouts=[]
+while(1){if(!po.p_v[s.v])
+set_ctrl(po,s,t)
+switch(s.type){case C.BAR:s2=null
+if(s.rep_p){po.repv++
+if(!po.repn&&(!s.rep_v||po.repv<=s.rep_v.length)){s2=s.rep_p
+po.repn=true}else{if(s.rep_v)
+s2=var_end(s)
+po.repn=false}}
+if(s.rep_s){s2=s.rep_s[po.repv]
+if(s2){po.repn=false
+if(s2==s)
+s2=null}else{s2=var_end(s)
+if(s2==po.s_end)
+break}}
+if(s.bar_type.slice(-1)==':'&&s.bar_type[0]!=':')
+po.repv=1
+if(s2){po.stim+=(s.ptim-s2.ptim)/po.conf.speed
+s=s2
+while(s&&!s.dur)
+s=s.ts_next
+if(!s)
+break
+t=po.stim+s.ptim/po.conf.speed
+break}
+if(!s.part1){while(s.ts_next&&!s.ts_next.seqst){s=s.ts_next
+if(s.part1)
+break}
+if(!s.part1)
+break}
+default:if(s.part1&&po.i_p!=undefined){s2=s.part1.p_s[++po.i_p]
+if(s2){po.stim+=(s.ptim-s2.ptim)/po.conf.speed
+s=s2
+t=po.stim+s.ptim/po.conf.speed}else{s=po.s_end}
+po.repv=1}
+break}
+if(s&&s!=po.s_end){switch(s.type){case C.BAR:break
+case C.BLOCK:if(s.subtype=="midictl")
+po.midi_ctrl(po,s,t)
+else if(s.subtype=='midiprog')
+po.midi_prog(po,s)
+break
+case C.GRACE:for(g=s.extra;g;g=g.next){d=g.pdur/po.conf.speed
+for(m=0;m<=g.nhd;m++){note=g.notes[m]
+if(!note.noplay)
+po.note_run(po,g,note.midi,t+g.ptim-s.ptim,d)}}
+break
+case C.NOTE:case C.REST:d=s.pdur/po.conf.speed
+if(s.type==C.NOTE){for(m=0;m<=s.nhd;m++){note=s.notes[m]
+if(note.tie_s||note.noplay)
+continue
+po.note_run(po,s,note.midi,t,note.tie_e?do_tie(note,d):d)}}
+if(po.onnote&&s.istart){i=s.istart
+st=(t-now)*1000
+po.timouts.push(setTimeout(po.onnote,st,i,true))
+if(d>2)
+d-=.1
+setTimeout(po.onnote,st+d*1000,i,false)}
+break}}
+while(1){if(!s||s==po.s_end||!s.ts_next){if(po.onend)
+setTimeout(po.onend,(t-now+d)*1000,po.repv)
+po.s_cur=s
+return}
+s=s.ts_next
+if(!s.noplay)
+break}
+t=po.stim+s.ptim/po.conf.speed
+if(t>maxt)
+break}
+po.s_cur=s
+po.timouts.push(setTimeout(play_cont,(t-now)*1000
+-300,po))}
+function get_part(po){var s,i,s_p
+for(s=po.s_cur;s;s=s.ts_prev){if(s.parts){po.i_p=-1
+return}
+s_p=s.part1
+if(!s_p||!s_p.p_s)
+continue
+for(i=0;i<s_p.p_s.length;i++){if(s_p.p_s[i]==s){po.i_p=i
+return}}}}
+get_part(po)
+po.stim=po.get_time(po)+.3
+-po.s_cur.ptim*po.conf.speed
+po.p_v=[]
+if(!po.repv)
+po.repv=1
+play_cont(po)}
+if(typeof module=='object'&&typeof exports=='object')
+exports.ToAudio=ToAudio
+var abcsf2=[]
+function Audio5(i_conf){var po,conf=i_conf,empty=function(){},errmsg,ac,gain,model,parser,presets,instr=[],params=[],rates=[],w_instr=0
+var b64d=[]
+function init_b64d(){var b64l='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',l=b64l.length
+for(var i=0;i<l;i++)
+b64d[b64l[i]]=i
+b64d['=']=0}
+function b64dcod(s){var i,t,dl,a,l=s.length,j=0
+dl=l*3/4
+if(s[l-1]=='='){if(s[l-2]=='=')
+dl--
+dl--
+l-=4}
+a=new Uint8Array(dl)
+for(i=0;i<l;i+=4){t=(b64d[s[i]]<<18)+
+(b64d[s[i+1]]<<12)+
+(b64d[s[i+2]]<<6)+
+b64d[s[i+3]]
+a[j++]=(t>>16)&0xff
+a[j++]=(t>>8)&0xff
+a[j++]=t&0xff}
+if(l!=s.length){t=(b64d[s[i]]<<18)+
+(b64d[s[i+1]]<<12)+
+(b64d[s[i+2]]<<6)+
+b64d[s[i+3]]
+a[j++]=(t>>16)&0xff
+if(j<dl)
+a[j++]=(t>>8)&0xff}
+return a}
+function sample_cp(b,s){var i,n,a=b.getChannelData(0)
+for(i=0;i<s.length;i++)
+a[i]=s[i]/196608}
+function sf2_create(instr,sf2par,sf2pre){function get_instr(i){var instrument=sf2par.instrument,zone=sf2par.instrumentZone,j=instrument[i].instrumentBagIndex,jl=instrument[i+1]?instrument[i+1].instrumentBagIndex:zone.length,info=[]
+while(j<jl){instrumentGenerator=sf2par.createInstrumentGenerator_(zone,j)
+info.push({generator:instrumentGenerator.generator,})
+j++}
+return{info:info}}
+var i,j,k,sid,gen,parm,gparm,sample,infos,sampleRate,scale,b=instr>>7,p=instr%128,pr=sf2pre
+rates[instr]=[]
+for(i=0;i<pr.length;i++){gen=pr[i].header
+if(gen.preset==p&&gen.bank==b)
+break}
+pr=pr[i]
+if(!pr){errmsg('unknown instrument '+b+':'+p)
+return}
+pr=pr.info
+for(k=0;k<pr.length;k++){if(!pr[k].generator.instrument)
+continue
+gparm=null
+infos=get_instr(pr[k].generator.instrument.amount).info
+for(i=0;i<infos.length;i++){gen=infos[i].generator
+if(!gparm){parm=gparm={attack:.001,hold:.001,decay:.001,sustain:0}}else{parm=Object.create(gparm)
+if(!gen.sampleID)
+gparm=parm}
+if(gen.attackVolEnv)
+parm.attack=Math.pow(2,gen.attackVolEnv.amount/1200)
+if(gen.holdVolEnv)
+parm.hold=Math.pow(2,gen.holdVolEnv.amount/1200)
+if(gen.decayVolEnv)
+parm.decay=Math.pow(2,gen.decayVolEnv.amount/1200)/3
+if(gen.sustainVolEnv)
+parm.sustain=gen.sustainVolEnv.amount/1000
+if(gen.sampleModes&&gen.sampleModes.amount&1)
+parm.sm=1
+if(!gen.sampleID)
+continue
+sid=gen.sampleID.amount
+sampleRate=sf2par.sampleHeader[sid].sampleRate
+sample=sf2par.sample[sid]
+parm.buffer=ac.createBuffer(1,sample.length,sampleRate)
+parm.hold+=parm.attack
+parm.decay+=parm.hold
+if(parm.sustain>=.4)
+parm.sustain=0.01
+else
+parm.sustain=1-parm.sustain/.4
+sample_cp(parm.buffer,sample)
+if(parm.sm){parm.loopStart=sf2par.sampleHeader[sid].startLoop/sampleRate
+parm.loopEnd=sf2par.sampleHeader[sid].endLoop/sampleRate}
+scale=(gen.scaleTuning?gen.scaleTuning.amount:100)/100,tune=(gen.coarseTune?gen.coarseTune.amount:0)+
+(gen.fineTune?gen.fineTune.amount:0)/100+
+sf2par.sampleHeader[sid].pitchCorrection/100-
+(gen.overridingRootKey?gen.overridingRootKey.amount:sf2par.sampleHeader[sid].originalPitch)
+for(j=gen.keyRange.lo;j<=gen.keyRange.hi;j++){rates[instr][j]=Math.pow(Math.pow(2,1/12),(j+tune)*scale)
+params[instr][j]=parm}}}}
+function load_instr(instr){w_instr++
+abc2svg.loadjs(conf.sfu+'/'+instr+'.js',function(){var sf2par=new sf2.Parser(b64dcod(abcsf2[instr]))
+sf2par.parse()
+var sf2pre=sf2par.getPresets()
+sf2_create(instr,sf2par,sf2pre)
+if(--w_instr==0)
+play_start()},function(){errmsg('could not find the instrument '+
+((instr/128)|0).toString()+'-'+
+(instr%128).toString())
+if(--w_instr==0)
+play_start()})}
+function def_instr(s,f,sf2par,sf2pre){var i,bk=[],nv=-1,vb=0
+s=s.p_v.sym
+while(s.ts_prev)
+s=s.ts_prev
+for(;s;s=s.ts_next){if(s.v>nv){nv=s.v
+bk[nv]=0
+if(s.p_v.midictl){if(s.p_v.midictl[0])
+bk[s.v]=(bk[s.v]&~0x1fc000)
++(s.p_v.midictl[0]<<14)
+if(s.p_v.midictl[32])
+bk[s.v]=(bk[s.v]&~0x3f80)
++(s.p_v.midictl[32]<<7)}}
+switch(s.subtype){case"midiprog":break
+case"midictl":if(s.ctrl!=0&&s.ctrl!=32)
+continue
+if(bk[s.v]==undefined)
+bk[s.v]=0
+if(s.ctrl==0)
+bk[s.v]=(bk[s.v]&~0x1fc000)
++(s.val<<14)
+else
+bk[s.v]=(bk[s.v]&~0x3f80)
++(s.val<<7)
+default:continue}
+vb|=1<<s.v
+i=s.instr
+if(i==undefined){if(s.chn!=9)
+continue
+i=bk[s.v]?0:128*128}
+if(bk[s.v])
+i+=bk[s.v]
+if(!params[i]){params[i]=[]
+f(i,sf2par,sf2pre)}}
+nv=(2<<nv)-1
+if(nv!=vb&&!params[0]){params[0]=[]
+f(0,sf2par,sf2pre)}}
+function load_res(s){if(abc2svg.sf2||conf.sfu.slice(-4)==".sf2"||conf.sfu.slice(-3)==".js"){if(abc2svg.sf2){if(!parser){parser=new sf2.Parser(b64dcod(abc2svg.sf2))
+parser.parse()
+presets=parser.getPresets()}}else if(!parser){w_instr++
+if(conf.sfu.slice(-3)==".js"){abc2svg.loadjs(conf.sfu,function(){load_res(s)
+if(--w_instr==0)
+play_start()},function(){errmsg('could not load the sound file '
++conf.sfu)
+if(--w_instr==0)
+play_start()})
+return}
+var r=new XMLHttpRequest()
+r.open('GET',conf.sfu,true)
+r.responseType="arraybuffer"
+r.onload=function(){if(r.status===200){parser=new sf2.Parser(new Uint8Array(r.response))
+parser.parse()
+presets=parser.getPresets()
+load_res(s)
+if(--w_instr==0)
+play_start()}else{errmsg('could not load the sound file '
++conf.sfu)
+if(--w_instr==0)
+play_start()}}
+r.onerror=function(){errmsg('could not load the sound file '
++conf.sfu)
+if(--w_instr==0)
+play_start()}
+r.send()
+return}
+def_instr(s,sf2_create,parser,presets)}else{def_instr(s,load_instr)}}
+function get_time(po){return po.ac.currentTime}
+function midi_ctrl(po,s,t){switch(s.ctrl){case 0:if(po.v_b[s.v]==undefined)
+po.v_b[s.v]=0
+po.v_b[s.v]=(po.v_b[s.v]&~0x1fc000)
++(s.val<<14)
+break
+case 7:s.p_v.vol=s.val/127
+break
+case 32:if(po.v_b[s.v]==undefined)
+po.v_b[s.v]=0
+po.v_b[s.v]=(po.v_b[s.v]&~0x3f80)
++(s.val<<7)
+break}}
+function midi_prog(po,s){var i=s.instr
+po.v_c[s.v]=s.chn
+if(i==undefined){if(s.chn!=9)
+return
+i=po.v_b[s.v]?0:128*128}
+if(po.v_b[s.v])
+i+=po.v_b[s.v]
+po.c_i[s.chn]=i}
+function note_run(po,s,key,t,d){var g,st,c=po.v_c[s.v],instr=po.c_i[c],k=key|0,parm=params[instr][k],o=po.ac.createBufferSource(),v=s.p_v.vol==undefined?1:s.p_v.vol
+if(!v||!parm)
+return
+o.buffer=parm.buffer
+if(parm.loopStart){o.loop=true
+o.loopStart=parm.loopStart
+o.loopEnd=parm.loopEnd}
+if(o.detune){var dt=(key*100)%100
+if(dt)
+o.detune.value=dt}
+o.playbackRate.value=po.rates[instr][k]
+g=po.ac.createGain()
+if(parm.hold<0.002){g.gain.setValueAtTime(v,t)}else{if(parm.attack<0.002){g.gain.setValueAtTime(v,t)}else{g.gain.setValueAtTime(0,t)
+g.gain.linearRampToValueAtTime(v,t+parm.attack)}
+g.gain.setValueAtTime(v,t+parm.hold)}
+g.gain.exponentialRampToValueAtTime(parm.sustain*v,t+parm.decay)
+o.connect(g)
+g.connect(po.gain)
+o.start(t)
+o.stop(t+d)}
+function play_start(){if(po.stop){po.onend(repv)
+return}
+gain.connect(ac.destination)
+abc2svg.play_next(po)}
+init_b64d()
+if(!conf.sfu)
+conf.sfu="Scc1t2"
+if(navigator.userAgentData&&navigator.userAgentData.getHighEntropyValues)
+navigator.userAgentData.getHighEntropyValues(['model']).then(function(ua){model=ua.model})
+else
+model=navigator.userAgent
+return{get_outputs:function(){return(window.AudioContext||window.webkitAudioContext)?['sf2']:null},play:function(i_start,i_end,i_lvl){errmsg=conf.errmsg||alert
+function play_unlock(){var buf=ac.createBuffer(1,1,22050),src=ac.createBufferSource()
+src.buffer=buf
+src.connect(ac.destination)
+src.start(0)}
+if(!gain){ac=conf.ac
+if(!ac){conf.ac=ac=new(window.AudioContext||window.webkitAudioContext)
+if(/iPad|iPhone|iPod/.test(model))
+play_unlock()}
+gain=ac.createGain()
+gain.gain.value=conf.gain}
+while(i_start.noplay)
+i_start=i_start.ts_next
+po={conf:conf,onend:conf.onend||empty,onnote:conf.onnote||empty,s_end:i_end,s_cur:i_start,repv:i_lvl||0,tgen:2,get_time:get_time,midi_ctrl:midi_ctrl,midi_prog:midi_prog,note_run:note_run,timouts:[],v_c:[],c_i:[],v_b:[],ac:ac,gain:gain,rates:rates}
+w_instr++
+load_res(i_start)
+if(--w_instr==0)
+play_start()},stop:function(){po.stop=true
+po.timouts.forEach(function(id){clearTimeout(id)})
+abc2svg.play_next(po)
+if(gain){gain.disconnect()
+gain=null}},set_vol:function(v){if(gain)
+gain.gain.value=v}}}
+(function(root,factory){if(typeof exports==="object"){root.sf2=exports;factory(exports)}else if(typeof define==="function"&&define.amd){define(["exports"],function(exports){root.sf2=exports;return(root.sf2,factory(exports))})}else{root.sf2={};factory(root.sf2)}}(this,function(sf2){"use strict";sf2.Parser=function(input,options){options=options||{};this.input=input;this.parserOptions=options.parserOptions};sf2.Parser.prototype.parse=function(){var parser=new sf2.Riff.Parser(this.input,this.parserOptions),chunk;parser.parse();if(parser.chunkList.length!==1)
+throw new Error('wrong chunk length');chunk=parser.getChunk(0);if(chunk===null)
+throw new Error('chunk not found');this.parseRiffChunk(chunk);this.input=null};sf2.Parser.prototype.parseRiffChunk=function(chunk){var parser,data=this.input,ip=chunk.offset,signature;if(chunk.type!=='RIFF')
+throw new Error('invalid chunk type:'+chunk.type);signature=String.fromCharCode(data[ip++],data[ip++],data[ip++],data[ip++]);if(signature!=='sfbk')
+throw new Error('invalid signature:'+signature);parser=new sf2.Riff.Parser(data,{'index':ip,'length':chunk.size-4});parser.parse();if(parser.getNumberOfChunks()!==3)
+throw new Error('invalid sfbk structure');this.parseInfoList(parser.getChunk(0));this.parseSdtaList(parser.getChunk(1));this.parsePdtaList(parser.getChunk(2))};sf2.Parser.prototype.parseInfoList=function(chunk){var parser,data=this.input,ip=chunk.offset,signature;if(chunk.type!=='LIST')
+throw new Error('invalid chunk type:'+chunk.type);signature=String.fromCharCode(data[ip++],data[ip++],data[ip++],data[ip++]);if(signature!=='INFO')
+throw new Error('invalid signature:'+signature);parser=new sf2.Riff.Parser(data,{'index':ip,'length':chunk.size-4});parser.parse()};sf2.Parser.prototype.parseSdtaList=function(chunk){var parser,data=this.input,ip=chunk.offset,signature;if(chunk.type!=='LIST')
+throw new Error('invalid chunk type:'+chunk.type);signature=String.fromCharCode(data[ip++],data[ip++],data[ip++],data[ip++]);if(signature!=='sdta')
+throw new Error('invalid signature:'+signature);parser=new sf2.Riff.Parser(data,{'index':ip,'length':chunk.size-4});parser.parse();if(parser.chunkList.length!==1)
+throw new Error('TODO');this.samplingData=parser.getChunk(0)};sf2.Parser.prototype.parsePdtaList=function(chunk){var parser,data=this.input,ip=chunk.offset,signature;if(chunk.type!=='LIST')
+throw new Error('invalid chunk type:'+chunk.type);signature=String.fromCharCode(data[ip++],data[ip++],data[ip++],data[ip++]);if(signature!=='pdta')
+throw new Error('invalid signature:'+signature);parser=new sf2.Riff.Parser(data,{'index':ip,'length':chunk.size-4});parser.parse();if(parser.getNumberOfChunks()!==9)
+throw new Error('invalid pdta chunk');this.parsePhdr((parser.getChunk(0)));this.parsePbag((parser.getChunk(1)));this.parsePmod((parser.getChunk(2)));this.parsePgen((parser.getChunk(3)));this.parseInst((parser.getChunk(4)));this.parseIbag((parser.getChunk(5)));this.parseImod((parser.getChunk(6)));this.parseIgen((parser.getChunk(7)));this.parseShdr((parser.getChunk(8)))};sf2.Parser.prototype.parsePhdr=function(chunk){var data=this.input,ip=chunk.offset,presetHeader=this.presetHeader=[],size=chunk.offset+chunk.size;if(chunk.type!=='phdr')
+throw new Error('invalid chunk type:'+chunk.type);while(ip<size){presetHeader.push({presetName:String.fromCharCode.apply(null,data.subarray(ip,ip+=20)),preset:data[ip++]|(data[ip++]<<8),bank:data[ip++]|(data[ip++]<<8),presetBagIndex:data[ip++]|(data[ip++]<<8),library:(data[ip++]|(data[ip++]<<8)|(data[ip++]<<16)|(data[ip++]<<24))>>>0,genre:(data[ip++]|(data[ip++]<<8)|(data[ip++]<<16)|(data[ip++]<<24))>>>0,morphology:(data[ip++]|(data[ip++]<<8)|(data[ip++]<<16)|(data[ip++]<<24))>>>0})}};sf2.Parser.prototype.parsePbag=function(chunk){var data=this.input,ip=chunk.offset,presetZone=this.presetZone=[],size=chunk.offset+chunk.size;if(chunk.type!=='pbag')
+throw new Error('invalid chunk type:'+chunk.type);while(ip<size){presetZone.push({presetGeneratorIndex:data[ip++]|(data[ip++]<<8),presetModulatorIndex:data[ip++]|(data[ip++]<<8)})}};sf2.Parser.prototype.parsePmod=function(chunk){if(chunk.type!=='pmod')
+throw new Error('invalid chunk type:'+chunk.type);this.presetZoneModulator=this.parseModulator(chunk)};sf2.Parser.prototype.parsePgen=function(chunk){if(chunk.type!=='pgen')
+throw new Error('invalid chunk type:'+chunk.type);this.presetZoneGenerator=this.parseGenerator(chunk)};sf2.Parser.prototype.parseInst=function(chunk){var data=this.input,ip=chunk.offset,instrument=this.instrument=[],size=chunk.offset+chunk.size;if(chunk.type!=='inst')
+throw new Error('invalid chunk type:'+chunk.type);while(ip<size){instrument.push({instrumentName:String.fromCharCode.apply(null,data.subarray(ip,ip+=20)),instrumentBagIndex:data[ip++]|(data[ip++]<<8)})}};sf2.Parser.prototype.parseIbag=function(chunk){var data=this.input,ip=chunk.offset,instrumentZone=this.instrumentZone=[],size=chunk.offset+chunk.size;if(chunk.type!=='ibag')
+throw new Error('invalid chunk type:'+chunk.type);while(ip<size){instrumentZone.push({instrumentGeneratorIndex:data[ip++]|(data[ip++]<<8),instrumentModulatorIndex:data[ip++]|(data[ip++]<<8)})}};sf2.Parser.prototype.parseImod=function(chunk){if(chunk.type!=='imod')
+throw new Error('invalid chunk type:'+chunk.type);this.instrumentZoneModulator=this.parseModulator(chunk)};sf2.Parser.prototype.parseIgen=function(chunk){if(chunk.type!=='igen')
+throw new Error('invalid chunk type:'+chunk.type);this.instrumentZoneGenerator=this.parseGenerator(chunk)};sf2.Parser.prototype.parseShdr=function(chunk){var data=this.input,ip=chunk.offset,samples=this.sample=[],sampleHeader=this.sampleHeader=[],size=chunk.offset+chunk.size,sampleName,start,end,startLoop,endLoop,sampleRate,originalPitch,pitchCorrection,sampleLink,sampleType;if(chunk.type!=='shdr')
+throw new Error('invalid chunk type:'+chunk.type);while(ip<size){sampleName=String.fromCharCode.apply(null,data.subarray(ip,ip+=20));start=(data[ip++]<<0)|(data[ip++]<<8)|(data[ip++]<<16)|(data[ip++]<<24);end=(data[ip++]<<0)|(data[ip++]<<8)|(data[ip++]<<16)|(data[ip++]<<24);startLoop=(data[ip++]<<0)|(data[ip++]<<8)|(data[ip++]<<16)|(data[ip++]<<24);endLoop=(data[ip++]<<0)|(data[ip++]<<8)|(data[ip++]<<16)|(data[ip++]<<24);sampleRate=(data[ip++]<<0)|(data[ip++]<<8)|(data[ip++]<<16)|(data[ip++]<<24);originalPitch=data[ip++];pitchCorrection=(data[ip++]<<24)>>24;sampleLink=data[ip++]|(data[ip++]<<8);sampleType=data[ip++]|(data[ip++]<<8);var sample=new Int16Array(new Uint8Array(data.subarray(this.samplingData.offset+start*2,this.samplingData.offset+end*2)).buffer);startLoop-=start;endLoop-=start;if(sampleRate>0){var adjust=this.adjustSampleData(sample,sampleRate);sample=adjust.sample;sampleRate*=adjust.multiply;startLoop*=adjust.multiply;endLoop*=adjust.multiply}
+samples.push(sample);sampleHeader.push({sampleName:sampleName,startLoop:startLoop,endLoop:endLoop,sampleRate:sampleRate,originalPitch:originalPitch,pitchCorrection:pitchCorrection,sampleLink:sampleLink,sampleType:sampleType})}};sf2.Parser.prototype.adjustSampleData=function(sample,sampleRate){var newSample,i,il,j,multiply=1;while(sampleRate<22050){newSample=new Int16Array(sample.length*2);for(i=j=0,il=sample.length;i<il;++i){newSample[j++]=sample[i];newSample[j++]=sample[i]}
+sample=newSample;multiply*=2;sampleRate*=2}
+return{sample:sample,multiply:multiply}};sf2.Parser.prototype.parseModulator=function(chunk){var data=this.input,ip=chunk.offset,size=chunk.offset+chunk.size,code,key,output=[];while(ip<size){ip+=2;code=data[ip++]|(data[ip++]<<8);key=sf2.Parser.GeneratorEnumeratorTable[code];if(key===undefined){output.push({type:key,value:{code:code,amount:data[ip]|(data[ip+1]<<8)<<16>>16,lo:data[ip++],hi:data[ip++]}})}else{switch(key){case'keyRange':case'velRange':case'keynum':case'velocity':output.push({type:key,value:{lo:data[ip++],hi:data[ip++]}});break;default:output.push({type:key,value:{amount:data[ip++]|(data[ip++]<<8)<<16>>16}});break}}
+ip+=2;ip+=2}
+return output};sf2.Parser.prototype.parseGenerator=function(chunk){var data=this.input,ip=chunk.offset,size=chunk.offset+chunk.size,code,key,output=[];while(ip<size){code=data[ip++]|(data[ip++]<<8);key=sf2.Parser.GeneratorEnumeratorTable[code];if(key===undefined){output.push({type:key,value:{code:code,amount:data[ip]|(data[ip+1]<<8)<<16>>16,lo:data[ip++],hi:data[ip++]}});continue}
+switch(key){case'keynum':case'keyRange':case'velRange':case'velocity':output.push({type:key,value:{lo:data[ip++],hi:data[ip++]}});break;default:output.push({type:key,value:{amount:data[ip++]|(data[ip++]<<8)<<16>>16}});break}}
+return output};sf2.Parser.prototype.getPresets=function(){var preset=this.presetHeader,zone=this.presetZone,output=[],bagIndex,bagIndexEnd,zoneInfo,presetGenerator,presetModulator,i,il,j,jl
+for(i=0,il=preset.length;i<il;++i){j=preset[i].presetBagIndex
+jl=preset[i+1]?preset[i+1].presetBagIndex:zone.length
+zoneInfo=[];for(;j<jl;++j){presetGenerator=this.createPresetGenerator_(zone,j);presetModulator=this.createPresetModulator_(zone,j);zoneInfo.push({generator:presetGenerator.generator,modulator:presetModulator.modulator,})}
+output.push({info:zoneInfo,header:preset[i],})}
+return output};sf2.Parser.prototype.createInstrumentGenerator_=function(zone,index){var modgen=this.createBagModGen_(zone,zone[index].instrumentGeneratorIndex,zone[index+1]?zone[index+1].instrumentGeneratorIndex:this.instrumentZoneGenerator.length,this.instrumentZoneGenerator);return{generator:modgen.modgen,}};sf2.Parser.prototype.createInstrumentModulator_=function(zone,index){var modgen=this.createBagModGen_(zone,zone[index].presetModulatorIndex,zone[index+1]?zone[index+1].instrumentModulatorIndex:this.instrumentZoneModulator.length,this.instrumentZoneModulator);return{modulator:modgen.modgen}};sf2.Parser.prototype.createPresetGenerator_=function(zone,index){var modgen=this.createBagModGen_(zone,zone[index].presetGeneratorIndex,zone[index+1]?zone[index+1].presetGeneratorIndex:this.presetZoneGenerator.length,this.presetZoneGenerator);return{generator:modgen.modgen,}};sf2.Parser.prototype.createPresetModulator_=function(zone,index){var modgen=this.createBagModGen_(zone,zone[index].presetModulatorIndex,zone[index+1]?zone[index+1].presetModulatorIndex:this.presetZoneModulator.length,this.presetZoneModulator);return{modulator:modgen.modgen,}};sf2.Parser.prototype.createBagModGen_=function(zone,indexStart,indexEnd,zoneModGen){var modgen={unknown:[],'keyRange':{hi:127,lo:0}};var info,i,il;for(i=indexStart,il=indexEnd;i<il;++i){info=zoneModGen[i];if(info.type==='unknown')
+modgen.unknown.push(info.value);else
+modgen[info.type]=info.value}
+return{modgen:modgen}};sf2.Parser.GeneratorEnumeratorTable=['startAddrsOffset','endAddrsOffset','startloopAddrsOffset','endloopAddrsOffset','startAddrsCoarseOffset','modLfoToPitch','vibLfoToPitch','modEnvToPitch','initialFilterFc','initialFilterQ','modLfoToFilterFc','modEnvToFilterFc','endAddrsCoarseOffset','modLfoToVolume',undefined,'chorusEffectsSend','reverbEffectsSend','pan',undefined,undefined,undefined,'delayModLFO','freqModLFO','delayVibLFO','freqVibLFO','delayModEnv','attackModEnv','holdModEnv','decayModEnv','sustainModEnv','releaseModEnv','keynumToModEnvHold','keynumToModEnvDecay','delayVolEnv','attackVolEnv','holdVolEnv','decayVolEnv','sustainVolEnv','releaseVolEnv','keynumToVolEnvHold','keynumToVolEnvDecay','instrument',undefined,'keyRange','velRange','startloopAddrsCoarseOffset','keynum','velocity','initialAttenuation',undefined,'endloopAddrsCoarseOffset','coarseTune','fineTune','sampleID','sampleModes',undefined,'scaleTuning','exclusiveClass','overridingRootKey'];sf2.Riff={};sf2.Riff.Parser=function(input,options){options=options||{};this.input=input;this.ip=options.index||0;this.length=options.length||input.length-this.ip;this.offset=this.ip;this.padding=options.padding!==undefined?options.padding:true;this.bigEndian=options.bigEndian!==undefined?options.bigEndian:false};sf2.Riff.Chunk=function(type,size,offset){this.type=type;this.size=size;this.offset=offset};sf2.Riff.Parser.prototype.parse=function(){var length=this.length+this.offset;this.chunkList=[];while(this.ip<length)
+this.parseChunk()};sf2.Riff.Parser.prototype.parseChunk=function(){var input=this.input,ip=this.ip,size;this.chunkList.push(new sf2.Riff.Chunk(String.fromCharCode(input[ip++],input[ip++],input[ip++],input[ip++]),(size=this.bigEndian?((input[ip++]<<24)|(input[ip++]<<16)|(input[ip++]<<8)|(input[ip++])):((input[ip++])|(input[ip++]<<8)|(input[ip++]<<16)|(input[ip++]<<24))),ip));ip+=size;if(this.padding&&((ip-this.offset)&1)===1)
+ip++;this.ip=ip};sf2.Riff.Parser.prototype.getChunk=function(index){var chunk=this.chunkList[index];if(chunk===undefined)
+return null;return chunk};sf2.Riff.Parser.prototype.getNumberOfChunks=function(){return this.chunkList.length};return sf2}));function Midi5(i_conf){var po,conf=i_conf,empty=function(){},rf,op
+function get_time(po){return window.performance.now()/1000}
+function note_run(po,s,k,t,d){var j,a=(k*100)%100,c=po.v_c[s.v],i=po.c_i[c]
+k|=0
+t*=1000
+d*=1000
+if(a&&Midi5.ma.sysexEnabled){po.op.send(new Uint8Array([0xf0,0x7f,0x7f,0x08,0x02,i&0x7f,0x01,k,k,a/.78125,0,0xf7]),t)}
+po.op.send(new Uint8Array([0x90+c,k,127]),t)
+po.op.send(new Uint8Array([0x80+c,k,0]),t+d-20)}
+function midi_ctrl(po,s,t){po.op.send(new Uint8Array([0xb0+po.v_c[s.v],s.ctrl,s.val]),t*1000)}
+function midi_prog(po,s){var i,c=s.chn
+po.v_c[s.v]=c
+if(po.c_i[c]==undefined){po.op.send(new Uint8Array([0xb0+c,121,0]))
+if(0){if(s.p_v.midictl){for(i in s.p_v.midictl)
+po.op.send(new Uint8Array([0xb0+c,i,s.p_v.midictl[i]]))}}}
+i=s.instr
+if(i!=undefined){po.c_i[c]=i
+po.op.send(new Uint8Array([0xc0+c,i&0x7f]))}}
+function send_outputs(access){var o,os,out=[]
+Midi5.ma=access
+if(access&&access.outputs.size>0){os=access.outputs.values()
+while(1){o=os.next()
+if(!o||o.done)
+break
+out.push(o.value.name)}}
+rf(out)}
+return{get_outputs:function(f){if(!navigator.requestMIDIAccess){f()
+return}
+rf=f
+navigator.requestMIDIAccess({sysex:true}).then(send_outputs,function(msg){navigator.requestMIDIAccess().then(send_outputs,function(msg){rf()})})},set_output:function(name){if(!Midi5.ma)
+return
+var o,os=Midi5.ma.outputs.values()
+while(1){o=os.next()
+if(!o||o.done)
+break
+if(o.value.name==name){op=o.value
+break}}},play:function(i_start,i_end,i_lvl){po={conf:conf,onend:conf.onend||empty,onnote:conf.onnote||empty,s_end:i_end,s_cur:i_start,repv:i_lvl||0,tgen:2,get_time:get_time,midi_ctrl:midi_ctrl,midi_prog:midi_prog,note_run:note_run,timouts:[],op:op,v_c:[],c_i:[]}
+if(0){op.send(new Uint8Array([0xf0,0x7f,0x7f,0x08,0x02,0x00,0x01,0x69,0x69,0x00,0,0xf7]),t)}
+abc2svg.play_next(po)},stop:function(){po.stop=true
+po.timouts.forEach(function(id){clearTimeout(id)})
+abc2svg.play_next(po)
+if(op&&op.clear)
+op.clear()}}}
+function follow(abc,user,playconf){var keep_types={note:true,rest:true}
+user.anno_stop=function(type,start,stop,x,y,w,h){if(!keep_types[type])
+return
+abc.out_svg('<rect class="abcr _'+start+'_" x="');abc.out_sxsy(x,'" y="',y);abc.out_svg('" width="'+w.toFixed(2)+'" height="'+abc.sh(h).toFixed(2)+'"/>\n')}
+playconf.onnote=function(i,on){var b,i,e,elts,x=0,y=0
+if(abc2svg.mu)
+elts=abc2svg.mu.d.getElementsByClassName('_'+i+'_')
+else
+elts=document.getElementsByClassName('_'+i+'_')
+if(!elts||!elts.length)
+return
+e=elts[0]
+e.style.fillOpacity=on?0.4:0
+if(on&&!window.no_scroll){b=e.getBoundingClientRect()
+if(b.top<0||b.bottom>window.innerHeight*.8)
+y=b.top-window.innerHeight*.3
+if(b.left<0||b.right>window.innerWidth*.8)
+x=b.left-window.innerWidth*.3
+if(x||y)
+window.scrollBy({top:y,left:x,behavior:(x<0||y)?'instant':'smooth'})}}}
+(function(){var sty=document.createElement("style")
+sty.innerHTML=".abcr {fill: #d00000; fill-opacity: 0; z-index: 15}"
+document.head.appendChild(sty)})()
+abc2svg.ch_names={'':["C-E G C+","E-C G C+","G-C E G "],m:["C-e G C+","e-C G C+","G-C e G "],'7':["C-b-E G ","E-C G b ","G-E b C+","b-E G C+"],m7:["C-b-e G ","e-C G b ","G-e b C+","b-e G C+"],m7b5:["C-b-e g ","e-C g b ","g-e b C+","b-e g C+"],M7:["C-B-E G ","E-C G B ","G-E B C+","B-E G C+"],'6':["C-A-E G ","E-C A B ","A-E B C+","B-E A C+"],m6:["C-A-e G ","e-C A B ","A-e B C+","B-e A C+"],aug:["C-E a C+","E-C a C+","a-C E a "],aug7:["C-b-E a ","E-C a b ","a-E b C+","b-E a C+"],dim:["C-E g C+","E-C g C+","g-C E g "],dim7:["C-e g A ","e-C g A ","g-e A C+","A-C e G "],'9':["C-b-E G D+","E-C G b D+","G-E b C+D+","b-E G C+D+","D-G-C E b "],m9:["C-b-e G D+","e-C G b D+","G-e b C+D+","b-e G C+D+","D-G-C e b "],maj9:["C-B-E G D+","E-C G B D+","G-E B C+D+","B-E G C+D+","D-G-C E B "],M9:["C-B-E G D+","E-C G B D+","G-C E B D+","B-E G C+D+","D-G-C E B "],'11':["C-b-E G D+F+","E-C G b D+F+","G-E b C+D+F+","b-E G C+D+F+","D-G-C E b F+","F-D-G-C E b D+"],dim9:["C-A-e g d+","e-C g A d+","g-C e A d+","A-C e g d+","D-g-C e A "],sus4:["C-F G C+","F-C G C+","G-C F G "],sus9:["C-D G C+","D-C G C+","G-C D G "],'7sus4':["C-b-F G ","F-C G b ","G-F b C+","b-C F G "],'7sus9':["C-b-D G ","D-C G b ","G-D b C+","b-C D G "],'5':["C-G C+","G-G C+"]}
+abc2svg.midlet="CdDeEFgGaAbB"
+abc2svg.letmid={C:0,d:1,D:2,e:3,E:4,F:5,g:6,G:7,a:8,A:9,b:10,B:11}
+abc2svg.chord=function(first,voice_tb,cfmt){var chnm,i,k,vch,s,gchon,C=abc2svg.C,trans=48+(cfmt.chord.trans?cfmt.chord.trans*12:0)
+function chcr(b,ch){var i,v,r=[]
+b=abc2svg.midlet[b]
+i=ch.length
+while(--i>0){if(ch[i][0]==b)
+break}
+ch=ch[i]
+for(i=0;i<ch.length;i+=2){v=abc2svg.letmid[ch[i]]
+switch(ch[i+1]){case'+':v+=12;break
+case'-':v-=12;break}
+r.push(v)}
+return r}
+function filter(a_cs){var i,cs,t
+for(i=0;i<a_cs.length;i++){cs=a_cs[i]
+if(cs.type!='g')
+continue
+t=cs.otext
+if(t.slice(-1)==')')
+t=t.replace(/\(.*/,'')
+return t.replace(/\(|\)|\[|\]/g,'')}}
+function gench(sb){var r,ch,b,m,n,not,a=filter(sb.a_gch),s={v:vch.v,p_v:vch,type:C.NOTE,time:sb.time,notes:[]}
+if(!a)
+return
+a=a.match(/([A-GN])([#♯b♭]?)([^/]*)\/?(.*)/)
+if(!a)
+return
+r=abc2svg.letmid[a[1]]
+if(r==undefined){if(a[1]!="N")
+return
+s.type=C.REST
+ch=[0]
+r=0}else{switch(a[2]){case"#":case"♯":r++;break
+case"b":case"♭":r--;break}
+if(!a[3]){ch=chnm[""]}else{ch=abc2svg.ch_alias[a[3]]
+if(ch==undefined)
+ch=a[3]
+ch=chnm[ch]
+if(!ch)
+ch=a[3][0]=='m'?chnm.m:chnm[""]}
+if(a[4]){b=a[4][0].toUpperCase()
+b=abc2svg.letmid[b]
+if(b!=undefined){switch(a[4][1]){case"#":case"♯":b++;if(b>=12)b=0;break
+case"b":case"♭":b--;if(b<0)b=11;break}}}}
+if(b==undefined)
+b=0
+ch=chcr(b,ch)
+n=ch.length
+r+=trans
+if(sb.p_v.tr_snd)
+r+=sb.p_v.tr_snd
+for(m=0;m<n;m++){not={midi:r+ch[m]}
+s.notes.push(not)}
+s.nhd=n-1
+s.prev=vch.last_sym
+vch.last_sym.next=s
+s.ts_next=sb.ts_next
+sb.ts_next=s
+s.ts_prev=sb
+if(s.ts_next)
+s.ts_next.ts_prev=s
+vch.last_sym=s}
+if(cfmt.chord.names){chnm=Object.create(abc2svg.ch_names)
+for(k in cfmt.chord.names){vch=""
+for(i=0;i<cfmt.chord.names[k].length;i++){s=cfmt.chord.names[k][i]
+vch+=abc2svg.midlet[s%12]
+vch+=i==0?"-":(s>=12?"+":" ")}
+chnm[k]=[vch]}}else{chnm=abc2svg.ch_names}
+k=0
+for(i=0;i<voice_tb.length;i++){if(k<voice_tb[i].chn)
+k=voice_tb[i].chn}
+if(k==8)
+k++
+vch={v:voice_tb.length,id:"_chord",time:0,sym:{type:C.BLOCK,subtype:"midiprog",chn:k+1,instr:cfmt.chord.prog||0,time:0,ts_prev:first,ts_next:first.ts_next},vol:cfmt.chord.vol||.6}
+vch.sym.p_v=vch
+vch.sym.v=vch.v
+vch.last_sym=vch.sym
+voice_tb.push(vch)
+first.ts_next=vch.sym
+gchon=cfmt.chord.gchon
+s=first
+while(1){if(!s.ts_next){if(gchon)
+vch.last_sym.dur=s.time-vch.last_sym.time
+break}
+s=s.ts_next
+if(!s.a_gch){if(s.subtype=="midigch"){if(gchon&&!s.on)
+vch.last_sym.dur=s.time-vch.last_sym.time
+gchon=s.on}
+continue}
+if(!gchon)
+continue
+for(i=0;i<s.a_gch.length;i++){gch=s.a_gch[i]
+if(gch.type!='g')
+continue
+vch.last_sym.dur=s.time-vch.last_sym.time
+gench(s)
+break}}}

+ 1984 - 0
dist/abc2svg/xml2abc.js

@@ -0,0 +1,1984 @@
+//~ Revision: 118, Copyright (C) 2014-2021: Willem Vree
+//~ This program is free software; you can redistribute it and/or modify it under the terms of the
+//~ Lesser GNU General Public License as published by the Free Software Foundation;
+//~ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+//~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+//~ See the Lesser GNU General Public License for more details. <http://www.gnu.org/licenses/lgpl.html>.
+var $jscomp = $jscomp || {};
+$jscomp.scope = {};
+$jscomp.arrayIteratorImpl = function (h) {
+    var u = 0;
+    return function () {
+        return u < h.length ? { done: !1, value: h[u++] } : { done: !0 };
+    };
+};
+$jscomp.arrayIterator = function (h) {
+    return { next: $jscomp.arrayIteratorImpl(h) };
+};
+$jscomp.makeIterator = function (h) {
+    var u = "undefined" != typeof Symbol && Symbol.iterator && h[Symbol.iterator];
+    return u ? u.call(h) : $jscomp.arrayIterator(h);
+};
+$jscomp.ASSUME_ES5 = !1;
+$jscomp.ASSUME_NO_NATIVE_MAP = !1;
+$jscomp.ASSUME_NO_NATIVE_SET = !1;
+$jscomp.SIMPLE_FROUND_POLYFILL = !1;
+$jscomp.defineProperty =
+    $jscomp.ASSUME_ES5 || "function" == typeof Object.defineProperties
+        ? Object.defineProperty
+        : function (h, u, n) {
+            h != Array.prototype && h != Object.prototype && (h[u] = n.value);
+        };
+$jscomp.getGlobal = function (h) {
+    h = [
+        "object" == typeof window && window,
+        "object" == typeof self && self,
+        "object" == typeof global && global,
+        h,
+    ];
+    for (var u = 0; u < h.length; ++u) {
+        var n = h[u];
+        if (n && n.Math == Math) return n;
+    }
+    return globalThis;
+};
+$jscomp.global = $jscomp.getGlobal(this);
+$jscomp.SYMBOL_PREFIX = "jscomp_symbol_";
+$jscomp.initSymbol = function () {
+    $jscomp.initSymbol = function () { };
+    $jscomp.global.Symbol || ($jscomp.global.Symbol = $jscomp.Symbol);
+};
+$jscomp.SymbolClass = function (h, u) {
+    this.$jscomp$symbol$id_ = h;
+    $jscomp.defineProperty(this, "description", { configurable: !0, writable: !0, value: u });
+};
+$jscomp.SymbolClass.prototype.toString = function () {
+    return this.$jscomp$symbol$id_;
+};
+$jscomp.Symbol = (function () {
+    function h(n) {
+        if (this instanceof h) throw new TypeError("Symbol is not a constructor");
+        return new $jscomp.SymbolClass($jscomp.SYMBOL_PREFIX + (n || "") + "_" + u++, n);
+    }
+    var u = 0;
+    return h;
+})();
+$jscomp.initSymbolIterator = function () {
+    $jscomp.initSymbol();
+    var h = $jscomp.global.Symbol.iterator;
+    h || (h = $jscomp.global.Symbol.iterator = $jscomp.global.Symbol("Symbol.iterator"));
+    "function" != typeof Array.prototype[h] &&
+        $jscomp.defineProperty(Array.prototype, h, {
+            configurable: !0,
+            writable: !0,
+            value: function () {
+                return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this));
+            },
+        });
+    $jscomp.initSymbolIterator = function () { };
+};
+$jscomp.initSymbolAsyncIterator = function () {
+    $jscomp.initSymbol();
+    var h = $jscomp.global.Symbol.asyncIterator;
+    h || (h = $jscomp.global.Symbol.asyncIterator = $jscomp.global.Symbol("Symbol.asyncIterator"));
+    $jscomp.initSymbolAsyncIterator = function () { };
+};
+$jscomp.iteratorPrototype = function (h) {
+    $jscomp.initSymbolIterator();
+    h = { next: h };
+    h[$jscomp.global.Symbol.iterator] = function () {
+        return this;
+    };
+    return h;
+};
+$jscomp.iteratorFromArray = function (h, u) {
+    $jscomp.initSymbolIterator();
+    h instanceof String && (h += "");
+    var n = 0,
+        q = {
+            next: function () {
+                if (n < h.length) {
+                    var p = n++;
+                    return { value: u(p, h[p]), done: !1 };
+                }
+                q.next = function () {
+                    return { done: !0, value: void 0 };
+                };
+                return q.next();
+            },
+        };
+    q[Symbol.iterator] = function () {
+        return q;
+    };
+    return q;
+};
+$jscomp.polyfill = function (h, u, n, q) {
+    if (u) {
+        n = $jscomp.global;
+        h = h.split(".");
+        for (q = 0; q < h.length - 1; q++) {
+            var p = h[q];
+            p in n || (n[p] = {});
+            n = n[p];
+        }
+        h = h[h.length - 1];
+        q = n[h];
+        u = u(q);
+        u != q && null != u && $jscomp.defineProperty(n, h, { configurable: !0, writable: !0, value: u });
+    }
+};
+$jscomp.polyfill(
+    "Array.prototype.keys",
+    function (h) {
+        return h
+            ? h
+            : function () {
+                return $jscomp.iteratorFromArray(this, function (h) {
+                    return h;
+                });
+            };
+    },
+    "es6",
+    "es3"
+);
+$jscomp.findInternal = function (h, u, n) {
+    h instanceof String && (h = String(h));
+    for (var q = h.length, p = 0; p < q; p++) {
+        var D = h[p];
+        if (u.call(n, D, p, h)) return { i: p, v: D };
+    }
+    return { i: -1, v: void 0 };
+};
+$jscomp.polyfill(
+    "Array.prototype.find",
+    function (h) {
+        return h
+            ? h
+            : function (h, n) {
+                return $jscomp.findInternal(this, h, n).v;
+            };
+    },
+    "es6",
+    "es3"
+);
+var xml2abc_VERSION = 118,
+    vertaal;
+(function () {
+    function h(a, b) {
+        return Array(a + 1).join(b);
+    }
+    function u(a, b) {
+        for (var c = []; a;) c.push(b), --a;
+        return c;
+    }
+    function n(a, b) {
+        for (var c = 0, d = {}; c < a.length; ++c) d[a[c]] = b[c];
+        return d;
+    }
+    function q(a, b) {
+        var c = a.split(/%[ds]/);
+        c.length > b.length && b.push("");
+        return b
+            .map(function (a, b) {
+                return c[b] + a;
+            })
+            .join("");
+    }
+    function p(a, b) {
+        v.info(q(a, b));
+    }
+    function D(a, b) {
+        return -1 !== a.indexOf(b, a.length - b.length);
+    }
+    function H(a) {
+        return Object.keys(a).map(function (a) {
+            return parseInt(a);
+        });
+    }
+    function M(a, b) {
+        var c = [],
+            d;
+        if (Array.isArray(a)) for (d = 0; d < a.length; ++d) d in a && c.push([d, a[d]]);
+        else for (d in a) c.push([d, a[d]]);
+        c.sort(
+            b
+                ? function (a, b) {
+                    return a[0] - b[0];
+                }
+                : function (a, b) {
+                    return a[1] - b[1] || b[0] - a[0];
+                }
+        );
+        return c;
+    }
+    function N(a) {
+        this.reset();
+        this.ixp = a;
+        this.divs = this.mdur = this.ixm = 0;
+        this.mtr = [4, 4];
+    }
+    function C(a, b) {
+        this.tijd = 0;
+        this.dur = a;
+        this.fact = null;
+        this.tup = [""];
+        this.tupabc = "";
+        this.grace = this.beam = 0;
+        this.before = [];
+        this.after = "";
+        this.ns = b ? [b] : [];
+        this.lyrs = {};
+        this.pos = 0;
+        this.tab = null;
+        this.ntdec = "";
+    }
+    function E(a) {
+        this.tijd = 0;
+        this.str = a;
+        this.pos = 0;
+    }
+    function F() { }
+    function z(a) {
+        this.maxtime = this.tijd = 0;
+        this.gMaten = [];
+        this.gLyrics = [];
+        this.vnums = {};
+        this.cnt = new F();
+        this.vceCnt = 1;
+        this.lastnote = null;
+        this.bpl = a.b;
+        this.cpl = a.n;
+        this.repbra = 0;
+        this.nvlt = a.v;
+    }
+    function G(a, b, c, d) {
+        this.fnmext = a;
+        this.outlist = [];
+        this.infolist = [];
+        this.title = "T:Title";
+        this.key = "none";
+        this.clefs = {};
+        this.mtr = "none";
+        this.tempo = 0;
+        this.tempo_units = [1, 4];
+        this.pad = b;
+        this.X = c + 1;
+        this.denL = d.d;
+        this.volpan = d.m;
+        this.cmpL = [];
+        this.scale = "";
+        this.tstep = d.t;
+        this.stemless = 0;
+        this.rightmargin = this.leftmargin = this.pagewidth = "";
+        this.shiftStem = d.s;
+        this.mnum = d.mnum;
+        4 == d.p.length &&
+            ((this.scale = "" != d.p[0] ? parseFloat(d.p[0]) : ""),
+                (this.pagewidth = "" != d.p[1] ? parseFloat(d.p[1]) : ""),
+                (this.leftmargin = "" != d.p[2] ? parseFloat(d.p[2]) : ""),
+                (this.rightmargin = "" != d.p[3] ? parseFloat(d.p[3]) : ""));
+    }
+    function W(a, b) {
+        if (!a.join("")) return ["", 0];
+        for (var c = [], d = 0; d < a.length; ++d) {
+            var e = a[d];
+            "" == e
+                ? (e = b ? "_" : "*")
+                : D(e, "_") && !D(e, "\\_")
+                    ? ((e = e.replace("_", "")), (b = 1))
+                    : (b = 0);
+            c.push(e);
+        }
+        return [c.join(" "), b];
+    }
+    function I(a, b) {
+        for (var c = a, d = b, e; b;) (e = a % b), (a = b), (b = e);
+        return [c / a, d / a];
+    }
+    function O(a, b, c) {
+        if (0 == a.dur) return "";
+        var d = I(c * a.dur, 4 * b);
+        b = d[0];
+        c = d[1];
+        a.fact && ((d = a.fact[0]), (a = a.fact[1]), (d = I(b * d, c * a)), (b = d[0]), (c = d[1]));
+        64 < c &&
+            ((a = b / c),
+                (d = Math.floor(a)),
+                a - d < 0.1 * a && ((b = d), (c = 1)),
+                (d = I(Math.round((64 * b) / c) || 1, 64)),
+                p("denominator too small: %d/%d rounded to %d/%d", [b, c, d[0], d[1]]),
+                (b = d[0]),
+                (c = d[1]));
+        return 1 == b ? (1 == c ? "" : 2 == c ? "/" : "/" + c) : 1 == c ? "" + b : b + "/" + c;
+    }
+    function P(a) {
+        var b = a.match(/([_^]*)([A-Ga-g])([',]*)/);
+        if (!b) return -1;
+        a = b[1];
+        var c = b[2];
+        b = b[3];
+        var d = c.toUpperCase();
+        c = 60 + [0, 2, 4, 5, 7, 9, 11]["CDEFGAB".indexOf(d)] + (d != c ? 12 : 0);
+        a && (c += ("^" == a[0] ? 1 : -1) * a.length);
+        b && (c += ("'" == b[0] ? 12 : -12) * b.length);
+        return c;
+    }
+    function X(a, b, c, d) {
+        var e = 0;
+        0 <= c.indexOf("stafflines=1") && (e += 4);
+        !d && 0 <= c.indexOf("bass") && (e += 12);
+        e && ((c = "CDEFGAB".split("")), (e = c.indexOf(a) + e), (a = c[e % 7]), (b += Math.floor(e / 7)));
+        4 < b && (a = a.toLowerCase());
+        5 < b && (a += h(b - 5, "'"));
+        4 > b && (a += h(4 - b, ","));
+        return a;
+    }
+    function Y(a, b) {
+        var c = {
+            maj: 8,
+            ion: 8,
+            m: 11,
+            min: 11,
+            aeo: 11,
+            mix: 9,
+            dor: 10,
+            phr: 12,
+            lyd: 7,
+            loc: 13,
+            non: 8,
+        };
+        b = b.slice(0, 3).toLowerCase();
+        b =
+            "Fb Cb Gb Db Ab Eb Bb F C G D A E B F# C# G# D# A# E# B#".split(" ")[c[b] + a] +
+            (8 != c[b] ? b : "");
+        c = "FCGDAEB".split("");
+        a = 0 <= a ? n(c.slice(0, a), u(a, 1)) : n(c.slice(a), u(-a, -1));
+        return [b, a];
+    }
+    function Q(a, b, c) {
+        var d = 0,
+            e = b[a];
+        var g = e.tup.indexOf("start");
+        -1 < g && e.tup.splice(g, 1);
+        var f = a;
+        for (c = [e.fact[0] / c[0], e.fact[1] / c[1]]; a < b.length;) {
+            e = b[a];
+            if (!(e instanceof E || e.grace)) {
+                -1 < e.tup.indexOf("start")
+                    ? ((g = Q(a, b, c)), (a = g[0]), (g = g[1]), (d += g))
+                    : e.fact && (d += 1);
+                g = e.tup.indexOf("stop");
+                if (-1 < g) {
+                    e.tup.splice(g, 1);
+                    break;
+                }
+                if (!e.fact) {
+                    a = l;
+                    break;
+                }
+                var l = a;
+            }
+            a += 1;
+        }
+        l = [c[0], c[1], d];
+        l = "3,2,3" == l.toString() ? "(3" : q("(%d:%d:%d", l);
+        b[f].tupabc = l + b[f].tupabc;
+        return [a, d];
+    }
+    function Z(a) {
+        a = a.filter(function (a) {
+            return a instanceof C;
+        });
+        for (var b = 0; b < a.length - 1;) {
+            var c = a[b],
+                d = a[b + 1];
+            !c.fact &&
+                !d.fact &&
+                0 < c.dur &&
+                d.beam &&
+                (3 * c.dur == d.dur
+                    ? ((d.dur = (2 * d.dur) / 3), (c.dur *= 2), (c.after = "<" + c.after), (b += 1))
+                    : 3 * d.dur == c.dur &&
+                    ((c.dur = (2 * c.dur) / 3), (d.dur *= 2), (c.after = ">" + c.after), (b += 1)));
+            b += 1;
+        }
+    }
+    function aa(a, b, c, d, e) {
+        for (d = 0; d < a.length;)
+            (c = a[d]), c instanceof C && c.fact && !c.grace && ((c = Q(d, a, [1, 1])), (d = c[0])), (d += 1);
+        d = [];
+        for (var g, f = 0; f < a.length; ++f) {
+            c = a[f];
+            if (c instanceof C) {
+                var l = O(c, b, e),
+                    k = 1 < c.ns.length;
+                g = c.ns.filter(function (a) {
+                    return D(a, "-");
+                });
+                g = g.map(function (a) {
+                    return a.slice(0, -1);
+                });
+                var m = "";
+                k && g.length == c.ns.length && ((c.ns = g), (m = "-"));
+                g = c.tupabc + c.before.join("");
+                k && (g += "[");
+                g += c.ns.join("");
+                k && (g += "]" + m);
+                D(g, "-") && ((g = g.slice(0, -1)), (m = "-"));
+                g += l + m;
+                g += c.after;
+                c = c.beam;
+            } else c.str instanceof Array && (c.str = c.str[0]), (g = c.str), (c = 1);
+            c ? d.push(g) : d.push(" " + g);
+        }
+        for (d = d.join(""); 0 <= d.indexOf("!ped!!ped!");) d = d.replace(/!ped!!ped!/g, "!ped!");
+        for (; 0 <= d.indexOf("!ped-up!!ped-up!");) d = d.replace(/!ped-up!!ped-up!/g, "!ped-up!");
+        for (; 0 <= d.indexOf("!8va(!!8va)!");) d = d.replace(/!8va\(!!8va\)!/g, "");
+        return d;
+    }
+    function ba(a, b) {
+        a.map(function (a, b) {
+            a.pos = b;
+        });
+        a.sort(function (a, b) {
+            return a.tijd - b.tijd || a.pos - b.pos;
+        });
+        for (var c = 0, d = [], e = [], g = 0; g < a.length; ++g) {
+            var f = a[g];
+            f.tijd > c && K(f.tijd - c, b) && (d.push(new C(f.tijd - c, "x")), e.push(d.length - 1));
+            if (f instanceof E) f.tijd < c && (f.tijd = c), d.push(f), (c = f.tijd);
+            else {
+                if (f.tijd < c) {
+                    if ("z" == f.ns[0]) continue;
+                    var l = d[d.length - 1];
+                    if (l.tijd <= f.tijd)
+                        if ("z" == l.ns[0])
+                            (l.dur = f.tijd - l.tijd),
+                                0 == l.dur && d.pop(),
+                                p("overlap in part %d, measure %d: rest shortened", [b.ixp + 1, b.ixm + 1]);
+                        else {
+                            l.ns = l.ns.concat(f.ns);
+                            p("overlap in part %d, measure %d: added chord", [b.ixp + 1, b.ixm + 1]);
+                            f.dur = f.tijd + f.dur - c;
+                            if (0 >= f.dur) continue;
+                            f.tijd = c;
+                        }
+                    else {
+                        p("overlapping notes in one voice! part %d, measure %d, note %s discarded", [
+                            b.ixp + 1,
+                            b.ixm + 1,
+                            f instanceof C ? f.ns : f.str,
+                        ]);
+                        continue;
+                    }
+                }
+                d.push(f);
+                if (f instanceof C)
+                    if (((c = f.ns[0]), "x" == c || "z" == c)) e.push(d.length - 1);
+                    else if (e.length) {
+                        if (f.beam && !f.grace) for (c = 0; c < e.length; ++c) d[e[c]].beam = f.beam;
+                        e = [];
+                    }
+                c = f.tijd + f.dur;
+            }
+        }
+        0 == c &&
+            p("empty measure in part %d, measure %d, it should contain at least a rest to advance the time!", [
+                b.ixp + 1,
+                b.ixm + 1,
+            ]);
+        return d;
+    }
+    function ca(a) {
+        function b(a) {
+            a = q('<part-group number="%d" type="%s"></part-group>', [a, "stop"]);
+            return $(a, d);
+        }
+        var c,
+            d = a[0];
+        var e = [];
+        var g = [];
+        var f = a.children();
+        for (c = 0; c < f.length; c++)
+            if (((a = $(f[c])), "part-group" == a[0].tagName)) {
+                var l = a.attr("number");
+                var k = a.attr("type");
+                var m = g.indexOf(l);
+                "start" == k
+                    ? -1 < m
+                        ? (e.push(b(l)), e.push(a))
+                        : (e.push(a), g.push(l))
+                    : -1 < m && (g.splice(m, 1), e.push(a));
+            } else e.push(a);
+        for (c = g.length - 1; 0 <= c; --c) (l = g[c]), e.push(b(l));
+        return e;
+    }
+    function J(a, b, c) {
+        if (0 == a.length) return [[], []];
+        var d = a.shift();
+        if ("part-group" == d[0].tagName) {
+            var e = d.attr("number");
+            var g = d.attr("type");
+            if ("start" == g) {
+                g = [];
+                for (f in { "group-symbol": 0, "group-barline": 0, "group-name": 0, "group-abbreviation": 0 })
+                    g.push(d.find(f).text() || "");
+                b[e] = g;
+                c.push(e);
+                var f = J(a, b, c);
+                a = f[0];
+                d = f[1];
+                f = J(d, b, c);
+                b = f[0];
+                c = f[1];
+                return [[a].concat(b), c];
+            }
+            c = c.pop();
+            a.length && "stop" == a[0].attr("type") && e != c && ((f = b[c]), (b[c] = b[e]), (b[e] = f));
+            b = b[e];
+            return [[b], a];
+        }
+        f = J(a, b, c);
+        b = f[0];
+        a = f[1];
+        return [
+            [
+                ["name_tuple", d.find("part-name").text() || "", d.find("part-abbreviation").text() || ""],
+            ].concat(b),
+            a,
+        ];
+    }
+    function R(a) {
+        var b, c;
+        if (0 == a.length) return [];
+        var d = [];
+        for (b = 0; b < a.length; ++b) {
+            var e = a[b];
+            if (1 == e.length) d.push("" + e[0]);
+            else {
+                d.push("(");
+                for (c = 0; c < e.length; ++c) d.push("" + e[c]);
+                d.push(")");
+            }
+            d.push("|");
+        }
+        d.splice(-1, 1);
+        1 < a.length && (d = ["{"].concat(d).concat(["}"]));
+        return d;
+    }
+    function S(a, b, c, d, e, g) {
+        if ("name_tuple" == a[0])
+            (d = d.shift()),
+                b[0] && ((a[1] = b[0] + ":" + a[1]), (a[2] = b[1] + ":" + a[2])),
+                e.push(a),
+                g.push.apply(g, R(d));
+        else if (2 == a.length && "name_tuple" == a[0][0])
+            (d = d.shift()),
+                (c = ["name_tuple", "", ""]),
+                (c[1] = a[0][1] + ":" + a[1][2]),
+                (c[2] = a[0][2] + ":" + a[1][3]),
+                e.push(c),
+                g.push.apply(g, R(d));
+        else {
+            var f = a[a.length - 1];
+            b = f[0];
+            var l = f[1];
+            var k = f[2];
+            f = f[3];
+            l = "yes" == l || c;
+            g.push("brace" == b ? "{" : "[");
+            for (c = 0; c < a.length - 1; ++c) S(a[c], [k, f], l, d, e, g), l && g.push("|");
+            l && g.splice(-1, 1);
+            g.push("brace" == b ? "}" : "]");
+        }
+    }
+    function da(a) {
+        for (var b = "", c = a.children(), d = 0; d < c.length; ++d) {
+            var e = c[d];
+            switch (e.tagName) {
+                case "elision":
+                    b += "~";
+                    break;
+                case "text":
+                    b += $(e).text().replace(/_/g, "\\_").replace(/-/g, "\\-").replace(/ /g, "~");
+            }
+        }
+        if (!b) return b;
+        c = a.find("syllabic").text();
+        if ("begin" == c || "middle" == c) b += "-";
+        a.find("extend").length && (b += "_");
+        return b;
+    }
+    function ea(a) {
+        var b = { diamond: 1, triangle: 1, square: 1, normal: 1 },
+            c = fa,
+            d,
+            e = "default",
+            g = { default: [] },
+            f = { default: [] };
+        a = a.split("\n");
+        for (d = 0; d < a.length; ++d) {
+            var l = a[d];
+            if (0 <= l.indexOf("I:percmap")) {
+                l = l.split(" ").map(function (a) {
+                    return a.trim();
+                });
+                var k = l[4];
+                k in b && (k = k + "+," + k);
+                l = "%%map perc" + e + " " + l[1] + " print=" + l[2] + " midi=" + l[3] + " heads=" + k;
+                g[e].push(l);
+            }
+            0 <= l.indexOf("%%MIDI") && f[e].push(l);
+            0 <= l.indexOf("V:") &&
+                (k = l.match(/V:\s*(\S+)/)) &&
+                ((e = k[1]), e in g || ((g[e] = []), (f[e] = [])));
+        }
+        b = Object.keys(g).sort();
+        for (d = 0; d < b.length; ++d) c = c.concat(g[b[d]]);
+        e = "default";
+        for (d = 0; d < a.length; ++d)
+            (l = a[d]),
+                0 <= l.indexOf("I:percmap") ||
+                0 <= l.indexOf("%%MIDI") ||
+                (0 <= l.indexOf("V:") || 0 <= l.indexOf("K:")
+                    ? ((k = l.match(/V:\s*(\S+)/)) && (e = k[1]),
+                        c.push(l),
+                        e in f && f[e].length && ((c = c.concat(f[e])), delete f[e]),
+                        0 <= l.indexOf("perc") && -1 == l.indexOf("map=") && (l += " map=perc"),
+                        0 <= l.indexOf("map=perc") && 0 < g[e].length && c.push("%%voicemap perc" + e),
+                        0 <= l.indexOf("map=off") && c.push("%%voicemap"))
+                    : c.push(l));
+        return c.join("\n");
+    }
+    function L(a, b) {
+        var c = a;
+        4 < b && (c = a.toLowerCase());
+        5 < b && (c += h(b - 5, "'"));
+        4 > b && (c += h(4 - b, ","));
+        return c;
+    }
+    function K(a, b) {
+        if (a > b.divs / 16) return 1;
+        p("MuseScore bug: incorrect duration, smaller then 1/64! in measure %d, part %d", [b.ixm, b.ixp]);
+        return 0;
+    }
+    function w(a) {
+        this.slurBuf = {};
+        this.dirStk = {};
+        this.ingrace = 0;
+        this.msc = new z(a);
+        this.unfold = a.u;
+        this.ctf = a.c;
+        this.gStfMap = [];
+        this.midiMap = [];
+        this.drumInst = {};
+        this.drumNotes = {};
+        this.instMid = [];
+        this.midDflt = [-1, -1, -1, -91];
+        this.msralts = {};
+        this.curalts = {};
+        this.stfMap = {};
+        this.vce2stf = {};
+        this.clefMap = {};
+        this.curClef = {};
+        this.stemDir = {};
+        this.clefOct = {};
+        this.curStf = {};
+        this.nolbrk = a.x;
+        this.doPageFmt = 1 == a.p.length;
+        this.tstep = a.t;
+        this.dirtov1 = a.v1;
+        this.ped = !a.noped;
+        this.wstems = a.stm;
+        this.pedVce = null;
+        this.repeat_str = {};
+        this.tabVceMap = {};
+        this.koppen = {};
+        this.note_alts = [
+            "=C ^C =D ^D =E =F ^F =G ^G =A ^A =B".split(" "),
+            "^B _D ^^C _E _F ^E _G ^^F _A ^^G _B _C".split(" "),
+            "__D ^^B __E __F ^^D __G ^^E __A _/A __B __C ^^A".split(" "),
+        ];
+        this.step_map = { C: 0, D: 2, E: 4, F: 5, G: 7, A: 9, B: 11 };
+    }
+    var ha = Math.pow(2, 53),
+        T = {
+            "ornaments>trill-mark": "T",
+            "ornaments>mordent": "M",
+            "ornaments>inverted-mordent": "P",
+            "ornaments>turn": "!turn!",
+            "ornaments>inverted-turn": "!invertedturn!",
+            "technical>up-bow": "u",
+            "technical>down-bow": "v",
+            "technical>harmonic": "!open!",
+            "technical>open-string": "!open!",
+            "technical>stopped": "!plus!",
+            "technical>snap-pizzicato": "!snap!",
+            "technical>thumb-position": "!thumb!",
+            "articulations>accent": "!>!",
+            "articulations>strong-accent": "!^!",
+            "articulations>staccato": ".",
+            "articulations>staccatissimo": "!wedge!",
+            "articulations>scoop": "!slide!",
+            fermata: "!fermata!",
+            arpeggiate: "!arpeggio!",
+            "articulations>tenuto": "!tenuto!",
+            "articulations>spiccato": "!wedge!",
+            "articulations>breath-mark": "!breath!",
+            "articulations>detached-legato": "!tenuto!.",
+        },
+        U = {
+            p: "!p!",
+            pp: "!pp!",
+            ppp: "!ppp!",
+            pppp: "!pppp!",
+            f: "!f!",
+            ff: "!ff!",
+            fff: "!fff!",
+            ffff: "!ffff!",
+            mp: "!mp!",
+            mf: "!mf!",
+            sfz: "!sfz!",
+        },
+        fa =
+            '%%beginsvg\n<defs>,<text id="x" x="-3" y="0">&#xe263;</text>,<text id="x-" x="-3" y="0">&#xe263;</text>,<text id="x+" x="-3" y="0">&#xe263;</text>,<text id="normal" x="-3.7" y="0">&#xe0a3;</text>,<text id="normal-" x="-3.7" y="0">&#xe0a3;</text>,<text id="normal+" x="-3.7" y="0">&#xe0a4;</text>,<g id="circle-x"><text x="-3" y="0">&#xe263;</text><circle r="4" class="stroke"></circle></g>,<g id="circle-x-"><text x="-3" y="0">&#xe263;</text><circle r="4" class="stroke"></circle></g>,<path id="triangle" d="m-4 -3.2l4 6.4 4 -6.4z" class="stroke" style="stroke-width:1.4"></path>,<path id="triangle-" d="m-4 -3.2l4 6.4 4 -6.4z" class="stroke" style="stroke-width:1.4"></path>,<path id="triangle+" d="m-4 -3.2l4 6.4 4 -6.4z" class="stroke" style="fill:#000"></path>,<path id="square" d="m-3.5 3l0 -6.2 7.2 0 0 6.2z" class="stroke" style="stroke-width:1.4"></path>,<path id="square-" d="m-3.5 3l0 -6.2 7.2 0 0 6.2z" class="stroke" style="stroke-width:1.4"></path>,<path id="square+" d="m-3.5 3l0 -6.2 7.2 0 0 6.2z" class="stroke" style="fill:#000"></path>,<path id="diamond" d="m0 -3l4.2 3.2 -4.2 3.2 -4.2 -3.2z" class="stroke" style="stroke-width:1.4"></path>,<path id="diamond-" d="m0 -3l4.2 3.2 -4.2 3.2 -4.2 -3.2z" class="stroke" style="stroke-width:1.4"></path>,<path id="diamond+" d="m0 -3l4.2 3.2 -4.2 3.2 -4.2 -3.2z" class="stroke" style="fill:#000"></path>,</defs>\n%%endsvg'.split(
+                ","
+            ),
+        V =
+            '%%beginsvg\n,<style type="text/css">\n,.bf {font-family:sans-serif; font-size:7px}\n,</style>\n,<defs>\n,<rect id="clr" x="-3" y="-1" width="6" height="5" fill="white"></rect>\n,<rect id="clr2" x="-3" y="-1" width="11" height="5" fill="white"></rect>\n'.split(
+                ","
+            ),
+        v;
+    N.prototype.reset = function () {
+        this.lline = this.attr = "";
+        this.rline = "|";
+        this.lnum = "";
+    };
+    F.prototype.inc = function (a, b) {
+        this.counters[a][b] = (this.counters[a][b] || 0) + 1;
+    };
+    F.prototype.clear = function (a) {
+        a = Object.keys(a);
+        var b = u(a.length, 0);
+        this.counters = { note: n(a, b), nopr: n(a, b), nopt: n(a, b) };
+    };
+    F.prototype.getv = function (a, b) {
+        return this.counters[a][b];
+    };
+    F.prototype.prcnt = function (a) {
+        for (var b in this.counters.note)
+            0 != this.getv("nopr", b) &&
+                p("part %d, voice %d has %d skipped non printable notes", [a, b, this.getv("nopr", b)]),
+                0 != this.getv("nopt", b) &&
+                p("part %d, voice %d has %d notes without pitch", [a, b, this.getv("nopt", b)]),
+                0 == this.getv("note", b) && p("part %d, skipped empty voice %d", [a, b]);
+    };
+    z.prototype.initVoices = function (a) {
+        this.vtimes = {};
+        this.voices = {};
+        this.lyrics = {};
+        for (var b in this.vnums) (this.vtimes[b] = 0), (this.voices[b] = []), (this.lyrics[b] = []);
+        a && this.cnt.clear(this.vnums);
+    };
+    z.prototype.incTime = function (a) {
+        this.tijd += a;
+        0 > this.tijd && (this.tijd = 0);
+        this.tijd > this.maxtime && (this.maxtime = this.tijd);
+    };
+    z.prototype.appendElemCv = function (a, b) {
+        for (var c in a) this.appendElem(c, b);
+    };
+    z.prototype.insertElem = function (a, b) {
+        b = new E(b);
+        b.tijd = 0;
+        this.voices[a].unshift(b);
+    };
+    z.prototype.appendObj = function (a, b, c) {
+        b.tijd = this.tijd;
+        this.voices[a].push(b);
+        this.incTime(c);
+        this.tijd > this.vtimes[a] && (this.vtimes[a] = this.tijd);
+    };
+    z.prototype.appendElemT = function (a, b, c) {
+        b = new E(b);
+        b.tijd = c;
+        this.voices[a].push(b);
+    };
+    z.prototype.appendElem = function (a, b, c) {
+        this.appendObj(a, new E(b), 0);
+        c && this.cnt.inc("note", a);
+    };
+    z.prototype.appendNote = function (a, b, c) {
+        b.ns.push(b.ntdec + c);
+        this.appendObj(a, b, parseInt(b.dur));
+        this.lastnote = b;
+        "z" != c && "x" != c && (this.cnt.inc("note", a), b.grace || this.lyrics[a].push(b.lyrs));
+    };
+    z.prototype.getLastRec = function (a) {
+        return this.gMaten.length ? ((a = this.gMaten[this.gMaten.length - 1][a]), a[a.length - 1]) : null;
+    };
+    z.prototype.getLastMelis = function (a, b) {
+        return this.gLyrics.length && ((a = this.gLyrics[this.gLyrics.length - 1][a]), b in a) ? a[b][1] : 0;
+    };
+    z.prototype.addChord = function (a, b) {
+        for (var c = 0; c < a.before.length; c++) {
+            var d = a.before[c];
+            0 > this.lastnote.before.indexOf(d) && this.lastnote.before.push(d);
+        }
+        this.lastnote.ns.push(a.ntdec + b);
+    };
+    z.prototype.addBar = function (a, b) {
+        b.mdur &&
+            this.maxtime > b.mdur &&
+            p("measure %d in part %d longer than metre", [b.ixm + 1, b.ixp + 1]);
+        this.tijd = this.maxtime;
+        for (var c in this.vnums) {
+            if (b.lline || b.lnum) {
+                var d = this.getLastRec(c);
+                if (d) {
+                    var e = d.str;
+                    b.lline && (e = (e + b.lline).replace(/:\|:/g, "::").replace(/\|\|/g, "|"));
+                    3 == this.nvlt
+                        ? b.ixp + parseInt(c) == Math.min.apply(null, H(this.vnums)) && (e += b.lnum)
+                        : 4 == this.nvlt
+                            ? parseInt(c) == Math.min.apply(null, H(this.vnums)) && (e += b.lnum)
+                            : b.lnum && ((e += b.lnum), (this.repbra = 1));
+                    d.str = e;
+                } else b.lline && this.insertElem(c, "|:");
+            }
+            a && (d = this.getLastRec(c)) && (d.str += a);
+            b.attr && this.insertElem(c, "" + b.attr);
+            this.appendElem(c, " " + b.rline);
+            this.voices[c] = ba(this.voices[c], b);
+            d = this.lyrics[c];
+            e = {};
+            for (
+                var g = d.reduce(function (a, b) {
+                    return a.concat(H(b));
+                }, []),
+                f = Math.max.apply(null, g.concat([0]));
+                0 < f;
+                --f
+            ) {
+                g = d.map(function (a) {
+                    return a[f] || "";
+                });
+                var l = this.getLastMelis(c, f);
+                e[f] = W(g, l);
+            }
+            this.lyrics[c] = e;
+            Z(this.voices[c]);
+        }
+        this.gMaten.push(this.voices);
+        this.gLyrics.push(this.lyrics);
+        this.tijd = this.maxtime = 0;
+        this.initVoices();
+    };
+    z.prototype.outVoices = function (a, b) {
+        var c;
+        var d = {};
+        var e = Math.min.apply(null, H(this.vnums) || [1]);
+        for (c in this.vnums)
+            if (0 != this.cnt.getv("note", c)) {
+                if (v.denL) var g = v.denL;
+                else {
+                    var f, l;
+                    g = c;
+                    var k = this.gMaten;
+                    var m = a;
+                    var B = 0;
+                    var h = ha;
+                    for (var r = [4, 8, 16]; r.length;) {
+                        var t = r.shift(),
+                            q = 0;
+                        for (l = 0; l < k.length; ++l) {
+                            var y = k[l][g];
+                            for (f = 0; f < y.length; ++f) {
+                                var p = y[f];
+                                p instanceof E || 0 == p.dur || (q += O(p, m[l], t).length);
+                            }
+                        }
+                        q < h && ((B = t), (h = q));
+                    }
+                    g = B;
+                }
+                v.cmpL.push(g);
+                f = [];
+                l = {};
+                for (k = 0; k < this.gMaten.length; ++k) {
+                    m = this.gMaten[k][c];
+                    f.push(aa(m, a[k], k, b, g));
+                    m = void 0;
+                    r = this.gLyrics;
+                    if (0 != k)
+                        for (m in ((B = this.gMaten[k][c]), (h = r[k][c]), (r = r[k - 1][c]), r))
+                            if (((t = r[m][1]), !(m in h) && t)) {
+                                t = B;
+                                q = [];
+                                for (y = 0; y < t.length; ++y)
+                                    if (((p = t[y]), p instanceof C && !p.grace)) {
+                                        if ("z" == p.ns[0] || "x" == p.ns[0]) break;
+                                        q.push("_");
+                                    }
+                                (t = q.join(" ")) && (h[m] = [t, 0]);
+                            }
+                    B = this.gLyrics[k][c];
+                    for (n in B)
+                        if (((m = B[n]), (m = m[0]), n in l)) {
+                            for (; l[n].length < k;) l[n].push("");
+                            l[n].push(m);
+                        } else l[n] = u(k, "").concat([m]);
+                }
+                for (n in l) (m = l[n]), (g = f.length - m.length), (l[n] = m.concat(u(g, "")));
+                v.add("V:" + this.vceCnt);
+                this.repbra &&
+                    (1 == this.nvlt && 1 < this.vceCnt && v.add("I:repbra 0"),
+                        2 == this.nvlt && parseInt(c) > e && v.add("I:repbra 0"));
+                0 < this.cpl ? (this.bpl = 0) : 0 == this.bpl && (this.cpl = 100);
+                for (g = 0; f.length;) {
+                    k = 1;
+                    for (
+                        m = f[0];
+                        k < f.length &&
+                        !(0 < this.cpl && m.length + f[k].length >= this.cpl) &&
+                        !(0 < this.bpl && k >= this.bpl);
+
+                    )
+                        (m += f[k]), (k += 1);
+                    g += k;
+                    v.add(m + " %" + g);
+                    f.splice(0, k);
+                    B = M(l, 1);
+                    for (h = 0; h < B.length; ++h) {
+                        m = B[h];
+                        var n = m[0];
+                        m = m[1];
+                        v.add("w: " + m.slice(0, k).join("|") + "|");
+                        m.splice(0, k);
+                    }
+                }
+                d[c] = this.vceCnt;
+                this.vceCnt += 1;
+            }
+        this.gMaten = [];
+        this.gLyrics = [];
+        this.cnt.prcnt(b + 1);
+        return d;
+    };
+    G.prototype.add = function (a) {
+        this.outlist.push(a + "\n");
+    };
+    G.prototype.info = function (a, b) {
+        this.infolist.push(("undefined" == typeof b || b ? "-- " : "") + a);
+    };
+    G.prototype.mkHeader = function (a, b, c, d, e) {
+        var g = [],
+            f = [],
+            l,
+            k;
+        var m = a.slice();
+        for (k = 0; k < b.length; ++k) {
+            var h = b[k];
+            try {
+                S(h, ["", ""], "", a, g, f);
+            } catch (ia) {
+                p("lousy musicxml: error in part-list", []);
+            }
+        }
+        b = f.join(" ");
+        a = {};
+        for (k = 0; k < m.length && k < g.length; ++k) {
+            var x = m[k];
+            h = g[k];
+            var r = h[1];
+            h = h[2];
+            0 != x.length &&
+                ((x = x[0][0]),
+                    (r = r.replace(/\n/g, "\\n").replace(/\.:/g, ".").replace(/^:|:$/g, "")),
+                    (h = h.replace(/\n/g, "\\n").replace(/\.:/g, ".").replace(/^:|:$/g, "")),
+                    (a[x] = (r ? 'nm="' + r + '"' : "") + (h ? ' snm="' + h + '"' : "")));
+        }
+        g = [
+            q("X:%d\n%s\n%s", [this.X, this.title, -1 < this.mnum ? "%%measurenb " + this.mnum + "\n" : ""]),
+        ];
+        "" !== this.scale && g.push("%%scale " + this.scale + "\n");
+        "" !== this.pagewidth && g.push("%%pagewidth " + this.pagewidth + "cm\n");
+        "" !== this.leftmargin && g.push("%%leftmargin " + this.leftmargin + "cm\n");
+        "" !== this.rightmargin && g.push("%%rightmargin " + this.rightmargin + "cm\n");
+        b && 1 < f.length && g.push("%%score " + b + "\n");
+        m = this.tempo ? q("Q:%d/%d=%s\n", [this.tempo_units[0], this.tempo_units[1], this.tempo]) : "";
+        f = [];
+        for (k = 0; k < this.cmpL.length; ++k) (h = this.cmpL[k]), (f[h] = (f[h] || 0) + 1);
+        f = M(f);
+        f = f[f.length - 1][0];
+        f = this.denL ? this.denL : f;
+        g.push(q("L:1/%d\n%sM:%s\n", [f, m, this.mtr]));
+        g.push(q("I:linebreak $\nK:%s\n", [this.key]));
+        this.stemless && g.push("U:s=!stemless!\n");
+        m = Object.keys(d).sort();
+        for (k = 0; k < m.length; ++k) g = g.concat(d[m[k]]);
+        this.dojef = 0;
+        for (l in this.clefs) {
+            h = c[l - 1];
+            k = h[0];
+            b = h[1];
+            r = h[2];
+            x = h[3];
+            m = h.slice(4);
+            h = this.clefs[l];
+            m.length && 0 > h.indexOf("perc") && (h = (h + " map=perc").trim());
+            g.push(q("V:%d %s %s\n", [l, h, a[l] || ""]));
+            l in d &&
+                (g.push(q("%%voicemap tab%d\n", [l])),
+                    g.push("K:none\nM:none\n%%clef none\n%%staffscale 1.6\n%%flatbeams true\n%%stemdir down\n"));
+            -1 < h.indexOf("perc") && g.push("K:none\n");
+            1 < this.volpan
+                ? (0 < k && k != l && g.push("%%MIDI channel " + k + "\n"),
+                    0 < b && g.push("%%MIDI program " + (b - 1) + "\n"),
+                    0 <= r && g.push("%%MIDI control 7 " + r + "\n"),
+                    0 <= x && g.push("%%MIDI control 10 " + x + "\n"))
+                : 0 < this.volpan &&
+                (m.length && 0 < k && g.push("%%MIDI channel " + k + "\n"),
+                    0 < b && g.push("%%MIDI program " + (b - 1) + "\n"));
+            for (k = 0; k < m.length; ++k)
+                if (
+                    ((h = m[k].nt),
+                        (r = m[k].step),
+                        (b = m[k].midi),
+                        (x = m[k].nhd) || (x = "normal"),
+                        P(h) != b || h != r)
+                )
+                    0 < this.volpan && g.push("%%MIDI drummap " + h + " " + b + "\n"),
+                        g.push("I:percmap " + h + " " + r + " " + b + " " + x + "\n"),
+                        (this.dojef = this.tstep);
+            f != this.cmpL[l - 1] && g.push("L:1/" + this.cmpL[l - 1] + "\n");
+        }
+        this.outlist = g.concat(this.outlist);
+        c = Object.keys(e).sort();
+        if (c.length) {
+            var t = [];
+            var n = this.shiftStem
+                ? '<g id="kop%s" class="bf"><use xlink:href="#clr"></use><text x="-2" y="3">%s</text></g>\n'.replace(
+                    "-2",
+                    "-5"
+                )
+                : '<g id="kop%s" class="bf"><use xlink:href="#clr"></use><text x="-2" y="3">%s</text></g>\n',
+                y = this.shiftStem
+                    ? '<g id="kop%s" class="bf"><use xlink:href="#clr2"></use><text x="-2" y="3">%s</text></g>\n'.replace(
+                        "-2",
+                        "-5"
+                    )
+                    : '<g id="kop%s" class="bf"><use xlink:href="#clr2"></use><text x="-2" y="3">%s</text></g>\n';
+            d = this.shiftStem
+                ? V.map(function (a) {
+                    return a.replace("-3", "-6");
+                })
+                : V;
+            c.forEach(function (a) {
+                t.push(1 < a.length ? q(y, [a, a]) : q(n, [a, a]));
+            });
+            this.outlist = d.concat(t, "</defs>\n%%endsvg\n", this.outlist);
+        }
+    };
+    G.prototype.writeall = function () {
+        var a = v.outlist.join("");
+        this.dojef && (a = ea(a));
+        return [a, this.infolist.join("\n")];
+    };
+    w.prototype.matchSlur = function (a, b, c, d, e, g) {
+        if (-1 != ["start", "stop"].indexOf(a))
+            if ((b || (b = "1"), b in this.slurBuf)) {
+                var f = this.slurBuf[b],
+                    l = f[0],
+                    k = f[1],
+                    m = f[2];
+                f = f[3];
+                a != l
+                    ? (c != k || "start" != l || (f && g) || (m.before.unshift("("), (d.after += ")")),
+                        delete this.slurBuf[b])
+                    : (p("double slur numbers %s-%s in part %d, measure %d, voice %d note %s, first discarded", [
+                        a,
+                        b,
+                        this.msr.ixp + 1,
+                        this.msr.ixm + 1,
+                        c,
+                        d.ns,
+                    ]),
+                        (this.slurBuf[b] = [a, c, d, e]));
+            } else this.slurBuf[b] = [a, c, d, e];
+    };
+    w.prototype.doNotations = function (a, b, c) {
+        for (var d = Object.keys(T).sort(), e = 0; e < d.length; ++e) {
+            var g = d[e],
+                f = T[g];
+            b.find(g).length && a.before.push(f);
+        }
+        e = b.find("ornaments>tremolo");
+        e.length &&
+            ((g = e.attr("type")),
+                (d = h(parseInt(e.text()), "/")),
+                "single" == g
+                    ? a.before.unshift("!" + d + "!")
+                    : ((a.fact = null),
+                        this.tstep
+                            ? "stop" == g && a.before.unshift("!trem" + e.text() + "!")
+                            : "start" == g && a.before.unshift("!" + d + "-!")));
+        d = b.find("technical>fingering");
+        c ||
+            d.each(function () {
+                a.before.push("!" + $(this).text() + "!");
+            });
+        d = b.find("technical>string");
+        d.length &&
+            c &&
+            (this.tstep
+                ? ((c = b.find("technical>fret")), c.length && (a.tab = [d.eq(0).text(), c.eq(0).text()]))
+                : d.each(function () {
+                    var b = "!" + $(this).text() + "!";
+                    0 > a.ntdec.indexOf(b) && (a.ntdec += b);
+                }));
+        c = b.find("ornaments>wavy-line");
+        c = $jscomp.makeIterator(c.toArray());
+        for (d = c.next(); !d.done; d = c.next())
+            switch (((d = d.value), $(d).attr("type"))) {
+                case "start":
+                    a.before.unshift("!trill(!");
+                    break;
+                case "stop":
+                    a.after += "!trill)!";
+            }
+        c = b.find("glissando");
+        0 == c.length && (c = b.find("slide"));
+        c.length &&
+            ((b = "wavy" == c.attr("line-type") ? "~" : "-"),
+                "start" == c.attr("type")
+                    ? a.before.unshift(q("!%s(!", [b]))
+                    : "stop" == c.attr("type") && a.before.unshift(q("!%s)!", [b])));
+    };
+    w.prototype.tabnote = function (a, b, c, d, e) {
+        var g;
+        var f = this.step_map[b] + parseInt(a || "0");
+        11 < f && ((c += 1), (f -= 12));
+        0 > f && (--c, (f += 12));
+        a = e.tab[0];
+        b = e.tab[1];
+        for (g = 0; 4 > g; ++g) {
+            var l = this.note_alts[g % 3][f];
+            var k = c;
+            -1 < ["^B", "^^B"].indexOf(l) && --k;
+            -1 < ["_C", "__C"].indexOf(l) && (k += 1);
+            if (-1 < l.indexOf("/") || 3 == g) k = 9;
+            l = L(l, k);
+            var m = this.tabmap[[d, l]] || ["", ""];
+            k = m[0];
+            m = m[1];
+            if (!k) break;
+            if (a == k) return l;
+            3 == g &&
+                (p("rejected: voice %d note %s string %s fret %s remains: string %s fret %s", [
+                    d,
+                    l,
+                    a,
+                    b,
+                    k,
+                    m,
+                ]),
+                    (e.tab = [k, m]));
+        }
+        this.tabmap[[d, l]] = e.tab;
+        return l;
+    };
+    w.prototype.ntAbc = function (a, b, c, d, e, g) {
+        var f = {
+            "double-flat": -2,
+            "flat-flat": -2,
+            flat: -1,
+            natural: 0,
+            sharp: 1,
+            "sharp-sharp": 2,
+            "double-sharp": 2,
+        };
+        b += this.clefOct[this.curStf[d]] || 0;
+        var l = c.find("accidental").text(),
+            k = c.find("pitch>alter").text();
+        if (e.tab) return this.tabnote(k, a, b, d, e);
+        g &&
+            this.tstep &&
+            ((e = ["__", "_", "", "^", "^^"][parseInt(k || "0") + 2] + L(a, b)),
+                p("no string notation found for note %s in voice %d", [e, d]));
+        b = L(a, b);
+        !k && this.msralts[a] && (k = 0);
+        e = b + "#" + d;
+        !k && e in this.curalts && (k = 0);
+        if ("" === l && "" === k) return b;
+        if ("" != l) k = f[l];
+        else {
+            k = parseFloat(k);
+            if (e in this.curalts) {
+                if (k == this.curalts[e]) return b;
+            } else if (k == (this.msralts[a] || 0)) return b;
+            if (
+                c
+                    .find("tie")
+                    .add(c.find("notations>tied"))
+                    .get()
+                    .some(function (a) {
+                        return "stop" == $(a).attr("type");
+                    })
+            )
+                return b;
+            p("accidental %d added in part %d, measure %d, voice %d note %s", [
+                k,
+                this.msr.ixp + 1,
+                this.msr.ixm + 1,
+                d + 1,
+                b,
+            ]);
+        }
+        this.curalts[e] = k;
+        return (b = ["__", "_", "=", "^", "^^"][k + 2] + b);
+    };
+    w.prototype.doNote = function (a) {
+        var b = new C(0, null),
+            c = parseInt(a.find("voice").text() || "1");
+        this.isSib && (c += 100 * (a.find("staff").text() || 1));
+        var d = 0 < a.find("chord").length,
+            e = a.find("pitch>step").text() || a.find("unpitched>display-step").text(),
+            g = a.find("pitch>octave").text() || a.find("unpitched>display-octave").text(),
+            f = 0 < a.find("rest").length,
+            l = a.find("time-modification>actual-notes").text();
+        if (l) {
+            var k = a.find("time-modification>normal-notes").text();
+            b.fact = [parseInt(l), parseInt(k)];
+        }
+        b.tup = a
+            .find("notations>tuplet")
+            .map(function () {
+                return $(this).attr("type");
+            })
+            .get();
+        k = a.find("duration").text();
+        l = a.find("grace");
+        b.grace = 0 < l.length;
+        b.before = [""];
+        b.after = "";
+        b.grace &&
+            !this.ingrace &&
+            ((this.ingrace = 1), (b.before = ["{"]), "yes" == l.attr("slash") && b.before.push("/"));
+        if ((l = !b.grace && this.ingrace)) (this.ingrace = 0), (this.msc.lastnote.after += "}");
+        if (!k || b.grace) k = 0;
+        if (!f && "no" == a.attr("print-object")) {
+            if (d) return;
+            f = 1;
+        }
+        b.dur = parseInt(k);
+        f || (e && g) || (this.msc.cnt.inc("nopt", c), (g = 5), (e = "E"));
+        k = 0 == ((this.curClef && this.curClef[this.curStf[c]]) || "").indexOf("tab");
+        var m = a.find("notations");
+        m.length && this.doNotations(b, m, k);
+        m = a.find("stem");
+        !f &&
+            m.length &&
+            "none" == m.text() &&
+            (!k || c in this.hasStems || this.tstep) &&
+            (b.before.push("s"), (v.stemless = 1));
+        m = a.find("accidental");
+        m.length && "yes" == m.attr("parentheses") && (b.ntdec += "!courtesy!");
+        f = f ? ("no" == a.attr("print-object") || k ? "x" : "z") : this.ntAbc(e, parseInt(g), a, c, b, k);
+        if (a.find("unpitched").length) {
+            k = this.curClef[this.curStf[c]];
+            e = X(e, parseInt(g), k, this.tstep);
+            g = a.find("instrument");
+            g = g.length ? g.attr("id") : "dummyId";
+            g = this.drumInst[g] || P(f);
+            k = a.find("notehead");
+            m = k.text().replace(" ", "-");
+            "x" == m && (f = "^" + f.replace(/\^/g, "").replace(/_/g, ""));
+            if ("circle-x" == m || "diamond" == m || "triangle" == m)
+                f = "_" + f.replace(/\^/g, "").replace(/_/g, "");
+            "yes" == k.attr("filled") && (m += "+");
+            "no" == k.attr("filled") && (m += "-");
+            this.drumNotes[c + ";" + f] = [e, g, m];
+        }
+        e = a.find("tie").add(a.find("notations>tied")).get();
+        e.some(function (a) {
+            return "start" == $(a).attr("type");
+        }) && (f += "-");
+        e = a
+            .find("beam")
+            .map(function () {
+                return $(this).text();
+            })
+            .get();
+        b.beam = -1 < e.indexOf("continue") || -1 < e.indexOf("end") || b.grace;
+        e = a.find("lyric");
+        for (g = k = 0; g < e.length; ++g) {
+            m = $(e[g]);
+            var h = parseInt((m.attr("number") || "1").replace(/^.*verse/, ""));
+            0 == h ? (h = k + 1) : (k = h);
+            b.lyrs[h] = da(m);
+        }
+        e = a.find("stem").text();
+        !this.wstems ||
+            ("up" != e && "down" != e) ||
+            e == this.stemDir[c] ||
+            ((this.stemDir[c] = e), this.msc.appendElem(c, q("[I:stemdir %s]", [e])));
+        d
+            ? this.msc.addChord(b, f)
+            : ((d = parseInt(a.find("staff").text() || "1")),
+                this.curStf[c] != d &&
+                ((e = d - this.curStf[c]),
+                    (this.curStf[c] = d),
+                    this.msc.appendElem(c, "[I:staff " + (0 < e ? "+" : "") + e + "]")),
+                this.msc.appendNote(c, b, f));
+        e = a.find("notations>slur");
+        for (g = 0; g < e.length; ++g)
+            (a = $(e[g])), this.matchSlur(a.attr("type"), a.attr("number"), c, this.msc.lastnote, b.grace, l);
+    };
+    w.prototype.doAttr = function (a) {
+        var b, c;
+        var d = {
+            C1: "alto1",
+            C2: "alto2",
+            C3: "alto",
+            C4: "tenor",
+            F4: "bass",
+            F3: "bass3",
+            G2: "treble",
+            TAB: "tab",
+            percussion: "perc",
+        };
+        if ((b = a.find("divisions").text())) this.msr.divs = parseInt(b);
+        b = parseInt(a.find("transpose>chromatic").text() || "0");
+        var e = a.find("key>fifths").first().text();
+        var g = 0 == this.msc.tijd && 0 == this.msr.ixm;
+        if (e) {
+            var f = Y(parseInt(e), a.find("key>mode").first().text() || "major");
+            e = f[0];
+            this.msralts = f[1];
+            g && !b && "none" == v.key ? (v.key = e) : (e == v.key && g) || (this.msr.attr += "[K:" + e + "]");
+        }
+        if ((e = a.find("time>beats").text())) {
+            f = a.find("time>beat-type").text();
+            var l = e + "/" + f;
+            g ? (v.mtr = l) : (this.msr.attr += "[M:" + l + "]");
+            this.msr.mtr = [parseInt(e), parseInt(f)];
+        }
+        this.msr.mdur = (this.msr.divs * this.msr.mtr[0] * 4) / this.msr.mtr[1];
+        var k = this;
+        a.find("measure-style").each(function () {
+            var a, b, c, d, e;
+            var f = parseInt($(this).attr("number") || "1");
+            var g = k.stfMap[f];
+            $(this)
+                .find("measure-repeat")
+                .each(function () {
+                    a = $(this).attr("type");
+                    "start" == a
+                        ? ((k.repeat_str[f] = [k.msr.ixm, $(this).text()]),
+                            g.forEach(function (a) {
+                                k.msc.insertElem(a, k.repeat_str[f]);
+                            }))
+                        : "stop" == a &&
+                        ((b = k.repeat_str[f][0]),
+                            (d = k.repeat_str[f][1]),
+                            (c = k.msr.ixm - b),
+                            d ? ((e = d + " "), (c /= parseInt(d))) : (e = ""),
+                            (k.repeat_str[f][0] = q("[I:repeat %s%d]", [e, c])),
+                            delete k.repeat_str[f]);
+                });
+        });
+        (e = a.find("transpose>octave-change").text() || "") && (b += 12 * parseInt(e));
+        l = a.find("clef");
+        for (f = 0; f < l.length; f++) {
+            var m = $(l[f]);
+            e = parseInt(m.attr("number") || "1");
+            var h = m.find("sign").text();
+            var x = "percussion" != h && "TAB" != h ? m.find("line").text() || "" : "";
+            x = d[h + x] || "";
+            m = m.find("clef-octave-change").text() || "0";
+            x += { "-2": "-15", "-1": "-8", 1: "+8", 2: "+15" }[m] || "";
+            this.clefOct[e] = -parseInt(m);
+            b && (x += " transpose=" + b);
+            var r = a.find("staff-details");
+            if (r.length && (r.attr("number") || 1) == e) {
+                if ((m = r.find("staff-lines").text()))
+                    (h = "3" == m && "TAB" == h ? "|||" : m),
+                        (x += " stafflines=" + h),
+                        (this.stafflines = parseInt(m));
+                var t = [];
+                r.find("staff-tuning").each(function () {
+                    t.push($(this).find("tuning-step").text() + $(this).find("tuning-octave").text());
+                });
+                t.length && (x += q(" strings=%s", [t.join(",")]));
+                (h = r.find("capo").text()) && (x += q(" capo=%s", [h]));
+            }
+            this.curClef[e] = x;
+            if (g) this.clefMap[e] = x;
+            else
+                for (m = this.stfMap[e], c = 0; c < m.length; ++c) {
+                    r = m[c];
+                    if (e != this.curStf[r]) {
+                        var n = e - this.curStf[r];
+                        this.curStf[r] = e;
+                        h = 0 < n ? "+" : "";
+                        this.msc.appendElem(r, "[I:staff " + h + n + "]");
+                    }
+                    this.msc.appendElem(r, "[K:" + x + "]");
+                }
+        }
+    };
+    w.prototype.findVoice = function (a, b) {
+        var c = b.eq(a);
+        var d = parseInt(c.find("staff").text() || "1");
+        var e = this.stfMap[d];
+        e = e.length ? e[0] : 1;
+        if (this.dirtov1) return { sn: d, v: e, v1: e };
+        for (a += 1; a < b.length; ++a) {
+            c = b.eq(a);
+            if ("note" == c[0].tagName)
+                return (
+                    (b = parseInt(c.find("staff").text() || "1")),
+                    (d = parseInt(c.find("voice").text() || "1")),
+                    this.isSib && (d += 100 * b),
+                    (b = this.vce2stf[d]),
+                    { sn: b, v: d, v1: e }
+                );
+            if ("backup" == c[0].tagName) break;
+        }
+        return { sn: d, v: e, v1: e };
+    };
+    w.prototype.doDirection = function (a, b, c) {
+        function d(a, b, c, d, e) {
+            b &&
+                ((c = 0 <= b.indexOf("!8v") ? a.stfMap[e] : [c]),
+                    c.forEach(function (c) {
+                        null != d
+                            ? a.msc.appendElemT(c, b.replace("(", ")").replace("ped", "ped-up"), d)
+                            : a.msc.appendElem(c, b);
+                    }));
+        }
+        function e(a, b, c, e) {
+            var f = { down: "!8va(!", up: "!8vb(!", crescendo: "!<(!", diminuendo: "!>(!", start: "!ped!" };
+            g = t.attr("type") || "";
+            var k = b + (t.attr("number") || "1");
+            if (g in f)
+                if (((f = f[g]), k in a.dirStk)) {
+                    var l = a.dirStk[k];
+                    delete a.dirStk[k];
+                    "stop" == l.type
+                        ? d(a, f, c, l.tijd, e)
+                        : (p("%s direction %s has no stop in part %d, measure %d, voice %d", [
+                            b,
+                            l.type,
+                            a.msr.ixp + 1,
+                            a.msr.ixm + 1,
+                            c + 1,
+                        ]),
+                            (a.dirStk[k] = { type: g, vs: c }));
+                } else a.dirStk[k] = { type: g, vs: c };
+            else if ("stop" == g)
+                k in a.dirStk
+                    ? ((l = a.dirStk[k]),
+                        delete a.dirStk[k],
+                        (g = l.type),
+                        (c = l.vs),
+                        "stop" == g
+                            ? (p("%s direction %s has double stop in part %d, measure %d, voice %d", [
+                                b,
+                                g,
+                                a.msr.ixp + 1,
+                                a.msr.ixm + 1,
+                                c + 1,
+                            ]),
+                                (f = ""))
+                            : (f = f[l.type].replace("(", ")").replace("ped", "ped-up")))
+                    : ((a.dirStk[k] = { type: "stop", tijd: a.msc.tijd }), (f = ""));
+            else throw "wrong direction type";
+            d(a, f, c, null, e);
+        }
+        var g,
+            f,
+            l,
+            k = "";
+        var m = a.attr("placement");
+        var h = this.findVoice(b, c);
+        c = h.sn;
+        b = h.v;
+        h = h.v1;
+        var x = "",
+            r = { dacapo: "D.C.", dalsegno: "D.S.", tocoda: "dacoda", fine: "fine", coda: "O", segno: "S" };
+        var t = a.find("sound");
+        if (t.length) {
+            var n = t.find("midi-instrument");
+            if (n.length) {
+                var y = t.find("midi-instrument>midi-program").text();
+                var u = t.find("midi-instrument>midi-channel").text();
+                for (l in this.vceInst) this.vceInst[l] == n.attr("id") && (b = l);
+                (l = (y ? y - 1 : u) + "") &&
+                    0 < v.volpan &&
+                    this.msc.appendElem(b, "[I:MIDI= " + (y ? "program" : "channel") + " " + l + "]");
+            }
+            if ((y = t.attr("tempo"))) {
+                y = parseFloat(y).toFixed(0);
+                var w = [1, 4];
+            }
+            for (A in r)
+                if (t.attr(A)) {
+                    x = r[A];
+                    break;
+                }
+        }
+        l = a.children("direction-type");
+        for (r = 0; r < l.length; ++r) {
+            a = $(l[r]);
+            var A = { whole: [1, 1], half: [1, 2], quarter: [1, 4], eighth: [1, 8] };
+            n = a.find("metronome");
+            n.length &&
+                ((t = n.find("beat-unit").text() || ""),
+                    (w = t in A ? A[t] : A.quarter),
+                    n.find("beat-unit-dot").length && (w = I(3 * w[0], 2 * w[1])),
+                    (A = n
+                        .find("per-minute")
+                        .text()
+                        .match(/[.\d]+/)) && (y = A[0]));
+            t = a.find("wedge");
+            t.length && e(this, "wedge", b);
+            A = a.find("words");
+            0 == A.length && (A = a.find("rehearsal"));
+            for (n = 0; n < A.length; ++n) {
+                if (x) {
+                    this.msc.appendElem(b, q("!%s!", [x]), 1);
+                    break;
+                }
+                var z = "below" == m ? "_" : "^";
+                u = $(A[n]);
+                0 > parseFloat(u.attr("default-y") || "0") && (z = "_");
+                k += u.text().replace(/"/g, '\\"').replace(/\n/g, "\\n");
+            }
+            k = k.trim();
+            for (f in U) (A = U[f]), a.find("dynamics>" + f).length && this.msc.appendElem(b, A, 1);
+            a.find("coda").length && this.msc.appendElem(b, "O", 1);
+            a.find("segno").length && this.msc.appendElem(b, "S", 1);
+            t = a.find("octave-shift");
+            t.length && e(this, "octave-shift", b, c);
+            t = a.find("pedal");
+            t.length && this.ped && (this.pedVce || (this.pedVce = b), e(this, "pedal", this.pedVce));
+            "diatonic fretting" == a.find("other-direction").text() && (this.diafret = 1);
+        }
+        y &&
+            ((y = parseFloat(y).toFixed(0)),
+                0 == this.msc.tijd && 0 == this.msr.ixm
+                    ? ((v.tempo = y), (v.tempo_units = w))
+                    : this.msc.appendElem(h, q("[Q:%d/%d=%s]", [w[0], w[1], y])));
+        k && this.msc.appendElem(b, '"' + z + k + '"', 1);
+    };
+    w.prototype.doHarmony = function (a, b, c) {
+        c = this.findVoice(b, c).v;
+        var d = {
+            major: "",
+            minor: "m",
+            augmented: "+",
+            diminished: "dim",
+            dominant: "7",
+            "half-diminished": "m7b5",
+        };
+        b = { major: "maj", dominant: "", minor: "m", diminished: "dim", augmented: "+", suspended: "sus" };
+        var e = {
+            second: "2",
+            fourth: "4",
+            seventh: "7",
+            sixth: "6",
+            ninth: "9",
+            "11th": "11",
+            "13th": "13",
+        };
+        var g = { 1: "#", 0: "", "-1": "b" };
+        var f = a.find("root>root-step", "").text();
+        var l = g[a.find("root>root-alter").text()] || "";
+        var k = "";
+        var m = a.find("kind").text();
+        m in d
+            ? (m = d[m])
+            : -1 < m.indexOf("-")
+                ? ((d = m.split("-")),
+                    (m = d[0]),
+                    (d = d[1]),
+                    (m = (b[m] || "") + (e[d] || "")),
+                    0 == m.indexOf("sus") && ((k = m), (m = "")))
+                : "none" == m && (m = a.find("kind").attr("text"));
+        e = a.find("degree");
+        for (b = 0; b < e.length; ++b)
+            (d = $(e[b])), (m += (g[d.find("degree-alter").text()] || "") + d.find("degree-value").text());
+        m = m.replace("79", "9").replace("713", "13").replace("maj6", "6");
+        a = a.find("bass>bass-step").text() + (g[a.find("bass>bass-alter").text()] || "");
+        this.msc.appendElem(c, '"' + f + l + m + k + (a && "/" + a) + '"', 1);
+    };
+    w.prototype.doBarline = function (a) {
+        var b = a.find("repeat"),
+            c = 0;
+        b.length && (c = b.attr("direction"));
+        if (this.unfold) return c ? ("forward" == c ? 1 : 2) : 0;
+        "right" == (a.attr("location") || "right") &&
+            ((b = a.find("bar-style").text()),
+                "light-light" == b ? (this.msr.rline = "||") : "light-heavy" == b && (this.msr.rline = "|]"));
+        c && ("forward" == c ? (this.msr.lline = ":") : (this.msr.rline = ":|"));
+        a = a.find("ending");
+        a.length &&
+            ("start" == a.attr("type")
+                ? ((a = (a.attr("number") || "1").replace(/\./g, "").replace(/ /g, "")),
+                    /^[\d,]+$/.test(a) || (a = '"' + a.trim() + '"'),
+                    (this.msr.lnum = a))
+                : "|" == this.msr.rline && (this.msr.rline = "||"));
+        return 0;
+    };
+    w.prototype.doPrint = function (a) {
+        if ("yes" == a.attr("new-system") || "yes" == a.attr("new-page")) return this.nolbrk ? "" : "$";
+    };
+    w.prototype.doPartList = function (a) {
+        var b, c;
+        var d = a.find("part-list>score-part");
+        for (b = 0; b < d.length; ++b) {
+            var e = d[b];
+            var g = {};
+            var f = $(e).find("midi-instrument");
+            for (e = 0; e < f.length; ++e) {
+                var l = $(f[e]);
+                var k = ["midi-channel", "midi-program", "volume", "pan"];
+                var m = [];
+                for (c = 0; c < k.length; ++c) {
+                    var h = k[c];
+                    m.push(l.find(h).text() || this.midDflt[c]);
+                }
+                c = 1 * m[3];
+                -90 <= c && 90 >= c && (c = ((c + 90) / 180) * 127);
+                g[l.attr("id")] = [parseInt(m[0]), parseInt(m[1]), 1.27 * parseFloat(m[2]), c];
+                (m = l.find("midi-unpitched").text()) && (this.drumInst[l.attr("id")] = m - 1);
+            }
+            this.instMid.push(g);
+        }
+        a = a.find("part-list");
+        m = ca(a);
+        return J(m, {}, [])[0];
+    };
+    w.prototype.mkTitle = function (a) {
+        var b = [],
+            c = [],
+            d = [],
+            e,
+            g;
+        var f = a.find("work>work-title").text().trim();
+        var l = a.find("movement-title").text().trim();
+        var k = a.find("identification>creator");
+        for (e = 0; e < k.length; ++e) {
+            var m = $(k[e]);
+            var h = m.text();
+            m = m.attr("type");
+            h &&
+                ((h = h.split("\n").map(function (a) {
+                    return a.trim();
+                })),
+                    "composer" == m
+                        ? b.push.apply(b, h)
+                        : ("lyricist" == m || "transcriber" == m) && c.push.apply(c, h));
+        }
+        k = a.find("identification>rights");
+        for (e = 0; e < k.length; ++e)
+            if ((h = $(k[e]).text()))
+                (h = h.split("\n").map(function (a) {
+                    return a.trim();
+                })),
+                    c.push.apply(c, h);
+        k = a.find("credit");
+        for (e = 0; e < k.length; ++e) {
+            h = "";
+            m = $(k[e]).find("credit-words");
+            for (g = 0; g < m.length; ++g) h += $(m[g]).text();
+            d.push(h.replace(/\s*[\r\n]\s*/g, " "));
+        }
+        d = (function (a) {
+            function e(a) {
+                return a && -1 < h.indexOf(a);
+            }
+            var g = [],
+                k;
+            for (k = 0; k < d.length; ++k) {
+                var h = d[k];
+                (6 > a && ((h && -1 < f.indexOf(h)) || (h && -1 < l.indexOf(h)))) ||
+                    (5 > a && ((h && -1 < b.indexOf(h)) || (h && -1 < c.indexOf(h)))) ||
+                    (4 > a && ((f && -1 < h.indexOf(f)) || (l && -1 < h.indexOf(l)))) ||
+                    (3 > a && (b.some(e) || c.some(e))) ||
+                    (2 > a && /^[\d\W]*$/.test(h)) ||
+                    g.push(h);
+            }
+            0 == a && f + l && (g = "");
+            return g;
+        })(this.ctf);
+        f && (f = "T:" + f.replace(/\n/g, "\nT:") + "\n");
+        l && (f += "T:" + l.replace(/\n/g, "\nT:") + "\n");
+        d.length &&
+            (f +=
+                d
+                    .map(function (a) {
+                        return "T:" + a;
+                    })
+                    .join("\n") + "\n");
+        b.length &&
+            (f +=
+                b
+                    .map(function (a) {
+                        return "C:" + a;
+                    })
+                    .join("\n") + "\n");
+        c.length &&
+            (f +=
+                c
+                    .map(function (a) {
+                        return "Z:" + a;
+                    })
+                    .join("\n") + "\n");
+        f && (v.title = f.substr(0, f.length - 1));
+        (this.isSib = 0 <= a.find("identification>encoding>software").text().indexOf("Sibelius")) &&
+            p("Sibelius MusicXMl is unreliable", []);
+    };
+    w.prototype.doDefaults = function (a) {
+        if (this.doPageFmt) {
+            var b = a.find("defaults");
+            if (b.length) {
+                a = b.find("scaling>millimeters").text();
+                var c = b.find("scaling>tenths").text();
+                c = a / c / 10;
+                a = b.find("page-layout>page-width").text() * c;
+                var d = b.find("page-layout>page-margins").first();
+                b = d.find("left-margin").text();
+                d = d.find("right-margin").text();
+                var e = (10 * c) / 0.2117;
+                !v.scale && e && (v.scale = e.toFixed(2));
+                !v.pagewidth && a && (v.pagewidth = a.toFixed(2));
+                v.leftmargin || "" == b || (v.leftmargin = (b * c).toFixed(2));
+                v.rightmargin || "" == d || (v.rightmargin = (d * c).toFixed(2));
+            }
+        }
+    };
+    w.prototype.locStaffMap = function (a) {
+        var b = {};
+        this.vceInst = {};
+        this.msc.vnums = {};
+        this.hasStems = {};
+        this.stfMap = {};
+        this.clefMap = {};
+        a = a.find("measure>note");
+        for (var c = 0; c < a.length; c++) {
+            var d = $(a[c]),
+                e = parseInt(d.find("voice").text() || "1");
+            this.isSib && (e += 100 * (d.find("staff").text() || 1));
+            this.msc.vnums[e] = 1;
+            var g = parseInt(d.find("staff").text() || "1");
+            this.stfMap[g] = [];
+            if (e in b) {
+                var f = b[e];
+                f[g] = (f[g] || 0) + 1;
+            } else (f = {}), (f[g] = 1), (b[e] = f);
+            f = d.find("instrument");
+            f.length && (this.vceInst[e] = $(f).attr("id"));
+            f = d.find("stem");
+            0 != d.find("rest").length || (0 != f.length && "none" == f.text()) || (this.hasStems[e] = 1);
+        }
+        for (e in b) {
+            a = [];
+            c = b[e];
+            for (g in c) a.push([c[g], g]);
+            a.sort(function (a, b) {
+                return a[0] - b[0];
+            });
+            a = a[a.length - 1][1];
+            this.stfMap[a].push(e);
+            this.vce2stf[e] = a;
+            this.curStf[e] = a;
+        }
+    };
+    w.prototype.addStaffMap = function (a) {
+        var b,
+            c,
+            d = [],
+            e = Object.keys(this.stfMap).sort();
+        for (c = 0; c < e.length; ++c) {
+            var g = e[c];
+            var f = this.stfMap[g];
+            var l = [];
+            var k = [];
+            for (b = 0; b < f.length; ++b) {
+                var h = f[b];
+                h in a && (l.push(a[h]), k.push(void 0 == this.hasStems[h]));
+            }
+            if (l.length)
+                for (d.push(l), f = (g in this.clefMap) ? this.clefMap[g] : "treble", b = 0; b < l.length; ++b)
+                    (h = l[b]),
+                        (g = ""),
+                        0 == f.indexOf("tab") &&
+                        (k[b] && 0 > f.indexOf("nostems") && (g = " nostems"),
+                            this.diafret && 0 > f.indexOf("diafret") && (g += " diafret")),
+                        (v.clefs[h] = f + g);
+        }
+        this.gStfMap.push(d);
+    };
+    w.prototype.addMidiMap = function (a, b) {
+        var c = this.instMid[a],
+            d = Object.keys(c);
+        var e = d.length ? c[d[0]] : this.midDflt;
+        a = [];
+        var g = this;
+        for (m in b) {
+            d = Object.keys(this.drumNotes)
+                .sort()
+                .filter(function (a) {
+                    return a.split(";")[0] == m;
+                });
+            var f = d.map(function (a) {
+                return {
+                    nt: a.split(";")[1],
+                    step: g.drumNotes[a][0],
+                    midi: g.drumNotes[a][1],
+                    nhd: g.drumNotes[a][2],
+                };
+            });
+            var h = b[m];
+            d = this.vceInst[m] || "";
+            d in c ? a.push([h, c[d].concat(f)]) : a.push([h, e.concat(f)]);
+        }
+        a.sort(function (a, b) {
+            return a[0] - b[0];
+        });
+        a.forEach(function (a) {
+            g.midiMap.push(a[1]);
+        });
+        e = "E G B d f a c' e'".split(" ");
+        var k = "0 1- 1 1+ 2 3 3 4 4 5 6 6+ 7 8- 8 8+ 9 10 10 11 11 12 13 13+ 14".split(" ");
+        d = Object.keys(this.tabmap).sort();
+        for (c = 0; c < d.length; ++c) {
+            h = d[c];
+            a = h.match(/(\d+),(.*)/);
+            var m = a[1];
+            var n = a[2];
+            f = this.tabmap[h][0];
+            var p = this.tabmap[h][1];
+            this.diafret && (p = k[parseInt(p)]);
+            h = b[m];
+            f = this.stafflines - parseInt(f);
+            a = this.tabVceMap[h] || [];
+            a.push(q("%%map tab%d %s print=%s heads=kop%s\n", [h, n, e[f], p]));
+            this.tabVceMap[h] = a;
+            this.koppen[p] = 1;
+        }
+    };
+    w.prototype.parse = function (a) {
+        var b = {},
+            c = $(a);
+        this.mkTitle(c);
+        this.doDefaults(c);
+        a = this.doPartList(c);
+        for (var d = c.find("part"), e = 0; e < d.length; ++e) {
+            var g = d.eq(e),
+                f = g.find("measure");
+            this.locStaffMap(g);
+            this.drumNotes = {};
+            this.clefOct = {};
+            this.curClef = {};
+            this.stemDir = {};
+            this.tabmap = {};
+            this.diafret = 0;
+            this.stafflines = 5;
+            this.msc.initVoices(1);
+            var h = 0,
+                k = 0;
+            g = [];
+            for (this.msr = new N(e); this.msr.ixm < f.length;) {
+                var m = f.eq(this.msr.ixm),
+                    n = 0,
+                    u = "";
+                this.msr.reset();
+                this.curalts = {};
+                for (var r = m.children(), t = 0; t < r.length; t++)
+                    switch (((c = r.eq(t)), c[0].tagName)) {
+                        case "note":
+                            this.doNote(c);
+                            break;
+                        case "attributes":
+                            this.doAttr(c);
+                            break;
+                        case "direction":
+                            this.doDirection(c, t, r);
+                            break;
+                        case "sound":
+                            this.doDirection(m, t, r);
+                            break;
+                        case "harmony":
+                            this.doHarmony(c, t, r);
+                            break;
+                        case "barline":
+                            n = this.doBarline(c);
+                            break;
+                        case "backup":
+                            c = parseInt(c.find("duration").text());
+                            K(c, this.msr) && this.msc.incTime(-c);
+                            break;
+                        case "forward":
+                            c = parseInt(c.find("duration").text());
+                            K(c, this.msr) && this.msc.incTime(c);
+                            break;
+                        case "print":
+                            u = this.doPrint(c);
+                    }
+                this.msc.addBar(u, this.msr);
+                g.push(this.msr.divs);
+                1 == n
+                    ? ((k = this.msr.ixm), (this.msr.ixm += 1))
+                    : 2 == n
+                        ? 1 > h
+                            ? ((this.msr.ixm = k), (h += 1))
+                            : ((h = 0), (this.msr.ixm += 1))
+                        : (this.msr.ixm += 1);
+            }
+            for (var w in this.repeat_str) (f = this.repeat_str[w]), (f[0] = q("[I:repeat %s %d]", [f[1], 1]));
+            f = this.msc.outVoices(g, e);
+            this.addStaffMap(f);
+            this.addMidiMap(e, f);
+            for (w in f) b[w] = f[w];
+        }
+        Object.keys(b).length
+            ? v.mkHeader(this.gStfMap, a, this.midiMap, this.tabVceMap, this.koppen)
+            : p("nothing written, %s has no notes ...", [v.fnmext]);
+    };
+    vertaal = function (a, b) {
+        var c = {
+            u: 0,
+            b: 0,
+            n: 0,
+            c: 0,
+            v: 0,
+            d: 0,
+            m: 0,
+            x: 0,
+            t: 0,
+            v1: 0,
+            noped: 0,
+            stm: 0,
+            mnum: -1,
+            p: "f",
+            s: 0,
+        },
+            d;
+        for (d in b) c[d] = b[d];
+        c.p = c.p ? c.p.split(",") : [];
+        v = new G(".abc", "", 0, c);
+        b = new w(c);
+        try {
+            b.parse(a);
+        } catch (e) {
+            p("** exception occurred: %s", [e]);
+        }
+        return v.writeall();
+    };
+})();
+"undefined" != typeof exports &&
+    ((exports.vertaal = vertaal), (exports.xml2abc_VERSION = xml2abc_VERSION));

BIN
dist/assets/FiraCode-Regular-f13d1ece.woff2


BIN
dist/assets/LatoLatin-Regular-ddd4ef7f.woff2


BIN
dist/assets/LatoLatin-Semibold-267eef30.woff2


BIN
dist/assets/icon_27_0-1f5f1516.png


BIN
dist/assets/icon_27_1-a2758876.png


BIN
dist/assets/icon_27_2-7d27294e.png


BIN
dist/assets/icon_27_3-1445a39a.png


BIN
dist/assets/icon_27_4-c754c0ce.png


File diff suppressed because it is too large
+ 0 - 0
dist/assets/index-5dfedfba.js


File diff suppressed because it is too large
+ 0 - 0
dist/assets/index-fe07ce50.css


File diff suppressed because it is too large
+ 0 - 0
dist/assets/index-legacy-84e4cf84.js


File diff suppressed because it is too large
+ 0 - 0
dist/assets/polyfills-legacy-0e8849b8.js


BIN
dist/favicon.ico


+ 55 - 0
dist/flexible.js

@@ -0,0 +1,55 @@
+! function (a, b) {
+  function c() {
+    var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
+    var height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
+    var b = width > height ? height : width;
+    b / i > 640 && (b = 640 * i);
+    b / i < 420 && (b = 420 * i);
+    var c = b / 10;
+    f.style.fontSize = c + "px", k.rem = a.rem = c
+  }
+  var d, e = a.document,
+    f = e.documentElement,
+    g = e.querySelector('meta[name="viewport"]'),
+    h = e.querySelector('meta[name="flexible"]'),
+    i = 0,
+    j = 0,
+    k = b.flexible || (b.flexible = {});
+  if (g) {
+    console.warn("将根据已有的meta标签来设置缩放比例");
+    var l = g.getAttribute("content").match(/initial\-scale=([\d\.]+)/);
+    l && (j = parseFloat(l[1]), i = parseInt(1 / j))
+  } else if (h) {
+    var m = h.getAttribute("content");
+    if (m) {
+      var n = m.match(/initial\-dpr=([\d\.]+)/),
+        o = m.match(/maximum\-dpr=([\d\.]+)/);
+      n && (i = parseFloat(n[1]), j = parseFloat((1 / i).toFixed(2))), o && (i = parseFloat(o[1]), j = parseFloat((1 / i).toFixed(2)))
+    }
+  }
+  if (!i && !j) {
+    var p = a.navigator.userAgent,
+      q = (!!p.match(/android/gi), !!p.match(/iphone/gi)),
+      r = q && !!p.match(/OS 9_3/),
+      s = a.devicePixelRatio;
+    i = q && !r ? s >= 3 && (!i || i >= 3) ? 3 : s >= 2 && (!i || i >= 2) ? 2 : 1 : 1, j = 1 / i
+  }
+  if (f.setAttribute("data-dpr", i), !g)
+    if (g = e.createElement("meta"), g.setAttribute("name", "viewport"), g.setAttribute("content", "initial-scale=" + j + ", maximum-scale=" + j + ", minimum-scale=" + j + ", user-scalable=no"), f.firstElementChild) f.firstElementChild.appendChild(g);
+    else {
+      var t = e.createElement("div");
+      t.appendChild(g), e.write(t.innerHTML)
+    } a.addEventListener("resize", function () {
+    clearTimeout(d), d = setTimeout(c, 300)
+  }, !1), a.addEventListener("pageshow", function (a) {
+    a.persisted && (clearTimeout(d), d = setTimeout(c, 300))
+  }, !1), "complete" === e.readyState ? e.body.style.fontSize = 12 * i + "px" : e.addEventListener("DOMContentLoaded", function () {
+    e.body.style.fontSize = 12 * i + "px"
+  }, !1), c(), k.dpr = a.dpr = i, k.refreshRem = c, k.rem2px = function (a) {
+    var b = parseFloat(a) * this.rem;
+    return "string" == typeof a && a.match(/rem$/) && (b += "px"), b
+  }, k.px2rem = function (a) {
+    var b = parseFloat(a) / this.rem;
+    return "string" == typeof a && a.match(/px$/) && (b += "rem"), b
+  }
+}(window, window.lib || (window.lib = {}));

+ 29 - 0
dist/index.html

@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="ZH-cn">
+
+<head>
+  <meta charset="UTF-8">
+  <link rel="icon" href="./favicon.ico" />
+  <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
+  <meta http-equiv="Cache-control" content="no-cache">
+  <meta http-equiv="Cache" content="no-cache">
+  <title>打谱</title>
+  <script src="//at.alicdn.com/t/c/font_4186350_idu6dqxtfd.js"></script>
+  <script src="./flexible.js"></script>
+  <script src="./abc2svg/xml2abc.js"></script>
+  <script src="./abc2svg/jquery-1.11.1.min.js"></script>
+  <script type="module" crossorigin src="./assets/index-5dfedfba.js"></script>
+  <link rel="stylesheet" href="./assets/index-fe07ce50.css">
+  <script type="module">import.meta.url;import("_").catch(()=>1);async function* g(){};window.__vite_is_modern_browser=true;</script>
+  <script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy chunks, syntax error above and the same error below should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script>
+</head>
+
+<body>
+  <div id="app"></div>
+  
+  <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
+  <script nomodule crossorigin id="vite-legacy-polyfill" src="./assets/polyfills-legacy-0e8849b8.js"></script>
+  <script nomodule crossorigin id="vite-legacy-entry" data-src="./assets/index-legacy-84e4cf84.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+</body>
+
+</html>

+ 11 - 0
dist/loading.svg

@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin:auto;display:block;" width="100px" height="100px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
+<circle cx="27.5" cy="57.5" r="5" fill="#01c1b5">
+  <animate attributeName="cy" calcMode="spline" keySplines="0 0.5 0.5 1;0.5 0 1 0.5;0.5 0.5 0.5 0.5" repeatCount="indefinite" values="57.5;42.5;57.5;57.5" keyTimes="0;0.3;0.6;1" dur="1s" begin="-0.6s"></animate>
+</circle> <circle cx="42.5" cy="57.5" r="5" fill="#ff979e">
+  <animate attributeName="cy" calcMode="spline" keySplines="0 0.5 0.5 1;0.5 0 1 0.5;0.5 0.5 0.5 0.5" repeatCount="indefinite" values="57.5;42.5;57.5;57.5" keyTimes="0;0.3;0.6;1" dur="1s" begin="-0.44999999999999996s"></animate>
+</circle> <circle cx="57.5" cy="57.5" r="5" fill="#01c1b5">
+  <animate attributeName="cy" calcMode="spline" keySplines="0 0.5 0.5 1;0.5 0 1 0.5;0.5 0.5 0.5 0.5" repeatCount="indefinite" values="57.5;42.5;57.5;57.5" keyTimes="0;0.3;0.6;1" dur="1s" begin="-0.3s"></animate>
+</circle> <circle cx="72.5" cy="57.5" r="5" fill="#ff979e">
+  <animate attributeName="cy" calcMode="spline" keySplines="0 0.5 0.5 1;0.5 0 1 0.5;0.5 0.5 0.5 0.5" repeatCount="indefinite" values="57.5;42.5;57.5;57.5" keyTimes="0;0.3;0.6;1" dur="1s" begin="-0.15s"></animate>
+</circle>
+</svg>

BIN
dist/soundFonts/flute-mp3/A4.mp3


BIN
dist/soundFonts/flute-mp3/A5.mp3


BIN
dist/soundFonts/flute-mp3/A6.mp3


BIN
dist/soundFonts/flute-mp3/Ab4.mp3


BIN
dist/soundFonts/flute-mp3/Ab5.mp3


BIN
dist/soundFonts/flute-mp3/Ab6.mp3


BIN
dist/soundFonts/flute-mp3/B4.mp3


BIN
dist/soundFonts/flute-mp3/B5.mp3


BIN
dist/soundFonts/flute-mp3/B6.mp3


BIN
dist/soundFonts/flute-mp3/Bb4.mp3


BIN
dist/soundFonts/flute-mp3/Bb5.mp3


BIN
dist/soundFonts/flute-mp3/Bb6.mp3


BIN
dist/soundFonts/flute-mp3/C4.mp3


BIN
dist/soundFonts/flute-mp3/C5.mp3


BIN
dist/soundFonts/flute-mp3/C6.mp3


BIN
dist/soundFonts/flute-mp3/C7.mp3


BIN
dist/soundFonts/flute-mp3/D4.mp3


BIN
dist/soundFonts/flute-mp3/D5.mp3


BIN
dist/soundFonts/flute-mp3/D6.mp3


BIN
dist/soundFonts/flute-mp3/Db4.mp3


BIN
dist/soundFonts/flute-mp3/Db5.mp3


BIN
dist/soundFonts/flute-mp3/Db6.mp3


BIN
dist/soundFonts/flute-mp3/E4.mp3


BIN
dist/soundFonts/flute-mp3/E5.mp3


BIN
dist/soundFonts/flute-mp3/E6.mp3


BIN
dist/soundFonts/flute-mp3/Eb4.mp3


BIN
dist/soundFonts/flute-mp3/Eb5.mp3


BIN
dist/soundFonts/flute-mp3/Eb6.mp3


BIN
dist/soundFonts/flute-mp3/F4.mp3


BIN
dist/soundFonts/flute-mp3/F5.mp3


BIN
dist/soundFonts/flute-mp3/F6.mp3


BIN
dist/soundFonts/flute-mp3/G4.mp3


BIN
dist/soundFonts/flute-mp3/G5.mp3


BIN
dist/soundFonts/flute-mp3/G6.mp3


BIN
dist/soundFonts/flute-mp3/Gb4.mp3


BIN
dist/soundFonts/flute-mp3/Gb5.mp3


BIN
dist/soundFonts/flute-mp3/Gb6.mp3


Some files were not shown because too many files changed in this diff