Prompted by the recent discussion on lute tablature, I tried coding a Scheme 
engraver to create the duration grobs but quickly ran into a problem.  I need 
to collect information from both a Listener and an Acknowledger so the obvious 
place to build the grob is in stop-translator-timestep, but my attempts all 
result in a LilyPond crash.  I'm on Windows Vista, so the crash code is not 
very helpful - 1073741819.

Minimal examples below.  The first creates a grob from the Listener and works 
fine.  The second tries to create a grob from stop-translator-timestep and 
fails.

What am I doing wrong?

This works:

\version "2.19.46"

engraver_demo =
#(make-engraver
   (listeners
     ((note-event engraver event)
      (let ((grob (ly:engraver-make-grob engraver 'TextScript event)))
        (ly:grob-set-property! grob 'text "hi")))))

\layout {
  \context {
    \Voice
    \consists
    \engraver_demo
  }
}

\relative {
  c'8
}

This fails:

\version "2.19.46"

#(define ev #f)

engraver_demo =
#(make-engraver
   (listeners
     ((note-event engraver event)
      (set! ev event)))
   ((stop-translation-timestep engraver)
      (let ((grob (ly:engraver-make-grob engraver 'TextScript ev)))
        (ly:grob-set-property! grob 'text "hi"))))

\layout {
  \context {
    \Voice
    \consists
    \engraver_demo
  }
}

\relative {
  c'8
}

Thanks, Trevor
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to