Hi, Colin --

On 7/5/11, Colin Campbell <c...@shaw.ca> wrote:
>
> This will probably require an issue, David, but could you send the code
> you used to produce the 2.12.3 version, please?  I can't reproduce the
> previous stable example, in order to confirm the regression, because
> your Scheme-ing gives an error:
> LilyPond 2.12.3 [music.ly] starting (preview mode)...
> Processing `music.ly'
> Parsing...
> Interpreting music...
> Preprocessing graphical objects...
> Finding the ideal number of pages...
> Fitting music on 1 page...
> Drawing systems...music.ly:19:12: In procedure + in expression (+
> (ly:grob-property beam #) (/ # 2)):
> music.ly:19:12: Wrong type argument in position 1: ()
> LilyPond [music.ly] exited with return code 1.
>
Oops -- yes, the error happened because 'thickness is now
'beam-thickness.  I've attached the file I used for the 2.12.3 image.

I've also attached a pared-down version of the file which should work
in either release, as is.  It distills the problem a little more -- at
the expense of centering the number directly on the beam . . .

I hope that in some way this is useful :)

Thank you for your help!

-David
\version "2.12.3"

#(define (tuplet-number-to-beam tuplet-number)
  (let* ((tuplet-bracket (ly:grob-object tuplet-number 'bracket))
         (note-column (ly:grob-parent tuplet-number X))
         (stem (ly:grob-object note-column 'stem))
         (beam (ly:grob-object stem 'beam)))

     ;; Move (invisible) TupletBracket to beam, taking number with it
     (ly:grob-set-property! tuplet-bracket 'positions (ly:grob-property beam 'positions))

     ;; Number is now centered on beam.  Offset it based on width of beam and height
     ;; of tuplet number.
     (ly:grob-set-property! tuplet-number 'Y-offset
         (-
           (+
             (ly:grob-property beam 'thickness)
             (/ (interval-length (ly:grob::stencil-height tuplet-number)) 2))))))

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\new PianoStaff <<
  \new Staff = "1" {
    s4
  }
  \new Staff = "2" {
    \relative c {
      \clef bass
      \override TupletNumber #'after-line-breaking = #tuplet-number-to-beam
      \times 2/3 {
        c8
        \change Staff = "1"
        c''
        \change Staff = "2"
        c,,
      }
    }
  }
>>


\version "2.12.3"

#(define (tuplet-number-to-beam tuplet-number)
  (let* ((tuplet-bracket (ly:grob-object tuplet-number 'bracket))
         (note-column (ly:grob-parent tuplet-number X))
         (stem (ly:grob-object note-column 'stem))
         (beam (ly:grob-object stem 'beam)))

     ;; Move (invisible) TupletBracket to beam, taking number with it
     (ly:grob-set-property! tuplet-bracket 'positions (ly:grob-property beam 'positions))))
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\new PianoStaff <<
  \new Staff = "1" {
    s4
  }
  \new Staff = "2" {
    \relative c {
      \clef bass
      \override TupletNumber #'after-line-breaking = #tuplet-number-to-beam
      \times 2/3 {
        c8
        \change Staff = "1"
        c''
        \change Staff = "2"
        c,,
      }
    }
  }
>>


Attachment: tuplet-number-function-minimal.pdf
Description: Adobe PDF document

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

Reply via email to