abcjs 6.4.2 → 6.4.3
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.
- package/LICENSE.md +1 -1
- package/RELEASE.md +12 -0
- package/dist/abcjs-basic-min.js +2 -2
- package/dist/abcjs-basic-min.js.LICENSE +1 -1
- package/dist/abcjs-basic.js +62 -80
- package/dist/abcjs-basic.js.map +1 -1
- package/dist/abcjs-plugin-min.js +2 -2
- package/dist/abcjs-plugin-min.js.LICENSE +1 -1
- package/index.js +1 -1
- package/license.js +1 -1
- package/package.json +1 -1
- package/plugin.js +1 -1
- package/src/data/abc_tune.js +2 -0
- package/src/parse/abc_parse_music.js +32 -17
- package/src/synth/chord-track.js +9 -0
- package/src/write/creation/elements/tie-element.js +26 -0
- package/src/write/layout/set-upper-and-lower-elements.js +8 -0
- package/test.js +1 -1
- package/types/index.d.ts +1 -1
- package/version.js +1 -1
- package/temp.txt +0 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**!
|
|
2
|
-
Copyright (c) 2009-
|
|
2
|
+
Copyright (c) 2009-2024 Paul Rosen and Gregory Dyke
|
|
3
3
|
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
5
|
of this software and associated documentation files (the "Software"), to deal
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**!
|
|
2
|
-
Copyright (c) 2009-
|
|
2
|
+
Copyright (c) 2009-2024 Paul Rosen and Gregory Dyke
|
|
3
3
|
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
5
|
of this software and associated documentation files (the "Software"), to deal
|
package/license.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**!
|
|
2
|
-
Copyright (c) 2009-
|
|
2
|
+
Copyright (c) 2009-2024 Paul Rosen and Gregory Dyke
|
|
3
3
|
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
5
|
of this software and associated documentation files (the "Software"), to deal
|
package/package.json
CHANGED
package/plugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**!
|
|
2
|
-
Copyright (c) 2009-
|
|
2
|
+
Copyright (c) 2009-2024 Paul Rosen and Gregory Dyke
|
|
3
3
|
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
5
|
of this software and associated documentation files (the "Software"), to deal
|
package/src/data/abc_tune.js
CHANGED
|
@@ -615,23 +615,38 @@ var letter_to_chord = function(line, i) {
|
|
|
615
615
|
chord[1] = chord[1].substring(1);
|
|
616
616
|
chord[2] = 'right';
|
|
617
617
|
} else if (chord[0] > 0 && chord[1].length > 0 && chord[1][0] === '@') {
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
chord[1] = chord[1].
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
chord[1] = chord[1].
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
618
|
+
// @-15,5.7
|
|
619
|
+
chord[1] = chord[1].substring(1);
|
|
620
|
+
var x = tokenizer.getFloat(chord[1]);
|
|
621
|
+
if (x.digits === 0){
|
|
622
|
+
warn("Missing first position in absolutely positioned annotation.", line, i);
|
|
623
|
+
chord[1] = chord[1].replace("@","");
|
|
624
|
+
chord[2] = 'above';
|
|
625
|
+
return chord;
|
|
626
|
+
}
|
|
627
|
+
chord[1] = chord[1].substring(x.digits);
|
|
628
|
+
if (chord[1][0] !== ','){
|
|
629
|
+
warn("Missing comma absolutely positioned annotation.", line, i);
|
|
630
|
+
chord[1] = chord[1].replace("@","");
|
|
631
|
+
chord[2] = 'above';
|
|
632
|
+
return chord;
|
|
633
|
+
}
|
|
634
|
+
chord[1] = chord[1].substring(1);
|
|
635
|
+
var y = tokenizer.getFloat(chord[1]);
|
|
636
|
+
if (y.digits === 0){
|
|
637
|
+
warn("Missing second position in absolutely positioned annotation.", line, i);
|
|
638
|
+
chord[1] = chord[1].replace("@","");
|
|
639
|
+
chord[2] = 'above';
|
|
640
|
+
return chord;
|
|
641
|
+
}
|
|
642
|
+
chord[1] = chord[1].substring(y.digits);
|
|
643
|
+
var ws = tokenizer.skipWhiteSpace(chord[1]);
|
|
644
|
+
chord[1] = chord[1].substring(ws);
|
|
645
|
+
chord[2] = null;
|
|
646
|
+
chord[3] = {
|
|
647
|
+
x: x.value,
|
|
648
|
+
y: y.value
|
|
649
|
+
};
|
|
635
650
|
} else {
|
|
636
651
|
if (multilineVars.freegchord !== true) {
|
|
637
652
|
chord[1] = chord[1].replace(/([ABCDEFG0-9])b/g, "$1♭");
|
package/src/synth/chord-track.js
CHANGED
|
@@ -198,6 +198,15 @@ ChordTrack.prototype.interpretChord = function (name) {
|
|
|
198
198
|
while (chordTranspose > 8)
|
|
199
199
|
chordTranspose -= 12;
|
|
200
200
|
bass += chordTranspose;
|
|
201
|
+
|
|
202
|
+
// MAE 31 Aug 2024 - For visual transpose backup range issue
|
|
203
|
+
// If transposed below A or above G, bring it back in the normal backup range
|
|
204
|
+
if (bass < 33){
|
|
205
|
+
bass += 12;
|
|
206
|
+
}
|
|
207
|
+
else if (bass > 44){
|
|
208
|
+
bass -= 12;
|
|
209
|
+
}
|
|
201
210
|
|
|
202
211
|
// MAE 17 Jun 2024 - Supporting octave shifted bass and chords
|
|
203
212
|
var unshiftedBass = bass;
|
|
@@ -225,4 +225,30 @@ TieElem.prototype.avoidCollisionAbove = function () {
|
|
|
225
225
|
}
|
|
226
226
|
};
|
|
227
227
|
|
|
228
|
+
TieElem.prototype.getYBounds = function () {
|
|
229
|
+
var lineStartX = 10 // TODO-PER: I'm not sure where to get this number from but it probably doesn't matter much
|
|
230
|
+
var lineEndX = 1000 // TODO-PER: I'm not sure where to get this number from but it probably doesn't matter much
|
|
231
|
+
if (this.isTie) {
|
|
232
|
+
this.calcTieDirection();
|
|
233
|
+
this.calcX(lineStartX, lineEndX);
|
|
234
|
+
this.calcTieY();
|
|
235
|
+
|
|
236
|
+
} else {
|
|
237
|
+
this.calcSlurDirection();
|
|
238
|
+
this.calcX(lineStartX, lineEndX);
|
|
239
|
+
this.calcSlurY();
|
|
240
|
+
}
|
|
241
|
+
var top;
|
|
242
|
+
var bottom;
|
|
243
|
+
// TODO-PER: It's hard to tell how far the arc is, so I'm just using 3 as the max
|
|
244
|
+
if (this.above) {
|
|
245
|
+
bottom = Math.min(this.startY, this.endY)
|
|
246
|
+
top = bottom + 3
|
|
247
|
+
} else {
|
|
248
|
+
top = Math.min(this.startY, this.endY)
|
|
249
|
+
bottom = top - 3
|
|
250
|
+
}
|
|
251
|
+
return [ top, bottom ]
|
|
252
|
+
};
|
|
253
|
+
|
|
228
254
|
module.exports = TieElem;
|
|
@@ -128,6 +128,14 @@ function setUpperAndLowerVoiceElements(positionY, voice, spacing) {
|
|
|
128
128
|
case 'EndingElem':
|
|
129
129
|
setUpperAndLowerEndingElements(positionY, abselem);
|
|
130
130
|
break;
|
|
131
|
+
case 'TieElem':
|
|
132
|
+
// If a tie element is the highest or lowest thing then space might need to make room for it.
|
|
133
|
+
var yBounds = abselem.getYBounds()
|
|
134
|
+
voice.staff.top = Math.max(voice.staff.top, yBounds[0])
|
|
135
|
+
voice.staff.top = Math.max(voice.staff.top, yBounds[1])
|
|
136
|
+
voice.staff.bottom = Math.min(voice.staff.bottom, yBounds[0])
|
|
137
|
+
voice.staff.bottom = Math.min(voice.staff.bottom, yBounds[1])
|
|
138
|
+
break;
|
|
131
139
|
}
|
|
132
140
|
}
|
|
133
141
|
}
|
package/test.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**!
|
|
2
|
-
Copyright (c) 2009-
|
|
2
|
+
Copyright (c) 2009-2024 Paul Rosen and Gregory Dyke
|
|
3
3
|
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
5
|
of this software and associated documentation files (the "Software"), to deal
|
package/types/index.d.ts
CHANGED
|
@@ -886,7 +886,7 @@ declare module 'abcjs' {
|
|
|
886
886
|
getBarLength: NumberFunction;
|
|
887
887
|
getBeatLength: NumberFunction;
|
|
888
888
|
getBeatsPerMeasure: NumberFunction;
|
|
889
|
-
getBpm:
|
|
889
|
+
getBpm: (tempo?:TempoProperties) => number;
|
|
890
890
|
getMeter: () => Meter;
|
|
891
891
|
getMeterFraction: () => MeterFraction;
|
|
892
892
|
getPickupLength: NumberFunction;
|
package/version.js
CHANGED
package/temp.txt
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
commit 747c5538cdfbb37eb6234356944b05855ff2921a
|
|
2
|
-
Author: paulrosen <junk@paulrosen.net>
|
|
3
|
-
Date: Sun Aug 4 10:08:14 2024 -0400
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
commit 5b3d3d0f3f951e6dea3c22ded60b6baa9776e64c
|
|
8
|
-
Author: paulrosen <junk@paulrosen.net>
|
|
9
|
-
Date: Sun Jul 28 19:20:32 2024 -0400
|
|
10
|
-
|
|
11
|
-
Start to refactor tablature and flatten the structure.
|
|
12
|
-
|