]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/clip-systems.ly
736586bb9493f58c7bd414363e21f3c4d81a8ec7
[lilypond.git] / Documentation / snippets / clip-systems.ly
1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.di.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.19.22"
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 #(ly:set-option 'clip-systems)
37 #(define output-suffix "1")
38
39 origScore = \score {
40   \relative c' {
41     \set Staff.instrumentName = #"bla"
42     c1
43     d1
44     \grace c16 e1
45     \key d \major
46     f1 \break
47     \clef bass
48     g,1
49     fis1
50   }
51 }
52
53 \book {
54   \score {
55     \origScore
56     \layout {
57       % Each clip-region is a (START . END) pair
58       % where both are rhythmic-locations.
59
60       % (make-rhythmic-locations BAR-NUMBER NUM DEN)
61       % means NUM/DEN whole-notes into bar numbered BAR-NUMBER
62
63       clip-regions = #(list
64       (cons
65        (make-rhythmic-location 2 0 1)
66        (make-rhythmic-location 4 0 1))
67
68       (cons
69        (make-rhythmic-location 0 0 1)
70        (make-rhythmic-location 4 0 1))
71
72       (cons
73        (make-rhythmic-location 0 0 1)
74        (make-rhythmic-location 6 0 1))
75       )
76     }
77   }
78 }
79
80 #(ly:set-option 'clip-systems #f)
81 #(define output-suffix #f)
82
83 \book {
84   \score { \origScore }
85   \markup { \bold \fontsize #6 clips }
86   \score {
87     \lyrics {
88       \markup { from-2.0.1-to-4.0.1-clip.eps }
89       \markup {
90         \epsfile #X #30.0 #(format #f "~a-1-from-2.0.1-to-4.0.1-clip.eps"
91                             (ly:parser-output-name)) }
92     }
93   }
94 }