abcjs 6.0.0-beta.35 → 6.0.0-beta.39
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/README.md +15 -6
- package/RELEASE.md +74 -0
- package/dist/abcjs-basic-min.js +2 -2
- package/dist/abcjs-basic-min.js.LICENSE +2 -2
- package/dist/abcjs-basic.js +2599 -328
- package/dist/abcjs-basic.js.map +1 -1
- package/dist/abcjs-plugin-min.js +2 -2
- package/dist/abcjs-plugin-min.js.LICENSE +2 -2
- package/dist/report-basic.html +37 -0
- package/dist/report-before-glyph-compress.html +37 -0
- package/dist/report-brown-ts-target-es5.html +37 -0
- package/dist/report-dev-orig-no-babel.html +37 -0
- package/dist/report-synth.html +37 -0
- package/docker-build.sh +1 -0
- package/glyphs.json +1 -0
- package/index.js +23 -1
- package/license.js +1 -1
- package/package.json +2 -1
- package/plugin.js +23 -1
- package/src/api/abc_tablatures.js +144 -0
- package/src/api/abc_tunebook.js +10 -1
- package/src/api/abc_tunebook_svg.js +18 -6
- package/src/data/abc_tune.js +26 -24
- package/src/edit/abc_editor.js +29 -11
- package/src/parse/abc_parse.js +4 -2
- package/src/parse/abc_parse_directive.js +12 -6
- package/src/parse/tune-builder.js +1 -1
- package/src/synth/abc_midi_flattener.js +11 -2
- package/src/synth/abc_midi_sequencer.js +4 -1
- package/src/synth/create-synth.js +105 -34
- package/src/synth/load-note.js +34 -65
- package/src/synth/place-note.js +63 -59
- package/src/tablatures/instruments/guitar/guitar-fonts.js +19 -0
- package/src/tablatures/instruments/guitar/guitar-patterns.js +23 -0
- package/src/tablatures/instruments/guitar/tab-guitar.js +50 -0
- package/src/tablatures/instruments/string-patterns.js +277 -0
- package/src/tablatures/instruments/string-tablature.js +56 -0
- package/src/tablatures/instruments/tab-note.js +282 -0
- package/src/tablatures/instruments/tab-notes.js +41 -0
- package/src/tablatures/instruments/violin/tab-violin.js +47 -0
- package/src/tablatures/instruments/violin/violin-fonts.js +19 -0
- package/src/tablatures/instruments/violin/violin-patterns.js +23 -0
- package/src/tablatures/tab-absolute-elements.js +310 -0
- package/src/tablatures/tab-common.js +29 -0
- package/src/tablatures/tab-renderer.js +243 -0
- package/src/tablatures/transposer.js +110 -0
- package/src/test/abc_parser_lint.js +3 -0
- package/src/write/abc_absolute_element.js +2 -2
- package/src/write/abc_engraver_controller.js +19 -11
- package/src/write/abc_glyphs.js +2 -0
- package/src/write/abc_relative_element.js +5 -3
- package/src/write/abc_renderer.js +5 -1
- package/src/write/draw/absolute.js +5 -1
- package/src/write/draw/draw.js +5 -6
- package/src/write/draw/non-music.js +3 -1
- package/src/write/draw/print-line.js +24 -0
- package/src/write/draw/relative.js +14 -2
- package/src/write/draw/selectables.js +9 -6
- package/src/write/draw/staff-group.js +44 -8
- package/src/write/draw/staff-line.js +3 -19
- package/src/write/draw/staff.js +15 -2
- package/src/write/draw/tab-line.js +40 -0
- package/src/write/draw/text.js +3 -0
- package/src/write/draw/voice.js +9 -1
- package/src/write/format-jazz-chord.js +2 -2
- package/src/write/layout/staffGroup.js +23 -1
- package/src/write/layout/voice.js +2 -1
- package/src/write/svg.js +2 -1
- package/temp.txt +0 -0
- package/test.js +23 -0
- package/types/index.d.ts +73 -25
- package/version.js +1 -1
package/src/write/svg.js
CHANGED
|
@@ -193,8 +193,9 @@ Svg.prototype.text = function(text, attr, target) {
|
|
|
193
193
|
line.appendChild(ts2);
|
|
194
194
|
}
|
|
195
195
|
if (parts[2]) {
|
|
196
|
+
var dist = parts[1] ? "0.4em" : "0.1em";
|
|
196
197
|
var ts3 = document.createElementNS(svgNS, 'tspan');
|
|
197
|
-
ts3.setAttribute("dy",
|
|
198
|
+
ts3.setAttribute("dy", dist);
|
|
198
199
|
ts3.setAttribute("style", "font-size:0.7em");
|
|
199
200
|
ts3.textContent = parts[2];
|
|
200
201
|
line.appendChild(ts3);
|
package/temp.txt
ADDED
|
File without changes
|
package/test.js
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
/**!
|
|
2
|
+
Copyright (c) 2009-2022 Paul Rosen and Gregory Dyke
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in
|
|
12
|
+
all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
20
|
+
THE SOFTWARE.
|
|
21
|
+
|
|
22
|
+
**This text is from: http://opensource.org/licenses/MIT**
|
|
23
|
+
!**/
|
|
1
24
|
var abcjs = require('./index');
|
|
2
25
|
var version = require('./version');
|
|
3
26
|
var Parse = require('./src/parse/abc_parse');
|
package/types/index.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ declare module 'abcjs' {
|
|
|
48
48
|
|
|
49
49
|
export type FormatAttributes = "titlefont" | "gchordfont" | "composerfont" | "footerfont" | "headerfont" | "historyfont" | "infofont" |
|
|
50
50
|
"measurefont" | "partsfont" | "repeatfont" | "subtitlefont" | "tempofont" | "textfont" | "voicefont" | "tripletfont" | "vocalfont" |
|
|
51
|
-
"wordsfont" | "annotationfont" | "scale" | "partsbox" | "freegchord" | "fontboxpadding" | "stretchlast";
|
|
51
|
+
"wordsfont" | "annotationfont" | "scale" | "partsbox" | "freegchord" | "fontboxpadding" | "stretchlast" | "tablabelfont" | "tabnumberfont" | "tabgracefont";
|
|
52
52
|
|
|
53
53
|
export type MidiCommands = "nobarlines" | "barlines" | "beataccents" | "nobeataccents" | "droneon" | "droneoff" | "noportamento" | "channel" | "c" |
|
|
54
54
|
"drumon" | "drumoff" | "fermatafixed" | "fermataproportional" | "gchordon" | "gchordoff" | "bassvol" | "chordvol" |
|
|
@@ -274,7 +274,7 @@ declare module 'abcjs' {
|
|
|
274
274
|
fadeLength?: number;
|
|
275
275
|
sequenceCallback?: (sequence: Array<NoteMapTrack>, context: any) => Array<NoteMapTrack>;
|
|
276
276
|
callbackContext?: any; // Anything is ok. It is just passed back in the callback
|
|
277
|
-
onEnded?: () => void;
|
|
277
|
+
onEnded?: (context: any) => void;
|
|
278
278
|
pan?: Array<number>;
|
|
279
279
|
voicesOff?: boolean | Array<number>;
|
|
280
280
|
drum?: string;
|
|
@@ -291,11 +291,11 @@ declare module 'abcjs' {
|
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
export interface SynthVisualOptions {
|
|
294
|
-
displayLoop
|
|
295
|
-
displayRestart
|
|
296
|
-
displayPlay
|
|
297
|
-
displayProgress
|
|
298
|
-
displayWarp
|
|
294
|
+
displayLoop?: boolean;
|
|
295
|
+
displayRestart?: boolean;
|
|
296
|
+
displayPlay?: boolean;
|
|
297
|
+
displayProgress?: boolean;
|
|
298
|
+
displayWarp?: boolean;
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
export type DownloadLabelFn = (visualObj: TuneObject, index: number) => string;
|
|
@@ -352,6 +352,11 @@ declare module 'abcjs' {
|
|
|
352
352
|
measureStart?: boolean;
|
|
353
353
|
}
|
|
354
354
|
|
|
355
|
+
export interface PercMapElement {
|
|
356
|
+
sound: number;
|
|
357
|
+
noteHead: NoteHeadType;
|
|
358
|
+
}
|
|
359
|
+
|
|
355
360
|
export interface Formatting {
|
|
356
361
|
alignbars?: number;
|
|
357
362
|
aligncomposer?: Alignment;
|
|
@@ -407,7 +412,7 @@ declare module 'abcjs' {
|
|
|
407
412
|
drone?: MidiParam;
|
|
408
413
|
droneoff?: MidiParam;
|
|
409
414
|
droneon?: MidiParam;
|
|
410
|
-
drum
|
|
415
|
+
drum?: MidiParam;
|
|
411
416
|
drumbars?: MidiParam;
|
|
412
417
|
drummap: MidiParam;
|
|
413
418
|
drumoff?: MidiParam;
|
|
@@ -415,7 +420,7 @@ declare module 'abcjs' {
|
|
|
415
420
|
expand?: MidiParam;
|
|
416
421
|
fermatafixed?: MidiParam;
|
|
417
422
|
fermataproportional?: MidiParam;
|
|
418
|
-
gchord
|
|
423
|
+
gchord?: MidiParam;
|
|
419
424
|
gchordon?: MidiParam;
|
|
420
425
|
gchordoff?: MidiParam;
|
|
421
426
|
grace?: MidiParam;
|
|
@@ -445,7 +450,7 @@ declare module 'abcjs' {
|
|
|
445
450
|
parskipfac?: number;
|
|
446
451
|
partsbox?: boolean;
|
|
447
452
|
partsspace?: number;
|
|
448
|
-
percmap?:
|
|
453
|
+
percmap?: Array<PercMapElement>;
|
|
449
454
|
playtempo?: string;
|
|
450
455
|
rightmargin?: number;
|
|
451
456
|
scale?: number;
|
|
@@ -485,6 +490,9 @@ declare module 'abcjs' {
|
|
|
485
490
|
partsfont: Font;
|
|
486
491
|
repeatfont: Font;
|
|
487
492
|
subtitlefont: Font;
|
|
493
|
+
tabgracefont: Font;
|
|
494
|
+
tablabelfont: Font;
|
|
495
|
+
tabnumberfont: Font;
|
|
488
496
|
tempofont: Font;
|
|
489
497
|
textfont: Font;
|
|
490
498
|
titlefont: Font;
|
|
@@ -728,7 +736,31 @@ declare module 'abcjs' {
|
|
|
728
736
|
|
|
729
737
|
export type TuneObjectArray = [TuneObject]
|
|
730
738
|
|
|
731
|
-
export
|
|
739
|
+
export interface AbcElem {
|
|
740
|
+
el_type: string //TODO enumerate these
|
|
741
|
+
abselem: any;
|
|
742
|
+
beambr?: number;
|
|
743
|
+
chord?: Array<any>
|
|
744
|
+
decoration: Array<any>
|
|
745
|
+
duration: number
|
|
746
|
+
endBeam?: boolean
|
|
747
|
+
endSlur?: number
|
|
748
|
+
endTriplet?: true
|
|
749
|
+
gracenotes?: Array<any>
|
|
750
|
+
lyric?: Array<any>
|
|
751
|
+
noStem?: boolean
|
|
752
|
+
pitches?: Array<any>
|
|
753
|
+
positioning?: any
|
|
754
|
+
rest?: any
|
|
755
|
+
startBeam?: boolean
|
|
756
|
+
startTriplet?: number
|
|
757
|
+
tripletMultiplier?: number
|
|
758
|
+
tripletR?: number
|
|
759
|
+
stemConnectsToAbove?: true
|
|
760
|
+
style?: NoteHeadType
|
|
761
|
+
startChar: number
|
|
762
|
+
endChar: number
|
|
763
|
+
}
|
|
732
764
|
|
|
733
765
|
export interface ClickListenerDrag {
|
|
734
766
|
step: number;
|
|
@@ -770,7 +802,7 @@ declare module 'abcjs' {
|
|
|
770
802
|
height: number;
|
|
771
803
|
left: number;
|
|
772
804
|
width: number;
|
|
773
|
-
elements: Array<
|
|
805
|
+
elements: Array< HTMLElement>;
|
|
774
806
|
startCharArray: Array<number>;
|
|
775
807
|
endCharArray: Array<number>;
|
|
776
808
|
midiPitches: MidiPitches
|
|
@@ -835,7 +867,7 @@ declare module 'abcjs' {
|
|
|
835
867
|
|
|
836
868
|
export interface SequenceBeat {
|
|
837
869
|
el_type: "beat";
|
|
838
|
-
beats:
|
|
870
|
+
beats: [number,number,number];
|
|
839
871
|
}
|
|
840
872
|
|
|
841
873
|
export interface SequenceBeatAccents {
|
|
@@ -864,9 +896,9 @@ declare module 'abcjs' {
|
|
|
864
896
|
export type MidiFile = any // This is a standard midi file format
|
|
865
897
|
|
|
866
898
|
export interface MidiBufferPromise {
|
|
867
|
-
cached:
|
|
868
|
-
error:
|
|
869
|
-
loaded:
|
|
899
|
+
cached: Array<string>;
|
|
900
|
+
error: Array<string>;
|
|
901
|
+
loaded: Array<string>;
|
|
870
902
|
}
|
|
871
903
|
|
|
872
904
|
export interface AudioTrack {
|
|
@@ -977,22 +1009,39 @@ declare module 'abcjs' {
|
|
|
977
1009
|
//
|
|
978
1010
|
// Audio
|
|
979
1011
|
//
|
|
980
|
-
export
|
|
1012
|
+
export interface AudioControl {
|
|
1013
|
+
disable: (isDisabled: boolean) => void;
|
|
1014
|
+
setWarp: (tempo: number, warp: number) => void;
|
|
1015
|
+
setTempo: (tempo: number) => void;
|
|
1016
|
+
resetAll: () => void;
|
|
1017
|
+
pushPlay: (push: boolean) => void;
|
|
1018
|
+
pushLoop: (push: boolean) => void;
|
|
1019
|
+
setProgress: (percent: number, totalTime: number) => void;
|
|
1020
|
+
}
|
|
981
1021
|
|
|
982
1022
|
export interface MidiBuffer {
|
|
983
1023
|
init(params?: MidiBufferOptions): Promise<MidiBufferPromise>
|
|
984
1024
|
prime(): Promise<void>
|
|
985
1025
|
start(): void
|
|
986
|
-
pause():
|
|
1026
|
+
pause(): number
|
|
987
1027
|
resume(): void
|
|
988
|
-
seek(position: number, units
|
|
989
|
-
stop():
|
|
990
|
-
download():
|
|
1028
|
+
seek(position: number, units?: ProgressUnit): void
|
|
1029
|
+
stop(): number
|
|
1030
|
+
download(): string // returns audio buffer in wav format as a reference to a blob
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
export interface SynthInitResponse {
|
|
1034
|
+
status: "no-audio-context" | "created";
|
|
1035
|
+
loadingResponse?: {
|
|
1036
|
+
cached: Array<string>
|
|
1037
|
+
error: Array<string>
|
|
1038
|
+
loaded: Array<string>
|
|
1039
|
+
}
|
|
991
1040
|
}
|
|
992
1041
|
|
|
993
1042
|
export interface SynthObjectController {
|
|
994
1043
|
disable(isDisabled: boolean): void
|
|
995
|
-
setTune(visualObj: TuneObject, userAction: Boolean, audioParams?: AbcVisualParams): Promise<
|
|
1044
|
+
setTune(visualObj: TuneObject, userAction: Boolean, audioParams?: AbcVisualParams): Promise<SynthInitResponse>
|
|
996
1045
|
load(selector: string, cursorControl?: any, visualOptions?: SynthVisualOptions): void
|
|
997
1046
|
play(): void
|
|
998
1047
|
pause(): void
|
|
@@ -1015,12 +1064,11 @@ declare module 'abcjs' {
|
|
|
1015
1064
|
let SynthSequence: { new (): SynthSequenceClass }
|
|
1016
1065
|
|
|
1017
1066
|
export function supportsAudio(): boolean
|
|
1018
|
-
export function registerAudioContext(AudioContext): boolean
|
|
1067
|
+
export function registerAudioContext(ac?: AudioContext): boolean
|
|
1019
1068
|
export function activeAudioContext(): AudioContext
|
|
1020
|
-
export function CreateSynthControl(element: Selector, options: AbcVisualParams): AudioControl
|
|
1069
|
+
export function CreateSynthControl(element: Selector, options: AbcVisualParams): AudioControl
|
|
1021
1070
|
export function getMidiFile(source: String | TuneObject, options?: MidiFileOptions): MidiFile;
|
|
1022
1071
|
export function playEvent(pitches: MidiPitches, graceNotes: MidiGracePitches, milliSecondsPerMeasure: number): Promise<void>;
|
|
1023
|
-
export function activeAudioContext(): AudioContext
|
|
1024
1072
|
export function sequence(visualObj: TuneObject, options: AbcVisualParams): AudioSequence
|
|
1025
1073
|
}
|
|
1026
1074
|
|
package/version.js
CHANGED