[Top][All Lists]

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

Re: How to do this correctly?

From: Carl Sorensen
Subject: Re: How to do this correctly?
Date: Thu, 28 Jan 2010 06:44:30 -0700

On 1/28/10 6:25 AM, "David Kastrup" <address@hidden> wrote:

> Neil Puttock <address@hidden> writes:
>> 2010/1/27 Carl Sorensen <address@hidden>:
>>> I don't think there is a way to do this better as the code sits now.  The
>>> accidentals in the ambitus are AmbitusAccidentals, and are create by the
>>> Ambitus_engraver, so the standard accidental styles (which might do what you
>>> want) don't apply.
>> Agreed.  I think you'd have to add a property to the Ambitus_engraver
>> which tells it to ignore the key signature.
> Well, I don't like extra interfaces.  I would be quite interested to
> know why the posted code actually works, engraving the proper key and
> using correct accidentals for it.  Is it because the Ambitus engraver
> pulls its signature from the Voice context (where the engraver sits),
> while the standard accidental engraver and key signature engraver take
> it (unmodified) from the Staff, where it presumably is set by the \key
> command?  Then probably per-voice accidentals would cease working.

I haven't looked thoroughly into this, but I suspect you are correct.

> Maybe it would be possible to just make \override Ambitus #'keySignature
> = #'() work as expected.

How do you expect it to work?  'keySignature is a property of a context, not
a property of a grob.  Ambitus doesn't have a 'keySignature; the context
containing Ambitus has a 'keySignature.  How can one override a property
that doesn't exist?  Furthermore, grob properties are applied in the output
stage to determine how the output appears.  Context properties are applied
in the engraving stage, and (at least in this case) to control what objects
are passed to the output.  I don't see your proposal as at all consistent
with the LilyPond architecture.

Two ways I see of getting the output you want:

1) Add a property ambitusKeySignature.  This would be the keySignature used
by the Ambitus_engraver, and would allow one to have any keySignature for
the ambitus, which would be different from the staff/voice.  You would then

\set ambitusKeySignature = #'()

2) Add a property ambitusIgnoreKeySignature that would cause the
Ambitus_engraver to ignore the keySignature of the containing context.  You
would then do

\set ambitusIgnoreKeySignature = ##t



reply via email to

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