Hi all

Can anybody explain why adding both the Scale_degree_colored_notes_engraver and the Ambitus_engraver to a voice results in an "Exited with return code 1" error.

C:/Users/steff/AppData/Local/frescobaldi/frescobaldi/lilypond-binaries/lilypond-2.25.31/share/lilypond/2.25.31/ly/init.ly:66:2: error: Guile signaled an error for the expression beginning here

#

(let ((book-handler (if (defined? 'default-toplevel-book-handler)

In procedure ly:event-property: Wrong type argument in position 1 (expecting Stream_event): #f

Exited with return code 1.

Find attached the relevant part of the --verbose log output (local paths replaced).

As soon as I comment out one of them I get the expected result of the remaining engraver. But I'd like to have both of them.

Any ideas?

- Stephan


%%% MWE Snippet

\version "2.25.31"

#(define Scale_degree_colored_notes_engraver
   (make-engraver
    (acknowledgers
     ((note-head-interface engraver grob source-engraver)
      (let* ((context (ly:translator-context engraver))
             (tonic-pitch (ly:context-property context 'tonic))
             (tonic-name (ly:pitch-notename tonic-pitch))
             (grob-pitch
              (ly:event-property (event-cause grob) 'pitch))
             (grob-name (ly:pitch-notename grob-pitch))
             (delta (modulo (- grob-name tonic-name) 7))

             ;; vector of colors indexed by scale degree (0–6)
             ;; red for tonic, green for dominant
             (colors
              (vector
               (x11-color 'red)
               (x11-color 'black)
               (x11-color 'black)
               (x11-color 'black)
               (x11-color 'green)
               (x11-color 'black)
               (x11-color 'black)))

             ;; select color for this note
             (note-color (vector-ref colors delta)))

        ;; set notehead color
        (ly:grob-set-property! grob 'color note-color))))))


\layout {
  \context {
    \Voice
    \consists Ambitus_engraver % try commenting out
    \consists \Scale_degree_colored_notes_engraver % try commenting out
  }
}

\score {
  \relative c'' {
    \time 6/8
    \key c \major
    g8 c c c d16 c b c
  }
}
Interpreting music...
[[PATH_TO_FRESCOBALDI]]/frescobaldi/frescobaldi/lilypond-binaries/lilypond-2.25.31/share/lilypond/2.25.31/ly/init.ly:66:2:
 error: Guile signaled an error for the expression beginning here
#
 (let ((book-handler (if (defined? 'default-toplevel-book-handler)
[[PATH_TO_FRESCOBALDI]]/frescobaldi/frescobaldi/lilypond-binaries/lilypond-2.25.31/share/lilypond/2.25.31/scm/lily/lily.scm
In ice-9/boot-9.scm:
  1755:12 16 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
In unknown file:
          15 (apply-smob/0 #<thunk 169fc014300>)
In 
/home/lily/lilypond-2.25.31/release/binaries/lilypond/build/out/share/lilypond/current/scm/lily/lily.scm:
  1145:16 14 (lilypond-main _)
   1174:4 13 (lilypond-all 
("[[USER_HOME]]\\AppData\\Local\\Temp\\frescobaldi-3cglhi2l\\tmpe3k_ltdr\\document.ly"))
In srfi/srfi-1.scm:
    634:9 12 (for-each #<procedure fc47d330 at 
/home/lily/lilypond-2.25.31/release/binaries/lilypond/build/out/share/lilypond/current/scm/lily/lily.scm:1175:5
 (x)> 
("[[USER_HOME]]\\AppData\\Local\\Temp\\frescobaldi-3cglhi2l\\tmpe3k_ltdr\\document.ly"))
In 
/home/lily/lilypond-2.25.31/release/binaries/lilypond/build/out/share/lilypond/current/scm/lily/lily.scm:
   1186:9 11 (_ 
"[[USER_HOME]]\\AppData\\Local\\Temp\\frescobaldi-3cglhi2l\\tmpe3k_ltdr\\document.ly")
In ice-9/boot-9.scm:
  1749:15 10 (with-exception-handler #<procedure fc47d300 at 
ice-9/boot-9.scm:1853:7 (exn)> _ #:unwind? _ #:unwind-for-type _)
In unknown file:
           9 (ly:parse-file 
"[[USER_HOME]]\\AppData\\Local\\Temp\\frescobaldi-3cglhi2l\\tmpe3k_ltdr\\document.ly")
In ice-9/boot-9.scm:
  1755:12  8 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
In unknown file:
           7 (apply-smob/0 #<thunk 169fcd93640>)
           6 (ly:book-process #<Book> #< Output_def> #< Output_def> "document")
           5 Exception thrown while printing backtrace:
precondition failed
In procedure ly:event-property: Wrong type argument in position 1 (expecting 
Stream_event): #f
Exited with return code 1.

Reply via email to