chordsheetjs 15.4.0 → 15.5.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.
package/lib/bundle.js CHANGED
@@ -2,7 +2,11 @@
2
2
  var ChordSheetJS = (() => {
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __commonJS = (cb, mod) => function __require() {
5
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
5
+ try {
6
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
7
+ } catch (e) {
8
+ throw mod = 0, e;
9
+ }
6
10
  };
7
11
 
8
12
  // lib/index.js
@@ -402,580 +406,97 @@ var ChordSheetJS = (() => {
402
406
  var $dce48cb70c4120bb$export$dfea9b8ecbbb8623 = "start_tag";
403
407
  var $dce48cb70c4120bb$export$3d329a2c209fbc28 = "end_tag";
404
408
  var $dce48cb70c4120bb$export$97c0a36af1d48540 = "auto";
405
- var $3d106a0ee348cfa8$export$7e1516eaf3ebe01f = {
406
- [(0, $dce48cb70c4120bb$export$27c95a7104c1f7aa)]: {
407
- [(0, $dce48cb70c4120bb$export$39615881bb0d21f6)]: {
408
- [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
409
- C: 0,
410
- D: 2,
411
- E: 4,
412
- F: 5,
413
- G: 7,
414
- A: 9,
415
- B: 11
416
- },
417
- [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
418
- B: 0,
419
- C: 1,
420
- D: 3,
421
- E: 5,
422
- F: 6,
423
- G: 8,
424
- A: 10
425
- },
426
- [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
427
- D: 1,
428
- E: 3,
429
- F: 4,
430
- G: 6,
431
- A: 8,
432
- B: 10,
433
- C: 11
434
- }
435
- },
436
- [(0, $dce48cb70c4120bb$export$f23edc19d247fd25)]: {
437
- [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
438
- C: 0,
439
- D: 2,
440
- E: 4,
441
- F: 5,
442
- G: 7,
443
- A: 9,
444
- B: 11
445
- },
446
- [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
447
- B: 0,
448
- C: 1,
449
- D: 3,
450
- E: 5,
451
- F: 6,
452
- G: 8,
453
- A: 10
454
- },
455
- [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
456
- D: 1,
457
- E: 3,
458
- F: 4,
459
- G: 6,
460
- A: 8,
461
- B: 10,
462
- C: 11
463
- }
464
- }
465
- },
466
- [(0, $dce48cb70c4120bb$export$539a6499f4711c57)]: {
467
- [(0, $dce48cb70c4120bb$export$39615881bb0d21f6)]: {
468
- [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
469
- Do: 0,
470
- Re: 2,
471
- Mi: 4,
472
- Fa: 5,
473
- Sol: 7,
474
- La: 9,
475
- Si: 11
476
- },
477
- [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
478
- Si: 0,
479
- Do: 1,
480
- Re: 3,
481
- Mi: 5,
482
- Fa: 6,
483
- Sol: 8,
484
- La: 10
485
- },
486
- [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
487
- Re: 1,
488
- Mi: 3,
489
- Fa: 4,
490
- Sol: 6,
491
- La: 8,
492
- Si: 10,
493
- Do: 11
494
- }
495
- },
496
- [(0, $dce48cb70c4120bb$export$f23edc19d247fd25)]: {
497
- [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
498
- Do: 0,
499
- Re: 2,
500
- Mi: 4,
501
- Fa: 5,
502
- Sol: 7,
503
- La: 9,
504
- Si: 11
505
- },
506
- [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
507
- Si: 0,
508
- Do: 1,
509
- Re: 3,
510
- Mi: 5,
511
- Fa: 6,
512
- Sol: 8,
513
- La: 10
514
- },
515
- [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
516
- Re: 1,
517
- Mi: 3,
518
- Fa: 4,
519
- Sol: 6,
520
- La: 8,
521
- Si: 10,
522
- Do: 11
523
- }
524
- }
525
- },
526
- [(0, $dce48cb70c4120bb$export$4d318981b5a83836)]: {
527
- [(0, $dce48cb70c4120bb$export$39615881bb0d21f6)]: {
528
- [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
529
- 1: 0,
530
- 2: 2,
531
- 3: 4,
532
- 4: 5,
533
- 5: 7,
534
- 6: 9,
535
- 7: 11
536
- },
537
- [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
538
- 7: 0,
539
- 1: 1,
540
- 2: 3,
541
- 3: 5,
542
- 4: 6,
543
- 5: 8,
544
- 6: 10
545
- },
546
- [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
547
- 2: 1,
548
- 3: 3,
549
- 4: 4,
550
- 5: 6,
551
- 6: 8,
552
- 7: 10,
553
- 1: 11
554
- }
555
- },
556
- [(0, $dce48cb70c4120bb$export$f23edc19d247fd25)]: {
557
- [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
558
- 1: 0,
559
- 2: 2,
560
- 3: 3,
561
- 4: 5,
562
- 5: 7,
563
- 6: 8,
564
- 7: 10
565
- },
566
- [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
567
- 1: 1,
568
- 2: 3,
569
- 3: 4,
570
- 4: 6,
571
- 5: 8,
572
- 6: 9,
573
- 7: 11
574
- },
575
- [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
576
- 2: 1,
577
- 3: 2,
578
- 4: 4,
579
- 5: 6,
580
- 6: 7,
581
- 7: 9,
582
- 1: 11
583
- }
584
- }
585
- },
586
- [(0, $dce48cb70c4120bb$export$1321df9b16c30c6a)]: {
587
- [(0, $dce48cb70c4120bb$export$39615881bb0d21f6)]: {
588
- [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
589
- I: 0,
590
- II: 2,
591
- III: 4,
592
- IV: 5,
593
- V: 7,
594
- VI: 9,
595
- VII: 11
596
- },
597
- [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
598
- VII: 0,
599
- I: 1,
600
- II: 3,
601
- III: 5,
602
- IV: 6,
603
- V: 8,
604
- VI: 10
605
- },
606
- [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
607
- II: 1,
608
- III: 3,
609
- IV: 4,
610
- V: 6,
611
- VI: 8,
612
- VII: 10,
613
- I: 11
614
- }
615
- },
616
- [(0, $dce48cb70c4120bb$export$f23edc19d247fd25)]: {
617
- [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
618
- I: 0,
619
- II: 2,
620
- III: 3,
621
- IV: 5,
622
- V: 7,
623
- VI: 8,
624
- VII: 10
625
- },
626
- [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
627
- I: 1,
628
- II: 3,
629
- III: 4,
630
- IV: 6,
631
- V: 8,
632
- VI: 9,
633
- VII: 11
634
- },
635
- [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
636
- II: 1,
637
- III: 2,
638
- IV: 4,
639
- V: 6,
640
- VI: 7,
641
- VII: 9,
642
- I: 11
643
- }
409
+ var $dce48cb70c4120bb$export$34df5089b632c747 = "german";
410
+ var $551a223fc13b5c10$var$ChordLyricsPair = class _$551a223fc13b5c10$var$ChordLyricsPair {
411
+ /**
412
+ * Initialises a ChordLyricsPair
413
+ * @param {string} chords The chords
414
+ * @param {string | null} lyrics The lyrics
415
+ * @param {string | null} annotation The annotation
416
+ * @param {Chord | null} chordObj Optional pre-parsed Chord object
417
+ * @param {boolean} isRhythmSymbol Whether this pair represents a rhythm symbol
418
+ */
419
+ constructor(chords = "", lyrics = null, annotation = null, chordObj = null, isRhythmSymbol = false) {
420
+ this.parentLine = null;
421
+ this._chordObj = null;
422
+ this.chords = chords || "";
423
+ this.lyrics = lyrics || "";
424
+ this.annotation = annotation || "";
425
+ this._chordObj = chordObj;
426
+ this.isRhythmSymbol = isRhythmSymbol;
427
+ }
428
+ /** Returns the Chord object if available, otherwise parses from string */
429
+ get chord() {
430
+ return this._chordObj || (0, $177a605b8569b31c$export$2e2bcd8739ae039).parse(this.chords.trim());
431
+ }
432
+ /**
433
+ * Indicates whether a ChordLyricsPair should be visible in a formatted chord sheet (except for ChordPro sheets)
434
+ * @returns {boolean}
435
+ */
436
+ isRenderable() {
437
+ return true;
438
+ }
439
+ /**
440
+ * Indicates whether the ChordLyricsPair has non-empty lyrics.
441
+ */
442
+ hasLyrics() {
443
+ return !!(this.lyrics && this.lyrics.trim().length > 0);
444
+ }
445
+ /**
446
+ * Returns a deep copy of the ChordLyricsPair, useful when programmatically transforming a song
447
+ * @returns {ChordLyricsPair}
448
+ */
449
+ clone() {
450
+ const chordObj = this._chordObj?.clone() || null;
451
+ return new _$551a223fc13b5c10$var$ChordLyricsPair(this.chords, this.lyrics, this.annotation, chordObj, this.isRhythmSymbol);
452
+ }
453
+ toString() {
454
+ return `ChordLyricsPair(chords=${this.chords}, lyrics=${this.lyrics})`;
455
+ }
456
+ set({ chords, lyrics, annotation, chordObj, isRhythmSymbol }) {
457
+ return new _$551a223fc13b5c10$var$ChordLyricsPair(chords ?? this.chords, lyrics ?? this.lyrics, annotation ?? this.annotation, chordObj ?? null, isRhythmSymbol ?? this.isRhythmSymbol);
458
+ }
459
+ setLyrics(lyrics) {
460
+ return this.set({
461
+ lyrics
462
+ });
463
+ }
464
+ setAnnotation(annotation) {
465
+ return this.set({
466
+ annotation
467
+ });
468
+ }
469
+ transpose(delta, key = null, { normalizeChordSuffix } = {
470
+ normalizeChordSuffix: false
471
+ }) {
472
+ return this.changeChord((chord) => {
473
+ const transposedChord = chord.transpose(delta);
474
+ if (key) return transposedChord.normalize(key, {
475
+ normalizeSuffix: normalizeChordSuffix
476
+ });
477
+ return transposedChord;
478
+ });
479
+ }
480
+ useAccidental(accidental) {
481
+ return this.changeChord((chord) => chord.useAccidental(accidental));
482
+ }
483
+ /**
484
+ * @deprecated Use useAccidental instead
485
+ */
486
+ useModifier(accidental) {
487
+ (0, $28a2fcb6fb95a147$export$b680e6b2c82f8c2f)("useModifier is deprecated, use useAccidental instead");
488
+ return this.useAccidental(accidental);
489
+ }
490
+ changeChord(func) {
491
+ const chordObj = this.chord;
492
+ if (chordObj) {
493
+ const changedChord = func(chordObj);
494
+ return this.set({
495
+ chords: changedChord.toString(),
496
+ chordObj: changedChord
497
+ });
644
498
  }
645
- }
646
- };
647
- var $3d106a0ee348cfa8$export$40141681ebb03523 = {
648
- [(0, $dce48cb70c4120bb$export$27c95a7104c1f7aa)]: {
649
- [(0, $dce48cb70c4120bb$export$39615881bb0d21f6)]: {
650
- [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
651
- 0: "C",
652
- 2: "D",
653
- 4: "E",
654
- 5: "F",
655
- 7: "G",
656
- 9: "A",
657
- 11: "B"
658
- },
659
- [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
660
- 0: "B#",
661
- 1: "C#",
662
- 3: "D#",
663
- 5: "E#",
664
- 6: "F#",
665
- 8: "G#",
666
- 10: "A#"
667
- },
668
- [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
669
- 1: "Db",
670
- 3: "Eb",
671
- 4: "Fb",
672
- 6: "Gb",
673
- 8: "Ab",
674
- 10: "Bb",
675
- 11: "Cb"
676
- }
677
- },
678
- [(0, $dce48cb70c4120bb$export$f23edc19d247fd25)]: {
679
- [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
680
- 0: "C",
681
- 2: "D",
682
- 4: "E",
683
- 5: "F",
684
- 7: "G",
685
- 9: "A",
686
- 11: "B"
687
- },
688
- [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
689
- 0: "B#",
690
- 1: "C#",
691
- 3: "D#",
692
- 5: "E#",
693
- 6: "F#",
694
- 8: "G#",
695
- 10: "A#"
696
- },
697
- [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
698
- 1: "Db",
699
- 3: "Eb",
700
- 4: "Fb",
701
- 6: "Gb",
702
- 8: "Ab",
703
- 10: "Bb",
704
- 11: "Cb"
705
- }
706
- }
707
- },
708
- [(0, $dce48cb70c4120bb$export$539a6499f4711c57)]: {
709
- [(0, $dce48cb70c4120bb$export$39615881bb0d21f6)]: {
710
- [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
711
- 0: "Do",
712
- 2: "Re",
713
- 4: "Mi",
714
- 5: "Fa",
715
- 7: "Sol",
716
- 9: "La",
717
- 11: "Si"
718
- },
719
- [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
720
- 0: "Si#",
721
- 1: "Do#",
722
- 3: "Re#",
723
- 5: "Mi#",
724
- 6: "Fa#",
725
- 8: "Sol#",
726
- 10: "La#"
727
- },
728
- [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
729
- 1: "Reb",
730
- 3: "Mib",
731
- 4: "Fab",
732
- 6: "Solb",
733
- 8: "Lab",
734
- 10: "Sib",
735
- 11: "Dob"
736
- }
737
- },
738
- [(0, $dce48cb70c4120bb$export$f23edc19d247fd25)]: {
739
- [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
740
- 0: "Do",
741
- 2: "Re",
742
- 4: "Mi",
743
- 5: "Fa",
744
- 7: "Sol",
745
- 9: "La",
746
- 11: "Si"
747
- },
748
- [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
749
- 0: "Si#",
750
- 1: "Do#",
751
- 3: "Re#",
752
- 5: "Mi#",
753
- 6: "Fa#",
754
- 8: "Sol#",
755
- 10: "La#"
756
- },
757
- [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
758
- 1: "Reb",
759
- 3: "Mib",
760
- 4: "Fab",
761
- 6: "Solb",
762
- 8: "Lab",
763
- 10: "Sib",
764
- 11: "Dob"
765
- }
766
- }
767
- },
768
- [(0, $dce48cb70c4120bb$export$4d318981b5a83836)]: {
769
- [(0, $dce48cb70c4120bb$export$39615881bb0d21f6)]: {
770
- [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
771
- 0: "1",
772
- 2: "2",
773
- 4: "3",
774
- 5: "4",
775
- 7: "5",
776
- 9: "6",
777
- 11: "7"
778
- },
779
- [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
780
- 0: "#7",
781
- 1: "#1",
782
- 3: "#2",
783
- 5: "#3",
784
- 6: "#4",
785
- 8: "#5",
786
- 10: "#6"
787
- },
788
- [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
789
- 1: "b2",
790
- 3: "b3",
791
- 4: "b4",
792
- 6: "b5",
793
- 8: "b6",
794
- 10: "b7",
795
- 11: "b1"
796
- }
797
- },
798
- [(0, $dce48cb70c4120bb$export$f23edc19d247fd25)]: {
799
- [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
800
- 0: "1",
801
- 2: "2",
802
- 3: "3",
803
- 5: "4",
804
- 7: "5",
805
- 8: "6",
806
- 10: "7"
807
- },
808
- [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
809
- 1: "#1",
810
- 3: "#2",
811
- 4: "#3",
812
- 6: "#4",
813
- 8: "#5",
814
- 9: "#6",
815
- 11: "#7"
816
- },
817
- [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
818
- 1: "b2",
819
- 2: "b3",
820
- 4: "b4",
821
- 6: "b5",
822
- 7: "b6",
823
- 9: "b7",
824
- 11: "b1"
825
- }
826
- }
827
- },
828
- [(0, $dce48cb70c4120bb$export$1321df9b16c30c6a)]: {
829
- [(0, $dce48cb70c4120bb$export$39615881bb0d21f6)]: {
830
- [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
831
- 0: "I",
832
- 2: "II",
833
- 4: "III",
834
- 5: "IV",
835
- 7: "V",
836
- 9: "VI",
837
- 11: "VII"
838
- },
839
- [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
840
- 0: "#VII",
841
- 1: "#I",
842
- 3: "#II",
843
- 5: "#III",
844
- 6: "#IV",
845
- 8: "#V",
846
- 10: "#VI"
847
- },
848
- [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
849
- 1: "bII",
850
- 3: "bIII",
851
- 4: "bIV",
852
- 6: "bV",
853
- 8: "bVI",
854
- 10: "bVII",
855
- 11: "bI"
856
- }
857
- },
858
- [(0, $dce48cb70c4120bb$export$f23edc19d247fd25)]: {
859
- [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
860
- 0: "I",
861
- 2: "II",
862
- 3: "III",
863
- 5: "IV",
864
- 7: "V",
865
- 8: "VI",
866
- 10: "VII"
867
- },
868
- [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
869
- 1: "#I",
870
- 3: "#II",
871
- 4: "#III",
872
- 6: "#IV",
873
- 8: "#V",
874
- 9: "#VI",
875
- 11: "#VII"
876
- },
877
- [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
878
- 1: "bII",
879
- 2: "bIII",
880
- 4: "bIV",
881
- 6: "bV",
882
- 7: "bVI",
883
- 9: "bVII",
884
- 11: "bI"
885
- }
886
- }
887
- }
888
- };
889
- var $551a223fc13b5c10$var$ChordLyricsPair = class _$551a223fc13b5c10$var$ChordLyricsPair {
890
- /**
891
- * Initialises a ChordLyricsPair
892
- * @param {string} chords The chords
893
- * @param {string | null} lyrics The lyrics
894
- * @param {string | null} annotation The annotation
895
- * @param {Chord | null} chordObj Optional pre-parsed Chord object
896
- * @param {boolean} isRhythmSymbol Whether this pair represents a rhythm symbol
897
- */
898
- constructor(chords = "", lyrics = null, annotation = null, chordObj = null, isRhythmSymbol = false) {
899
- this.parentLine = null;
900
- this._chordObj = null;
901
- this.chords = chords || "";
902
- this.lyrics = lyrics || "";
903
- this.annotation = annotation || "";
904
- this._chordObj = chordObj;
905
- this.isRhythmSymbol = isRhythmSymbol;
906
- }
907
- /** Returns the Chord object if available, otherwise parses from string */
908
- get chord() {
909
- return this._chordObj || (0, $177a605b8569b31c$export$2e2bcd8739ae039).parse(this.chords.trim());
910
- }
911
- /**
912
- * Indicates whether a ChordLyricsPair should be visible in a formatted chord sheet (except for ChordPro sheets)
913
- * @returns {boolean}
914
- */
915
- isRenderable() {
916
- return true;
917
- }
918
- /**
919
- * Indicates whether the ChordLyricsPair has non-empty lyrics.
920
- */
921
- hasLyrics() {
922
- return !!(this.lyrics && this.lyrics.trim().length > 0);
923
- }
924
- /**
925
- * Returns a deep copy of the ChordLyricsPair, useful when programmatically transforming a song
926
- * @returns {ChordLyricsPair}
927
- */
928
- clone() {
929
- const chordObj = this._chordObj?.clone() || null;
930
- return new _$551a223fc13b5c10$var$ChordLyricsPair(this.chords, this.lyrics, this.annotation, chordObj, this.isRhythmSymbol);
931
- }
932
- toString() {
933
- return `ChordLyricsPair(chords=${this.chords}, lyrics=${this.lyrics})`;
934
- }
935
- set({ chords, lyrics, annotation, chordObj, isRhythmSymbol }) {
936
- return new _$551a223fc13b5c10$var$ChordLyricsPair(chords ?? this.chords, lyrics ?? this.lyrics, annotation ?? this.annotation, chordObj ?? null, isRhythmSymbol ?? this.isRhythmSymbol);
937
- }
938
- setLyrics(lyrics) {
939
- return this.set({
940
- lyrics
941
- });
942
- }
943
- setAnnotation(annotation) {
944
- return this.set({
945
- annotation
946
- });
947
- }
948
- transpose(delta, key = null, { normalizeChordSuffix } = {
949
- normalizeChordSuffix: false
950
- }) {
951
- return this.changeChord((chord) => {
952
- const transposedChord = chord.transpose(delta);
953
- if (key) return transposedChord.normalize(key, {
954
- normalizeSuffix: normalizeChordSuffix
955
- });
956
- return transposedChord;
957
- });
958
- }
959
- useAccidental(accidental) {
960
- return this.changeChord((chord) => chord.useAccidental(accidental));
961
- }
962
- /**
963
- * @deprecated Use useAccidental instead
964
- */
965
- useModifier(accidental) {
966
- (0, $28a2fcb6fb95a147$export$b680e6b2c82f8c2f)("useModifier is deprecated, use useAccidental instead");
967
- return this.useAccidental(accidental);
968
- }
969
- changeChord(func) {
970
- const chordObj = this.chord;
971
- if (chordObj) {
972
- const changedChord = func(chordObj);
973
- return this.set({
974
- chords: changedChord.toString(),
975
- chordObj: changedChord
976
- });
977
- }
978
- return this.clone();
499
+ return this.clone();
979
500
  }
980
501
  };
981
502
  var $551a223fc13b5c10$export$2e2bcd8739ae039 = $551a223fc13b5c10$var$ChordLyricsPair;
@@ -1883,10 +1404,521 @@ var ChordSheetJS = (() => {
1883
1404
  "sus#42": "sus#42",
1884
1405
  "": ""
1885
1406
  };
1886
- var $5f19a6aa6bc347f1$export$2e2bcd8739ae039 = $5f19a6aa6bc347f1$var$mapping;
1407
+ var $5f19a6aa6bc347f1$export$2e2bcd8739ae039 = $5f19a6aa6bc347f1$var$mapping;
1408
+ var $3d106a0ee348cfa8$export$7e1516eaf3ebe01f = {
1409
+ [(0, $dce48cb70c4120bb$export$27c95a7104c1f7aa)]: {
1410
+ [(0, $dce48cb70c4120bb$export$39615881bb0d21f6)]: {
1411
+ [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
1412
+ C: 0,
1413
+ D: 2,
1414
+ E: 4,
1415
+ F: 5,
1416
+ G: 7,
1417
+ A: 9,
1418
+ B: 11
1419
+ },
1420
+ [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
1421
+ B: 0,
1422
+ C: 1,
1423
+ D: 3,
1424
+ E: 5,
1425
+ F: 6,
1426
+ G: 8,
1427
+ A: 10
1428
+ },
1429
+ [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
1430
+ D: 1,
1431
+ E: 3,
1432
+ F: 4,
1433
+ G: 6,
1434
+ A: 8,
1435
+ B: 10,
1436
+ C: 11
1437
+ }
1438
+ },
1439
+ [(0, $dce48cb70c4120bb$export$f23edc19d247fd25)]: {
1440
+ [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
1441
+ C: 0,
1442
+ D: 2,
1443
+ E: 4,
1444
+ F: 5,
1445
+ G: 7,
1446
+ A: 9,
1447
+ B: 11
1448
+ },
1449
+ [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
1450
+ B: 0,
1451
+ C: 1,
1452
+ D: 3,
1453
+ E: 5,
1454
+ F: 6,
1455
+ G: 8,
1456
+ A: 10
1457
+ },
1458
+ [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
1459
+ D: 1,
1460
+ E: 3,
1461
+ F: 4,
1462
+ G: 6,
1463
+ A: 8,
1464
+ B: 10,
1465
+ C: 11
1466
+ }
1467
+ }
1468
+ },
1469
+ [(0, $dce48cb70c4120bb$export$539a6499f4711c57)]: {
1470
+ [(0, $dce48cb70c4120bb$export$39615881bb0d21f6)]: {
1471
+ [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
1472
+ Do: 0,
1473
+ Re: 2,
1474
+ Mi: 4,
1475
+ Fa: 5,
1476
+ Sol: 7,
1477
+ La: 9,
1478
+ Si: 11
1479
+ },
1480
+ [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
1481
+ Si: 0,
1482
+ Do: 1,
1483
+ Re: 3,
1484
+ Mi: 5,
1485
+ Fa: 6,
1486
+ Sol: 8,
1487
+ La: 10
1488
+ },
1489
+ [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
1490
+ Re: 1,
1491
+ Mi: 3,
1492
+ Fa: 4,
1493
+ Sol: 6,
1494
+ La: 8,
1495
+ Si: 10,
1496
+ Do: 11
1497
+ }
1498
+ },
1499
+ [(0, $dce48cb70c4120bb$export$f23edc19d247fd25)]: {
1500
+ [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
1501
+ Do: 0,
1502
+ Re: 2,
1503
+ Mi: 4,
1504
+ Fa: 5,
1505
+ Sol: 7,
1506
+ La: 9,
1507
+ Si: 11
1508
+ },
1509
+ [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
1510
+ Si: 0,
1511
+ Do: 1,
1512
+ Re: 3,
1513
+ Mi: 5,
1514
+ Fa: 6,
1515
+ Sol: 8,
1516
+ La: 10
1517
+ },
1518
+ [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
1519
+ Re: 1,
1520
+ Mi: 3,
1521
+ Fa: 4,
1522
+ Sol: 6,
1523
+ La: 8,
1524
+ Si: 10,
1525
+ Do: 11
1526
+ }
1527
+ }
1528
+ },
1529
+ [(0, $dce48cb70c4120bb$export$4d318981b5a83836)]: {
1530
+ [(0, $dce48cb70c4120bb$export$39615881bb0d21f6)]: {
1531
+ [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
1532
+ 1: 0,
1533
+ 2: 2,
1534
+ 3: 4,
1535
+ 4: 5,
1536
+ 5: 7,
1537
+ 6: 9,
1538
+ 7: 11
1539
+ },
1540
+ [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
1541
+ 7: 0,
1542
+ 1: 1,
1543
+ 2: 3,
1544
+ 3: 5,
1545
+ 4: 6,
1546
+ 5: 8,
1547
+ 6: 10
1548
+ },
1549
+ [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
1550
+ 2: 1,
1551
+ 3: 3,
1552
+ 4: 4,
1553
+ 5: 6,
1554
+ 6: 8,
1555
+ 7: 10,
1556
+ 1: 11
1557
+ }
1558
+ },
1559
+ [(0, $dce48cb70c4120bb$export$f23edc19d247fd25)]: {
1560
+ [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
1561
+ 1: 0,
1562
+ 2: 2,
1563
+ 3: 3,
1564
+ 4: 5,
1565
+ 5: 7,
1566
+ 6: 8,
1567
+ 7: 10
1568
+ },
1569
+ [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
1570
+ 1: 1,
1571
+ 2: 3,
1572
+ 3: 4,
1573
+ 4: 6,
1574
+ 5: 8,
1575
+ 6: 9,
1576
+ 7: 11
1577
+ },
1578
+ [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
1579
+ 2: 1,
1580
+ 3: 2,
1581
+ 4: 4,
1582
+ 5: 6,
1583
+ 6: 7,
1584
+ 7: 9,
1585
+ 1: 11
1586
+ }
1587
+ }
1588
+ },
1589
+ [(0, $dce48cb70c4120bb$export$1321df9b16c30c6a)]: {
1590
+ [(0, $dce48cb70c4120bb$export$39615881bb0d21f6)]: {
1591
+ [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
1592
+ I: 0,
1593
+ II: 2,
1594
+ III: 4,
1595
+ IV: 5,
1596
+ V: 7,
1597
+ VI: 9,
1598
+ VII: 11
1599
+ },
1600
+ [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
1601
+ VII: 0,
1602
+ I: 1,
1603
+ II: 3,
1604
+ III: 5,
1605
+ IV: 6,
1606
+ V: 8,
1607
+ VI: 10
1608
+ },
1609
+ [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
1610
+ II: 1,
1611
+ III: 3,
1612
+ IV: 4,
1613
+ V: 6,
1614
+ VI: 8,
1615
+ VII: 10,
1616
+ I: 11
1617
+ }
1618
+ },
1619
+ [(0, $dce48cb70c4120bb$export$f23edc19d247fd25)]: {
1620
+ [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
1621
+ I: 0,
1622
+ II: 2,
1623
+ III: 3,
1624
+ IV: 5,
1625
+ V: 7,
1626
+ VI: 8,
1627
+ VII: 10
1628
+ },
1629
+ [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
1630
+ I: 1,
1631
+ II: 3,
1632
+ III: 4,
1633
+ IV: 6,
1634
+ V: 8,
1635
+ VI: 9,
1636
+ VII: 11
1637
+ },
1638
+ [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
1639
+ II: 1,
1640
+ III: 2,
1641
+ IV: 4,
1642
+ V: 6,
1643
+ VI: 7,
1644
+ VII: 9,
1645
+ I: 11
1646
+ }
1647
+ }
1648
+ }
1649
+ };
1650
+ var $3d106a0ee348cfa8$export$40141681ebb03523 = {
1651
+ [(0, $dce48cb70c4120bb$export$27c95a7104c1f7aa)]: {
1652
+ [(0, $dce48cb70c4120bb$export$39615881bb0d21f6)]: {
1653
+ [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
1654
+ 0: "C",
1655
+ 2: "D",
1656
+ 4: "E",
1657
+ 5: "F",
1658
+ 7: "G",
1659
+ 9: "A",
1660
+ 11: "B"
1661
+ },
1662
+ [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
1663
+ 0: "B#",
1664
+ 1: "C#",
1665
+ 3: "D#",
1666
+ 5: "E#",
1667
+ 6: "F#",
1668
+ 8: "G#",
1669
+ 10: "A#"
1670
+ },
1671
+ [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
1672
+ 1: "Db",
1673
+ 3: "Eb",
1674
+ 4: "Fb",
1675
+ 6: "Gb",
1676
+ 8: "Ab",
1677
+ 10: "Bb",
1678
+ 11: "Cb"
1679
+ }
1680
+ },
1681
+ [(0, $dce48cb70c4120bb$export$f23edc19d247fd25)]: {
1682
+ [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
1683
+ 0: "C",
1684
+ 2: "D",
1685
+ 4: "E",
1686
+ 5: "F",
1687
+ 7: "G",
1688
+ 9: "A",
1689
+ 11: "B"
1690
+ },
1691
+ [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
1692
+ 0: "B#",
1693
+ 1: "C#",
1694
+ 3: "D#",
1695
+ 5: "E#",
1696
+ 6: "F#",
1697
+ 8: "G#",
1698
+ 10: "A#"
1699
+ },
1700
+ [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
1701
+ 1: "Db",
1702
+ 3: "Eb",
1703
+ 4: "Fb",
1704
+ 6: "Gb",
1705
+ 8: "Ab",
1706
+ 10: "Bb",
1707
+ 11: "Cb"
1708
+ }
1709
+ }
1710
+ },
1711
+ [(0, $dce48cb70c4120bb$export$539a6499f4711c57)]: {
1712
+ [(0, $dce48cb70c4120bb$export$39615881bb0d21f6)]: {
1713
+ [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
1714
+ 0: "Do",
1715
+ 2: "Re",
1716
+ 4: "Mi",
1717
+ 5: "Fa",
1718
+ 7: "Sol",
1719
+ 9: "La",
1720
+ 11: "Si"
1721
+ },
1722
+ [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
1723
+ 0: "Si#",
1724
+ 1: "Do#",
1725
+ 3: "Re#",
1726
+ 5: "Mi#",
1727
+ 6: "Fa#",
1728
+ 8: "Sol#",
1729
+ 10: "La#"
1730
+ },
1731
+ [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
1732
+ 1: "Reb",
1733
+ 3: "Mib",
1734
+ 4: "Fab",
1735
+ 6: "Solb",
1736
+ 8: "Lab",
1737
+ 10: "Sib",
1738
+ 11: "Dob"
1739
+ }
1740
+ },
1741
+ [(0, $dce48cb70c4120bb$export$f23edc19d247fd25)]: {
1742
+ [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
1743
+ 0: "Do",
1744
+ 2: "Re",
1745
+ 4: "Mi",
1746
+ 5: "Fa",
1747
+ 7: "Sol",
1748
+ 9: "La",
1749
+ 11: "Si"
1750
+ },
1751
+ [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
1752
+ 0: "Si#",
1753
+ 1: "Do#",
1754
+ 3: "Re#",
1755
+ 5: "Mi#",
1756
+ 6: "Fa#",
1757
+ 8: "Sol#",
1758
+ 10: "La#"
1759
+ },
1760
+ [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
1761
+ 1: "Reb",
1762
+ 3: "Mib",
1763
+ 4: "Fab",
1764
+ 6: "Solb",
1765
+ 8: "Lab",
1766
+ 10: "Sib",
1767
+ 11: "Dob"
1768
+ }
1769
+ }
1770
+ },
1771
+ [(0, $dce48cb70c4120bb$export$4d318981b5a83836)]: {
1772
+ [(0, $dce48cb70c4120bb$export$39615881bb0d21f6)]: {
1773
+ [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
1774
+ 0: "1",
1775
+ 2: "2",
1776
+ 4: "3",
1777
+ 5: "4",
1778
+ 7: "5",
1779
+ 9: "6",
1780
+ 11: "7"
1781
+ },
1782
+ [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
1783
+ 0: "#7",
1784
+ 1: "#1",
1785
+ 3: "#2",
1786
+ 5: "#3",
1787
+ 6: "#4",
1788
+ 8: "#5",
1789
+ 10: "#6"
1790
+ },
1791
+ [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
1792
+ 1: "b2",
1793
+ 3: "b3",
1794
+ 4: "b4",
1795
+ 6: "b5",
1796
+ 8: "b6",
1797
+ 10: "b7",
1798
+ 11: "b1"
1799
+ }
1800
+ },
1801
+ [(0, $dce48cb70c4120bb$export$f23edc19d247fd25)]: {
1802
+ [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
1803
+ 0: "1",
1804
+ 2: "2",
1805
+ 3: "3",
1806
+ 5: "4",
1807
+ 7: "5",
1808
+ 8: "6",
1809
+ 10: "7"
1810
+ },
1811
+ [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
1812
+ 1: "#1",
1813
+ 3: "#2",
1814
+ 4: "#3",
1815
+ 6: "#4",
1816
+ 8: "#5",
1817
+ 9: "#6",
1818
+ 11: "#7"
1819
+ },
1820
+ [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
1821
+ 1: "b2",
1822
+ 2: "b3",
1823
+ 4: "b4",
1824
+ 6: "b5",
1825
+ 7: "b6",
1826
+ 9: "b7",
1827
+ 11: "b1"
1828
+ }
1829
+ }
1830
+ },
1831
+ [(0, $dce48cb70c4120bb$export$1321df9b16c30c6a)]: {
1832
+ [(0, $dce48cb70c4120bb$export$39615881bb0d21f6)]: {
1833
+ [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
1834
+ 0: "I",
1835
+ 2: "II",
1836
+ 4: "III",
1837
+ 5: "IV",
1838
+ 7: "V",
1839
+ 9: "VI",
1840
+ 11: "VII"
1841
+ },
1842
+ [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
1843
+ 0: "#VII",
1844
+ 1: "#I",
1845
+ 3: "#II",
1846
+ 5: "#III",
1847
+ 6: "#IV",
1848
+ 8: "#V",
1849
+ 10: "#VI"
1850
+ },
1851
+ [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
1852
+ 1: "bII",
1853
+ 3: "bIII",
1854
+ 4: "bIV",
1855
+ 6: "bV",
1856
+ 8: "bVI",
1857
+ 10: "bVII",
1858
+ 11: "bI"
1859
+ }
1860
+ },
1861
+ [(0, $dce48cb70c4120bb$export$f23edc19d247fd25)]: {
1862
+ [(0, $dce48cb70c4120bb$export$f0f7b592ea674eb2)]: {
1863
+ 0: "I",
1864
+ 2: "II",
1865
+ 3: "III",
1866
+ 5: "IV",
1867
+ 7: "V",
1868
+ 8: "VI",
1869
+ 10: "VII"
1870
+ },
1871
+ [(0, $dce48cb70c4120bb$export$f5b1d6b4244c9536)]: {
1872
+ 1: "#I",
1873
+ 3: "#II",
1874
+ 4: "#III",
1875
+ 6: "#IV",
1876
+ 8: "#V",
1877
+ 9: "#VI",
1878
+ 11: "#VII"
1879
+ },
1880
+ [(0, $dce48cb70c4120bb$export$1ea14522906630af)]: {
1881
+ 1: "bII",
1882
+ 2: "bIII",
1883
+ 4: "bIV",
1884
+ 6: "bV",
1885
+ 7: "bVI",
1886
+ 9: "bVII",
1887
+ 11: "bI"
1888
+ }
1889
+ }
1890
+ }
1891
+ };
1887
1892
  function $28a2fcb6fb95a147$export$79570e60478bce41(value, functions) {
1888
1893
  return functions.reduce((acc, fn) => fn(acc), value);
1889
1894
  }
1895
+ function $28a2fcb6fb95a147$export$4da2456f0a9c9a18(key) {
1896
+ return key === "H" || key === "h";
1897
+ }
1898
+ function $28a2fcb6fb95a147$export$59c434f66823d8be(key) {
1899
+ if (key === "H") return "B";
1900
+ if (key === "h") return "b";
1901
+ return key;
1902
+ }
1903
+ function $28a2fcb6fb95a147$export$4f126a839166f96d(keyString) {
1904
+ return keyString.startsWith("H") ? `B${keyString.slice(1)}` : keyString;
1905
+ }
1906
+ function $28a2fcb6fb95a147$export$7d9735233c5272d2(key, accidental, notation) {
1907
+ if (notation === (0, $dce48cb70c4120bb$export$34df5089b632c747) && accidental === null && (key === "B" || key === "b")) return 0, $dce48cb70c4120bb$export$1ea14522906630af;
1908
+ return null;
1909
+ }
1910
+ function $28a2fcb6fb95a147$export$9bc1c71527523e02(keyString, explicit) {
1911
+ if (explicit) return explicit;
1912
+ return $28a2fcb6fb95a147$export$4da2456f0a9c9a18(keyString) ? (0, $dce48cb70c4120bb$export$34df5089b632c747) : null;
1913
+ }
1914
+ function $28a2fcb6fb95a147$export$f524439d316753cc(key, accidental, type, minor) {
1915
+ const grades = (0, $3d106a0ee348cfa8$export$7e1516eaf3ebe01f)[type][minor ? (0, $dce48cb70c4120bb$export$f23edc19d247fd25) : (0, $dce48cb70c4120bb$export$39615881bb0d21f6)][accidental];
1916
+ const lookupKey = type === (0, $dce48cb70c4120bb$export$27c95a7104c1f7aa) ? $28a2fcb6fb95a147$export$59c434f66823d8be(key) : key;
1917
+ if (lookupKey in grades) return grades[lookupKey];
1918
+ const upperCaseKey = lookupKey.toUpperCase();
1919
+ if (upperCaseKey in grades) return grades[upperCaseKey];
1920
+ return null;
1921
+ }
1890
1922
  function $28a2fcb6fb95a147$export$d332d76d125f0cbe(line) {
1891
1923
  return line.items.some((item) => item instanceof (0, $551a223fc13b5c10$export$2e2bcd8739ae039) && !!item.chords);
1892
1924
  }
@@ -2009,7 +2041,7 @@ ${error.stack}`);
2009
2041
  return Object.fromEntries(Object.entries(object).filter(([key, value]) => predicate(key, value)));
2010
2042
  }
2011
2043
  var $c2d6ab25ad00308f$var$regexes = {
2012
- symbol: /^(?<key>((?<note>[A-Ga-g])(?<accidental>#|b)?))(?<minor>m)?$/,
2044
+ symbol: /^(?<key>((?<note>[A-Ha-h])(?<accidental>#|b)?))(?<minor>m)?$/,
2013
2045
  solfege: /^(?<key>((?<note>Do|Re|Mi|Fa|Sol|La|Si|do|re|mi|fa|sol|la|si)(?<accidental>#|b)?))(?<minor>m)?$/,
2014
2046
  numeric: /^(?<key>(?<accidental>#|b)?(?<note>[1-7]))(?<minor>m)?$/,
2015
2047
  numeral: /^(?<key>(?<accidental>#|b)?(?<note>I{1,3}|IV|VI{0,2}|i{1,3}|iv|vi{0,2}))$/
@@ -2095,28 +2127,29 @@ ${error.stack}`);
2095
2127
  key: note,
2096
2128
  keyType,
2097
2129
  minor: minor || false,
2098
- accidental: accidental || null
2130
+ accidental: accidental || null,
2131
+ preferredNotation: keyType === (0, $dce48cb70c4120bb$export$27c95a7104c1f7aa) && (0, $28a2fcb6fb95a147$export$4da2456f0a9c9a18)(note) ? (0, $dce48cb70c4120bb$export$34df5089b632c747) : null
2099
2132
  });
2100
2133
  }
2101
2134
  /* eslint-disable-next-line max-lines-per-function */
2102
- static resolve({ key, keyType, minor, accidental }) {
2135
+ static resolve({ key, keyType, minor, accidental, preferredNotation }) {
2103
2136
  const keyString = `${key}`;
2104
2137
  const isMinor = this.isMinor(keyString, keyType, minor);
2105
- if (keyType === (0, $dce48cb70c4120bb$export$27c95a7104c1f7aa) || keyType === (0, $dce48cb70c4120bb$export$539a6499f4711c57)) {
2106
- const grade = this.toGrade(keyString, accidental || (0, $dce48cb70c4120bb$export$3fdd332fe3104970), keyType, isMinor);
2107
- if (grade !== null) return new _$c2d6ab25ad00308f$var$Key({
2108
- grade: 0,
2109
- minor: isMinor,
2110
- type: keyType,
2111
- accidental: accidental || null,
2112
- preferredAccidental: accidental || null,
2113
- referenceKeyGrade: grade,
2114
- originalKeyString: keyString
2115
- });
2116
- }
2117
- const number = this.getNumberFromKey(keyString, keyType);
2138
+ const notation = (0, $28a2fcb6fb95a147$export$9bc1c71527523e02)(keyString, preferredNotation);
2139
+ const lookupAccidental = (0, $28a2fcb6fb95a147$export$7d9735233c5272d2)(keyString, accidental, notation) ?? accidental;
2140
+ const grade = keyType === (0, $dce48cb70c4120bb$export$27c95a7104c1f7aa) || keyType === (0, $dce48cb70c4120bb$export$539a6499f4711c57) ? (0, $28a2fcb6fb95a147$export$f524439d316753cc)(keyString, lookupAccidental || (0, $dce48cb70c4120bb$export$3fdd332fe3104970), keyType, isMinor) : null;
2141
+ if (grade !== null) return new _$c2d6ab25ad00308f$var$Key({
2142
+ grade: 0,
2143
+ minor: isMinor,
2144
+ type: keyType,
2145
+ accidental: accidental || null,
2146
+ preferredAccidental: accidental || null,
2147
+ referenceKeyGrade: grade,
2148
+ originalKeyString: keyString,
2149
+ preferredNotation: notation
2150
+ });
2118
2151
  return new _$c2d6ab25ad00308f$var$Key({
2119
- number,
2152
+ number: this.getNumberFromKey(keyString, keyType),
2120
2153
  minor: isMinor,
2121
2154
  type: keyType,
2122
2155
  accidental: accidental || null,
@@ -2141,14 +2174,6 @@ ${error.stack}`);
2141
2174
  (0, $28a2fcb6fb95a147$export$b680e6b2c82f8c2f)("keyWithModifier is deprecated, use keyWithAccidental instead");
2142
2175
  return this.keyWithAccidental(key, accidental, type);
2143
2176
  }
2144
- static toGrade(key, accidental, type, isMinor) {
2145
- const mode = isMinor ? (0, $dce48cb70c4120bb$export$f23edc19d247fd25) : (0, $dce48cb70c4120bb$export$39615881bb0d21f6);
2146
- const grades = (0, $3d106a0ee348cfa8$export$7e1516eaf3ebe01f)[type][mode][accidental];
2147
- if (key in grades) return grades[key];
2148
- const upperCaseKey = key.toUpperCase();
2149
- if (upperCaseKey in grades) return grades[upperCaseKey];
2150
- return null;
2151
- }
2152
2177
  static isMinor(key, keyType, minor) {
2153
2178
  switch (keyType) {
2154
2179
  case "numeral":
@@ -2192,13 +2217,14 @@ ${error.stack}`);
2192
2217
  static distance(oneKey, otherKey) {
2193
2218
  return this.wrapOrFail(oneKey).distanceTo(otherKey);
2194
2219
  }
2195
- constructor({ grade = null, number = null, minor, type, accidental, referenceKeyGrade = null, referenceKeyMode = null, originalKeyString = null, preferredAccidental = null, explicitAccidental = false }) {
2220
+ constructor({ grade = null, number = null, minor, type, accidental, referenceKeyGrade = null, referenceKeyMode = null, originalKeyString = null, preferredAccidental = null, explicitAccidental = false, preferredNotation = null }) {
2196
2221
  this.number = null;
2197
2222
  this.minor = false;
2198
2223
  this.referenceKeyGrade = null;
2199
2224
  this.referenceKeyMode = null;
2200
2225
  this.originalKeyString = null;
2201
2226
  this.explicitAccidental = false;
2227
+ this.preferredNotation = null;
2202
2228
  this.grade = grade;
2203
2229
  this.number = number;
2204
2230
  this.minor = minor;
@@ -2209,6 +2235,7 @@ ${error.stack}`);
2209
2235
  this.referenceKeyMode = referenceKeyMode;
2210
2236
  this.originalKeyString = originalKeyString;
2211
2237
  this.explicitAccidental = explicitAccidental;
2238
+ this.preferredNotation = preferredNotation;
2212
2239
  }
2213
2240
  distanceTo(otherKey) {
2214
2241
  const otherKeyObj = _$c2d6ab25ad00308f$var$Key.wrapOrFail(otherKey);
@@ -2250,7 +2277,7 @@ ${error.stack}`);
2250
2277
  }
2251
2278
  calculateGradeFromNumber() {
2252
2279
  if (this.number === null) throw new Error("Cannot calculate grade, number is null");
2253
- this.grade = _$c2d6ab25ad00308f$var$Key.toGrade(this.number.toString(), this.accidental || (0, $dce48cb70c4120bb$export$3fdd332fe3104970), (0, $dce48cb70c4120bb$export$4d318981b5a83836), this.isMinor());
2280
+ this.grade = (0, $28a2fcb6fb95a147$export$f524439d316753cc)(this.number.toString(), this.accidental || (0, $dce48cb70c4120bb$export$3fdd332fe3104970), (0, $dce48cb70c4120bb$export$4d318981b5a83836), this.isMinor());
2254
2281
  this.number = null;
2255
2282
  }
2256
2283
  toChordSymbol(key, referenceKeyWasMinor = false) {
@@ -2372,13 +2399,20 @@ ${error.stack}`);
2372
2399
  if ((this.isChordSymbol() || this.isChordSolfege()) && this.referenceKeyGrade === null) throw new Error("Not possible, reference key grade is null");
2373
2400
  let { minor } = this;
2374
2401
  if (this.referenceKeyMode) minor = this.referenceKeyMode === (0, $dce48cb70c4120bb$export$f23edc19d247fd25);
2375
- return (0, $28a2fcb6fb95a147$export$65f5b958d546bb3f)({
2402
+ const rendered = (0, $28a2fcb6fb95a147$export$65f5b958d546bb3f)({
2376
2403
  type: this.type,
2377
2404
  accidental: this.accidental,
2378
2405
  preferredAccidental: this.preferredAccidental,
2379
2406
  grade: this.effectiveGrade,
2380
2407
  minor
2381
2408
  });
2409
+ return this.applyGermanRendering(rendered);
2410
+ }
2411
+ applyGermanRendering(rendered) {
2412
+ if (this.preferredNotation !== (0, $dce48cb70c4120bb$export$34df5089b632c747) || !this.isChordSymbol()) return rendered;
2413
+ if (this.accidental === null && this.effectiveGrade === 10) return "B";
2414
+ if (rendered === "B") return "H";
2415
+ return rendered;
2382
2416
  }
2383
2417
  getNoteForNumber() {
2384
2418
  if (this.number === null) throw new Error("Not possible, grade and number are null");
@@ -2483,15 +2517,16 @@ ${error.stack}`);
2483
2517
  normalizeEnharmonics(key) {
2484
2518
  if (key) {
2485
2519
  if (this.explicitAccidental) return this.clone();
2486
- const rootKeyString = _$c2d6ab25ad00308f$var$Key.wrapOrFail(key).toString({
2520
+ const rootKeyString = (0, $28a2fcb6fb95a147$export$4f126a839166f96d)(_$c2d6ab25ad00308f$var$Key.wrapOrFail(key).toString({
2487
2521
  showMinor: true
2488
- });
2522
+ }));
2489
2523
  const enharmonics = (0, $c6abce5a8855cc55$export$2e2bcd8739ae039)[rootKeyString];
2490
- const thisKeyString = this.toString({
2524
+ const thisKeyString = (0, $28a2fcb6fb95a147$export$4f126a839166f96d)(this.toString({
2491
2525
  showMinor: false
2492
- });
2526
+ }));
2493
2527
  if (enharmonics && enharmonics[thisKeyString]) return _$c2d6ab25ad00308f$var$Key.parseOrFail(enharmonics[thisKeyString]).set({
2494
- minor: this.minor
2528
+ minor: this.minor,
2529
+ preferredNotation: this.preferredNotation
2495
2530
  });
2496
2531
  }
2497
2532
  return this.clone();
@@ -2508,6 +2543,7 @@ ${error.stack}`);
2508
2543
  originalKeyString: this.originalKeyString,
2509
2544
  preferredAccidental: this.preferredAccidental,
2510
2545
  explicitAccidental: this.explicitAccidental,
2546
+ preferredNotation: this.preferredNotation,
2511
2547
  ...overwrite ? attributes : {}
2512
2548
  });
2513
2549
  }
@@ -2663,15 +2699,15 @@ ${error.stack}`);
2663
2699
  chordType: "symbol"
2664
2700
  };
2665
2701
  };
2666
- const peg$c10 = /^[A-Ga-g]/;
2702
+ const peg$c10 = /^[A-Ha-h]/;
2667
2703
  const peg$c11 = peg$classExpectation([
2668
2704
  [
2669
2705
  "A",
2670
- "G"
2706
+ "H"
2671
2707
  ],
2672
2708
  [
2673
2709
  "a",
2674
- "g"
2710
+ "h"
2675
2711
  ]
2676
2712
  ], false, false);
2677
2713
  const peg$c12 = "/";
@@ -3803,20 +3839,27 @@ ${error.stack}`);
3803
3839
  * Tries to parse a chord string into a chord
3804
3840
  * Any leading or trailing whitespace is removed first, so a chord like ` \n E/G# \r ` is valid.
3805
3841
  * @param chordString the chord string, eg `Esus4/G#` or `1sus4/#3`.
3842
+ * @param {ChordParseOptions} [options] parse options
3843
+ * @param {Notation|null} [options.notation] when `'german'`, `B` is interpreted as B-flat (grade 10)
3844
+ * and `H` as B natural (grade 11), and output renders accordingly. Defaults to English semantics where
3845
+ * `B` is B natural and `H` is accepted as an alias for it.
3806
3846
  * @returns {Chord|null}
3807
3847
  */
3808
- static parse(chordString) {
3848
+ static parse(chordString, options = {}) {
3809
3849
  try {
3810
- return this.parseOrFail(chordString);
3850
+ return this.parseOrFail(chordString, options);
3811
3851
  } catch (_error) {
3812
3852
  return null;
3813
3853
  }
3814
3854
  }
3815
- static parseOrFail(chordString) {
3855
+ static parseOrFail(chordString, options = {}) {
3816
3856
  const trimmedChord = chordString.trim();
3817
3857
  try {
3818
3858
  const ast = (0, $b0c0093f9a3a0967$export$98e6a39c04603d36)(trimmedChord);
3819
- return new _$177a605b8569b31c$var$Chord(ast);
3859
+ return new _$177a605b8569b31c$var$Chord({
3860
+ ...ast,
3861
+ notation: options.notation ?? null
3862
+ });
3820
3863
  } catch (error) {
3821
3864
  const errorObj = error;
3822
3865
  throw new (0, $b6f966368871e837$export$2e2bcd8739ae039)(`Failed parsing '${trimmedChord}': ${errorObj.message}`);
@@ -4092,7 +4135,7 @@ ${error.stack}`);
4092
4135
  return this.suffix === otherChord.suffix && this.optional === otherChord.optional && (0, $c2d6ab25ad00308f$export$2e2bcd8739ae039).equals(this.root, otherChord.root) && (0, $c2d6ab25ad00308f$export$2e2bcd8739ae039).equals(this.bass, otherChord.bass);
4093
4136
  }
4094
4137
  static determineRoot(options) {
4095
- const { root, base, accidental, suffix, chordType } = options;
4138
+ const { root, base, accidental, suffix, chordType, notation } = options;
4096
4139
  if (root) return root;
4097
4140
  if (!base) return null;
4098
4141
  if (!chordType) throw new Error("Can't resolve at this point without a chord type");
@@ -4100,11 +4143,12 @@ ${error.stack}`);
4100
4143
  key: base,
4101
4144
  keyType: chordType,
4102
4145
  minor: (0, $28a2fcb6fb95a147$export$51fabfbeed747719)(base, chordType, suffix ?? null),
4103
- accidental: accidental ?? null
4146
+ accidental: accidental ?? null,
4147
+ preferredNotation: notation ?? null
4104
4148
  });
4105
4149
  }
4106
4150
  static determineBass(options) {
4107
- const { bass, bassBase, bassAccidental, chordType } = options;
4151
+ const { bass, bassBase, bassAccidental, chordType, notation } = options;
4108
4152
  if (bass) return bass;
4109
4153
  if (!bassBase) return null;
4110
4154
  if (!chordType) throw new Error("Can't resolve at this point without a chord type");
@@ -4112,7 +4156,8 @@ ${error.stack}`);
4112
4156
  key: bassBase,
4113
4157
  accidental: bassAccidental ?? null,
4114
4158
  minor: false,
4115
- keyType: chordType
4159
+ keyType: chordType,
4160
+ preferredNotation: notation ?? null
4116
4161
  });
4117
4162
  }
4118
4163
  isMinor() {
@@ -8538,9 +8583,14 @@ Or set the song key before changing key:
8538
8583
  /**
8539
8584
  * Deserializes a song that has been serialized using {@link serialize}
8540
8585
  * @param {object} serializedSong The serialized song
8586
+ * @param {object} [options] Deserialization options
8587
+ * @param {Notation|null} [options.notation] When `'german'`, chord strings on the song are eagerly
8588
+ * parsed with German notation (`B` = B-flat, `H` = B natural) so the preference survives transpose
8589
+ * and re-serialization. Defaults to English semantics.
8541
8590
  * @returns {Song} The deserialized song
8542
8591
  */
8543
- deserialize(serializedSong) {
8592
+ deserialize(serializedSong, options = {}) {
8593
+ this.notation = options.notation ?? null;
8544
8594
  this.parseAstComponent(serializedSong);
8545
8595
  return this.song;
8546
8596
  }
@@ -8584,7 +8634,11 @@ Or set the song key before changing key:
8584
8634
  }
8585
8635
  parseChordLyricsPair(astComponent) {
8586
8636
  const { chord, chords, lyrics, annotation, isRhythmSymbol } = astComponent;
8587
- return new (0, $551a223fc13b5c10$export$2e2bcd8739ae039)(chord ? new (0, $177a605b8569b31c$export$2e2bcd8739ae039)(chord).toString() : chords, lyrics, annotation, null, isRhythmSymbol || false);
8637
+ const chordString = chord ? new (0, $177a605b8569b31c$export$2e2bcd8739ae039)(chord).toString() : chords;
8638
+ const eagerChord = this.notation && chordString ? (0, $177a605b8569b31c$export$2e2bcd8739ae039).parse(chordString, {
8639
+ notation: this.notation
8640
+ }) : null;
8641
+ return new (0, $551a223fc13b5c10$export$2e2bcd8739ae039)(eagerChord ? eagerChord.toString() : chordString, lyrics, annotation, eagerChord, isRhythmSymbol || false);
8588
8642
  }
8589
8643
  parseTag(astComponent) {
8590
8644
  const { name, value, location: { offset = null, line = null, column = null } = {}, chordDefinition, attributes, selector, isNegated } = astComponent;
@@ -8620,6 +8674,7 @@ Or set the song key before changing key:
8620
8674
  constructor() {
8621
8675
  this.song = new (0, $c53141c05fae8382$export$2e2bcd8739ae039)();
8622
8676
  this.songBuilder = new (0, $69c885ea9d252cfd$export$2e2bcd8739ae039)(this.song);
8677
+ this.notation = null;
8623
8678
  }
8624
8679
  };
8625
8680
  var $8b93ef43471b6ed2$export$2e2bcd8739ae039 = $8b93ef43471b6ed2$var$ChordSheetSerializer;
@@ -13114,6 +13169,9 @@ Or set the song key before changing key:
13114
13169
  * followed by * a space is treated as a soft line break
13115
13170
  * @param {ChordProParserOptions.chopFirstWord} options.chopFirstWord=true If true, only the first lyric
13116
13171
  * word is paired with the chord, the rest of the lyric is put in a separate chord lyric pair
13172
+ * @param {Notation|null} [options.notation] When `'german'`, every chord in the song is parsed using
13173
+ * German notation (`B` = B-flat, `H` = B natural) and rendered accordingly. Defaults to English
13174
+ * semantics where `B` is B natural and `H` is accepted as an alias for it.
13117
13175
  * @see https://peggyjs.org/documentation.html#using-the-parser
13118
13176
  * @returns {Song} The parsed song
13119
13177
  */
@@ -13122,7 +13180,9 @@ Or set the song key before changing key:
13122
13180
  tracer: new (0, $95c3b35b301e70e4$export$2e2bcd8739ae039)(),
13123
13181
  ...options
13124
13182
  });
13125
- this.song = new (0, $8b93ef43471b6ed2$export$2e2bcd8739ae039)().deserialize(ast);
13183
+ this.song = new (0, $8b93ef43471b6ed2$export$2e2bcd8739ae039)().deserialize(ast, {
13184
+ notation: options?.notation ?? null
13185
+ });
13126
13186
  return this.song;
13127
13187
  }
13128
13188
  };
@@ -14287,15 +14347,15 @@ Or set the song key before changing key:
14287
14347
  chordType: "symbol"
14288
14348
  };
14289
14349
  };
14290
- const peg$c71 = /^[A-Ga-g]/;
14350
+ const peg$c71 = /^[A-Ha-h]/;
14291
14351
  const peg$c72 = peg$classExpectation([
14292
14352
  [
14293
14353
  "A",
14294
- "G"
14354
+ "H"
14295
14355
  ],
14296
14356
  [
14297
14357
  "a",
14298
- "g"
14358
+ "h"
14299
14359
  ]
14300
14360
  ], false, false);
14301
14361
  const peg$c73 = "/";
@@ -29618,7 +29678,7 @@ ${template}
29618
29678
  }
29619
29679
  };
29620
29680
  var $a5a21ced491ea51f$export$2e2bcd8739ae039 = $a5a21ced491ea51f$var$UltimateGuitarParser;
29621
- var $ae92e002ce14f11a$export$2e2bcd8739ae039 = "15.4.0";
29681
+ var $ae92e002ce14f11a$export$2e2bcd8739ae039 = "15.5.0";
29622
29682
  var $2a7926da41d163b3$export$191a710ad3c9a989 = {
29623
29683
  configure: $181068e44290b873$export$8d21e34596265fa2,
29624
29684
  getDefaultConfig: $fe1d3ba9df1ecad5$export$ed30944e0fe6ae5c,