Re: [PATCH] Bugfix: Ambitus (Was: Re: ambitus and G_8)

2002-07-24 Thread Laura Conrad

> "Juergen" == Juergen Reuter <[EMAIL PROTECTED]> writes:

Juergen> On 11 Jul 2002, Laura Conrad wrote:

>> 
>> When I print the attached file, the ambitus is an octave too high.  It
>> may be something wierd I'm doing, since I've seen the ambitus engraver
>> work on other files with a G_8 clef, but I don't see what.
>> 

Juergen> Should be fixed with the attached diff.  

Thanks, it seems to be working fine now.



-- 
Laura (mailto:[EMAIL PROTECTED] , http://www.laymusic.org/ )
(617) 661-8097  fax: (801) 365-6574 
233 Broadway, Cambridge, MA 02139


___
Lilypond-devel mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-devel



[PATCH] Bugfix: Ambitus (Was: Re: ambitus and G_8)

2002-07-23 Thread Han-Wen

[EMAIL PROTECTED] writes:
> >
> 
> Should be fixed with the attached diff.  Actually, this was not a problem
> with some specific clefs, but rather yet another problem related to the

thanks, applied.

> BTW., your file produces (at least on my machine here) many errors like:
> 
> programming error: empty break column? --fixme (Continuing; cross Thumbs)

I've removed this error message -- it is triggered far too often, and
people will send in reports on anomalous spaces anyway.   

> 
> (custos . (extra-space . 0.0))
> 
> to the LeftEdge grob in scm/grob-description.scm.  However, since I think
> the latter message is a result of something else that went wrong and
> under normal circumstances this situation should not occur, I decided not
> to include this line in my patch.

It happens when you have breakpoints without barlines. I added your entry.

-- 

Han-Wen Nienhuys   |   [EMAIL PROTECTED]   |   http://www.cs.uu.nl/~hanwen 

___
Lilypond-devel mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-devel



Re: [PATCH] Bugfix: Ambitus (Was: Re: ambitus and G_8)

2002-07-23 Thread Juergen Reuter


Sorry, I forgot the ChangeLog.

Greetings,
Juergen

--- ChangeLog~  Mon Jul 22 14:24:43 2002
+++ ChangeLog   Tue Jul 23 20:22:31 2002
@@ -1,3 +1,8 @@
+2002-07-23  Juergen Reuter  <[EMAIL PROTECTED]>
+
+   * lily/ambitus-engraver.cc: bugfix: create ambitus grob during
+   process_music phase
+
 2002-07-22  Han-Wen  <[EMAIL PROTECTED]>

* VERSION: 1.5.69 released



___
Lilypond-devel mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-devel



[PATCH] Bugfix: Ambitus (Was: Re: ambitus and G_8)

2002-07-23 Thread Juergen Reuter



On 11 Jul 2002, Laura Conrad wrote:

>
> When I print the attached file, the ambitus is an octave too high.  It
> may be something wierd I'm doing, since I've seen the ambitus engraver
> work on other files with a G_8 clef, but I don't see what.
>

Should be fixed with the attached diff.  Actually, this was not a problem
with some specific clefs, but rather yet another problem related to the
start/stop_translation_timestep() anomaly (lily may issue a
stop_translation_timestep() before having issued a
start_translation_timestep()).

BTW., your file produces (at least on my machine here) many errors like:

programming error: empty break column? --fixme (Continuing; cross thumbs)

programming error: No spacing entry from LeftEdge to `custos' (Continuing;
cross thumbs)

The latter can be avoided by adding

(custos . (extra-space . 0.0))

to the LeftEdge grob in scm/grob-description.scm.  However, since I think
the latter message is a result of something else that went wrong and
under normal circumstances this situation should not occur, I decided not
to include this line in my patch.

Greetings,
Juergen


--- lilypond-1.5.69/lily/ambitus-engraver.ccTue Jul  2 01:52:24 2002
+++ lilypond-1.5.69.NEW/lily/ambitus-engraver.ccTue Jul 23 00:51:27 2002
@@ -64,6 +64,7 @@
 {
 public:
 TRANSLATOR_DECLARATIONS(Ambitus_engraver);
+  virtual void process_music ();
   virtual void acknowledge_grob (Grob_info);
   virtual void stop_translation_timestep ();
   virtual void finalize ();
@@ -71,51 +72,65 @@
 private:
   void create_ambitus ();
   Item *ambitus_p_;
-  int isActive;
+  int/*bool*/ is_typeset;
   Pitch pitch_min, pitch_max;
 };
 
 Ambitus_engraver::Ambitus_engraver ()
 {
-  ambitus_p_ = 0; isActive = 0;
+  ambitus_p_ = 0;
+  is_typeset = 0;
 
-  // (pitch_min > pitch_max) means that pitches are not yet
-  // initialized
+  /*
+   * (pitch_min > pitch_max) means that pitches are not yet
+   * initialized
+   */
   pitch_min = Pitch (0, 0, +1);
   pitch_max = Pitch (0, 0, -1);
 }
 
 void
-Ambitus_engraver::stop_translation_timestep ()
+Ambitus_engraver::process_music ()
 {
+  /*
+   * Ensure that ambitus is created in the very first timestep (on
+   * which lily does not call start_translation_timestep ()).
+   * Otherwise, if a voice begins with a rest, the ambitus grob will
+   * be placed after the rest.
+   */
   if (!ambitus_p_) {
-// Create ambitus not before stopping timestep.  centralCPosition
-// will then be the same as that for the first timestep.
-//
-// TODO: is this really a good idea?  At least, creating the
-// ambitus in start_translation_timestep is a *bad* idea, since we
-// may then oversee a clef that is defined in a staff context if
-// we are in a voice context; centralCPosition would then be
-// assumed to be 0.
 create_ambitus ();
   }
-  if (ambitus_p_ && isActive)
+}
+
+void
+Ambitus_engraver::stop_translation_timestep ()
+{
+  if (ambitus_p_ && !is_typeset)
 {
+  /*
+   * Evaluate centralCPosition not until now, since otherwise we
+   * may then oversee a clef that is defined in a staff context if
+   * we are in a voice context; centralCPosition would then be
+   * assumed to be 0.
+   */
+  SCM c0 = get_property ("centralCPosition");
+  ambitus_p_->set_grob_property ("centralCPosition", c0);
+
+  /*
+   * Similar for keySignature.
+   */
   SCM key_signature = get_property ("keySignature");
   ambitus_p_->set_grob_property ("keySignature", key_signature);
+
   typeset_grob (ambitus_p_);
-  isActive = 0;
+  is_typeset = 1;
 }
 }
 
 void
 Ambitus_engraver::acknowledge_grob (Grob_info info)
 {
-  if (!ambitus_p_) {
-create_ambitus ();
-  }
-  if (!ambitus_p_)
-return;
   Item *item = dynamic_cast (info.grob_l_);
   if (item)
 {
@@ -148,9 +163,7 @@
 Ambitus_engraver::create_ambitus ()
 {
   SCM basicProperties = get_property ("Ambitus");
-  SCM c0 = get_property ("centralCPosition");
-  ambitus_p_ = new Item (basicProperties); isActive = 1;
-  ambitus_p_->set_grob_property ("centralCPosition", c0);
+  ambitus_p_ = new Item (basicProperties); is_typeset = 0;
   announce_grob (ambitus_p_, SCM_EOL);
 }
 
@@ -168,9 +181,11 @@
}
   else // have not seen any pitch, so forget about the ambitus
{
- // Do not print a warning on empty ambitus range, since this
- // most probably arises from an empty voice, such as shared
- // global timesig/clef definitions.
+ /*
+  * Do not print a warning on empty ambitus range, since this
+  * most probably arises from an empty voice, such as shared
+  * global timesig/clef definitions.
+  */
 #if 0
  ambitus_p_->warning("empty ambitus range [ignored]");
 #endif



Re: ambitus and G_8

2002-07-12 Thread Juergen Reuter



On 11 Jul 2002, Laura Conrad wrote:

>
> When I print the attached file, the ambitus is an octave too high.  It
> may be something wierd I'm doing, since I've seen the ambitus engraver
> work on other files with a G_8 clef, but I don't see what.
>

Sounds as if for some reason the clef is not seen from within the voice
context.  The next couple of days I am quite buisy, but I'll nevertheless
try to have a look at it this weekend.

Greetings,
Juergen


___
Lilypond-devel mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-devel



ambitus and G_8

2002-07-11 Thread Laura Conrad


When I print the attached file, the ambitus is an octave too high.  It
may be something wierd I'm doing, since I've seen the ambitus engraver
work on other files with a G_8 clef, but I don't see what.




tenor.ly
Description: Binary data


-- 
Laura (mailto:[EMAIL PROTECTED] , http://www.laymusic.org/ )
(617) 661-8097  fax: (801) 365-6574 
233 Broadway, Cambridge, MA 02139