@ref{Clef}.
@lilypond[verbatim,quote,relative=2]
-\new Staff {
- \override Staff.StaffSymbol #'line-count = #3
- d4 d d d
+\new Staff \with {
+ \override StaffSymbol #'line-count = #3
}
+{ d4 d d d }
@end lilypond
The vertical position of staff lines and the number of staff lines
can be defined at the same time. As the following example shows,
-note positions are not influenced by the position of the staff
-lines.
+note positions are not influenced by the staff line positions.
@warning{The @code{'line-positions} property overrides the
@code{'line-count} property. The number of staff lines is
{ e4 d c b }
@end lilypond
-The thickness of ledger lines can be set independently of staff
-line thickness.
+Ledger line thickness can be set independently of staff line
+thickness.
@lilypond[verbatim,quote,relative=1]
\new Staff \with {
{ e4 d c b }
@end lilypond
-The distance between staff lines can be changed. The setting has
+The distance between staff lines can be changed. This setting has
influence on ledger lines as well.
@lilypond[verbatim,quote,relative=1]
{ a4 b c d }
@end lilypond
-The width of a staff can be adjusted. The unit is one staff
+The width of a staff can be modified. The unit is one staff
space. The spacing of objects inside the staff is not influenced
by this setting.
{ a4 e' f b | d1 }
@end lilypond
-Further details about the properties of @code{StaffSymbol} listed
-above can be found here: @rinternals{staff-symbol-interface}.
+Further details about the properties of @code{StaffSymbol} can be
+found here: @rinternals{staff-symbol-interface}.
+
+@funindex \startStaff
+@funindex \stopStaff
Modifications to staff properties in the middle of a score can be
placed between @code{\stopStaff} and @code{\startStaff}:
@predefined
-@funindex \startStaff
@code{\startStaff},
-@funindex \stopStaff
@code{\stopStaff}.
@knownissues
-When setting staff lines manually, bar lines are always drawn
-centered on the position 0, so the maximum distance of the bar
-lines in either direction must be equal.
+When setting vertical staff line positions manually, bar lines are
+always centered on position 0, so the maximum distance between the
+outermost bar lines in either direction must be equal.
@node Ossia staves
@node Hiding staves
@unnumberedsubsubsec Hiding staves
-@cindex Frenched scores
+@cindex Frenched score
+@cindex Frenched staff
@cindex staff, hiding
@cindex staff, empty
@cindex hiding of staves
@cindex empty staves
-@cindex Frenched staves
-In orchestral scores, staff lines that only have rests are usually
-removed in order to save some space. This style is called
-@q{French Score}. For the @code{Lyrics}, @code{ChordNames}, and
-@code{FiguredBass} contexts, this is switched on by default.
+Staff lines can be hidden by removing the
+@code{Staff_symbol_engraver} from the @code{Staff} context. As an
+alternative, @code{\stopStaff} may be used.
+
+@lilypond[verbatim,quote]
+\new Staff \with {
+ \remove "Staff_symbol_engraver"
+}
+\relative c''' { a8 f e16 d c b a2 }
+@end lilypond
+
+@funindex \RemoveEmptyStaffContext
+
+Empty staves can be hidden by setting the
+@code{\RemoveEmptyStaffContext} command in the @code{\layout}
+block. In orchestral scores, this style is known as @q{Frenched
+Score}. By default, this command hides all empty staves in a
+score except for those in the first system.
-For other staff contexts, this behavior is set with the
-@code{\RemoveEmptyStaffContext} command. It is set in the
-@code{\layout} block. As a result, empty staves or staves
-containing multi-measure rests are removed after a line break.
+@warning{An empty staff may only include multi-measure rests,
+skips, spacer rests, or a combination of these.}
@lilypond[verbatim,quote,ragged-right]
\layout {
\RemoveEmptyStaffContext
}
}
-\relative c'' {
- <<
- \new Staff { e4 f g a \break c1 }
- \new Staff { c4 d e f \break R1 }
- >>
-}
+\relative c' <<
+ \new Staff {
+ e4 f g a \break
+ b1 \break
+ a4 b c2
+ }
+ \new Staff {
+ c,4 d e f \break
+ R1 \break
+ f4 g c,2
+ }
+>>
@end lilypond
-To remove other types of contexts, use
-@code{\AncientRemoveEmptyStaffContext} or
-@code{\RemoveEmptyRhythmicStaffContext}.
-
@cindex ossia
-Another application of @code{\RemoveEmptyStaffContext} is to make
-ossia sections, i.e., alternative melodies on a separate piece of
-staff, with help of a Frenched staff. For details, see
-@ref{Ossia staves}.
-
-Staff lines can be made invisible by removing the
-@code{Staff_symbol_engraver} from the @code{Staff} context:
+@code{\RemoveEmptyStaffContext} can also be used to create ossia
+sections for a staff. For details, see @ref{Ossia staves}.
-@lilypond[verbatim,quote]
-\new Staff \with {
- \remove "Staff_symbol_engraver"
-}
-\relative c'' { c8 c c16 c c c c2 }
-@end lilypond
-
-
-@snippets
+@cindex hiding ancient staves
+@cindex hiding rhythmic staves
+@funindex \AncientRemoveEmptyStaffContext
+@funindex \RemoveEmptyRhythmicStaffContext
-@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
-{removing-the-first-empty-line.ly}
+The @code{\AncientRemoveEmptyStaffContext} command may be used to
+hide empty staves in ancient music contexts. Similarly,
+@code{\RemoveEmptyRhythmicStaffContext} may be used to hide empty
+@code{RhythmicStaff} contexts.
@predefined
-@funindex \RemoveEmptyStaffContext
@code{\RemoveEmptyStaffContext},
-@funindex \AncientRemoveEmptyStaffContext
@code{\AncientRemoveEmptyStaffContext},
-@funindex \RemoveEmptyRhythmicStaffContext
@code{\RemoveEmptyRhythmicStaffContext}.
+@snippets
+
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+{removing-the-first-empty-line.ly}
+
+
@seealso
+Music Glossary:
+@rglos{Frenched staff}.
+
Notation Reference:
@ref{Staff symbol},
@ref{Ossia staves}.
@lilypond[verbatim,quote,ragged-right,relative=1]
\set Staff.instrumentName = "Violin "
\set Staff.shortInstrumentName = "Vln "
-c1
+c4.. g'16 c4.. g'16
\break
-c''1
+c1
@end lilypond
Markup mode can be used to create more complicated instrument
\set Staff.instrumentName = \markup {
\column { "Clarinetti"
\line { "in B" \smaller \flat } } }
-c1
+c4 c,16 d e f g2
@end lilypond
@cindex instrument names, centering
@lilypond[verbatim,quote,relative=2]
<<
+ \new Staff {
+ \set Staff.instrumentName = "Flute"
+ f2 g4 f
+ }
\new Staff {
\set Staff.instrumentName = \markup \center-column {
Clarinetti
\line { "in B" \smaller \flat }
}
- c1
- }
- \new Staff {
- \set Staff.instrumentName = "Vibraphone"
- c1
+ c4 b c2
}
>>
@end lilypond
@cindex indent
@cindex short-indent
-The @code{indent} and @code{short-indent} settings specify the
-level of indentation for the first system and all succeeding
-systems, respectively. They can be modified in the @code{\layout}
-block. For instrument names or short instrument names that are
-longer, it may be useful to increase the @code{indent} and
-@code{short-indent} settings:
-
-@lilypond[verbatim,quote]
-\relative c' <<
- \new Staff \with {
- instrumentName = "Oboe"
- }
- { c2 d }
- \new Staff \with {
- instrumentName = "Glockenspiel"
- }
- { c'2 d }
->>
+However, if the instrument names are longer, the instrument names
+in a staff group may not be centered unless the @code{indent} and
+@code{short-indent} settings are increased. The @code{indent} and
+@code{short-indent} settings are modified in the @code{\layout}
+block and specify the level of indentation for the first system
+and all succeeding systems, respectively.
+@lilypond[verbatim,quote,ragged-right]
\layout {
indent = 2.5\cm
+ short-indent = 1.5\cm
}
+
+\relative c'' <<
+ \new Staff {
+ \set Staff.instrumentName = "Flute"
+ \set Staff.shortInstrumentName = "Fl."
+ f2 g4 f \break
+ g4 f g2
+ }
+ \new Staff {
+ \set Staff.instrumentName = "Clarinet"
+ \set Staff.shortInstrumentName = "Clar."
+ c,4 b c2 \break
+ c2 b4 c
+ }
+>>
@end lilypond
To add instrument names to other contexts (such as
@end lilypond
-@snippets
-
-@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
-{aligning-and-centering-instrument-names.ly}
-
-
@seealso
Notation Reference:
implicitly, and occurs simultaneously with @var{music}, which
creates a polyphonic situation. The @var{voice} argument
determines whether the cue notes should be notated as a first or
-second voice; @code{DOWN} corresponds to the first voice, and
-@code{UP} corresponds to the second.
+second voice; @code{UP} corresponds to the first voice, and
+@code{DOWN} corresponds to the second.
@lilypond[verbatim,quote]
oboe = \relative c'' {
@end itemize
-@c FIXME explain syntax of \transposedCueDuring
-
The @code{\transposedCueDuring} command is useful to add cues for
-instruments in a completely different register. Having piccolo
-cues within a contrabassoon part is a good example.
+instruments in a completely different register. The syntax is
+similar to @code{\cueDuring}, but it requires one more argument to
+specify the transposition of the cued instrument. For more
+information about transposition, see
+@ref{Instrument transpositions}.
@lilypond[verbatim,quote]
piccolo = \relative c''' {
@seealso
+Notation Reference:
+@ref{Instrument transpositions}.
+
Snippets:
@rlsr{Staff notation}.
;; 2. end * * *
;; 3. end <type> <num> <den>
;; 4. end * <num> <den>
-;; 5. if 1-4 not specified: begin anywhere, end at every beat
+;; 5. if 1-4 not specified, begin anywhere, end at time determined by
+;; beatGrouping and beatLength:
+;; if beatGrouping and beatLength are consistent with measureLength,
+;; use beatGrouping to determine end of beams.
+;; if beatGrouping and beatLength are inconsistent with measureLength,
+;; use beatLength to determine end of beams.
;;
;; Rationale:
;;
;; 4. exceptions for specific time signature
;; 5. easy catch-all rule for non-specified measure types
+
(define-public (default-auto-beam-check context dir test)
(define (get name default)
(let ((value (ly:context-property context name)))
(if (not (null? value)) value default)))
+ (define (ending-moments group-list start-beat beat-length)
+ (if (null? group-list)
+ '()
+ (let ((new-start (+ start-beat (car group-list))))
+ (cons (ly:moment-mul (ly:make-moment new-start 1) beat-length)
+ (ending-moments (cdr group-list) new-start beat-length)))))
+
+ (define (make-end-settings time ending-list moment-den)
+ (if (null? ending-list)
+ '()
+ (cons (cons (append '(end * *) time)
+ (ly:make-moment (car ending-list) moment-den))
+ (make-end-settings time (cdr ending-list) moment-den))))
+
;; Don't start auto beams on grace notes
(if (and (!= (ly:moment-grace-numerator (ly:context-now context)) 0)
(= dir START))
#f
- (let* ((beat-length (get 'beatLength (ly:make-moment 1 1)))
+ (let* ((beat-length (get 'beatLength (ly:make-moment 1 4)))
(measure-length (get 'measureLength (ly:make-moment 1 1)))
(measure-pos (get 'measurePosition ZERO-MOMENT))
+ (beat-grouping (get 'beatGrouping '()))
(settings (get 'autoBeamSettings '()))
(function (list (if (= dir START) 'begin 'end)))
+ ;; Calculate implied time signature based on measureLength
+ ;; and beatLength for default value in get
(num-mom (ly:moment-div measure-length beat-length))
(num (inexact->exact
(round (/ (ly:moment-main-numerator num-mom)
(ly:moment-main-denominator num-mom)))))
(den (ly:moment-main-denominator beat-length))
- (time (list num den))
+ (time-signature-fraction
+ (get 'timeSignatureFraction (cons num den)))
+ (time (list (car time-signature-fraction)
+ (cdr time-signature-fraction)))
(type (list (ly:moment-main-numerator test)
(ly:moment-main-denominator test)))
(pos (if (>= (ly:moment-main-numerator measure-pos) 0)
measure-pos
(ly:moment-add measure-length measure-pos)))
- (lst (list
+ (grouping-moments (ending-moments beat-grouping 0 beat-length))
+ ;; Calculate implied measure length from beatGrouping
+ ;; and beatLength
+ (grouping-length (if (null? grouping-moments)
+ ZERO-MOMENT
+ (list-ref grouping-moments
+ (1- (length grouping-moments)))))
+ (lst (list
;; Hmm, should junk user-override feature,
;; or split this in user-override and config section?
(append function type '(* *))
(append function '(* * * *))
(append function type time)
- (append function '(* *) time))))
-
- (if (or
+ (append function '(* *) time)))
+ (predefined-setting (first-assoc lst settings)))
+ (if (or
;; always begin or end beams at beginning/ending of measure
(= (ly:moment-main-numerator pos) 0)
(first-member (map (lambda (x) (cons x pos)) lst) settings))
(if (= dir START)
;; if no entry matches our function + time or type,
;; start anywhere
- (not (first-assoc lst settings))
- ;; if no entry matches our function + time or type,
- ;; end at any beat
- (and (not (first-assoc lst settings))
- (= (ly:moment-main-denominator
- (ly:moment-div pos beat-length)) 1)))))))
+ (not predefined-setting)
+ ;; if entry matches our function + time or type, check moment
+ (if predefined-setting
+ (equal? measure-pos (cdr predefined-setting))
+ ;; if measure-length matches grouping-length, use
+ ;; grouping moments, else use beat-length
+ (if (equal? measure-length grouping-length)
+ (member measure-pos grouping-moments)
+ (= (ly:moment-main-denominator
+ (ly:moment-div pos beat-length)) 1))))))))