lilypond-user
[Top][All Lists]
Advanced

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

Re: Function to add a "-" before finger number


From: Nick Payne
Subject: Re: Function to add a "-" before finger number
Date: Tue, 03 Aug 2010 21:35:36 +1000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6

On 03/08/10 10:55, Antheo wrote:
Hi,

I write some Violin pieces and would like to implement a function to typeset
a commonly used fingering with the shift indicator (simply a "-" before the
finger number).

Ideally I'd like to have the following syntax: {f \shift a-1} where the
\shift command would add a dash and offset the finger number to be aligned
with the note. Or it could be {f a\shift-1}.

I implemented the following function but it does not behave as expected and
generate side effects.

%% Shift Finger
%% Print a finger number preceded by a "-" to indicate a shift
%% Usage: ex: f \shift a-1
%% Passing a string as i had error with passing an integer

sf = #(define-music-function (parser location finger) ( string? ) #{
        \once \override TextScript #'extra-offset = #'(0 . 0)
     \mark \markup { \tiny \concat {\char ##x2012 $finger }}
#})
http://old.nabble.com/file/p29331036/Snippet_Fingering.ly
Snippet_Fingering.ly
Why not use a modified glissando:

\version "2.13.28"

guide = #(define-music-function (parser location padleft padright shift) (number? number? pair?) #{
    \once \override Glissando #'bound-details #'left #'padding = #$padleft
\once \override Glissando #'bound-details #'right #'padding = #$padright
    \once \override Glissando #'extra-offset = #$shift
#})

\relative c'' {
    \override Fingering #'staff-padding = #'()
    \guide #2 #1 #'(0 . 1.4) <b-1>2\glissando <c-1>
}

Nick

Attachment: test.preview.png
Description: PNG image


reply via email to

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