]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/adding-extra-fingering-with-scheme.ly
Doc-fr: updates texidocs
[lilypond.git] / Documentation / snippets / adding-extra-fingering-with-scheme.ly
1 % DO NOT EDIT this file manually; it is automatically
2 % generated from Documentation/snippets/new
3 % Make any changes in Documentation/snippets/new/
4 % and then run scripts/auxiliar/makelsr.py
5 %
6 % This file is in the public domain.
7 %% Note: this file works from version 2.16.0
8 \version "2.16.0"
9
10 \header {
11   lsrtags = "scheme-language"
12
13   texidoc = "
14 You can add additional elements to notes using @code{map-some-music}. In this
15 example, an extra script is attached to a note.
16
17 In general, first do a @code{\\displayMusic} of the music you want to
18 create, then write a function that will work on the appropriate parts
19 of the music for you.
20 "
21   doctitle = "Adding extra fingering with scheme"
22 } % begin verbatim
23
24
25 addScript =
26 #(define-music-function (parser location script music)
27    (ly:event? ly:music?)
28    (map-some-music
29     (lambda (mus)
30       (define (append-script-at! prop)
31         (set! (ly:music-property mus prop)
32               (append (ly:music-property mus prop)
33                       (list (ly:music-deep-copy script))))
34         mus)
35       (case (ly:music-property mus 'name)
36         ((EventChord)
37          (append-script-at! 'elements))
38         ((NoteEvent)
39          (append-script-at! 'articulations))
40         (else #f)))
41     music))
42
43 \score {
44   {
45     \addScript _6 { c'4-3 <c' e' g'> }
46   }
47 }