[ << Updating files with convert-ly ] | [Top][Contents][Index] | [ lilypond-book >> ] |
[ < Updating files with convert-ly ] | [ Up : Updating files with convert-ly ] | [ Invoking convert-ly > ] |
2.1 Why does the syntax change?
Often, syntax changes are made to make the input simpler to both read and write, but occasionally the changes are made to accommodate new features or enhancements to existing functions.
To illustrate this here is a real example:
All \paper
and \layout
property names were supposed to be
written in the form first-second-third
. However, in LilyPond
version 2.11.60, it was noticed that the printallheaders
property
did not follow this convention. Should this property be left alone
(confusing new users with an inconsistent format)? Or should it be
changed (annoying old users with existing LilyPond input files)?
The decision was made to change the name of the property to
print-all-headers
, and by using the convert-ly
command
the old users had a way to automatically update their existing input
files.
However, the convert-ly
command cannot always be used to
manage all syntax changes. In versions of LilyPond before 2.4.2,
accents and non-English characters were entered using standard LaTeX
notation. For example the French word for ‘Christmas’ was entered as
No\"el
. But in LilyPond 2.6 onwards, the special ë
must
be entered directly as a UTF-8 character. The convert-ly
command cannot change LaTeX special characters into UTF-8 characters, so
older LilyPond input files have to edited manually.
The conversion rules of the convert-ly
command work using text
pattern-matching and replacement (rather than ‘understanding’ the
context of what it is changing within a given input file). This has
several consequences:
- The reliability of the conversion depends on the quality of each applied rule set and on the complexity of the respective change. Sometimes conversions may require additional, manual fixes, so the original input files should be kept for comparison just in case.
- Only conversions to newer syntax changes are possible: there are no rule sets to go back to older versions of LilyPond. So the input file should only be upgraded when older versions of LilyPond are no longer being maintained. Again, the original input files should be kept just in case; perhaps using version control systems (i.e. Git) to help with maintaining multiple versions of your input files.
-
LilyPond is quite robust when processing ‘creatively’ placed or
omitted whitespace, but the rules used by
convert-ly
often make some stylistic assumptions. Therefore following the input style as used in the LilyPond manuals is advised for painless upgrades, particularly as the examples in the manuals themselves are all upgraded using theconvert-ly
command.
[ << Updating files with convert-ly ] | [Top][Contents][Index] | [ lilypond-book >> ] |
[ < Updating files with convert-ly ] | [ Up : Updating files with convert-ly ] | [ Invoking convert-ly > ] |