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