]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/parser.yy
Let fret-diagram scale markups to fit into dots
[lilypond.git] / lily / parser.yy
index 552d699d25c87fa6bbb1106f749992a5943b5e19..87edcdafed7cc33c4cf48e4dc68c4998789e67dd 100644 (file)
@@ -717,6 +717,26 @@ partial_function:
        {
                $$ = scm_acons ($1, $2, SCM_EOL);
        }
+       | OVERRIDE grob_prop_path '='
+       {
+               if (SCM_UNBNDP ($2))
+                       $$ = scm_list_1 (SCM_BOOL_F);
+               else
+                       $$ = scm_cons
+                               (scm_list_3 (Syntax::property_override_function,
+                                            scm_cdr ($2), scm_car ($2)),
+                                SCM_EOL);
+       }
+       | SET context_prop_spec '='
+       {
+               if (SCM_UNBNDP ($2))
+                       $$ = scm_list_1 (SCM_BOOL_F);
+               else
+                       $$ = scm_cons
+                               (scm_list_3 (Syntax::property_set_function,
+                                            scm_cadr ($2), scm_car ($2)),
+                                SCM_EOL);
+       }
        | MUSIC_FUNCTION EXPECT_SCM function_arglist_optional partial_function
        {
                $$ = scm_acons ($1, $3, $4);
@@ -729,6 +749,26 @@ partial_function:
        {
                $$ = scm_acons ($1, $3, $4);
        }
+       | OVERRIDE grob_prop_path '=' partial_function
+       {
+               if (SCM_UNBNDP ($2))
+                       $$ = scm_list_1 (SCM_BOOL_F);
+               else
+                       $$ = scm_cons
+                               (scm_list_3 (Syntax::property_override_function,
+                                            scm_cdr ($2), scm_car ($2)),
+                                $4);
+       }
+       | SET context_prop_spec '=' partial_function
+       {
+               if (SCM_UNBNDP ($2))
+                       $$ = scm_list_1 (SCM_BOOL_F);
+               else
+                       $$ = scm_cons
+                               (scm_list_3 (Syntax::property_set_function,
+                                            scm_cadr ($2), scm_car ($2)),
+                                $4);
+       }
        | MUSIC_FUNCTION EXPECT_OPTIONAL EXPECT_SCM function_arglist_nonbackup partial_function
        {
                $$ = scm_acons ($1, $4, $5);
@@ -1483,11 +1523,19 @@ context_prefix:
        ;
 
 new_lyrics:
-       ADDLYRICS lyric_mode_music {
-               $$ = scm_list_1 ($2);
+       ADDLYRICS optional_context_mod lyric_mode_music {
+               Context_mod *ctxmod = unsmob<Context_mod> ($2);
+               SCM mods = SCM_EOL;
+               if (ctxmod)
+                       mods = ctxmod->get_mods ();
+               $$ = scm_acons ($3, mods, SCM_EOL);
        }
-       | new_lyrics ADDLYRICS lyric_mode_music {
-               $$ = scm_cons ($3, $1);
+       | new_lyrics ADDLYRICS optional_context_mod lyric_mode_music {
+               Context_mod *ctxmod = unsmob<Context_mod> ($3);
+               SCM mods = SCM_EOL;
+               if (ctxmod)
+                       mods = ctxmod->get_mods ();
+               $$ = scm_acons ($4, mods, $1);
        }
        ;
 
@@ -4047,14 +4095,12 @@ make_duration (SCM d, int dots)
 SCM
 make_chord_step (SCM step_scm, Rational alter)
 {
-        int step = scm_to_int (step_scm);
+       Pitch m (0, scm_to_int (step_scm) - 1, alter);
 
-       if (step == 7)
-               alter += FLAT_ALTERATION;
+       // Notename/octave are normalized
+       if (m.get_notename () == 6)
+               m = m.transposed (Pitch (0, 0, FLAT_ALTERATION));
 
-       while (step < 0)
-               step += 7;
-       Pitch m ((step -1) / 7, (step - 1) % 7, alter);
        return m.smobbed_copy ();
 }