lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: \makeOctaves broken?


From: Jan-Peter Voigt
Subject: Re: \makeOctaves broken?
Date: Thu, 19 Apr 2012 14:23:37 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120327 Thunderbird/11.0.1

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--




reply via email to

[Prev in Thread] Current Thread [Next in Thread]