gusper / SongTxt-vscode

Visual Studio Code extension that adds support for editing text files for songs including lyrics, chords, guitar tablature, etc.
MIT License
29 stars 7 forks source link

Some chord names not highlighted #18

Closed RBekking closed 1 year ago

RBekking commented 2 years ago

Certain common chord names aren't recognised: Example:

etc...

contributor commented 2 years ago

up

c-d commented 1 year ago

Do you have any other example variations that are being missed? Or a reference to possible valid chord names?

I don't have great knowledge of music theory but here's a tweaked regex for the above: https://regex101.com/r/fIqVVI/3

RBekking commented 1 year ago

Thank you @c-d for taking the time to actually tweak the file. I've already done it myself but didn't take the time to share. Here it is:

It deals with double sharps, double flats, and all other common chord notations. This might only fail on avant-garde jazz music where the chords look like WiFi passwords ;-)

"chords": {
            "patterns": [
                {
                    "comment": "Chords above lyrics",
                    "name": "string",
                    "match": "[CDEFGAB](b|bb|#|##)?(m|M|min|maj|minmaj|dim|aug|\\+)?(\\d)?(b5)?(sus|sus2|sus4)?(add)?(2|4|5|6|7|9|10|11|13)?(\\z|\\n|\\r|\\/| )"
                },
                {
                    "comment": "No chord symbols",
                    "name": "string",
                    "match": "N\\.C\\."
                },
                {
                    "comment": "Tuning notes",
                    "name": "storage.type",
                    "match": "[CDEFGAB|e][b|bb|#|##]?(?=\\|)"
                }
            ]
        },
c-d commented 1 year ago

Nice, thanks @RBekking. Hope you don't mind me raising a PR with your changes (though I'm not sure if PR's are being accepted on this repo...)

RBekking commented 1 year ago

Oh wait I miss-read. Offcourse you can do whatever you want with the code I've shared.

You're welcome! I love your plugin, I use it a lot.

I'll see if I can raise you a PR after work. Cheers,

Richard Bekking

Bekking Electronics Design tel: +31630397999 electronicsdesign.nl

On Mon, 1 Aug 2022 at 10:41, Chris Deaker @.***> wrote:

Nice, thanks. Hope you don't mind me raising a PR with your changes (though I'm not sure if PR's are being accepted on this repo...)

— Reply to this email directly, view it on GitHub https://github.com/gusper/SongTxt-vscode/issues/18#issuecomment-1200899221, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRIRKZTTVHEX2FBS5KX4W3VW6EUHANCNFSM52DMLJLA . You are receiving this because you authored the thread.Message ID: @.***>

gusper commented 1 year ago

I'll happily take a PR. :)

RBekking commented 1 year ago

You're welcome! I love your plugin, I use it a lot.

I'll see if I can raise you a PR after work. Cheers,

Richard Bekking

Bekking Electronics Design tel: +31630397999 electronicsdesign.nl

On Mon, 1 Aug 2022 at 10:41, Chris Deaker @.***> wrote:

Nice, thanks. Hope you don't mind me raising a PR with your changes (though I'm not sure if PR's are being accepted on this repo...)

— Reply to this email directly, view it on GitHub https://github.com/gusper/SongTxt-vscode/issues/18#issuecomment-1200899221, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRIRKZTTVHEX2FBS5KX4W3VW6EUHANCNFSM52DMLJLA . You are receiving this because you authored the thread.Message ID: @.***>

gusper commented 1 year ago

Finally got around to publishing the version with your updates a couple days ago. Thanks again, guys!