From: Han-Wen Nienhuys Date: Thu, 9 Feb 2006 13:43:46 +0000 (+0000) Subject: (Difficult tweaks): X-Git-Tag: release/2.7.34~26 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0ef93e0bd8cb15590c99970c9d09c0f47a8ff5d5;p=lilypond.git (Difficult tweaks): remove applyOutput example. (Objects connected to the input): document \tweak, \parenthesize --- diff --git a/ChangeLog b/ChangeLog index 1cd6a81386..9ae9bcf632 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-02-09 Han-Wen Nienhuys + * Documentation/user/changing-defaults.itely (Difficult tweaks): + remove applyOutput example. + (Objects connected to the input): document \tweak, \parenthesize + * lily/relocate.cc (prefix_relocation): allow "current" iso. TOPLEVEL_VERSION for share/lilypond/ suffix. This makes changing VERSION in a lily tree less painful. diff --git a/Documentation/user/changing-defaults.itely b/Documentation/user/changing-defaults.itely index b1d66dea4f..0bd06f0995 100644 --- a/Documentation/user/changing-defaults.itely +++ b/Documentation/user/changing-defaults.itely @@ -1232,50 +1232,59 @@ the @internalsref{Fingering_engraver} plug-in says Fingering_engraver is part of contexts: @dots{} @b{@internalsref{Voice}} @end quotation +@node Objects connected to the input +@subsection Objects connected to the input + +In some cases, it is possible to take a short-cut for tuning graphical +objects. For objects that result directly from a piece of the input, +you can use the @code{\tweak} function, for example + +@lilypond[relative=2,fragment,verbatim,ragged-right] +< + c + \tweak #'color #red d + g + \tweak #'duration-log #1 a +>4-\tweak #'padding #10 -. +@end lilypond + +As you can see, properties are set directly in the objects directly, +without mentioning the grob name or context where this should be +applied. + +This technique only works for objects that are directly connected to +an @internalsref{event} from the input, for example + +@itemize @bullet +@item note heads, caused by chord-pitch. +@item articulation signs, caused by articulation instructions +@end itemize + +It notably does not work for stems and accidentals (these are caused +by note heads, not by music events), clefs (these are not caused by +music inputs, but rather by the change of a property value). + +In a similar vein, objects may be parenthesized by prefixing +@code{\parenthesize} to the music event, + +@lilypond[relative=2,fragment,verbatim,ragged-right] +< + c + \parenthesize d + g +>4-\parenthesize -. +@end lilypond + + + + @node Difficult tweaks @subsection Difficult tweaks There are a few classes of difficult adjustments. @itemize @bullet -First, when there are -several of the same objects at one point, and you want to adjust only -one. - -For example, if you want to change only one note head in a chord. - -In this case, the @code{\applyOutput} function must be used. The -next example defines a Scheme function @code{set-position-font-size} -that sets the @code{font-size} property, but only -on objects that have @internalsref{note-head-interface} and are at the -right Y-position. - -@lilypond[quote,verbatim] -#(define ((set-position-font-size pos size) grob origin current) - (let* - ((meta (ly:grob-property grob 'meta)) - (interfaces (cdr (assoc 'interfaces meta))) - (position (ly:grob-property grob 'staff-position))) - (if (and - ; is this a note head? - (memq 'note-head-interface interfaces) - - ; is the Y coordinate right? - (= pos position)) - - ; then do it. - (set! (ly:grob-property grob 'font-size) size)))) - -\relative { - c - \applyOutput #(set-position-font-size -2 4) - -} -@end lilypond -@noindent -A similar technique can be used for accidentals. In that case, the -function should check for @code{accidental-interface}. @item Another difficult adjustment is the appearance of spanner objects, diff --git a/make/lilypond-vars.make b/make/lilypond-vars.make index bd8d172f2e..23d39b8a41 100644 --- a/make/lilypond-vars.make +++ b/make/lilypond-vars.make @@ -3,8 +3,8 @@ ifeq ($(LILYPOND_EXTERNAL_BINARY),) # environment settings. export PATH:=$(top-build-dir)/lily/$(outconfbase):$(top-build-dir)/buildscripts/$(outconfbase):$(top-build-dir)/scripts/$(outconfbase):$(PATH): -export LILYPONDPREFIX:=$(build_lilypond_datadir)/$(TOPLEVEL_VERSION) -export DVIPSHEADERS:=$(top-build-dir)/mf/out:: +export LILYPONDPREFIX:=$(build_lilypond_datadir)/current +bexport DVIPSHEADERS:=$(top-build-dir)/mf/out:: export LILYPOND_BINARY=$(top-build-dir)/lily/$(outconfbase)/lilypond else