lilypond-user
[Top][All Lists]
Advanced

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

Re: Shortcut for epeated chords?


From: Mats Bengtsson
Subject: Re: Shortcut for epeated chords?
Date: Fri, 28 Mar 2008 14:36:50 +0100
User-agent: Thunderbird 2.0.0.5 (X11/20070716)

If you find the \repeat unfold syntax too long to type in, you can easily
defined a macro with a shorter name:
rr = #(define-music-function (parser location num music)(number? ly:music?)
#{ \repeat unfold $num $music #})

The only complication is that you have to add a #-mark before the
number that indicates the number of times the pattern should be repeated.
Example:

\relative c'{
\rr #5 <c e g>4 \rr #2 c8 \rr #6 r4
\rr #2 {c e d g, }
}

When it comes to extending the syntax, you have to be careful and think about
all possible side effects before doing such a change.

   /Mats


Joseph Wakeling wrote:
Mats Bengtsson wrote:
You mean like
http://lilypond.org/doc/v2.10/Documentation/user/lilypond/Measure-repeats#Measure-repeats

I interpret the suggestion to mean that he wants the _notes_ to appear
(unlike the link you posted, which uses 'slash' notation to indicate
repetition), but wants some handy shortcut not to have to type them out
repeatedly in the Lilypond source.

So e.g. to follow his example and suggested notation,

  <c e g b c'>16 <> <> <>
  <d f a c c'>16 <>8 <>16

would produce the same output as,

  <c e g b c'>16 <c e g b c'> <c e g b c'> <c e g b c'>
  <d f a c c'>16 <d f a c c'>8 <d f a c c'>16

This is certainly a possibility I would like to see in Lilypond.  In
fact I see no reason for it to be limited to chords: some notation for
'same note(s) again' would be very desirable.

--
=============================================
        Mats Bengtsson
        Signal Processing
        School of Electrical Engineering
        Royal Institute of Technology (KTH)
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463                         
       Fax:   (+46) 8 790 7260
        Email: address@hidden
        WWW: http://www.s3.kth.se/~mabe
=============================================





reply via email to

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