lilypond-user
[Top][All Lists]
Advanced

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

Re: music function not duplicating manual "equivalent"


From: Nicolas Sceaux
Subject: Re: music function not duplicating manual "equivalent"
Date: Sat, 5 Jun 2010 12:04:11 +0200

Le 4 juin 2010 à 18:13, Kieren MacMillan a écrit :

> Hey all!
> 
> Can anyone explain what's going wrong here? [The scores are intended/expected 
> to have identical output, i.e., the first version.]
> Is it the q "function" that's messing me up, or my \split function?

Itt is the conjonction of `q', \relative and #{ #} syntax which gives
the undesired result, as is demonstrated in the following example:

\version "2.13.22"

identityA =
#(define-music-function (parser location music) (ly:music?)
   music)

identityB =
#(define-music-function (parser location music) (ly:music?)
   #{ $music #})

%% reference: tied chords
\relative c' { <c e g>4 ~ q }

%% music function, without #{  #} syntax ==> OK
\relative c' \identityA { <c e g>4 ~ q }

%% music function with #{  #} syntax ==> KO
\relative c' \identityB { <c e g>4 ~ q }

I don't see yet how to solve that problem, I'm adding an issue to the tracker.
<http://code.google.com/p/lilypond/issues/detail?id=1110>

As a work around, you can use the following \split function:

split =
#(define-music-function (parser location music1 music2) (ly:music? ly:music?)
   (make-music
    'SequentialMusic
    'elements
    (list (make-music
           'SimultaneousMusic
           'elements
           (list (make-music
                  'SequentialMusic
                  'elements (list voiceOne music1))
                 (make-music
                  'ContextSpeccedMusic
                  'property-operations '()
                  'context-id "2"
                  'context-type 'Voice
                  'element (make-music 'SequentialMusic
                                       'elements (list voiceTwo music2)))))
          oneVoice)))

Nicolas




reply via email to

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