Hi Gabriel,
Am 20.01.26 um 11:45 schrieb Gabriel Ellsworth:
Has anyone created custodes with the modern (stemless) note head style?
The topic came up here in 2013
<https://lists.gnu.org/archive/html/lilypond-user/2013-05/msg00376.html>but
was not resolved. I would like to add custos notes to a score in which
I am transcribing Gregorian chant in modern (stemless) notation.
To take this up once more:
In the 2013 discussion, 'ghe' remarked that the Custos code is in two
C++ files, namely
lily/custos-engraver.cc
lily/custos.cc
The first one is the 'engraver' which collects notes and creates
abstract Custos grobs. This can easily be translated to Scheme, and I
did that yesterday - that way, knowledgeable users can manipulate the
Custos machinery at will without touching the C++ code. (I would guess
that it's not impossible to get that version into the regular LilyPond
codebase.)
The interesting part is in the second file: The custos::print function
that selects the Custos glyph. It's not hard to add a 'modern' custos
style there that simply takes a stem-less modern notehead, but in the
present state, this has to be done in C++.
Currently, since Harm added the feature of having custodes with ledger
lines, the Custos creation is split up between C++ and Scheme: The C++
machinery creates a stencil, a Scheme function then takes this stencil
and adds ledger lines. I don't find this particularly elegant; probably
the custos::print function should be ported to Scheme anyway. This is
also feasible, but I don't understand part of the internals workings
well enough (to wit, what's the proper Scheme equivalent to
Staff_symbol_referencer::get_rounded_position?) to do this right now.
Lukas