Music: Practice & Theory Stack Exchange is a question and answer site for musicians, students, and enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What I'd like to do is define custom, specific chord voicings in lilypond, and to be able to attach note-durations to them, along the lines of

voicing= < g a c e a > % dom7, with 7th in bass 
  \new Staff {
         % play the whole chord for two quarters, then a half
        \voicing4 \voicing4 \voicing2 

However, this basic approach doesn't work: you can't attach the note durations to the variables.

I'm trying to avoid having to write out all of the notes for all of the instances of using the chords.

Is there any way to achieve this end?

share|improve this question
While I doubt it's yet going to kick off, I'd like to advertise the Lilypond proposal on Area51.StackExchange here. – leftaroundabout Feb 1 '14 at 11:20
up vote 4 down vote accepted

You can, of course, write

< g a c e a >4 q q2

If you want to mix different chords, this is not feasible. With the restriction of always needing a duration, you can write something like

makevoicing = #(define-scheme-function (parser location m) (ly:music?)
                  (define-music-function (parser location d) (ly:duration?)
                      (lambda (m)
                        (and (ly:duration? (ly:music-property m 'duration))
                                (set! (ly:music-property m 'duration) d)
                      (ly:music-deep-copy m))))

voicing = \makevoicing < g a c e a > % dom7, with 7th in bass

\new Staff {
       % play the whole chord for two quarters, then a half
      \voicing4 \voicing4 \voicing2 

While it is possible to have the duration be defaulted, you'd still need to write \voicing\default in order to get the default, pretty much defeating the idea of having a default in order to save typing.

share|improve this answer
You can combine this with the "q" notation, which serves my purposes well. – Dave Feb 2 '14 at 1:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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