]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/new/adding-orchestral-cues-to-a-vocal-score.ly
Merge remote-tracking branch 'origin/master' into translation
[lilypond.git] / Documentation / snippets / new / adding-orchestral-cues-to-a-vocal-score.ly
1 \version "2.17.6"
2
3 \header {
4   lsrtags = "staff-notation, vocal-music"
5
6   texidoc = "
7 This shows one approach to simplify adding many orchestral cues to the
8 piano reduction in a vocal score.  The music function @code{\\cueWhile}
9 takes four arguments: the music from which the cue is to be taken, as
10 defined by @code{\\addQuote}, the name to be inserted before the cue
11 notes, then either @code{#UP} or @code{#DOWN} to specify either
12 @code{\\voiceOne} with the name above the staff or @code{\\voiceTwo}
13 with the name below the staff, and finally the piano music in parallel
14 with which the cue notes are to appear.  The name of the cued
15 instrument is positioned to the left of the cued notes. Many passages
16 can be cued, but they cannot overlap each other in time.
17
18 "
19   doctitle = "Adding orchestral cues to a vocal score"
20 }
21
22 cueWhile =
23 #(define-music-function
24    (parser location instrument name dir music)
25    (string? string? ly:dir? ly:music?)
26    #{
27      \cueDuring $instrument #dir {
28        \once \override TextScript.self-alignment-X = #RIGHT
29        \once \override TextScript.direction = $dir
30        <>-\markup { \tiny #name }
31        $music
32      }
33    #})
34
35 flute = \relative c'' {
36   \transposition c'
37   s4 s4 e g
38 }
39 \addQuote "flute" { \flute }
40
41 clarinet = \relative c' {
42   \transposition bes
43   fis4 d d c
44 }
45 \addQuote "clarinet" { \clarinet }
46
47 singer = \relative c'' { c4. g8 g4 bes4 }
48 words = \lyricmode { here's the lyr -- ics }
49
50 pianoRH = \relative c'' {
51   \transposition c'
52   \cueWhile "clarinet" "Clar." #DOWN { c4. g8 }
53   \cueWhile "flute" "Flute" #UP { g4 bes4 }
54 }
55 pianoLH = \relative c { c4 <c' e> e, <g c> }
56
57 \score {
58   <<
59     \new Staff {
60       \new Voice = "singer" {
61         \singer
62       }
63     }
64     \new Lyrics {
65       \lyricsto "singer"
66       \words
67     }
68     \new PianoStaff <<
69       \new Staff {
70         \new Voice {
71           \pianoRH
72         }
73       }
74       \new Staff {
75         \clef "bass"
76         \pianoLH
77       }
78     >>
79   >>
80 }