lilypond-user
[Top][All Lists]
Advanced

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

Re: Macro or abbreviation


From: David Kastrup
Subject: Re: Macro or abbreviation
Date: Sun, 09 Aug 2015 11:54:11 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Andrew Bernard <address@hidden> writes:

> Hello Ponderers,
>
> It seems the topic of macros and abbreviations in lilypond source
> comes up from time to time and engenders all sorts of complex debate,
> so I am slightly wary of asking this question.
>
> I need to say:
>
> \tweak Accidental.stencil ##f

Well, it's the same as

\single \omit Accidental

which is not really shorter but more idiomatic.  The point to note is
that either way this phrase is not complete without a following music
expression with which it will then form a new, tweaked music expression.

> in a very large number of chords, and often several times in one chord
> in my current large and complex score. The score is becoming cluttered
> with this repeated command, and it’s quite a lot of typing when you
> have so many to type. I naively tried to make this an event function,
> but that does not work inside a chord.

Please, please, please _always_ back up any such statements by including
a minimal example that you would have expected to work.  Event functions
work perfectly well inside of a chord.  They are however near useless
for tweaking accidentals either in- or outside of chords since
accidentals don't, as a rule, occur in post-events (one rather obscure
exception being pitched trills).

And tweaks _also_ work perfectly well inside of a chord.  So it is not
clear just what problem you were experiencing here.

> [As an aside, it’s not a matter of changing the accidental style in
> use, dodecaphonic. I need to turn off selected accidentals in the
> dodecaphonic style when I join notes using a custom grace note slur
> function I have, that does not behave the same way as ‘proper’ slurs
> do.]

A more "correct" fix might be to teach LilyPond about your "custom grace
note slur" actually being a slur.  That might be preferable to applying
tweaks everywhere, even with a simpler way of doing the tweaks (there
are several other replies already covering that angle exhaustively).

It might be more technically involved but would likely keep your source
code cleaner and the MIDI matching the intent.

But this would actually require an example of what you are trying to do
with what code.

-- 
David Kastrup



reply via email to

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