@end ignore
+@item
+Additional bass strings (for lute tablature) are supported.
+@lilypond[quote,verbatim]
+m = { f'4 d' a f d a, g, fis, e, d, c, \bar "|." }
+
+\score {
+ \new TabStaff \m
+ \layout {
+ \context {
+ \Score
+ tablatureFormat = #fret-letter-tablature-format
+ }
+ \context {
+ \TabStaff
+ stringTunings = \stringTuning <a, d f a d' f'>
+ additionalBassStrings = \stringTuning <c, d, e, fis, g,>
+ fretLabels = #'("a" "b" "r" "d" "e" "f" "g" "h" "i" "k")
+ }
+ }
+}
+@end lilypond
+
@item
The markup-list-command @code{\table} is now available.
Each column may be aligned differently.
* Common notation for fretted strings::
* Guitar::
* Banjo::
+* Lute::
@end menu
@node Common notation for fretted strings
Snippets:
@rlsr{Fretted strings}.
+
+
+@node Lute
+@subsection Lute
+
+@menu
+* Lute tablatures::
+@end menu
+
+@node Lute tablatures
+@unnumberedsubsubsec Lute tablatures
+
+@cindex lute tablatures
+@cindex tablature, lute
+
+LilyPond supports tablature for lute.
+
+To get additional bass strings use @code{additionalBassStrings}, where the
+pitches of those strings are set. They will be printed below lowest line as:
+a, /a, //a, ///a, 4, 5 etc.
+
+@code{fret-letter-tablature-format} for @code{tablatureFormat} should be used,
+probably @code{fretLabels} for further customizing.
+
+@lilypond[quote,ragged-right,verbatim]
+m = { f'4 d' a f d a, g, fis, e, d, c, \bar "|." }
+
+\score {
+ <<
+ \new Staff { \clef bass \cadenzaOn \m }
+ \new TabStaff \m
+ >>
+ \layout {
+ \context {
+ \Score
+ tablatureFormat = #fret-letter-tablature-format
+ }
+ \context {
+ \TabStaff
+ stringTunings = \stringTuning <a, d f a d' f'>
+ additionalBassStrings = \stringTuning <c, d, e, fis, g,>
+ fretLabels = #'("a" "b" "r" "d" "e" "f" "g" "h" "i" "k")
+ }
+ }
+}
+@end lilypond
+
+@cindex lute tunings
+@cindex tunings, lute
+
+@knownissues
+Using @code{FretBoards} with @code{additionalBassStrings} is not supported and
+will yield unsatisfying results.
--- /dev/null
+\version "2.19.37"
+
+\header
+{
+ texidoc = "Additional bass strings (for baroque lute, etc.) are supported in
+ TabStaff. They are printed below lowest line as: a, /a, //a, ///a, 4, 5 etc.
+ @code{additionalBassStrings} needs to be set accordingly."
+}
+
+m = { e' b g d a, e, d, c, b,,\9 a,, g,, }
+mus = { \m \bar "||" \transpose c cis \m \bar "|." }
+
+\score {
+ <<
+ \new Staff { \clef bass \cadenzaOn \mus }
+ %% FretBoards with `additionalBassStrings' return weird output
+ %% A warning is thrown if uncommented
+ %\new FretBoards \mus
+ \new TabStaff { \mus }
+ >>
+ \layout {
+ \context {
+ \Score
+ tablatureFormat = #fret-letter-tablature-format
+ }
+ \context {
+ \FretBoards
+ stringTunings = \stringTuning <e, a, d g b e'>
+ additionalBassStrings = \stringTuning <g,, a,, b,, c, d,>
+ }
+ \context {
+ \TabStaff
+ stringTunings = \stringTuning <e, a, d g b e'>
+ additionalBassStrings = \stringTuning <g,, a,, b,, c, d,>
+ fretLabels = #'("a" "b" "r" "d" "e" "f" "g" "h" "i" "k")
+ }
+ }
+}
on the same note in different octaves may be horizontally staggered
if in different voices.")
(aDueText ,markup? "Text to print at a unisono passage.")
+ (additionalBassStrings ,list? "The additional tablature bass-strings, which
+will not get a seprate line in TabStaff. It is a list of the pitches of each
+string (starting with the lowest numbered one).")
(additionalPitchPrefix ,string? "Text with which to prefix
additional pitches within a chord name.")
(alignAboveContext ,string? "Where to insert newly created context in
(cons tuning (map (lambda (x) (shift-octave x -1))
pitches))))))))
+ ;; TODO: Does it make sense to have additional bass strings in a fret-diagram?
+ (if (and (not (null? rest))
+ (not (null? (ly:context-property context 'additionalBassStrings))))
+ (ly:warning "additional bass strings are not supported by FretBoards"))
+
;; body of determine-frets
(let* ((predefined-fret-table
(ly:context-property context 'predefinedDiagramTable))
- (tunings (ly:context-property context 'stringTunings))
+ (tunings
+ (append
+ (ly:context-property context 'stringTunings)
+ (ly:context-property context 'additionalBassStrings '())))
(string-count (length tunings))
(grob (if (null? rest) '() (car rest)))
(pitches (map (lambda (x) (ly:event-property x 'pitch)) notes))
;; The fret letter is taken from 'fretLabels if present
(define-public (fret-letter-tablature-format
context string-number fret-number)
- (let ((labels (ly:context-property context 'fretLabels)))
- (make-translate-scaled-markup '(0 . -0.5)
- (cond
- ((= 0 (length labels))
- (string (integer->char (+ fret-number (char->integer #\a)))))
- ((and (<= 0 fret-number) (< fret-number (length labels)))
- (list-ref labels fret-number))
- (else
- (ly:warning (_ "No label for fret ~a (on string ~a);
+ (let* ((labels (ly:context-property context 'fretLabels))
+ (string-tunings (ly:context-property context 'stringTunings))
+ (string-count (length string-tunings))
+ (letter
+ (cond
+ ((= 0 (length labels))
+ (string (integer->char (+ fret-number (char->integer #\a)))))
+ ((and (<= 0 fret-number) (< fret-number (length labels)))
+ (list-ref labels fret-number))
+ (else
+ (ly:warning
+ (_ "No label for fret ~a (on string ~a);
only ~a fret labels provided")
- fret-number string-number (length labels))
- ".")))))
+ fret-number string-number (length labels))
+ ".")))
+ (add-bass-string-nr ;; starting at zero
+ (- string-number string-count 1)))
+ (make-translate-scaled-markup '(0 . -0.5)
+ ;; For additional bass strings, we add zero up to three "/"-signs before
+ ;; the letter, even more bass strings will get numbers, starting with "4".
+ ;; In the rare case such a string isn't played open, we put out, eg."4b"
+ (make-concat-markup
+ (if (> string-number (+ string-count 4))
+ (list (number->string add-bass-string-nr)
+ (if (zero? fret-number) "" letter))
+ (list (make-string (max 0 add-bass-string-nr) #\/)
+ letter))))))
;; Display the fret number as a number
(define-public (fret-number-tablature-format
(define-public (tablature-position-on-lines context string-number)
(let* ((string-tunings (ly:context-property context 'stringTunings))
(string-count (length string-tunings))
+ (string-nr
+ (if (> string-number (length string-tunings))
+ (1+ (length string-tunings))
+ string-number))
(string-one-topmost (ly:context-property context 'stringOneTopmost))
- (staff-line (- (* 2 string-number) string-count 1)))
+ (staff-line (- (* 2 string-nr) string-count 1)))
(if string-one-topmost
(- staff-line)
staff-line)))