Closed ljfreelancer88 closed 4 months ago
Hey @ljfreelancer88. Thanks for reaching out.
Currently that is only possible for songs, assuming the original key is known.
So when parsing:
{key: C}
[C]Whisper words of [G]wisdom, let it [F]be [C/E] [Dm] [C]
you can do:
const song = new ChordProParser().parse(sheet).changeKey('E');
If the song key is not set, you can do:
const song = new ChordProParser().parse(sheet).setKey('C').changeKey('E');
Please note Song
is immutable, so all the methods return a new song object. They don't change the object in-place.
For chords this is not (yet) possible, but I'll add a ticket to the board!
Hey @ljfreelancer88. I'm revisiting this issue, but I'm wondering how you would expect this to work. Chords are unaware of the current key, so they wouldn't know how to transpose to another key.
A way to solve your issue would be to calculate the distance between keys using Key.distance()
, and subsequently transpose the chords using the calculated number of semitones.
Based on the documentation, it can transpose the chords within the lyrics using numbers? Is it possible to transpose using chromatic scales?
chord.transpose('C')