Easier Lilypond coding with Context

Submitted by Frederic Marand on

A few months ago, I discovered the Lilypond music typesetting system, and thought I had stumbled upon some sort of holy grail: here was an open source system which, at last, allowed me to write music much like program code, and did not jump me through the hoops of a UI in order to create scores and the MIDI files representing them.

After years of Pro24, Cubasis, Cubase, ProTools, Jazz++, Cakewalk, Reason and a number of other less successful products, each of which would store my music in a proprietary format, and produce less than stellar scores to bring to the studio, it was refreshing to find a tools with which I could create music in a human-readable and text-editable format.

...Which of course required a choice of editor. Now, Lilypond has already several dedicated editors or plugins for various editors, not even mentioning Lied, or Roudoudou for the born adventurer. But none of these editors was familiar, and my favorite editor on Windows happens to be Context. So what ?

Actually, although Context is definitely not a Lilypond IDE like Lilypond for jEdit, it can be made quite comfortable, in three steps:

  1. install one of the existing Lilypond highlighters for Context, available from Context.cx: I tend to favor the first of these two, but this is a matter of personal preference anyway.
  2. install the Lilypond PDF help to C:\Program Files\Lilypond\doc. This will allow use of F1 to read the doc
  3. map F9 to F11 in Options/Environment Options/Execute Keys:
    • F9: compile. Point to the Lilypond.exe binary ; Parameters: %n, and check Capture Console Output and Scroll console to the last line
    • F10: view score. Point to the PDF reader on your machine ; Parameters: "%p%F.pdf" (do not forget the double quotes). Select a Maximized window for easier reading
    • F11: listen to midifile. Point the the MIDI reader on your machine, possibly Windows Media Player ; Parameters: "%p%F.midi" (did I already write not to forget the double quotes ?)

If your version chokes on the Lilypond.pdf help file, you are probably using an older version of Context: version 0.95 runs winhlp32 to activate help, so this does just not work on it. Update to a more recent version (today's current is 0.98.5).