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