5.8.4 Other sources of information

The Internals Reference documentation contains a lot of information about LilyPond, but even more information can be gathered by looking at the internal LilyPond files. To explore these, you must first find the directory appropriate to your system. The location of this directory depends on whether you obtained LilyPond by downloading a precompiled binary from lilypond.org or whether you installed it from a package manager (i.e., distributed with GNU/Linux, or installed under MacPorts, Homebrew, Cygwin, Chocolatey, etc.) or compiled it from source.

Within this directory the two interesting subdirectories are


contains files in LilyPond format


contains files in Scheme format

Let’s begin by looking at some files in ly/. Open ly/property-init.ly in a text editor – the one you normally use for .ly files will be fine. This file contains the definitions of all the standard LilyPond predefined commands, such as \tieUp and \slurDotted. You will see that these are nothing more than definitions of variables containing one or a group of \override commands. For example, \textLengthOn is defined to be:

textLengthOn = {
  % 0.4 staff-space between adjacent texts
  \override TextScript.extra-spacing-width = #'(-0.0 . 0.4)
  \override TextScript.extra-spacing-height = #'(-inf.0 . +inf.0)

If you do not like the default values these predefined commands can be redefined easily, just like any other variable, at the head of your input file.

The following are the most useful files to be found in ly/:

ly/engraver-init.lyDefinitions of engraver contexts
ly/paper-defaults-init.lySpecifications of paper-related defaults
ly/performer-init.lyDefinitions of performer contexts
ly/property-init.lyDefinitions of all common predefined commands
ly/spanner-init.lyDefinitions of spanner-related predefined commands

Other settings (such as the definitions of markup commands) are stored as .scm (Scheme) files. The Scheme programming language is used to provide a programmable interface into LilyPond’s internal operation. Further explanation of these files is outside the scope of this manual, as some knowledge of the Scheme language is required. Users should be warned that a substantial amount of technical knowledge or time is required to understand Scheme and these files (see Scheme tutorial).

If you have this knowledge, the Scheme files that may be of interest are:

scm/auto-beam.scmSub-beaming defaults
scm/define-grobs.scmDefault settings for grob properties
scm/define-markup-commands.scmAlmost all markup commands
scm/midi.scmDefault settings for MIDI output
scm/output-lib.scmSettings that affect appearance of frets, colors, accidentals, bar lines, etc.
scm/parser-clef.scmDefinitions of supported clefs
scm/script.scmDefault settings for articulations

LilyPond 学习手册 v2.25.17 (开发分支).