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 09:12:13 -0500



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


David Nalesnik-2 wrote
> I do realize that these "enhancements" make the
> difference between usability and "thanks, nice toy" :)

That may be true on a practical level, but I am truly thankful for your
efforts. I do know a bit of programming myself, but LISP and its dialects
are absolutely beyond me - it is one of those languages that still look
completely inaccessible to me, which is a pity since I'd really love to help
by coding.


David Nalesnik-2 wrote
> I've been working on making sure what I have now produces the same
> expressions as a score with manual ottavas does before I venture into
> enhancing it.  I hit a problem with << >> (SimultaneousMusic), but I have
> your request in mind

This is indeed tricky, I didn't think about this situation before. Here is
an example /without/ any rhythmical complexities (with those, things can
turn into nightmares very quickly, since ottavation affects the whole
staff...):

<http://lilypond.1069038.n5.nabble.com/file/n167757/53.png>

(this example above is a bit exaggerated, but think of instruments that have
a nice range and are traditionally notated in one single staff, such as a
xylophone).

If I may suggest something, what about simply ignoring places where two or
more voices occur and outputting an error message to the user telling the
lines that are problematic? This way, one can find the problem and solve it
by:

\ottavation #'(4 . 7) #'(-4 . -7) { \musicPartA }
\musicPartB
\ottavation #'(4 . 7) #'(-4 . -7) { \musicPartC }

where \musicPartB would be the passage that needs manual tweaking.

I had pretty much decided not to try to make any rational decisions with examples like you post!  What you say about an error message (or simply a warning) is a good idea.  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.  (See the snippet at  http://lilypond.org/doc/v2.18/Documentation/notation/displaying-pitches#index-ottava-2).  No way.

My issue at this point is adding the ottava before the SequentialMusic _expression_, rather than inside it: for example, creating \ottava #1 << ... >>, based on the contents of << >>.  Instead the routine puts the ottavas where "needed" inside the _expression_.

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

____
You're right that you can turn it off and on wherever you want.  But there is one big issue--which I will not be able to solve.  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.

So you will run into some oddness when you turn it on within a passage where, say, bass clef is already in force--namely, the function will use treble clef to calculate the number of ledger lines for notes.  But there's no help for that, unless there's an argument for opening-clef-if-different-than-treble, but that's getting perverse :)

(The number of ledger lines a note gets has not been determined yet, hence the casting around for a clef to do our own calculations.)
 

I think a lot of these decisions are easy to take by a human but very
difficult to generalize (I have been myself working on a code (not in Scheme
;) ) to decide between flat and sharp accidentals in atonal music, but there
are situation that makes the computer go nuts (or makes the code
increasingly complex and long), where a human can spot right away what is
the best solution, or the least worse alternative).

All I can say is: yup. 

--David


reply via email to

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