ddycai / chord-transposer

Node library for transposing musical chords within text.
https://ddycai.github.io/chord-transposer/
MIT License
58 stars 23 forks source link

Transposed chord jumps line down and joins next lyrics line #27

Open contributor opened 2 years ago

contributor commented 2 years ago

Code executed:

Transposer.transpose(input).fromKey("G").toKey("Bb")

input:

[Verse 1]
       G
It's hard for me to say the things
   D
I want to say sometimes 
            G
There's no one here but you and me 
              D
And that broken old street light
A           Bm
Lock the doors 

output:

[Verse 1]
       BbIt's hard for me to say the things
   F
I want to say sometimes 
            BbThere's no one here but you and me 
              F
And that broken old street light
C           Dm
Lock the doors

You can see in the output two instances of Bb chord joined with lyrics. It looks like CRLF is missing after Bb. If you edit the output and press Enter after each Bb - lyrics structure is fixed, and all chords are correct.

Another example - C#m chord joined with lyrics. The same song, but transposed via .fromKey("G").up(2)

output:

[Verse 1]
       A
It's hard for me to say the things
   E
I want to say sometimes 
            A
There's no one here but you and me 
              E
And that broken old street light
B           C#mLock the doors

My guess is that somehow CRLF is lost/trimmed for some flat/sharp chords