MobileSheets Forums
ChoPro metadata fields - Printable Version

+- MobileSheets Forums (https://www.zubersoft.com/mobilesheets/forum)
+-- Forum: Support (https://www.zubersoft.com/mobilesheets/forum/forum-1.html)
+--- Forum: MobileSheets (Android) (https://www.zubersoft.com/mobilesheets/forum/forum-23.html)
+--- Thread: ChoPro metadata fields (/thread-2642.html)



ChoPro metadata fields - sciurius - 05-27-2015

I have a ChoPro file "fiets.cho" that starts with

{t: Op Fietse}
{artist: Daniƫl Lohoes & Skik}
{key:C}
{capo:2}
{tempo:104}
{time:4/4}

I have checked "Use Text Fields During Song Creation".

When I import this file, I get a song titled "fiets" (after the file name). In the song view the title is "Op Fietse" (as it should be) and below it is the artist info.
However, when I edit this song, field "Title" shows "fiets" and none of the other metadata has been set.

What am I doing wrong?

MSPro version 1.1.3.


RE: ChoPro metadata fields - Zubersoft - 05-28-2015

Artist wasn't one of the fields that was being automatically populated. I've now updated the code to include that field. I also was not using the title in the chord pro file as the title for the song - that has been changed as well. There was also a bug where the fields were being set in the song but the UI on the fields tab was not updated.

Thanks for the help,
Mike


RE: ChoPro metadata fields - DTownSMR - 05-30-2015

Mike,

From the chordii site I'm not sure the spec is specific enough regarding whitespace ("Check: Is whitespace before/after the : allowed? Whitespace after the argument?") but I think it would be a good idea programming wise to be tolerant of whitespace in each of those cases. Before the colon, after the colon, and after the argument. Just a thought.

I didn't try before the colon because that just wasn't intuitive for me. I did notice however that after the colon is OK but after the argument is not.


RE: ChoPro metadata fields - sciurius - 05-30-2015

There's an old saying, attributed to Jon Postel: "Be liberal in what you accept, and conservative in what you produce."
The ChordPro reference implementation uses the C-library function strtok with ": " (colon + space) as delimeters. Therefore it accepts all of the following:
Code:
{columns 2}
{columns:2}
{columns: 2}
{columns : 2}
{ : columns ::: 2 : }

This also means that
Code:
{title: My Song}

specifies the title as "My Song" with no leading spaces.


RE: ChoPro metadata fields - Zubersoft - 05-30-2015

I've reworked the parsing to use a tokenizing approach similar to what you suggested Johan. That should make it a little more forgiving.

Thanks,
Mike