lilypond-user
[Top][All Lists]
Advanced

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

Re: Small note between staves as time signature


From: Jakob Pedersen
Subject: Re: Small note between staves as time signature
Date: Thu, 11 May 2023 14:22:38 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Betterbird/102.11.0

Hi Juergen,

Works perfectly! Thank you very much.

I can guarantee you I would never have figured that out on my own!

If anyone has any idea what this kind of notation is called, do let me know :)

Best wishes,
Jakob

On 11.05.2023 12.59, juergen.gruen@xyz.de wrote:
Hello,

what about this:

%%%%%%%%%%%%%%%%
\version "2.24.0"

\language "deutsch"

%% based on https://www.mail-archive.com/lilypond-user@gnu.org/msg119983.html
center =
#(define-music-function (text x-off) (markup? number?)
   #{    
     \once \override Score.GridLine.stencil =
     #(lambda (grob)
        (let* ((stil (ly:grid-line-interface::print grob))
               (stil-y-ext (ly:stencil-extent stil Y))
               (thick (ly:grob-property grob 'thickness 0.1))
               (center ( / (+ (car stil-y-ext) (cdr stil-y-ext)) 2))

               (note
                (interpret-markup
                 (ly:grob-layout grob)
                 (ly:grob-alist-chain grob
                   (ly:output-def-lookup (ly:grob-layout grob) 'text-font-defaults))
                 text))

               (note-y-ext (ly:stencil-extent note Y))
               (height (interval-length (ly:stencil-extent note Y)))
               (y-off (- (- center (car note-y-ext)) ( / height 2))))

          (ly:stencil-translate note (cons x-off y-off))))
   #})


sig = \markup { \teeny \line { \note {2} #1 \note {4} #-1 } }

\score {
  \new PianoStaff <<
    \new Staff <<
      \key d \major
      \new Voice { \once \override Staff.TimeSignature. stencil = ##f \voiceOne d'4 \bar "|" }
      \new Voice { \voiceTwo \center \sig #-6.25 a4 }
    >>
    \new Staff <<
      \clef bass \key d \major
      \new Voice { \once \override Staff.TimeSignature. stencil = ##f \voiceOne fis4 }
      \new Voice { \voiceTwo d4 }
    >>
  >>
}

\layout {
  \context {
    \Score
    \consists "Grid_line_span_engraver"
    \override GridLine.stencil = ##f
  }
  \context {
    \Staff
    \consists "Grid_point_engraver"
    %% adjust the value if needed
    gridInterval = #(ly:make-moment 1/64)
  }
}
%%%%%%%%%%%%%%%%%%%%%

HTH, Juergen.




reply via email to

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