Hello? LilyPond?

Further Adventures in LilyPond

Ok, this is a very naive exploration of what needs to be done in the hands of someone who, sure, knows how to code in elisp but hasn’t since long before the whole Doom Emacs renaissance and use-package and countless other things, plus, being lazy, I won’t read the code unless it’s the last option. So …

On a tip from Ihor Radchenko (@yantar92@emacs.ch):

The problem with full page might be related to new versions of LilyPond that changed the defaults of how the page is rendered. You may try the latest development Org branch – we have adjusted things to work with the latest LilyPond release.

I cloned the org-mode git repo into ~/.emacs/src/, added the requisite texinfo and texi2html packages, then ran sudo make install naively hoping that’s enough to replace the system version because I haven’t read what the process actually does. I could, of course, whereas you, if you are using Big Tech tools, almost certainly can’t, but I digress. Restarting Emacs was uneventful, so I inserted that org-bable-do-load-languages lisp code block (here hidden) and then the example notation snippet.

 

\version "2.24.1"
\layout {
  #(layout-set-staff-size 25)
  \context {
    \Score
    \override SystemStartBracket.after-line-breaking =
    #(lambda (grob)
     (if (defined? 'default-toplevel-book-handler)
       (let ((Y-off (ly:grob-property grob 'Y-extent)))
         (ly:grob-set-property! grob 'Y-extent
           (cons (- (car Y-off) 1.7) (+ (cdr Y-off) 1.7))))))
  }
}
\new StaffGroup << 
\new Staff = "up" {
  \voiceOne
\relative c' {
    d'  e fis g a b   c d e fis g a
}
} 
\new Staff = "up" {
  \voiceTwo
\relative c' {
    a' b cis d e fis g a b cis d e
}
}
\new Staff = "down" {
  \voiceThree
\relative c' {
    d  e fis g a b   c d e fis g a
}
}
>>

On my first attempts, the block would only show as source, colourized and formatted, and using C-c C-c on the block itself complained that org-babel had no command for LilyPond, although checking on customize-group I see that it does, so I close that, not saving, and try again, and now I get the proper thing although, as seen above, I can no longer use plain #+begin_src lilypond to show my source, but I do get my beautifully engraved music, sort of:

dulcimertones.png

Which is now properly cropped, but clearly something is still not quite right as those two initial clefs have appeared out of nowhere1 and neither #+CAPTION nor #+DESCRIPTION will show! To be honest, I had cobbled a naive example not completely understanding the language; it seemed correct with the old org-mode, so perhaps an artifact of the new LilyPond? Nonetheless, far closer to what I needed it to be, although I really have no idea how I got there.

There was another problem…

On an early try, I ran into this:

 

font-lock-default-fontify-region: Symbol’s value as variable is void: font-lock-reference-face

Apparently that variable has been deprecated forever and, well, now it is gone, but this is fixed by adding

 

(setq font-lock-reference-face 'font-local-constant-face)

to my init.el, although now I get warnings saying font-local-constant-face is not found. But I still do get a page (plus some noise) and that’s progress!

Footnotes:

1 Pointers to good LilyPond troubleshooting references are most welcome! As are pointers on how to troubleshoot this extra-empty-P-tag footnote issue.

 

Author: garym

the reality of me is just me

One thought on “Hello? LilyPond?”

  1. @garym @yantar92I keep getting closer! And I really don't understand why other seniors bide their time with crosswords and sudoku puzzles when all they really need is a spare computer and a reckless attitude; there's no end of not just engaging brain entertainment, but also making new friends in the process!And I still haven't completely puzzled out why my footnotes go so wrong! 🤪

Comments are closed.