lilypond-devel
[Top][All Lists]
Advanced

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

patch for \transposedCueDuring


From: Werner LEMBERG
Subject: patch for \transposedCueDuring
Date: Tue, 16 May 2006 06:56:22 +0200 (CEST)

Here is my updated patch which implements \transposedCueDuring as
discussed earlier on this list.


    Werner


======================================================================

2006-05-15  Werner Lemberg  <address@hidden>

        * lily/lexer.ll (init_signature_has_table): Add
        `scm-scm-music-music'.

        * lily/parser.yy (MUSIC_FUNCTION_SCM_SCM_MUSIC_MUSIC): New token.
        (Generic_prefix_music_scm): Add rule for it.

        * lily/quote-iterator.cc (Quote_iterator::process): Handle
        `quoted-transposition' property.

        * ly/music-functions-init.ly (transposedCueDuring): New function.

        * scm/define-music-properties.scm (all-music-properties): Updated.

        * Documenation/topdocs/NEWS.itely: Document it.

======================================================================

--- ./ly/music-functions-init.ly.old    2006-05-06 15:09:43.000000000 +0200
+++ ./ly/music-functions-init.ly        2006-05-16 00:02:11.000000000 +0200
@@ -207,6 +207,20 @@
              'origin location))
 
 
+transposedCueDuring = #
+(define-music-function
+  (parser location what dir pitch-note main-music)
+  (string? ly:dir? ly:music? ly:music?)
+  (make-music 'QuoteMusic
+             'element main-music
+             'quoted-context-type 'Voice
+             'quoted-context-id "cue"
+             'quoted-music-name what
+             'quoted-voice-direction dir
+             'quoted-transposition (pitch-of-note pitch-note)
+             'origin location))
+
+
 quoteDuring = #
 (define-music-function
   (parser location what main-music)
@@ -217,7 +231,6 @@
              'origin location))
 
 
-
 pitchedTrill =
 #(define-music-function
    (parser location main-note secondary-note)
--- ./scm/define-music-properties.scm.old       2006-05-09 10:04:56.000000000 
+0200
+++ ./scm/define-music-properties.scm   2006-05-16 00:05:27.000000000 +0200
@@ -80,6 +80,7 @@
      (quoted-voice-direction ,ly:dir? "Should the quoted voice be up-stem or 
down-stem?")
      (quoted-context-type ,symbol? "The name of the context to direct quotes 
to, eg., @code{Voice}.")
      (quoted-context-id ,string? "The id of the context to direct quotes to, 
eg., @code{cue}.")
+     (quoted-transposition ,ly:pitch? "The pitch used for the quote, 
overriding \\transposition")
      (to-relative-callback ,procedure? "How to transform a piece of music to 
relative pitches")
      (tweaks ,list? "An alist of properties to override in the backend
 for the grob made of this event.")
--- ./lily/quote-iterator.cc.old        2006-04-03 01:36:51.000000000 +0200
+++ ./lily/quote-iterator.cc    2006-05-16 00:03:48.000000000 +0200
@@ -222,7 +222,9 @@
       /*
        The pitch that sounds like central C
       */
-      Pitch *me_pitch = unsmob_pitch (get_outlet ()->get_property 
("instrumentTransposition"));
+      Pitch *me_pitch = unsmob_pitch (get_music ()->get_property 
("quoted-transposition"));
+      if (!me_pitch)
+       me_pitch = unsmob_pitch (get_outlet ()->get_property 
("instrumentTransposition"));
 
       for (SCM s = scm_cdr (entry); scm_is_pair (s); s = scm_cdr (s))
        {
--- ./lily/parser.yy.old        2006-04-07 03:05:57.000000000 +0200
+++ ./lily/parser.yy    2006-05-16 06:35:40.000000000 +0200
@@ -282,6 +282,7 @@
 %token <scm> MUSIC_FUNCTION_SCM 
 %token <scm> MUSIC_FUNCTION_SCM_MUSIC 
 %token <scm> MUSIC_FUNCTION_SCM_MUSIC_MUSIC 
+%token <scm> MUSIC_FUNCTION_SCM_SCM_MUSIC_MUSIC 
 %token <scm> MUSIC_FUNCTION_SCM_SCM 
 %token <scm> MUSIC_FUNCTION_SCM_SCM_MUSIC 
 %token <scm> MUSIC_FUNCTION_SCM_SCM_SCM 
@@ -1037,6 +1038,11 @@
                $4->unprotect ();
                $3->unprotect ();
        }
+       | MUSIC_FUNCTION_SCM_SCM_MUSIC_MUSIC function_scm_argument 
function_scm_argument Music Music {
+               $$ = scm_list_n ($1, make_input (@$), $2, $3, $4->self_scm (), 
$5->self_scm (), SCM_UNDEFINED);
+               $4->unprotect ();
+               $5->unprotect ();
+       }
        | MUSIC_FUNCTION_MARKUP_MUSIC_MUSIC full_markup Music Music {
                $$ = scm_list_5 ($1, make_input (@$), $2, $3->self_scm (), 
$4->self_scm ());
                $3->unprotect ();
--- ./lily/lexer.ll.old 2006-04-06 14:54:23.000000000 +0200
+++ ./lily/lexer.ll     2006-05-16 06:28:16.000000000 +0200
@@ -895,6 +895,7 @@
                {"scm-scm", MUSIC_FUNCTION_SCM_SCM},
                {"music-music", MUSIC_FUNCTION_MUSIC_MUSIC},
                {"scm-music-music", MUSIC_FUNCTION_SCM_MUSIC_MUSIC},
+               {"scm-scm-music-music", MUSIC_FUNCTION_SCM_SCM_MUSIC_MUSIC},
                {"scm-scm-music", MUSIC_FUNCTION_SCM_SCM_MUSIC},
                {"scm-scm-scm-music", MUSIC_FUNCTION_SCM_SCM_SCM_SCM_MUSIC},
                {"scm-scm-scm-scm-music", MUSIC_FUNCTION_SCM_SCM_SCM_MUSIC},
--- ./Documentation/topdocs/NEWS.tely.old       2006-05-15 22:42:10.000000000 
+0200
+++ ./Documentation/topdocs/NEWS.tely   2006-05-16 00:14:56.000000000 +0200
@@ -66,6 +66,17 @@
 
 @end ignore
 
+
address@hidden
+A new command @code{\transposedCueDuring} has been added which overrides
+the cue's transposition locally.  Its intended use is to octavate cues
+up or down to avoid an excessive number of ledger lines.  The syntax form
+is
+
address@hidden
+\transposedCueDuring #NAME #UPDOWN PITCH MUSIC
address@hidden example
+
 @item
 Objects may be rotated using the @code{rotation} property.
 @lilypond[ragged-right,fragment,relative=1]




reply via email to

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