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