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