M Sun <chris.cors...@gmail.com> 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

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to