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, reinh...@kainhofer.com, 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
\version "2.13.1" #(ly:set-option 'point-and-click #f) % Some sample text dynamic spanners, to be used as postfix operators crxxx = #(make-music 'CrescendoEvent 'span-direction START 'crescendoSpanner 'text 'crescendoText "cresc.") crpoco = #(make-music 'CrescendoEvent 'span-direction START 'crescendoSpanner 'text 'crescendoText "cresc. poco a poco") dimxxx = #(make-music 'DecrescendoEvent 'span-direction START 'decrescendoSpanner 'text 'decrescendoText "dim.") \relative c' { c4\crxxx d4 e4 f4 | g4 a4\! b4\crpoco c4 | c4 d4 e4 f4 | g4 a4\! b4\< c4 | g4\dimxxx a4\< b4\crxxx c4\! } % Two functions for (de)crescendo spanners where you can explicitly give the % spanner text. mycresc = #(define-music-function (parser location mymarkup) (string?) (make-music 'CrescendoEvent 'span-direction START 'crescendoSpanner 'text 'crescendoText mymarkup) ) mydecresc = #(define-music-function (parser location mymarkup) (string?) (make-music 'DecrescendoEvent 'span-direction START 'decrescendoSpanner 'text 'decrescendoText mymarkup) ) \relative c' { c4\mycresc "blah.." c4 c4 c4 | c4\mydecresc "...halb" c4 c4 c4 | c4 c4\! c4 c4 }
dynamic_spanners_postfix.pdf
Description: Adobe PDF document
_______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel