[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: vertical spacer in figured bass
From: |
Richard Shann |
Subject: |
Re: vertical spacer in figured bass |
Date: |
Fri, 23 Jun 2017 13:46:51 +0100 |
On Fri, 2017-06-23 at 14:31 +0200, N. Andrew Walsh wrote:
> Hi Richard,
>
>
> when I tried that implicitBassFigures declaration, it just printed a
> zero. But! If I drop the "Staff." part of that declaration, then it
> works. I'm not sure if that's going to have consequences later on, but
> I'll try it and see how it goes.
>
>
> Now I have another matter, somewhat more OCD: when dealing with the
> figures:
>
>
> < 4 2 7 >4 < _+ 0\! 8 >
>
>
> the # sign is set slightly lower than the 4, and thus the 8 is set
> lower than the 7. That is, they don't appear to have the same
> baseline, and it looks like bad typesetting. Is there a way to fix
> this so they align perfectly?
I fixed this recently (and the alignment of the figures which aren't
centered on whole notes, breves etc). It's on the mailing list a month
or so ago, or you can fish the relevant code out of this sample from
Denemo ( it's the
#(define-public (format-bass-figures figure event context)
and
figuredBassFormatter = #format-bass-figures
bits)
I suggested this would be good to put directly in the LilyPond code base
as it is just straight forward bug fixes as far as I can see.
HTH
Richard
8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
%% LilyPond file generated by Denemo version 2.1.3
%%http://www.gnu.org/software/denemo/
\version "2.18.0"
CompactChordSymbols = {}
#(define DenemoTransposeStep 0)
#(define DenemoTransposeAccidental 0)
DenemoGlobalTranspose = #(define-music-function (parser location
arg)(ly:music?) #{\transpose c c#arg #})
titledPiece = {}
AutoBarline = {}
AutoEndMovementBarline = \bar "|."
% The music follows
MvmntIVoiceI = {
a'4 a' d'' \AutoEndMovementBarline
}
MvmntIVoiceIBassFiguresLine = \figuremode {
\set figuredBassAlterationDirection = #1
\set figuredBassPlusDirection = #1
\override FiguredBass.BassFigure #'font-size = #-1
%figures follow
\set Staff.implicitBassFigures = #'(0)
\bassFigureExtendersOff <4 2 8>4<3 0\! 7>4
\bassFigureExtendersOn <3 0\! 7>4
}
%Default Score Layout
\header{DenemoLayoutName = "Default Score Layout"
instrumentation = \markup { \with-url
#'"scheme:(d-BookInstrumentation)" "Full Score"}
}
\header {
tagline = \markup
{"/home/rshann/git-denemo/denemo/examples/FiguredBassExtender.denemo" on
\simple #(strftime "%x" (localtime (current-time)))}
}
#(define-public (format-bass-figures figure event context)
(let* ((fig (ly:event-property event 'figure))
(fig-markup (if (number? figure)
;; this is not very elegant, but center-aligning
;; all digits is problematic with other markups,
;; and shows problems in the (lack of) overshoot
;; of feta-alphabet glyphs.
((if (<= 10 figure)
(lambda (y) (make-translate-scaled-markup
(cons -0.7 0) y))
identity)
(cond
((eq? #t (ly:event-property event 'diminished))
(markup #:slashed-digit figure))
((eq? #t (ly:event-property event 'augmented-slash))
(markup #:backslashed-digit figure))
(else (markup #:number (number->string figure 10)))))
#f))
(alt (ly:event-property event 'alteration))
(alt-markup
(if (number? alt)
(markup
#:general-align Y DOWN #:fontsize
(if (not (= alt DOUBLE-SHARP))
;-2 2 ;; is the default
(if (not fig-markup) 0 -2) 4 ;; changed
)
(alteration->text-accidental-markup alt))
#f))
(plus-markup (if (eq? #t (ly:event-property event 'augmented))
(markup #:number "+")
#f))
(alt-dir (ly:context-property context 'figuredBassAlterationDirection))
(plus-dir (ly:context-property context 'figuredBassPlusDirection)))
(if (and (not fig-markup) alt-markup)
(begin
(set! fig-markup (markup #:left-align #:pad-around 0.3 alt-markup))
(set! alt-markup #f)))
(if (and (eqv? 0 (ly:duration-log (ly:event-property event 'duration)))
(markup? fig-markup))
(set!
fig-markup (markup #:translate (cons 1.0 0)
#:center-align fig-markup)))
(if alt-markup
(set! fig-markup
(markup #:put-adjacent
X (if (number? alt-dir)
alt-dir
LEFT)
fig-markup
#:pad-x 0.2 #:raise (if (= alt FLAT) 0.1 -0.1)
alt-markup))) ;changed
(if plus-markup
(set! fig-markup
(if fig-markup
(markup #:put-adjacent
X (if (number? plus-dir)
plus-dir
LEFT)
fig-markup
#:pad-x 0.2 plus-markup)
plus-markup)))
(if (markup? fig-markup)
(markup #:fontsize -2 fig-markup)
empty-markup)))
\layout {
\context {
\Score
figuredBassFormatter = #format-bass-figures
}
} #(set-default-paper-size "a4")
#(set-global-staff-size 18)
\paper {
}
\score { %Start of Movement
<<
%Start of Staff
\new Staff = "Part 1" <<
\context Staff \with {implicitBassFigures = #'(0) }
\MvmntIVoiceIBassFiguresLine %End of bass figures
\new Voice = "MvmntIVoiceI" {
\clef treble \key c \major \time 4/4 \MvmntIVoiceI
} %End of voice
>> %End of Staff
>>
} %End of Movement
8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
>
>
> Cheers,
>
>
> A
>
> On Fri, Jun 23, 2017 at 1:17 PM, Richard Shann
> <address@hidden> wrote:
> On Fri, 2017-06-23 at 13:06 +0200, N. Andrew Walsh wrote:
> > Richard, if I can dissect the Denomo code a bit (there's a
> lot of it!
> > ), it looks like I need both the
>
> > \context Staff \with {implicitBassFigures = #'(0) }
> > expression in the \score block, and the
> > \set Staff.implicitBassFigures = #'(0)
> > expression in the music content. Is that correct?
>
> I noticed that too, and assumed one of them was most probably
> redundant
> - I did write this syntax, but I'm afraid I can't say how I
> arrived at
> it, some sort of trial and error almost certainly.
>
> > doing just the latter didn't work, but now I'm unsure how to
> proceed.
>
> Is it doing what you wanted? I cooked up the example from the
> documentation that Mark quoted, because I knew about this
> trick of
> declaring a special figure (I use 0 since that doesn't occur
> for real in
> a figured bass) that just acts as a place holder. So then I
> used that
> and the \! notation for stopping the extender and it worked
> (for what I
> thought was your object).
> I entered this
>
> <3 0\! 7>4
>
> with the idea that the figure 0 would keep that position open
> as a blank
> figure while not causing an extender from it.
>
> I think the repeated \bassFigureExtendersOff and On would be
> done in
> some neater way if you were hand-writing the code ...
>
> HTH
>
> Richard
>
>
>
>
>
- vertical spacer in figured bass, N. Andrew Walsh, 2017/06/22
- RE: vertical spacer in figured bass, Mark Stephen Mrotek, 2017/06/22
- Re: vertical spacer in figured bass, Urs Liska, 2017/06/23
- Re: vertical spacer in figured bass, Richard Shann, 2017/06/23
- Re: vertical spacer in figured bass, Kieren MacMillan, 2017/06/24
- Re: vertical spacer in figured bass, Richard Shann, 2017/06/24