abcjs 6.6.3 → 6.6.4

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.
@@ -255,14 +255,19 @@ ChordTrack.prototype.interpretChord = function (name) {
255
255
  }
256
256
 
257
257
  ChordTrack.prototype.chordNotes = function (bass, modifier) {
258
- var intervals = this.chordIntervals[modifier];
258
+ // accept either chord spelling
259
+ modifier = modifier.replace(/♭/g,'b').replace(/♯/g,'#')
260
+
261
+ var intervals = chordIntervals[modifier];
259
262
  if (!intervals) {
263
+ // If the chord isn't in our list, we can at least guess
264
+ // whether it is major or minor.
260
265
  if (modifier.slice(0, 2).toLowerCase() === 'ma' || modifier[0] === 'M')
261
- intervals = this.chordIntervals.M;
266
+ intervals = chordIntervals.M;
262
267
  else if (modifier[0] === 'm' || modifier[0] === '-')
263
- intervals = this.chordIntervals.m;
268
+ intervals = chordIntervals.m;
264
269
  else
265
- intervals = this.chordIntervals.M;
270
+ intervals = chordIntervals.M;
266
271
  }
267
272
  bass += 12; // the chord is an octave above the bass note.
268
273
 
@@ -416,7 +421,7 @@ function extractNote(chord, index) {
416
421
  // This creates an arpeggio note no matter how many notes are in the chord - if it runs out of notes it continues in the next octave
417
422
  var octave = Math.floor(index / chord.chick.length)
418
423
  var note = chord.chick[index % chord.chick.length]
419
- //console.log(chord.chick, {index, octave, note}, index % chord.chick.length)
424
+ //console.log(chord.chick, {index, octave, note, index % chord.chick.length)
420
425
  return note + octave * 12
421
426
  }
422
427
 
@@ -477,131 +482,375 @@ ChordTrack.prototype.basses = {
477
482
  'A': 33, 'B': 35, 'C': 36, 'D': 38, 'E': 40, 'F': 41, 'G': 43
478
483
  };
479
484
 
480
- ChordTrack.prototype.chordIntervals = {
481
- // diminished (all flat 5 chords)
482
- 'dim': [0, 3, 6],
483
- '°': [0, 3, 6],
484
- '˚': [0, 3, 6],
485
-
486
- 'dim7': [0, 3, 6, 9],
487
- '°7': [0, 3, 6, 9],
488
- '˚7': [0, 3, 6, 9],
489
-
490
- 'ø7': [0, 3, 6, 10],
491
- 'm7(b5)': [0, 3, 6, 10],
492
- 'm7b5': [0, 3, 6, 10],
493
- 'm7♭5': [0, 3, 6, 10],
494
- '-7(b5)': [0, 3, 6, 10],
495
- '-7b5': [0, 3, 6, 10],
496
-
497
- '7b5': [0, 4, 6, 10],
498
- '7(b5)': [0, 4, 6, 10],
499
- '7♭5': [0, 4, 6, 10],
500
-
501
- '7(b9,b5)': [0, 4, 6, 10, 13],
502
- '7b9,b5': [0, 4, 6, 10, 13],
503
- '7(#9,b5)': [0, 4, 6, 10, 15],
504
- '7#9b5': [0, 4, 6, 10, 15],
505
- 'maj7(b5)': [0, 4, 6, 11],
506
- 'maj7b5': [0, 4, 6, 11],
507
- '13(b5)': [0, 4, 6, 10, 14, 21],
508
- '13b5': [0, 4, 6, 10, 14, 21],
509
-
510
- // minor (all normal 5, minor 3 chords)
511
- 'm': [0, 3, 7],
512
- '-': [0, 3, 7],
513
- 'm6': [0, 3, 7, 9],
514
- '-6': [0, 3, 7, 9],
515
- 'm7': [0, 3, 7, 10],
516
- '-7': [0, 3, 7, 10],
517
-
518
- '-(b6)': [0, 3, 7, 8],
519
- '-b6': [0, 3, 7, 8],
520
- '-6/9': [0, 3, 7, 9, 14],
521
- '-7(b9)': [0, 3, 7, 10, 13],
522
- '-7b9': [0, 3, 7, 10, 13],
523
- '-maj7': [0, 3, 7, 11],
524
- '-9+7': [0, 3, 7, 11, 13],
525
- '-11': [0, 3, 7, 11, 14, 17],
526
- 'm11': [0, 3, 7, 11, 14, 17],
527
- '-maj9': [0, 3, 7, 11, 14],
528
- '-∆9': [0, 3, 7, 11, 14],
529
- 'mM9': [0, 3, 7, 11, 14],
530
-
531
- // major (all normal 5, major 3 chords)
532
- 'M': [0, 4, 7],
533
- '6': [0, 4, 7, 9],
534
- '6/9': [0, 4, 7, 9, 14],
535
- '6add9': [0, 4, 7, 9, 14],
536
- '69': [0, 4, 7, 9, 14],
537
-
538
- '7': [0, 4, 7, 10],
539
- '9': [0, 4, 7, 10, 14],
540
- '11': [0, 7, 10, 14, 17],
541
- '13': [0, 4, 7, 10, 14, 21],
542
- '7b9': [0, 4, 7, 10, 13],
543
- '7♭9': [0, 4, 7, 10, 13],
544
- '7(b9)': [0, 4, 7, 10, 13],
545
- '7(#9)': [0, 4, 7, 10, 15],
546
- '7#9': [0, 4, 7, 10, 15],
547
- '(13)': [0, 4, 7, 10, 14, 21],
548
- '7(9,13)': [0, 4, 7, 10, 14, 21],
549
- '7(#9,b13)': [0, 4, 7, 10, 15, 20],
550
- '7(#11)': [0, 4, 7, 10, 14, 18],
551
- '7#11': [0, 4, 7, 10, 14, 18],
552
- '7(b13)': [0, 4, 7, 10, 20],
553
- '7b13': [0, 4, 7, 10, 20],
554
- '9(#11)': [0, 4, 7, 10, 14, 18],
555
- '9#11': [0, 4, 7, 10, 14, 18],
556
- '13(#11)': [0, 4, 7, 10, 18, 21],
557
- '13#11': [0, 4, 7, 10, 18, 21],
558
-
559
- 'maj7': [0, 4, 7, 11],
560
- '∆7': [0, 4, 7, 11],
561
- 'Δ7': [0, 4, 7, 11],
562
- 'maj9': [0, 4, 7, 11, 14],
563
- 'maj7(9)': [0, 4, 7, 11, 14],
564
- 'maj7(11)': [0, 4, 7, 11, 17],
565
- 'maj7(#11)': [0, 4, 7, 11, 18],
566
- 'maj7(13)': [0, 4, 7, 14, 21],
567
- 'maj7(9,13)': [0, 4, 7, 11, 14, 21],
568
-
569
- '7sus4': [0, 5, 7, 10],
570
- 'm7sus4': [0, 3, 7, 10, 17],
571
- 'sus4': [0, 5, 7],
572
- 'sus2': [0, 2, 7],
573
- '7sus2': [0, 2, 7, 10],
574
- '9sus4': [0, 5, 7, 10, 14],
575
- '13sus4': [0, 5, 7, 10, 14, 21],
576
-
577
- // augmented (all sharp 5 chords)
578
- 'aug7': [0, 4, 8, 10],
579
- '+7': [0, 4, 8, 10],
580
- '+': [0, 4, 8],
581
- '7#5': [0, 4, 8, 10],
582
- '7♯5': [0, 4, 8, 10],
583
- '7+5': [0, 4, 8, 10],
584
- '9#5': [0, 4, 8, 10, 14],
585
- '9♯5': [0, 4, 8, 10, 14],
586
- '9+5': [0, 4, 8, 10, 14],
587
- '-7(#5)': [0, 3, 8, 10],
588
- '-7#5': [0, 3, 8, 10],
589
- '7(#5)': [0, 4, 8, 10],
590
- '7(b9,#5)': [0, 4, 8, 10, 13],
591
- '7b9#5': [0, 4, 8, 10, 13],
592
- 'maj7(#5)': [0, 4, 8, 11],
593
- 'maj7#5': [0, 4, 8, 11],
594
- 'maj7(#5,#11)': [0, 4, 8, 11, 18],
595
- 'maj7#5#11': [0, 4, 8, 11, 18],
596
- '9(#5)': [0, 4, 8, 10, 14],
597
- '13(#5)': [0, 4, 8, 10, 14, 21],
598
- '13#5': [0, 4, 8, 10, 14, 21],
599
- // MAE Power chords added 10 April 2024
600
- '5': [0, 7],
601
- '5(8)': [0, 7, 12],
602
- '5add8': [0, 7, 12]
603
-
604
- };
485
+ var chordIntervals = {
486
+ // unusual chords
487
+ "-addb2": [0, 1, 3, 7],
488
+ "maddb2": [0, 1, 3, 7],
489
+ "addb2": [0, 1, 4, 7],
490
+ "susb2": [0, 1, 7],
491
+ "-add2": [0, 2, 3, 7],
492
+ "madd2": [0, 2, 3, 7],
493
+ "add2": [0, 2, 4, 7],
494
+ "sus2": [0, 2, 7],
495
+ "-7sus2": [0, 2, 7, 10],
496
+ "7sus2": [0, 2, 7, 10],
497
+ "m7sus2": [0, 2, 7, 10],
498
+ "min7sus2": [0, 2, 7, 10],
499
+ "7sus2/9": [0, 2, 7, 10, 14],
500
+ "add#2": [0, 3, 4, 7],
501
+ "-add4": [0, 3, 5, 7],
502
+ "madd4": [0, 3, 5, 7],
503
+
504
+ // diminished chords
505
+ "dim": [0, 3, 6],
506
+ "m(b5)": [0, 3, 6],
507
+ "°": [0, 3, 6],
508
+ "˚": [0, 3, 6],
509
+ "-add#4": [0, 3, 6, 7],
510
+ "madd#4": [0, 3, 6, 7],
511
+ "dim7": [0, 3, 6, 9],
512
+ "°7": [0, 3, 6, 9],
513
+ "˚7": [0, 3, 6, 9],
514
+ "-7(b5)": [0, 3, 6, 10],
515
+ "-7b5": [0, 3, 6, 10],
516
+ "m7(b5)": [0, 3, 6, 10],
517
+ "m7b5": [0, 3, 6, 10],
518
+ "ø": [0, 3, 6, 10],
519
+ "ø7": [0, 3, 6, 10],
520
+
521
+ // minor chords
522
+ "-": [0, 3, 7],
523
+ "m": [0, 3, 7],
524
+ "-(b6)": [0, 3, 7, 8],
525
+ "-b6": [0, 3, 7, 8],
526
+ "m(b6)": [0, 3, 7, 8],
527
+ "mb6": [0, 3, 7, 8],
528
+ "-6": [0, 3, 7, 9],
529
+ "m6": [0, 3, 7, 9],
530
+ "-6(9)": [0, 3, 7, 9, 14],
531
+ "-6/9": [0, 3, 7, 9, 14],
532
+ "-69": [0, 3, 7, 9, 14],
533
+ "m6(9)": [0, 3, 7, 9, 14],
534
+ "m6/9": [0, 3, 7, 9, 14],
535
+ "m69": [0, 3, 7, 9, 14],
536
+ "-7": [0, 3, 7, 10],
537
+ "m7": [0, 3, 7, 10],
538
+ "-7(b9)": [0, 3, 7, 10, 13],
539
+ "-7b9": [0, 3, 7, 10, 13],
540
+ "-7(9)": [0, 3, 7, 10, 14],
541
+ "-7/9": [0, 3, 7, 10, 14],
542
+ "-9": [0, 3, 7, 10, 14],
543
+ "m7(9)": [0, 3, 7, 10, 14],
544
+ "m7/9": [0, 3, 7, 10, 14],
545
+ "m9": [0, 3, 7, 10, 14],
546
+ "-7(9,11)": [0, 3, 7, 10, 14, 17],
547
+ "-7/9/11": [0, 3, 7, 10, 14, 17],
548
+ "m7(9,11)": [0, 3, 7, 10, 14, 17],
549
+ "m7/9/11": [0, 3, 7, 10, 14, 17],
550
+ "-13": [0, 3, 7, 10, 14, 17, 21],
551
+ "-7(9,11,13)": [0, 3, 7, 10, 14, 17, 21],
552
+ "-7/9/11/13": [0, 3, 7, 10, 14, 17, 21],
553
+ "m13": [0, 3, 7, 10, 14, 17, 21],
554
+ "m7(9,11,13)": [0, 3, 7, 10, 14, 17, 21],
555
+ "m7/9/11/13": [0, 3, 7, 10, 14, 17, 21],
556
+ "-7(9,13)": [0, 3, 7, 10, 14, 21],
557
+ "-7/9/13": [0, 3, 7, 10, 14, 21],
558
+ "m7(9,13)": [0, 3, 7, 10, 14, 21],
559
+ "m7/9/13": [0, 3, 7, 10, 14, 21],
560
+ "-7(11)": [0, 3, 7, 10, 17],
561
+ "-7/11": [0, 3, 7, 10, 17],
562
+ "m7(11)": [0, 3, 7, 10, 17],
563
+ "m7/11": [0, 3, 7, 10, 17],
564
+ "-7(11,13)": [0, 3, 7, 10, 17, 21],
565
+ "-7/11/13": [0, 3, 7, 10, 17, 21],
566
+ "m7(11,13)": [0, 3, 7, 10, 17, 21],
567
+ "m7/11/13": [0, 3, 7, 10, 17, 21],
568
+ "-(maj7)": [0, 3, 7, 11],
569
+ "-7M": [0, 3, 7, 11],
570
+ "-maj7": [0, 3, 7, 11],
571
+ "-∆7": [0, 3, 7, 11],
572
+ "m(maj7)": [0, 3, 7, 11],
573
+ "mM7": [0, 3, 7, 11],
574
+ "min(maj7)": [0, 3, 7, 11],
575
+ "-9+7": [0, 3, 7, 11, 13],
576
+ "-(maj9)": [0, 3, 7, 11, 14],
577
+ "-7M(9)": [0, 3, 7, 11, 14],
578
+ "-maj9": [0, 3, 7, 11, 14],
579
+ "-∆9": [0, 3, 7, 11, 14],
580
+ "m(maj9)": [0, 3, 7, 11, 14],
581
+ "mM9": [0, 3, 7, 11, 14],
582
+ "min(maj9)": [0, 3, 7, 11, 14],
583
+ "-11": [0, 3, 7, 11, 14, 17],
584
+ "m11": [0, 3, 7, 11, 14, 17],
585
+ "-addb9": [0, 3, 7, 13],
586
+ "maddb9": [0, 3, 7, 13],
587
+ "-add9": [0, 3, 7, 14],
588
+ "madd9": [0, 3, 7, 14],
589
+ "-add11": [0, 3, 7, 17],
590
+ "madd11": [0, 3, 7, 17],
591
+ "-add#11": [0, 3, 7, 18],
592
+ "madd#11": [0, 3, 7, 18],
593
+
594
+ // altered minor chords
595
+ "-#5": [0, 3, 8],
596
+ "-(#5)": [0, 3, 8],
597
+ "m#5": [0, 3, 8],
598
+ "m(#5)": [0, 3, 8],
599
+ "-7#5": [0, 3, 8, 10],
600
+ "-7(#5)": [0, 3, 8, 10],
601
+ "dim7(b13)": [0, 3, 9, 20],
602
+ "°7(b13)": [0, 3, 9, 20],
603
+ "˚7(b13)": [0, 3, 9, 20],
604
+
605
+ // altered major chords
606
+ "add4": [0, 4, 5, 7],
607
+ "maj(b5)": [0, 4, 6],
608
+ "majb5": [0, 4, 6],
609
+ "add#4": [0, 4, 6, 7],
610
+ "7(b5)": [0, 4, 6, 10],
611
+ "7b5": [0, 4, 6, 10],
612
+ "7(b5,b9)": [0, 4, 6, 10, 13],
613
+ "7(b9,b5)": [0, 4, 6, 10, 13],
614
+ "7b5(b9)": [0, 4, 6, 10, 13],
615
+ "7b9,b5": [0, 4, 6, 10, 13],
616
+ "7b9b5": [0, 4, 6, 10, 13],
617
+ "7(b5,b9,b13)": [0, 4, 6, 10, 13, 20],
618
+ "7/b5/b9/b13": [0, 4, 6, 10, 13, 20],
619
+ "7b5/b9/b13": [0, 4, 6, 10, 13, 20],
620
+ "7(b5,b9,13)": [0, 4, 6, 10, 13, 21],
621
+ "7/b5/b9/13": [0, 4, 6, 10, 13, 21],
622
+ "7b5/b9/13": [0, 4, 6, 10, 13, 21],
623
+ "7(9,b5)": [0, 4, 6, 10, 14],
624
+ "7(b5,9)": [0, 4, 6, 10, 14],
625
+ "7b5(9)": [0, 4, 6, 10, 14],
626
+ "9b5": [0, 4, 6, 10, 14],
627
+ "13(b5)": [0, 4, 6, 10, 14, 21],
628
+ "13b5": [0, 4, 6, 10, 14, 21],
629
+ "7(b5,9,13)": [0, 4, 6, 10, 14, 21],
630
+ "7/b5/9/13": [0, 4, 6, 10, 14, 21],
631
+ "7b5/9/13": [0, 4, 6, 10, 14, 21],
632
+ "7#9b5": [0, 4, 6, 10, 15],
633
+ "7(#9,b5)": [0, 4, 6, 10, 15],
634
+ "7(b5,#9)": [0, 4, 6, 10, 15],
635
+ "7b5(#9)": [0, 4, 6, 10, 15],
636
+ "7(b5,#9,b13)": [0, 4, 6, 10, 15, 20],
637
+ "7/b5/#9/b13": [0, 4, 6, 10, 15, 20],
638
+ "7b5/#9/b13": [0, 4, 6, 10, 15, 20],
639
+ "7(b5,#9,13)": [0, 4, 6, 10, 15, 21],
640
+ "7/b5/#9/13": [0, 4, 6, 10, 15, 21],
641
+ "7b5/#9/13": [0, 4, 6, 10, 15, 21],
642
+ "7(b5,b13)": [0, 4, 6, 10, 20],
643
+ "7/b5/b13": [0, 4, 6, 10, 20],
644
+ "7b5/b13": [0, 4, 6, 10, 20],
645
+ "7(b5,13)": [0, 4, 6, 10, 21],
646
+ "7/b5/13": [0, 4, 6, 10, 21],
647
+ "7b5(13)": [0, 4, 6, 10, 21],
648
+ "7b5/13": [0, 4, 6, 10, 21],
649
+ "7M(b5)": [0, 4, 6, 11],
650
+ "maj7(b5)": [0, 4, 6, 11],
651
+ "maj7b5": [0, 4, 6, 11],
652
+ "7M(b5,9)": [0, 4, 6, 11, 14],
653
+ "maj7(b5,9)": [0, 4, 6, 11, 14],
654
+ "maj7b5/9": [0, 4, 6, 11, 14],
655
+ "7M(b5,9,13)": [0, 4, 6, 11, 14, 21],
656
+ "maj7(b5,9,13)": [0, 4, 6, 11, 14, 21],
657
+ "maj7b5/9/13": [0, 4, 6, 11, 14, 21],
658
+ "7M(b5,13)": [0, 4, 6, 11, 21],
659
+ "maj7(b5,13)": [0, 4, 6, 11, 21],
660
+ "maj7b5/13": [0, 4, 6, 11, 21],
661
+
662
+ // major chords
663
+ "M": [0, 4, 7],
664
+ "Δ": [0, 4, 7],
665
+ "∆": [0, 4, 7],
666
+ "6": [0, 4, 7, 9],
667
+ "6(9)": [0, 4, 7, 9, 14],
668
+ "6/9": [0, 4, 7, 9, 14],
669
+ "69": [0, 4, 7, 9, 14],
670
+ "6add9": [0, 4, 7, 9, 14],
671
+ "6(9,11)": [0, 4, 7, 9, 14, 17],
672
+ "6/9/11": [0, 4, 7, 9, 14, 17],
673
+ "6911": [0, 4, 7, 9, 14, 17],
674
+ "6(9,#11)": [0, 4, 7, 9, 14, 18],
675
+ "6/9/#11": [0, 4, 7, 9, 14, 18],
676
+ "69#11": [0, 4, 7, 9, 14, 18],
677
+ "6(11)": [0, 4, 7, 9, 17],
678
+ "6/11": [0, 4, 7, 9, 17],
679
+ "611": [0, 4, 7, 9, 17],
680
+ "6#11": [0, 4, 7, 9, 18],
681
+ "6(#11)": [0, 4, 7, 9, 18],
682
+ "6/#11": [0, 4, 7, 9, 18],
683
+ "7": [0, 4, 7, 10],
684
+ "7(b9)": [0, 4, 7, 10, 13],
685
+ "7b9": [0, 4, 7, 10, 13],
686
+ "7(9)": [0, 4, 7, 10, 14],
687
+ "7/9": [0, 4, 7, 10, 14],
688
+ "9": [0, 4, 7, 10, 14],
689
+ "7(9,11)": [0, 4, 7, 10, 14, 17],
690
+ "7/9/11": [0, 4, 7, 10, 14, 17],
691
+ "7(9,11,13)": [0, 4, 7, 10, 14, 17, 21],
692
+ "7/9/11/13": [0, 4, 7, 10, 14, 17, 21],
693
+ "7#11": [0, 4, 7, 10, 14, 18],
694
+ "7(#11)": [0, 4, 7, 10, 14, 18],
695
+ "9#11": [0, 4, 7, 10, 14, 18],
696
+ "9(#11)": [0, 4, 7, 10, 14, 18],
697
+ "(13)": [0, 4, 7, 10, 14, 21],
698
+ "13": [0, 4, 7, 10, 14, 21],
699
+ "7(9,13)": [0, 4, 7, 10, 14, 21],
700
+ "7/9/13": [0, 4, 7, 10, 14, 21],
701
+ "9/13": [0, 4, 7, 10, 14, 21],
702
+ "7#9": [0, 4, 7, 10, 15],
703
+ "7(#9)": [0, 4, 7, 10, 15],
704
+ "7(#9,b13)": [0, 4, 7, 10, 15, 20],
705
+ "7(11)": [0, 4, 7, 10, 17],
706
+ "7/11": [0, 4, 7, 10, 17],
707
+ "7(11,13)": [0, 4, 7, 10, 17, 21],
708
+ "7/11/13": [0, 4, 7, 10, 17, 21],
709
+ "13#11": [0, 4, 7, 10, 18, 21],
710
+ "13(#11)": [0, 4, 7, 10, 18, 21],
711
+ "7(b13)": [0, 4, 7, 10, 20],
712
+ "7b13": [0, 4, 7, 10, 20],
713
+ "7(13)": [0, 4, 7, 10, 21],
714
+ "7/13": [0, 4, 7, 10, 21],
715
+ "7M": [0, 4, 7, 11],
716
+ "maj7": [0, 4, 7, 11],
717
+ "Δ7": [0, 4, 7, 11],
718
+ "∆7": [0, 4, 7, 11],
719
+ "7M(9)": [0, 4, 7, 11, 14],
720
+ "7M/9": [0, 4, 7, 11, 14],
721
+ "maj7(9)": [0, 4, 7, 11, 14],
722
+ "maj7/9": [0, 4, 7, 11, 14],
723
+ "maj9": [0, 4, 7, 11, 14],
724
+ "Δ9": [0, 4, 7, 11, 14],
725
+ "∆9": [0, 4, 7, 11, 14],
726
+ "7M(9,11)": [0, 4, 7, 11, 14, 17],
727
+ "7M/9/11": [0, 4, 7, 11, 14, 17],
728
+ "maj11": [0, 4, 7, 11, 14, 17],
729
+ "maj7(9,11)": [0, 4, 7, 11, 14, 17],
730
+ "maj7/9/11": [0, 4, 7, 11, 14, 17],
731
+ "Δ11": [0, 4, 7, 11, 14, 17],
732
+ "∆11": [0, 4, 7, 11, 14, 17],
733
+ "7M(9,11,13)": [0, 4, 7, 11, 14, 17, 21],
734
+ "7M/9/11/13": [0, 4, 7, 11, 14, 17, 21],
735
+ "maj13": [0, 4, 7, 11, 14, 17, 21],
736
+ "maj7(9,11,13)": [0, 4, 7, 11, 14, 17, 21],
737
+ "maj7/9/11/13": [0, 4, 7, 11, 14, 17, 21],
738
+ "Δ11(13)": [0, 4, 7, 11, 14, 17, 21],
739
+ "Δ13": [0, 4, 7, 11, 14, 17, 21],
740
+ "∆11(13)": [0, 4, 7, 11, 14, 17, 21],
741
+ "7M(9,#11)": [0, 4, 7, 11, 14, 18],
742
+ "7M/9/#11": [0, 4, 7, 11, 14, 18],
743
+ "maj7(9,#11)": [0, 4, 7, 11, 14, 18],
744
+ "maj7/9/#11": [0, 4, 7, 11, 14, 18],
745
+ "maj9#11": [0, 4, 7, 11, 14, 18],
746
+ "maj9(#11)": [0, 4, 7, 11, 14, 18],
747
+ "maj9/#11": [0, 4, 7, 11, 14, 18],
748
+ "Δ9(#11)": [0, 4, 7, 11, 14, 18],
749
+ "7M(9,#11,13)": [0, 4, 7, 11, 14, 18, 21],
750
+ "7M/9/#11/13": [0, 4, 7, 11, 14, 18, 21],
751
+ "maj13#11": [0, 4, 7, 11, 14, 18, 21],
752
+ "maj13(#11)": [0, 4, 7, 11, 14, 18, 21],
753
+ "maj13/#11": [0, 4, 7, 11, 14, 18, 21],
754
+ "Δ13(#11)": [0, 4, 7, 11, 14, 18, 21],
755
+ "∆13(#11)": [0, 4, 7, 11, 14, 18, 21],
756
+ "7M(9,13)": [0, 4, 7, 11, 14, 21],
757
+ "7M/9/13": [0, 4, 7, 11, 14, 21],
758
+ "maj7(9,13)": [0, 4, 7, 11, 14, 21],
759
+ "maj7/9/13": [0, 4, 7, 11, 14, 21],
760
+ "maj9(13)": [0, 4, 7, 11, 14, 21],
761
+ "Δ9(13)": [0, 4, 7, 11, 14, 21],
762
+ "∆9(13)": [0, 4, 7, 11, 14, 21],
763
+ "7M(11)": [0, 4, 7, 11, 17],
764
+ "7M/11": [0, 4, 7, 11, 17],
765
+ "maj7(11)": [0, 4, 7, 11, 17],
766
+ "maj7/11": [0, 4, 7, 11, 17],
767
+ "Δ7(11)": [0, 4, 7, 11, 17],
768
+ "∆7(11)": [0, 4, 7, 11, 17],
769
+ "7M(#11)": [0, 4, 7, 11, 18],
770
+ "7M/#11": [0, 4, 7, 11, 18],
771
+ "maj7(#11)": [0, 4, 7, 11, 18],
772
+ "maj7/#11": [0, 4, 7, 11, 18],
773
+ "Δ7(#11)": [0, 4, 7, 11, 18],
774
+ "∆7(#11)": [0, 4, 7, 11, 18],
775
+ "7M(13)": [0, 4, 7, 11, 21],
776
+ "7M/13": [0, 4, 7, 11, 21],
777
+ "maj7(13)": [0, 4, 7, 11, 21],
778
+ "maj7/13": [0, 4, 7, 11, 21],
779
+ "Δ7(13)": [0, 4, 7, 11, 21],
780
+ "∆7(13)": [0, 4, 7, 11, 21],
781
+ "addb9": [0, 4, 7, 13],
782
+ "add9": [0, 4, 7, 14],
783
+ "add#9": [0, 4, 7, 15],
784
+ "add11": [0, 4, 7, 17],
785
+ "add#11": [0, 4, 7, 18],
786
+
787
+ // augmented chords
788
+ "+": [0, 4, 8],
789
+ "aug": [0, 4, 8],
790
+ "+7": [0, 4, 8, 10],
791
+ "7#5": [0, 4, 8, 10],
792
+ "7(#5)": [0, 4, 8, 10],
793
+ "7+5": [0, 4, 8, 10],
794
+ "aug7": [0, 4, 8, 10],
795
+ "7(b9,#5)": [0, 4, 8, 10, 13],
796
+ "7b9#5": [0, 4, 8, 10, 13],
797
+ "9#5": [0, 4, 8, 10, 14],
798
+ "9(#5)": [0, 4, 8, 10, 14],
799
+ "9+5": [0, 4, 8, 10, 14],
800
+ "13#5": [0, 4, 8, 10, 14, 21],
801
+ "13(#5)": [0, 4, 8, 10, 14, 21],
802
+ "7M(#5)": [0, 4, 8, 11],
803
+ "maj7#5": [0, 4, 8, 11],
804
+ "maj7(#5)": [0, 4, 8, 11],
805
+ "7M(#5,9)": [0, 4, 8, 11, 14],
806
+ "maj7#5/9": [0, 4, 8, 11, 14],
807
+ "maj7(#5,9)": [0, 4, 8, 11, 14],
808
+ "maj7#5#11": [0, 4, 8, 11, 18],
809
+ "maj7(#5,#11)": [0, 4, 8, 11, 18],
810
+
811
+ // sus4 chords
812
+ "sus": [0, 5, 7],
813
+ "sus4": [0, 5, 7],
814
+ "-7sus4": [0, 5, 7, 10],
815
+ "7sus": [0, 5, 7, 10],
816
+ "7sus4": [0, 5, 7, 10],
817
+ "m7sus4": [0, 5, 7, 10],
818
+ "min7sus4": [0, 5, 7, 10],
819
+ "7sus(b9)": [0, 5, 7, 10, 13],
820
+ "7sus4(b9)": [0, 5, 7, 10, 13],
821
+ "-9sus4": [0, 5, 7, 10, 14],
822
+ "7sus4(9)": [0, 5, 7, 10, 14],
823
+ "7sus4/9": [0, 5, 7, 10, 14],
824
+ "9sus": [0, 5, 7, 10, 14],
825
+ "9sus4": [0, 5, 7, 10, 14],
826
+ "m9sus4": [0, 5, 7, 10, 14],
827
+ "min9sus4": [0, 5, 7, 10, 14],
828
+ "11sus4": [0, 5, 7, 10, 14, 17],
829
+ "13sus4": [0, 5, 7, 10, 14, 21],
830
+ "7sus(#9)": [0, 5, 7, 10, 15],
831
+ "7sus4(#9)": [0, 5, 7, 10, 15],
832
+ "7sus4(11)": [0, 5, 7, 10, 17],
833
+ "7sus4(13)": [0, 5, 7, 10, 21],
834
+ "7Msus": [0, 5, 7, 11],
835
+ "7Msus4": [0, 5, 7, 11],
836
+ "maj7sus": [0, 5, 7, 11],
837
+ "maj7sus4": [0, 5, 7, 11],
838
+
839
+ // power chords and unusual chords
840
+ "#4": [0, 6],
841
+ "b5": [0, 6],
842
+ "sus#4": [0, 6, 7],
843
+ "7Msus#4": [0, 6, 11],
844
+ "maj7sus#4": [0, 6, 11],
845
+ "5": [0, 7],
846
+ "11": [0, 7, 10, 14, 17],
847
+ "5(8)": [0, 7, 12],
848
+ "5add8": [0, 7, 12],
849
+ "5(9)": [0, 7, 14],
850
+ "5add9": [0, 7, 14],
851
+ "#5": [0, 8],
852
+ "b6": [0, 8],
853
+ }
605
854
 
606
855
  ChordTrack.prototype.rhythmPatterns = {
607
856
  "2/2": ['boom', '', '', '', 'chick', '', '', ''],
@@ -317,8 +317,14 @@ function CreateSynth() {
317
317
 
318
318
  var noteMapTracks = createNoteMap(self.flattened);
319
319
 
320
- if (self.options.swing)
321
- addSwing(noteMapTracks, self.options.swing, self.meterFraction, self.pickupLength)
320
+ if (self.options.swing) {
321
+ // If we have a drum intro, then the pickup is already incorporated into the beat.
322
+ // That is, without a drum intro, the first note starts at 0 whether it
323
+ // is a pickup or not. With a drum intro, the first note will be in its
324
+ // proper place.
325
+ var pickupLength = self.options.drumIntro ? 0 : self.pickupLength
326
+ addSwing(noteMapTracks, self.options.swing, self.meterFraction, pickupLength)
327
+ }
322
328
 
323
329
  if (self.sequenceCallback)
324
330
  self.sequenceCallback(noteMapTracks, self.callbackContext);
@@ -564,7 +570,7 @@ function CreateSynth() {
564
570
  function addSwing(noteMapTracks, swing, meterFraction, pickupLength) {
565
571
 
566
572
  // we can only swing in X/4 and X/8 meters.
567
- if (meterFraction.den != 4 && meterFraction.den != 8)
573
+ if (meterFraction.den !== 4 && meterFraction.den !== 8)
568
574
  return;
569
575
 
570
576
  swing = parseFloat(swing);
@@ -586,7 +592,7 @@ function CreateSynth() {
586
592
  // could be also in the settings. Try out values such 0.1, 0.2
587
593
  var volumeIncrease = 0.0;
588
594
 
589
- // the beatLength in X/8 meters
595
+ // the beatLength in X/4 meters
590
596
  var beatLength = 0.25;
591
597
 
592
598
  // in X/8 meters the 16s swing so the beatLength is halved
@@ -605,15 +611,15 @@ function CreateSynth() {
605
611
  var event = track[i];
606
612
  if (
607
613
  // is halfbeat
608
- (event.start-pickupLength) % halfbeatLength == 0 && (event.start-pickupLength) % beatLength != 0
614
+ (event.start-pickupLength) % halfbeatLength === 0 && (event.start-pickupLength) % beatLength !== 0
609
615
  && (
610
616
  // the previous note is on the beat or before OR there is no previous note
611
- i == 0
617
+ i === 0
612
618
  || track[i-1].start <= track[i].start - halfbeatLength
613
619
  )
614
620
  && (
615
621
  // the next note is on the beat or after OR there is no next note
616
- i == track.length - 1
622
+ i === track.length - 1
617
623
  || track[i+1].start >= track[i].start + halfbeatLength
618
624
  )
619
625
  ) {
@@ -626,7 +632,7 @@ function CreateSynth() {
626
632
 
627
633
  // if there is a previous note ending at the start of this note, extend its end
628
634
  // and decrease its volume
629
- if (i > 0 && track[i-1].end == oldEventStart) {
635
+ if (i > 0 && track[i-1].end === oldEventStart) {
630
636
  track[i-1].end = event.start;
631
637
  track[i-1].volume *= 1 - volumeIncrease;
632
638
  }
@@ -15,10 +15,10 @@ function Repeats(voice) {
15
15
  this.sections.push({type: "startRepeat", index: this.sections[this.sections.length-1].index})
16
16
  this.sections.push({type: "endRepeat", index: thisIndex})
17
17
  }
18
- if (isStartRepeat)
19
- this.sections.push({type:"startRepeat", index: thisIndex})
20
18
  if (startEnding)
21
19
  this.sections.push({type:"startEnding", index: thisIndex, endings: startEnding})
20
+ if (isStartRepeat)
21
+ this.sections.push({type:"startRepeat", index: thisIndex})
22
22
  }
23
23
 
24
24
  this.resolveRepeats = function() {
@@ -8,7 +8,7 @@ function printLine(renderer, x1, x2, y, klass, name, dy) {
8
8
  var y1 = roundNumber(y - dy);
9
9
  var y2 = roundNumber(y + dy);
10
10
  // TODO-PER: This fixes a firefox bug where it isn't displayed
11
- if (renderer.firefox112) {
11
+ if (renderer.firefox) {
12
12
  y += dy / 2; // Because the y coordinate is the edge of where the line goes but the width widens from the middle.
13
13
  var attr = {
14
14
  x1: x1,
@@ -39,4 +39,3 @@ function printLine(renderer, x1, x2, y, klass, name, dy) {
39
39
  }
40
40
 
41
41
  module.exports = printLine;
42
-
@@ -13,7 +13,7 @@ function printStem(renderer, x, dx, y1, y2, klass, name) {
13
13
  x = roundNumber(x);
14
14
  var x2 = roundNumber(x + dx);
15
15
  // TODO-PER: This fixes a firefox bug where it isn't displayed
16
- if (renderer.firefox112) {
16
+ if (renderer.firefox) {
17
17
  x += dx / 2; // Because the x coordinate is the edge of where the line goes but the width widens from the middle.
18
18
  var attr = {
19
19
  x1: x,
@@ -351,7 +351,7 @@ function splitSvgIntoLines(renderer, output, title, responsive, scale) {
351
351
  if (responsive === 'resize')
352
352
  svg.style.position = ''
353
353
  // TODO-PER: Hack! Not sure why this is needed.
354
- var viewBoxHeight = renderer.firefox112 ? height+1 : height
354
+ var viewBoxHeight = renderer.firefox ? height+1 : height
355
355
  svg.setAttribute("viewBox", "0 " + nextTop + " " + width + " " + viewBoxHeight)
356
356
  svg.appendChild(style.cloneNode(true))
357
357
  var titleEl = document.createElement("title")
@@ -16,7 +16,7 @@ var Renderer = function (paper) {
16
16
  this.space = 3 * spacing.SPACE;
17
17
  this.padding = {}; // renderer's padding is managed by the controller
18
18
  this.reset();
19
- this.firefox112 = navigator.userAgent.indexOf('Firefox/112.0') >= 0
19
+ this.firefox = navigator.userAgent.indexOf('Firefox/') >= 0
20
20
  };
21
21
 
22
22
  Renderer.prototype.reset = function () {