lilypond-devel
[Top][All Lists]
Advanced

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

Re: Issue 3918: Add \alternatingTimeSignatures (issue 97110045)


From: Paul Morris
Subject: Re: Issue 3918: Add \alternatingTimeSignatures (issue 97110045)
Date: Sat, 17 May 2014 11:43:38 -0700 (PDT)

David Kastrup wrote
> You mean with regard to patches?  Let's first figure out what we want to
> arrive at.  Personally, I'm not really enthused about any proposal
> including my own ones yet.  But maybe we can manage to find something
> making most people happier yet.

I like the idea of something like \appearance and working out a general
solution. Some suggestions for a verb name: \replace, \redraw  (I like how
redraw emphasizes the visual aspect.)

As a first step (just working with \override X.X.stencil =) could there be
an easier way to just override a stencil with a markup (that gets converted
into a stencil)?  Ideally without leaving LilyPond syntax?  Then you could
do something like this:

\override Score.TimeSignature.stencil = 
  \markup \fraction-list "-" #'((6 8)(5 4))

Maybe LilyPond could automatically convert a markup into a stencil for you
in this case?  (Maybe that's a bad idea since it would obscure the
difference between markups and stencils?)  Or if you could manually convert
the markup to a stencil with something like:

\override Score.TimeSignature.stencil = 
  \markupToStencil \markup \fraction-list "-" #'((6 8)(5 4))

When overriding a stencil the grob is passed as an argument without the user
having to manually supply it, so that may be useful.  Below is my humble
attempt in this direction, for what it's worth.

Cheers,
-Paul


\version "2.18.2"

#(define (markupToStencil mrkp)
   (lambda (grob)
     (grob-interpret-markup grob mrkp)))

{
  \override Score.TimeSignature.stencil =
  #(lambda (grob)
     (grob-interpret-markup
      grob
      #{ \markup "11" #}))
  c'1

  \override Score.TimeSignature.stencil =
  #(markupToStencil #{ \markup "22" #})
  \time 2/4
  c'2

  %{
  % the following doesn't work though:
  % error: markup outside of text script or \lyricmode
  % This object should be a markup: #<Grob TimeSignature >

  \override Staff.TimeSignature.stencil =
  \markupToStencil \markup "33"
  \time 2/4
  c2
  %}
}



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Re-Issue-3918-Add-alternatingTimeSignatures-issue-97110045-tp162462p162515.html
Sent from the Dev mailing list archive at Nabble.com.



reply via email to

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