summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7cfc123)
Add --nd or --no-articulation-directions command-line option, which causes
musicxml2ly to not convert ^ or _ up/down indicators for articulations, texts, etc.
Rather, "-" is used where necessary.
I'm now storing the command-line options in another global variable, so that one
can access them anywhere in the whole script.
echo -e '\n\n\n' ; \
git diff ; \
fi > $(outdir)/tree.gittxt
echo -e '\n\n\n' ; \
git diff ; \
fi > $(outdir)/tree.gittxt
- $(MAKE) LILYPOND_BOOK_LILYPOND_FLAGS="-dbackend=eps --formats=ps $(LILYPOND_JOBS) -dseparate-log-files -dinclude-eps-fonts -dgs-load-lily-fonts --header=texidoc -I $(top-src-dir)/input/manual -ddump-profile -dcheck-internal-types -ddump-signatures -danti-alias-factor=1" LILYPOND_BOOK_VERBOSE= $(outdir)/collated-files.html
+ $(MAKE) LILYPOND_BOOK_LILYPOND_FLAGS="-dbackend=eps --formats=ps,png $(LILYPOND_JOBS) -dseparate-log-files -dinclude-eps-fonts -dgs-load-lily-fonts --header=texidoc -I $(top-src-dir)/input/manual -ddump-profile -dcheck-internal-types -ddump-signatures -danti-alias-factor=1" LILYPOND_BOOK_VERBOSE= $(outdir)/collated-files.html
rsync -L -a --exclude 'out-*' --exclude 'out' --exclude mf --exclude source --exclude mf $(top-build-dir)/out/share $(outdir)
rsync -L -a --exclude 'out-*' --exclude 'out' --exclude mf --exclude source --exclude mf $(top-build-dir)/out/share $(outdir)
from rational import Rational
from rational import Rational
+# Store command-line options in a global variable, so we can access them everythwere
+options = None
def progress (str):
sys.stderr.write (str + '\n')
def progress (str):
sys.stderr.write (str + '\n')
return ev
def musicxml_direction_to_indicator (direction):
return ev
def musicxml_direction_to_indicator (direction):
- return { "above": 1, "upright": 1, "below": -1, "downright": -1 }.get (direction, '')
+ return { "above": 1, "upright": 1, "up":1, "below": -1, "downright": -1, "down": -1 }.get (direction, 0)
def musicxml_fermata_to_lily_event (mxl_event):
ev = musicexp.ArticulationEvent ()
ev.type = "fermata"
if hasattr (mxl_event, 'type'):
dir = musicxml_direction_to_indicator (mxl_event.type)
def musicxml_fermata_to_lily_event (mxl_event):
ev = musicexp.ArticulationEvent ()
ev.type = "fermata"
if hasattr (mxl_event, 'type'):
dir = musicxml_direction_to_indicator (mxl_event.type)
+ if dir and options.convert_directions:
ev.force_direction = dir
return ev
def musicxml_arpeggiate_to_lily_event (mxl_event):
ev = musicexp.ArpeggioEvent ()
ev.force_direction = dir
return ev
def musicxml_arpeggiate_to_lily_event (mxl_event):
ev = musicexp.ArpeggioEvent ()
- ev.direction = {"up": 1, "down": -1}.get (getattr (mxl_event, 'direction', None), 0)
+ ev.direction = musicxml_direction_to_indicator (getattr (mxl_event, 'direction', None))
# Some articulations use the type attribute, other the placement...
dir = None
# Some articulations use the type attribute, other the placement...
dir = None
- if hasattr (mxl_event, 'type'):
+ if hasattr (mxl_event, 'type') and options.convert_directions:
dir = musicxml_direction_to_indicator (mxl_event.type)
dir = musicxml_direction_to_indicator (mxl_event.type)
- if hasattr (mxl_event, 'placement'):
+ if hasattr (mxl_event, 'placement') and options.convert_directions:
dir = musicxml_direction_to_indicator (mxl_event.placement)
dir = musicxml_direction_to_indicator (mxl_event.placement)
+ if dir:
+ ev.force_direction = dir
text = re.sub (' *\n? *$', '', text)
event.text = text
text = re.sub (' *\n? *$', '', text)
event.text = text
- if hasattr (words, 'default-y'):
+ if hasattr (words, 'default-y') and options.convert_directions:
offset = getattr (words, 'default-y')
try:
off = string.atoi (offset)
offset = getattr (words, 'default-y')
try:
off = string.atoi (offset)
action = "store",
help = _ ("Use a different language file, e.g. 'deutsch' for deutsch.ly."))
action = "store",
help = _ ("Use a different language file, e.g. 'deutsch' for deutsch.ly."))
+ p.add_option ('--no-articulation-directions', '--nd',
+ action = "store_false",
+ default = True,
+ dest = "convert_directions",
+ help = _ ("Do not convert directions (^, _ or -) for articulations."))
+
p.add_option ('-o', '--output',
metavar=_ ("FILE"),
action="store",
p.add_option ('-o', '--output',
metavar=_ ("FILE"),
action="store",
def main ():
opt_parser = option_parser()
def main ():
opt_parser = option_parser()
(options, args) = opt_parser.parse_args ()
if not args:
opt_parser.print_usage()
(options, args) = opt_parser.parse_args ()
if not args:
opt_parser.print_usage()