abcjs 6.2.3 → 6.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +4 -0
  2. package/RELEASE.md +40 -1
  3. package/dist/abcjs-basic-min.js +2 -2
  4. package/dist/abcjs-basic.js +751 -416
  5. package/dist/abcjs-basic.js.map +1 -1
  6. package/dist/abcjs-plugin-min.js +2 -2
  7. package/index.js +2 -0
  8. package/package.json +1 -1
  9. package/plugin.js +1 -1
  10. package/src/api/abc_tablatures.js +48 -13
  11. package/src/parse/abc_parse_directive.js +17 -16
  12. package/src/parse/abc_parse_header.js +22 -19
  13. package/src/parse/abc_tokenizer.js +72 -7
  14. package/src/parse/tune-builder.js +60 -1
  15. package/src/synth/synth-controller.js +6 -2
  16. package/src/tablatures/instruments/string-patterns.js +11 -0
  17. package/src/tablatures/instruments/{guitar/guitar-patterns.js → tab-string-patterns.js} +6 -6
  18. package/src/tablatures/instruments/{violin/tab-violin.js → tab-string.js} +13 -11
  19. package/src/tablatures/tab-absolute-elements.js +16 -7
  20. package/src/tablatures/tab-renderer.js +22 -9
  21. package/src/test/abc_parser_lint.js +13 -12
  22. package/src/write/creation/abstract-engraver.js +3 -2
  23. package/src/write/creation/add-chord.js +102 -82
  24. package/src/write/creation/add-text-if.js +2 -2
  25. package/src/write/creation/decoration.js +14 -8
  26. package/src/write/creation/elements/bottom-text.js +62 -47
  27. package/src/write/creation/elements/rich-text.js +51 -0
  28. package/src/write/creation/elements/top-text.js +37 -11
  29. package/src/write/creation/glyphs.js +1 -1
  30. package/src/write/draw/absolute.js +4 -1
  31. package/src/write/draw/draw.js +13 -4
  32. package/src/write/draw/non-music.js +3 -1
  33. package/src/write/draw/relative.js +1 -1
  34. package/src/write/draw/tempo.js +1 -1
  35. package/src/write/draw/text.js +10 -0
  36. package/src/write/engraver-controller.js +54 -13
  37. package/src/write/helpers/classes.js +1 -1
  38. package/src/write/helpers/get-font-and-attr.js +8 -1
  39. package/src/write/helpers/get-text-size.js +8 -1
  40. package/src/write/svg.js +30 -0
  41. package/temp.txt +50 -0
  42. package/types/index.d.ts +46 -6
  43. package/version.js +1 -1
  44. package/.github/workflows/tests.yml +0 -29
  45. package/src/tablatures/instruments/guitar/tab-guitar.js +0 -48
  46. package/src/tablatures/instruments/violin/violin-patterns.js +0 -23
@@ -1,48 +0,0 @@
1
- /*
2
- Emit tab for Guitar staff
3
- */
4
- var StringTablature = require('../string-tablature');
5
- var TabCommon = require('../../tab-common');
6
- var TabRenderer = require('../../tab-renderer');
7
- var GuitarPatterns = require('./guitar-patterns');
8
-
9
- /**
10
- * upon init mainly store provided instances for later usage
11
- * @param {*} abcTune the parsed tune AST tree
12
- * @param {*} tuneNumber the parsed tune AST tree
13
- * @param {*} params complementary args provided to Tablature Plugin
14
- */
15
- Plugin.prototype.init = function (abcTune, tuneNumber, params) {
16
- var _super = new TabCommon(abcTune, tuneNumber, params);
17
- this._super = _super;
18
- this.abcTune = abcTune;
19
- this.linePitch = 3;
20
- this.nbLines = 6;
21
- this.isTabBig = true;
22
- this.capo = params.capo;
23
- this.transpose = params.visualTranspose;
24
- this.tablature = new StringTablature(this.nbLines,
25
- this.linePitch);
26
-
27
- var semantics = new GuitarPatterns(this);
28
- this.semantics = semantics;
29
- };
30
-
31
- Plugin.prototype.render = function (renderer, line, staffIndex) {
32
- if (this._super.inError) return;
33
- if (this.tablature.bypass(line)) return;
34
- var rndrer = new TabRenderer(this, renderer, line, staffIndex);
35
- rndrer.doLayout();
36
- };
37
-
38
- function Plugin() {}
39
-
40
- //
41
- // Tablature plugin definition
42
- //
43
- var AbcGuitarTab = function () {
44
- return { name: 'GuitarTab', tablature: Plugin };
45
- };
46
-
47
-
48
- module.exports = AbcGuitarTab;
@@ -1,23 +0,0 @@
1
- var StringPatterns = require('../string-patterns');
2
-
3
- function ViolinPatterns(plugin) {
4
- this.tuning = plugin._super.params.tuning;
5
- if (!this.tuning) {
6
- this.tuning = ['G,', 'D', 'A', 'e'];
7
- }
8
- plugin.tuning = this.tuning;
9
- this.strings = new StringPatterns(plugin);
10
- }
11
-
12
- ViolinPatterns.prototype.notesToNumber = function (notes, graces) {
13
- var converter = this.strings;
14
- return converter.notesToNumber(notes, graces);
15
- };
16
-
17
- ViolinPatterns.prototype.stringToPitch = function (stringNumber) {
18
- var converter = this.strings;
19
- return converter.stringToPitch(stringNumber);
20
- };
21
-
22
-
23
- module.exports = ViolinPatterns;