lilypond-devel
[Top][All Lists]
Advanced

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

Re: [GLISS] expressing "sustained arpeggios"


From: David Kastrup
Subject: Re: [GLISS] expressing "sustained arpeggios"
Date: Fri, 21 Sep 2012 15:50:00 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

Janek Warchoł <address@hidden> writes:

> On Fri, Sep 21, 2012 at 2:02 PM, Janek Warchoł
> <address@hidden> wrote:
>> What's your opinion?  How would you do this?  Maybe there's no need
>> for new syntax constructs?
>
> To be more credible, here is my try at doing this with a music function:
>
> sust =
> #(define-music-function (parser location note rhythm lasts music)
>   (ly:pitch? ly:duration? ly:duration? ly:music?)
>   #{ <<
>       \mergeDifferentlyDottedOn
>       { \voiceOne $note $rhythm $music }
>       \new Voice { \voiceTwo $note $lasts }
>   >> #})
>
> \new Staff {
>    \sust f' 16 4 \sust g' 16 8. \sust a'16 8 b'16
> }
>
> Hmm.  Is it only my impression, or had music functions became easier
> to write?

ly:pitch? and ly:duration? argument types sure help a lot when compared
to the state used in
<URL:http://nicolas.sceaux.free.fr/prelude/prelude.html>.  I am not sure
whether the function body itself would not actually have worked just in
this form if we somehow got pitches and durations assigned to local
variables of the right name.  But the point is that now I am sure
because I don't need to figure out whether I actually have all the
strange preconditions for this working in place.  Oh, and in case it had
not worked, you'd have gotten obscure error messages talking about
lilyvar-2745 and similar that did not point to the actual source of the
problem.

> Anyway, this is quite concise.  However, voice "direction" is
> hardcoded... probably this could be changed?

\voiceOne or similar can be another music argument.

> Also, without explicit Staff the output is crazy.  No idea whether
> this is easy to fix.

Wrap your function content into \context Voice { ... }

-- 
David Kastrup




reply via email to

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