2

Assuming I have a pattern like this:

\relative c' {
  c4 d e f8 g
  d4 e f g8 a
  e4 f g a8 b
  f4 g a b8 c
}

How can a define the rhythmic pattern to be applied to all notes so I only had to input the note durations one time?

% I imagine it to look somehow like this:

definerhytmicpattern = {
  4 4 4 8 8
}

\relative c' {
  c d e f g
  d e f g a
  e f g a b
  f g a b c
}
4

I could not leave it and I found this on the Lilypond Snippet Repository.

Download the newest file with wget:

wget http://gillesth.free.fr/Lilypond/changePitch/changePitch.ly

then:

\version "2.18.2"

\include "changePitch.ly"

pattern = { c4 c4 c4 c8 c8 }
newnotes = \relative c' {
  c d e f g
  d e f g a
  e f g a b
  f g a b c
}

\score {
  \changePitch \pattern \newnotes
}

outputs:

enter image description here

you can also add articulation:

[...]
pattern = { c4-> c4-. c4-. c8( c8) }
[...]

enter image description here

and dynamics:

[...]
pattern = { c4-\p c4\< c4 c8( c8)-\! }
[...]

enter image description here

...and even fingerings! (just awesome)

[...]    
pattern = { c4-1 c4-2 c-3 c8(-4 c8)-5 }
[...]

enter image description here

detailed documentation for this function can be found here: PDF

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.