[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: adding slurs to notes passed form a user defined function
From: |
David Kastrup |
Subject: |
Re: adding slurs to notes passed form a user defined function |
Date: |
Tue, 31 Dec 2013 11:26:38 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Paul Malcolm <address@hidden> writes:
> This is my problem.
> Ive written a crude little function
>
> ScaleDegree = #(define-music-function (parser location Degree) (ly:music?)
> #{
> $Degree
> #})
>
>
> All this thing does is write one note according to the argument passed to it.
>
> Say for example I define "the" note as
>
> zero = \relative c' { g4 }
>
> Then in the code I write
>
> \ScaleDegree \zero \ScaleDegree \zero
>
> then I get two notes, both the g4.
>
> However what I would to be able to do, is "sometimes" add a slur.
> So ultimately I want g4( g4) etc.
>
> How can I do this please ?
This is currently not trivial: LilyPond treats \xxx as a complete music
expression it does not crack up again in order to add articulations.
Even assuming that it did, there would be several layers of difficulty:
{ g4 } is sequential music and does not take articulations
\relative c' g4 (the next improvement) is music explicitly made absolute
and does not take articulations.
What you _can_ do here is write
zero = g''
In that case, zero is _not_ a music expression but rather a pitch. As
such, it will take a duration and articulations just fine in order to
form a complete music expression.
--
David Kastrup