lilypond-user
[Top][All Lists]
Advanced

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

Re: Change the duration of a chord defined as a variable


From: paolo prete
Subject: Re: Change the duration of a chord defined as a variable
Date: Tue, 6 Mar 2018 12:44:20 +0100

Hi David,
in the snippet below, is it possible to set a new duration of \newChord  in the variable definition?
Thanks

chord = <f' a'>4
newChord = #(make-event-chord (ly:music-property chord 'elements))  
  
 \newChord
}

2018-03-06 12:14 GMT+01:00 David Kastrup <address@hidden>:
paolo prete <address@hidden> writes:

> Hello.
>
> How can I change the duration of a chord defined as a variable?
> I want to obtain something like:
>
> chord = <f' a'>
>
> { \chord 8 }

\version "2.18.0"
chord =
#(define-music-function (parser location dur) (ly:duration?)
    #{ <f' a'> $dur #})

For recent 2.19, you can leave out the "parser location" blurb.

I am not sure whether this kind of usage might be common enough to
warrant creating an \etc syntax for it, like

chord = <f' a'> \etc

{ \chord 8 }

It might actually be desirable for guitar chord variants outside of
\chordmode.  Or even in \chordmode.

--
David Kastrup


reply via email to

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