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