[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Glissando function
From: |
David Kastrup |
Subject: |
Re: Glissando function |
Date: |
Thu, 20 Mar 2014 13:41:27 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Benjamin Fluehr <address@hidden> writes:
>> The examples in the manual don't really require Scheme knowledge.
>
> Mostly true, but my lack of Scheme knowledge prevents me from fully
> understanding the error messages when things go wrong. Here is my attempt:
>
> \version "2.18.0"
>
> crossGlissando =
> #(define-music-function
> (parser location noteA noteB)
> (ly:music? ly:music?)
> #{
> #noteA \glissando
> \change Staff = "up"
> #noteB
> \change Staff = "down"
> #})
>
> \score {
> \new StaffGroup <<
> \new Staff = up
> \new Staff = down {
> \new Voice {
> \crossGlissando c' d'
> }
> }
> >>
> }
>
> And the associated errors:
> error: syntax error, unexpected EVENT_IDENTIFIER
> #noteA
> \glissando
That's actually a different problem: you cannot attach articulations to
music events in variables. You can probably futz around this a bit by
using things like
< $NoteA >\glissando
but of course that only works when NoteA is just a single note. It is
true that one can work around some of that by reverting to actual Scheme
programming.
--
David Kastrup