1 ;;;; bass-figure.scm -- implement Scheme output routines for TeX
3 ;;;; source file of the GNU LilyPond music typesetter
5 ;;;; (c) 1998--2005 Jan Nieuwenhuizen <janneke@gnu.org>
6 ;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 'bass-figure-interface
11 "A bass figure, including bracket"
15 (define-public (format-new-bass-figure figure event context)
16 (let* ((fig (ly:music-property event 'figure))
17 (fig-markup (markup #:number (number->string figure 10)))
19 (alt (ly:music-property event 'alteration))
22 (alteration->text-accidental-markup alt)
24 (alt-dir (ly:context-property context 'figuredBassAlterationDirection))
30 (markup #:put-adjacent fig-markup X
35 #:pad-around 0.5 #:smaller alt-markup )))
39 (define-public (format-bass-figure figures context grob)
40 ;; TODO: support slashed numerals here.
41 (define (fig-to-markup fig-music)
43 (eq? #t (ly:context-property context 'alignBassFigureAccidentals)))
44 (fig (ly:music-property fig-music 'figure))
45 (acc (ly:music-property fig-music 'alteration))
50 (if align-accs (make-simple-markup " ")
51 (if (not (eq? acc '()))
52 (make-simple-markup "")
53 (make-strut-markup))))))
56 (make-line-markup (list fig-markup
57 (alteration->text-accidental-markup acc)))
60 (define (filter-brackets i figs acc)
64 (filter-brackets (1+ i) (cdr figs)
67 (if (eq? (ly:music-property (car figs) 'bracket-start) #t)
70 (if (eq? (ly:music-property (car figs) 'bracket-stop) #t)
76 (set! (ly:grob-property grob 'text)
77 (make-bracketed-y-column-markup
78 (sort (filter-brackets 0 figures '()) <)
79 (map fig-to-markup figures))))