lilypond-devel
[Top][All Lists]
Advanced

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

Proposal: support for custom grob and context properties


From: Paul
Subject: Proposal: support for custom grob and context properties
Date: Tue, 27 Sep 2016 17:45:58 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

Hi all,

It would be nice if LilyPond supported user-defined grob and context properties, for use in users' code -- in the spirit of practical software freedom and to further LilyPond's excellent extensibility. It would also be handy for prototyping code that might end up in LilyPond.

Harm recently used custom properties in his BendSpanner-engraver, and I use them in my code for alternative notation systems.

Currently this requires finding and copy/pasting the relevant scheme procedures so they can be used in your own files. Namely, define-grob-property from scm/define-grob-properties.scm and translator-property-description from scm/define-context-properties.scm.

Here are two possibilities for making this easier:

1. Make those two procedures "define-public" so users can just use them to define their own properties. This requires very minimal change to LilyPond code, and is convenient for users since existing functions will just work for accessing and setting their custom properties (e.g. ly:grob-property).

2. Define a "custom-properties" grob property and a "customProperties" context property (or whatever name) that each holds an alist of user properties. This adds additional properties to LilyPond and is a little more complex for the user to work with, but it provides isolation from LilyPond's properties. (For example, users would only have to worry about conflicts with other user-defined properties, not conflicts with current or future LilyPond properties.)

I'm interested in implementing this one way or another. Using the same approach for grob and context properties would make sense.

Thoughts?
-Paul



reply via email to

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