Re: Patch to fix centering of some bass figures on whole notes and longer.

2017-07-13 Thread Richard Shann
On Thu, 2017-07-13 at 15:07 +0200, David Kastrup wrote:
> Richard Shann  writes:
> 
> > On Thu, 2017-07-13 at 12:47 +0100, James wrote:
> >> > I am not top posting
> >> 
> >> This 'patch' does not apply to current master so I could not test it
> >> even if I wanted to
> >
> > Ah, yes, sorry, I looked into what parameters git uses for its diff but
> > didn't think about the directory you would want to run patch from.
> > I've made a git clone of the repository and used git diff now to get the
> > attached patch.
> 
> That doesn't help much I think.  Create an actual commit with commit
> message, then format that using
> 
> git format-patch HEAD~1

ah, ok. That gives the attached.

Richard

From 336daa273929815ecb4b6e1a2be5a56f743b1181 Mon Sep 17 00:00:00 2001
From: Richard Shann 
Date: Thu, 13 Jul 2017 14:00:48 +0100
Subject: [PATCH] Fix centering of single figures and lone accidentals when
 occurring on whole notes and longer durations

---
 scm/translation-functions.scm | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/scm/translation-functions.scm b/scm/translation-functions.scm
index 0ed0def..cd78d83 100644
--- a/scm/translation-functions.scm
+++ b/scm/translation-functions.scm
@@ -184,13 +184,10 @@ way the transposition number is displayed."
   (set! alt-markup #f)))
 
 
-;; hmm, how to get figures centered between note, and
-;; lone accidentals too?
-
-;;(if (markup? fig-markup)
-;;  (set!
-;;   fig-markup (markup #:translate (cons 1.0 0)
-;;  #:center-align fig-markup)))
+(if (and (>= 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
-- 
2.1.4

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Patch to fix centering of some bass figures on whole notes and longer.

2017-07-13 Thread David Kastrup
Richard Shann  writes:

> On Thu, 2017-07-13 at 12:47 +0100, James wrote:
>> > I am not top posting
>> 
>> This 'patch' does not apply to current master so I could not test it
>> even if I wanted to
>
> Ah, yes, sorry, I looked into what parameters git uses for its diff but
> didn't think about the directory you would want to run patch from.
> I've made a git clone of the repository and used git diff now to get the
> attached patch.

That doesn't help much I think.  Create an actual commit with commit
message, then format that using

git format-patch HEAD~1

or similar.

-- 
David Kastrup

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Patch to fix centering of some bass figures on whole notes and longer.

2017-07-13 Thread Richard Shann
On Thu, 2017-07-13 at 12:47 +0100, James wrote:
> > I am not top posting
> 
> This 'patch' does not apply to current master so I could not test it
> even if I wanted to

Ah, yes, sorry, I looked into what parameters git uses for its diff but
didn't think about the directory you would want to run patch from.
I've made a git clone of the repository and used git diff now to get the
attached patch.

Richard

diff --git a/scm/translation-functions.scm b/scm/translation-functions.scm
index 0ed0def..cd78d83 100644
--- a/scm/translation-functions.scm
+++ b/scm/translation-functions.scm
@@ -184,13 +184,10 @@ way the transposition number is displayed."
   (set! alt-markup #f)))
 
 
-;; hmm, how to get figures centered between note, and
-;; lone accidentals too?
-
-;;(if (markup? fig-markup)
-;;  (set!
-;;   fig-markup (markup #:translate (cons 1.0 0)
-;;  #:center-align fig-markup)))
+(if (and (>= 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
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Patch to fix centering of some bass figures on whole notes and longer.

2017-07-09 Thread Richard Shann
On Sun, 2017-07-09 at 18:46 +0200, David Kastrup wrote:
> Richard Shann  writes:
> 
> > Simon Albrecht suggested I start a new thread for this (apologies for
> > any confusion)
> >
> > Attached is a patch that fixes the centering of single bass figures over
> > notes of duration whole note and more. The duration is tested and a
> > translate applied horizontally if needed.
> 
> Except that the "centering" or not decision then rests on the duration
> of the bass figure rather than any properties of the note column in
> question.
> 
> I think it isn't uncommon to have bass lines where there isn't one
> figure per bass note but there are also intermediate notes without
> figure.

Indeed, there are frequently notes without figures (more often than not
in fact) and there are also multiple figures per note, and figures on
rests. Not sure what any of that has to do with this.

In the current LilyPond the figures are centered (visually speaking - I
don't know how they relate to internals such as note column) for
durations greater than 0 but too far to the left for the others (always
referring here to the case of a single figures on a note).

Richard





___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Patch to fix centering of some bass figures on whole notes and longer.

2017-07-09 Thread David Kastrup
Richard Shann  writes:

> Simon Albrecht suggested I start a new thread for this (apologies for
> any confusion)
>
> Attached is a patch that fixes the centering of single bass figures over
> notes of duration whole note and more. The duration is tested and a
> translate applied horizontally if needed.

Except that the "centering" or not decision then rests on the duration
of the bass figure rather than any properties of the note column in
question.

I think it isn't uncommon to have bass lines where there isn't one
figure per bass note but there are also intermediate notes without
figure.

-- 
David Kastrup

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel