[icon]

GNU LilyPond

-- --

What is LilyPond
Home
Examples
Templates
Download
GNU/Linux binaries
Windows binaries
Source code
Documentation
Tutorial
Manual
Glossary
Index

Support
Mailing lists
Search
WikiWiki

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

Tuning per object

Tuning a single object is most often done with \property. The form,

             \once \property ...
     
applies a setting only during one moment in the score: notice how the original setting for stem thickness is restored automatically in the following example
       c4
       \once \property Voice.Stem \set #'thickness = #4
       c4
       c4
     
[picture of music]

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

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

This command is only single shot, in contrast to \override and \set.

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

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)
       <<c e g>>8 }
     
[picture of music]

In this example, the predicate checks the text object 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 (address unknown)

Copyright (c) 1997--2002 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.7.14 (development-branch) by

Buchan Milne <(address unknown)>, Thu Mar 6 21:11:35 2003 CET.