]> git.donarmstrong.com Git - lilypond.git/blob - ly/engraver-init.ly
Fix minimum spacing between staves.
[lilypond.git] / ly / engraver-init.ly
1 %%%% This file is part of LilyPond, the GNU music typesetter.
2 %%%%
3 %%%% Copyright (C) 1996--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
4 %%%%                          Jan Nieuwenhuizen <janneke@gnu.org>
5 %%%%
6 %%%% LilyPond is free software: you can redistribute it and/or modify
7 %%%% it under the terms of the GNU General Public License as published by
8 %%%% the Free Software Foundation, either version 3 of the License, or
9 %%%% (at your option) any later version.
10 %%%%
11 %%%% LilyPond is distributed in the hope that it will be useful,
12 %%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
13 %%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 %%%% GNU General Public License for more details.
15 %%%%
16 %%%% You should have received a copy of the GNU General Public License
17 %%%% along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
18
19 \version "2.13.39"
20
21 \context {
22   \name "Global"
23
24   \accepts "Score"
25
26   \defaultchild "Score"
27   \description "Hard coded entry point for LilyPond.  Cannot be tuned."
28   \grobdescriptions #all-grob-descriptions
29 }
30
31 \context {
32   \type "Engraver_group"
33   \name "FretBoards"
34   \description "A context for displaying fret diagrams."
35
36   \consists "Fretboard_engraver"
37   \consists "Output_property_engraver"
38   \consists "Hara_kiri_engraver"
39   \consists "Separating_line_group_engraver"
40   \consists "Font_size_engraver"
41   \consists "Instrument_name_engraver"
42
43   predefinedDiagramTable = #default-fret-table
44 }
45
46 \context {
47   \type "Engraver_group"
48   \name "Staff"
49
50   \consists "Output_property_engraver"
51   \consists "Bar_engraver"
52   %% Bar_engraver must be first so default bars aren't overwritten
53   %% with empty ones.
54
55   \consists "Font_size_engraver"
56   \consists "Separating_line_group_engraver"
57   \consists "Dot_column_engraver"
58   \consists "Staff_collecting_engraver"
59
60  %% perhaps move to Voice context?
61   \consists "Ottava_spanner_engraver"
62   \consists "Clef_engraver"
63   \consists "Key_engraver"
64   \consists "Time_signature_engraver"
65   \consists "Ledger_line_engraver"
66   \consists "Staff_symbol_engraver"
67   \consists "Collision_engraver"
68   \consists "Grob_pq_engraver"
69   \consists "Rest_collision_engraver"
70   \consists "Accidental_engraver"
71   \consists "Piano_pedal_engraver"
72   \consists "Piano_pedal_align_engraver"
73   \consists "Instrument_name_engraver"
74   \consists "Axis_group_engraver"
75   \consists "Figured_bass_engraver"
76   \consists "Figured_bass_position_engraver"
77   \consists "Script_row_engraver"
78
79   localKeySignature = #'()
80   createSpacing = ##t
81   ignoreFiguredBassRest = ##f
82
83   %% explicitly set instrument, so we don't get
84   %% weird effects when doing instrument names for
85   %% piano staves
86
87   instrumentName = #'()
88   shortInstrumentName = #'()
89
90   \defaultchild "Voice"
91   \accepts "Voice"
92   \accepts "CueVoice"
93
94   \description "Handles clefs, bar lines, keys, accidentals.  It can contain
95 @code{Voice} contexts."
96
97 }
98
99 \context {
100   \Staff
101   \type "Engraver_group"
102   \name "DrumStaff"
103   \alias "Staff"
104
105   \remove "Accidental_engraver"
106   \remove "Ottava_spanner_engraver"
107   \remove "Key_engraver"
108   \remove "Piano_pedal_engraver"
109
110   \description "Handles typesetting for percussion."
111
112   \denies "Voice"
113   \accepts "DrumVoice"
114   \defaultchild "DrumVoice"
115
116   clefGlyph = #"clefs.percussion"
117   clefPosition = #0
118   \override Script #'staff-padding = #0.75
119 }
120
121
122 \context {
123   \type "Engraver_group"
124   \name "ChoirStaff"
125   \consists "Vertical_align_engraver"
126   topLevelAlignment = ##f
127
128   \consists "System_start_delimiter_engraver"
129   systemStartDelimiter = #'SystemStartBracket
130   vocalName = #'()
131   shortVocalName = #'()
132
133   \accepts "Staff"
134   \accepts "DrumStaff"
135   \accepts "RhythmicStaff"
136   \accepts "GrandStaff"
137   \accepts "PianoStaff"
138   \accepts "Lyrics"
139   \accepts "ChordNames"
140   \accepts "FiguredBass"
141   \accepts "ChoirStaff"
142   \accepts "StaffGroup"
143   \defaultchild "Staff"
144   \description "Identical to @code{StaffGroup} except that the
145 contained staves are not connected vertically."
146 }
147
148 \context{
149   \type "Engraver_group"
150
151   localKeySignature = #'()
152   createSpacing = ##t
153
154   squashedPosition = #0
155   \name RhythmicStaff
156   \alias "Staff"
157
158   \override BarLine #'bar-size = #4
159   \override VoltaBracket #'staff-padding = #3
160   \override StaffSymbol #'line-count = #1
161
162   \override Stem  #'neutral-direction = #UP
163   \override Beam  #'neutral-direction = #UP
164
165   \consists "Output_property_engraver"
166   \consists "Font_size_engraver"
167   \consists "Separating_line_group_engraver"
168   \consists "Dot_column_engraver"
169   \consists "Bar_engraver"
170   \consists "Staff_symbol_engraver"
171   \consists "Pitch_squash_engraver"
172   \consists "Time_signature_engraver"
173   \consists "Instrument_name_engraver"
174   \consists "Axis_group_engraver"
175   \consists "Ledger_line_engraver"
176
177   \accepts "Voice"
178   \accepts "CueVoice"
179   \defaultchild "Voice"
180
181   \description "A context like @code{Staff} but for printing rhythms.
182 Pitches are ignored; the notes are printed on one line."
183 }
184
185
186 \context {
187   \type "Engraver_group"
188   \name "Voice"
189
190   \description "Corresponds to a voice on a staff.  This context
191 handles the conversion of dynamic signs, stems, beams, super- and
192 subscripts, slurs, ties, and rests.
193
194 You have to instantiate this explicitly if you want to have
195 multiple voices on the same staff."
196
197   localKeySignature = #'()
198   \consists "Font_size_engraver"
199
200   \consists "Pitched_trill_engraver"
201   \consists "Output_property_engraver"
202   \consists "Arpeggio_engraver"
203   \consists "Multi_measure_rest_engraver"
204   \consists "Text_spanner_engraver"
205   \consists "Trill_spanner_engraver"
206   \consists "Grob_pq_engraver"
207   \consists "Forbid_line_break_engraver"
208   \consists "Laissez_vibrer_engraver"
209   \consists "Repeat_tie_engraver"
210   \consists "Note_head_line_engraver"
211   \consists "Glissando_engraver"
212   \consists "Ligature_bracket_engraver"
213   \consists "Breathing_sign_engraver"
214   \consists "Note_heads_engraver"
215   \consists "Dots_engraver"
216   \consists "Rest_engraver"
217   \consists "Tweak_engraver"
218
219   %% switch on to make stem directions interpolate for the
220   %% center line.
221   %  \consists "Melody_engraver"
222
223   \consists "Stem_engraver"
224   \consists "Beam_engraver"
225   \consists "Grace_beam_engraver"
226   \consists "Auto_beam_engraver"
227
228   %% must come before Script_column_engraver.
229   \consists "New_fingering_engraver"
230
231   \consists "Chord_tremolo_engraver"
232   \consists "Percent_repeat_engraver"
233   \consists "Slash_repeat_engraver"
234   \consists "Part_combine_engraver"
235
236   \consists "Text_engraver"
237   \consists "New_dynamic_engraver"
238   \consists "Dynamic_align_engraver"
239 %  \consists "Dynamic_engraver"
240   \consists "Fingering_engraver"
241   \consists "Bend_engraver"
242
243   \consists "Script_engraver"
244   \consists "Script_column_engraver"
245   \consists "Rhythmic_column_engraver"
246   \consists "Note_spacing_engraver"
247   \consists "Spanner_break_forbid_engraver"
248   \consists "Phrasing_slur_engraver"
249   \consists "Cluster_spanner_engraver"
250   \consists "Slur_engraver"
251   \consists "Tie_engraver"
252   \consists "Tuplet_engraver"
253   \consists "Grace_engraver"
254   \consists "Instrument_switch_engraver"
255 }
256
257 \context{
258   \Voice
259
260   \name CueVoice
261   \alias Voice
262   fontSize = #-4
263   \override Stem #'length-fraction = #(magstep -4)
264   \override Beam #'length-fraction = #(magstep -4)
265   \override Beam #'beam-thickness = #0.35
266 }
267
268 \context {
269   \Voice
270   \name DrumVoice
271   \alias Voice
272
273   \description "A voice on a percussion staff."
274   \remove "Arpeggio_engraver"
275   \consists "Grob_pq_engraver"
276
277   \remove "Note_head_line_engraver"
278   \remove "Glissando_engraver"
279   \remove "Ligature_bracket_engraver"
280   \remove "Note_heads_engraver"
281   \consists "Drum_notes_engraver"
282   \remove "New_fingering_engraver"
283
284   \remove "Fingering_engraver"
285
286   \remove "Cluster_spanner_engraver"
287 }
288
289 \context{
290   \type "Engraver_group"
291   \name GrandStaff
292   localKeySignature = #'()
293
294   \description "A group of staves, with a brace on the left
295 side, grouping the staves together.  The bar lines of the
296 contained staves are connected vertically."
297
298   \consists "Span_bar_engraver"
299   \consists "Span_arpeggio_engraver"
300   \consists "System_start_delimiter_engraver"
301   systemStartDelimiter = #'SystemStartBrace
302   topLevelAlignment = ##f
303
304   \defaultchild "Staff"
305   \accepts "Staff"
306   \accepts "FiguredBass"
307   \accepts "Dynamics"
308 }
309
310 \context{
311   \GrandStaff
312   \name "PianoStaff"
313   \alias "GrandStaff"
314
315   \description "Just like @code{GrandStaff} but with support for
316 instrument names at the start of each system."
317
318   \consists "Instrument_name_engraver"
319   \consists "Vertical_align_engraver"
320   \consists "Keep_alive_together_engraver"
321   topLevelAlignment = ##f
322
323   instrumentName = #'()
324   shortInstrumentName = #'()
325 }
326
327 \context {
328   \type "Engraver_group"
329   \name "StaffGroup"
330
331   \consists "Vertical_align_engraver"
332   topLevelAlignment = ##f
333
334   \consists "Span_bar_engraver"
335   \consists "Span_arpeggio_engraver"
336   \consists "Output_property_engraver"
337   systemStartDelimiter = #'SystemStartBracket
338
339   \consists "System_start_delimiter_engraver"
340
341   \defaultchild "Staff"
342   \accepts "Staff"
343   \accepts "RhythmicStaff"
344   \accepts "DrumStaff"
345   \accepts "GrandStaff"
346   \accepts "PianoStaff"
347   \accepts "TabStaff"
348   \accepts "Lyrics"
349   \accepts "ChordNames"
350   \accepts "FiguredBass"
351   \accepts "ChoirStaff"
352   \accepts "StaffGroup"
353
354   \description "Groups staves while adding a bracket on the left
355 side, grouping the staves together.  The bar lines of the contained
356 staves are connected vertically.  @code{StaffGroup} only consists of
357 a collection of staves, with a bracket in front and spanning bar lines."
358 }
359
360 \context {
361   \type "Engraver_group"
362   \name Dynamics
363   \alias Voice
364   \consists "Output_property_engraver"
365   \consists "Bar_engraver"
366   \consists "Piano_pedal_engraver"
367   \consists "Script_engraver"
368   \consists "New_dynamic_engraver"
369   \consists "Dynamic_align_engraver"
370   \consists "Text_engraver"
371   \consists "Text_spanner_engraver"
372   \consists "Axis_group_engraver"
373
374   pedalSustainStrings = #'("Ped." "*Ped." "*")
375   pedalUnaCordaStrings = #'("una corda" "" "tre corde")
376   \override VerticalAxisGroup #'staff-affinity = #CENTER
377   \override VerticalAxisGroup #'nonstaff-relatedstaff-spacing =
378     #'((space . 5)
379        (padding . 0.5))
380   \override TextScript #'font-shape = #'italic
381   \override DynamicLineSpanner #'Y-offset = #0
382
383   \description "Holds a single line of dynamics, which will be
384 centered between the staves surrounding this context."
385 }
386
387
388 \context{
389   \type "Engraver_group"
390
391   \description "Corresponds to a voice with lyrics.  Handles the
392 printing of a single line of lyrics."
393
394   \name "Lyrics"
395   instrumentName = #'()
396   shortInstrumentName = #'()
397
398   \consists "Lyric_engraver"
399   \consists "Extender_engraver"
400   \consists "Hyphen_engraver"
401   \consists "Stanza_number_engraver"
402   \consists "Instrument_name_engraver"
403   \consists "Font_size_engraver"
404   \consists "Hara_kiri_engraver"
405
406   \override VerticalAxisGroup #'remove-first = ##t
407   \override VerticalAxisGroup #'remove-empty = ##t
408   \override VerticalAxisGroup #'staff-affinity = #UP
409   \override VerticalAxisGroup #'nonstaff-relatedstaff-spacing =
410     #'((space . 5.5)
411        (stretchability . 1)
412        (padding . 0.5))
413   \override VerticalAxisGroup #'nonstaff-nonstaff-spacing =
414      #'((space . 0)
415         (stretchability . 0)
416         (padding . 0.2)
417         (minimum-distance . 2.8))
418   \override VerticalAxisGroup #'nonstaff-unrelatedstaff-spacing #'padding = #1.5
419   \override InstrumentName #'self-alignment-Y = ##f
420
421   %% sync with define-grobs.scm ;
422   \override InstrumentName #'font-size = #1.0
423
424   %% make sure that barlines aren't collapsed, when
425   %% Bar_engraver is there.
426   \override BarLine #'bar-size = #0.1
427
428 }
429
430 \context {
431   \type "Engraver_group"
432   \name NoteNames
433   \description "A context for printing the names of notes."
434   \consists "Axis_group_engraver"
435
436   % FIXME: not sure what the default should be here.
437   \override VerticalAxisGroup #'staff-affinity = #DOWN
438
439   \consists "Tie_engraver"
440   \consists "Note_name_engraver"
441   \consists "Separating_line_group_engraver"
442 }
443
444 \context {
445   \type "Engraver_group"
446   \name ChordNames
447   \description "Typesets chord names."
448
449   \consists "Output_property_engraver"
450   \consists "Separating_line_group_engraver"
451   \consists "Chord_name_engraver"
452   \consists "Hara_kiri_engraver"
453 %  \consists "Note_spacing_engraver"
454   \override VerticalAxisGroup #'remove-first = ##t
455   \override VerticalAxisGroup #'remove-empty = ##t
456   \override VerticalAxisGroup #'staff-affinity = #DOWN
457   \override VerticalAxisGroup #'nonstaff-relatedstaff-spacing #'padding = #0.5
458   \override VerticalAxisGroup #'nonstaff-nonstaff-spacing #'padding = #0.5
459 }
460
461
462 RemoveEmptyStaves = \with {
463   \remove "Axis_group_engraver"
464   \remove "Hara_kiri_engraver"
465   \consists "Hara_kiri_engraver"
466   \override Beam #'auto-knee-gap = #'()
467   \override VerticalAxisGroup #'remove-empty = ##t
468 }
469
470
471 \context {
472   \type "Score_engraver"
473   \name "Score"
474
475   \description "This is the top level notation context.  No
476 other context can contain a @code{Score} context.  This context
477 handles the administration of time signatures.  It also makes sure
478 that items such as clefs, time signatures, and key-signatures are
479 aligned across staves.
480
481 You cannot explicitly instantiate a @code{Score} context (since it
482 is not contained in any other context).  It is instantiated
483 automatically when an output definition (a @code{\score} or
484 @code{\layout} block) is processed."
485
486   \consists "Paper_column_engraver"
487   \consists "Repeat_acknowledge_engraver"
488   \consists "Staff_collecting_engraver"
489
490   %% move the alias along with the engraver.
491
492   \consists "Timing_translator"
493   \consists "Default_bar_line_engraver"
494   \consists "Output_property_engraver"
495   \consists "System_start_delimiter_engraver"
496   \consists "Mark_engraver"
497   \consists "Volta_engraver"
498   \consists "Metronome_mark_engraver"
499   \consists "Break_align_engraver"
500   \consists "Spacing_engraver"
501   \consists "Grace_spacing_engraver"
502   \consists "Vertical_align_engraver"
503   \consists "Stanza_number_align_engraver"
504   \consists "Bar_number_engraver"
505   \consists "Parenthesis_engraver"
506
507   \defaultchild "Staff"
508
509   \accepts "FretBoards"
510   \accepts "Staff"
511   \accepts "RhythmicStaff"
512   \accepts "TabStaff"
513   \accepts "VaticanaStaff"
514   \accepts "GregorianTranscriptionStaff"
515   \accepts "MensuralStaff"
516   \accepts "StaffGroup"
517   \accepts "DrumStaff"
518   \accepts "Lyrics"
519   \accepts "ChordNames"
520   \accepts "GrandStaff"
521   \accepts "ChoirStaff"
522   \accepts "PianoStaff"
523   \accepts "Devnull"
524   \accepts "NoteNames"
525   \accepts "FiguredBass"
526
527
528   noteToFretFunction = #determine-frets
529   predefinedDiagramTable = ##f
530   soloText = #"Solo"
531   soloIIText = #"Solo II"
532   aDueText = #"a2"
533   printPartCombineTexts = ##t
534   systemStartDelimiter =#'SystemStartBar
535
536   drumStyleTable = #drums-style
537
538   melismaBusyProperties = #default-melisma-properties
539   tieWaitForNote = ##f
540   clefGlyph = #"clefs.G"
541   clefPosition = #-2
542   middleCClefPosition = #-6
543   middleCPosition = #-6
544   firstClef = ##t
545
546   crescendoSpanner = #'hairpin
547   decrescendoSpanner = #'hairpin
548
549   defaultBarType = #"|"
550   doubleRepeatType = #":|:"
551   barNumberVisibility = #first-bar-number-invisible
552   automaticBars = ##t
553
554   explicitClefVisibility = #all-visible
555   explicitKeySignatureVisibility = #all-visible
556   implicitTimeSignatureVisibility = #end-of-line-invisible
557
558   repeatCountVisibility = #all-repeat-counts-visible
559
560   timeSignatureSettings = #default-time-signature-settings
561   timeSignatureFraction = #'(4 . 4)
562
563 %% These defaults should be the same as the rules established in
564 %%   scm/time-signature-settings.scm for 4/4 time
565   measureLength = #(ly:make-moment 4 4)
566   baseMoment = #(ly:make-moment 1  4)
567   beatStructure = #'(1 1 1 1)
568   beamExceptions = #'((end . (((1 . 8) . (4 4))
569                               ((1 . 12) . (3 3 3 3)))))
570   autoBeaming = ##t
571   autoBeamCheck = #default-auto-beam-check
572
573   scriptDefinitions = #default-script-alist
574
575   pedalSustainStrings = #'("Ped." "*Ped." "*")
576   pedalSustainStyle = #'text
577   pedalUnaCordaStrings = #'("una corda" "" "tre corde")
578   pedalUnaCordaStyle = #'text
579
580 %% These are in ordinary italic font, including the *,
581 %% but they are unlikely to be used,
582 %% as the default pedal-style for SostenutoPedal is 'mixed':
583 %% i.e.  Sost. Ped_____________________
584   pedalSostenutoStrings = #'("Sost. Ped." "*Sost. Ped." "*")
585   pedalSostenutoStyle = #'mixed
586
587   harmonicAccidentals = ##t
588   fingeringOrientations = #'(up down)
589   stringNumberOrientations = #'(up down)
590   strokeFingerOrientations = #'(right)
591
592   lyricMelismaAlignment = #LEFT
593   markFormatter = #format-mark-letters
594   rehearsalMark = #1
595   subdivideBeams = ##f
596   extraNatural = ##t
597   autoAccidentals = #`(Staff ,(make-accidental-rule 'same-octave 0))
598   autoCautionaries = #'()
599
600   printKeyCancellation = ##t
601   keyAlterationOrder = #`(
602     (6 . ,FLAT) (2  . ,FLAT) (5 . ,FLAT ) (1  . ,FLAT) (4  . ,FLAT) (0  . ,FLAT) (3  . ,FLAT)
603     (3 . ,SHARP) (0 . ,SHARP) (4 . ,SHARP) (1 . ,SHARP) (5 . ,SHARP) (2 . ,SHARP) (6 . ,SHARP)
604     (6 . ,DOUBLE-FLAT) (2 . ,DOUBLE-FLAT) (5 . ,DOUBLE-FLAT ) (1 . ,DOUBLE-FLAT) (4 . ,DOUBLE-FLAT) (0 . ,DOUBLE-FLAT) (3 . ,DOUBLE-FLAT)
605     (3  . ,DOUBLE-SHARP) (0 . ,DOUBLE-SHARP) (4 . ,DOUBLE-SHARP) (1 . ,DOUBLE-SHARP) (5 . ,DOUBLE-SHARP) (2 . ,DOUBLE-SHARP) (6 . ,DOUBLE-SHARP)
606   )
607
608   barCheckSynchronize = ##f
609
610 %% chord names:
611   chordNameFunction = #ignatzek-chord-names
612   majorSevenSymbol = #whiteTriangleMarkup
613   chordNameLowercaseMinor = ##f
614   chordNameSeparator = #(make-simple-markup  "/")
615   chordNameExceptions = #ignatzekExceptions
616   chordNoteNamer = #'()
617   chordRootNamer = #note-name->markup
618   chordPrefixSpacer = #0
619   chordNameExceptionsFull = #fullJazzExceptions
620   chordNameExceptionsPartial = #partialJazzExceptions
621   noChordSymbol = #(make-simple-markup "N.C.")
622
623   bassStaffProperties = #'((assign clefGlyph "clefs.F")
624   (assign clefPosition 2)
625   (assign middleCPosition 6)
626   (assign middleCClefPosition 6))
627 %% tablature:
628   stringOneTopmost = ##t
629   highStringOne = ##t
630
631 %% One may change the string tunings as follows :
632 %% The length of the list must be equal to the number of strings
633   stringTunings = #guitar-tuning
634   tablatureFormat = #fret-number-tablature-format
635   tabStaffLineLayoutFunction = #tablature-position-on-lines
636
637 %%
638   figuredBassFormatter = #format-bass-figure
639   metronomeMarkFormatter = #format-metronome-markup
640
641
642   %% See also make-voice-props-set
643   graceSettings = #`(
644     (Voice Stem direction ,UP)
645     (Voice Stem font-size -3)
646     (Voice NoteHead font-size -3)
647     (Voice TabNoteHead font-size -4)
648     (Voice Dots font-size -3)
649     (Voice Stem length-fraction 0.8)
650     (Voice Stem no-stem-extend #t)
651     (Voice Beam beam-thickness 0.384)
652     (Voice Beam length-fraction 0.8)
653     (Voice Accidental font-size -4)
654     (Voice AccidentalCautionary font-size -4)
655     (Voice Slur direction ,DOWN)
656     (Voice Script font-size -3)
657     (Voice Fingering font-size -8)
658     (Voice StringNumber font-size -8)
659   )
660
661   keepAliveInterfaces = #'(
662     bass-figure-interface
663     chord-name-interface
664     cluster-beacon-interface
665     fret-diagram-interface
666     lyric-syllable-interface
667     note-head-interface
668     tab-note-head-interface
669     lyric-interface
670     percent-repeat-item-interface
671     percent-repeat-interface
672
673     ;; need this, as stanza numbers are items, and appear only once.
674     stanza-number-interface
675   )
676   % \quoteDuring is supposed to quote everything, cueDuring only the essentials
677   quotedEventTypes = #'(StreamEvent)
678   quotedCueEventTypes = #'(
679     note-event
680     rest-event
681     tie-event
682     beam-event
683     tuplet-span-event)
684   instrumentTransposition = #(ly:make-pitch 0 0 0)
685
686   topLevelAlignment = ##t
687
688   timing = ##t
689 }
690
691
692
693
694 \context {
695   \type "Engraver_group"
696   \name "FiguredBass"
697   \description "A context for printing a figured bass line."
698
699   \consists "Figured_bass_engraver"
700   \consists "Separating_line_group_engraver"
701   \consists "Hara_kiri_engraver"
702
703   \override VerticalAxisGroup #'remove-empty = ##t
704   \override VerticalAxisGroup #'remove-first = ##t
705   \override VerticalAxisGroup #'staff-affinity = #UP
706   \override VerticalAxisGroup #'nonstaff-relatedstaff-spacing #'padding = #0.5
707   \override VerticalAxisGroup #'nonstaff-nonstaff-spacing #'padding = #0.5
708 }
709
710 \context {
711   \name "Devnull"
712   \type "Engraver_group"
713
714 %% don't want to route anything out of here:
715   \alias "Staff"
716   \alias "Voice"
717   \description "Silently discards all musical information given to this
718 context."
719 }
720
721 \context {
722   \Voice
723   \name "TabVoice"
724   \alias "Voice"
725   \consists "Tab_note_heads_engraver"
726   \consists "Tab_harmonic_engraver"
727
728   \remove "Note_heads_engraver"
729   \remove "Fingering_engraver"
730   \remove "New_fingering_engraver"
731
732   \description "Context for drawing notes in a Tab staff."
733
734   %% TabStaff increase the staff-space, which in turn
735   %% increases beam thickness and spacing; beams are
736   %% too big. We have to adjust the beam settings:
737   \override Beam #'beam-thickness = #0.32
738   \override Beam #'length-fraction = #0.62
739   %% the same goes for tremolo beams
740   \override StemTremolo #'beam-thickness = #0.32
741   %% NOTE: in lily/stem-tremolo.cc, we have length-fraction = 1,
742   %% and the tablature staff space is scaled (1.5 by default),
743   %% so we use the inversion of the scale factor:
744   \override StemTremolo #'length-fraction = #(lambda (grob)
745                                                (/ 1 (ly:staff-symbol-staff-space grob)))
746   \override StemTremolo #'beam-width = #stem-tremolo::calc-tab-width
747
748   %% No accidental in tablature !
749   \remove "Accidental_engraver"
750   %% make the Stems as short as possible to minimize their influence
751   %% on the slur::calc-control-points routine
752   \override Stem #'length = #0
753   \override Stem #'no-stem-extend = ##t
754   \override Stem #'flag-style = #'no-flag
755   \override Stem #'details = #'((lengths 0 0 0 0 0 0)
756                                 (beamed-lengths 0 0 0)
757                                 (beamed-minimum-free-lengths 0 0 0)
758                                 (beamed-extreme-minimum-free-lengths 0 0)
759                                 (stem-shorten 0 0))
760   %% after all, the stubs of the stems may still be visible, so ...
761   \override Stem #'transparent = ##t
762   %% automatic beams should be suppressed for similar reasons ...
763   autoBeaming = ##f
764   %% remove beams, dots and rests ...
765   \override Beam #'stencil = ##f
766   \override StemTremolo #'stencil = ##f
767   \override Dots #'stencil = ##f
768   \override Rest #'stencil = ##f
769   \override MultiMeasureRest #'stencil = ##f
770   \override MultiMeasureRestNumber #'transparent = ##t
771   \override MultiMeasureRestText #'transparent = ##t
772   %% ... all kinds of ties/slurs
773   \override Tie  #'stencil = ##f
774   \override RepeatTie #'stencil = ##f
775   \override LaissezVibrerTie #'stencil = ##f
776   \override Slur #'stencil = #slur::draw-tab-slur
777   \override PhrasingSlur #'stencil = ##f
778   %% 'tied to' fret numbers become invisible or parenthesized, respectively)
779   \override Tie #'after-line-breaking = #tie::handle-tab-note-head
780   \override RepeatTie #'after-line-breaking = #repeat-tie::handle-tab-note-head
781   %% ... and all kinds of markups, spanners etc.
782   \override TupletBracket #'stencil = ##f
783   \override TupletNumber #'stencil = ##f
784   \override DynamicText #'transparent = ##t
785   \override DynamicTextSpanner #'stencil = ##f
786   \override TextSpanner #'stencil = ##f
787   \override Hairpin #'transparent = ##t
788   \override Script #'stencil = ##f
789   \override TextScript #'stencil = ##f
790   %% the direction for glissando lines will be automatically corrected
791   \override Glissando #'extra-dy = #glissando::calc-tab-extra-dy
792   \override Glissando #'bound-details #'right = #`((attach-dir . ,LEFT)
793                                                    (padding . 0.3))
794   \override Glissando #'bound-details #'left = #`((attach-dir . ,RIGHT)
795                                                    (padding . 0.3))
796   %% dead notes
797   \override TabNoteHead #'glyph-name = #tab-note-head::calc-glyph-name
798   \override TabNoteHead #'stencil = #tab-note-head::whiteout-if-style-set
799 }
800
801 \context {
802   \Staff
803   \alias "Staff"
804   \name "TabStaff"
805   \denies "Voice"
806   \consists "Tab_staff_symbol_engraver"
807
808   \description "Context for generating tablature. It accepts only @code{TabVoice}
809 contexts and handles the line spacing, the tablature clef etc. properly."
810
811   \accepts "TabVoice"
812   \defaultchild "TabVoice"
813
814   %% 6 strings, bigger spacing
815   \override StaffSymbol #'staff-space = #1.5
816
817   %% Don't draw stems over the tablature figures !
818   \override Stem #'avoid-note-head = ##t
819
820   %% No accidental in tablature !
821   \remove "Accidental_engraver"
822   \remove "Key_engraver"
823
824   \remove "Ottava_spanner_engraver"
825   %% the clef handler
826   \override Clef #'stencil = #clef::print-modern-tab-if-set
827   %% no time signature
828   \override TimeSignature #'stencil = ##f
829   %% better parentheses in a TabStaff
830   \override ParenthesesItem #'stencils = #parentheses-item::calc-tabstaff-parenthesis-stencils
831   %% no arpeggios
832   \override Arpeggio #'stencil = ##f
833   %% we ignore collision warnings that may occur due to
834   %% stem overlapping, because we have no stems ;-)
835   \override NoteColumn #'ignore-collision = ##t
836   %% Special "TAB" clef
837   clefGlyph = #"clefs.tab"
838   clefPosition = #0
839 }
840
841 \context {
842   \Voice
843   \name "VaticanaVoice"
844   \alias "Voice"
845   \description "Same as @code{Voice} context, except that it is
846 accommodated for typesetting Gregorian Chant in the notational style
847 of Editio Vaticana."
848
849   \remove "Slur_engraver"
850   \remove "Stem_engraver"
851   \remove "Ligature_bracket_engraver"
852   \consists "Vaticana_ligature_engraver"
853   \remove "Text_spanner_engraver"
854   \consists "Episema_engraver"
855
856   %% Set default head for notes outside of \[ \].
857   \override NoteHead #'style = #'vaticana.punctum
858
859   %% Put some space before and after divisiones.
860   %% FIXME: This does not seem to show any effect.
861   \override Script #'padding = #0.5
862
863   %% There are no beams in Gregorian Chant notation.
864   autoBeaming = ##f
865 }
866
867 \context {
868   \Staff
869   \name "VaticanaStaff"
870   \alias "Staff"
871   \denies "Voice"
872   \accepts "VaticanaVoice"
873   \defaultchild "VaticanaVoice"
874
875   \description "Same as @code{Staff} context, except that it is
876 accommodated for typesetting Gregorian Chant in the notational style
877 of Editio Vaticana."
878
879   \remove "Time_signature_engraver"
880   \consists "Custos_engraver"
881
882   %% We can not remove Bar_engraver; otherwise clefs and custodes will
883   %% not show up any more among other line breaking issues.
884   %% Instead, we make the grob transparent.
885   \override BarLine #'transparent = ##t
886
887   \override StaffSymbol #'line-count = #4
888   \override StaffSymbol #'thickness = #0.6
889
890   %% FIXME: unit on StaffSymbol's width should be \linewidth.
891   %% \override StaffSymbol #'width = #60.0
892
893   %% Choose vaticana do clef on 3rd line as default.
894   clefGlyph = #"clefs.vaticana.do"
895   middleCPosition = #1
896   middleCClefPosition = #1
897   clefPosition = #1
898   clefOctavation = #0
899
900   %% Select vaticana style font.
901   \override KeySignature #'glyph-name-alist = #alteration-vaticana-glyph-name-alist
902   \override Accidental #'glyph-name-alist = #alteration-vaticana-glyph-name-alist
903   \override Custos #'style = #'vaticana
904   \override Custos #'neutral-position = #3
905   \override Custos #'neutral-direction = #DOWN
906   \override Dots #'style = #'vaticana
907 }
908
909 \context {
910   \Voice
911   \name "GregorianTranscriptionVoice"
912   \alias "Voice"
913   \consists "Episema_engraver"
914
915   %% Removing ligature bracket engraver without replacing it by some
916   %% other ligature engraver would cause a "Junking event: `LigatureEvent'"
917   %% warning for every "\[" and "\]".  Therefore, we make the grob
918   %% transparent instead.
919   \override LigatureBracket #'transparent = ##t
920
921   %% Put some space before and after divisiones.
922   %% FIXME: This does not seem to show any effect.
923   \override Script #'padding = #0.5
924
925   %% There are no beams in Gregorian Chant notation.
926   autoBeaming = ##f
927
928 }
929
930 \context {
931   \Staff
932   \name "GregorianTranscriptionStaff"
933   \alias "Staff"
934   \denies "Voice"
935   \accepts "GregorianTranscriptionVoice"
936   \defaultchild "GregorianTranscriptionVoice"
937
938   %% We can not remove Bar_engraver; otherwise clefs and custodes will
939   %% not show up any more among other line breaking issues.
940   %% Instead, we make the grob transparent.
941   \override BarLine #'transparent = ##t
942 }
943
944 \context {
945   \Voice
946   \name "MensuralVoice"
947   \alias "Voice"
948   \description "Same as @code{Voice} context, except that it is
949 accommodated for typesetting a piece in mensural style."
950
951   \remove "Slur_engraver"
952   \remove "Ligature_bracket_engraver"
953   \consists "Mensural_ligature_engraver"
954
955   %% Set default head for notes outside of \[ \].
956   \override NoteHead #'style = #'mensural
957   \override Rest #'style = #'mensural
958
959   %% There are no beams in mensural notation.
960   autoBeaming = ##f
961 }
962
963 \context {
964   \Staff
965   \name "MensuralStaff"
966   \alias "Staff"
967   \denies "Voice"
968   \defaultchild "MensuralVoice"
969   \accepts "MensuralVoice"
970   \description "Same as @code{Staff} context, except that it is
971 accommodated for typesetting a piece in mensural style."
972
973   \consists "Custos_engraver"
974
975   %% We can not remove Bar_engraver; otherwise clefs and custodes will
976   %% not show up any more among other line breaking issues.
977   %% Instead, we make the grob transparent.
978   \override BarLine #'transparent = ##t
979
980   \override StaffSymbol #'thickness = #0.6
981
982   %% FIXME: unit on StaffSymbol's width should be \linewidth.
983   %% \override StaffSymbol #'width = #60.0
984
985   %% Choose mensural g clef on 2nd line as default.
986   clefGlyph = #"clefs.mensural.g"
987   middleCClefPosition = #-6
988   middleCPosition = #-6
989   clefPosition = #-2
990   clefOctavation = #0
991
992   %% Select mensural style font.
993   \override TimeSignature #'style = #'mensural
994   \override KeySignature #'glyph-name-alist = #alteration-mensural-glyph-name-alist
995   \override Accidental #'glyph-name-alist = #alteration-mensural-glyph-name-alist
996   \override Custos #'style = #'mensural
997   \override Custos #'neutral-position = #3
998   \override Custos #'neutral-direction = #DOWN
999
1000   %% Accidentals are valid only once (same as
1001   %% #(set-accidental-style 'forget))
1002   extraNatural = ##f
1003   autoAccidentals = #`(Staff ,(make-accidental-rule 'same-octave -1))
1004   autoCautionaries = #'()
1005   printKeyCancellation = ##f
1006 }
1007
1008
1009 %% Keep the old definitions in here for compatibility (they erase previous
1010 %% settings to the corresponding context!).
1011 %% For new scores, one should simply insert the \RemoveEmptyStaves settings
1012 %% into the desired context. That's just as easy, requires only one line more
1013 %% (the \*Staff), but preserves previous context mods.
1014 %% TODO: DEPRECATED_2.13.17, remove at some point in the future
1015 RemoveEmptyStaffContext = \context {
1016   \Staff
1017   \RemoveEmptyStaves
1018 }
1019
1020 AncientRemoveEmptyStaffContext = \context {
1021   \VaticanaStaff
1022   \RemoveEmptyStaves
1023 }
1024
1025 RemoveEmptyDrumStaffContext = \context {
1026   \DrumStaff
1027   \RemoveEmptyStaves
1028 }
1029
1030 RemoveEmptyRhythmicStaffContext = \context {
1031   \RhythmicStaff
1032   \RemoveEmptyStaves
1033 }
1034
1035 RemoveEmptyTabStaffContext = \context {
1036   \TabStaff
1037   \RemoveEmptyStaves
1038 }
1039