[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: hide and omit behaviour
From: |
Andrew Bernard |
Subject: |
Re: hide and omit behaviour |
Date: |
Mon, 07 Sep 2015 18:10:27 +1000 |
User-agent: |
Microsoft-MacOutlook/0.0.0.150807 |
Hi Joram,
Rather than trying to figure pushing and popping state from a notional stack, I
just do what you want with some simple functions. Crude but effective.
I have quickly adapted these three functions from ones I use to turn on or off
tuplet brackets and numbers at will. I think you get the idea. Does this help?
Andrew
% ====
\version "2.19.26"
% tuplet functions
tupletNumberOff = {
%\once \override TupletBracket.bracket-visibility = ##f
\once \override TupletNumber.stencil = #point-stencil
}
tupletNumberOffAll = {
%\override TupletBracket.bracket-visibility = ##f
\override TupletNumber.stencil = #point-stencil
}
tupletNumberOn = {
%\override TupletBracket.bracket-visibility = ##t
\revert TupletNumber.stencil
}
{
\tupletSpan 4
\tuplet 3/2 {
a8-"default" a a
\omit TupletNumber
a-"omit" a a
\undo \omit TupletNumber
a8-"undo" a a
\omit TupletNumber
a-"omit" a a
\once \undo \omit TupletNumber
a-"once undo" a a
a-"why not omitted again?" a a
}
r2
}
{
\tupletSpan 4
\tuplet 3/2 {
a8 a a
\tupletNumberOffAll
a a a
a8 a a
a a a
\tupletNumberOn
a a a
\tupletNumberOffAll
a a a
}
r2
}
% ====
On 7/09/2015 10:17, "Noeck" <address@hidden on behalf of address@hidden> wrote:
>Hi,
>
>I am trying to achieve this for triplets:
>The first triplet should show the number, the following not. In rare
>cases, I would like to force the triplet number again. I tried to do
>this with \omit TupletNumber, but there is one problem as this snippet
>shows:
>
>{
> \tupletSpan 4
> \tuplet 3/2 {
> a8-"default" a a
> \omit TupletNumber
> a-"omit" a a
> \undo \omit TupletNumber
> a8-"undo" a a
> \omit TupletNumber
> a-"omit" a a
> \once \undo \omit TupletNumber
> a-"once undo" a a
> a-"why not omitted again?" a a
> }
> r2
>}
>
>How can I achieve a "showTupletNumberOnce" like I tried with
>\once \undo \omit TupletNumber? Or is the only possibility to do \undo
>and then again \omit after wards?
>
>Thanks
>Joram
>
>_______________________________________________
>lilypond-user mailing list
>address@hidden
>https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: hide and omit behaviour,
Andrew Bernard <=