// abc2svg - ABC to SVG translator // @source: https://chiselapp.com/user/moinejf/repository/abc2svg // Copyright (C) 2014-2020 Jean-Francois Moine - LGPL3+ //abc2svg-jazzchord.js-Adds jazz chord styling to chord symbols abc2svg.jazzchord={gch_build:function(of,s){var gch,i,ix,t if(!this.cfmt().jazzchord){of(s) return} for(ix=0;ix=0) continue switch(t){case"/":gch.text="𝄍";continue case"%":gch.text="𝄎";continue case"%%":gch.text="𝄎";continue} if(abc2svg.jazzchord.rep){t=t.replace(abc2svg.jazzchord.reg,function(x){return abc2svg.jazzchord.rep[x]})} t=t.replace(/-|°|º|ᵒ|0|6\/9|\^/g,function(x){switch(x){case'-':return"–" case'0':return"ø" case'6/9':return"⁶⁄₉" case'^':return"∆" default:return"o"}}) if(t[0]=='(') t=t.slice(1,-1) i=1 switch(t[1]){case"\u266f":case"\u266d":i++ break} a=t.match(/([A-G])([#♯b♭]?)([^/]*)\/?(.*)/) if(!a) continue if(!a[2]) t=a[1] else t="$6"+a[1]+"$7"+a[2]+"$0" if(a[3]) t+="$8"+a[3]+"$0" if(a[4]) t+="/$9"+a[4]+"$0" if(gch.text[0]=='(') gch.text='('+t+')' else gch.text=t} of(s)},set_fmt:function(of,cmd,parm){var r,k if(cmd=="jazzchord"){this.cfmt().jazzchord=this.get_bool(parm) if(parm&&parm.indexOf('=')>0){parm=parm.split(/[\s]+/) abc2svg.jazzchord.rep={} r=[] for(cmd=0;cmd