lilypond-user
[Top][All Lists]
Advanced

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

Re: Simple scheme function


From: Павел Буданов
Subject: Re: Simple scheme function
Date: Thu, 2 Apr 2020 09:12:55 +0300

Amazing, thank you!

чт, 2 апр. 2020 г. в 01:12, Aaron Hill <address@hidden>:
On 2020-04-01 3:04 pm, Павел Буданов wrote:
> Hello, I'm newbie in scheme. I want to write simple function to
> octavize
> melody, but something doesn't works...
>
>
> \version "2.20.0"
> octavize = #(define-music-function
>     (parser location music) (ly:music?)
>     #{ << #music \transpose c c' #music >> #})
>
> music = { c' d' e' f' }
>
> \markup "Need:"
> \new Voice { << \music \transpose c c' \music >> }
> \markup "Got:"
> \new Voice { \octavize \music }

This is a case where the $ is needed over #.  The \transpose ... #music
is changing the value which affects both usage of #music.  Using $music
in place of either (or both) #music should fix the issue.

Also, parser and location are no longer required to be specified as
arguments, so you can shorten up the function definition a bit.


-- Aaron Hill


reply via email to

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