Take the 2-minute tour ×
Musical Practice & Performance Stack Exchange is a question and answer site for musicians, students, and enthusiasts. It's 100% free, no registration required.

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 at 11:20

1 Answer 1

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?)
                    (map-some-music
                      (lambda (m)
                        (and (ly:duration? (ly:music-property m 'duration))
                             (begin
                                (set! (ly:music-property m 'duration) d)
                                m)))
                      (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 at 1:53

Your Answer

 
discard

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.