Using non-standard clef positions and adding customized clef definitions

LilyPond supports a number of pre-defined clefs, all of which show the clef symbol on some staff line. If you need the clef symbol between two lines, say, you can either manually set Staff.clefGlyph, Staff.clefPosition, and Staff.middleCPosition to the appropriate values, or you can add your own clef definition so that you can use \clef myCustomClef, for example. This can be achieved by using the add-new-clef function which has the form:

(add-new-clef "myCustomClef" "clefs.GLYPH" clef-position octavation c0-position)

The parameters are as follows.

"myCustomClef" is the name of the new clef.

"clefs.GLYPH" describes the actual clef glyph (e.g., "clefs.g" for the treble clef, "clefs.neomensural.c" for the neomensural c glyph, etc.).

clef-position determines the position of the clef, counted from the center line of the staff. For example, a value of 1 means the clef is shown between the center line and the line above, 4 means the clef is shown on the top line, -2 means it is shown on the second line of the staff.

octavation describes the octave transposition, which is typically 0.

c0-position determines the position of middle C on the staff relative to clef-position. For example, a value of -2 means middle C will be two staff positions (lines or spaces) below clef-position.