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, 21 Oct 2014 12:03:50 -0500



On Tue, Oct 21, 2014 at 9:35 AM, Gilberto Agostinho <address@hidden> wrote:
Hi David,


David Nalesnik-2 wrote
> I'm not going to venture into automating the process described in the
> manual for having an ottava apply to one voice, but not the other.

That would be indeed painful to implement... this is exactly the type of
notation that a human can spot as "okay" in some cases, even though it
breaks some conventions for a brief moment. Nevertheless, this is quite a
rare case - and I still would avoid using it at all, I'd rather create a new
stave if necessary, which is a more contemporary approach to these types of
passages.


David Nalesnik-2 wrote
> Maybe best would be to throw a warning and completely ignore the << >>
> passage.  Certainly easier from my standpoint!

I guess this would be a very fair solution. Your function already handles
chords (it always considers the bottom note for treble clef and the top note
for bass clef, am I right?), which is wonderful. If someone is dealing with
more complex polyphony, then better do it manually.

Actually, no, it averages the ledger lines of the chord members.  If the average is above the threshold, we get an ottava.  I'm welcome to better algorithms!  (It would be easy enough to implement what you describe.)
 


David Nalesnik-2 wrote
> There is no access to context properties from within a music function.  So
> determining the clef relies on its explicit creation within the music
> _expression_ that \ottavate considers.  Otherwise, it can only assume treble
> clef.

What about adding a optional variable to set the clef? So if the music
starts with a different clef, the user would have to explicitely have to
inform this.

Well, I could.  The only thing is that number of optional variables is limited.  I suppose there could be an argument which takes an alist of symbols and settings: '((starting-clef . bass) (short-names . #t) (stop-at-rests . #t) ...).  If a pair isn't present, a default is taken.  My goal was simplicity, though :(  

And here is a minor thing I just spotted: there is also a small
inconsistense with the negative values in your function. Try this:

{
  \ottavate #'(4 . 7) #'(-4 . -7) ##f { f''' g''' \clef bass g,, e,,}
}

So up to (inclusive) 4 ledger lines above the treble cleff is displayed
without ottavation, but only notes with less (not inclusive) than 4 ledger
lines are displayed without ottava bassa in the bass clef.

I don't see the problem you've describe.  The attached shows the snippet without and with \ottavate, with short names for clarity.  The notes affected by the ottavas both have four ledger lines.

Best,
David 

Attachment: auto-8-15.png
Description: PNG image


reply via email to

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