lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: musicxml2ly: title and subtitle (issue 1913), miscellaneous (issue 5


From: reinhold . kainhofer
Subject: Re: musicxml2ly: title and subtitle (issue 1913), miscellaneous (issue 5096050)
Date: Fri, 23 Sep 2011 11:42:26 +0000

Hm, I didn't understand all of this. What do I have to change in
musicxml2ly? My
idea was to use the "description" misc field for a custom header
variable named
'miscellaneous' by default. I was thinking about implementing a cmd
line option
('-t' and '--texinfo') to be able to use the 'texinfo' variable when
needed. But
if at all this should be implemented in a different patch...

My suggestion is more general: It copies every miscellaneous-field to
the lilypond file as a header variable with the same name. This way,
nothing gets lost from the MusicXML file. And the 'description' fields
is duplicated as 'texidoc', too.
I don't think we need a --texinfo cmd line option, see my comment below.


http://codereview.appspot.com/5096050/diff/1/python/musicxml.py
File python/musicxml.py (right):

http://codereview.appspot.com/5096050/diff/1/python/musicxml.py#newcode252
python/musicxml.py:252: return None
On 2011/09/22 13:26:54, Reinhold wrote:
Of course, you'll have to adjust musicxml2ly.py, too.

I already gave you the spot where you would have to modify it. I'll add
some pseudocode there to make it clearer what I envisioned...

http://codereview.appspot.com/5096050/diff/1/scripts/musicxml2ly.py
File scripts/musicxml2ly.py (right):

http://codereview.appspot.com/5096050/diff/1/scripts/musicxml2ly.py#newcode231
scripts/musicxml2ly.py:231: #        set_if_exists ('miscellaneous',
ids.get_miscellaneous ());
On 2011/09/22 13:26:54, Reinhold wrote:
If you change get_miscellaneous to a hash, you can extract the
'description'
here for the texidoc, and loop through all fields to insert custom
header fields
for them.

What I'm thinking of is something like:

misc = ids.get_miscellaneous (); # This is a hash with "fieldname" ->
"value"
for i in misc.keys ():
    # Create a header variable for each miscellaneous-field:
    set_if_exists (i, misc[i]);
    if (i == 'description'):
        set_if_exists ('texidoc', misc[i]);

This will create a header variable for each miscellaneous-field, plus
one texidoc header variable for the description. I don't think we need a
cmd line argument to switch on/off texidoc creation. If someone really
uses a miscellaneous-field with 'description' type for a MusicXML file
that is not part of our regtest suite, it still doesn't hurt to have one
more header variable. The user won't need it, but it also doesn't cause
any problems.

http://codereview.appspot.com/5096050/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]