]> git.donarmstrong.com Git - lilypond.git/blob - ly/property-init.ly
Merge branch 'lilypond/translation' of ssh://git.sv.gnu.org/srv/git/lilypond into...
[lilypond.git] / ly / property-init.ly
1 % property-init.ly
2
3 \version "2.12.0"
4
5 stemUp = \override Stem #'direction = #UP
6 stemDown = \override Stem #'direction = #DOWN 
7 stemNeutral = \revert Stem #'direction
8
9 slurUp = \override Slur #'direction = #UP
10 slurDown = \override Slur #'direction = #DOWN
11 slurNeutral = \revert Slur #'direction
12
13 #(define (make-simple-dash-definition dash-fraction dash-period)
14     (list (list 0 1 dash-fraction dash-period)))
15
16 slurDashed = {
17   \override Slur #'dash-definition =  #'((0 1 0.4 0.75))
18 }
19 slurDashPattern = 
20 #(define-music-function (parser location dash-fraction dash-period)
21   (number? number?)
22   #{
23      \override Slur #'dash-definition =
24        $(make-simple-dash-definition dash-fraction dash-period)
25   #})
26 slurDotted = {
27   \override Slur #'dash-definition =  #'((0 1 0.1 0.75))
28 }
29 slurHalfDashed = {
30   \override Slur #'dash-definition =  #'((0 0.5 0.4 0.75)
31                                          (0.5 1 1 1))
32 }
33 slurHalfSolid = {
34   \override Slur #'dash-definition =  #'((0 0.5 1 1)
35                                          (0.5 1 0.4 0.75))
36 }
37 slurSolid = {
38   \revert Slur #'dash-definition
39 }
40
41
42 phrasingSlurUp = \override PhrasingSlur #'direction = #UP
43 phrasingSlurDown = \override PhrasingSlur #'direction = #DOWN
44 phrasingSlurNeutral = \revert PhrasingSlur #'direction
45
46 phrasingSlurDashed = {
47   \override PhrasingSlur #'dash-definition =  #'((0 1 0.4 0.75))
48 }
49 phrasingSlurDashPattern = 
50 #(define-music-function (parser location dash-fraction dash-period)
51   (number? number?)
52   #{
53      \override PhrasingSlur #'dash-definition =
54        $(make-simple-dash-definition dash-fraction dash-period)
55   #})
56 phrasingSlurDotted = {
57   \override PhrasingSlur #'dash-definition =  #'((0 1 0.1 0.75))
58 }
59 phrasingSlurHalfDashed = {
60   \override PhrasingSlur #'dash-definition =  #'((0 0.5 0.4 0.75)
61                                                  (0.5 1 1 1))
62 }
63 phrasingSlurHalfSolid = {
64   \override PhrasingSlur #'dash-definition =  #'((0 0.5 1 1)
65                                                  (0.5 1 0.4 0.75))
66 }
67 phrasingSlurSolid = {
68   \revert PhrasingSlur #'dash-definition
69 }
70
71 mergeDifferentlyDottedOn = {
72   \override Staff.NoteCollision #'merge-differently-dotted = ##t
73 }
74 mergeDifferentlyDottedOff = {
75   \revert Staff.NoteCollision #'merge-differently-dotted
76 }
77
78 mergeDifferentlyHeadedOn = {
79   \override Staff.NoteCollision #'merge-differently-headed = ##t
80 }
81 mergeDifferentlyHeadedOff = {
82   \revert Staff.NoteCollision #'merge-differently-headed
83 }
84
85 shiftOn = \override NoteColumn #'horizontal-shift = #1
86 shiftOnn = \override NoteColumn #'horizontal-shift = #2
87 shiftOnnn = \override NoteColumn #'horizontal-shift = #3
88 shiftOff = \revert NoteColumn #'horizontal-shift
89
90 tieUp = \override Tie #'direction = #UP
91 tieDown = \override Tie #'direction = #DOWN
92 tieNeutral = \revert Tie #'direction
93
94 tieDashed = {
95   \override Tie #'dash-definition = #'((0 1 0.4 0.75))
96 }
97 tieDashPattern = 
98 #(define-music-function (parser location dash-fraction dash-period)
99   (number? number?)
100   #{
101      \override Tie #'dash-definition =
102        $(make-simple-dash-definition dash-fraction dash-period)
103   #})
104 tieDotted = {
105   \override Tie #'dash-definition = #'((0 1 0.1 0.75))
106 }
107 tieHalfDashed = {
108   \override Tie #'dash-definition =  #'((0 0.5 0.4 0.75)
109                                         (0.5 1 1 1))
110 }
111 tieHalfSolid = {
112   \override Tie #'dash-definition =  #'((0 0.5 1 1)
113                                         (0.5 1 0.4 0.75))
114 }
115 tieSolid = {
116   \revert Tie #'dash-definition
117 }
118
119 easyHeadsOn = {
120   \override NoteHead #'stencil = #ly:note-head::brew-ez-stencil
121   \override NoteHead #'font-size = #-7
122   \override NoteHead #'font-family = #'sans
123   \override NoteHead #'font-series = #'bold
124 }
125
126 easyHeadsOff = {
127   \revert NoteHead #'stencil
128   \revert NoteHead #'font-size
129   \revert NoteHead #'font-family
130   \revert NoteHead #'font-series
131 }
132
133 aikenHeads = \set shapeNoteStyles = #'#(do re mi fa #f la ti)
134
135 sacredHarpHeads = \set shapeNoteStyles = #'#(fa #f la fa #f la mi)
136
137 dynamicUp = {
138   \override DynamicText #'direction = #UP
139   \override DynamicLineSpanner #'direction = #UP
140 }
141
142 dynamicDown = {
143   \override DynamicText #'direction = #DOWN
144   \override DynamicLineSpanner #'direction = #DOWN
145 }
146
147 dynamicNeutral = {
148   \revert DynamicText #'direction
149   \revert DynamicLineSpanner #'direction
150 }
151
152
153 dotsUp = \override Dots #'direction = #UP
154 dotsDown = \override Dots #'direction = #DOWN
155 dotsNeutral = \revert Dots #'direction
156
157 tupletUp = \override TupletBracket #'direction = #UP
158 tupletDown = \override TupletBracket #'direction = #DOWN
159 tupletNeutral = \revert TupletBracket #'direction
160
161 cadenzaOn = \set Timing.timing = ##f
162 cadenzaOff = {
163   \set Timing.timing = ##t
164   \set Timing.measurePosition = #ZERO-MOMENT
165 }
166
167 % dynamic ly:dir?  text script, articulation script ly:dir? 
168 oneVoice = #(context-spec-music (make-voice-props-revert) 'Voice)
169 voiceOne = #(context-spec-music (make-voice-props-set 0) 'Voice)
170 voiceTwo = #(context-spec-music (make-voice-props-set 1) 'Voice)
171 voiceThree = #(context-spec-music (make-voice-props-set 2) 'Voice)
172 voiceFour = #(context-spec-music (make-voice-props-set 3) 'Voice)
173
174 voiceOneStyle = {
175   \override NoteHead #'style = #'diamond
176   \override NoteHead #'color = #red
177   \override Stem #'color = #red
178   \override Beam #'color = #red
179 }
180 voiceTwoStyle = {
181   \override NoteHead #'style = #'triangle
182   \override NoteHead #'color = #blue
183   \override Stem #'color = #blue
184   \override Beam #'color = #blue
185 }
186 voiceThreeStyle = {
187   \override NoteHead #'style = #'xcircle
188   \override NoteHead #'color = #green
189   \override Stem #'color = #green
190   \override Beam #'color = #green
191 }
192 voiceFourStyle = {
193   \override NoteHead #'style = #'cross
194   \override NoteHead #'color = #magenta
195   \override Stem #'color = #magenta
196   \override Beam #'color = #magenta
197 }
198 voiceNeutralStyle = {
199   \revert NoteHead #'style
200   \revert NoteHead #'color
201   \revert Stem #'color
202   \revert Beam #'color
203 }
204
205 teeny = {
206   \set fontSize = #-3
207 }
208
209 tiny = {
210   \set fontSize = #-2
211 }
212
213 small = {
214   \set fontSize = #-1
215 }
216
217 normalsize = {
218   \set fontSize = #0
219 }
220
221 large = {
222   \set fontSize = #1
223 }
224
225 huge = {
226   \set fontSize = #2
227 }
228
229 %% End the incipit and print a ``normal line start''.
230 endincipit = \context Staff {
231   \partial 16 s16  % Hack to handle e.g. \bar ".|" \endincipit
232   \once \override Staff.Clef #'full-size-change = ##t
233   \once \override Staff.Clef #'non-default = ##t
234   \bar ""
235 }
236
237 autoBeamOff = \set autoBeaming = ##f
238 autoBeamOn = \set autoBeaming = ##t
239
240 textLengthOn = {
241   \override TextScript #'extra-spacing-width = #'(0 . 0)
242   \override TextScript #'extra-spacing-height = #'(-inf.0 . +inf.0)
243 }
244
245 textLengthOff = {
246   \override TextScript #'extra-spacing-width = #'(+inf.0 . -inf.0)
247   \override TextScript #'extra-spacing-height = #'(0 . 0)
248 }
249
250 balloonLengthOn = {
251   \override BalloonTextItem #'extra-spacing-width = #'(0 . 0)
252   \override BalloonTextItem #'extra-spacing-height = #'(-inf.0 . +inf.0)
253 }
254
255 balloonLengthOff = {
256   \override BalloonTextItem #'extra-spacing-width = #'(+inf.0 . -inf.0)
257   \override BalloonTextItem #'extra-spacing-height = #'(0 . 0)
258 }
259
260
261 showStaffSwitch = \set followVoice = ##t
262 hideStaffSwitch = \set followVoice = ##f
263
264 expandFullBarRests = {
265   \set Score.skipBars = ##f
266 }
267
268 compressFullBarRests = {
269   \set Score.skipBars = ##t
270 }
271
272 numericTimeSignature = {
273   \override Staff.TimeSignature #'style = #'()
274 }
275
276 defaultTimeSignature = {
277   \revert Staff.TimeSignature #'style
278 }
279
280
281 % For drawing vertical chord brackets with \arpeggio
282 % This is a shorthand for the value of the print-function property 
283 % of either Staff.Arpeggio or PianoStaff.Arpeggio, depending whether 
284 % cross-staff brackets are desired. 
285
286 arpeggio = #(make-music 'ArpeggioEvent)
287
288 arpeggioArrowUp = {
289   \revert Arpeggio  #'stencil
290   \revert Arpeggio #'X-extent
291   \override Arpeggio  #'arpeggio-direction = #UP
292 }
293 arpeggioArrowDown = {
294   \revert Arpeggio #'stencil
295   \revert Arpeggio #'X-extent
296   \override Arpeggio  #'arpeggio-direction = #DOWN
297 }
298 arpeggioNormal = {
299   \revert Arpeggio #'stencil
300   \revert Arpeggio #'X-extent
301   \revert Arpeggio #'arpeggio-direction
302   \revert Arpeggio #'dash-definition
303 }
304 arpeggioBracket = {
305   \revert Arpeggio #'X-extent
306   \override Arpeggio #'stencil = #ly:arpeggio::brew-chord-bracket
307 }
308 arpeggioParenthesis = {
309   \override Arpeggio #'stencil = #ly:arpeggio::brew-chord-slur
310   \override Arpeggio #'X-extent = #ly:grob::stencil-width
311   \revert Arpeggio #'dash-definition
312 }
313 arpeggioParenthesisDashed = {
314   \override Arpeggio #'stencil = #ly:arpeggio::brew-chord-slur
315   \override Arpeggio #'X-extent = #ly:grob::stencil-width
316   \override Arpeggio #'dash-definition = #'((0 1 0.4 0.75))
317 }
318
319
320
321 glissando = #(make-music 'GlissandoEvent)
322
323 fermataMarkup = \markup { \musicglyph #"scripts.ufermata" } 
324
325 hideNotes = {
326   % hide notes, accidentals, etc.
327   \override Dots #'transparent = ##t
328   \override NoteHead #'transparent = ##t
329   \override NoteHead #'no-ledgers = ##t
330   \override Stem #'transparent = ##t
331   \override Beam #'transparent = ##t
332   \override Accidental #'transparent = ##t
333 }
334
335
336 unHideNotes = {
337   \revert Accidental #'transparent
338   \revert Beam #'transparent
339   \revert Stem #'transparent
340   \revert NoteHead #'transparent
341   \revert NoteHead #'no-ledgers
342   \revert Dots #'transparent
343 }
344
345 germanChords = {
346   \set chordRootNamer = #(chord-name->german-markup #t)
347   \set chordNoteNamer = #note-name->german-markup
348 }
349 semiGermanChords = {
350   \set chordRootNamer = #(chord-name->german-markup #f)
351   \set chordNoteNamer = #note-name->german-markup
352 }
353
354 frenchChords = {
355   \set chordRootNamer = #(chord-name->italian-markup #t)
356   \set chordPrefixSpacer = #0.4
357 }
358
359 italianChords = {
360   \set chordRootNamer = #(chord-name->italian-markup #f)
361   \set chordPrefixSpacer = #0.4
362 }
363
364 harmonicsOn = \override NoteHead #'style = #'harmonic
365
366 harmonicsOff = \revert NoteHead #'style
367
368 improvisationOn = {
369   \set squashedPosition = #0
370   \override NoteHead #'style = #'slash
371   \override Accidental #'stencil = ##f
372 }
373
374 improvisationOff = {
375   \unset squashedPosition
376   \revert NoteHead #'style
377   \revert Accidental #'stencil
378 }
379
380 textSpannerUp = \override TextSpanner #'direction = #UP
381 textSpannerDown = \override TextSpanner #'direction = #DOWN
382 textSpannerNeutral = \revert TextSpanner #'direction
383
384
385
386 bassFigureExtendersOn = {
387   \set useBassFigureExtenders = ##t
388   \set Staff.useBassFigureExtenders = ##t
389 }
390
391 bassFigureExtendersOff = {
392   \set useBassFigureExtenders = ##f
393   \set Staff.useBassFigureExtenders = ##f
394 }
395
396 bassFigureStaffAlignmentDown = {
397   \override Staff.BassFigureAlignmentPositioning #'direction = #DOWN
398 }
399
400 bassFigureStaffAlignmentUp = {
401   \override Staff.BassFigureAlignmentPositioning #'direction = #UP
402 }
403
404 bassFigureStaffAlignmentNeutral = {
405   \revert Staff.BassFigureAlignmentPositioning #'direction
406 }
407
408 predefinedFretboardsOff = {  
409   \set FretBoards.predefinedDiagramTable = ##f
410 }
411
412 predefinedFretboardsOn = {
413   \set FretBoards.predefinedDiagramTable = #fretboard-table
414 }
415
416 pointAndClickOff = #(define-music-function (parser location) ()
417                       (ly:set-option 'point-and-click #f)
418                       (make-music 'SequentialMusic 'void #t))
419
420 pointAndClickOn = #(define-music-function (parser location) ()
421                       (ly:set-option 'point-and-click #t)
422                       (make-music 'SequentialMusic 'void #t))
423
424 palmMuteOn = {
425   \override NoteHead #'style = #'do
426 }
427
428 palmMuteOff = {
429   \revert NoteHead #'style
430 }
431
432 palmMute =
433 #(define-music-function (parser location note) (ly:music?)
434   ;; are we inside a <...>?
435   (if (eq? (ly:music-property note 'name) 'NoteEvent)
436       ;; yes -> add a tweak
437       (begin (set! (ly:music-property note 'tweaks)
438                     (acons 'style 'do (ly:music-property note 'tweaks)))
439       note)
440       ;; no -> use predefined commands to switch to triangle-shaped note heads
441       #{
442         \palmMuteOn
443         $note
444         \palmMuteOff
445       #}))
446
447 deadNotesOn = {
448   \override TabNoteHead #'style = #'cross
449   \override NoteHead #'style = #'cross
450 }
451
452 deadNotesOff = {
453   \revert TabNoteHead #'style
454   \revert NoteHead #'style
455 }
456
457 deadNote =
458 #(define-music-function (parser location note) (ly:music?)
459   ;; are we inside a <...>?
460   (if (eq? (ly:music-property note 'name) 'NoteEvent)
461       ;; yes -> add a tweak
462       (begin (set! (ly:music-property note 'tweaks)
463                     (acons 'style 'cross (ly:music-property note 'tweaks)))
464        note)
465        ;; no -> use predefined commmands for changing
466        ;; note head and tablature fret signs
467        #{
468          \deadNotesOn
469          $note
470          \deadNotesOff
471        #}))
472
473 tabFullNotation = {
474   % time signature
475   \revert TabStaff.TimeSignature #'stencil
476   % stems (the half note gets a double stem)
477   \override TabVoice.Stem #'stencil = #tabvoice::draw-double-stem-for-half-notes
478   % beams, dots
479   \revert TabVoice.Beam #'stencil
480   \revert TabVoice.Dots #'stencil
481   \revert TabVoice.Tie #'stencil
482   \revert TabVoice.Tie #'after-line-breaking
483   \revert TabVoice.RepeatTie #'stencil
484   \revert TabVoice.RepeatTie #'after-line-braking
485   \revert TabVoice.LaissezVibrerTie #'stencil
486   \revert TabVoice.Slur #'stencil
487   \revert PhrasingSlur #'stencil
488   % tuplet stuff
489   \revert TabVoice.TupletBracket #'stencil
490   \revert TabVoice.TupletNumber #'stencil
491   % dynamic signs
492   \revert DynamicText #'transparent
493   \revert DynamicTextSpanner #'stencil
494   \revert TabVoice.DynamicTextSpanner #'stencil
495   \revert TabVoice.Hairpin #'transparent
496   % rests
497   \revert TabVoice.Rest #'stencil
498   \revert TabVoice.MultiMeasureRest #'stencil
499   % markups etc.
500   \revert TabVoice.Script #'stencil
501   \revert TabVoice.TextScript #'stencil
502   \revert TabStaff.Arpeggio #'stencil
503 }