lilypond-user
[Top][All Lists]
Advanced

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

Re: "anchors" in the music stream?


From: Jay Anderson
Subject: Re: "anchors" in the music stream?
Date: Wed, 22 Jul 2009 11:53:59 -0700

On Wed, Jul 22, 2009 at 9:05 AM, Kieren
MacMillan<address@hidden> wrote:
> Hello all,
>
> Like many Lilyponders, I break down my code into variables, e.g. global (for
> time signature changes, etc.), notes, dynamics, etc. The main irritation
> with this (IMO) is that each variable requires a complete set of skips in
> order to keep the timing accurate.
>
> Would it be technically feasible/possible to establish a system of "anchors"
> instead? That is, could we declare an anchor point in the global setup, and
> then refer to it in other code? e.g.
>
> global =
> {
>  \time 4/4 s4*4*10
>  \time 3/4 s4*3*5
>  \time 7/4 s4*7
>  \time 4/4 \anchor #'coda s4*4*10
>  \bar "|."
> }
>
> tempoChanges =
> {
>  \tempo \markup "Opening tempo"
>  \anchorTo #'coda \tempo \markup "Extremely slow"
> }
>
> ??
>
> Just a brainstorm from someone who doesn't understand the internals enough
> to immediately see the stupidity of this idea...  =)
>

That's a neat idea. It might be easier to do something like:

global =
{
 \time 4/4 s4*4*10
 \time 3/4 s4*3*5
 \time 7/4 s4*7
 \time 4/4 \anchor #'coda s4*4*10
 \bar "|."
}

\addAt #'coda \global {\tempo \markup "Extremely slow"}

Then the addAt function could weave the tempo in at the correct point.
Though I'm not sure how easy this would be either.

=====

I've thought about something similar before and I think anchors would
be a good syntax (I don't know about the internals) to make it work:

global = {s1*4 \anchor #'place s1*4}
part = \relative c' {c1 c c c \assertAt #'place c c c c \assertEnd}
anotherPart = \relative c' {e1 e e \assertAt #'place e e e e \assertEnd} %Error
\score { << \new Staff{ << \global \part >> } \new Staff{ << \global
\anotherPart >> }  >> }

This would work similar to bar checks. Errors would be thrown when the
anchor and assertion don't line up. I think this might be more
complicated than the above use.

In any case I think anchors could be very useful for a variety of purposes.

-----Jay




reply via email to

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