Hi Michael, Fantastic solution! Thank you very much!
LilyPond is similar to Emacs: given my superficial understanding of both LilyPond and Elisp, quite often non-standard things are quite hard to nail down without help from experts, but most of them are possible! Thank you, Vlad On Fri, Oct 13, 2023 at 3:20 PM Michael Werner <reznae...@gmail.com> wrote: > Hi Vlad, > > On Fri, Oct 13, 2023 at 6:02 AM Volodymyr Prokopyuk < > volodymyrprokop...@gmail.com> wrote: > >> I'd like to create a *music function* for convenience to be used like \after >> 4. { \udTurn \sharp \natural } g=''2 a8 g f e | >> >> How do I create a music function for this purpose? I've tried the >> following with the *error* of unknown command \sharp >> >> udTurn = #(define-music-function (up down) (markup? markup?) >> #{ \markup \center-column { >> \raise #-1 \teeny #up >> \musicglyph "scripts.turn" >> \lower #-1 \teeny #down >> } #}) >> > > I got something that seems to work by switching from a music function to a > markup function. This code: > > \version "2.24.2" > > #(define-markup-command (udTurn layout props up down) (markup? markup?) > (interpret-markup layout props > #{ \markup { \center-column { > \raise #-1 \teeny #up > \musicglyph "scripts.turn" > \lower #-1 \teeny #down > } > } #} )) > > \new Score { > \new Staff { > \new Voice { > \after 4. ^\markup{ \udTurn \sharp \natural } > g''2 a8 g f e > \after 4. ^\markup{ \udTurn \flat \sharp } > g''2 a8 g f e > } > } > } > > is producing: > > [image: image.png] > > Might not be the best way to go about this, but it seems to be working as > described. Hopefully at least enough to get started with. > -- > Michael > >