lilypond-user
[Top][All Lists]
Advanced

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

Re: \makeOctaves broken?


From: David Kastrup
Subject: Re: \makeOctaves broken?
Date: Thu, 19 Apr 2012 13:04:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

> I am not topposting

Let's see whether bypassing Gmane gets us into the discussion any
faster.

Jan-Peter Voigt <address@hidden> writes:

> Hello Urs,
>
> the articulations are were copied to the EventChord - so I added
> copying the articulations from NoteEvent to EventChord.
> That means, they should not stay in the NoteEvents when getting
> wrapped into the EventChord:

Well, you could use event-chord-wrap! in order to fix this the easy way.

Actually, here is a somewhat amusing version that can do quite a bit
more with quite less code, and that will work both in absolute as well
as relative mode.

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

\relative c' {
  \time 3/8
  \key gis \minor
  \makeDuped c' c''  { dis8( e dis')~ dis8.( cis16 b8}
  \makeDuped c' <c g> { ais' gis dis) cis( dis<dis gis'>) }
}

-- 
David Kastrup

reply via email to

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