[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.4 Controlling output


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.4.1 Extracting fragments of music

It is possible to output one or more fragments of a score by defining the explicit location of the music to be extracted within the \layout block of the input file using the clip-regions function, and then running LilyPond with the ‘-dclip-systems’ option;

 
\layout {
  clip-regions
  = #(list
      (cons
       (make-rhythmic-location 5 1 2)
       (make-rhythmic-location 7 3 4)))
}

This example will extract a single fragment of the input file starting after a half-note duration in fifth measure (5 1 2) and ending after the third quarter-note in the seventh measure (7 3 4).

Additional fragments can be extracted by adding more pairs of make-rhythmic-location entries to the clip-regions list in the \layout block.

By default, each music fragment will be output as a separate EPS file, but other formats such as PDF or PNG can also be created if required. The extracted music is output as if had been literally ‘cut’ from the original printed score so if a fragment runs over one or more lines, a separate output file for each line will be generated.

See also

Notation Reference: The \layout block.

Application Usage: (usage)Command-line usage section ‘Command-line usage’ in Application Usage.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.4.2 Skipping corrected music

When entering or copying music, usually only the music near the end (where new notes are being added) is interesting to view and correct. To speed up this correction process, it is possible to skip typesetting of all but the last few measures. This is achieved by defining a special variable at the source file’s top level, as follows:

 
showLastLength = R1*5
\score { … }

In this instance, nothing will be rendered but the last five measures (assuming 4/4 time signature) of every \score in the input file. For longer pieces, rendering only a small part is often an order of magnitude quicker than rendering it completely. When working on the beginning of a score that has already been typeset (for example to add a new part), the showFirstLength property may be useful as well.

Skipping parts of a score can be controlled in a more fine-grained fashion with the property Score.skipTypesetting. When it is set, no typesetting is performed at all. As a property of the Score context, it affects all voices and staves; see Score - the master of all contexts.

This property is also used to control output to the MIDI file. If some event in the skipped section alters some of its context properties, for example a tempo or instrument change, then that new setting will take effect only at the point in time where skipTypesetting is disabled again:

 
\relative c' {
  c4 c c c
  \set Score.skipTypesetting = ##t
  d4 d d d
  \tempo 4 = 80
  e4 e e e
  \set Score.skipTypesetting = ##f
  f4 f f f
}

[image of music]

Predefined commands

showLastLength, showFirstLength.

See also

Notation Reference: Interpretation contexts, Score - the master of all contexts, All context properties.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.4.3 Alternative output formats

The default output formats for the printed score are Portable Document Format (PDF) and PostScript (PS). Portable Network Graphics (PNG), Scalable Vector Graphics (SVG) and Encapsulated PostScript (EPS) output formats are available through command line options, see (usage)Basic command line options for LilyPond section ‘Basic command line options for LilyPond’ in Application Usage.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

SVG Output

SVG output can optionally contain metadata for graphical objects (grobs) like note heads, rests, etc. This metadata can be standard SVG attributes like id and class, or non-standard custom attributes. Specify the attributes and their values by overriding a grob’s output-attributes property with a Scheme association list (alist). The values can be numbers, strings, or symbols. For example:

 
{
  \once \override NoteHead.output-attributes =
  #'((id . 123)
     (class . "this that")
     (data-whatever . something))
  c
}

The input above will produce the following <g> (group) tag in the SVG file:

 
<g id="123" class="this that" data-whatever="something">
  ...NoteHead grob SVG elements...
</g>

The <g> tag contains all of the SVG elements for a given grob. (Some grobs generate multiple SVG elements.) In SVG syntax the data- prefix is used for non-standard custom metadata attributes.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.4.4 Replacing the notation font

Gonville is an alternative set of glyphs to Feta – part of the Emmentaler font – and used in LilyPond. They can be downloaded from:

 
http://www.chiark.greenend.org.uk/~sgtatham/gonville/

Here are a few sample bars of music set in Gonville:

pictures/Gonville_after

Here are a few sample bars of music set in LilyPond’s Feta glyphs:

pictures/Gonville_before

Installation Instructions

Download and extract the font files. Copy the ‘gonville-11.otf’, ‘gonville-13.otf’, ‘gonville-14.otf’, ‘gonville-16.otf’, ‘gonville-18.otf’, ‘gonville-20.otf’, ‘gonville-23.otf’, ‘gonville-26.otf’, and ‘gonville-brace.otf’ files to ‘…/share/lilypond/current/fonts/otf’ or ‘…/share/lilypond/X.Y.Z/fonts/otf’. If you have ‘gonville-*.svg’ and ‘gonville-*.woff’ files, copy them to ‘…/share/lilypond/current/fonts/svg’ or ‘…/share/lilypond/X.Y.Z/fonts/svg’. For more information, see (learning)Other sources of information section ‘Other sources of information’ in Learning Manual.

Note: ‘gonville-*.otf’ files are for ps and eps backend (for PDF and PostScript outputs). ‘gonville-*.svg’ files are for svg backend without svg-woff option. ‘gonville-*.woff’ files are for svg backend with svg-woff option. For more information, see (usage)Advanced command line options for LilyPond section ‘Advanced command line options for LilyPond’ in Application Usage.

The following syntax changes the notation font (general and brace) to the Gonville font.

 
\paper {
  #(define fonts
    (set-global-fonts
     #:music "gonville"
     #:brace "gonville"
   ))
}

Note: Each call to set-global-fonts completely resets both the main notation and text fonts. If any category is left unspecified, then the default font will be used for that category. Each call to set-global-fonts changes the fonts for each \book that follows it, whether created explicitly or implicitly. This means that each \book can have its own set of main fonts by calling set-global-fonts before it. For more information, see Entire document fonts.

See also

Learning Manual: (learning)Other sources of information section ‘Other sources of information’ in Learning Manual.

Notation Reference: The Emmentaler font, Entire document fonts.

Known issues and warnings

Gonville cannot be used to typeset ‘Ancient Music’ notation and it is likely newer glyphs in later releases of LilyPond may not exist in the Gonville font family. Please refer to the author’s website for more information on these and other specifics, including licensing of Gonville.

Other notation fonts

If you have other notation fonts like ‘fontname-*.otf’, ‘fontname-*.svg’, and ‘fontname-*.woff’, you can use them in the same way as Gonville.

That is, copy the ‘fontname-*.otf’ files to ‘…/share/lilypond/current/fonts/otf’ or ‘…/share/lilypond/X.Y.Z/fonts/otf’. If you have ‘fontname-*.svg’ and ‘fontname-*.woff’ files, copy them to ‘…/share/lilypond/current/fonts/svg’ or ‘…/share/lilypond/X.Y.Z/fonts/svg’.

Note: At the moment, LilyPond expects the font file names to have the following suffixes, all of which must be present in the above installation folder(s) to work properly: ‘-11’, ‘-13’, ‘-14’, ‘-16’, ‘-18’, ‘-20’, ‘-23’, ‘-26’, ‘-brace’. For example, ‘emmentaler-11.otf’, ‘emmentaler-20.svg’, and ‘emmentaler-brace.woff’ etc.

The following syntax changes the notation font (general and brace) to the fontname font.

 
\paper {
  #(define fonts
    (set-global-fonts
     #:music "fontname" ; font filename without suffix and extension
     #:brace "fontname" ; font filename without suffix and extension
   ))
}

Note: For music and brace categories, specify the font filename without the suffix and extension.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated by gub on July 13, 2020 using texi2html 1.82.

Outros idiomas: català, deutsch, español, français, italiano, 日本語.
Sobre seleção automática de idioma.