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