lilypond-user
[Top][All Lists]
Advanced

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

property syntax (was Re: constructive criticism)


From: John Williams
Subject: property syntax (was Re: constructive criticism)
Date: Fri, 9 Jan 2004 11:06:50 -0700 (MST)

On Thu, 8 Jan 2004, Mats Bengtsson wrote:
> The step from basic to advanced user is clearly a major threshold but
> does not involve learning all about Scheme but rather to learn the
> mechanisms to set properties and the syntax used. The sections on
> "Setting Variables" and "Fine Tuning layout" in the Tutorial try
> to explain these aspects.

I think a unified and simplified property syntax above would help lower
the treshhold.
Currently we have:

  Context properties:
     \property Context.propName = #value
     \property Context.propName \unset
  Object properties:
     \property Context.ObjectName \set #'prop-name = #value
     \property Context.ObjectName \override #'prop-name = #value
     \property Context.ObjectName \revert #'prop-name
     \once \property Context.ObjectName \set #'prop-name = #value
  Context properties in a translator:
     \translator { \NameContext propName = #value }
  Object properties in a translator:
     \translator { \NameContext ObjectName \set #'prop-name = #value }

How about this instead?

\set Staff.instrument = #"Clarinet"
\set Staff.instr = #"Clar."
\unset Staff.instr
  (Would override and revert on context properties make sense?)
\set PianoStaff.createKeyOnClefChange = ##t
\set Staff.Slur.dashed = #1
\override Staff.Stem.thickness = #4
\revert Staff.Stem.thickness
\once Staff.Stem.thickness = #4
\once Voice.NoteHead.style = #'diamond

% This one is a bit strange. Are there any others like autoBeamSettings?
\override Voice.autoBeamSettings.(end * * * *) = #(ly:make-moment 1 4)

Translator sections can do a lot more than just set properties,
but maybe we could still keep a consistent syntax in the
contemplated \with and \apply sections.

\with {   % or \apply ?
  \set Staff.systemStartDelimiter = #'SystemStartBrace
  \set Score.RehearsalMark.padding = #1.5
}


What do you think of that, Han-Wen?

It's not new functionality; just simplifying the syntax.

~ John Williams






reply via email to

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