lilypond-user
[Top][All Lists]
Advanced

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

Re: Position chromatic notes in 1/3 note head size instead of 1/2


From: Valentin Petzel
Subject: Re: Position chromatic notes in 1/3 note head size instead of 1/2
Date: Wed, 02 Mar 2022 20:23:56 +0100

Have you tried something like this?

\new Staff \with {
  \override NoteHead.Y-offset =
  #(grob-transformer 'Y-offset
     (lambda (grob orig)
       (let* ((cause (ly:grob-property grob 'cause))
              (pitch (ly:event-property cause 'pitch))
              (st (ly:pitch-alteration pitch))
              (offset (* 2/3 st)))
         (+ orig offset))))
}
\relative c' {
  c4 cis d dis e eis f fis g gis a ais b bis c
}

Am Mittwoch, 2. März 2022, 19:36:22 CET schrieb Robert Mengual:
> Hello Valentin,
> 
> By increasing the distance between lines it fits, yes, but that is not how
> this music notation was specified. They specify 1/3 notehead size vertical
> distance between chromatic notes.
> 
> My staff, for example, is defined as follows:
> \layout { \context {
>   \Staff
>   \override StaffSymbol.line-positions = #'(-5.67 -2.33 2.33 5.67)
> }}
> So no integer number in staffLineLayoutFunction will allow me to match my
> lines with the noteheads. This is why I think it would make sense to allow
> passing decimal numbers to staffLineLayoutFunction.
> 
> As an alternative, I tried setting manually NoteHead.Y-offset to decimals,
> but then I have the problem that the note position should be different
> depending on the clef...
> 
> Robert
> 
> ________________________________
> De: Valentin Petzel
> Enviado: Miércoles, 02 de Marzo de 2022 19:16
> Para: lilypond-user@gnu.org; Robert Mengual
> Asunto: Re: Position chromatic notes in 1/3 note head size instead of 1/2
> 
> Hello Robert,
> 
> mathematically 1/3 instead of 1/2 means 50% more, this 3*1.4 = 4.5 notes
> should fit.
> 
> But the same thing should be doable by simply increasing the distance
> between lines, like this:
> 
> <<
> \new NoteNames { c d e f g a b c d e f g a }
> \new Staff \with {
>     \override StaffSymbol.line-positions = #'(-6 -3 0 3 6)
> } \relative c' {
>   c d e f g a b c d e f g a
> }
> 
> Am Mittwoch, 2. März 2022, 19:06:33 CET schrieb Robert Mengual:
> > Hello Valentin, thanks for the response.
> > 
> > That's not really what I want, instead of defining a new Staff (which I
> > already did btw) I want to position the notes so that more noteheads fit
> > in
> > the same height.
> > 
> > For example, let's take the height starting from the e bar to the b bar in
> > treble. In the traditional notation, only three noteheads fit between this
> > height (f g a). In this new notation, 4 noteheads should fit because the
> > vertical distance between notes is 1/3 instead of 1/2.
> > 
> > I hope I made things clearer,
> > 
> > Robert
> > 
> > ________________________________
> > De: Valentin Petzel
> > Enviado: Miércoles, 02 de Marzo de 2022 18:49
> > Para: lilypond-user@gnu.org
> > CC: Robert Mengual
> > Asunto: Re: Position chromatic notes in 1/3 note head size instead of 1/2
> > 
> > Hello Robert,
> > 
> > I’m not exactly sure what you want to do. If you want to achieve the
> > results from the screenshot maybe using StaffSymbol.line-positions is
> > what you want.
> > 
> > Cheers,
> > Valentin
> > 
> > Am Mittwoch, 2. März 2022, 18:22:25 CET schrieb Robert Mengual:
> > > Hello everyone,
> > > 
> > > I am trying to position the notes of my custom music notation as in the
> > > screenshot.
> > > 
> > > I tried using a custom callback for staffLineLayoutFunction. I thought
> > > it
> > > was going to be enough, but it won't allow decimal numbers.
> > > 
> > > Does anybody have any idea how I can implement this behaviour? Find
> > > attached a Tiny.ly as well.
> > > 
> > > Robert

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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