lilypond-user
[Top][All Lists]
Advanced

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

Re: Curve in a macro?


From: David Kastrup
Subject: Re: Curve in a macro?
Date: Sat, 16 Sep 2017 09:10:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

M Sun <address@hidden> writes:

> Hi list,
>
> If I have a note and a curve like this:
>
>   b8-\tweak control-points #'((0.5 . 4) (1 . 6) (2 . 6) (2.5 . 4)) ( <> )
>
> How can I make the curve into a macro, so that I can write "b8 \curve"
> or "\curve b8"?

It's a bad idea to turn this into a single macro/command since such a
command does not "scale": you cannot possibly use it anywhere than as
the last part of an expression and before the next expression, and
that's only possible once since the result is a sequential expression no
longer able to accept an articulation, certainly not so for its _first_
element.

Current master (to become 2.21.0) can combine stuff without using Scheme
so you could write

\version "2.21.0"
curve =
#(define-music-function (arg) (ly:music?)
  #{ #arg \tweak control-points #'((0.5 . 4) (1 . 6) (2 . 6) (2.5 . 4))
      ( <> ) #})

and it would work as intended for \curve b8 .  However, it would be a
lousy user interface exactly because you could never combine it with a
second, similar command or expression: when trying to do that, the
second articulation would attach itself to the <> rather than the b8 .

So while 2.21.0 will be able to execute this as desired, the desire is
still imprudent.

-- 
David Kastrup



reply via email to

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