lilypond-devel
[Top][All Lists]
Advanced

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

Re: (de)cresendi syntax


From: Reinhold Kainhofer
Subject: Re: (de)cresendi syntax
Date: Sat, 11 Apr 2009 01:54:22 +0200
User-agent: KMail/1.11.2 (Linux/2.6.27-11-generic; KDE/4.2.2; i686; ; )

On Sonntag, 22. Februar 2009 09:25:57 Frédéric Bron wrote:
> I am in charge of the question of (de)crescendo syntax issue in 2.12.2.

Okay, sorry if I'm working on the same issue as you now, but I simply got too 
frustrated with hundreds of pages of old scores suddenly changing 
cresc/hairpin behavior (they were created with 2.10 and now I've started 
revising them with 2.12...) and the huge work I have now with cross-checking 
every cresc/dim/hairpin.

So, I took a look at the issue today and created a patch, which will now allow 
all dynamic spanner starters to be implemented as postfix-operators. 

The short (<15 quite trivial lines!) patch is up for review at:
http://codereview.appspot.com/39047

Basically, my question for now is whether this the right approach. Call it a 
proof-of-concept patch.
If so, we'll need to think about possible upgrade paths for the syntax changes 
that are introduced by making all dynamic spanners postfix operators...
The patch also does not include the actual definitions of things like \dim, 
\cresc, etc.

> Current syntax is not satisfactory because:
>
> - syntax is different between \<, \>, \! and \cresc, \dim, \enddim,
> \endcresc (undocumented):
>    . \<, \>, \! apply to the previous note,
>    . \cresc, \dim, \enddim, \endcresc apply to the next note

With my patch, everything applies to the previous note, all spanners are ended 
with \!, no \endXXX are needed any more.

> - some people just want cresc. to be printed without dashed line (spanner)

That's a global setting of the DynamicTextSpanner, which (IMO) should be 
changed to no dashed line by default.

> - \<, \>, \! are used to start/stop (de)crescendo spanner (hairpin or
> text), 
> - crescTextXXX, dimTextXXX, crescHairpin, dimHairpin decide if \<,
> \>, \! produce text or hairpin (applies for ever until changed to something
> else), 

Yes, this behavior stays the same with my patch.

> - \<"cresc.", \<"cresc. poco a poco", \>"dim."... produce a text spanner
> with corresponding text, the spanner is ended with \!, the text applies
> only once, i.e. next (de)crescendo produces hairpin if this is the
> current setting

This would require a parser change to be able to use \>. However, with my 
patch it's easy to write a function, e.g. mycresc, which can be used as:
a4\mycresc "cresc. molto" a4 a4\fff

An example is given in the attached file.

> - \cresc, \dim, \decr, \decresc produce a text without spanner, applies
> only once to the previous note, no need to finish with \! or \endcresc,
> this could be implemented with a \markup command

No, using a markup would break e.g. MIDI, which needs information about the 
end. With my patch, those can simply create dynamic text spanners with or 
without dashed line, but must be finished with \!

> - remove unnecessary \cr, \endcr, \decr, \enddecr
> - remove unnecessary \enddim, \endcresc

Yes, unnecessary with my patch

> I know that it is not possible to implement this only with scheme and
> lily code but I am sure it is possible in C++.

Yes, some simple lines of C++ were required.

Attached is a sample file to show how the definition of spanners could work 
with my patch. I've also implemented two functions to give the text of the 
spanner directly in the postfix call.

Any comments / objections / suggestions?

Cheers,
Reinhold
-- 
------------------------------------------------------------------
Reinhold Kainhofer, address@hidden, http://reinhold.kainhofer.com/
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org

Attachment: dynamic_spanners_postfix.ly
Description: Text Data

Attachment: dynamic_spanners_postfix.pdf
Description: Adobe PDF document


reply via email to

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