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