tr-igem / esmuflily

Extension for LilyPond to support SMuFL compliant fonts
http://www.ekmelic-music.org/en/extra/esmuflily.htm
MIT License
1 stars 0 forks source link

Always getting wierd error messages when attempting to use `esmufl` #10

Closed vanleefxp closed 1 month ago

vanleefxp commented 1 month ago

I am working on Lilypond 2.24.4, and I recently heard of esmufl as a powerful LilyPond library for SMuFL support in comparison to openlilylib's SMuFL library. However, when I'm attempting to switch my LilyPond SMuFL library from openlilylib's smufl to esmufl, for every score document there seems to be different types of errors. Even I made a test document using only one example from the PDF document I still got a strange error. I don't know why. Is it possible for me to use esmufl anyway?

If more information is needed I will provide it later.

The source code is:

\version "2.24.4"
\include "./assets/ly/lib/ekmelily/esmufl.ily"

\score {
  \new Staff \with {
    \ekmSmuflOn #'trill
  }
  \relative c'' {
    \ekmSmuflOn #'notehead
    \override NoteHead.style = #'triangle
    c4 a
    \ekmSmuflOff #'notehead
    \revert NoteHead.style
    \autoBeamOff
    a8
    \ekmFlag #'straight
    a <a d> a16 <a d>
    \ekmPitchedTrill #'slash #'bracket
    d2 \ekmStartTrillSpan #­4 e d4 c \stopTrillSpan
    \ekmSmuflOn #'tremolo
    \ekmTremolo unmeasured { c4:16 a: }
    \ekmSmuflOff #'tremolo
    \ekmTremolo unmeasured { c4:16 a: }
  }
  \layout {
    \context {
      \Score
      \ekmSmuflOn #'flag
    }
  }
}

And the error message I get is:

Starting lilypond.exe 2.24.4 [test.ly]...
Processing `C:/Users/<my username>/AppData/Local/Temp/frescobaldi-32ks6vs_/tmpkxnhb12_/test.ly'
Parsing...
C:/Users/<my username>/AppData/Local/Temp/frescobaldi-32ks6vs_/tmpkxnhb12_/test.ly:19:24: error: Guile signaled an error for the expression beginning here
d2 \ekmStartTrillSpan #
                       ­4 e d4 c \stopTrillSpan

Unbound variable: #{\xad;4}#
C:/Users/<my username>/AppData/Local/Temp/frescobaldi-32ks6vs_/tmpkxnhb12_/test.ly:19:23: error: wrong type for argument 1.  Expecting integer, found #<unspecified>
d2 \ekmStartTrillSpan 
                      #­4 e d4 c \stopTrillSpan

Interpreting music...
Exited with return code -1073741819.

Also, for my other two scores, below are the error messages I got respectively (some paths names is replaced by general identifiers wrapped in <>):

Starting lilypond.exe 2.24.4 [etudina-35.ly]...
Processing `<lilypond work dir>/etudina/etudina-35.ly'
Parsing...
Interpreting music...[8][16][24][32][40][48][56][64][72][80][88][96][104][112][120][128][136][144][152][160][168][176][184][192][200][208][216][224][232]
Preprocessing graphical objects...
<lilypond work dir>/etudina/etudina-35.ly:302:86: programming error: cyclic dependency: calculation-in-progress encountered for Beam.direction
  | g4 d'16( c b a | g fs e d c) d c ds | e( c bf gs) a gs a b a fs d c \lowerStaff a
                                                                                     \jsOnceOffset "13" "positions" #'(1.57 . 0.4) [ \upperStaff c d fs] |

<lilypond work dir>/etudina/etudina-35.ly:302:86: continuing, cross fingers
<lilypond work dir>/etudina/etudina-35.ly:302:150: programming error: cyclic dependency: calculation-in-progress encountered for Stem.direction
  | g4 d'16( c b a | g fs e d c) d c ds | e( c bf gs) a gs a b a fs d c \lowerStaff a\jsOnceOffset "13" "positions" #'(1.57 . 0.4) [ \upperStaff c d 
                                                                                                                                                     fs] |

<lilypond work dir>/etudina/etudina-35.ly:302:150: continuing, cross fingers
fatal error: make-ekm-char-markup: Invalid argument in position 1.  Expect: integer, found: (57508 #f 1 . 0.3).
Exited with return code 1.
Starting lilypond.exe 2.24.4 [prelude-2.ly]...
Processing `<lilypond work dir>/prelude-2.ly'
Parsing...
Interpreting music...[8][16][24][32][40]
Preprocessing graphical objects...
<lilypond work dir>/prelude-2.ly:120:72: programming error: cyclic dependency: calculation-in-progress encountered for Stem.direction
\relative c'' { | r16_\exprMark"rit." ds e ds b cs b g fs g fs cs ds e 
                                                                       ds \lowerStaff b | fs1^^ | }

D:/New Homeland/Creations/Music/Scores/Source Files/LilyPond/prelude-2.ly:120:72: continuing, cross fingers
C:/ProgramData/chocolatey/lib/lilypond/lilypond_v2.24.4/lilypond-2.24.4/share/lilypond/2.24.4/ly/init.ly:65:2: error: Guile signaled an error for the expression beginning here
#
 (let ((book-handler (if (defined? 'default-toplevel-book-handler)
In procedure zero?: Wrong type argument in position 1: calculation-in-progress
Exited with return code 1.
tr-igem commented 1 month ago

The first error is caused by a soft hyphen ("shy" U+00AD) instead of the correct minus sign (U+002D) in the pdf for #-4. This is due to the fonts I used for the pdf. I changed this so that copy-paste now works correctly.

The second error - cyclic dependency - is caused by beamed cross-staff notes. This is a new issue (#11) which I'm still trying to fix.

vanleefxp commented 1 month ago

Thanks for the explanation. Hope esmuflily will work for me in the future.

tr-igem commented 1 month ago

Found a solution that should work in most cases. Only (cross-staff) beamed notes with a note-head style like triangle (where the heads are different for up and down stem) can be wrong. But no error messages should occur.

vanleefxp commented 1 month ago

Thanks a lot! I'll try the new version later.