lilypond-user
[Top][All Lists]
Advanced

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

Re: Automatic ottava handling


From: David Nalesnik
Subject: Re: Automatic ottava handling
Date: Tue, 7 Oct 2014 18:32:52 -0500

Hi,

On Mon, Oct 6, 2014 at 3:51 PM, David Bellows <address@hidden> 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 <address@hidden> 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

Attachment: auto-ottava-music-function.ly
Description: Text Data

Attachment: auto-ottava-music-function.png
Description: PNG image


reply via email to

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