]> git.donarmstrong.com Git - lilypond.git/blob - input/new/clip-systems.ly
Update from Neil in input/new
[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
16 @item
17 If system starts and ends are included, they include extents of the
18 System grob, e.g., instrument names.
19
20 @item
21 Grace notes at the end point of the region are not included.
22
23 @item
24 Regions can span multiple systems.  In this case, multiple EPS files
25 are generated.
26
27 @end itemize
28 "
29   doctitle = "Clip systems"
30 }
31
32 #(ly:set-option 'clip-systems)
33 #(set! output-count 1)
34
35 origScore = \score {
36   \relative c' {
37     \set Staff.instrumentName = #"bla"
38     c1
39     d
40     \grace c16 e1
41     \key d \major
42     f \break
43     \clef bass
44     g,
45     fis
46   }
47 }
48
49 \book {
50   \score {
51     \origScore
52     \layout {
53       % Each clip-region is a (START . END) pair
54       % where both are rhythmic-locations.
55       
56       % (make-rhythmic-locations BAR-NUMBER NUM DEN)
57       % means NUM/DEN whole-notes into bar numbered BAR-NUMBER
58
59       clip-regions = #(list
60       (cons
61        (make-rhythmic-location 2 0 1)
62        (make-rhythmic-location 4 0 1))
63       
64       (cons
65        (make-rhythmic-location 0 0 1)
66        (make-rhythmic-location 4 0 1))
67
68       (cons
69        (make-rhythmic-location 0 0 1)
70        (make-rhythmic-location 6 0 1))
71       )
72     }
73   }
74 }
75
76 #(set! output-count 0)
77 #(ly:set-option 'clip-systems #f)
78
79 \book {
80   \score { \origScore }
81   \markup { \bold \fontsize #6 clips }
82   \score {
83     \lyrics {
84       \markup { from-2.0.1-to-4.0.1-clip.eps }
85       \markup {
86         \epsfile #X #30.0 #(format #f "~a-1-from-2.0.1-to-4.0.1-clip.eps"
87                             (ly:parser-output-name parser)) }
88     }
89   }
90 }