[Top][All Lists]

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

Re: automatic "note-as-denominator" time signatures?

From: Reinhold Kainhofer
Subject: Re: automatic "note-as-denominator" time signatures?
Date: Thu, 29 Oct 2009 00:40:00 +0100
User-agent: KMail/1.12.2 (Linux/2.6.31-14-generic; KDE/4.3.2; i686; ; )

Hash: SHA1

Am Mittwoch, 28. Oktober 2009 20:40:05 schrieb Carl Sorensen:
> On 10/28/09 12:33 PM, "Kieren MacMillan" <address@hidden>
> wrote:
> > Hi all,
> >
> > Can the snippet
> >
> >    <>
> >
> > be made into an automatic callback, instead of requiring the creation
> > of a markup each time? i.e., I would love to be able to say something
> >    \override TimeSignature #'denominator-style = #'note
> >
> > and have all denominators be output as notes (rather than numbers).
> Yes, it can.  Right now the only thing stopping from being automatic is
> the hardcoded 3 and 2 in tsMarkup.
> The challenge is that you need to have a context in order to return (as
> opposed to setting) the timeSignatureFraction, so you'd need to make a
>  music function that returned context-spec-music in order to get the
>  context -- that's somewhat tricky.  
> a new style could be added (either to the c++ or to a new scheme file that
> implements all of the current time signatures) -- note-denominator
> Then you'd do
> \override TimeSignature #'style=#'note-denominator.

It's way simpler: Simply write your own stencil function, which gets the 
TimeSignature grob when evaluated. You can use the 'fraction grob-property and 
create the desired stencil from that fraction... All you have to do is to 
override the TimeSignature #'stencil with your own function and you are done. 
Example is attached (and uploaded to the LSR: ).

Of course, any approach based on the \time signature will never be able to 
format e.g. 6/8 as 2/(dotted quarter), etc.


- -- 
- ------------------------------------------------------------------
Reinhold Kainhofer, address@hidden,
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 *, DVR: 0005886
 * LilyPond, Music typesetting,
Version: GnuPG v1.4.9 (GNU/Linux)


Description: Text Data

reply via email to

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