chordsheetjs 7.2.0 → 7.4.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/README.md CHANGED
@@ -639,9 +639,9 @@ If not, it returns [INDETERMINATE](#INDETERMINATE)</p>
639
639
  * [.clone()](#Song+clone) ⇒ [<code>Song</code>](#Song)
640
640
  * [.setKey(key)](#Song+setKey) ⇒ [<code>Song</code>](#Song)
641
641
  * [.setCapo(capo)](#Song+setCapo) ⇒ [<code>Song</code>](#Song)
642
- * [.transpose(delta)](#Song+transpose) ⇒ [<code>Song</code>](#Song)
643
- * [.transposeUp()](#Song+transposeUp) ⇒ [<code>Song</code>](#Song)
644
- * [.transposeDown()](#Song+transposeDown) ⇒ [<code>Song</code>](#Song)
642
+ * [.transpose(delta, [options])](#Song+transpose) ⇒ [<code>Song</code>](#Song)
643
+ * [.transposeUp([options])](#Song+transposeUp) ⇒ [<code>Song</code>](#Song)
644
+ * [.transposeDown([options])](#Song+transposeDown) ⇒ [<code>Song</code>](#Song)
645
645
  * [.changeKey(newKey)](#Song+changeKey) ⇒ [<code>Song</code>](#Song)
646
646
  * [.changeMetadata(name, value)](#Song+changeMetadata)
647
647
  * [.mapItems(func)](#Song+mapItems) ⇒ [<code>Song</code>](#Song)
@@ -729,7 +729,7 @@ if you want to skip the &quot;header lines&quot;: the lines that only contain me
729
729
 
730
730
  <a name="Song+transpose"></a>
731
731
 
732
- ### song.transpose(delta) ⇒ [<code>Song</code>](#Song)
732
+ ### song.transpose(delta, [options]) ⇒ [<code>Song</code>](#Song)
733
733
  <p>Transposes the song by the specified delta. It will:</p>
734
734
  <ul>
735
735
  <li>transpose all chords, see: [transpose](#Chord+transpose)</li>
@@ -740,13 +740,15 @@ if you want to skip the &quot;header lines&quot;: the lines that only contain me
740
740
  **Kind**: instance method of [<code>Song</code>](#Song)
741
741
  **Returns**: [<code>Song</code>](#Song) - <p>The transposed song</p>
742
742
 
743
- | Param | Type | Description |
744
- | --- | --- | --- |
745
- | delta | <code>number</code> | <p>The number of semitones (positive or negative) to transpose with</p> |
743
+ | Param | Type | Default | Description |
744
+ | --- | --- | --- | --- |
745
+ | delta | <code>number</code> | | <p>The number of semitones (positive or negative) to transpose with</p> |
746
+ | [options] | <code>Object</code> | <code>{}</code> | <p>options</p> |
747
+ | [options.normalizeChordSuffix] | <code>boolean</code> | <code>false</code> | <p>whether to normalize the chord suffixes after transposing</p> |
746
748
 
747
749
  <a name="Song+transposeUp"></a>
748
750
 
749
- ### song.transposeUp() ⇒ [<code>Song</code>](#Song)
751
+ ### song.transposeUp([options]) ⇒ [<code>Song</code>](#Song)
750
752
  <p>Transposes the song up by one semitone. It will:</p>
751
753
  <ul>
752
754
  <li>transpose all chords, see: [transpose](#Chord+transpose)</li>
@@ -756,9 +758,15 @@ if you want to skip the &quot;header lines&quot;: the lines that only contain me
756
758
 
757
759
  **Kind**: instance method of [<code>Song</code>](#Song)
758
760
  **Returns**: [<code>Song</code>](#Song) - <p>The transposed song</p>
761
+
762
+ | Param | Type | Default | Description |
763
+ | --- | --- | --- | --- |
764
+ | [options] | <code>Object</code> | <code>{}</code> | <p>options</p> |
765
+ | [options.normalizeChordSuffix] | <code>boolean</code> | <code>false</code> | <p>whether to normalize the chord suffixes after transposing</p> |
766
+
759
767
  <a name="Song+transposeDown"></a>
760
768
 
761
- ### song.transposeDown() ⇒ [<code>Song</code>](#Song)
769
+ ### song.transposeDown([options]) ⇒ [<code>Song</code>](#Song)
762
770
  <p>Transposes the song down by one semitone. It will:</p>
763
771
  <ul>
764
772
  <li>transpose all chords, see: [transpose](#Chord+transpose)</li>
@@ -768,6 +776,12 @@ if you want to skip the &quot;header lines&quot;: the lines that only contain me
768
776
 
769
777
  **Kind**: instance method of [<code>Song</code>](#Song)
770
778
  **Returns**: [<code>Song</code>](#Song) - <p>The transposed song</p>
779
+
780
+ | Param | Type | Default | Description |
781
+ | --- | --- | --- | --- |
782
+ | [options] | <code>Object</code> | <code>{}</code> | <p>options</p> |
783
+ | [options.normalizeChordSuffix] | <code>boolean</code> | <code>false</code> | <p>whether to normalize the chord suffixes after transposing</p> |
784
+
771
785
  <a name="Song+changeKey"></a>
772
786
 
773
787
  ### song.changeKey(newKey) ⇒ [<code>Song</code>](#Song)
@@ -1188,7 +1202,7 @@ Inherits from [ChordSheetParser](#ChordSheetParser)</p>
1188
1202
  * [.toNumericString([key])](#Chord+toNumericString) ⇒ <code>string</code>
1189
1203
  * [.isNumeral()](#Chord+isNumeral) ⇒ <code>boolean</code>
1190
1204
  * [.toString()](#Chord+toString) ⇒ <code>string</code>
1191
- * [.normalize()](#Chord+normalize) ⇒ [<code>Chord</code>](#Chord)
1205
+ * [.normalize([key], [options])](#Chord+normalize) ⇒ [<code>Chord</code>](#Chord)
1192
1206
  * [.useModifier(newModifier)](#Chord+useModifier) ⇒ [<code>Chord</code>](#Chord)
1193
1207
  * [.transposeUp()](#Chord+transposeUp) ⇒ [<code>Chord</code>](#Chord)
1194
1208
  * [.transposeDown()](#Chord+transposeDown) ⇒ [<code>Chord</code>](#Chord)
@@ -1312,7 +1326,7 @@ For example, a chord symbol A# with reference key E will return the numeric chor
1312
1326
  **Returns**: <code>string</code> - <p>the chord string</p>
1313
1327
  <a name="Chord+normalize"></a>
1314
1328
 
1315
- ### chord.normalize() ⇒ [<code>Chord</code>](#Chord)
1329
+ ### chord.normalize([key], [options]) ⇒ [<code>Chord</code>](#Chord)
1316
1330
  <p>Normalizes the chord root and bass notes:</p>
1317
1331
  <ul>
1318
1332
  <li>Fb becomes E</li>
@@ -1324,11 +1338,19 @@ For example, a chord symbol A# with reference key E will return the numeric chor
1324
1338
  <li>7# becomes 1</li>
1325
1339
  <li>3# becomes 4</li>
1326
1340
  </ul>
1327
- <p>Besides that it normalizes the suffix. For example, <code>sus2</code> becomes <code>2</code>, <code>sus4</code> becomes <code>sus</code>.
1341
+ <p>Besides that it normalizes the suffix if <code>normalizeSuffix</code> is <code>true</code>.
1342
+ For example, <code>sus2</code> becomes <code>2</code>, <code>sus4</code> becomes <code>sus</code>.
1328
1343
  All suffix normalizations can be found in <code>src/normalize_mappings/suffix-mapping.txt</code>.</p>
1329
1344
 
1330
1345
  **Kind**: instance method of [<code>Chord</code>](#Chord)
1331
1346
  **Returns**: [<code>Chord</code>](#Chord) - <p>the normalized chord</p>
1347
+
1348
+ | Param | Type | Default | Description |
1349
+ | --- | --- | --- | --- |
1350
+ | [key] | <code>Key</code> \| <code>string</code> | <code></code> | <p>the key to normalize to</p> |
1351
+ | [options] | <code>Object</code> | <code>{}</code> | <p>options</p> |
1352
+ | [options.normalizeSuffix] | <code>boolean</code> | <code>true</code> | <p>whether to normalize the chord suffix after transposing</p> |
1353
+
1332
1354
  <a name="Chord+useModifier"></a>
1333
1355
 
1334
1356
  ### chord.useModifier(newModifier) ⇒ [<code>Chord</code>](#Chord)