lilypond-user
[Top][All Lists]
Advanced

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

Custom dynamic function


From: foxfanfare
Subject: Custom dynamic function
Date: Tue, 17 Dec 2019 07:43:00 -0700 (MST)

Hi all,

I am trying to make a shortcut which could easily create dynamic texts
without having the necessity to create a specific variable each time. Here
is my attempt :

---

\version "2.19.82"

dynI =
  #(make-dynamic-script
    (markup #:line (#:left-align
        #:normal-text "this is a long text")))

dynII =
  \tweak DynamicText.self-alignment-X #-1
  #(make-dynamic-script
    (markup #:line (#:left-align
        #:normal-text "this is a long text")))

dynIII =
  #(define-music-function (mymarkup) (markup?)
    (make-dynamic-script
      (markup #:line (#:left-align
          #:normal-text mymarkup))))

<<
  \relative c'' {
    c1\dynI
  }
  \relative c'' {
    c1\dynII
  }
  \relative c'' {
    c1-\dynIII "this is a long text"
  }
>>

\paper {
  #(set-paper-size "a6")
}

----
dynamic.pdf <http://lilypond.1069038.n5.nabble.com/file/t5604/dynamic.pdf>  

The problem I have is that Dynamics are always centered (as shown in the
first example). It needs a tweak of the self-alignment-X as show with my
second example. In my third example, I was able to create the correct
function but I can't find where to include the self-alignment-X to solve the
placement issue.

Does someone has any idea?



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html



reply via email to

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