lilypond-user
[Top][All Lists]
Advanced

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

Re: lilypond function aliases


From: Gianmaria Lari
Subject: Re: lilypond function aliases
Date: Thu, 4 Apr 2019 12:52:26 +0200



On Thu, 4 Apr 2019 at 11:28, Gianmaria Lari <address@hidden> wrote:
Is this the correct way to create a function alias in lilypond or there is a shorter/better way?

\version "2.21.0"
extremelyLongNameFunction  =
#(define-music-function (music) (ly:music?)
   (let ((varOne #{ a b b a #}))
     #{
       $varOne $music $varOne
     #}))

alias = 
#(define-music-function (music) (ly:music?)   
   #{
     \extremelyLongNameFunction $music
   #})

\alias {a}

Thank you, g.

Apologies, in my previous mail before sending it I make a small change in the code and didn't test it. So I introduced an error: "alias" is a reserved word. So here it is the previous code corrected (I highlighted the relevant change):

\version "2.21.0"
extremelyLongNameFunction  =
#(define-music-function (music) (ly:music?)
   (let ((varOne #{ a b b a #}))
     #{
       $varOne $music $varOne
     #}))

short
#(define-music-function (music) (ly:music?)   
   #{
     \extremelyLongNameFunction $music
   #})

\short {c c c c}

Best regards, g.


 

reply via email to

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