@uref{http://@/lilypond@/.org/@/doc/@/stable/@/Documentation/@/user/@/lilypond@/-internals/,on@/-line},
but is also included with the LilyPond documentation package.
+@c TODO The following is at variance to what actually follows. Fix -td
+
There are four areas where the default settings may be changed:
@itemize
@node Using break-visibility
@unnumberedsubsubsec Using break-visibility
+@c TODO Add making other objects breakable
+
@cindex break-visibility
Most layout objects are printed only once, but some like
at the end of the previous line as well.
This behaviour is controlled by the @code{break-visibility}
-property, which is explained in @rlearning{Visibility and color of
-objects}. This property takes a vector of three booleans which,
-in order, determine whether the object is printed at the end of,
-within the body of, or at the beginning of a line. Or to be more
-precise, before a line break, where there is no line break, or
-after a line break.
+property, which is explained in
+@c Leave this ref on a newline - formats incorrectly otherwise -td
+@rlearning{Visibility and color of objects}. This property takes
+a vector of three booleans which, in order, determine whether the
+object is printed at the end of, within the body of, or at the
+beginning of a line. Or to be more precise, before a line break,
+where there is no line break, or after a line break.
Alternatively, seven of the eight combinations may be specified
by pre-defined functions, defined in @file{scm/output-lib.scm},
where the last three columns indicate whether the layout objects
will be visible in the positions shown at the head of the columns:
-@multitable @columnfractions .40 .15 .15 .15 .15
+@multitable @columnfractions .40 .15 .1 .1 .1
@c TODO check these more carefully
@headitem Function @tab Vector @tab Before @tab At no @tab After
@headitem form @tab form @tab break @tab break @tab break
@node Rotating objects
@subsection Rotating objects
-@c FIXME Write this section
+Both layout objects and elements of markup text can be rotated by
+any angle about any point, but the method of doing so differs.
+
+@menu
+* Rotating layout objects::
+* Rotating markup::
+@end menu
+
+@node Rotating layout objects
+@unnumberedsubsubsec Rotating layout objects
+
+@cindex rotating objects
+@cindex objects, rotating
+
+All layout objects which support the @code{grob-interface} can be
+rotated by setting their @code{rotation} property. This takes a
+list of three items: the angle of rotation counter-clockwise,
+and the x and y coordinates of the point relative to the object's
+reference point about which the rotation is to be performed. The
+angle of rotation is specified in degrees and the coordinates in
+staff-spaces.
+
+The angle of rotation and the coordinates of the rotation point must
+be determined by trial and error.
+
+@cindex hairpins, angled
+@cindex angled hairpins
+
+There are only a few situations where the rotation of layout
+objects is useful; the following example shows one situation where
+they may be:
+
+@lilypond[quote,verbatim,relative=1]
+g4\< e' d' f\!
+\override Hairpin #'rotation = #'(20 -1 0)
+g,,4\< e' d' f\!
+@end lilypond
+
+@node Rotating markup
+@unnumberedsubsubsec Rotating markup
+
+All markup text can be rotated to lie at any angle by prefixing it
+with the @code{\rotate} command. The command takes two arguments:
+the angle of rotation in degrees counter-clockwise and the text to
+be rotated. The extents of the text are not rotated: they take
+their values from the extremes of the x and y coordinates of the
+rotated text. In the following example the
+@code{outside-staff-priority} property for text is set to @code{#f}
+to disable the automatic collision avoidance, which would push some
+of the text too high.
+
+@lilypond[quote,verbatim,relative=1]
+\override TextScript #'outside-staff-priority = ##f
+g4^\markup { \rotate #30 "a G" }
+b^\markup { \rotate #30 "a B" }
+des^\markup { \rotate #30 "a D-Flat" }
+fis^\markup { \rotate #30 "an F-Sharp" }
+@end lilypond
+
@node Aligning objects
@subsection Aligning objects
@lilypondfile[quote]{chords-headword.ly}
-Chords can be entered in chord mode, which recognizes some traditional European chord naming conventions. Chord names can also
-be displayed. In addition, figured bass notation can be displayed.
+Chords can be entered either as normal notes or in chord mode and displayed
+using a variety of traditional European chord naming conventions. Chord
+names and figured bass notation can also be displayed.
@menu
* Chord mode::
are also different symbols displayed for a given chord name. The
names and symbols displayed for chord names are customizable.
-@cindex Banter
@cindex jazz chords
@cindex chords, jazz
-The default chord name layout is a system for Jazz music, proposed
-by Klaus Ignatzek (see @ref{Literature list}). There are also two
-other chord name schemes implemented: an alternate Jazz chord
-notation, and a systematic scheme called Banter chords. The
-alternate Jazz notation is also shown on the chart in @ref{Chord
+The basic chord name layout is a system for Jazz music, proposed
+by Klaus Ignatzek (see @ref{Literature list}). The chord naming
+system can be modified as described below. An alternate jazz
+chord system has been developed using these modifications.
+The Ignatzek and alternate
+Jazz notation are shown on the chart in @ref{Chord
name chart}.
@c TODO -- Change this so we don't have a non-verbatim example.
@lilypondfile[ragged-right]{chord-names-languages.ly}
-If none of the default settings give the desired output, the chord
+If none of the existing settings give the desired output, the chord
name display can be tuned through the following properties.
@table @code
@lilypond[quote,ragged-right,verbatim]
-\storePredefinedDiagram <c\5 e g c' e'>
+\storePredefinedDiagram <c e g c' e'>
#guitar-tuning
#"x;3-1-(;5-2;5-3;5-4;3-1-1);"
<<
}
}
\context FretBoards {
- <c\5 e g c' e'>1
+ <c e g c' e'>1
\predefinedFretboardsOff
- <c\5 e g c' e'>
+ <c e g c' e'>
\predefinedFretboardsOn
- <c\5 e g c' e'>
+ <c e g c' e'>
}
\context Staff {
\clef "treble_8"
- <c\5 e g c' e'>1
- <c\5 e g c' e'>
- <c\5 e g c' e'>
+ <c e g c' e'>1
+ <c e g c' e'>
+ <c e g c' e'>
}
>>
@end lilypond
-Notes can be explicitly placed on a string. It is often enough
-to place only the lowest note on an explicit string; the rest of
+Sometimes the fretboard calculator will be unable to find
+an accceptable diagram. This can often be remedied by
+manually assigning a note to a string. In many cases, only one
+note need be manually placed on a string; the rest of
the notes will then be placed appropriately by the @code{FretBoards}
context.
<<
\context ChordNames {
\chordmode {
- c1 c d:m d:m
+ c1 c
}
}
\context FretBoards {
- < c e g c' e' > 1
- < c\5 e g c' e' > 1
- < d a d' f'>
- < d\4 a d' f'>
+ < c g c' e' g'> 1
+ < c g\4 c' e' g'> 1
}
\context Staff {
\clef "treble_8"
- < c e g c' e' > 1
- < c e g c' e' > 1
- < d a d' f'>
- < d a d' f'>
+ < c g c' e' g'> 1
+ < c g c' e' g'> 1
}
>>
@end lilypond
}
}
\context FretBoards {
- < c\5-3 e-2 g c'-1 e' > 1
- < d\4 a-2 d'-3 f'-1>
+ < c-3 e-2 g c'-1 e' > 1
+ < d a-2 d'-3 f'-1>
}
\context Staff {
\clef "treble_8"
>>
@end lilypond
+The minimum fret to be used in calculating strings and frets for
+the FretBoard context can be set with the @code{minimumFret}
+property.
+
+@lilypond[quote, verbatim]
+<<
+ \context ChordNames {
+ \chordmode {
+ d1:m d:m
+ }
+ }
+ \context FretBoards {
+ < d a d' f'>
+ \set FretBoards.minimumFret = #5
+ < d a d' f'>
+ }
+ \context Staff {
+ \clef "treble_8"
+ < d a d' f'>
+ < d a d' f'>
+ }
+>>
+@end lilypond
+
The strings and frets for the @code{FretBoards} context depend
on the @code{stringTunings} property, which has the same meaning
as in the TabStaff context. See @ref{Custom tablatures} for
@code{FretBoards} fret diagram, the interface properties belong to
@code{FretBoards.FretBoard}.
-@snippets
-The minimum fret to be used in calculating strings and frets for
-the FretBoard context can be set with the @code{minimumFret}
-property.
-
-@c TODO -- snippet showing minimum fret.
-
-@c TODO -- snippet for using StringTunings
-
@predefined
\predefinedFretboardsOff,
\predefinedFretboardsOn.
Spacing rests are often used to avoid too many rests, as seen in the
example above.
-The method exposed creates two new voices when the @code{<<@{...@} \\
-@{...@}>>} construction is found in the code; to temporally add only
-one additional voice to an existing one, it is necessary to
-instantiate that voice explicitly. For these purposes, the
-@code{\voiceOne} ... @code{\voiceFour}, and @code{\oneVoice} commands
-can be used:
+Each music expression in the @code{<<{...} \\ {...}>>} construct
+is placed in a new voice, distinct from the voice for single-voice
+music; to temporarily add only one additional voice to an existing
+one, it is necessary to instantiate that voice explicitly. For
+these purposes, the @code{\voiceOne} ... @code{\voiceFour}, and
+@code{\oneVoice} commands can be used:
@example
<< @{ \voiceOne ... @} \new Voice @{ \voiceTwo ... @} >> \oneVoice
@end example
-This is a better construction to keep the control of the voices, for
+This is a better construct to keep the control of the voices, for
example, to ease a consistent assign of lyrics to the proper voice
context.
automatic beaming. You can override this by switching off
automatic beaming and beaming the notes manually. Where matching
existing typeset music is not an issue, you may still want to
-adjust the beaming behaviour and/or using compound time
-signatures.
+adjust the beaming behaviour and/or use compound time signatures.
@snippets
((< i 0))
(f (vector-ref v i))))
-;; TODO: make a remove-grace-property too.
(define-public (add-grace-property context-name grob sym val)
"Set SYM=VAL for GROB in CONTEXT-NAME. "
(define (set-prop context)
(ly:context-set-property! where 'graceSettings new-settings)))
(ly:export (context-spec-music (make-apply-context set-prop) 'Voice)))
+(define-public (remove-grace-property context-name grob sym)
+ "Remove all SYM for GROB in CONTEXT-NAME. "
+ (define (sym-grob-context? property sym grob context-name)
+ (and (eq? (car property) context-name)
+ (eq? (cadr property) grob)
+ (eq? (caddr property) sym)))
+ (define (delete-prop context)
+ (let* ((where (ly:context-property-where-defined context 'graceSettings))
+ (current (ly:context-property where 'graceSettings))
+ (prop-settings (filter
+ (lambda(x) (sym-grob-context? x sym grob context-name))
+ current))
+ (new-settings current))
+ (for-each (lambda(x)
+ (set! new-settings (delete x new-settings)))
+ prop-settings)
+ (ly:context-set-property! where 'graceSettings new-settings)))
+ (ly:export (context-spec-music (make-apply-context delete-prop) 'Voice)))
+
(defmacro-public def-grace-function (start stop)
(if (note-string note)
(set-fret note (note-string note))
(let*
- ((string (find (lambda (string) (string-qualifies string
- (note-pitch note)))
- (reverse free-strings))))
- (if string
- (set-fret note string)
- (ly:warning "No string for pitch ~a (given frets ~a)" (note-pitch note)
+ ((fit-string (find (lambda (string)
+ (string-qualifies string (note-pitch note)))
+ free-strings)))
+ (if fit-string
+ (set-fret note fit-string)
+ (ly:warning "No string for pitch ~a (given frets ~a)"
+ (note-pitch note)
specified-frets))
)))