lilypond-user
[Top][All Lists]
Advanced

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

Re: translation-type? vs. backend-type?


From: Jean Abou Samra
Subject: Re: translation-type? vs. backend-type?
Date: Sun, 8 Aug 2021 18:48:50 +0200 (CEST)


Le 08/08/2021 18:34, Lukas-Fabian Moser <lfm@gmx.de> a écrit :


Hi,

sorry for the messed-up formatting. I try again:

This is probably a very stupid question.

During my work on updating blackmensural.ly I had to deal with custom
grob and context properties. The original source for 2.12 did the following:

%% ===============================================
% declaring some custom properties
%% ===============================================

%% custom NoteHead property, for \override-able notehead style definitions
#(set-object-property! 'mensural_glyphs 'backend-type? list?)
#(set-object-property! 'mensural_glyphs 'backend-doc "current set of
mensural display settings")

%% custom Voice context property, needed for ligature assembly
#(set-object-property! 'mensural_ligature_queue 'backend-type? list?)
#(set-object-property! 'mensural_ligature_queue 'backend-doc "current
set of note grobs to be assembled into a ligature")
#(set-object-property! 'mensural_accidentals_queue 'backend-type? list?)
#(set-object-property! 'mensural_accidentals_queue 'backend-doc "current
set of accidentals to be collected for a ligature")

%% custom entry in an event's 'tweak property
#(set-object-property! 'mensural_tags 'backend-type? list?)
#(set-object-property! 'mensural_tags 'backend-doc "various tags set in
a notehead tweak to control mensural note display")

The actual code then accessed

a) mensural_glyphs with what amounts to \override
NoteHead.mensural_glyphs = ...
b) mensural_ligature_queue with (ly:context-property some-context
'mensural_ligature_queue) and (what amounts to) \set
mensural_ligature_queue = ...
c) mensural_tags with (ly:grob-property some-note 'mensural_tags) (and
in a tweak).

Part b) failed with current LilyPond: "can't find property type-check
for `instrument' (translation-type?)" (I'm not sure if a) and c) work or
just were not being in an active code path).

Now, looking at scm/define-context-properties.scm and
scm/define-grob-properties.scm that there seems to be a distinction:

- Context properties (\set'table) are defined via (set-object-property!
symbol 'translation-type? type?)
- Grob properties (\override'able) are defined via (set-object-property!
symbol 'backend-type? type?)

Is this correct?

To my knowledge, yes.

And if so, when did this change between 2.12 and 2.22,
seeing as the above code seems to have worked in 2011?

No idea, sorry.

Best,
Jean

It works fine in
2.22 if I define mensural_ligature_queue using 'translation-type?

Lukas

reply via email to

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