lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Writing Scheme in Lilypond to control glyph used for custom custos funct


From: Matthew Fong
Subject: Writing Scheme in Lilypond to control glyph used for custom custos function
Date: Sun, 7 Mar 2021 17:26:23 -0800

Hello everyone,


I'm writing a function that places a custos after the double bar to give singers an indication of the pitch of their next note. Usually, custos are are used within a piece, but in chant, I have verses that are part of new scores, and it is helpful to indicate the pitch of the first note.


I wanted to custos to be consistent with the intra-piece custos as I have set it up, that is, 


1/ Notes on the ledger line up until b' use custodes.vaticana.u1 (long stem up)

2/ Notes in between the ledger up until b' use custodes.vaticana.u0 (short stem up)

3/ Notes on the ledger line from b' use ustodes.vaticana.d1 (long stem down)

4/ Notes in between the ledger from b' use custodes.vaticana.d0 (short stem down)


And this should work regardless of the key signature of the piece (since things might get transposed).


May I get some pointers of how the logic might be coded up?


Here is what I have so far, with help from this list, and taken from 

https://lilypond.org/doc/v2.20/Documentation/notation/substitution-function-examples


addCustos =

#(define-music-function (noteList)

(ly:music?)

#{

\tweak NoteHead.stencil #ly:text-interface::print

\tweak NoteHead.font-size #3

\tweak NoteHead.text \markup {

\musicglyph "custodes.vaticana.u1"

}

\tweak Stem.stencil ##f

$(first (music-pitches noteList)) 4

#}

)



Many thanks,
mattfong

reply via email to

[Prev in Thread] Current Thread [Next in Thread]