]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/creating-double-digit-fingerings.ly
c1d0fb620fc3391b0f626b89591f590fa9c65b88
[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.16.0"
8
9 \header {
10   lsrtags = "editorial-annotations, expressive-marks, scheme-language, staff-notation, 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
23 ten =
24 #(make-music 'FingeringEvent
25              'digit 10)
26
27 fifty =
28 #(make-music 'FingeringEvent
29              'digit 50)
30
31 finger =
32 #(define-music-function (parser location digit) (integer?)
33    (make-music 'FingeringEvent
34                'digit digit))
35
36 #(define (calc-finger-without-warning grob)
37    (let* ((event (event-cause grob))
38           (digit (ly:event-property event 'digit)))
39      (number->string digit 10)))
40
41 \relative c' {
42   % optional override to remove warnings for fingerings larger than 5
43   \override Fingering #'text = #calc-finger-without-warning
44   c1\ten
45   c1\fifty
46   c1-\finger #36
47   c1-\finger #29
48 }