Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Difference From 1f1e9ecb656a9e71 To 93aa3a8ca3fc968e
|
2024-12-15
| ||
| 18:10 | modules: strtab: fix: lack of stem on grace notes ... (check-in: 6a540b1c49 user: jef tags: trunk) | |
|
2024-12-14
| ||
| 18:07 | New release v1.22.23 ... (check-in: 93aa3a8ca3 user: jef tags: trunk, v1.22.23) | |
| 07:41 | core: add %%partname ... (check-in: bc88c24d2f user: jef tags: trunk) | |
|
2024-02-01
| ||
| 10:50 | core: keep the multi-measure rests of the second voices of the staves - asked by Gerhard Schacherl ... (check-in: fc7af4436c user: jef tags: trunk) | |
|
2024-01-30
| ||
| 16:56 | New release v1.22.13 ... (check-in: 1f1e9ecb65 user: jef tags: trunk, v1.22.13) | |
|
2024-01-27
| ||
| 15:05 | core: better vertical offset of rests when many voices ... (check-in: e8149de154 user: jef tags: trunk) | |
Changes to README.md.
| ︙ | |||
154 155 156 157 158 159 160 | 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | - + - + | It puts the lines of music on vertical areas. Without this style, the music is in-lined as in [this other example][5]. [5]: http://moinejf.free.fr/abcm2ps-doc/dansou-i.html "Tune index example" Global ABC parameters may be added as `parameter=value` in the query string |
| ︙ | |||
345 346 347 348 349 350 351 352 353 354 355 356 357 358 | 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 | + + + + + + |
after `-o` (default `abc.odt`).
Example:
` abcqjs toodt.js my_file.abc -o my_file.odt`
- `toparam.js`
This script just outputs the abc2svg parameters.
- `tosvg.js`
This script creates a SVG file that includes all the SVGs of the generation.
The included SVG images are updated for being correctly rendered by tools
that use librsvg, the SVG library for GNOME (feh, viewnior, swayimg...).
#### 2.3 PDF generation
`abctopdf` is a shell script which converts ABC to PDF using one of the
previous shell scripts and, either a chrome/chromium compatible web browser
(settable by the environment variable 'BROWSER'),
or the program [weasyprint](https://weasyprint.org/).
|
| ︙ | |||
497 498 499 500 501 502 503 | 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 | - - + - + |
Playing and highlighting the played notes may be offered loading
the script `snd-1.js` (see below).
[15]: http://moinejf.free.fr/abcm2ps-doc/inline.html "abc2svg - inline music"
This script also accepts a parameter `with_source`.
When this parameter is set, the music source is included before the
|
| ︙ |
Changes to abc2svg.ttf.
cannot compute difference between binary files
Changes to abcqjs.
| 1 2 3 4 5 6 7 8 | - + |
|
| ︙ | |||
66 67 68 69 70 71 72 73 74 75 76 77 | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | + + + + |
}
}
load(path + core)
load(path + "cmdline.js")
abc_cmd("abcqjs", args, "QuickJS")
// test: list the global variables
//for (var k in this)
// console.log(k)
' $p "$@"
The previous solution with the shebang line as
#!/usr/bin/env -S qjs --std
did not work with non-GNU versions of env
|
Changes to abctopdf.
| ︙ | |||
83 84 85 86 87 88 89 | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | - + - - + + | set -- "$@" "$a" fi shift done # check if some chromium-based browser is available for c in "$BROWSER" chromium-browser vivaldi opera brave-browser epic google-chrome; do |
| ︙ |
Changes to build.
| ︙ | |||
21 22 23 24 25 26 27 | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | - + |
# no minify
gen() {
cat "$@"
}
fi
out=abc2svg-$MAJOR.js
|
| ︙ |
Changes to build.ninja.
| ︙ | |||
22 23 24 25 26 27 28 | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | - + + + | rule jsc command = if [ -e .fslckout ] && command -v fossil >/dev/null 2>&1; then $ v=`fossil describe`;$ d=`date -Idate`;$ v="abc2svg.version=\"$$v\";abc2svg.vdate=\"$$d\"";$ else $ |
| ︙ | |||
90 91 92 93 94 95 96 | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | - | build font: font | font/abc2svg.sfd build sf: sf | Scc1t2/ build abc2svg-$MAJOR.js: jsc core/abc2svg.js core/deco.js core/draw.js $ font.js core/format.js core/front.js core/music.js core/parse.js core/subs.js $ core/svg.js core/tune.js core/lyrics.js core/gchord.js core/tail.js $ core/modules.js |
| ︙ | |||
119 120 121 122 123 124 125 126 127 128 129 130 131 132 | 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | + | build perc-$MAJOR.js: jscu modules/perc.js build psvg-$MAJOR.js: jscu modules/wps.js modules/psvg.js build roman-$MAJOR.js: jscu modules/roman.js build soloffs-$MAJOR.js: jscu modules/soloffs.js build sth-$MAJOR.js: jscu modules/sth.js build strtab-$MAJOR.js: jscu modules/strtab.js build temper-$MAJOR.js: jscu modules/temper.js build tempo-$MAJOR.js: jscu modules/tempo.js build tropt-$MAJOR.js: jscu modules/tropt.js build edit-$MAJOR.css: cp editor/edit.css build abcdoc-$MAJOR.js: jscu util/abcdoc.js build abcweb-$MAJOR.js: jscu util/abcweb.js build abcweb1-$MAJOR.js: jscu util/abcweb1.js |
| ︙ | |||
145 146 147 148 149 150 151 | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | - - + + + + - + - - + | ambitus-$MAJOR.js break-$MAJOR.js capo-$MAJOR.js $ chordnames-$MAJOR.js clair-$MAJOR.js clip-$MAJOR.js $ combine-$MAJOR.js diag-$MAJOR.js equalbars-$MAJOR.js gamelan-$MAJOR.js $ grid-$MAJOR.js grid2-$MAJOR.js grid3-$MAJOR.js jianpu-$MAJOR.js $ jazzchord-$MAJOR.js mdnn-$MAJOR.js MIDI-$MAJOR.js $ nns-$MAJOR.js page-$MAJOR.js pedline-$MAJOR.js perc-$MAJOR.js psvg-$MAJOR.js $ roman-$MAJOR.js soloffs-$MAJOR.js sth-$MAJOR.js strtab-$MAJOR.js $ |
Changes to cmdline.js.
| ︙ | |||
92 93 94 95 96 97 98 99 100 101 102 103 104 105 | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | + + + + + |
function abc_cmd(cmd, args, interp_name) {
var arg, parm, fn;
abc2svg.abort = function(e) {
abc2svg.printErr('javascript error: ' + e.message +
'\nStack:\n' + e.stack)
if (abc) {
abc.parse.state = 0 // force block flush
abc.blk_flush()
abc2svg.abc_end()
}
abc2svg.quit()
} // abort()
// put the last options before the last file
function arg_reorder(a) {
var f,
i = a.length - 2
|
| ︙ |
Changes to core/abc2svg.js.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | // abc2svg - abc2svg.js // |
| ︙ | |||
167 168 169 170 171 172 173 174 175 176 177 178 179 180 | 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | + + + |
"sus": "sus4",
"7sus": "7sus4"
} // ch_alias
// global fonts
abc2svg.font_tb = [] // fonts - index = font.fid
abc2svg.font_st = {} // font style => font_tb index for incomplete user fonts
// cache for converting a duration into [head, dots, nflags]
abc2svg.hdn = {}
// font weight
// reference:
// https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight
abc2svg.ft_w = {
thin: 100,
extralight: 200,
|
| ︙ | |||
352 353 354 355 356 357 358 | 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | - + |
}
user.errmsg(h + txt, l, c)
}
function error(sev, s, msg, a1, a2, a3, a4) {
var i, j, regex, tmp
|
| ︙ |
Changes to core/deco.js.
| ︙ | |||
53 54 55 56 57 58 59 | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | - + - + - - + + |
var dd_tb = {}, // definition of the decorations
a_de, // array of the decoration elements
cross // cross voice decorations
// decorations - populate with standard decorations
var decos = {
|
| ︙ | |||
171 172 173 174 175 176 177 | 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | - + + - - + + |
sacc3: "3 sacc3 6,5 4 4",
sacc1: "3 sacc1 6,4 4 4",
courtesy: "43 0 0 0 0",
"cacc-1": "3 cacc-1 0 0 0",
cacc3: "3 cacc3 0 0 0",
cacc1: "3 cacc1 0 0 0",
"tie(": "44 0 0 0 0",
|
| ︙ | |||
261 262 263 264 265 266 267 268 269 270 271 272 273 274 | 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | + + + |
function up3(s, pos) {
switch (pos & 0x07) {
case C.SL_ABOVE:
return 1 // true
case C.SL_BELOW:
return 0 // false
}
if (!s.multi // if voice alone in the staff
&& !s.invis) // but not invisible symbol of a secondary voice
return 1 //true
// if (s.multi)
// return s.multi > 0
// return 1 // true
return !s.second
} // up3()
// - of the dynamic and volume marks
|
| ︙ | |||
336 337 338 339 340 341 342 | 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 | + + + + + + + - - + + + - - - - - - - - - - - - - - - - - - - - - - + + + - + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
dd = de.dd
y = up ? s.ymx : s.ymn
if (y > 0 && y < 24) {
y = (((y + 9) / 6) | 0) * 6 - 6 // between lines
}
if (up) {
if (s.ys > 27
&& dd.name[0] == 'd' // if dot (staccato)
&& s.a_dd[0].name == "dot" // as the first decoration
&& s.stem > 0 && s.nflags >= 0
&& s.beam_st && s.beam_end)
y -= 6 // put the dot a bit lower
else
|
| ︙ | |||
558 559 560 561 562 563 564 | 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 | - - - - + + - + + + + |
s = de.s,
dd = de.dd,
x = de.x,
w = dd.wl + dd.wr
// glyphs inside the staff
switch (dd.glyph) {
|
| ︙ | |||
674 675 676 677 678 679 680 | 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 | - + |
wr = parseFloat(a[5])
if (isNaN(c_func)) {
error(1, null, "%%deco: bad C function value '$1'", a[1])
return //undefined
}
if (c_func > 10
|
| ︙ | |||
764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 | 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 | + + + - + + - + |
var nt2 = cross[nm],
nm2 = nm.slice(0, -1) + (nm.slice(-1) == '(' ? ')' : '(')
if (nt2) {
error(1, s, "Conflict on !$1!", nm)
return
}
if (nt1.tie_ty) // if normal '-'
curvoice.tie_s = null
nt1.s = s
nt2 = cross[nm2]
if (!nt2) {
cross[nm] = nt1 // keep the start/end
return
}
if (nm.slice(-1) == ')') {
nt2 = nt1
nt1 = cross[nm2]
}
cross[nm2] = null
if (nt1.midi != nt2.midi
|
| ︙ | |||
822 823 824 825 826 827 828 | 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 | - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + |
dd.ty = ty
}
return dd
} // get_dd()
/* -- convert the decorations -- */
function deco_cnv(s, prev) {
|
| ︙ | |||
1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 | 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 | + + + + + + + + + + + + + + |
case 44: // cross-voice ties
if (s.type != C.NOTE) {
error(1, s, errs.must_note, nm)
continue
}
do_ctie(nm, s, s.notes[0]) // (only one note for now)
continue
case 45: // finger glissando
fg = 1 //true
continue
// default:
// break
}
// handle the fingering in case finger glissando
if (fg && dd.glyph == 'fng') {
fg = 0 //false
if (sav_fg()) {
error(1, s,
"!$1! must be on the last of a couple of notes",
nm)
continue
}
}
// add the decoration in the symbol
if (!s.a_dd)
s.a_dd = []
s.a_dd.push(dd)
}
// handle the possible courtesy accidental
|
| ︙ | |||
1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 | 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
Abc.prototype.draw_all_deco = function() {
if (!a_de.length)
return
var de, dd, s, note, f, st, x, y, y2, ym, uf, i, str, a,
new_de = [],
ymid = []
// display a finger glissando
function out_fg() {
var k, l, de2, fg, fg2, x2,
j = s.fg.length
while (--j >= 0) {
fg = s.fg[j]
if (fg.nm == dd.name)
break
}
if (j < 0)
return
if (fg.ty) { // end
if (fg.ty == 1) // no start (not treated yet)
out_wln(x - 19, y, 12)
return
}
x2 = x + 7 // start
for (k = 0; k < a_de.length; k++) {
de2 = a_de[k]
if (de2.s != fg.s
|| de2.dd.name != dd.name)
continue
for (l = 0; l < de2.s.fg.length; l++) {
fg2 = de2.s.fg[l]
if (fg2.nm == fg.nm)
break
}
if (fg2.nm == fg.nm) { // if same finger
fg2.ty = 2 // end done
xypath(x2, y + 1)
output += 'l' + (de2.x - 7 - x2).toFixed(1)
+ ' ' + (y - de2.y
- staff_tb[s.st].y).toFixed(1)
+ '" stroke-width=".7"/>\n'
return
}
}
out_wln(x2, y, 12) // start without end
} // out_fg()
st = nstaff;
y = staff_tb[st].y
while (--st >= 0) {
y2 = staff_tb[st].y;
ymid[st] = (y + 24 + y2) * .5;
y = y2
}
|
| ︙ | |||
1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 | 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 | + + + + + |
// g_open(x, y, 0, .7, de.inv ? -.7 : 0);
// x = y = 0
// } else
if (de.inv) {
y = y + dd.h - dd.hd
g_open(x, y, 0, 1, -1);
x = y = 0
} else if (de.rotpi) {
g_open(x, y, 180)
x = y = 0
}
if (de.has_val) {
if (dd.func != 2 // if not !arpeggio!
|| stv_g.st < 0) // or not staff scale
// || voice_tb[s.v].scale != 1)
out_deco_val(x, y, f, de.val / stv_g.scale, de.defl)
else
out_deco_val(x, y, f, de.val, de.defl)
if (de.cont)
new_de.push(de.start) // to be continued next line
} else if (dd.str != undefined // string
&& !tgls[dd.glyph]
&& !glyphs[dd.glyph]) { // with a class
if (s.fg) // if finger glissando
out_fg() // (may change y)
out_deco_str(x, y, // - dd.h * .2,
de)
} else if (de.lden) {
out_deco_long(x, y, de)
} else {
xygl(x, y, f)
}
|
| ︙ | |||
2011 2012 2013 2014 2015 2016 2017 | 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 | - + |
if (font_size)
param_set_font("measurefont", "* " + font_size.toString());
}
/* -- draw the parts and the tempo information -- */
// (unscaled delayed output)
function draw_partempo() {
|
| ︙ | |||
2043 2044 2045 2046 2047 2048 2049 | 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 | + + + - + + - + - - + + + |
some_part = s;
set_font("parts");
h = gene.curfont.size + 2 +
gene.curfont.pad * 2
}
if (s2.x == undefined)
s2.x = s.x - 10
p = s2.text
if (cfmt.partname)
s2.ntxt = p = partname(p)[2]
|
| ︙ | |||
2119 2120 2121 2122 2123 2124 2125 | 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 | - + + | s.wr = w - 16 s.ymn = y s.ymx = s.ymn + 14 anno_start(s) } writempo(s, s.x - 16, y) anno_stop(s) |
Changes to core/draw.js.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | // abc2svg - draw.js - draw functions // |
| ︙ | |||
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | - + | STEM_CH_MIN2 = 10, /* ... for notes with two beams */ STEM_CH_MIN3 = 9, /* ... for notes with three beams */ STEM_CH_MIN4 = 9, /* ... for notes with four beams */ BEAM_DEPTH = 3.2, /* width of a beam stroke */ BEAM_OFFSET = .25, /* pos of flat beam relative to staff line */ BEAM_SHIFT = 5, /* shift of second and third beams */ BEAM_STUB = 7, /* length of stub for flag under beam */ |
| ︙ | |||
395 396 397 398 399 400 401 | 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 | - - - - - - - - - - - - |
break
case C.GRACE:
for (g = s.extra; g; g = g.next) {
y = a * g.x + b
if (s1.stem > 0) {
y = g.ymx - y
+ BEAM_DEPTH + BEAM_SHIFT * (nflags - 1)
|
| ︙ | |||
509 510 511 512 513 514 515 | 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 | - + | } } } y1 = bm.a * x1 + bm.b - dy; x2 -= x1; x2 /= stv_g.scale; |
| ︙ | |||
745 746 747 748 749 750 751 | 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 | - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + - - - - - - + + + + + - - - + + + + + + + + |
}
}
/* -- draw the time signature -- */
function draw_meter(s) {
if (!s.a_meter)
return
|
| ︙ | |||
849 850 851 852 853 854 855 | 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 | - + - + |
}
n = hla.length
if (!n)
return // no
// handle the helper lines out of the staff
var dx1, dx2, hl, shhd,hlp,
|
| ︙ | |||
1510 1511 1512 1513 1514 1515 1516 | 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 | - + |
/* draw the head */
if (note.invis) {
;
} else if (s.grace) { // don't apply %%map to grace notes
p = "ghd";
x_note -= 4.5 * stv_g.scale
} else if (note.map && note.map[0]) {
|
| ︙ | |||
1987 1988 1989 1990 1991 1992 1993 | 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 | - + |
} else {
y1 = k1.ys + 6
}
} else {
y1 = k1.ys - 3
}
} else {
|
| ︙ | |||
2022 2023 2024 2025 2026 2027 2028 | 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 | - + |
&& k2.nflags >= -1
&& !k2.in_tuplet)
// || k2.ys < y2 + 3))
y2 = k2.ys + 6
else
y2 = k2.ys - 3
} else {
|
| ︙ | |||
2105 2106 2107 2108 2109 2110 2111 | 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 | - + | y1 += dy } /* special case for grace notes */ if (k1.grace) x1 = k1.x - GSTEM_XOFF * .5 if (k2.grace) |
| ︙ | |||
2136 2137 2138 2139 2140 2141 2142 | 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 | - - + + - - + + |
if (y < h)
h = y
}
break
case C.GRACE:
for (g = k.extra; g; g = g.next) {
if (dir > 0) {
|
| ︙ | |||
2199 2200 2201 2202 2203 2204 2205 | 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 | - + - - + + - + | dx = x2 - x1; a = (y2 - y1) / dx; /*fixme: it seems to work with .4, but why?*/ // addy = y1 - a * x1 + .4 * height //fixme: the following code seems better! addy = y1 - a * x1 if (height > 0) |
| ︙ | |||
2858 2859 2860 2861 2862 2863 2864 | 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 | - + - - + + - + + | } if (s1.dots && !(not1.pit & 1) && ((dir > 0 && !s1.dot_low) || (dir < 0 && s1.dot_low))) x1 += 5 |
| ︙ | |||
3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 | 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 | + + + + |
continue
case C.MREST:
y_set(s.st, true, s.x + 16, 32, s.ymx + 2)
continue
default:
y_set(s.st, true, s.x - s.wl, s.wl + s.wr, s.ymx + 2);
y_set(s.st, false, s.x - s.wl, s.wl + s.wr, s.ymn - 2)
// fall thru
case C.PART:
case C.TEMPO:
case C.STAVES:
continue
case C.NOTE:
break
}
// (permit closer staves)
if (s.stem > 0) {
|
| ︙ | |||
3211 3212 3213 3214 3215 3216 3217 | 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 | - - - + |
for (v = 0; v < voice_tb.length; v++) {
p_voice = voice_tb[v]
if (!cur_sy.voices[v])
continue
st = cur_sy.voices[v].st
if (!stl[st])
continue
|
| ︙ | |||
3235 3236 3237 3238 3239 3240 3241 | 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 | - + |
for (st = 0; st < staff_d.length; st++) {
if (!staff_d[st])
continue
a_p = staff_d[st].split("\n");
y = staff_tb[st].y
+ staff_tb[st].topbar * .5
* staff_tb[st].staffscale
|
| ︙ | |||
3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 | 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 | + - - + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + |
/* -- draw the staff systems and the measure bars -- */
function draw_systems(indent) {
var s, s2, st, x, x2, res, sy,
xstaff = [],
stl = [], // all staves in the line
bar_bot = [],
bar_height = [],
bar_ng = [], // number of gaps
ba = [], // bars [symbol, bottom, height]
sb = "",
thb = ""
/* -- set the bottom and height of the measure bars -- */
function bar_set() {
|
| ︙ | |||
3459 3460 3461 3462 3463 3464 3465 | 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 | - + - | 'h' + w.toFixed(1); dy = 0 continue } if (ty != undefined) ln += '"/>\n'; ty = stafflines[i] |
| ︙ | |||
3486 3487 3488 3489 3490 3491 3492 | 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 | - + + - + - + - - |
xygl(x1, y, i)
return
}
out_XYAB('<g transform="translate(X, Y)">\n' + ln + '\n</g>\n', x1, y)
} // draw_staff()
// draw a measure bar
|
| ︙ | |||
3535 3536 3537 3538 3539 3540 3541 | 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 | - + + + + - - + + - - + + - + - - + + - + + + + + - + + - - + + + - + - + + + - + + + |
if (bar_type == '||:')
bar_type = '[|:'
for (i = bar_type.length; --i >= 0; ) {
switch (bar_type[i]) {
case "|":
if (s.bar_dotted) {
|
| ︙ | |||
3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 | 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 | + + + - + |
if (sy.st_print[st] // if not staff stop
&& cur_sy.staves[st]
&& sy.staves[st].stafflines ==
cur_sy.staves[st].stafflines)
continue
if (s.ts_prev.bar_type) {
x2 = s.ts_prev.x
if (sy.staves[st].stafflines.length >
cur_sy.staves[st].stafflines.length)
x2 -= s.ts_prev.wl - 4
} else {
x2 = (s.ts_prev.x + s.x) / 2
xstaff[st] = -1
}
draw_staff(st, x, x2)
xstaff[st] = sy.st_print[st] ? x2 : -1
}
cur_sy = sy;
bar_set()
continue
case C.BAR: // display the bars after the staves
if (s.invis || !s.bar_type
|| !cur_sy.st_print[s.st])
break
if (s.second
&& (!s.ts_prev
|| (s.ts_prev.type == C.BAR
&& s.ts_prev.st == s.st)))
break
|
| ︙ |
Changes to core/format.js.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | // abc2svg - format.js - formatting functions // |
| ︙ | |||
22 23 24 25 26 27 28 29 30 31 32 33 34 35 | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | + |
serifBold: 1,
'sans-serif': 1,
'sans-serifBold': 1,
Palatino: 1.1,
monospace: 1
},
txt_ff = "text,serif", // text font-family (serif for compatibility)
ff = {}, // font-face's from %%beginsvg
fmt_lock = {}
var cfmt = {
"abc-version": "1", // default: old version
annotationfont: {name: "text,sans-serif", size: 12},
aligncomposer: 1,
beamslope: .4, // max slope of a beam
|
| ︙ | |||
105 106 107 108 109 110 111 | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | - + + |
staffsep: 46,
stemheight: 21, // one octave
stretchlast: .25,
stretchstaff: true,
subtitlefont: {name: txt_ff, size: 16},
subtitlespace: 3,
sysstaffsep: 34,
|
| ︙ | |||
152 153 154 155 156 157 158 | 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | - + | measrepnb: true, rbmax: true, rbmin: true, shiftunison: true, slurheight: true, squarebreve: true, staffsep: true, |
| ︙ | |||
386 387 388 389 390 391 392 | 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 | - - + + - + - + + - + + + | case "px": // screen pixel in 1/96 inch case "": return v[1] } return NaN } |
| ︙ | |||
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 | + + + + + + + + + |
case "infoline":
case "measurenb":
case "rbmax":
case "rbmin":
case "measrepnb":
case "shiftunison":
case "systnames":
case "systvoices":
v = parseInt(param)
if (isNaN(v)) {
syntax(1, "Bad integer value");
break
}
if (cmd == "systnames") { // compatibility
switch (v) {
case -1: v = 3; break
case 1: v = 2; break
case 2: v = 1; break
}
cmd = "systvoices"
}
cfmt[cmd] = v
break
case "abc-version":
case "bgcolor":
case "fgcolor":
case "propagate-accidentals":
|
| ︙ | |||
593 594 595 596 597 598 599 | 607 608 609 610 611 612 613 614 615 616 617 618 619 620 | - | case "decoerr": case "flatbeams": case "graceslurs": case "graceword": case "hyphencont": case "keywarn": case "linewarn": |
| ︙ | |||
640 641 642 643 644 645 646 | 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 | - + | case "sysstaffsep": case "textspace": case "titlespace": case "topspace": case "vocalspace": case "wordsspace": f = get_unit(param) // normally, unit in points - 72 DPI accepted |
| ︙ | |||
721 722 723 724 725 726 727 | 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 | + - + | v[3] = f if (curvoice) curvoice.tup = v else cfmt[cmd] = v break case "infoname": case "partname": |
| ︙ | |||
817 818 819 820 821 822 823 824 825 826 | 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 | + - + - + | cfmt.rightmargin = v; img.chg = true break case "textoption": cfmt[cmd] = get_textopt(param) break case "dynalign": case "quiet": case "singleline": case "stretchlast": case "titletrim": |
| ︙ | |||
908 909 910 911 912 913 914 | 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 | - + + + + + + + |
if (font.fid == undefined) { // if default font
font.fid = abc2svg.font_tb.length
abc2svg.font_tb.push(font)
if (!font.swfac)
set_font_fac(font)
if (!font.pad)
font.pad = 0
|
| ︙ | |||
951 952 953 954 955 956 957 | 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 | - + - |
if (font.name)
font2.name = font.name
if (font.normal) {
if (font2.weight) // !! don't use delete !!
font2.weight = null
if (font2.style)
font2.style = null
|
| ︙ |
Changes to core/front.js.
| ︙ | |||
213 214 215 216 217 218 219 220 221 222 223 224 225 226 | 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | + | syntax(1, "Cannot read file '$1'", fn) return } include++; parse_sav = clone(parse); tosvg(fn, file); parse_sav.state = parse.state; parse_sav.ckey = parse.ckey parse = parse_sav; include-- } // parse ABC code function tosvg(in_fname, // file name file, // file content |
| ︙ | |||
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
src = src.replace(/([^\\])%.*/, '$1')
.replace(/\\%/g, '%');
src = src.replace(/\s+$/, '')
if (flag && src.indexOf('\\') >= 0)
return cnv_escape(src, flag)
return src
} // uncomment()
// set the sequence showing the source and save it in sav.src
function set_src(stag, se) {
var r, t,
etag = ""
if (!se)
se = file.indexOf('\n\n', bol) // end of tune
if (se < 0)
se = eof
if (typeof stag != "object") { // set the tag after source
if (stag[0] != 'b' && stag[0] != 'a' && stag[0] != '+'
&& stag[0] != '*')
stag = 'b' + stag // default: source before
if (stag[1] != '<') // (if bool)
stag = stag[0] + "<pre>"
r = stag.match(/<\/?[^>]*>/g)
while (1) {
t = r.pop()
if (!t)
break
if (t[1] == '/' || t.slice(-2) == '/>')
r.pop() // skip this stop/start tag
else
etag += '</' + t.slice(1)
}
cfmt.show_source = stag = [stag, etag]
}
t = stag[0].slice(1)
+ clean_txt(file.slice(bol, se))
+ stag[1]
if (stag[0][0] == '+' && sav.src)
sav.src += t
else
sav.src = t
} // set_src()
function end_tune() {
parse.bol = bol // (for multi V:)
generate()
cfmt = sav.cfmt;
info = sav.info;
char_tb = sav.char_tb;
glovar = sav.glovar;
maps = sav.maps;
mac = sav.mac;
maci = sav.maci;
parse.tune_v_opts = null;
parse.scores = null;
parse.ufmt = false
delete parse.pq
init_tune()
img.chg = true;
set_page();
if (cfmt.show_source) {
user.img_out("</div>")
if (cfmt.show_source[0][0] == 'a')
user.img_out(sav.src)
}
} // end_tune()
// get %%voice
function do_voice(select, in_tune) {
var opt, bol
if (select == "end")
return // end of previous %%voice
|
| ︙ | |||
496 497 498 499 500 501 502 503 504 505 506 507 | 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 | + + + + + + + + + + + + + + + + + + - + |
.replace(/^%%/gm,''))
parse.eol = file.indexOf('\n', i + 6)
if (parse.eol < 0)
parse.eol = eof
continue
}
switch (a[1]) {
case "show_source":
b = uncomment(a[2])
switch (b[0]) {
case '*':
i = file.indexOf('\n' + line0 + line1
+ "show_source", eol)
bol = parse.eol
set_src(b, i)
user.img_out(sav.src)
// fall thru
case '0':
b = ""
// fall thru
default:
cfmt[a[1]] = b
// fall thru
}
continue
case "select":
if (parse.state != 0) {
syntax(1, errs.not_in_tune, "%%select")
continue
}
|
| ︙ | |||
639 640 641 642 643 644 645 646 647 | 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 | + + + + + + + - - - |
sav.cfmt = clone(cfmt);
sav.info = clone(info, 2) // (level 2 for info.V[])
sav.char_tb = clone(char_tb);
sav.glovar = clone(glovar);
sav.maps = clone(maps, 1);
sav.mac = clone(mac);
sav.maci = clone(maci);
if (cfmt.show_source) {
bol -= 2
set_src(cfmt.show_source)
if (cfmt.show_source[0][0] == 'b')
user.img_out(sav.src)
user.img_out('<div class="source">')
}
info.X = text;
parse.state = 1 // tune header
|
| ︙ | |||
745 746 747 748 749 750 751 752 753 754 | 810 811 812 813 814 815 816 817 818 819 820 821 822 823 | + + + + |
return
if (parse.state == 1) {
syntax(1, "End of file in tune header")
get_key("C")
}
if (parse.state >= 2)
end_tune();
if (sav.src && cfmt.show_source[0] == '+') {
user.img_out(sav.src) // source of all tunes
sav.src = null
}
parse.state = 0
}
Abc.prototype.tosvg = tosvg
|
Changes to core/lyrics.js.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | // abc2svg - lyrics.js - lyrics // |
| ︙ | |||
117 118 119 120 121 122 123 | 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | - - + + + + + + + + | s = s.next; i++ } curvoice.sym_cont = s } /* -- parse a lyric (vocal) line (w:) -- */ |
| ︙ | |||
157 158 159 160 161 162 163 | 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | - |
if (!s) {
syntax(1, "w: without music")
return
}
}
/* scan the lyric line */
|
| ︙ | |||
355 356 357 358 359 360 361 | 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | - + |
if (s3.wl < wl) {
s3.shrink += wl - s3.wl
s3.wl = wl
}
// if not room enough, shift the following notes to the right
dx -= 6
|
| ︙ |
Changes to core/modules.js.
| ︙ | |||
49 50 51 52 53 54 55 56 57 58 59 60 61 62 | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | + |
pedline: {},
percmap: { fn: 'perc' },
roman: {},
soloffs: {},
sth: {},
strtab: {},
temperament: { fn: 'temper' },
temponame: { fn: 'tempo' },
tropt: {},
nreq: 0,
// scan the file and find the required modules
// @file: ABC file
// @relay: (optional) callback function for continuing the treatment
|
| ︙ | |||
82 83 84 85 86 87 88 | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | - + | if (--abc2svg.modules.nreq == 0) abc2svg.modules.cbf() } // test if some keyword in the file var m, i, fn, nreq_i = this.nreq, |
| ︙ |
Changes to core/music.js.
| ︙ | |||
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | + + + + - - - - |
5, // OVAL
6, // OVALBARS
7 // SQUARE
])
// get head type, dots, flags of note/rest for a duration
function identify_note(s, dur_o) {
var r = abc2svg.hdn[dur_o]
if (r) // in cache?
return r
var head, flags,
dots = 0,
dur = dur_o
if (dur % 12 != 0)
error(1, s, "Invalid note duration $1", dur);
dur /= 12 /* see C.BLEN for values */
if (!dur)
error(1, s, "Note too short")
for (flags = 5; dur; dur >>= 1, flags--) {
if (dur & 1)
break
}
dur >>= 1
|
| ︙ | |||
105 106 107 108 109 110 111 | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | + - + + | case -2: head = C.OVAL break case -1: head = C.EMPTY break } abc2svg.hdn[dur_o] = |
| ︙ | |||
863 864 865 866 867 868 869 870 871 872 873 874 875 876 | 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 | + + + | w += 1 // fall thru case ":": w += 2 break } } if (bar_type[0] == ":" // if "c3 :|" && s.prev && s.prev.dots) w += 4 break } s.wl = w if (s.next && s.next.type != C.METER) s.wr = 7 else |
| ︙ | |||
899 900 901 902 903 904 905 | 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 | + - - + + - |
s.wl = deco_width(s, s.wl)
/* have room for the repeat numbers / chord indication */
if (s.text && s.text.length < 4
&& s.next && s.next.a_gch) {
set_font("repeat");
s.wr += strwh(s.text)[0] + 2
}
|
| ︙ | |||
981 982 983 984 985 986 987 | 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 | - + - + - - + + + + + + - + + + + - + |
wlw = 0
for (i = 0; i < s.a_meter.length; i++) {
meter = s.a_meter[i]
switch (meter.top[0]) {
case 'C':
case 'c':
case 'o':
|
| ︙ | |||
1261 1262 1263 1264 1265 1266 1267 | 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 | - + + | sn = s.ts_next // start of next line b.wl = 0 b.wr = 0 b.ts_prev = s b.next = s.next b.ts_next = s.ts_next |
| ︙ | |||
1304 1305 1306 1307 1308 1309 1310 | 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 | - + - + + - + + |
if (s.prev && s.prev.st != st) {
xl[st] = xl[s.prev.st]
wr[st] = wr[s.prev.st]
}
val = xl[st] + wr[st] + s.wl
if (val > maxx)
maxx = val
|
| ︙ | |||
1362 1363 1364 1365 1366 1367 1368 | 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 | - + | } if (stup) set_sp_tup(stup, s2) // let the chord symbols at the same offset // and adjust the spacing due to the lyrics |
| ︙ | |||
1817 1818 1819 1820 1821 1822 1823 | 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 | - + - + |
function do_warn(s) { // start of next line
var s1, s2, s3, s4, w
// advance in the next line
for (s2 = s; s2 && s2.time == s.time; s2 = s2.ts_next) {
switch (s2.type) {
case C.KEY:
|
| ︙ | |||
2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 | 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
next, /* symbol of the next line / null */
lwidth, /* w - (clef & key sig) */
indent) { /* for start of tune */
var first, s2, s3, s4, s5, x, xmin, xmid, xmax, wwidth, shrink, space,
nlines,
last = next ? next.ts_prev : null,
ws = get_width(s, next) // 2 widths: nice and shrunk
// split a big lyric word on two music lines
function ly_split(s, wmax) {
var i, wh,
s2 = clone(s),
p = s.a_ly[0].t, // lyric word
w = 0,
j = 0
gene.deffont = s.a_ly[0].font
while (1) {
i = p.indexOf(' ', j) + 1
if (i <= 0)
break
wh = strwh(p.slice(j, i))
w += wh[0]
if (w > wmax)
break
j = i
}
s.a_ly[0].t = new String(p.slice(0, j - 1))
s2.a_ly = clone(s.a_ly)
s2.a_ly[0] = clone(s.a_ly[0])
s2.a_ly[0].t = new String(p.slice(j))
if (abc2svg.el) {
strwh(s.a_ly[0].t)
strwh(s2.a_ly[0].t)
} else {
s.a_ly[0].t.wh = strwh(s.a_ly[0].t)
s2.a_ly[0].t.wh = strwh(s2.a_ly[0].t)
}
w = s.a_ly[0].t.wh[0] // new length of the words
s.wr = wmax
s2.wr -= w
lkvsym(s2, s2.next) // voice linkage
s2.time += .1
// s2.dur -= .1
s2.nl = 0 //false
while (!s.seqst)
s = s.ts_prev
s2.x = s.x + w
s2.shrink = w - s2.wl
s = s2.ts_next
while (s) {
if (s.seqst) {
s.wl -= w
s.shrink -= w
break
}
s = s.ts_next
}
lktsym(s2, s2.ts_next) // time linkage
} // ly_split()
// -- set_lines --
// take care of big key signatures at end of line
if (s.fmt.keywarn && next
&& next.type == C.KEY && !last.dur) {
ws[0] += next.wr
ws[1] += next.wr
}
|
| ︙ | |||
2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 | 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 | + + + + + + + + + + + |
s4 = s // keep first symbol with x greater than xmin
//fixme: can this occur?
if (s == next) {
if (s)
s = set_nl(s)
return s
}
// if the width of the symbol is greater than
// the remaining width in the staff
// and if there are lyrics, split these lyrics on 2 staves
if (s.x > xmax
&& s.prev.a_ly) {
s3 = s = s.prev
while (!s3.seqst)
s3 = s3.ts_prev
ly_split(s, xmax - s3.x)
} else {
/* try to cut on a measure bar */
s3 = null
for ( ; s != next; s = s.ts_next) {
x = s.x
if (!x)
continue
|
| ︙ | |||
2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 | 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 | + |
s3 = s
break
}
s3 = s
}
}
s = s3
} // ly_split call
while (s.ts_next) {
s = s.ts_next
if (s.seqst)
break
}
if (s.nl) { /* already set here - advance */
|
| ︙ | |||
2179 2180 2181 2182 2183 2184 2185 | 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 | - + - - + + |
var s2, i, mc,
pg_sav = { // save the page parameters
leftmargin: cfmt.leftmargin,
rightmargin: cfmt.rightmargin,
pagewidth: cfmt.pagewidth,
scale: cfmt.scale
},
|
| ︙ | |||
2566 2567 2568 2569 2570 2571 2572 | 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 | - - + + |
}
} // mrest_expand()
// set the clefs (treble or bass) in a 'auto clef' sequence
// return the starting clef type
function set_auto_clef(st, s_start, clef_type_start) {
var s, time, s2, s3,
|
| ︙ | |||
3143 3144 3145 3146 3147 3148 3149 | 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 | + + + + - + + + + + + + | || (s.a_gch && s.ts_next.a_gch) || s.invis) break if (s.ts_next.a_dd) s.a_dd = s.ts_next.a_dd if (s.ts_next.a_gch) s.a_gch = s.ts_next.a_gch if (s.p_v.scale != 1 && s.ts_next.p_v.scale > s.p_v.scale) unlksym(s) else |
| ︙ | |||
3283 3284 3285 3286 3287 3288 3289 | 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 | - - - + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + - - - + | } v_s.s = s v_s.st = s.st v_s.end_time = s.time + s.dur if (s.fmr) // if full meeasure rest v_s.end_time -= s.p_v.wmeasure * .3 |
| ︙ | |||
3842 3843 3844 3845 3846 3847 3848 | 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 | - + - + - | // set the clefs and adjust the pitches of all symbol set_clefs(); self.set_pitch(null) } // get the left offsets of the first and other staff systems |
| ︙ | |||
3879 3880 3881 3882 3883 3884 3885 | 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 | - - - + + + - - - + + + + - - - + + + - + + - - + + - + - + |
p1 = p_v.nm
po = p_v.snm
if ((p1 || po) && !fnt) {
set_font("voice")
fnt = gene.deffont
}
if (p1) {
|
| ︙ | |||
4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 | 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 | + + |
for (i1 = i11; i1 < i12; i1++) {
s1.notes[i1].invis = true
delete s1.notes[i1].acc
}
for (i1 = 0; i1 <= s1.nhd; i1++)
s1.notes[i1].shhd += sh2
}
if (s1.dots == s2.dots) // let the dots in one voice
s2.dots = 0
return true
}
/* handle unison with different accidentals */
function unison_acc(s1, s2, i1, i2) {
var m, d, acc
|
| ︙ | |||
4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 | 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 | + + + + |
for (s = tsfirst; s; s = s.ts_next) {
if (s.type != C.NOTE
|| s.invis) {
if (s.type == C.STAVES)
sy = s.sy
continue
}
// set the dot vertical offset of secondary voices
if (s.second)
s.dot_low = 1 //true
/* treat the stem on two staves with different directions */
if (s.xstem
&& s.ts_prev.stem < 0) {
for (m = 0; m <= s.nhd; m++) {
s.notes[m].shhd -= 7; // stem_xoff
s.notes[m].shac += 16
|
| ︙ | |||
4364 4365 4366 4367 4368 4369 4370 | 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 | - - - - - - | && s2.st == s.st) break } if (!s2) continue s1 = s |
| ︙ | |||
4507 4508 4509 4510 4511 4512 4513 | 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 | - - - + + + - - - |
if (t < 0) { /* unison and different accidentals */
unison_acc(s1, s2, i1, i2)
continue
}
sd = 0;
if (s1.dots) {
|
| ︙ | |||
4632 4633 4634 4635 4636 4637 4638 | 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 | - - + + |
g.ys = ymx + slen;
ymx = Math.round(g.ys)
} else {
g.y = ymx;
g.ys = ymn - slen;
ymn = Math.round(g.ys)
}
|
| ︙ | |||
4680 4681 4682 4683 4684 4685 4686 | 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 | - + + + + + + + + + + + + + + |
if (s2.nflags > nflags)
nflags = s2.nflags
}
/* set height of stem end */
slen = s.fmt.stemheight
switch (nflags) {
|
| ︙ | |||
4883 4884 4885 4886 4887 4888 4889 | 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 | - + |
}
}
}
} // set_brace()
// set the top and bottom of the staves
function set_top_bot() {
|
| ︙ | |||
4905 4906 4907 4908 4909 4910 4911 | 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 | - + - - - - - - - - - - - - - - - - - |
switch (p_staff.stafflines[i]) {
case '.':
case '-':
continue
}
break
}
|
| ︙ | |||
5098 5099 5100 5101 5102 5103 5104 | 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 | - + |
if (s.seqst) {
xmin += s.shrink
if (xmin > width) {
error(1, s, "Line too much shrunk $1 $2 $3",
xmin.toFixed(1),
xx.toFixed(1),
width.toFixed(1))
|
| ︙ | |||
5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 | 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 | + + |
if (xx == xse) // if no space
xx += 10
spf = (width - xs - xse) / (xx - xse)
} else {
spf = spf_last
if (ll && spf < s.fmt.stretchlast)
spf = s.fmt.stretchlast
else if (spf < 1 - cfmt.maxshrink)
spf = 1 - cfmt.maxshrink
if (spf > (width - xs) / xx)
spf = (width - xs) / xx
}
while (--cnt >= 0) {
xx = 0;
xse = 0;
x = 0
|
| ︙ | |||
5270 5271 5272 5273 5274 5275 5276 | 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 | - + |
}
tsfirst = null /* no more notes */
}
/* -- generate the music -- */
// (possible hook)
Abc.prototype.output_music = function() {
|
| ︙ | |||
5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 | 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 | + |
}
// save symbol pointers for play
ts1st = tsfirst
v = nv
while (--v >= 0)
voice_tb[v].osym = voice_tb[v].sym
meter1 = ts1st.p_v.meter
spf_last = .65 // last spacing factor
while (1) { /* loop per music line */
set_piece();
indent = set_indent(lsh)
if (!line_height
&& cfmt.indent
|
| ︙ | |||
5376 5377 5378 5379 5380 5381 5382 5383 | 5472 5473 5474 5475 5476 5477 5478 5479 5480 | + |
v = nv
while (--v >= 0) {
p_v = voice_tb[v]
if (p_v.sym && p_v.s_prev)
p_v.sym.prev = p_v.s_prev
p_v.sym = p_v.osym
}
ts1st.p_v.meter = meter1
}
|
Changes to core/parse.js.
| ︙ | |||
306 307 308 309 310 311 312 | 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | - + - - + - - - - - |
char_tb[k] = v
}
// get a stafflines value
function get_st_lines(param) {
if (!param)
return
|
| ︙ | |||
506 507 508 509 510 511 512 | 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 | - + + + - + - - + | case "snm=": curvoice.snm = a.shift() if (curvoice.snm[0] == '"') curvoice.snm = curvoice.snm.slice(1, -1); break case "stafflines=": val = get_st_lines(a.shift()) |
| ︙ | |||
772 773 774 775 776 777 778 | 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 | - - + + |
s.k_sf = sf;
// set the map of the notes with accidentals
s.k_map = s.k_bagpipe && !sf
? abc2svg.keys[9] // implicit F# and C#
: abc2svg.keys[sf + 7]
if (s.k_a_acc) {
|
| ︙ | |||
904 905 906 907 908 909 910 | 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 | - + |
if (p[i] != ' ' && p[i] != '+')
break
if (i >= p.length
|| p[i + 1] == '(') /* "M:5 (2/4+3/4)" */
break
meter.top += p[i++]
}
|
| ︙ | |||
1749 1750 1751 1752 1753 1754 1755 | 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 | + - + - + - + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - |
// return the mapping of a note
//
// The global 'maps' object is indexed by the map name.
// Its content is an object ('map') indexed from the map type:
// - normal = ABC note
// - octave = 'o' + ABC note in C..B interval
// - key = 'k' + scale index
// - tonic = 't' + mode index
|
| ︙ | |||
1999 2000 2001 2002 2003 2004 2005 | 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 | - - + + + |
error(1, tie_s, "Bad tie")
else
s.ti2 = true
} // do_ties()
// (possible hook)
Abc.prototype.new_note = function(grace, sls) {
|
| ︙ | |||
2050 2051 2052 2053 2054 2055 2056 | 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 | - - - - - - - |
s.nmes = (c > '0' && c <= '9') ? line.get_int() : 1;
if (curvoice.wmeasure == 1) {
error(1, s, "multi-measure rest, but no measure!")
return
}
s.dur = curvoice.wmeasure * s.nmes
|
| ︙ | |||
2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 | 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 | + + + + + + + + + + + |
pit: 18,
dur: s.dur_orig
}]
break
case '[': // chord
in_chord = true;
c = line.next_char()
i = line.buffer.indexOf(']', line.index)
if (i < 0) {
syntax(1, "No end of chord")
return
}
n = line.index // save the parser index
line.index = i + 1 // set the parser to the end of chord
nd = parse_dur(line)
chdur = nd[0] / nd[1] // length factor of the chord
in_chord = reg_dur.lastIndex // hack: index after the chord length
line.index = n // restore the parser index
// fall thru
default: // accidental, chord, note
if (curvoice.acc_tie) {
acc_tie = curvoice.acc_tie
curvoice.acc_tie = null
}
s.notes = []
|
| ︙ | |||
2129 2130 2131 2132 2133 2134 2135 | 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 | - - + + - - + + + - + + - + - - + - - + + + |
if (!c)
break
i = c.charCodeAt(0);
if (i >= 128) {
syntax(1, errs.not_ascii)
return //null
}
|
| ︙ | |||
2236 2237 2238 2239 2240 2241 2242 | 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 | - - - - |
curvoice.sls.push({
ty: i,
ss: s,
nts: note // starting note
})
}
}
|
| ︙ | |||
2282 2283 2284 2285 2286 2287 2288 2289 | 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 | + + + + + - + - - - - - - - |
continue
}
syntax(1, "Misplaced dot")
break
}
break
}
if (a_dcn.length) {
s.time = curvoice.time // (needed for !tie)!
dh_cnv(s, note)
}
if (c == ']') {
|
| ︙ | |||
2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 | 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 | + + + + + + + + + + + |
}
if (s.grace && s.type != C.NOTE) {
syntax(1, errs.bad_grace)
return //null
}
if (s.notes) { // if note or rest
if (!s.fmr) { // (but not full measure rest)
n = s.dur_orig / 12 // check its duration
i = 0
while (!(n & 1)) {
n >>= 1
i++
}
if ((n + 1) & n)
error(0, s, "Non standard note duration $1",
n + '/' + (1 << (6 - i)))
}
if (!grace) {
switch (curvoice.pos.stm & 0x07) {
case C.SL_ABOVE: s.stem = 1; break
case C.SL_BELOW: s.stem = -1; break
case C.SL_HIDDEN: s.stemless = true; break
}
|
| ︙ |
Changes to core/subs.js.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | - + - - + + - - + + - - - + - - - - - - - - + + + + - + | // abc2svg - subs.js - text output // |
| ︙ | |||
116 117 118 119 120 121 122 123 124 125 126 127 | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | + + + + + + + + + + + + - + + - - - - - - - - - - - + - + + + - - + - - - - - - - - + + - |
}
return (font || gene.curfont).cw_tb[i]
}
// return the character width with the current font
function cwidf(c) {
return cwid(c) * gene.curfont.swfac
}
// make XML clean
function clean_txt(p) {
return p.replace(/<|>|&[^&\s]*?;|&/g, function(c) {
switch (c) {
case '<': return "<"
case '>': return ">"
case '&': return "&"
}
return c // &xxx;
})
} // clean_txt()
// estimate the width and height of a string ..
var strwh
(function() {
|
| ︙ | |||
301 302 303 304 305 306 307 | 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | - + | return c // &xxx; }) if (c_font != o_font) o += "</tspan>" // convert to String and memorize the string width and height o = new String(o) |
| ︙ | |||
336 337 338 339 340 341 342 | 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | - + |
function xy_str(x, y,
str, // string or object String with attribute 'wh'
action, // default: align left
w, // needed for justify
wh) { // optional [width, height]
if (!wh)
wh = str.wh || strwh(str)
|
| ︙ | |||
524 525 526 527 528 529 530 | 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 | - + + |
for (j = 0; j < words.length; j++) {
ww = strwh(words[j] + ' ') //
w += ww[0]
if (w >= strlw) {
vskip(wh * cfmt.lineskipfac)
xy_str(0, ww[1] * .2,
words.slice(k, j).join(' '),
|
| ︙ | |||
591 592 593 594 595 596 597 | 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 | - - - - + + + + + + | var y = gene.curfont.size * .22 // descent if (k != 0) xy_str(x, y, p.slice(0, k), 'r') if (i < p.length) xy_str(x + 5, y, p.slice(i), 'l') } // put_wline() |
| ︙ | |||
731 732 733 734 735 736 737 | 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 | - + |
P: "parts",
Q: "tempo",
R: "info",
T: "title",
X: "title"
}
function write_headform(lwidth) {
|
| ︙ | |||
878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 | 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 | + - + - + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + |
font = get_font(font_name);
sz = font.size * 1.1
if (info_sz[c])
sz += info_sz[c];
set_font(font);
x = xa[align];
y = ya[align] + sz
yd = y - font.size * .22 // descent
if (c == 'Q') { /* special case for tempo */
self.set_width(glovar.tempo)
if (!glovar.tempo.invis) {
if (align != 'l') {
tempo_build(glovar.tempo)
w = glovar.tempo.tempo_wh[0]
if (align == 'c')
w *= .5;
x -= w
}
writempo(glovar.tempo, x, -y)
}
} else if (str) {
if (c == 'T')
str = trim_title(str,
info_font.T[0] == 's')
|
| ︙ | |||
1032 1033 1034 1035 1036 1037 1038 | 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 | + + + - + |
&& cfmt.writefields.indexOf('P') >= 0) {
set_font("parts");
i = cfmt.partsspace + gene.curfont.size + gene.curfont.pad
if (down1 + i > down2)
down2 = down1 + i
else
down2 += i
p = info.P
if (cfmt.partname)
p = new_part()
|
Changes to core/svg.js.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | // abc2svg - svg.js - svg functions // |
| ︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | + + + + - + - - + + + |
var output = "", // output buffer
style = '\
\n.stroke{stroke:currentColor;fill:none}\
\n.bW{stroke:currentColor;fill:none;stroke-width:1}\
\n.bthW{stroke:currentColor;fill:none;stroke-width:3}\
\n.slW{stroke:currentColor;fill:none;stroke-width:.7}\
\n.slthW{stroke:currentColor;fill:none;stroke-width:1.5}\
\n.sltnW{stroke:currentColor;fill:none;stroke-width:.25}\
\n.sldW{stroke:currentColor;fill:none;stroke-width:.7;stroke-dasharray:5,10}\
\n.sW{stroke:currentColor;fill:none;stroke-width:.7}\
\n.box{outline:1px solid black;outline-offset:1px}',
font_style = '',
posx = cfmt.leftmargin / cfmt.scale, // default x offset of the images
posy = 0, // y offset in the block
img = { // image
width: cfmt.pagewidth, // width
lm: cfmt.leftmargin, // left and right margins
rm: cfmt.rightmargin,
wx: 0, // used width between the left and right margins
chg: 1 //true
},
defined_glyph = {},
defs = '',
fulldefs = '', // unreferenced defs as <filter>
stv_g = { /* staff/voice graphic parameters */
scale: 1,
stsc: 1, // staff scale
vsc: 1, // voice scale
dy: 0,
st: -1,
v: -1,
g: 0
// color: undefined
},
blkdiv = 0 // block of contiguous SVGs
// -1: block started
// 0: no block
// 1: start a block
// 2: start a new page
// glyphs in music font
var tgls = {
"mtr ": {x:0, y:0, c:"\u0020"}, // space
brace: {x:0, y:0, c:"\ue000"},
lphr: {x:0, y:23, c:"\ue030"},
mphr: {x:0, y:23, c:"\ue038"},
|
| ︙ | |||
166 167 168 169 170 171 172 | 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | - + |
sfz: {x:-10, y:0, c:"\ue539"},
trl: {x:-5, y:-2, c:"\ue566"}, // trill
turn: {x:-5, y:0, c:"\ue567"},
turnx: {x:-5, y:0, c:"\ue569"},
umrd: {x:-6, y:2, c:"\ue56c"},
lmrd: {x:-6, y:2, c:"\ue56d"},
dplus: {x:-3, y:0, c:"\ue582"}, // plus
|
| ︙ | |||
326 327 328 329 330 331 332 | 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | - + - + + + - + + - + + - + - - - - - - - + + - + + - + |
}
/* -- set the staff scale (only) -- */
function set_sscale(st) {
var new_scale, dy
if (st != stv_g.st && stv_g.scale != 1)
|
| ︙ | |||
527 528 529 530 531 532 533 | 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 | - + |
Abc.prototype.sx = sx
function sy(y) {
if (stv_g.g)
return -y
if (stv_g.scale == 1)
return posy - y
if (stv_g.v >= 0)
|
| ︙ | |||
680 681 682 683 684 685 686 | 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 | - + |
x, y, tgl.sc, tgl.c);
} else {
// out_XYAB('<text x="X" y="Y">A</text>\n', x, y, tgl.c)
gla[0].push(sx(x))
gla[1].push(sy(y))
gla[2] += tgl.c
}
|
| ︙ | |||
909 910 911 912 913 914 915 | 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 | - + |
function out_deco_str(x, y, de) {
var name = de.dd.glyph // class
if (name == 'fng') {
out_XYAB('\
<text x="X" y="Y" style="font-size:14px">A</text>\n',
|
| ︙ | |||
1188 1189 1190 1191 1192 1193 1194 | 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 | - - + + | } } de1.x -= 8 // (there is no note width) } deco_l_tb[name](x, y, de) } |
| ︙ | |||
1214 1215 1216 1217 1218 1219 1220 | 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 | - - - + + + + + + + + | break default: p = "\ueca5" break } break } |
| ︙ | |||
1240 1241 1242 1243 1244 1245 1246 | 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 | - + - - - - - - - - + - - - - - - - |
if (s.tempo_str1) {
str.push(s.tempo_str1)
w += strwh(s.tempo_str1)[0]
}
if (s.tempo_notes) {
dy = ' dy="-1"' // notes a bit higher
for (i = 0; i < s.tempo_notes.length; i++) {
|
| ︙ | |||
1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 | 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 | + + + + + + + + + + + + + + - + + + - - - + + + + - - - + - - - |
s.invis = true
} // writempo()
// update the vertical offset
function vskip(h) {
posy += h
}
// clear the styles
function clr_sty() {
font_style = ''
if (cfmt.fullsvg) {
defined_glyph = {}
for (var i = 0; i < abc2svg.font_tb.length; i++)
abc2svg.font_tb[i].used = 0 //false
ff.used = 0 //false // clear the font-face
} else {
style =
fulldefs = ''
}
} // clr_sty()
// create the SVG image of the block
function svg_flush() {
|
| ︙ | |||
1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 | 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 | + + + + + + + - + - - - - - - - - - + |
g = '</g>\n'
}
if (psvg) // if PostScript support
psvg.ps_flush(true); // + setg(0)
// start a block if needed
if (parse.state == 1 && user.page_format && !blkdiv)
blkdiv = 1 // new tune
if (blkdiv > 0) {
user.img_out(blkdiv == 1 ?
'<div class="nobrk">' :
'<div class="nobrk newpage">')
blkdiv = -1 // block started
} else if (blkdiv < 0 && cfmt.splittune) {
i = 1 // header and first music line
blkdiv = 0
}
user.img_out(head + output + g + "</svg>");
if (i)
user.img_out("</div>")
output = ""
|
Changes to core/tail.js.
| ︙ | |||
22 23 24 25 26 27 28 29 30 31 32 33 34 35 | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | + |
// Abc functions used by the modules
Abc.prototype.a_de = function() { return a_de }
Abc.prototype.add_style = function(s) { style += s };
Abc.prototype.anno_a = anno_a
Abc.prototype.cfmt = function() { return cfmt };
Abc.prototype.clone = clone;
Abc.prototype.clr_sty = clr_sty
Abc.prototype.deco_put = function(nm, s) {
a_dcn.push(nm)
deco_cnv(s)
}
Abc.prototype.defs_add = defs_add
Abc.prototype.dh_put = function(nm, s, nt) {
a_dcn.push(nm)
|
| ︙ | |||
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | + + |
Abc.prototype.out_deco_val = out_deco_val;
Abc.prototype.out_ltr = out_ltr;
Abc.prototype.param_set_font = param_set_font;
Abc.prototype.parse = parse;
Abc.prototype.psdeco = empty_function;
Abc.prototype.psxygl = empty_function;
Abc.prototype.set_cur_sy = function(sy) { cur_sy = sy };
Abc.prototype.set_curvoice = function(p_v) { curvoice = p_v }
Abc.prototype.set_dscale = set_dscale;
Abc.prototype.set_font = set_font;
Abc.prototype.set_a_gch = function(s, a) { a_gch = a; csan_add(s) }
Abc.prototype.set_hl = set_hl
Abc.prototype.set_map = set_map
Abc.prototype.set_page = set_page
Abc.prototype.set_pagef = function() { blkdiv = 1 }
Abc.prototype.set_realwidth = function(v) { realwidth = v }
Abc.prototype.set_scale = set_scale;
Abc.prototype.set_sscale = set_sscale
Abc.prototype.set_tsfirst = function(s) { tsfirst = s };
Abc.prototype.set_v_param = set_v_param;
|
| ︙ |
Changes to core/tune.js.
| ︙ | |||
174 175 176 177 178 179 180 181 182 183 184 185 186 187 | 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | + |
}
// if the previous symbol is a grace note at the same offset as the bar
// remove the grace notes from the previous time sequence
if (!fl) {
while (prev.type == C.GRACE
&& vtb[prev.v] && !vtb[prev.v].bar_type) {
delete prev.seqst
vtb[prev.v] = prev
prev = prev.ts_prev
fl = 1 //true
}
}
if (v == undefined)
|
| ︙ | |||
430 431 432 433 434 435 436 | 431 432 433 434 435 436 437 438 439 440 441 442 443 444 | - - - - - - - - - - | s.st = s2.st break } } } } // ins_pq() |
| ︙ | |||
568 569 570 571 572 573 574 | 559 560 561 562 563 564 565 566 567 568 569 570 571 572 | - - - | } break } continue case C.NOTE: if (s.feathered_beam) set_feathered_beam(s) |
| ︙ | |||
760 761 762 763 764 765 766 | 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 | - + - + |
}
// convert a note to ABC
function not2abc(pit, acc) {
var i,
nn = ''
|
| ︙ | |||
797 798 799 800 801 802 803 | 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 | - - + - - - + + + - + - - - |
a = text.split(/\s+/)
if (a.length < 3) {
syntax(1, errs.not_enough_p)
return
}
ns = a[1]
|
| ︙ | |||
1281 1282 1283 1284 1285 1286 1287 | 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 | - + + + + + + + + + + + |
break
i = text.indexOf('>', i)
j = text.indexOf('</style>', i)
if (j < 0) {
syntax(1, "No </style> in %%beginsvg sequence")
break
}
|
| ︙ | |||
1497 1498 1499 1500 1501 1502 1503 | 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 | - + - - + + - + + + + + + + + + + + + + + + + - + - - + - - |
sym_link(s2)
curvoice = p_v_sav
} // fill_mr_ba()
/* -- get staves definition (%%staves / %%score) -- */
function get_staves(cmd, parm) {
|
| ︙ | |||
1589 1590 1591 1592 1593 1594 1595 | 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 | - |
p_voice.last_sym = s // set back the last symbol
}
}
range = 0
for (i = 0; i < a_vf.length; i++) {
vid = a_vf[i][0];
p_voice = new_voice(vid);
|
| ︙ | |||
1659 1660 1661 1662 1663 1664 1665 | 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 | - + |
if (flags & FL_VOICE) {
p_voice.floating = true;
p_voice.second = true
} else {
st++;
if (!par_sy.staves[st]) {
par_sy.staves[st] = {
|
| ︙ | |||
2058 2059 2060 2061 2062 2063 2064 | 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 | - + |
if (p_voice.id == id)
return p_voice // old voice
}
p_voice = {
v: v,
id: id,
|
| ︙ | |||
2130 2131 2132 2133 2134 2135 2136 | 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 | - + |
// treat V: with many voices
function do_cloning() {
var i,
clone = curvoice.clone,
vs = clone.vs,
a = clone.a,
bol = clone.bol,
|
| ︙ | |||
2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 | 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 | + + |
// change state from 'tune header' to 'in tune body'
// curvoice is defined when called from get_voice()
function goto_tune() {
var v, p_voice
set_page();
write_heading();
blk_flush() // tune heading in a specific SVG
if (glovar.new_nbar) {
gene.nbar = glovar.new_nbar // measure numbering
glovar.new_nbar = 0
} else {
gene.nbar = 1
}
|
| ︙ |
Changes to editor/edit.js.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | // edit.js - file used in the abc2svg editor // |
| ︙ | |||
41 42 43 44 45 46 47 48 49 50 51 52 53 54 | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | + |
abc, // Abc object
syms, // music symbol at source index
ctxMenu, // context menu for play
elt_ref = {}, // pointers to page HTML elements
selx = [0, 0], // selected source indexes
selx_sav = [], // (saved while playing/printing)
play = {}, // play data
tunes, // tune list, updated on rendering refresh
pop, // current popup message
texts = {}, // language specific texts
chg = 0, // > 0 when the textarea is modified
jsdir = document.currentScript ?
document.currentScript.src.match(/.*\//) :
(function() {
var s_a = document.getElementsByTagName('script')
|
| ︙ | |||
157 158 159 160 161 162 163 | 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | - + - - + - |
e.style.visibility = visible ? 'visible' : 'hidden';
pop = visible ? e : null
}
// load the (ABC source or include) file in the textarea
function loadtune() {
var files = document.getElementById("abcfile").files
|
| ︙ | |||
534 535 536 537 538 539 540 | 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | - + - |
// 1: Selection
// 2: Loop
// 3: Continue
function play_tune(what) {
if (!abc)
return // no generation yet
var i, si, ei, elt,
|
| ︙ | |||
657 658 659 660 661 662 663 | 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 | - + + - - + + - - | play.abcplay.play(si, ei, play.repv) } // play tune() ctxMenu.style.display = "none"; // remove the play menu play.playing = true; |
| ︙ | |||
695 696 697 698 699 700 701 | 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 | - - - - + + + + + + - - + + + + + + + |
si = get_se(selx[0]);
ei = null
} else if (what != 0 && selx[1]) { // if selection without start
si = gsot(selx[1])
ei = get_ee(selx[1])
} else { // no selection => tune
elt = play.click.svg // (dummy)
|
| ︙ | |||
866 867 868 869 870 871 872 873 874 875 876 877 878 879 | 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 | + + + + + + + + + + |
e = elt_ref.target
// e.onauxclick = show_menu // right or middle buttons (KO in Safari)
e.ondblclick = show_menu // double click
e.oncontextmenu = show_menu
}
set_pref() // set the preferences from local storage
// create a hidden span for string width computation
e = document.createElement("span")
e.style.position = "absolute"
e.style.top =
e.style.padding = 0
e.style.visibility = "hidden"
e.style.lineHeight = 1
document.body.appendChild(e)
abc2svg.el = e
}
// drag and drop
function drag_enter(evt) {
evt.stopImmediatePropagation();
evt.preventDefault() // allow drop
//fixme: "move" does not work
|
| ︙ |
Changes to font.js.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | - - - - - - - + + + + + + + - - - + + + - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - + + + + + + + + - - - + - - + - - - - - - + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + - - - - - - - - + + + + + + + + - + - - - - - - - + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + + + + + - - + - - - - + + - - + - - - - - + + + + + + + - - - + - - - - + + + + - - - - - - - + + + + + + + - - + + + - - + - - + + - - + - - - - - - - - - - - - - + + + + + + - - - - + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + - - - - - - + + + + + - - - + + - - + - - - - - - + + + + + + + + + - - - + + - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + - - + - - - + - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + |
// abc2svg music font
var musicfont = 'url("data:application/octet-stream;base64,\
|
Changes to font/abc2svg.sfd.
| ︙ | |||
16 17 18 19 20 21 22 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | - + | Layer: 1 0 "Fore" 0 XUID: [1021 296 1430826605 13506888] FSType: 0 OS2Version: 0 OS2_WeightWidthSlopeOnly: 0 OS2_UseTypoMetrics: 0 CreationTime: 1433498007 |
| ︙ | |||
46 47 48 49 50 51 52 | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | - + - + | LangName: 1033 Encoding: Custom UnicodeInterp: none NameList: Adobe Glyph List DisplaySize: -96 AntiAlias: 1 FitToEm: 1 |
| ︙ | |||
177 178 179 180 181 182 183 184 | 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | - - + + + + + + + + + + + + + + + + + | 22 320 0 342 0 370 c 7 0 398 22 420 50 420 c 7 78 420 100 398 100 370 c 7 100 342 78 320 50 320 c 7 EndSplineSet Validated: 1 EndChar |
| ︙ | |||
237 238 239 240 241 242 243 | 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | - + | 470 60 370 0 220 0 c 0 147 0 73 0 0 0 c 0 EndSplineSet Validated: 1 EndChar StartChar: uniE046 |
| ︙ | |||
288 289 290 291 292 293 294 | 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | - + | 470 60 370 0 220 0 c 0 147 0 73 0 0 0 c 0 EndSplineSet Validated: 1 EndChar StartChar: uniE047 |
| ︙ | |||
338 339 340 341 342 343 344 | 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 | - + | 328 5 299 2 271 2 c 0 203 2 167 51 167 91 c 0 EndSplineSet Validated: 1 EndChar StartChar: uniE048 |
| ︙ | |||
382 383 384 385 386 387 388 | 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 | - + | 373 629 309 565 304 374 c 1 452 374 l 1 EndSplineSet Validated: 1 EndChar StartChar: uniE050 |
| ︙ | |||
438 439 440 441 442 443 444 | 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 | - + | 387 -222 397 -221 408 -220 c 0 375 138 l 1 EndSplineSet Validated: 1 EndChar StartChar: uniE05C |
| ︙ | |||
504 505 506 507 508 509 510 | 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 | - + | 0 -514 l 1 0 510 l 1 EndSplineSet Validated: 1 EndChar StartChar: uniE062 |
| ︙ | |||
542 543 544 545 546 547 548 | 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 | - + | 681 174 702 153 702 127 c 0 702 94 682 72 655 72 c 0 EndSplineSet Validated: 1 EndChar StartChar: uniE069 |
| ︙ | |||
564 565 566 567 568 569 570 | 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 | - + | 0 -250 l 1 0 250 l 1 EndSplineSet Validated: 1 EndChar StartChar: uniE07A |
| ︙ | |||
624 625 626 627 628 629 630 | 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 | - + | 442 749 433 790 401 820 c 1 331 792 299 728 290 658 c 0 EndSplineSet Validated: 1 EndChar StartChar: uniE07B |
| ︙ | |||
690 691 692 693 694 695 696 | 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 | - + | 0 -411 l 1 0 408 l 1 EndSplineSet Validated: 1 EndChar StartChar: uniE07C |
| ︙ | |||
728 729 730 731 732 733 734 | 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 | - + | 545 139 562 123 562 102 c 0 562 76 546 58 524 58 c 0 EndSplineSet Validated: 1 EndChar StartChar: uniE07D |
| ︙ | |||
758 759 760 761 762 763 764 | 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 | - + | 169 110 180 90 180 70 c 0 180 27 140 0 90 0 c 0 EndSplineSet Validated: 1 EndChar StartChar: uniE07E |
| ︙ | |||
819 820 821 822 823 824 825 | 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 | - + - + | 79 -0 67 0 52 -0 c 0 38 0 25 0 9 0 c 0 EndSplineSet Validated: 1 EndChar StartChar: uniE080 |
| ︙ | |||
862 863 864 865 866 867 868 | 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 | - + | 115 100 l 29 0 0 l 25 EndSplineSet Validated: 1 EndChar StartChar: uniE082 |
| ︙ | |||
897 898 899 900 901 902 903 | 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 | - + | 28 25 0 60 0 128 c 0 0 213 102 250 199 250 c 0 EndSplineSet Validated: 1 EndChar StartChar: uniE083 |
| ︙ | |||
934 935 936 937 938 939 940 | 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 | - + | 252 177 223 213 175 213 c 0 131 213 109 193 102 170 c 1 EndSplineSet Validated: 1 EndChar StartChar: uniE084 |
| ︙ | |||
965 966 967 968 969 970 971 | 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 | - + | 325 -160 l 5 325 -209 l 5 EndSplineSet Validated: 1 EndChar StartChar: uniE085 |
| ︙ | |||
1000 1001 1002 1003 1004 1005 1006 | 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 | - + | 25 -217 0 -176 0 -152 c 0 0 -135 3 -113 18 -95 c 0 EndSplineSet Validated: 1 EndChar StartChar: uniE086 |
| ︙ | |||
1030 1031 1032 1033 1034 1035 1036 | 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 | - + | 1 133 74 250 200 250 c 0 257 250 298 244 340 205 c 0 EndSplineSet Validated: 1 EndChar StartChar: uniE087 |
| ︙ | |||
1053 1054 1055 1056 1057 1058 1059 | 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 | - + | 305 125 280 121 268 121 c 0 194 121 173 161 97 161 c 0 EndSplineSet Validated: 1 EndChar StartChar: uniE088 |
| ︙ | |||
1084 1085 1086 1087 1088 1089 1090 | 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 | - + | 93 -250 0 -194 0 -130 c 0 0 -77 50 -44 108 -16 c 1 EndSplineSet Validated: 1 EndChar StartChar: uniE089 |
| ︙ | |||
1114 1115 1116 1117 1118 1119 1120 | 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 | - + | 384 -133 311 -250 185 -250 c 0 128 -250 87 -244 45 -205 c 0 EndSplineSet Validated: 1 EndChar StartChar: uniE08A |
| ︙ | |||
1142 1143 1144 1145 1146 1147 1148 | 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 280 249 325 222 345 199 c 0 365 176 379 150 379 124 c 0 379 77 354 30 315 30 c 0 270 30 242 69 242 104 c 1 244 130 265 164 302 164 c 2 303 164 l 1 EndSplineSet |
| ︙ | |||
3994 3995 3996 3997 3998 3999 4000 | 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 | - - - - - + + + + + - | StartChar: uniE5D0 Encoding: 116 58832 116 Width: 310 Flags: HMW LayerCount: 2 Fore SplineSet |
| ︙ | |||
4312 4313 4314 4315 4316 4317 4318 | 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 | - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 135 161 150 163 166 179 c 0 173 186 179 196 179 204 c 0 179 219 166 230 141 230 c 0xcb40 EndSplineSet Validated: 1 EndChar |
| ︙ | |||
4450 4451 4452 4453 4454 4455 4456 | 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - + + + + + - + - + | 112 -250 0 -138 0 0 c 24 0 139 111 250 250 250 c 0 344 250 420 210 463 130 c 0 EndSplineSet Validated: 1 EndChar |
| ︙ | |||
4549 4550 4551 4552 4553 4554 4555 | 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 | - + | 0 -190 l 25 0 190 l 25 EndSplineSet Validated: 1 EndChar StartChar: uniEA02 |
| ︙ | |||
4573 4574 4575 4576 4577 4578 4579 | 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 | - + | 32 41 l 25 0 65 l 25 EndSplineSet Validated: 1 EndChar StartChar: uniEAA4 |
| ︙ | |||
4597 4598 4599 4600 4601 4602 4603 | 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 | - + - + | -17 226 -24 227 -24 234 c 0 -24 241 -17 253 0 270 c 0 EndSplineSet Validated: 1 EndChar StartChar: uniECA2 |
| ︙ | |||
4645 4646 4647 4648 4649 4650 4651 | 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 | - + - + | 237 148 273 134 298 103 c 1 299 680 l 1 EndSplineSet Validated: 1 EndChar StartChar: uniECA5 |
| ︙ | |||
4688 4689 4690 4691 4692 4693 4694 | 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 | - + | 485 57 490 104 490 148 c 0 490 258 462 396 320 441 c 1 EndSplineSet Validated: 1 EndChar StartChar: uniECA9 |
| ︙ | |||
4718 4719 4720 4721 4722 4723 4724 | 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 | - + | 494 242 495 248 495 255 c 0 495 388 391 509 320 509 c 1 EndSplineSet Validated: 1 EndChar StartChar: uniECB7 |
| ︙ |
Changes to modules/MIDI.js.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | - + - + + | // MIDI.js - module to handle the %%MIDI parameters // |
| ︙ | |||
117 118 119 120 121 122 123 | 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | - + + + + - + + - - + + + + + + - + | // case "drone": // %%MIDI drone <#prog> <pit_1> <pit_2> <vol_1> <vol_2> // // default: 70 45 33 80 80 // break // case "droneon": // %%MIDI droneon // break // case "droneoff": // %%MIDI droneoff // break |
| ︙ | |||
176 177 178 179 180 181 182 | 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | - + - - + + + + + - + + - - + + - - + + + + - + |
n += "'"
v -= 12
}
this.do_pscom("map MIDIdrum " + a[2] + " play=" + n)
abc.set_v_param("mididrum", "MIDIdrum")
break
case "program":
|
| ︙ | |||
302 303 304 305 306 307 308 | 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | - + - - - + + + + + - - + |
of(a.slice(0)) // (copy because the parameters are removed)
for (i = 0; i < a.length; i++) {
switch (a[i]) {
case "channel=": // %%MIDI channel
s = abc.new_block("midiprog")
s.play = s.invis = 1 //true
|
| ︙ |
Changes to modules/break.js.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | // break.js - module to handle the %%break command // |
| ︙ | |||
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | - + |
var abc2svg = {}
abc2svg.break = {
// get the %%break parameters
get_break: function(parm) {
var C = abc2svg.C,
|
| ︙ | |||
62 63 64 65 66 67 68 | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | - - + + |
t: d[1] * C.BLEN / d[2],
sq: sq})
}
}, // get_break()
// insert the EOLs of %%break
do_break: function() {
|
| ︙ |
Changes to modules/chordnames.js.
| ︙ | |||
18 19 20 21 22 23 24 | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | - + | // along with abc2svg. If not, see <http://www.gnu.org/licenses/>. // // This module is loaded by %%chordnames. // // Parameters // 1st syntax: // %%chordnames <comma separated list of chord names> |
| ︙ |
Changes to modules/clip.js.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | // clip.js - module to handle the %%clip command // |
| ︙ | |||
64 65 66 67 68 69 70 | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + |
return
}
this.cfmt().clip = [b, c]
}, // get_clip()
// cut the tune
do_clip: function() {
|
| ︙ | |||
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | + + + + + + + + + + - - + + + + |
for (s2 = this.get_tsfirst(); s2 != s; s2 = s2.ts_next) {
switch (s2.type) {
case C.CLEF:
s2.p_v.clef = s2
break
case C.KEY:
s2.p_v.key = this.clone(s2.as.u.key)
s2.p_v.ckey = this.clone(s2.as.u.ckey)
break
case C.METER:
s2.p_v.meter = this.clone(s2.as.u.meter)
break
case C.STAVES:
sy = s2.sy;
this.set_cur_sy(sy)
break
}
}
for (v = 0; v < voice_tb.length; v++) {
p_voice = voice_tb[v]
for (s2 = s; s2; s2 = s2.ts_next) {
if (s2.v == v) {
delete s2.prev
break
}
}
p_voice.sym = s2
}
s2 = this.get_tsfirst()
if (s != s2) {
if (s2.type == C.STAVES) {
s2.ts_next = s
s.ts_prev = s2
s2.next = s2.p_v.sym
s2.p_v.sym = s2
s2.next.prev = s2
} else {
|
| ︙ | |||
190 191 192 193 194 195 196 197 198 199 200 201 202 203 | 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | + + |
break
}
}
if (!s2)
p_voice.sym = null
}
delete s.ts_prev.ts_next
chkptr(s.ts_prev) // check the pointers (ties and slurs)
}, // do_clip()
do_pscom: function (of, text) {
if (text.slice(0, 5) == "clip ")
abc2svg.clip.get_clip.call(this, text)
else
of(text)
|
| ︙ |
Changes to modules/combine.js.
| ︙ | |||
73 74 75 76 77 78 79 | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | - - |
if (s.invis && !s2.invis)
return //false
} else if (s.combine <= 2) {
return //false
}
return true
}
|
| ︙ |
Changes to modules/gamelan.js.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | // gamelan.js - module to output Gamelan (indonesian) music sheets // |
| ︙ | |||
60 61 62 63 64 65 66 | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | + - + |
break
}
of(p)
},
// adjust some symbols before the generation
output_music: function(of) {
var v,
|
| ︙ |
Changes to modules/grid2.js.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | // grid2.js - module to replace a voice in the music by a chord grid // |
| ︙ | |||
38 39 40 41 42 43 44 | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | - + |
if (voice_tb[v].grid2 == undefined)
voice_tb[v].grid2 = 1
for (v = 0; v < voice_tb.length; v++) {
p_v = voice_tb[v]
if (!p_v.grid2)
continue
|
| ︙ |
Changes to modules/grid3.js.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | - + - + + + | // grid3.js - module to insert a manual chords // |
| ︙ | |||
118 119 120 121 122 123 124 | 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | + + + + - + + + + + + + - |
// -- build_grid() --
// build the content of the cells
hr = font.size * 2.1
if (wc < hr * 1.4)
wc = hr * 1.4 // cell width
if (s.width) {
w = s.width
wc = w / nc
} else {
|
| ︙ | |||
265 266 267 268 269 270 271 | 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | - + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + + + - + |
// build the grid and insert it in the music
build_grid()
abc.blk_flush()
}, // block_gen()
// handle %%begingrid
do_begin_end: function(of, type, opt, txt) {
|
| ︙ |
Changes to modules/jianpu.js.
| ︙ | |||
354 355 356 357 358 359 360 | 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | - + - + - - + |
}
}
of()
}, // output_music()
draw_symbols: function(of, p_voice) {
|
| ︙ | |||
398 399 400 401 402 403 404 405 406 407 408 409 410 411 | 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
}
if (s == s2)
break
s = s.next
}
}
} // draw_dur()
// draw the duration lines of grace notes
// and the slurs
// (assume all notes have the same duration)
function draw_dgr(s) {
var g, x, l,
y = staff_tb[s.st].y,
s2 = s.extra,
nl = s2.nflags
for (g = s2; g.next; g = g.next)
;
out_svg('<g transform="translate(')
out_sxsy(s2.x, ',', y + 19) // (font height + 4)
out_svg(') scale(.5)" stroke-width="1.5">\n')
abc.stv_g().g++ // in container
l = ((g.x - s2.x) * 2 + 8).toFixed(1)
y = (nl > 0 ? 5 * nl : 0) + 2
if (nl > 0) {
xypath(-3, 0)
while (--nl >= 0) {
out_svg('m0 4h' + l)
l = -l
}
out_svg('"/>\n')
}
if (s.fmt.graceslurs // if a slur,
&& !s.sl1) { // but not an explicit one
l = Math.abs(l)
out_svg('<path class="stroke" \
d="m' + (l / 2 - 3).toFixed(1)+' '+y.toFixed(1))
if (s.gr_shift) {
out_svg('m0 0c0 10 0 10 -10 10')
} else {
out_svg('m0 0c0 10 0 10 10 10')
}
out_svg('"/>\n')
}
out_svg('</g>\n')
abc.stv_g().g--
} // draw_dgr()
function out_mus(x, y, p) {
out_svg('<text x="')
out_sxsy(x, '" y="', y)
out_svg('">' + p + '</text>\n')
} // out_mus()
|
| ︙ | |||
500 501 502 503 504 505 506 | 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 | - + + + + + + | case C.NOTE: case C.REST: nl = s.nflags if (nl <= 0) continue y = staff_tb[s.st].y s2 = s |
| ︙ |
Changes to modules/page.js.
| ︙ | |||
247 248 249 250 251 252 253 | 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | - + |
}
return fh * a[4]
}, // gen_hf()
// start a new page
open_page: function(page,
ht) { // spacing under the header
|
| ︙ | |||
272 273 274 275 276 277 278 | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | - + + + - + - + + + - + |
ht += page.topmargin
page.hmax = cfmt.pageheight - page.botmargin - ht
// define the header/footer
page.hf = ''
if (page.header) {
|
| ︙ | |||
429 430 431 432 433 434 435 436 437 438 439 440 441 442 | 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 | + |
abc: this,
topmargin: 38, // 1cm
botmargin: 38, // 1cm
// gutter: 0,
h: 0, // current page height
pn: 0, // page number
pna: 0, // absolute page number
ffsty: '', // style of the footer
first: true // no skip to next page
}
// don't let the backend handle the header/footer
if (cfmt.header) {
page.header = cfmt.header;
cfmt.header = null
|
| ︙ |
Changes to modules/strftime.js.
| 1 2 3 4 5 6 7 8 9 | - + - + |
|
| ︙ |
Changes to modules/strtab.js.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | // abc2svg - strtab.js - tablature for string instruments // |
| ︙ | |||
48 49 50 51 52 53 54 | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | - + - + |
// draw the note heads
function draw_heads(stb, s) {
var m, not, x, y
for (m = 0; m <= s.nhd; m++) {
not = s.notes[m]
|
| ︙ | |||
261 262 263 264 265 266 267 | 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | - + + - + - + + - + - + - - - - - - - - + + + + + + + + + + + + + + + + |
this.set_v_param("minfret", parm)
return
}
of(cmd, parm)
}, // set_fmt()
// change the notes when the global generation settings are done
|
| ︙ | |||
331 332 333 334 335 336 337 | 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 | - + + + |
nt = s.notes[m]
if (nt.sls) { // if start of slur
for (i = 0; i < nt.sls.length; i++) {
nt.sls[i].ty &= ~0x07
nt.sls[i].ty |= C.SL_ABOVE
}
}
|
| ︙ | |||
368 369 370 371 372 373 374 | 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 | + - + + | bn = n } } set_pit(p_v, s, nt, bi) } s.y = 3 * (nt.pit - 18) |
| ︙ | |||
390 391 392 393 394 395 396 | 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 | - + - + - + - |
m = p_v[n].capo
if (m) {
for (i = 0; i < p_v[n].tab.length; i++)
p_v[n].tab[i] += m
}
}
|
| ︙ | |||
423 424 425 426 427 428 429 | 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 | - - + + + + - + |
default:
delete s.a_dd
break
case C.GRACE:
if (p_v.pos.gst == C.SL_HIDDEN)
s.sappo = 0
for (g = s.extra; g; g = g.next) {
|
| ︙ | |||
615 616 617 618 619 620 621 | 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 | - + |
tab = abc2tab(strs) // ABC syntax
if (!tab) {
this.syntax(1, "Bad strings in tablature")
ok = false
}
} else if (!p_v.tab) {
tab = p_v.diafret ?
|
| ︙ | |||
674 675 676 677 678 679 680 | 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 | - + - - - - - - + + + + + + - - |
of(a)
}, // set_vp()
set_hooks: function(abc) {
abc.draw_symbols = abc2svg.strtab.draw_symbols.bind(abc, abc.draw_symbols)
abc.gch_build = abc2svg.strtab.csan_bld.bind(abc, abc.gch_build)
abc.set_format = abc2svg.strtab.set_fmt.bind(abc, abc.set_format);
|
Added modules/tempo.js.
|
Changes to modules/tropt.js.
| ︙ | |||
111 112 113 114 115 116 117 118 119 120 121 122 123 124 | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | + + |
break
default:
continue
}
if (ok(s, np)) {
nt.pit = np
nt.acc = na
if (p_v.map)
this.set_map(p_v, nt, na)
}
}
}
}
of(last_s)
}, // voice_adj()
|
| ︙ |
Deleted package.json.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Changes to toabc.js.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | // abc2svg - toabc.js - convert ABC to ABC // |
| ︙ | |||
455 456 457 458 459 460 461 | 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 | - + |
}
t = ly.t
if (ly.ln) {
w[i] += t
if (ly.ln == 1)
w[i] += '-'
} else {
|
| ︙ | |||
984 985 986 987 988 989 990 | 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 | - + - - + + |
//fixme: put 'X' if more than one measure
if (s.time > vti[v] + 2) {
line += 'x' + dur_dump(s.time - vti[v])
}
vti[v] = s.time
}
sym_dump(s)
|
| ︙ |
Added tosvg.js.