[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Function for multiple tweaks
From: |
David Kastrup |
Subject: |
Re: Function for multiple tweaks |
Date: |
Thu, 24 Jan 2019 14:08:30 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
David Kastrup <address@hidden> writes:
> Andrew Bernard <address@hidden> writes:
>
>> I have many chords where a note is a harmonic. I use the following for the
>> note inside the chord:
>>
>> \tweak NoteHead.stencil #ly:text-interface::print
>> \tweak NoteHead.font-size #1
>> \tweak NoteHead.text #(markup #:musicglyph "noteheads.s0mi")
>>
>> How can I make this into what I am tempted to call a macro (I know that is
>> not lilypond terminology)?
>>
>> I have always been confused about the dash '-' used with tweak, and when to
>> use it and when not to.
>
> When in doubt, always when tweaking a post-event (which gets written
> after a note). It tells LilyPond that the context of the expression is,
> well, a post-event. Sometimes LilyPond can figure it out on its own
> depending on what the expression is used for, sometimes it doesn't
> matter. But relying on either just makes your code less readable to you
> and others.
>
>> I am aware this is Dumb Question of the week, but something is stopping me
>> seeing the answer.
>
> Do not ever use { } except for enclosing sequential music or markup
> lists. Braces have meaning. With reasonably recent 2.19, you could
> just write
>
> harmonicNote =
> -\tweak NoteHead.stencil #ly:text-interface::print
> -\tweak NoteHead.font-size #1
> -\tweak NoteHead.text #(markup #:musicglyph "noteheads.s0mi")
> \etc
>
> Verbatim.
BZZZZZZZZZT, wrong. Because you are not tweaking a post-event here but
a regular note event. So indeed, just write \tweak \tweak \tweak rather
than -\tweak -\tweak -\tweak in _this_ case.
--
David Kastrup