Hi,

I’m trying to use an engraver that was shared on the lilypond-user list in 2012:

https://mail.gnu.org/archive/html/lilypond-user/2012-03/msg00363.html 
<https://mail.gnu.org/archive/html/lilypond-user/2012-03/msg00363.html>

This engraver draws a frame around notes, followed by an arrow.

I’ve been able to update this engraver so that it can be used in more recent 
versions of LilyPond; this is available at

https://github.com/nwhetsell/lilypond-frame-engraver/blob/main/frame-engraver.ily
 
<https://github.com/nwhetsell/lilypond-frame-engraver/blob/main/frame-engraver.ily>

This engraver works when a score has a single staff, but compilation fails when 
a score has multiple staffs:

/usr/local/Cellar/lilypond-unstable/2.25.3/share/lilypond/2.25.3/ly/init.ly:64:2:
 error: Guile signaled an error for the expression beginning here
#
 (let ((book-handler (if (defined? 'default-toplevel-book-handler)
In procedure ly:grob-property: Wrong type argument in position 1 (expecting 
Grob): ()

I can compile successfully if I comment out what happens in lines 183–6—

https://github.com/nwhetsell/lilypond-frame-engraver/blob/310c2f0776c217fcc486e933badde6a56940f9c1/frame-engraver.ily#L183-L186
 
<https://github.com/nwhetsell/lilypond-frame-engraver/blob/310c2f0776c217fcc486e933badde6a56940f9c1/frame-engraver.ily#L183-L186>

—like this—

           ;(if (ly:stream-event? (cdr event-drul))
           ;    (begin (set! stub (ly:engraver-make-grob trans 'FrameStub (cdr 
event-drul)))
           ;           (ly:grob-set-property! stub 'direction RIGHT)
           ;           (ly:grob-set-object! stub 'frame span)))
       ))

—but I can only get frames in one staff (and it must be the first staff).

Because this engraver doesn’t mention staffs at all, I’m not sure how this is 
happening or how to fix it, and I’m hoping I’m missing something simple. Any 
help would be greatly appreciated! A small test program follows.

Many thanks,
Nate

\version "2.22.0"

\include "frame-engraver.ily"

music = \relative c'' {
  \override Stem.transparent = ##t
  \override Beam.transparent = ##t
  \once \override Frame.extender-length = #8
  \frameStart dis'8[ e f \frameEnd ges] s2
}

\score {
  <<
    \new Staff {
      \music
    }
    \new Staff {
      \music
    }
  >>
}

\layout {
  \context {
    \Global
    \grobdescriptions #all-grob-descriptions
  }
  \context {
    \Voice
    \consists \frameEngraver
  }
}

Reply via email to