[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Figured Bass Tweaks
From: |
Thomas Morley |
Subject: |
Re: Figured Bass Tweaks |
Date: |
Sun, 8 May 2016 13:14:45 +0200 |
2016-05-08 2:28 GMT+02:00 Sam Bivens <address@hidden>:
> Hi all,
>
> Attached, I show my solutions for two figured bass tweaks: first, a
> parenthesized (not bracketed) figure; and second, a lone integer on the
> "lower line."
>
> The work-arounds are good enough for now, I'm just curious if anyone has any
> better ideas, or if I missed an obvious solution in the manual; I'd
> appreciate any comments anyone would be willing to offer.
>
> Thanks,
>
> Sam
\version "2.19.40"
#(define (brackets->bows grob)
(let* ((brackets-stil (ly:enclosing-bracket::print grob))
(edge-height (ly:grob-property grob 'edge-height))
(y-ext (ly:stencil-extent brackets-stil Y))
(x-ext (ly:stencil-extent brackets-stil X))
(up-left (cons (+ (car x-ext) (car edge-height)) (cdr y-ext)))
(down-left (cons (+ (car x-ext) (car edge-height)) (car y-ext)))
(up-right (cons (- (cdr x-ext) (cdr edge-height)) (cdr y-ext)))
(down-right (cons (- (cdr x-ext) (cdr edge-height)) (car y-ext))))
(ly:stencil-add
(make-bow-stencil
down-left
up-left
0.1 ;; thick
0.2 ;; angularity
0.3 ;; height
1)
(make-bow-stencil
down-right
up-right
0.1
0.2
0.3
-1))))
#(define ((make-bass-figures-transparent lst) grob)
(let* ((array (ly:grob-object (ly:grob-parent grob X) 'elements))
(bass-figures-list
(filter
(lambda (g)
(grob::has-interface g 'bass-figure-interface))
(ly:grob-array->list array))))
(if (> (length lst) (length bass-figures-list))
(begin
(ly:warning "Can't apply to items not present, ignoring the rest")
(set! lst (take lst (length bass-figures-list)))))
(for-each
(lambda (bf)
(ly:grob-set-property!
(list-ref bass-figures-list (1- bf)) 'transparent #t))
lst)))
bassFigureTransparent =
#(define-music-function (which-list)(number-list?)
#{
\once \override BassFigure.after-line-breaking =
#(make-bass-figures-transparent which-list)
#})
line = {
\repeat unfold 12 c'4
}
figs = \figuremode {
<[6]>4
%\once
\override BassFigureBracket.stencil = #brackets->bows
<[6]>4
<[6 4]>
<[6 4 2]>
<9 7 6 4>
\bassFigureTransparent #'(1)
<9 7 6 4>
\bassFigureTransparent #'(2)
<9 7 6 4>
\bassFigureTransparent #'(3)
<9 7 6 4>
\bassFigureTransparent #'(4)
<9 7 6 4>
\bassFigureTransparent #'(1 3)
<9 7 6 4>
\bassFigureTransparent #'(2 4)
<9 7 6 4>
\bassFigureTransparent #'(1 2 3)
<9 7 6 4>
}
\score {
<<
\new Staff \line
\new FiguredBass \figs
>>
}
HTH,
Harm