lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wrong type argument


From: Thomas Morley
Subject: Re: Wrong type argument
Date: Tue, 2 Sep 2014 22:58:12 +0200

2014-09-02 12:44 GMT+02:00 MING TSANG <address@hidden>:
> James & Phil:
> I comment out line 421 which call solfege-engravers - both versions run ok.
> Un-comment out line 421 - v2.19.12 run ok; but fails with v2.19.13.
> I don't know scheme. I cannot not begin debug.
> Appreciated if you can help.
> Emmanuel,
> Ming.

It's more an issue with NullVoice, than with the solfege-engraver.
In NullVoice the following line returns an empty list:
              (tonic-pitch (ly:context-property context 'tonic))
Seems 'tonic is not "known" in NullVoice.

Can't help more, I didn't follow the discussion about NullVoice close
enough and my computer is still broken, acting as a guest on another
computer (until I've the money to buy a new one ...)

Nevertheless, here a boiled down code
(The engraver will cause some terminal-output, all other functionality
is commented)


\version "2.19.13"    % work on v2.19.12 but failes with v2.19.13

#(define numR➀ '("➀" "➁" "➂" "➃" "➄" "➅" "➆"))

#(define (solfege-engraver lst dir)
   (make-engraver
     (acknowledgers
      ((note-head-interface engraver grob source)
       (let* (
              (context (ly:translator-context engraver))
              (tonic-pitch (ly:context-property context 'tonic))
;              (tonic-index (ly:pitch-notename tonic-pitch))
              (event (ly:grob-property grob 'cause))
              (event-copy (ly:event-deep-copy event))
              (grob-pitch (ly:event-property event 'pitch))
              (grob-index (ly:pitch-notename grob-pitch))
;              (delta (modulo (- grob-index tonic-index) 7))
;              (name (list-ref lst delta))
;              (newgrob (ly:engraver-make-grob engraver 'TextScript event-copy))
              )

              (newline)
              (display tonic-pitch)

         ;; clear 'tweaks for newgrob
       ;;  (ly:event-set-property! event-copy 'tweaks '())
;         (if (string= name "Hb")  (set! name "B"))
         ;; Give newgrob 'outside-staff-priority depending on
         ;; grob 'staff-position
;         (set! (ly:grob-property newgrob 'outside-staff-priority)
;               (+ (ly:grob-property newgrob 'outside-staff-priority)
;                  (* dir (ly:grob-property grob 'staff-position))))
;         (set! (ly:grob-property newgrob 'text) name)
;         (set! (ly:grob-property newgrob 'direction) dir)
         )))))


\layout {
  \context {
    \NullVoice
    \consists #(solfege-engraver numR➀ UP)
  }
}

\new Staff
  \new NullVoice
  { d'4 }



Cheers,
  Harm



reply via email to

[Prev in Thread] Current Thread [Next in Thread]