1 ;;;; figured bass support ...
5 "A bass figure, including bracket"
8 (define (recursive-split-at pred? l)
12 ((x (split-at-predicate pred? l)))
13 (set-cdr! x (recursive-split-at pred? (cdr x)))
17 (define-public (make-bass-figure-markup figures context)
19 (define (no-end-bracket? f1 f2)
20 (eq? (ly:music-property f1 'bracket-stop) '())
22 (define (no-start-bracket? f1 f2)
23 (eq? (ly:music-property f2 'bracket-start) '())
26 ;; TODO: support slashed numerals here.
27 (define (fig-to-markup fig-music)
29 ((align-accs (eq? #t (ly:context-property context 'alignBassFigureAccidentals)))
30 (fig (ly:music-property fig-music 'figure))
31 (acc (ly:music-property fig-music 'alteration))
35 (make-simple-markup fig)
36 (if align-accs (make-simple-markup " ")
37 (if (not (eq? acc '()))
38 (make-simple-markup "")
43 (make-line-markup (list fig-markup
44 (alteration->text-accidental-markup acc)))
48 (define (fig-seq-to-markup figs)
51 (c (make-dir-column-markup (map fig-to-markup figs)))
53 (if (eq? (ly:music-property (car figs) 'bracket-start) #t)
54 (make-bracket-markup c)
60 (ends (recursive-split-at no-end-bracket? (reverse figures)))
61 (starts (map (lambda (x) (recursive-split-at no-start-bracket? x)) ends))
63 (make-dir-column-markup (map fig-seq-to-markup (apply append starts)))