]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/clip-systems.ly
Update snippets from today's LSR with changed makelsr.py
[lilypond.git] / Documentation / snippets / clip-systems.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.2"
8
9 \header {
10   lsrtags = "paper-and-layout"
11
12   texidoc = "
13 This code shows how to clip (extract) snippets from a full score.
14
15 This file needs to be run separately with @code{-dclip-systems}; the
16 snippets page may not adequately show the results.
17
18 The result will be files named
19 @samp{base-from-start-to-end[-count].eps}.
20
21
22 If system starts and ends are included, they include extents of the
23 System grob, e.g., instrument names.
24
25
26 Grace notes at the end point of the region are not included.
27
28
29 Regions can span multiple systems.  In this case, multiple EPS files
30 are generated.
31
32 "
33   doctitle = "Clip systems"
34 } % begin verbatim
35
36
37 #(ly:set-option 'clip-systems)
38 #(define output-suffix "1")
39
40 origScore = \score {
41   \relative c' {
42     \set Staff.instrumentName = #"bla"
43     c1
44     d1
45     \grace c16 e1
46     \key d \major
47     f1 \break
48     \clef bass
49     g,1
50     fis1
51   }
52 }
53
54 \book {
55   \score {
56     \origScore
57     \layout {
58       % Each clip-region is a (START . END) pair
59       % where both are rhythmic-locations.
60
61       % (make-rhythmic-locations BAR-NUMBER NUM DEN)
62       % means NUM/DEN whole-notes into bar numbered BAR-NUMBER
63
64       clip-regions = #(list
65       (cons
66        (make-rhythmic-location 2 0 1)
67        (make-rhythmic-location 4 0 1))
68
69       (cons
70        (make-rhythmic-location 0 0 1)
71        (make-rhythmic-location 4 0 1))
72
73       (cons
74        (make-rhythmic-location 0 0 1)
75        (make-rhythmic-location 6 0 1))
76       )
77     }
78   }
79 }
80
81 #(ly:set-option 'clip-systems #f)
82 #(define output-suffix #f)
83
84 \book {
85   \score { \origScore }
86   \markup { \bold \fontsize #6 clips }
87   \score {
88     \lyrics {
89       \markup { from-2.0.1-to-4.0.1-clip.eps }
90       \markup {
91         \epsfile #X #30.0 #(format #f "~a-1-from-2.0.1-to-4.0.1-clip.eps"
92                             (ly:parser-output-name parser)) }
93     }
94   }
95 }