[icon]

GNU LilyPond

Welcome to the home of the GNU Music Typesetter

What is LilyPond
General information
Simple examples
Complex examples
Download
GNU/Linux binaries
Windows
Source code
Documentation
Tutorial
Manual
Glossary
other ...

Support
Mailing lists
Search
WikiWiki
FAQs

External sites
lilypond.org/development
lilypond.org/stable
ftp.lilypond.org
Mutopia
Other music online

Node:Tuning per grob, Next:, Previous:Tuning groups of grobs, Up:Tuning output



Tuning per grob

A second way of tuning grobs is the more arcane \outputproperty feature. The syntax is as follows:

\outputproperty predicate symbol = value
Here predicate is a Scheme function taking a grob argument, and returning a boolean. This statement is processed by the Output_property_engraver . It instructs the engraver to feed all grobs that it sees to predicate. Whenever the predicate returns true, the grob property symbol will be set to value.

You will need to combine this statement with \context to select the appropriate context to apply this to.

Here are some random examples.

In the following example, all note heads occurring at current staff level, are shifted up and right by setting their extra-offset property.

\relative c'' { c4
  \context Staff \outputproperty
  #(make-type-checker 'note-head-interface)
  #'extra-offset = #'(0.5 . 0.75)
  <c8 e g> }

[picture of music]

In this example, the predicate checks the text grob property, to shift only the `m.d.' text, but not the fingering instruction "2".

#(define (make-text-checker text)
   (lambda (grob) (equal? text (ly-get-grob-property grob 'text))))

\score {
  \notes\relative c''' {
    \property Voice.Stem \set #'direction = #1
    \outputproperty #(make-text-checker "m.d.")
      #'extra-offset = #'(-3.5 . -4.5)
    a^2^"m.d."
  }
}

[picture of music]

BUGS

If possible, avoid this feature: the semantics are not very clean, and the syntax and semantics are up for rewrite.

Go back to index of LilyPond.

Please send GNU LilyPond questions and comments to lilypond-user@gnu.org.

Please send comments on these web pages to lilypond@packages.debian.org

Copyright (c) 1997--2001 Han-Wen Nienhuys and Jan Nieuwenhuizen.

Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.


This page was built from LilyPond-1.4.12 (stable-branch) by

Anthony Fok <lilypond@packages.debian.org>, Tue Mar 12 01:35:39 2002 HKT.