chordsheetjs 7.0.0 → 7.3.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 +53 -7
- package/lib/bundle.js +616 -1665
- package/lib/index.js +616 -1665
- package/lib/index.js.map +1 -1
- package/lib/main.d.ts +36 -12
- package/lib/main.d.ts.map +1 -1
- package/package.json +5 -8
package/README.md
CHANGED
|
@@ -424,7 +424,8 @@ Inherits from [ChordSheetParser](#ChordSheetParser)</p></dd>
|
|
|
424
424
|
<dt><a href="#END_OF_VERSE">END_OF_VERSE</a> : <code>string</code></dt>
|
|
425
425
|
<dd><p>Key meta directive. See https://www.chordpro.org/chordpro/directives-key/</p></dd>
|
|
426
426
|
<dt><a href="#KEY">KEY</a> : <code>string</code></dt>
|
|
427
|
-
<dd><p>
|
|
427
|
+
<dd><p>_Key meta directive. Reflects the key as transposed by the capo value
|
|
428
|
+
See https://www.chordpro.org/chordpro/directives-key/</p></dd>
|
|
428
429
|
<dt><a href="#_KEY">_KEY</a> : <code>string</code></dt>
|
|
429
430
|
<dd><p>Lyricist meta directive. See https://www.chordpro.org/chordpro/directives-lyricist/</p></dd>
|
|
430
431
|
<dt><a href="#LYRICIST">LYRICIST</a> : <code>string</code></dt>
|
|
@@ -638,6 +639,9 @@ If not, it returns [INDETERMINATE](#INDETERMINATE)</p>
|
|
|
638
639
|
* [.clone()](#Song+clone) ⇒ [<code>Song</code>](#Song)
|
|
639
640
|
* [.setKey(key)](#Song+setKey) ⇒ [<code>Song</code>](#Song)
|
|
640
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)
|
|
641
645
|
* [.changeKey(newKey)](#Song+changeKey) ⇒ [<code>Song</code>](#Song)
|
|
642
646
|
* [.changeMetadata(name, value)](#Song+changeMetadata)
|
|
643
647
|
* [.mapItems(func)](#Song+mapItems) ⇒ [<code>Song</code>](#Song)
|
|
@@ -696,7 +700,7 @@ if you want to skip the "header lines": the lines that only contain me
|
|
|
696
700
|
### song.setKey(key) ⇒ [<code>Song</code>](#Song)
|
|
697
701
|
<p>Returns a copy of the song with the key value set to the specified key. It changes:</p>
|
|
698
702
|
<ul>
|
|
699
|
-
<li>the value for <code>key</code> in the
|
|
703
|
+
<li>the value for <code>key</code> in the [metadata](metadata) set</li>
|
|
700
704
|
<li>any existing <code>key</code> directive</li>
|
|
701
705
|
</ul>
|
|
702
706
|
|
|
@@ -705,14 +709,14 @@ if you want to skip the "header lines": the lines that only contain me
|
|
|
705
709
|
|
|
706
710
|
| Param | Type | Description |
|
|
707
711
|
| --- | --- | --- |
|
|
708
|
-
| key | <code>number</code> \| <code>null</code> | <p>the key. Passing <code>null</code> will:</p> <ul> <li>remove the current key from
|
|
712
|
+
| key | <code>number</code> \| <code>null</code> | <p>the key. Passing <code>null</code> will:</p> <ul> <li>remove the current key from [metadata](metadata)</li> <li>remove any <code>key</code> directive</li> </ul> |
|
|
709
713
|
|
|
710
714
|
<a name="Song+setCapo"></a>
|
|
711
715
|
|
|
712
716
|
### song.setCapo(capo) ⇒ [<code>Song</code>](#Song)
|
|
713
717
|
<p>Returns a copy of the song with the key value set to the specified capo. It changes:</p>
|
|
714
718
|
<ul>
|
|
715
|
-
<li>the value for <code>capo</code> in the
|
|
719
|
+
<li>the value for <code>capo</code> in the [metadata](metadata) set</li>
|
|
716
720
|
<li>any existing <code>capo</code> directive</li>
|
|
717
721
|
</ul>
|
|
718
722
|
|
|
@@ -721,14 +725,55 @@ if you want to skip the "header lines": the lines that only contain me
|
|
|
721
725
|
|
|
722
726
|
| Param | Type | Description |
|
|
723
727
|
| --- | --- | --- |
|
|
724
|
-
| capo | <code>number</code> \| <code>null</code> | <p>the capo. Passing <code>null</code> will:</p> <ul> <li>remove the current key from
|
|
728
|
+
| capo | <code>number</code> \| <code>null</code> | <p>the capo. Passing <code>null</code> will:</p> <ul> <li>remove the current key from [metadata](metadata)</li> <li>remove any <code>capo</code> directive</li> </ul> |
|
|
729
|
+
|
|
730
|
+
<a name="Song+transpose"></a>
|
|
731
|
+
|
|
732
|
+
### song.transpose(delta) ⇒ [<code>Song</code>](#Song)
|
|
733
|
+
<p>Transposes the song by the specified delta. It will:</p>
|
|
734
|
+
<ul>
|
|
735
|
+
<li>transpose all chords, see: [transpose](#Chord+transpose)</li>
|
|
736
|
+
<li>transpose the song key in [metadata](metadata)</li>
|
|
737
|
+
<li>update any existing <code>key</code> directive</li>
|
|
738
|
+
</ul>
|
|
739
|
+
|
|
740
|
+
**Kind**: instance method of [<code>Song</code>](#Song)
|
|
741
|
+
**Returns**: [<code>Song</code>](#Song) - <p>The transposed song</p>
|
|
742
|
+
|
|
743
|
+
| Param | Type | Description |
|
|
744
|
+
| --- | --- | --- |
|
|
745
|
+
| delta | <code>number</code> | <p>The number of semitones (positive or negative) to transpose with</p> |
|
|
746
|
+
|
|
747
|
+
<a name="Song+transposeUp"></a>
|
|
725
748
|
|
|
749
|
+
### song.transposeUp() ⇒ [<code>Song</code>](#Song)
|
|
750
|
+
<p>Transposes the song up by one semitone. It will:</p>
|
|
751
|
+
<ul>
|
|
752
|
+
<li>transpose all chords, see: [transpose](#Chord+transpose)</li>
|
|
753
|
+
<li>transpose the song key in [metadata](metadata)</li>
|
|
754
|
+
<li>update any existing <code>key</code> directive</li>
|
|
755
|
+
</ul>
|
|
756
|
+
|
|
757
|
+
**Kind**: instance method of [<code>Song</code>](#Song)
|
|
758
|
+
**Returns**: [<code>Song</code>](#Song) - <p>The transposed song</p>
|
|
759
|
+
<a name="Song+transposeDown"></a>
|
|
760
|
+
|
|
761
|
+
### song.transposeDown() ⇒ [<code>Song</code>](#Song)
|
|
762
|
+
<p>Transposes the song down by one semitone. It will:</p>
|
|
763
|
+
<ul>
|
|
764
|
+
<li>transpose all chords, see: [transpose](#Chord+transpose)</li>
|
|
765
|
+
<li>transpose the song key in [metadata](metadata)</li>
|
|
766
|
+
<li>update any existing <code>key</code> directive</li>
|
|
767
|
+
</ul>
|
|
768
|
+
|
|
769
|
+
**Kind**: instance method of [<code>Song</code>](#Song)
|
|
770
|
+
**Returns**: [<code>Song</code>](#Song) - <p>The transposed song</p>
|
|
726
771
|
<a name="Song+changeKey"></a>
|
|
727
772
|
|
|
728
773
|
### song.changeKey(newKey) ⇒ [<code>Song</code>](#Song)
|
|
729
774
|
<p>Returns a copy of the song with the key set to the specified key. It changes:</p>
|
|
730
775
|
<ul>
|
|
731
|
-
<li>the value for <code>key</code> in the
|
|
776
|
+
<li>the value for <code>key</code> in the [metadata](metadata) set</li>
|
|
732
777
|
<li>any existing <code>key</code> directive</li>
|
|
733
778
|
<li>all chords, those are transposed according to the distance between the current and the new key</li>
|
|
734
779
|
</ul>
|
|
@@ -1427,7 +1472,8 @@ Can be deserialized using [deserialize](deserialize)</p>
|
|
|
1427
1472
|
<a name="KEY"></a>
|
|
1428
1473
|
|
|
1429
1474
|
## KEY : <code>string</code>
|
|
1430
|
-
<p>
|
|
1475
|
+
<p>_Key meta directive. Reflects the key as transposed by the capo value
|
|
1476
|
+
See https://www.chordpro.org/chordpro/directives-key/</p>
|
|
1431
1477
|
|
|
1432
1478
|
**Kind**: global variable
|
|
1433
1479
|
<a name="_KEY"></a>
|