[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: reading properties
From: |
Han-Wen Nienhuys |
Subject: |
Re: reading properties |
Date: |
Fri, 5 Apr 2002 12:08:50 +0200 |
address@hidden writes:
> > then what you want could be done using
> >
> > \context Staff
> > \applycontext #(lambda (trans)
> > (ly-set-trans-property trans centralCPosition
> > (+ (ly-get-trans-property trans centralCPosition) 7)))
> >
> > We could even use this mechanism as a basic way to express various
> > other operations, such as barchecks, \property, staff changes,
> > etc. Implementing it shouldn't be that hard. Basically, you have to
> > implement a new music-iterator that does the gh_call (). Loads of fun
> > if you've never written such a beast before :-)
>
> I'll have a look at the end of the semester - i.e. in start of july.
> One question though: If one does
>
> \context Voice {
> \context Staff {
> ..
>
> I am pretty sure that the current translator will be Voice and not
> Staff...? This is a problem in this case (the ottava statement would
> apply to the voice and not the Staff).
It depends on the precise contents of ... ; the moment lily encounters
a note, the context of the inner { } will be switched to Thread. The
\context Staff will never descend, so the outer { } will also not
descend.
It's a little hairy, but \applycontext will simply work just as
\outputproperty does.
BTW, I might hack it in myself if I'd have to wait till July :-)
(It should be a quite small hack, at least for those in the know :-)
--
Han-Wen Nienhuys | address@hidden | http://www.cs.uu.nl/~hanwen/