David Kastrup <d...@gnu.org> writes:

> Jan-Peter Voigt <jp.vo...@gmx.de> writes:
>
>> 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
>
> Not really surprising since slurs start on two notes and finish on three
> with the modified example.  I did not bother making them match.
>
>> 2. if you try this tiny snippet, the chord <g b> is actually broken in
>> two notes and the slur is typed twice.
>
>>   \new Staff \makeDuped c e \relative c' {
>>     c e( g b c)
>
> That's because this gets transformed into \new Staff << notes notes >>
> and "implicit voice creation" makes _two_ voices from that.  Try with
> \new Voice \makeDuped ...
> instead.

Possibly adding \context Voice helps:

makeDuped =
#(define-music-function (parser location from arg mus)
  (ly:pitch? ly:music? ly:music?)
  #{ \context Voice
     $(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))
  #})

I am not sure that this will not have side effects in other situations,
though: you would need to experiment with it.

-- 
David Kastrup

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

Reply via email to