Recorder fingering diagrams in lilypond

(OR: Adventures in scheme)

Include file: recorder-fingerings.ly

Summary

The functions

  • recorder-diagram takes as its argument a "size" and a list of holes, and creates a piece of markup representing the recorder diagram, scaled to size, with the specified holes (or half-holes) covered. The holes are named as:
    thumbthumb hole covered
    thumbhfthumb hole half covered (horizontal)
    one...five, onehf...fivehfhole $n covered / half covered (vertical)
    sixl, sixrbig sixth hole covered, small sixth hole covered
    pinkyl, pinkyrbig seventh hole covered, small seventh hole covered


    They can be listed in any order.
  • myxxFingerings is a chart for the recorder xx. I added charts for the alto F and the descant; macros for tenor and sopranino simply refer to (transpositions of) these. The charts have a little introductory code and a series of lines like:
    	    ; C# or Db4
        ((= (ly:pitch-semitones pitch)
                1)
          (recorder-diagram size '(thumbhf one two three four five sixl sixr pinkyl)
    	    ))
    where the number (here 1) is the lilypond numeric representation for the absolute pitch (middle C is 0), and we provide the list of holes to cover. It calls recorder-diagram and returns the piece of markup with the chart.
  • finger and addf take an object of type ly:music and print the diagram markup as lilypond NoteNames for the music.

    How to use it

    How to modify it

    References / credits

    Notes

    Another "obvious" way to do this (and my initial idea), rather than implementing the recorder diagram markup from scratch, would have been to patch the .scm files display-woodwind-diagram.scm and define-woodwind-diagram.scm, modifying e.g. the tin whistle diagram with the double holes at the bottom and the thumb hole at the top (or at the side, to taste), as done by a user on the lilypond mailing list (2017) for an eight-holed instrument. The fingering charts and \addf function would then have been defined using the lilypond built in syntax for woodwind diagrams, rather than the locally defined recorder-diagram.

    However, I couldn't find out how to create a patch in a local file that will then just extend the lilypond built-ins. It seems you have to actually modify the system files. I didn't think this was a suitable solution for our use case...


    (*) A bonus point if you can name the piece this comes from (Back)