James:
Thank you for answering.
Now I reduce the file and copy & paste the two includes inline. The .ly file
compiles with error.
The same file run ok in v2.19.12
Emmanuel,
Ming
Starting lilypond-windows.exe 2.19.13 [joyful-test.ly]...
Processing `C:/Users/Tsang/Dropbox/Lyndon/HYMN/CP_002/joyful-test.ly'
Parsing...
Interpreting music...
Interpreting music...
Interpreting
music...C:/Users/Tsang/Dropbox/Lyndon/HYMN/CP_002/joyful-test.ly:37:28: In
procedure ly:pitch-notename in expression (ly:pitch-notename tonic-pitch):
C:/Users/Tsang/Dropbox/Lyndon/HYMN/CP_002/joyful-test.ly:37:28: Wrong type
argument in position 1 (expecting Pitch): ()
Exited with return code 1.
Starting lilypond-windows.exe 2.19.12 [joyful-test.ly]...
Processing `C:/Users/Tsang/Dropbox/Lyndon/HYMN/CP_002/joyful-test.ly'
Parsing...
Interpreting music...
Interpreting music...
Interpreting music...
Preprocessing graphical objects...
Interpreting music...
MIDI output to `joyful-test.mid'...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to `joyful-test.ps'...
Converting to `./joyful-test.pdf'...
Success: compilation successfully completed
Completed successfully in 4.4".
On Monday, September 1, 2014 12:14:41 PM, James <pkx1...@gmail.com> wrote:
On 01/09/14 15:20, Phil Holmes wrote:
With your file I get
joyful-joyful-we-adore-thee.ly:23:10: error: cannot find file:
`include_solfege-engraver.ly'
joyful-joyful-we-adore-thee.ly:107:10: error: cannot find file:
`include_extract-music.ly'
error: unknown escaped string: `\ePU'
This is running 2.19.11
Might I suggest that following the advice in
http://lilypond.org/website/tiny-examples.html might enable you to find your
own problem, and would certainly help someone else.
--
Phil Holmes
----- Original Message -----
>From: MING TSANG
>To: lilypond-user mailinglist
>Sent: Monday, September 01, 2014 2:58 PM
>Subject: Wrong type argument
>
>
>I uninstall v2.19.12 and install v19.13 and run a lily file and I got the
>following error. I then run convert-ly; re-run and got the same error.
>The .ly file run without error in v2.19.12.
>Emmanuel,
>Ming.
>
>
>Starting lilypond-windows.exe 2.19.13 [joyful-joyful-we-adore-thee.ly]...
>Processing
`C:/Users/Tsang/Dropbox/Lyndon/HYMN/CP_002/joyful-joyful-we-adore-thee.ly'
>Parsing...
>Interpreting music...
>Interpreting music...
>Interpreting music...
>Interpreting music...
>Interpreting
music...C:/Users/Tsang/Dropbox/Lyndon/HYMN/CP_002/joyful-joyful-we-adore-thee.ly:37:28:
In procedure ly:pitch-notename in expression (ly:pitch-notename tonic-pitch):
>C:/Users/Tsang/Dropbox/Lyndon/HYMN/CP_002/joyful-joyful-we-adore-thee.ly:37:28:
> Wrong type argument in position 1 (expecting Pitch): ()
>Exited with return code 1.
>________________________________
> _______________________________________________
>lilypond-user mailing list
>lilypond-user@gnu.org
>https://lists.gnu.org/mailman/listinfo/lilypond-user
>
_______________________________________________
lilypond-user mailing list lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user
Ming,
Even if you remove the 'includes' lines you still have some
variables referenced that are not in the email.
Doing some very basic troubleshooting I also get
test.ly:36:28: In procedure ly:pitch-notename in expression
(ly:pitch-notename tonic-pitch):
test.ly:36:28: Wrong type argument in position 1 (expecting Pitch):
()
and this 'test.ly:36:28' refers to a line in my test.ly file with
your code cut and paste. and this line is included in the
solfege-engraver function.
#(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))
<------- HERE IS THE LINE BEING REFERENCED!!!!!!!
(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)))
;; 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) )))))
but unless you can simplify this example, I am not sure if anyone
can help (they might be able to guess).
Now I also rememeber a change to this solfege engraver being
discussed in June
http://lists.gnu.org/archive/html/lilypond-user/2014-06/msg00640.html
But I don't use this so I don't know if this is the same as the one
you are using or if you have some other issue.
Simplifying your example would help.
James
\version "2.19.13"
\language "english"
\header {
title = "å¿«æ¨é "
subtitle = "Joyful, Joyful, We Adore Three"
% Remove default LilyPond tagline
tagline = ##f
}
\paper {
#(set-paper-size "letter")
}
#(set-global-staff-size 22)
global = {
\key g \major
\time 4/4
\tempo 4=120
}
%\include "include_solfege-engraver.ly"
#(define syllables '("do" "re" "mi" "fa" "so" "la" "ti"))
#(define sylsâ '("â" "â¡" "â" "â" "â¢" "â" "â£"))
#(define numRâ '("â" "â" "â" "â" "â" "â
" "â"))
#(define number '("1" "2" "3" "4" "5" "6" "7"))
#(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)))
;; 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) )))))
xup = \with { \consists #(solfege-engraver syllables UP) }
xdown = \with { \consists #(solfege-engraver syllables DOWN) }
zup= \with { \consists #(solfege-engraver sylsâ UP) }
zdown= \with { \consists #(solfege-engraver sylsâ DOWN) }
nup= \with { \consists #(solfege-engraver number UP) }
ndown= \with { \consists #(solfege-engraver number DOWN) }
rup= \with { \consists #(solfege-engraver numRâ UP) }
rdown= \with { \consists #(solfege-engraver numRâ DOWN) }
sup= \with { \consists #(solfege-engraver numRâ UP) }
sdown= \with { \consists #(solfege-engraver numRâ DOWN) }
%end of \include "include_solfege-engraver.ly"
verse = \lyricmode {
å å© è·¯ äº! å
å© è·¯ äº! å å© è·¯ äº! å æ¨ æº é ,
è³ äºº å® æ¯ æ ä½³ ç¾. å
å å© è·¯ äº! å å© è·¯ äº! æ±
æ æ å, ç¸ æ ç¸ è¦ª, å 享 屬 ç¥ å¤§ æ¡ æ¬£.
}
%\include "include_extract-music.ly"
%% LSR = http://lsr.dsi.unimi.it/LSR/Item?u=1&id=761
%% LSR = http://lsr.dsi.unimi.it/LSR/Item?u=1&id=545
%% for Lilypond 2.18 or higher.
%% version 2013/04/16 : last change = replace chord-elts->note
%% by chord->note. You can now specified several numbers, to
%% extract several notes at one time
#(define (noteEvent? music)
(eq? (ly:music-property music 'name) 'NoteEvent))
#(define (no-duration? music)
(not (ly:duration? (ly:music-property music 'duration))))
#(define (expand-q-chords music); for q chords : see chord-repetition-init.ly
(expand-repeat-chords! (list 'rhythmic-event) music))
%%%%%%%%%%%%%%%%%%%%%%%%%% extractNote %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#(define tagNotExtractNote (gensym))
#(use-modules (ice-9 receive)) %% for the use of receive
#(define (chord->note chord n . args)
"Return the note n of one chord, keeping articulations.
Other numbers can be specified in args"
(receive (notes others)
(partition noteEvent? (ly:music-property chord 'elements))
(if (null? notes)
chord
(let* ((len (length notes))
(res (filter-map
(lambda(i)
(and (integer? i)
(<= i len)
(> i 0)
(list-ref notes (1- i)))) ; list-ref is zero-based
(cons n args)))
(one-note (cond
((null? res) (list-ref notes (1- len)))
((null? (cdr res))(car res))
(else #f))))
(if one-note
(begin
(ly:music-set-property! one-note 'articulations
(append (ly:music-property one-note 'articulations) others))
one-note)
(make-event-chord (append res others)))))))
#(define (extract-note music n . args)
"Extract the note n of each chords in music, keeping articulations.
If other numbers are given in args, the function returns a chord build with all
matching notes. If no note matches, returns the last note of the chord."
(map-some-music
(lambda (evt)
(cond
((eq? 'EventChord (ly:music-property evt 'name))
(let ((tags (ly:music-property evt 'tags)))
(if (memq tagNotExtractNote tags)
(ly:music-set-property! evt 'tags ; only remove the tag
(delq tagNotExtractNote tags))
(set! evt (apply chord->note evt n args)))
evt))
(else (and (ly:music-property evt 'duration #f) evt))))
(expand-q-chords music)))
%% TO DO : add a parameter optional pred?
extractNote = #(define-music-function (parser location n music )
(number? ly:music?)
(extract-note music n))
% usefull for notExtractNote
tagify = #(define-music-function (parser location tag music)(symbol? ly:music?)
"Add `tag in the tags property of all chords"
(music-map
(lambda (evt)
(if (eq? 'EventChord (ly:music-property evt 'name))
(ly:music-set-property! evt 'tags
(cons tag (ly:music-property evt 'tags))))
evt)
music))
notExtractNote = #(define-music-function (parser location music)(ly:music?)
"Avoids music to be extracted by \\extractNote."
#{
\tagify #tagNotExtractNote $music
#})
%%%%%%%%%%%%%%%%%%%%%%%%%% extractVoice %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#(define tagNotExtractVoice (gensym))
#(define (get-voice voices n)
(let ((len (length voices)))
(list-ref voices (1- ; list-ref is zero-based !
(if (and (<= n len)(> n 0)) n len)))))
#(define (extract-voice music n)
(let loop ((evt music))
(if (no-duration? evt) ; see chord.ly ; notes, rests multi-rests
(let ((e (ly:music-property evt 'element))
(es (ly:music-property evt 'elements)))
(if (ly:music? e)(ly:music-set-property! evt 'element (loop e)))
(if (pair? es)
(case (ly:music-property evt 'name)
((EventChord) evt)
((SimultaneousMusic)
(let ((tags (ly:music-property evt 'tags)))
(if (memq tagNotExtractVoice tags)
(ly:music-set-property! evt 'tags ; only remove the tag
(delq tagNotExtractVoice tags))
(let ((res (map loop (filter (lambda(x)
(not (eq? (ly:music-property x 'name) 'VoiceSeparator)))
es))))
(if (pair? res)(set! evt (music-filter (lambda (x)
(let((name (ly:music-property x 'name)))
(or (not (memq name '(OverrideProperty PropertySet)))
(begin
(if (eq? name 'ContextSpeccedMusic)
(set! x (ly:music-property x 'element)))
x))))
(get-voice res n))))))))
(else (ly:music-set-property! evt 'elements (map loop es)))))))
evt))
extractVoice = #(define-music-function (parser location n music ) (integer? ly:music?)
(extract-voice music n))
notExtractVoice = #(define-music-function (parser location music)(ly:music?)
"Inside an \\extractVoice section, avoids that a part of this section (called
here `music) to be extracted."
#{
\tag #tagNotExtractVoice $music
#})
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% derivated functions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% If you have enter << <c e g> \\ <ais cis fis> >>, the first function will
%% give you c, the second fis
extractPartUpper = #(define-music-function (parser location music )(ly:music?)
#{ \extractNote #1000 \extractVoice #1 $music #})
extractPartLower = #(define-music-function (parser location music )(ly:music?)
#{ \extractNote #1 \extractVoice #1000 $music #})
%%%%%% shortcuts %%%%%%%
#(define ePU extractPartUpper)
#(define ePL extractPartLower)
%%%%%%%%%%%%%%%%%%%%% addNote
#(define (add-note music notes-to-add) ; notes-to-add as music
(define (note->chords-arti note) ; note as a NoteEvent
(receive (note-arti chord-arti)
(partition ; separates arti for NoteEvent from arti for EventChord
(lambda (evt)(memq (ly:music-property evt 'name)
(list 'StringNumberEvent 'StrokeFingerEvent 'FingeringEvent)))
(ly:music-property note 'articulations))
(ly:music-set-property! note 'articulations note-arti)
chord-arti))
(let* ((alist ; a list of pairs of 2 lists : '(notes . articulations)
(reverse (let loop ((m (expand-q-chords notes-to-add)) ; q to chords
(p '())) ; m = music, p previous value of the list
(case (ly:music-property m 'name)
((or SkipEvent SkipMusic) ; a skip in notes-to-add means : add nothing
(cons #f p)) ; add #f to the list
((NoteEvent)
(acons (list m) (note->chords-arti m) p))
((EventChord)
(receive (notes arti) ; separates notes from scripts, dynamics etc
(partition noteEvent? (ly:music-property m 'elements))
(if (pair? notes)(acons notes arti p) p)))
(else (let ((e (ly:music-property m 'element)))
(fold loop
(if (ly:music? e)(loop e p) p)
(ly:music-property m 'elements))))))))
(entry #f) ; will be (car alist)
(entry? (lambda() (and
(pair? alist)
(begin (set! entry (car alist))
(set! alist (cdr alist))
entry))))
(do-add (lambda (notes arti)
(let* ((dur (ly:music-property (car notes) 'duration))
(new-notes (map ; fix all durations to dur
(lambda(evt)(ly:music-set-property! evt 'duration dur)
evt)
(car entry))) ; the list of new notes
(new-arti (cdr entry))) ; the articulations
(append new-notes notes new-arti arti)))))
;; combine in chords, each element of alist with notes of music
(map-some-music
(lambda(x)
(case (ly:music-property x 'name)
((NoteEvent)(if (entry?)
(make-event-chord (do-add (list x) (note->chords-arti x)))
x))
((EventChord)
(if (entry?)(receive (notes arti) ; separates notes from scripts, dynamics etc
(partition noteEvent? (ly:music-property x 'elements))
(if (pair? notes)(ly:music-set-property! x 'elements (do-add notes arti)))))
x)
(else (and (ly:music-property x 'duration #f) x)))) ; #f means : go deeper
(expand-q-chords music))))
addNote = #(define-music-function (parser location music notes)
(ly:music? ly:music?)
(add-note #{\relative c' $music #} ; the 2 music-parameters will
#{\relative c' $notes #})) % be seen in \relative mode
%%%%%%%%%%%%%%%%%%%% addVoice
addVoice = #(define-music-function (parser location music newVoice)
(ly:music? ly:music?)
;; #{
;; <<
;; { \voiceOne $music }
;; \new Voice { \voiceTwo $newVoice }
;; >>
;; \oneVoice
;;#})
#{
<<
$music \\ $newVoice
>>
#})
addVoiceReverse = #(define-music-function (parser location music newVoice)
(ly:music? ly:music?)
#{
<<
{ \voiceOne $newVoice }
\new Voice { \voiceTwo $music }
>>
\oneVoice
#})
%%%%%%%%%%%%%%%%%%%%
deleteDynamics = #(define-music-function (parser location music) (ly:music?)
(music-filter
(lambda (evt)
(not (memq (ly:music-property evt 'name) (list
'AbsoluteDynamicEvent
'CrescendoEvent
'DecrescendoEvent))))
music))
%%%%%%%%%%%%%%%%%%%%%%%%
absolute = #(define-music-function (parser location music) (ly:music?)
"A \\relative command will have no effect in the resulting music."
(make-music 'UnrelativableMusic 'element music))
doubleNote = #(define-music-function (parser location music) (ly:music?)
"Double each note with the note an octave higher."
#{
\addNote \transpose c c' \relative c' { $music } $music
#})
%%%%%%%%%%%%%%%%%%%%%%%%
doubleDur = #(define-music-function (parser location music)(ly:music?)
(music-filter
(lambda (evt)
(let ((dur (ly:music-property evt 'duration)))
(if (ly:duration? dur)
(ly:music-set-property! evt 'duration
(ly:make-duration
(1-(ly:duration-log dur))
(ly:duration-dot-count dur))))
#t))
music))
halfDur = #(define-music-function (parser location music)(ly:music?)
(music-filter
(lambda (evt)
(let ((dur (ly:music-property evt 'duration)))
(if (ly:duration? dur)
(ly:music-set-property! evt 'duration
(ly:make-duration
(1+ (ly:duration-log dur))
(ly:duration-dot-count dur))))
#t))
music))
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%end of \include "include_extract-music.ly"
SA = {
\global
<d'b'>4 4 <d'c''>4 <d'd''>4 |%m01
% <d'd''>4 <<{c''4}\\{e'8 fs'8}>> <g'b'>4 <d'a'>4 |%m02
% <d'g'>4 4 <fs'a'>4 <g'b'>4 |\break %m03
% <g'b'>4. <fs'a'>8 2 |%m04
% <g'b'>4 <d'b'>4 <e'c''>4 <f'd''>4 |%m05
% <f'd''>4 <e'c''>4 <d'b'>4 <e'a'>4 |\break %06
% <d'g'>4 4 <fs'a'>4 <g'b'>4 |%m07
% <fs'a'>4. g'8 2 |%m08
% <fs'a'>4 <d'a'>4 <d'b'>4 g'4 |\break %m09
% <fs'a'>4 <g'b'>8( <fs'c''>8) <g'b'>4 g'4 |%m10
% <fs'a'>4 <<{b'8( c''8)}\\{fs'4}>> <fs'b'>4 <ds'a'>4 |%m11
% <<{g'4}\\{e'8 d'8}>> <cs'a'>4 d'2 |\break %m12
% <d'b'>4 4 <e'c''>4 <f'd''>4 |%m13
% <f'd''>4 <e'c''>4 <d'b'>4 <e'a'>4 |%m14
% <d'g'>4 4 <fs'a'>4 <g'b'>4 |%m15
% <fs'a'>4. g'8 2 |%m16
\bar"|."
\label #'lastPage
}
soprano = { \ePU \SA }
alto = { \ePL \SA }
verseOne = \lyricmode { \set fontSize = #3.0
\set stanza = "1."
å¿« æ¨, å¿« æ¨, æ å å´ æ, 榮 è æ
æ
大 主 å®°; å¥ ç» å¿ é å¨ ä¸» é¢ å,
å¦ å è± æµ å æ¥ é. æ é§, ç é²,
罪 æª, æ é©, æ æ± æ 主 æ¶ é¤ ç¡,
è¬ ç¦ ä¹ æº, æ°¸ æ¨ ä¹ ä¸» è³ ä¸ å
æ 滿 æ å¿.
}
choirPart = \new ChoirStaff <<
\new Staff \with {
%midiInstrument = "choir aahs"
instrumentName = \markup \center-column { "S." "A." }
shortInstrumentName = \markup \center-column { "S." "A." }
} <<
%\SA
\set Staff.printPartCombineTexts = ##f
\partcombine << \soprano>> <<\alto>>
\new NullVoice = "soprano" \rup
{ \voiceOne \soprano }
\new NullVoice = "alto" { \voiceTwo \alto }
%\new Voice = "soprano" { \voiceOne \soprano }
%\new Voice = "alto" { \voiceTwo \alto }
>>
\new Lyrics \with {
\override VerticalAxisGroup #'staff-affinity = #CENTER
} \lyricsto "soprano" \verseOne
>>
\score {
<<
\choirPart
>>
\layout { }
\midi { }
}
%{
convert-ly.py (GNU LilyPond) 2.19.13 convert-ly.py: Processing `'...
Applying conversion: The document has not been changed.
%}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user