Miscellaneous improvements (LilyPond Changes)

## Miscellaneous improvements

- The `\tempo` command now accepts exact rational values. The default formatter rounds to the nearest 0.25; the context property `tempoCountPrecision` controls this.

  >     \fixed c' {
  >       \once \set Timing.tempoCountPrecision = #1/1000000
  >       \tempo 4 = #200/3
  >       g4 e2 f4
  >     }

- The new Scheme function `ly:parser-define-once!` defines a variable if it is not already defined.
- The `timeSignatureFraction` context property is deprecated in favor of `timeSignature`. The new property accepts subdivided and alternating time signatures in addition to the simple fractions that the old property accepted. Accessing the old property transparently derives a simple fraction from the new property and triggers a warning.
- `(make-music 'Music)` and `(make-music 'Event)` now create music expressions that have the `void` property set to `#t` by default. The function `empty-music` has been removed in favor of `(make-music 'Music)`. The new predicate `unspecified-music?` recognizes any music expression with the `void` flag set.
- The new Scheme function `ly:number->duration` converts a duration expressed in units of whole notes to a `ly:duration`. The log, number of dots, and scaling factor are chosen automatically.
- The markup commands `\hspace` and `\vspace` are used to insert space, which may be negative. Other objects are moved accordingly. This movement may be indicated by arrows printed by the new markup command `annotate-moving`. Note that the arrows do not reflect the actual extents of the objects created by `\vspace` and `\hspace`; you might use `\box` for that.

  >     \markup {
  >       left \annotate-moving \hspace #4 right
  >       \column { top \annotate-moving \vspace #-4/3 bottom }
  >     }

- The new `\contextPropertyCheck` command verifies that a property is set to an expected value or is unset in a specific context.
- Various context properties that previously held `ly:moment` values now hold rational numbers. To ease this transition, each number property is paired with a fallback `ly:moment` property. Using the fallback property transparently accesses the number property and triggers a warning.

  > Deprecated Context Property | New Context Property
  > `baseMoment` | `beatBase`
  > `completionUnitAsMoment` | `completionUnit`
  > `gridIntervalAsMoment` | `gridInterval`
  > `measureLengthAsMoment` | `measureLength`
  > `minimumPageTurnLength` | `pageTurnMinimumRestLength`
  > `minimumRepeatLengthForPageTurn` | `pageTurnMinimumRepeatLength`
  > `proportionalNotationDurationAsMoment` | `proportionalNotationDuration`
  > `tempoWholesPerMinuteAsMoment` | `tempoWholesPerMinute`
  > `tupletSpannerDurationAsMoment` | `tupletSpannerDuration`
  > `voltaSpannerDurationAsMoment` | `voltaSpannerDuration`

- `\tempo dur = min - max` used to set the context property `tempoWholesPerMinute` after rounding the center of the range to the nearest integer. It no longer rounds. This is expected to change the MIDI tempo in certain cases.
- The Scheme functions `duration-length` and `ly:duration-length` are renamed to `ly:duration->number` and `ly:duration->moment`, respectively.
- The new Scheme function `ly:parser-append-to-include-path` appends its argument to the current parser’s include path.
- The value of the `timeSignatureSettings` context property uses the symbol `beatBase` where it formerly used `baseMoment`. `convert-ly` does not address this change.
- Embedding PNG images is now supported using the new `\image` markup command. This supplements the existing `\epsfile` command for EPS images.

  `\image` works for both PNG and EPS images. For EPS images, the difference between using `\image` and `\epsfile` is that `\image` adds a white background by default, while `\epsfile` does not.

- The new `\qr-code` markup command inserts a QR code of the specified size for the specified URL. This can be used to link to, e.g., the website of a composer or publisher, the LilyPond source files for the score, recordings, etc.

  >     \markup \qr-code #10 "https://lilypond.org"

- Parentheses for text markup have been added to the Emmentaler fonts, which harmonize with digits (in contrast to the already available parentheses for accidentals).
- Glyphs for a figure-dash (U+2012), an en-dash (U+2013), and a slash (U+002F) have been added to the Emmentaler fonts.
- A figure space (U+2007), a thin space (U+2009), and a hair space (U+200A) have been added to the Emmentaler fonts.
- The `-dinclude-settings` option can now be given multiple times to include several stylesheets.
- In the LaTeX backend of `lilypond-book`, all inline images are now vertically shifted. The amount can be controlled globally with command-line option `--inline-vshift` and locally with an argument to the snippet option `inline`.
- It is possible to use various command-line options of `musicxml2ly` as options for `lilypond-book`’s `musicxmlfile` command. This was actually introduced in version 2.15.9 (in 2011) but stayed undocumented until now.
- Two new command-line options `-dfirst` and `-dlast` have been introduced; they are equivalent to setting `showFirstLength` and `showLastLength`, respectively, in a LilyPond input file. For example, saying

      lilypond -dlast=R1*5 ...

  makes LilyPond render only the last five measures (assuming a 4/4 time signature).

- A visual index of all LilyPond graphical objects (grobs) is now available as a manual. This is based on Joram Berger’s work for LilyPond 2.19.
- LilyPond provides support for in-notes, i.e., footnote-like annotations between music systems. This isn’t new (it has actually been available since version 2.15.17, published in 2011) but it had some flaws and wasn’t documented until now.
- The `lilysong` script has been removed. Besides lacking any documentation, it hasn’t been maintained for a long time. Additionally, it has been using an external speech synthesis program called `festival`, which is no longer maintained either.
- Two new spacing styles are available for the `space-alist` grob property: `shrink-space` and `semi-shrink-space`; these spaces only shrink and don’t stretch. They are also used directly in LilyPond, improving the formatting of tightly spaced staves.
- The `lilypond` binary has a new command-line option `-dstaff-size` to set the global staff size, equivalent to setting `set-global-staff-size` in a LilyPond input file.
- Instead of the functions `\bookOutputName` and `\bookOutputSuffix` we now recommend using the paper variables `output-filename` and `output-suffix` (which are not new but stayed undocumented until now). While the former will work unchanged, the latter is more coherent and easier to understand, especially if combined with predefined paper variables.
- The `Stem.details.lengths` property now also accepts pairs as list elements, allowing to set the length for up and down stems separately.
- The `ly:self-alignment-interface::aligned-on-x-parent` function (used by many grobs to compute the x-offset) now listens to a new `PaperColumn` property called `X-alignment-extent`. Set by default, it provides a fallback width for the `PaperColumn` grob in case it doesn’t contain note heads. This helps align dynamic scripts that are attached to spacer rests, for example.

  >     music =
  >       \new Staff <<
  >         { f'2 g'2 }
  >         { s4\f s\f s\f s\f }
  >       >>

  >     \score {
  >       \music
  >     }

  >     \score {
  >       \music

  >       \layout {
  >         \context {
  >           \Score
  >           \override PaperColumn.X-alignment-extent = ##f
  >         }
  >       }
  >     }

- `BassFigureContinuation` grobs now support `horizontal-line-spanner-interface`; the `padding` property has been replaced with the corresponding subproperties in `bound-details`.
- The `\align-on-other` markup command now accepts `#f` as a value for the alignment, indicating a markup’s reference point.
- A new function `\withRelativeDir` is now available for markup commands that include files, and where such files should be found relative to the input file. Example:

      \markup { \image #X #3 \withRelativeDir "test.png" }

- The positioning of horizontal (analysis) brackets has been improved; in particular, the `HorizontalBracket` grob now has an `outside-staff-priority` value of 800. As a consequence, however, nested horizontal brackets might be positioned differently than before. You can fix this by adjusting `outside-staff-priority` values with `\tweak` (where the outermost bracket should get the highest priority value).
- A new Scheme function `to-staff-space` is provided to convert absolute dimensions (in various units) to staff-space units. Examples:

      top-markup-spacing.basic-distance = #(to-staff-space 2 'cm)

      % default unit is pt
      \markup
        \override #`(baseline-skip . ,(to-staff-space 20))
        \column {
          foo
          bar
        }

- Two new markup functions `\abs-hspace` and `\abs-vspace` are available to provide absolute dimensions that stay the same regardless of the current staff size.
- The data emitted by the command-line option `-dshow-available-fonts` is now sent to standard output.
- The function `ly:font-config-display-fonts` now takes an optional argument for output port selection.
- Scheme command-line option handling is now more robust. In the course of the new implementation, some minor changes were necessary.
  - − On the command line, the argument for the `-dpaper-size` option no longer needs to be extra-quoted, i.e., a call like `-dpaper-size=a3` works just fine.
  - − The `pixmap-format` option now expects a string as a value, not a symbol. No change on the command line, but a call like

        #(ly:set-option 'pixmap-format 'pngalpha)

    must be changed to

        #(ly:set-option 'pixmap-format "pngalpha")

    The same holds for options `separate-page-formats` and `tall-page-formats`. Note that `convert-ly` can handle this automatically.

- The `side-position-interface` now offers two new properties, `X-padding` and `minimum-X-space`, to control the horizontal padding and minimum distance to a grob’s parent object, independently of the vertical padding and minimum distance. This is useful for grobs like `Fingering` that can be attached either horizontally or vertically to note heads, and which need different padding values for the X- and Y-axis, respectively.
- `\pushContextProperty` and `\popContextProperty` are two new commands for manipulating context properties. The first one pushes the current value to a stack, while the second one pops off the value from the stack and uses it to restore the property.

  >     {
  >       c'
  >       \pushContextProperty Staff.fontSize
  >       \set Staff.fontSize = 3
  >       c'
  >       \pushContextProperty Staff.fontSize
  >       \set Staff.fontSize = 6
  >       c'
  >       \popContextProperty Staff.fontSize
  >       c'
  >       \popContextProperty Staff.fontSize
  >       c'
  >     }

- A new grob property `whiteout-color` is available to set the color used for white-out operations. Similarly, the `\whiteout` markup command now listens to a `color` property to do the same.
- The `musicxml2ly` script has been completely revised to better convert MusicXML to LilyPond. It now supports more MusicXML features and elements and tries to be more faithful in the conversion, retaining more of the original appearance if possible (and sensible).

  Here is a list of some notable changes (not taking bug fixes into account).

  - − The script is now much faster.
  - − Overlapping and nested slurs work as expected.
  - − Better automatic support of circumventing LilyPond’s infamous issue #34 (i.e., synchronization of grace note timing between staves at the beginning of a piece).
  - − Support of two-stem tremolos and nested tuplets.
  - − Color and font size support for almost all MusicXML elements. A new command-line option `--dynamics-scale` helps compensate glyph size differences of dynamics signs in various music fonts.
  - − Correct handling of ottava endings for MusicXML files created by Finale. The script looks at the `<software>` element to detect the used notation software. If necessary, this can be overridden with the new command-line option `--ottavas-end-early`.
  - − Option `--shift-meter` has been replaced with option `--shift-durations`, using a simpler syntax.
  - − New command-line option `--no-tagline` to suppress the output of a LilyPond tagline.
  - − New command-line option `--book` to wrap the top-level score with `\book`.
  - − If `<credit>` elements are present, they now fill the fields in LilyPond’s `\header` block instead of metadata elements like `<work-title>` or `<creator>`.
  - − New command-line option `--credit-page` to specify the page from which LilyPond should take `<credit>` data to fill the `\header` block.
  - − All metadata elements that are not mapped to standard `\header` fields (and which are not ignored like the ‘page number’ type) are output with more consistent field names: the prefix ‘`id:` ’ is used for `<identification>` children, ‘`credit:` ’ for `<credit>` elements, and the MusicXML element name (without a prefix) in all other cases. As a consequence, some (unused) fields got new names.

    > old | new
    > --- | ---
    > `movementnumber` | `movement-number`
    > `encodingsoftware` | `id: software`
    > `encodingdate` | `id: encoding-date`
    > `encoder` | `id: encoder`
    > `encodingdescription` | `id: encoding-description`
    > `source` | `id: source`

  - − The bar numbers shown as comments in the created LilyPond input file are now as expected, i.e., the values shown refer to the previous bar.
- The markup command `\page-ref` has a new property `x-align` to control the X-alignment of the gauge replacement.

  >     \markup {
  >       \box
  >         \page-ref #'foo "???" "?" " right-aligned (default)"
  >     }
  >     \markup {
  >       \box
  >         \override #`(x-align . ,LEFT)
  >         \page-ref #'foo "???" "?" " left-aligned"
  >     }
  >     \markup {
  >       \box
  >         \override #'(x-align . -2.5)
  >         \page-ref #'foo "???" "?" " left outside"
  >     }

- It is now also possible to set the `ledger-extra` property via the `NoteHead` grob.

  >     \score {
  >       {
  >         c'''1
  >         \tweak ledger-extra #4 c'''1
  >         c'''1
  >       }
  >     }

- For grob `NonMusicalPaperColumn`, the subproperty `bottom-space` of the `line-break-system-details` property has been renamed to `bottom-padding`. While available since version 2.13.4 (released in 2009) it wasn’t documented before.
- It is now possible to modify tag groups created with `\tagGroup` or `\tagGroupRef` by using the commands `\resetTagGroups`, `\resetTagGroup`, `\addToTagGroup`, and `\removeFromTagGroup`.
- The current input language (as selected with `\language`) can be accessed in the new Scheme variable `input-language` (as a symbol).
- The new function `\breakAlignInsert` makes it easy to change the order of notational elements like clefs, time signatures, bar lines etc. Previously, this required re-defining the `Score.BreakAlignment.break-align-orders` vector.

  >     {
  >       g'1
  >       \key f \major
  >       g'
  >       \breakAlignInsert staff-bar after key-signature
  >       \key g \minor
  >       g'
  >     }

- The output option `-dcrop` now takes all stencils into account while calculating the bounding box. This can change the size of cropped output.
- These functions, which have been deprecated since version 2.13.19, have been removed: `\deprecatedcresc`, `\deprecatedendcresc`, `\deprecateddim`, and `\deprecatedenddim`.

For older news, go to https://lilypond.org/doc/v2.22/Documentation/changes/, or go back to the Documentation index.

#### LilyPond Changes v2.26.0 (stable-branch).

- Major changes in LilyPond
  - Notes for source compilation and packagers
- New for musical notation
  - Pitches improvements
  - Rhythm improvements
  - Expressive mark improvements
  - Repeat improvements
  - Editorial annotation improvements
  - Text and font improvements
- New for specialist notation
- Miscellaneous improvements