Hi, just some thoughts on the current header parsing of Mutopia's software motivated by (not wanting to install java and) the thought that lilypond's language is so complex that parsing it should be left to lilypond itself.
I noticed that lilypond has (since at least version 2.8.0) a --header option which could be used to retrieve header fields from the file, thereby letting lilypond do the parsing for us. Compared to the manual parsing this of course takes longer, especially since it seems that one has to compile the piece in order to get the header information, on the other hand one does not need to care where the header is placed in the file, whether there are multiple headers or variables are used inside the headers. In addition to retrieving header fields the Mutopia software also inserts a lastupdated field, a footer and a tagline to the header. So lilypond's --header option is not enough to stop the need of manually parsing the files. But one could put these fields into a separate header at the end of the files. In this way they take precendence over fields of the original header while keeping it intact. Maybe going a bit further one could strip the (new) files in the git repository from the (automatically generated) lastupdated, footer and tagline fields and add a new field like mutopiaId (I hope that the name is self-explanatory). When preparing the files for the server one adds the lastupdated field, the footer field with something like footer=\markup{\concat{"Mutopia-" \lastupdated "-" \mutopiaId}} and the tagline in a separate header to the end of each file. One advantage of this would be that if a update/correction of a piece sent via git is ok, it wouldn't have to be modified at all. For new pieces just the mutopiaId field needs to be set. Disadvantages would be the fact that there are now two versions of the files floating around and I'm not sure about legal matters: For a piece contributed in terms of a CC license then the only hint about this license in the files in the git repository would be the copyright field. Is that enough to comply with the license? I think that it wouldn't be too difficult to implement it, even in shell by tweaking and extending the current scripts. I haven't tried so, though. A bit of thought would need to be spent on the best way of how to handle multiple-ly pieces. Any more thoughts on this? Regards, Felix _______________________________________________ Mutopia-discuss mailing list Mutopia-discuss@mutopiaproject.org http://lists.bcn.mythic-beasts.com/mailman/listinfo/mutopia-discuss