]> git.donarmstrong.com Git - lilypond.git/blob - ly/property-init.ly
51fbb8bc449f268dc3720453d1f1d47d11a709a3
[lilypond.git] / ly / property-init.ly
1 % property-init.ly
2
3 \version "2.1.21"
4
5 stemUp = \property Voice.Stem \set #'direction = #1
6 stemDown = \property Voice.Stem \set #'direction = #-1 
7 stemBoth= \property Voice.Stem \revert #'direction
8
9 slurUp   = \property Voice.Slur \set #'direction = #1
10 slurDown = \property Voice.Slur \set #'direction = #-1
11 slurBoth = \property Voice.Slur \revert #'direction 
12
13 % There's also dash, but setting dash period/length should be fixed.
14 slurDotted = \property Voice.Slur \set #'dashed = #1
15 slurSolid = \property Voice.Slur \revert #'dashed
16
17
18 phrasingSlurUp   = \property Voice.PhrasingSlur \set #'direction = #1
19 phrasingSlurDown = \property Voice.PhrasingSlur \set #'direction = #-1
20 phrasingSlurBoth = \property Voice.PhrasingSlur \revert #'direction 
21
22 shiftOn  = \property Voice.NoteColumn \set #'horizontal-shift = #1
23 shiftOnn  = \property Voice.NoteColumn \set #'horizontal-shift = #2
24 shiftOnnn  = \property Voice.NoteColumn \set #'horizontal-shift = #3
25 shiftOff  = \property Voice.NoteColumn \revert #'horizontal-shift 
26
27 tieUp = \property Voice.Tie \set #'direction = #1
28 tieDown = \property Voice.Tie \set #'direction = #-1
29 tieBoth = \property Voice.Tie \revert #'direction 
30
31 tieDotted = \property Voice.Tie \set #'dashed = #1
32 tieSolid = \property Voice.Tie \revert #'dashed
33
34
35 dynamicUp  = {
36   \property Voice.DynamicText \set #'direction = #1
37   \property Voice.DynamicLineSpanner \set #'direction = #1
38 }
39 dynamicDown = {
40   \property Voice.DynamicText \set #'direction = #-1
41   \property Voice.DynamicLineSpanner \set #'direction = #-1
42 }
43 dynamicBoth = {
44   \property Voice.DynamicText \revert #'direction
45   \property Voice.DynamicLineSpanner \revert #'direction
46 }
47
48 scriptUp  = {
49   \property Voice.TextScript \set #'direction = #1
50   \property Voice.Script \set #'direction = #1
51 }
52 scriptDown = {
53   \property Voice.TextScript \set #'direction = #-1
54   \property Voice.Script \set #'direction = #-1
55 }
56 scriptBoth = {
57   \property Voice.TextScript \revert #'direction
58   \property Voice.Script \revert #'direction
59 }
60
61 dotsUp = \property Voice.Dots \set #'direction = #1
62 dotsDown = \property Voice.Dots \set #'direction = #-1
63 dotsBoth = \property Voice.Dots \revert #'direction 
64
65 tupletUp  =   \property Voice.TupletBracket \set #'direction = #1
66 tupletDown =   \property Voice.TupletBracket \set #'direction = #-1
67 tupletBoth =   \property Voice.TupletBracket \revert #'direction
68
69 cadenzaOn = \property Timing.timing = ##f
70 cadenzaOff = {
71   \property Timing.timing = ##t
72   \property Timing.measurePosition = #(ly:make-moment 0 1)
73 }
74
75 newpage = \notes
76 {
77   \break
78   % urg, only works for TeX output
79   \context Score \applyoutput
80   #(outputproperty-compatibility (make-type-checker 'paper-column-interface)
81     'between-system-string "\\newpage")
82 }
83
84 % dynamic ly:dir?  text script, articulation script ly:dir?     
85 oneVoice = #(context-spec-music (make-voice-props-revert) 'Voice)
86 voiceOne = #(context-spec-music (make-voice-props-set 0) 'Voice)
87 voiceTwo = #(context-spec-music (make-voice-props-set 1) 'Voice)
88 voiceThree =#(context-spec-music (make-voice-props-set 2) 'Voice)
89 voiceFour = #(context-spec-music (make-voice-props-set 3) 'Voice)
90
91         
92 tiny  = 
93         \property Voice.fontSize= #-2
94
95 small  = 
96         \property Voice.fontSize= #-1
97
98 normalsize = {
99         \property Voice.fontSize= #0
100 }
101
102
103 % End the incipit and print a ``normal line start''.
104 endincipit = \notes \context Staff {
105     \partial 16 s16  % Hack to handle e.g. \bar ".|" \endincipit
106     \once \property Staff.Clef \set #'full-size-change = ##t
107     \once \property Staff.Clef \set #'non-default = ##t
108     \bar ""
109 }
110
111 autoBeamOff = \property Voice.autoBeaming = ##f
112 autoBeamOn = \property Voice.autoBeaming = ##t
113
114 fatText = \property Voice.TextScript \set #'no-spacing-rods = ##f
115 emptyText = \property Voice.TextScript \set #'no-spacing-rods  = ##t
116
117 showStaffSwitch = \property Voice.followVoice = ##t
118 hideStaffSwitch = \property Voice.followVoice = ##f
119
120 % accidentals as they were common in the 18th century.
121 defaultAccidentals = {
122   \property Current.extraNatural = ##t
123   \property Current.autoAccidentals = #'(Staff (same-octave . 0))
124   \property Current.autoCautionaries = #'()
125 }
126
127 % accidentals in voices instead of staves.
128 % Notice that accidentals from one voice do NOT get cancelled in other voices
129 voiceAccidentals = {
130   \property Current.extraNatural = ##t
131   \property Current.autoAccidentals = #'(Voice (same-octave . 0))
132   \property Current.autoCautionaries = #'()
133   
134 }
135
136 % accidentals as suggested by Kurt Stone, Music Notation in the 20th century.
137 % This includes all the default accidentals, but accidentals also needs cancelling
138 % in other octaves and in the next measure.
139 modernAccidentals = {
140   \property Current.extraNatural = ##f
141   \property Current.autoAccidentals = #'(Staff (same-octave . 0) (any-octave . 0) (same-octave . 1))
142   \property Current.autoCautionaries = #'()  
143 }
144
145 % the accidentals that Stone adds to the old standard as cautionaries
146 modernCautionaries = {
147   \property Current.extraNatural = ##f
148   \property Current.autoAccidentals = #'(Staff (same-octave . 0))
149   \property Current.autoCautionaries = #'(Staff (any-octave . 0) (same-octave . 1))  
150 }
151
152 % Multivoice accidentals to be read both by musicians playing one voice
153 % and musicians playing all voices.
154 % Accidentals are typeset for each voice, but they ARE cancelled across voices.
155 modernVoiceAccidentals = {
156   \property Current.extraNatural = ##f
157   \property Current.autoAccidentals = #'(
158     Voice (same-octave . 0) (any-octave . 0) (same-octave . 1)
159     Staff (same-octave . 0) (any-octave . 0) (same-octave . 1)
160   )
161   \property Current.autoCautionaries = #'()  
162 }
163
164 % same as modernVoiceAccidental eccept that all special accidentals are typeset
165 % as cautionaries
166 modernVoiceCautionaries = {
167   \property Current.extraNatural = ##f
168   \property Current.autoAccidentals = #'(
169     Voice (same-octave . 0) 
170   )
171   \property Current.autoCautionaries = #'(
172     Voice (any-octave . 0) (same-octave . 1)
173     Staff (same-octave . 0) (any-octave . 0) (same-octave . 1)
174   )  
175 }
176
177 % stone's suggestions for accidentals on grand staff.
178 % Accidentals are cancelled across the staves in the same grand staff as well
179 pianoAccidentals = {
180   \property Current.autoAccidentals = #'(
181     Staff (same-octave . 0) (any-octave . 0) (same-octave . 1)
182     GrandStaff (any-octave . 0) (same-octave . 1)
183   )
184   \property Current.autoCautionaries = #'()  
185 }
186
187 pianoCautionaries = {
188   \property Current.autoAccidentals = #'(
189     Staff (same-octave . 0)
190   )
191   \property Current.autoCautionaries = #'(
192     Staff (any-octave . 0) (same-octave . 1)
193     GrandStaff (any-octave . 0) (same-octave . 1)
194   )  
195 }
196
197
198 % Do not reset the key at the start of a measure.  Accidentals will be
199 % printed only once and are in effect until overridden, possibly many
200 % measures later.
201 noResetKey = {
202   \property Current.autoAccidentals = #'(Staff (same-octave . #t))
203   \property Current.autoCautionaries = #'()
204 }
205
206 % do not set localKeySignature when a note alterated differently from
207 % localKeySignature is found.
208 % Causes accidentals to be printed at every note instead of
209 % remembered for the duration of a measure.
210 % accidentals not being remembered, causing accidentals always to be typeset relative to the time signature
211 forgetAccidentals = {
212   \property Current.autoAccidentals = #'(Staff (same-octave . -1))
213   \property Current.autoCautionaries = #'()  
214 }
215
216
217 % To remove a Volta bracket or some other graphical object,
218 % set it to turnOff. Example: \property Staff.VoltaBracket = \turnOff
219
220 %%
221 %% DO NOT USE THIS. IT CAN LEAD TO CRASHES.
222 turnOff = #(cons '() '())
223
224 % For drawing vertical chord brackets with \arpeggio
225 % This is a shorthand for the value of the print-function property 
226 % of either Staff.Arpeggio or PianoStaff.Arpeggio, depending whether 
227 % cross-staff brackets are desired. 
228
229 arpeggioBracket = #Arpeggio::brew_chord_bracket
230 arpeggio = #(make-music-by-name 'ArpeggioEvent)
231 glissando = #(make-music-by-name 'GlissandoEvent)
232
233 fermataMarkup = \markup { \musicglyph #"scripts-ufermata" } 
234
235 setMmRestFermata =
236   \once \property Voice.MultiMeasureRestNumber \override #'text =
237     #fermataMarkup 
238
239
240 hideNotes =\sequential {
241                                 % hide notes, accidentals, etc.
242     \property Voice.Dots \override #'transparent = ##t
243     \property Voice.NoteHead \override #'transparent = ##t
244     \property Voice.Stem \override #'transparent = ##t
245     \property Voice.Beam \override #'transparent = ##t
246     \property Staff.Accidental \override #'transparent = ##t
247 }
248
249
250 unHideNotes =  \sequential {
251   \property Staff.Accidental \revert #'transparent
252   \property Voice.Beam \revert #'transparent
253   \property Voice.Stem \revert #'transparent
254   \property Voice.NoteHead \revert #'transparent
255   \property Voice.Dots \revert #'transparent 
256 }
257
258 germanChords = {
259     \property ChordNames. chordRootNamer = #(chord-name->german-markup #t)
260     \property ChordNames. chordNoteNamer = #note-name->german-markup
261 }
262 semiGermanChords = {
263     \property ChordNames. chordRootNamer = #(chord-name->german-markup #f)
264     \property ChordNames. chordNoteNamer = #note-name->german-markup
265 }