LilyPond and LilyJAZZ

Yes, LilyPond can do Jazz in some fancy jazz-like style! Thanks to Torsten Hämmerle and his marvelous work, this is now possible.

EDIT: This content has been superseded by the work of Abraham Lee. Jump to the more recent post for more current instructions and lots more content.

The more or less “official” source for the latest preliminary version of LilyJAZZ can be obtained from:
lists.gnu.org/archive/html/lilypond-user/2013-03/msg00647.html

After extracting the attached zip file, you will find four files:

  • LilyJAZZ.otf (the font file for note heads and stuff)
  • LilyJAZZText.otf (the font file for letters)
  • LilyJAZZ.ily (a LilyPond file to be included in your file)
  • jazz-test-3.ly (a test file)

The installation is simple: first, install the two font files on your system so that LilyPond can
find them. After that, just type

lilypond jazz-test-3.ly

to compile the test file. If the fonts are installed properly, your should get a nice
Realbook-like sheet.

To use that style in your own LilyPond documents, you have to put

\include "LilyJAZZ.ily"

in your document. To tell LilyPond that you wish to use the jazz fonts, use

\jazzOn

and voilá: that’s all.

\version "2.17.25"
\include "LilyJAZZ.ily"

\score {
  \new Staff {
    \jazzOn
    c'4 c' \tuplet 3/2 { d'8-- es'-- e'-- } g'4 ~ |
    g'4 r r8 f'-^ \noBeam es' c'-> \bar "|."
  }
}

will result in:

lilyjazz.preview

Of course to make the Jazz style permamently available you should include LilyJAZZ.ily into LilyPond’s search path.

35 thoughts on “LilyPond and LilyJAZZ

  1. Peter Crighton

    That’s fantastic! Personally, I’m not a fan of such a jazz font style, but being able to use it makes LilyPond quite a bit more versatile and maybe more appealing for a lot of possible users. And who knows, maybe I have a use for it, too, sometime. 😉

    Reply
  2. Federico Bruni

    It’s awesome, thanks to Torsten and Marc!

    Note for Linux users: click on the .otf files, the Font viewer will open the file and you can click on the install button. The files are then copied in ~/.local/share/fonts

    Reply
  3. Janek Warchoł

    This is great!
    Marc, do you think we could put this package somewhere where it won’t get forgotten, and where it could be easily updated and developed further? Some git repository would be perfect for this, does Torsten use git?

    Janek

    Reply
    1. Urs Liska

      That’s true. A public git repository could also increase the probability of further development.
      What I’m asking myself even more is: Is there a chance to make this go into LilyPond itself?

      Reply
  4. Joe Austin

    I’ve been developing my own “shape-note” font (a different note head symbol for each of the 12 chromatic pitches). I’d think I could adapt this technology to my font. Do you have any guidance in how to proceed?

    Reply
  5. Masaru

    Great improvement for LilyPond!

    If I could request an improvement, when I add “chords” to a melody staff (like in Real Book), the alterations in chords seems not covered by “LilyJAZZ Text” font (nor by “LilyJAZZ”) font.

    grille = \chords {
      \override ChordNames . ChordName #'font-name = #"LilyJazz Text"
      as1/bes | as2:m7 / bes g4.:7 c8:m7 | s4. e8:7 f4:7 fis:7 | g4.:7 g2:7+ s8
    }
    

    The flat and sharp beside the chord’s primary note are thicker than normal, it’s good, but look different from those in the staff.

    Do I have a work around, such as specifying multiple font-name? (maybe there’s a way…) I just tried putting

    \override ChordNames . ChordName #'font-name = #"LilyJAZZ Text, LilyJAZZ"
    

    but no visible effect…

    Reply
  6. Steve Noland

    On a Mac, when trying to compile the jazz-test-3.ly file, I get the following error from Lilypond re: the LilyJAZZ.ily file:

    Starting lilypond 2.17.27 [jazz-test-3.ly]…
    Processing `/Users/snoland/Downloads/LilyJAZZ/jazz-test-3.ly’
    Parsing…
    Interpreting music…
    Preprocessing graphical objects…/Users/snoland/Downloads/LilyJAZZ/LilyJAZZ.ily:151:16: In expression (key-signature-interface::alteration-position (car alt) (cdr alt) …):
    /Users/snoland/Downloads/LilyJAZZ/LilyJAZZ.ily:151:16: Unbound variable: key-signature-interface::alteration-position
    Exited with return code 1.

    What could be the problem?

    Thanks,
    Steve

    Reply
    1. Steve Noland

      I forgot – here is a snippet from the LilyJAZZ.ily that contains the above line:

      %***********************************************************************
      % KEY SIGNATURES
      %***********************************************************************
      
      #(define (jazz-keysig grob)
         “stencil: jazz key signature (including cancellation)
         (let* ((altlist (ly:grob-property grob ‘alteration-alist))
                (c0pos (ly:grob-property grob ‘c0-position))
                (keysig-stencil ‘()))
           (for-each (lambda (alt)
                       (let* ((alteration (if (grob::has-interface grob ‘key-cancellation-interface) 0 (cdr alt)))
                              (glyphname (assoc-get alteration jazz-alteration-glyph-name-alist “”))
                              (padding (cond
                                        ((< alteration 0) 0.25) ; any kind of flat
                                        ((= alteration 0) 0.05) ; natural
                                        ((< alteration 1) 0.1) ; sharp (less than double sharp)
                                        (else -0.4))) ; double sharp
                              (ypos (key-signature-interface::alteration-position (car alt) (cdr alt) c0pos))
                              (acc-stencil (grob-interpret-markup grob (markup #:raise (/ ypos 2) #:jazzglyph glyphname))))
                         (set! keysig-stencil (ly:stencil-combine-at-edge acc-stencil X RIGHT keysig-stencil padding)))) altlist)
           keysig-stencil))
      
      Reply
  7. Stefan Vollmar

    On the Mac (MacOS 10.8), installing the fonts can apparently also be done by double-clicking the otf-files. Here, the application is “Font Book”. jazz-test-3.ly compiled without warning or error. However, this results in “Chinese” characters in the PDF file for the jazz-test-3.ly example. On my system, the system-wide availability of the LilyJAZZ-fonts was not relevant: the correct way to install the font files for me was to copy them to /Applications/LilyPond.app/Contents/Resources/share/lilypond/current/fonts/otf and I am happy to say that the PDF looks beautiful now. Thank you for what I think is a very valuable addition to lilypond’s capabilities! Warm regards, Stefan

    Reply
  8. Denis Bitouzé

    LilyJAZZ is indeed very nice. The only real trouble I get with it for the tempo : the following MCE shows that the quarter note doesn’t appear.

    \version "2.16.2"
    
    \include "LilyJAZZ.ily"
    
    global = {
      \jazzOn
      \tempo 4=100
    }
    
    music = \relative c' {
      \global
      c
    }
    
    \score {
      \new Staff \music
      \layout { }
    }
    
    Reply
    1. Janek Warchoł

      Hmm, interesting. Please report this on the LilyPond-user mailing list, you’ll probably get some assistance there.

      Reply
    2. Jim Long

      Thanks to (I believe) Harm’s dedicated work, tempo indications now work as expected with LilyJAZZ as of 2.17.95!

      Reply
        1. Urs Liska

          Scroll up on this page and look out for “Thomas Morley”. Maybe the link in his comment is what you’re looking for?

          Once more for all: If there’s anybody out there having a working and “the latest” version of LilyJAZZ available we’d really like to add it to the openLilyLib snippets repo beside the new SMuFL adaptor. Please add something there or get in touch with us.

          Reply
  9. kuluse

    Hi!
    Great job really! Congrats

    Just an improvement : when I use \jazzOn the bars are not numbered anymore.
    They are if I comment the line “\jazzOn”
    I’m on lilypond 2.18.0

    Anyways thanks a lot, this is really useful for me as I am a jazz composer, arranger and also a student in jazz.

    Reply
    1. kuluse

      And also for the drums in \drummode : the headnotes are changed for normal headnotes. Usually hihat or cymbals have a cross as headnote

      Reply
    2. Marc

      Hi,

      Concerning \jazzOn and bar numbers:
      Just add

      \revert Score.BarNumber.stencil

      right *after* \jazzOn, this should bring you the bar numbers back.

      Reply
  10. Pingback: SMuFL Fonts in LilyPond | Scores of Beauty

  11. Pingback: LilyPond’s Look & Feel | Scores of Beauty

  12. steve

    please, where is lilypond’s search path? i’m using linuxmint, and lilypond is installed in usr/share

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *