]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/score-for-diatonic-accordion.ly
Rerun scripts/auxiliar/update-with-convert-ly.sh
[lilypond.git] / Documentation / snippets / score-for-diatonic-accordion.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.16.0
8 \version "2.17.6"
9
10 \header {
11   lsrtags = "template, real-music, specific-notation"
12
13   texidoc = "
14 A template to write a score for a diatonic accordion.
15
16 - There is a horizontal staff indicating if the accordion must be
17 pushed (thick line) or pulled (thin line)
18
19 - There is a small rhythmic staff with lyrics that describes the bass
20 buttons to press. The bar lines are made from gridlines
21
22 - The tabulator staff for diatonic accordions shows the geographic
23 position of the buttons and not (as for every other instrument) the
24 pitch of the notes; the keys on the melody-side of the accordion are
25 placed in three columns and about 12 rows
26
27
28 In the tabulator staff notation the outermost column is described with
29 notes between lines, the innermost column is described with notes
30 between lines and a cross as accidental, and the middle column is
31 described with notes on a line, whereby the row in the middle is
32 represented on the middle line in the staff.
33
34
35 Some words to transpose piano notes to the diatonic accordion:
36
37
38 1. Every diatonic accordion is built for some keys only (for example,
39 for the keys of C major and F major), so it is important to transpose a
40 piano melody to match one of these keys. Transpose the source code, not
41 only the output because this code is required later on to translate it
42 once more to the tabulator staff. This can be done with the command
43 @code{displayLilyMusic}.
44
45
46 2. You have to alternate the push- and pull-direction of the accordion
47 regularly. If the player has a too long part to pull the accordion gets
48 broken. On the other hand, some harmonies are only available in one
49 direction. Considering this, decide which parts of the melody are the
50 push-parts and which the pull-parts.
51
52
53 3. For each pull- or push-part translate the piano notes to the
54 according tabulature representation.
55
56
57 This snippet comes with a useful optional macro for the jEdit text
58 editor.
59
60 "
61   doctitle = "Score for diatonic accordion"
62 } % begin verbatim
63
64
65 verse = \lyricmode { Wie gross bist du! Wie gross bist du! }
66
67 harmonies = \new ChordNames \chordmode {
68   \germanChords
69   \set chordChanges = ##t
70   bes8 bes8 bes8
71   es2 f
72   bes1
73 }
74
75 NoStem = { \override Stem.transparent = ##t \override Flag.transparent = ##t }
76 NoNoteHead = \override NoteHead.transparent = ##t
77 ZeroBeam = \override Beam.positions = #'(0 . 0)
78
79 staffTabLine = \new Staff \with {
80   \remove "Time_signature_engraver"
81   \remove "Clef_engraver"
82 } {
83   \override Staff.StaffSymbol.line-positions = #'(0)
84   % Shows one horizontal line. The vertical line (simulating a bar-line) is simulated with a gridline
85   \set Staff.midiInstrument = #"choir aahs"
86   \key c \major
87   \relative c''
88   {
89     % disable the following line to see the the noteheads while writing the song
90     \NoNoteHead
91     \override NoteHead.no-ledgers = ##t
92
93     % The beam between 8th-notes is used to draw the push-line
94     %How to fast write the push-lines:
95     %  1. write repeatedly 'c c c c c c c c |' for the whole length of the song
96     %  2. uncomment the line \NoNoteHead
97     %  3. compile
98     %  4. Mark the positions on which push/pull changes.
99     %     In the score-picture click on the position the push- or pull-part starts
100     %           (on the noteHead, the cursor will change to a hand-icon).
101     %     The cursor in the source code will jump just at this position.
102     %   a) If a push-part starts there, replace the 'c' by an 'e['
103     %   b) If a pull-part starts there, replace the 'c' by an 's'
104     %  5. Switch into 'overwrite-mode' by pressing the 'ins' key.
105     %  6. For the pull-parts overwrite the 'c' with 's'
106     %  7. For every push-part replace the last 'c' with 'e]'
107     %        8. Switch into 'insert-mode' again
108     %  9. At last it should look lik e.g. (s s e[ c | c c c c c c c c | c c c c c c e] s s)
109     % 10. re-enable the line \NoNoteHead
110     \autoBeamOff
111     \ZeroBeam
112     s8 s s e[ c c c c c c e] | s s s s s
113   }
114 }
115
116 %{
117 %}
118
119 % Accordion melody in tabulator score
120 % 1. Place a copy of the piano melody below
121 % 2. Separate piano melody into pull- and push-parts according to the staffTabLine you've already made
122 % 3. For each line: Double the line. Remark the 1st one (Keeps unchanged as reference) and then change the second line using the transformation paper
123 %    or the macros 'conv2diaton push.bsh' and 'conv2diaton pull.bsh'
124 % Tips:
125 % - In jEdit Search & Replace mark the Option 'Keep Dialog'
126
127 AccordionTabTwoCBesDur = {
128   % pull 1
129   %<f' bes'>8 <f' a'>8 <d' bes'>8 |
130   <g'' a''>8 <g'' b''>8 <e'' a''>8 |
131   % push 2
132   %<g' c''>4 <f' d''> <g' ees''> <f' a'> |
133   <g'' a''>4 <d'' eisis''> <g'' bisis''> <d'' f''> |
134   % pull 3
135   % <f' bes'>2 r8 }
136   <g'' a''>2 r8 }
137
138 AccordionTab= { \dynamicUp
139   % 1. Place a copy of the piano melody above
140   % 2. Separate piano melody into pull- and push-parts according to the staffTabLine you've already made
141   % 3. For each line: Double the line. Remark the 1st one (Keeps unchanged as reference) and then
142   %    change the second line using the transformation paper
143   % Tips:
144   % - In jEdit Search & Replace mark the Option 'Keep Dialog'
145   % -
146   \AccordionTabTwoCBesDur
147 }
148
149
150
151 \layout {
152   \context {
153     \Score
154     % The vertical line (simulating a bar-line) in
155     % the staffBassRhytm is a gridline
156     \consists "Grid_line_span_engraver"
157   }
158   \context {
159     \Staff
160     \consists "Grid_point_engraver"
161     gridInterval = #(ly:make-moment 4 4) % 4/4 - tact. How many beats per bar
162     % The following line has to be adjusted O-F-T-E-N.
163     \override GridPoint.Y-extent = #'(-2 . -21)
164   }
165   \context {
166     \ChoirStaff
167     \remove "System_start_delimiter_engraver"
168   }
169 }
170
171 staffVoice = \new Staff = astaffvoice  {
172   \time 4/4
173   \set Staff.instrumentName = "Voice"
174   \set Staff.midiInstrument = "voice oohs"
175   \key bes \major
176   \partial 8*3
177   \clef treble
178   {
179     \context Voice = "melodyVoi"
180     { <f' bes'>8 <f' a'>8 <d' bes'>8 | <g' c''>4 <f' d''> <g' es''> <f' a'> | <f' bes'>2 r8 }
181     \bar "|."
182   }
183 }
184
185 staffAccordionMel =
186 \new Staff  \with { \remove "Clef_engraver" } {
187   \accidentalStyle forget %Set the accidentals (Vorzeichen) for each note,
188   %do not remember them for the rest of the measure.
189   \time 4/4
190   \set Staff.instrumentName="Accordion"
191   \set Staff.midiInstrument="voice oohs"
192   \key c \major
193   \clef treble
194   { \AccordionTab \bar "|." }
195 }
196
197 AltOn =
198 #(define-music-function (parser location mag) (number?)
199   #{ \override Stem.length = #(* 7.0 mag)
200       \override NoteHead.font-size =
201 #(inexact->exact (* (/ 6.0 (log 2.0)) (log mag))) #})
202
203 AltOff = {
204   \revert Stem.length
205   \revert NoteHead.font-size
206 }
207
208 BassRhytm = {s4 s8 | c2 c2 | c2 s8 }
209 LyricBassRhythmI=  \lyricmode { c b | c }
210
211 staffBassRhytm =
212 \new Staff = staffbass \with { \remove "Clef_engraver" } {
213   % This is not a RhythmicStaff  because it must be possible to append lyrics.
214
215   \override Score.GridLine.extra-offset = #'( 13.0 . 0.0 ) % x.y
216   \override Staff.StaffSymbol.line-positions = #'( 0 )
217   % Shows one horizontal line. The vertical line (simulating a bar-line) is simulated by a grid
218   % Search for 'grid' in this page to find all related functions
219   \time 4/4
220   {
221     \context Voice = "VoiceBassRhytm"
222     \stemDown \AltOn #0.6
223     \relative c''
224     {
225       \BassRhytm
226     }
227     \AltOff
228     \bar "|."
229   }
230 }
231
232 \score {
233   \new ChoirStaff <<
234     \harmonies
235     \staffVoice
236     \context Lyrics = "lmelodyVoi"
237       \with { alignBelowContext = astaffvoice }
238       \lyricsto melodyVoi \verse
239     \staffAccordionMel
240     \staffTabLine
241     \staffBassRhytm
242     \context Lyrics = "lBassRhytmAboveI"
243       \with { alignAboveContext = staffbass }
244       \lyricsto VoiceBassRhytm \LyricBassRhythmI
245   >>
246 }
247 %}