Hi Knut,

Nice work on the videos.  Just a couple quick thoughts.

On 07/17/2017 02:30 AM, Knut Petersen wrote:
B) Is there a practical way to redefine color? within a .ly file in a way that it is recognized
by lilyponds code?

I take it you have tried this?

#(define (color? ...) ...)

In the after-line-breaking function I give color the objects ... well, not really:
I abuse the color property to encode the moment and duration of the
color change.

Would it help to define your own custom properties (grob or context) to avoid overloading the color property. I have this in my include file for Clairnote:

#(let*
  ;; translator-property-description function
  ;; from "scm/define-context-properties.scm" (modified)
  ((context-prop
    (lambda (symbol type?)
      (set-object-property! symbol 'translation-type? type?)
(set-object-property! symbol 'translation-doc "custom context property") (set! all-translation-properties (cons symbol all-translation-properties))
      symbol))

   ;; define-grob-property function
   ;; from "scm/define-grob-properties.scm" (modified)
   (grob-prop
    (lambda (symbol type?)
      (set-object-property! symbol 'backend-type? type?)
      (set-object-property! symbol 'backend-doc "custom grob property")
      symbol)))

  (context-prop 'myfoo list?)

  (grob-prop 'mybar integer?)
  ;; etc...
  )

Then I can use my custom properties just like the built-in ones.

-Paul


_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to