David Kastrup <[email protected]> writes:

> James Worlton <[email protected]> writes:

>> I expect it to just output a scale with a double-stemmed g.

[slightly fixed code quoted]

>> \version "2.17.95"
>>
>> doubleStem =
>> #(define-music-function
>>   (parser location note)
>>   (ly:music?)
>>   #{
>>     << { \voiceOne $note } \new Voice { \voiceTwo $note } >> \oneVoice
>>   #})
>>
>> melody = \relative c' {
>>   c4 d e f
>>   \doubleStem g a b c
>> }
>>
>> \score {
>>   \new Staff \melody
>> }
>
>> I can work around this by adding \absolute before #note in the
>> function (and remembering to use absolute mode in the input), but it
>> would be nice if the function would produce the correct output. What
>> am I doing wrong?
>
> \relative is icky in this situation anyway: if you use \doubleStem g',
> you'll get a similar problem.  There is the make-relative macro, but it
> only works on single pitches rather than whole music.  Maybe I need to
> extend it.

See issue 3673.  If that makes it in, you can do

doubleStem =
#(define-music-function
  (parser location note)
  (ly:music?)
  (make-relative (note) note
  #{
    << { \voiceOne $note } \new Voice { \voiceTwo $note } >> \oneVoice
  #}))

and the behavior in- and outside of \relative will be just as you would
expect.

-- 
David Kastrup


_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to