Hello David,

thank you for implementing this stuff!
This is nice, but there are two things to mention:
1. with Urs' example, lily complains about Slurs it can't finish
2. if you try this tiny snippet, the chord <g b> is actually broken in two notes and the slur is typed twice.
So how do you build real (event)chords with these functions?
And where are these funcs documented?

Cheers, Jan-Peter

--snip--
\version "2.15.36"

relTranspose = #(define-music-function (parser location from to mus)
  (ly:pitch? ly:pitch? ly:music?)
  #{ \withMusicProperty #'to-relative-callback
    #(lambda (m p)
            (let ((mu (ly:music-property m 'element)))
                 (ly:music-transpose mu (ly:pitch-diff from to))
                 (ly:make-music-relative! mu p)
                 (ly:music-transpose mu (ly:pitch-diff to from)))
            p)
    \transpose $from $to $mus
#})

makeDuped = #(define-music-function (parser location from arg mus)
  (ly:pitch? ly:music? ly:music?)
  (make-simultaneous-music
    (fold-some-music
      (lambda (m) (music-is-of-type? m 'note-event))
      (lambda (p l)
(cons #{ \relTranspose $from $(ly:music-property p 'pitch) $mus #} l))
      (list #{ $mus #})
      arg)))

\score {
  \new Staff \makeDuped c e \relative c' {
    c e( g b c)
  }
  \layout { }
  \midi { }
}
--snip--


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to