]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/creating-double-digit-fingerings.ly
Doc-it: fix compile.
[lilypond.git] / Documentation / snippets / creating-double-digit-fingerings.ly
1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.dsi.unimi.it
3 %% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
4 %% and then run scripts/auxiliar/makelsr.py
5 %%
6 %% This file is in the public domain.
7 \version "2.14.0"
8
9 \header {
10   lsrtags = "expressive-marks, staff-notation, editorial-annotations, tweaks-and-overrides"
11
12   texidoc = "
13 By default you cannot make double-digit fingering notation (i.e.
14 numbers larger than 9). This is a hard coded limitation.
15
16 This snippet shows two methods of creating fingerings larger than 9.
17
18 "
19   doctitle = "Creating double-digit fingerings"
20 } % begin verbatim
21
22 ten =
23 #(make-music 'FingeringEvent
24              'digit 10)
25
26 fifty =
27 #(make-music 'FingeringEvent
28              'digit 50)
29
30 finger =
31 #(define-music-function (parser location digit) (integer?)
32    (make-music 'FingeringEvent
33                'digit digit))
34
35 #(define (calc-finger-without-warning grob)
36    (let* ((event (event-cause grob))
37           (digit (ly:event-property event 'digit)))
38      (number->string digit 10)))
39
40 \relative c' {
41   % optional override to remove warnings for fingerings larger than 5
42   \override Fingering #'text = #calc-finger-without-warning
43   c1\ten
44   c1\fifty
45   c1-\finger #36
46   c1-\finger #29
47 }