[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Another Figured Bass problem
From: |
Thomas Morley |
Subject: |
Re: Another Figured Bass problem |
Date: |
Mon, 30 Apr 2018 23:09:40 +0200 |
2018-04-30 12:51 GMT+02:00 Torsten Hämmerle <address@hidden>:
> Hi Robert,
>
> How about simply flipping the stacking direction?
>
> \override BassFigureAlignment.stacking-dir = #UP
>
> That way, the bass figures will be piled up from bottom to top.
> Caveat: the first figure entered will be the lowest.
>
> %%%%
> <<
> { 4 4 4 4 4 4 }
> \figures {
> \override BassFigureAlignment.stacking-dir = #UP
> <_!> <3+ 6> <4> <4 5> <3+> <_+>
> }
> >>
> %%%%
>
> HTH,
> Torsten
I looked for a way not to change the input order, but still benefit
from upwards stacking-dir.
Coming up with the code below.
For test-cases I used some of our reg-tests in a modified manner.
figured-bass-continuation-center.ly looks even better, imho.
figured-bass.ly is surely not meant to demonstrate real live input,
though, I add it as well, demonstrating bracketing still works.
\version "2.19.81"
reverseEventChordsElements =
#(define-music-function (mus)(ly:music?)
(music-map
(lambda (m)
(if (music-is-of-type? m 'event-chord)
(let ((ev-chrd-elts (ly:music-property m 'elements)))
(ly:music-set-property! m 'elements
(reverse
(map
(lambda (e)
(cond ((and (eq? #t (ly:music-property e 'bracket-start))
(eq? #t (ly:music-property e 'bracket-stop)))
'())
((eq? #t (ly:music-property e 'bracket-start))
(begin
(ly:music-set-property! e 'bracket-start '())
(ly:music-set-property! e 'bracket-stop #t)))
((eq? #t (ly:music-property e 'bracket-stop))
(begin
(ly:music-set-property! e 'bracket-stop '())
(ly:music-set-property! e 'bracket-start #t))))
e)
ev-chrd-elts)))
m)
m))
mus))
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% EXAMPLES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paper { indent = 30 }
\layout {
\context {
\FiguredBass
\override BassFigureAlignment.stacking-dir = #UP
}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% figured-bass-continuation-center.ly
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
mI =
\relative {
c'8 c b b a a b b
c c b b
}
figI =
\figuremode {
\set useBassFigureExtenders = ##t
\set figuredBassCenterContinuations = ##t
<6+ 4 3>4 <6 4 3> r
<6+ 4 3>4 <6 4 3> <4 3+> r
}
<<
\new Staff
\with { instrumentName = "default figures" }
\mI
\new FiguredBass
\with { \revert BassFigureAlignment.stacking-dir }
\figI
\new Staff
\with { instrumentName = "tweaked figures" }
\mI
\new FiguredBass
\reverseEventChordsElements
\figI
>>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% figured-bass.ly
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
mII = {
\clef bass
c 4 c c c
c 4 c c c
}
figII =
\figuremode {
<3 [5 7]>
<3\+ [5/] 7/ [9 11]>
<3+ 5- 7!>
<3 _! 5 _- 7>
<3 _ 5 _ 7>
<3 6/ >
<3 6\\ >
<"V7" ["bla" 6] \markup{ \musicglyph "rests.2"} >
}
<<
\new Staff
\with { instrumentName = "default figures" }
\mII
\new FiguredBass
\with { \revert BassFigureAlignment.stacking-dir }
\figII
\new Staff
\with { instrumentName = "tweaked figures" }
\mII
\new FiguredBass
\reverseEventChordsElements
\figII
>>
Cheers,
Harm