]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 3648/1: Isolated durations in music sequences now stand for unpitched notes
authorDavid Kastrup <dak@gnu.org>
Sat, 31 Aug 2013 12:11:32 +0000 (14:11 +0200)
committerDavid Kastrup <dak@gnu.org>
Tue, 19 Nov 2013 10:10:44 +0000 (11:10 +0100)
This allows for things like

\new RhythmicStaff { 4 4. 8 4 | 4 \tuplet 3/2 { 2 4 } 4 }

"unpitched" simply means that this is rendered as a normal NoteEvent,
but the pitch information is missing and has to be filled in by some
other means.  The example using RhythmicStaff is not actually
commendable as the MIDI rendition still requires a pitch or drum
type.  It's just that as of this patch, there are no immediately
useful applications.  The rhythmic shorthand { c4 4. 8 4 } is
introduced by a later patch.

lily/parser.yy

index cd8f9991411f2499f2b2196b68c660d04d751a50..dfc961d6ae9f3109c79de356384c7335a021f7e1 100644 (file)
@@ -1081,6 +1081,18 @@ music_embedded:
        {
                $$ = $3;
        }
+       | multiplied_duration post_events
+       {
+               Music *n = MY_MAKE_MUSIC ("NoteEvent", @$);
+
+               parser->default_duration_ = *unsmob_duration ($1);
+               n->set_property ("duration", $1);
+
+               if (scm_is_pair ($2))
+                       n->set_property ("articulations",
+                                        scm_reverse_x ($2, SCM_EOL));
+               $$ = n->unprotect ();
+       }
        ;
 
 music_embedded_backup: