>Here's a preliminary experiment. It will add an automatic \ottava 1 before passages where notes have at least a specified number of ledger lines.
This is a terrific start! The solution I'm using in my program counts the number of commas or single quotes and applies the ottava marking based on that which works fine but doesn't give as aesthetically a pleasing result as your method does. I will totally ditch my method if this one progresses much further. On Tue, Oct 7, 2014 at 4:32 PM, David Nalesnik <david.nales...@gmail.com> wrote: > Hi, > > On Mon, Oct 6, 2014 at 3:51 PM, David Bellows <davebell...@gmail.com> > wrote: > >> I ended up creating my own solution to use in my code that generates >> scores. Unfortunately it doesn't really translate into anything usable by >> anyone else. Likewise I created my own staff switching method as well so >> that rests would be printed in the other staff. >> >> Still, I think the automatic ottava marking would be a good idea and >> maybe even doable. Alas, I am not the one to do it, though. >> >> On Sun, Oct 5, 2014 at 2:14 PM, Gilberto Agostinho < >> gilbertohasn...@gmail.com> wrote: >> >>> Malte Meyn-3 wrote >>> > There is a pitch-dependent staff switching automatism in LilyPond (I >>> > don’t know how it works but you can have a look at piano/harp section >>> in >>> > the notation reference) so I think what you are asking for should at >>> > least not be impossible. >>> >>> You are talking about \autochange (see: >>> >>> http://lilypond.org/doc/v2.18/Documentation/notation/common-notation-for-keyboards#changing-staff-automatically >>> ). >>> >>> And indeed an automatic function to add ottava markings for every pitch >>> higher than a certain threshold (and ottava bassa lower than another >>> defined >>> threshold) would be a fantastic addition to LilyPond. >>> >>> > I think this should be doable. > > Here's a preliminary experiment. It will add an automatic \ottava 1 > before passages where notes have at least a specified number of ledger > lines. > > Right now this is pretty limited. It won't handle \relative, for one > thing. I'll have to get deeper into the music representation for that, but > this should serve as a proof-of-concept. > > Another issue is adapting to different clefs. The function \octavate is > hard-coded for treble clef at the moment. The problem is that > 'clefMiddleCPosition is a context property, and I'm not sure how to get at > context properties through a music function. Any ideas? With this > property it's easy to have this work automatically with different clefs. > (The number -6 in the function represents the value of > 'clefMiddleCPosition for treble clef--middle C is 6 staff-steps below the > center line.) > > Best, > David > >
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user