On 29 April 2010 21:36, Graham Percival <gra...@percival-music.ca> wrote:
> On Thu, Apr 29, 2010 at 03:11:13PM +0200, Valentin Villenave wrote:
>> Speaking of which, I often wished we had a cool shortcut for writing
>> repeats using a postfix syntax, e.g.
>> { large music expression here };4
>> instead of
>> \repeat unfold 4 { large music expression }
>
> That would already be handled by
>  { ...} * 4
> which is much more intuitive than ;4

You took the words straight out of my mouth. :)

I'm afraid I couldn't resist testing this, so if you're interested,
try the attached patch.

Cheers,
Neil
From 9c143dbdc40ec9a60ad110d2869ce7ad1ed6ca29 Mon Sep 17 00:00:00 2001
From: Neil Puttock <n.putt...@gmail.com>
Date: Thu, 29 Apr 2010 21:52:12 +0100
Subject: [PATCH] Cool repeat shorthand for Valentin :)

---
 lily/parser.yy |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/lily/parser.yy b/lily/parser.yy
index ac0d357..3b4295d 100644
--- a/lily/parser.yy
+++ b/lily/parser.yy
@@ -994,6 +994,11 @@ repeated_music:
 	{
 		$$ = MAKE_SYNTAX ("repeat", @$, $2, $3, $4, $5);
 	}
+	|
+	sequential_music '*' unsigned_number
+	{
+		$$ = MAKE_SYNTAX ("repeat", @$, ly_string2scm ("unfold"), $3, $1, SCM_EOL);
+	}
 	;
 
 sequential_music:
-- 
1.7.0.4

_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to