Am 07.12.18 um 11:07 schrieb Urs Liska:

Am 07.12.18 um 10:55 schrieb mansouraoun:
i wrote the code in raw and it's somehow not displayed in my message
Here it is

dynx =
#(define-music-function
      (parser location X-offset)
      (number?)
    #{
      \once\override DynamicText.X-offset = #X-offset
    #})

Mansour

As David said: if you use the development version (currently 2.19.82) you can simplify this by skipping "parser location":

  ...
  #(define-music-function (X-offset)(number?)
  ...


And while we're at it:

As David also pointed out, the *naming* of such variables is arbitrary, it's just their order/position. "parser" and "location" are arguments that the LilyPond parser (in 2.18) *implicitly* passes to a music function because *sometimes* a music function has the need to access either the current LilyPond parser or the "location" (the place in the input file from where the function was called). But since the vast majority of functions does *not* need them it is needlessly verbose having to write them for each and every music function. So two procedures, *parser* and *location* were at some point added to LilyPond that can be called from within a music function, if it should actually need one of these values (to *invoke* a procedure it has to be enclosed in parentheses like

  (display (*location*))

For the function you are currently interested in this is of absolutely no interest, but I thought to point it out since you were irritated by the function arguments in the first place, so it may be interesting to know.

Best
Urs


Urs


_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to