• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ChoPro metadata fields
#1
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.
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).
Reply
#2
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
Reply
#3
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.
Samsung Note 10.1 GT-N8013ZW / iPad Pro / AirTurn BT-105 / AirTurn BT200S-4
Reply
#4
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.
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).
Reply
#5
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
Reply




Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2024 MyBB Group.