lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[TIP/TRICK] a function to shift a tuplet


From: Kieren MacMillan
Subject: [TIP/TRICK] a function to shift a tuplet
Date: Tue, 6 Jun 2006 13:27:24 -0400

Hello, all --

Sometimes (though not very often!), Lilypond puts a tuplet in the wrong place, and you need to shift it up or down (or, I suppose, left and right!?).

Since it actually requires two shifts -- one each for the TupletBracket and TupletNumber -- I've written a simple function to encapsulate the whole tweak.
The function and an example is included, below.

Enjoy!
Kieren.

________________________________

%%%%% CODE SNIPPET BEGINS
\version "2.9.7"

tupletShift =
        #(define-music-function (parser location shift) (pair?)
                #{
                        \once \override TupletBracket #'extra-offset = $shift
                        \once \override TupletNumber #'extra-offset = $shift
                #})

\relative c'
{
        \time 4/2
        \times 2/3 { c4 c c }
        \tupletShift #'( 0 . 4 ) \times 2/3 { c4 c c }  % up 4 spaces
\tupletShift #'( -2 . 2 ) \times 2/3 { c4 c c } % left 2 spaces, up 2 spaces \times 2/3 { c4 c c } % \once in the function means subsequent tuplets 'revert'
}
%%%%% CODE SNIPPET ENDS





reply via email to

[Prev in Thread] Current Thread [Next in Thread]