Splitting chords: Difference between revisions

Fsarud (talk | contribs)
Add that it doesn't work with q for repeating last chord
Fsarud (talk | contribs)
mNo edit summary
Line 1: Line 1:
This snippet is a 2009 contribution by Gilles Thibault in [https://lists.gnu.org/archive/html/lilypond-user/2009-01/msg00685.html lilypond-user]. It works well in 2.24.4 and even in 2.25.35. I find it very useful. (Beware: it doesn't work if you use «q» to repeat last chord).  
This snippet is a 2009 contribution by Gilles Thibault in [https://lists.gnu.org/archive/html/lilypond-user/2009-01/msg00685.html lilypond-user]. It splits a chord sequence into two separated voices: the first one built on the first note (usually the lowest) of every chord and the other on the remaining notes. It works well in 2.24.4 and even in 2.25.35. I find it very useful. The only drawback it doesn't work if you use «q» to repeat last chord.  
 
<lilypond version="2.24">


<span></span>
\version "2.24"
  #(define (has-duration? music)
  #(define (has-duration? music)
  (ly:duration? (ly:music-property music 'duration)))
  (ly:duration? (ly:music-property music 'duration)))
Line 34: Line 33:
   
   
  music =\relative c' {
  music =\relative c' {
  <c e>4-> <d f>( <nowiki><b g'>) <c e>-. g2 c2</nowiki>
  <c e>4-> <d f>( <b g'>) <c e>-. g2 c2
  }
  }
   
   
Line 44: Line 43:
   \new Staff \keepsOnlyFirstNote \music
   \new Staff \keepsOnlyFirstNote \music
  >>
  >>
<span></span>
</lilypond>