Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \version "2.19.82"
- #(define (filterChanges music)
- (let ((es (ly:music-property music 'elements))
- (e (ly:music-property music 'element))
- (p (ly:music-property music 'pitch)))
- (if (and
- (pair? es)
- (not
- (music-is-of-type? music 'event-chord)))
- (ly:music-set-property!
- music 'elements
- (map (lambda (x) (filterChanges x)) es)))
- (if (ly:music? e)
- (ly:music-set-property!
- music 'element
- (filterChanges e)))
- (if (and (not (pair? es))
- (music-is-of-type? music 'event-chord))
- (set! music (make-music
- 'RestEvent
- 'duration
- (ly:music-property music 'duration))))
- (if (ly:pitch? p)
- (begin
- (set! music (make-music
- 'RestEvent
- 'duration
- (ly:music-property music 'duration)))))
- music))
- filterChordChanges =
- #(define-music-function (parser location m)
- (ly:music?)
- (filterChanges m))
- music = { d \chordmode { d:m/a } f, q d q f, q e, \chordmode { e:7^5/gis } gis, q e, q gis, q }
- \new Staff { \clef "bass"
- <<
- \new ChordNames {
- \set noChordSymbol = ""
- \filterChordChanges \music
- }
- \music
- >>
- }
Advertisement
Add Comment
Please, Sign In to add comment