pianosnake / ireal-reader

A Node JS module to read music files from iRealPro.
33 stars 8 forks source link

Parsing chords with "add" and "sus" is broken #1

Closed bolau closed 6 years ago

bolau commented 6 years ago

Hi, thanks for this nice library! I use it to extract chord progressions. When doing some tests, I saw that chords containing "add" and "sus" are not correctly parsed. I guess this is due to the fact that they are not captured by this regexp expression.

Are you interested in me working on this? I'd like to understand why it's necessary to do the regexp matching so strictly. Can we just add 'a', 'd', 's', and 'u' to the character classes - which would allow "add" and "sus" but also allow rubbish like "Caus"? Or do you think it should be a proper regexp that refuses wrong chords?

Cheers, Boris

pianosnake commented 6 years ago

Hi Boris, You're right, we can just add the a d s and u to the regex. That seems to have fixed the problem with sus and add chords. See version 1.2.5 and let me know if it solved your problem.

The regex is so restrictive just in case I missed some symbols from the iReal markup language.