lilypond-user
[Top][All Lists]
Advanced

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

Re: How to define a turn with two accidentals


From: Volodymyr Prokopyuk
Subject: Re: How to define a turn with two accidentals
Date: Fri, 13 Oct 2023 16:31:41 +0200

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 <reznaeous@gmail.com> wrote:
Hi Vlad, 

On Fri, Oct 13, 2023 at 6:02 AM Volodymyr Prokopyuk <volodymyrprokopyuk@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.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


reply via email to

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