lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Key Signature Bug in 2.24.0,Re: Key Signature Bug in 2.24.0


From: nitram45
Subject: Re: Key Signature Bug in 2.24.0,Re: Key Signature Bug in 2.24.0
Date: Fri, 13 Jan 2023 19:30:29 +0000

I was talking about the first note of each measures after the Key Signature.
But you were right, it is the default spacing.

About the distance between different accidentals, consider the example
bellow. You can see a difference between the "Reference staff" and number
"C" in the "Corrected Output". It looks like an extra space has been added
between the key cancellation and the new one.

---

\version "2.24.0"

music = \relative c'' {
  \key a\major
  a4 4 4 4
  \key es\major
  g4 4 4 4
  \key b\major
  fis4 4 4 4
  \key f\minor
  f4 4 4 4
}

musicCorrected = {
  \override Staff.KeyCancellation.break-align-symbol = #'key-signature
  \override Staff.KeySignature.X-offset =
    #(lambda (grob)
       (let* ((parent (ly:grob-parent grob X))
              (elts (ly:grob-object parent 'elements))
              (can (find (lambda (g)
                           (and (grob::has-interface g 
'key-cancellation-interface)
                                (eq? (ly:grob-object g 'staff-symbol)
                                     (ly:grob-object grob 'staff-symbol))))
                         (ly:grob-array->list elts))))
         (when can
           (ly:grob-translate-axis!
            grob
            (+ (- (interval-end (ly:grob-extent can parent X))
                  (ly:grob-relative-coordinate grob parent X))
               0.7)
            X))))
  \music
}

\markup \huge "Reference"

\new Staff \music

\markup \huge "Default Output"

\new StaffGroup <<
  \new Staff \with {
    instrumentName = "A"
  }
  \transpose c a {
    \music
  }
  \new Staff \with {
    instrumentName = "B"
  }
  \transpose c g {
    \music
  }
  \new Staff \with {
    instrumentName = "C"
  }
    \music
>>

\markup \huge "Corrected output with still some differences"

\new StaffGroup <<

  \new Staff \with {
    instrumentName = "A"
  }
  \transpose c a {
    \musicCorrected
  }
  \new Staff \with {
    instrumentName = "B"
  }
  \transpose c g {
    \musicCorrected
  }
  \new Staff \with {
    instrumentName = "C"
  }
    \musicCorrected
>>

Le vendredi 13 janvier 2023 à 09:39, David Wright a écrit :
> On Fri 13 Jan 2023 at 11:58:42 (+0000), nitram45@posteo.net wrote:
> > Yes it is better, thank you for your fast reply. But several problems are
> > still there in my opinion:
> > 
> > - The first note of the measure doesn't align with the last accidental and
> >   is still too far.
> 
> None of the first notes in any measure has an accidental, so I'm
> not sure what you mean.
> 
> If, by the last accidental, you mean the last symbol in the key
> signature, then you certainly shouldn't place the first note in the
> measure too close to the key signature.
> 
> > - I don't understand why the distance between different accidentals is
> >   wider (for instance between a natural and a sharp, or between a natural
> >   and a flat).
> 
> Can you be specific about which symbols you're referring to: can you
> give the staff and measure number for the ones you're comparing.
> 
> > Le vendredi 13 janvier 2023 à 12:02, Jean Abou Samra a écrit :
> > > Le 13/01/2023 à 10:16, Werner LEMBERG a écrit :
> > > > > > I just discovered this huge bug in the recent release of 2.24.0
> > > > > > which wasn't in the previous version.
> > > > > What previous version did you test this with? For me, the output is
> > > > > the same in 2.22 and in 2.18.2.
> > > > Regardless of that, it is indeed a severe bug: No need to ever align
> > > > key signatures vertically, AFAIK.  Simply left-align them.
> > > 
> > > 
> > > Do you mean like this, or something else?
> > > 
> > > (NB this is unreliable code, I was surprised that it even works)
> > > 
> > > \version "2.24.0"
> > > 
> > > music = \relative c' {
> > >   \override Staff.KeyCancellation.break-align-symbol = #'key-signature
> > >   \override Staff.KeySignature.X-offset =
> > >     #(lambda (grob)
> > >        (let* ((parent (ly:grob-parent grob X))
> > >               (elts (ly:grob-object parent 'elements))
> > >               (can (find (lambda (g)
> > >                            (and (grob::has-interface g
> > > 'key-cancellation-interface)
> > >                                 (eq? (ly:grob-object g 'staff-symbol)
> > >                                      (ly:grob-object grob 
> > > 'staff-symbol))))
> > >                          (ly:grob-array->list elts))))
> > >          (when can
> > >            (ly:grob-translate-axis!
> > >             grob
> > >             (+ (- (interval-end (ly:grob-extent can parent X))
> > >                   (ly:grob-relative-coordinate grob parent X))
> > >                0.7)
> > >             X))))
> > >   \key es\major
> > >   c d e f
> > >   \key c\major
> > >   c d e f
> > >   \key as\major
> > >   c d e f
> > >   \key bes\major
> > >   c d e f
> > > }
> > > 
> > > \new StaffGroup <<
> > >   \transpose c a {
> > >     \music
> > >   }
> > >   \new Staff
> > >   \transpose c g {
> > >     \music
> > >   }
> > >   \new Staff
> > >     \music
> > > >>
> 
> Cheers,
> David.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]