MobileSheets Forums

Full Version: ChordPro: "Keys" defaulting to C is wrong
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When I import a new text or ChordPro file without any hint for a key MSP automatically sets "Keys" to "C". "Keys" should be empty (meaning "not specified") as it is the case for PDFs.
My internal logic for transposing was changed to require a key (instead of potentially storing an invalid flag that meant no key existed). This eliminated a number of errors that were occurring in earlier versions of the software. I'm always going to detect a key using the "Detect Key By" method in the text file settings. It seems like what you are asking for here is a change in behavior. You are saying you don't want the key set in the song unless the key directive is used in the chord pro file to explicitly set a key. This means that a key wouldn't be set when using text files instead of chord pro files. If this is really a big deal for you, then I would need to add a new setting for chord pro files that basically says "Only populate key metadata from key tag" or something along those lines. You could also just turn this off under Text File Settings->Use Text Fields During Song Creation.

If people think it's better not to populate the keys field of the song using the detected starting key, and it's better to require an explicit tag in the file ("Key:" for text files and {key:} for chord pro files), then I can certainly make that change.

Sorry if I was not clear enough. In this thread I'm only talking about filling the meta tag "Keys" when a ChordPro file is imported using "Import - Local File". It's not about the "Starting Key" for transposing.

To import a new ChordPro file I click "Import - Local File" and select the file. The dialog "Import Settings" is displayed.
If I specify "Keys:" - OK, we're done.
If "Keys:" is not specified in "Import Settings" MSP tries to detect the key from the file's content and writes it into "Keys". That's helpful and convenient.
If "Detect Key By" is successful its result is used - OK, fine.
If a "{key:}" tag is found, its content overwrites the result of "Detect Key By" and is used instead - OK, exactly as expected.

What I meant with "without any hint for a key" is the case when the file neither contains a "{key:}" tag nor a "[ ]" chord at all.
In that case the meta tag "Keys" should remain empty and NOT default to "C".

Not an important bug, really.
But I regularly import files containing just lyrics without chords and need to keep the information "key not specified (yet)"
Okay, I can add a check that says if 0 chords were detected, then don't populate the song's metadata.