lilypond-user
[Top][All Lists]
Advanced

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

Re: using \pushToTag and \removeWithTag consecutively


From: David Kastrup
Subject: Re: using \pushToTag and \removeWithTag consecutively
Date: Sat, 14 Apr 2018 15:42:33 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Gianmaria Lari <address@hidden> writes:

> On 14 April 2018 at 15:15, David Kastrup <address@hidden> wrote:
>
>> Gianmaria Lari <address@hidden> writes:
>>
>> > I don't understand the behaviour of this code:
>> >
>> > \version "2.19.81"
>> > var = {a \tag #'here {b} a}
>> > {\var} %Result: a b a
>> > {\removeWithTag #'here \var}  %Result: a a
>> > {\pushToTag #'here b! \removeWithTag #'here \var}  %Result: a a ;
>> Expected:
>> > a b! a
>> >
>> >
>> > The result is:
>> >
>> > a b a - ok!
>> > a a - ok!
>> > a a - not ok; shouldn't be "a b! a" ??
>>
>> \removeWithTag removes the tagged expression.  Which includes the tag
>> itself.
>>
>
> This was what I was afraid of :)
>
> Any idea how I can obtain the same effect? I would like to be able to
> substitute a note in a variable with another one.
> Of course I could use "\pushToTag ... noteA" when I need noteA and  
> "\pushToTag
> ... noteB" when i need noteB but I would like that my variable make sense
> also when I don't use \pushToTag command.
> Thank you, g.

Use two tags.

{\pushToTag #'here b! \removeWithTag #'there \var}

-- 
David Kastrup



reply via email to

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