lilypond-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Fix for bug #218 (center staccato over stem instead of noteh


From: Neil Puttock
Subject: Re: [PATCH] Fix for bug #218 (center staccato over stem instead of notehead)
Date: Sat, 29 Nov 2008 13:07:32 +0000

Hi Max,

2008/11/28 Maximilian Albert <address@hidden>:

> attached is a patch for bug #218 (see
> http://code.google.com/p/lilypond/issues/detail?id=218). It simply
> tests whether the directions of stem and articulation coincide, and if
> so it shifts the latter sideways. Please note that the patch is just a
> casual attempt to get more familiar with Lilypond's internals and that
> the way it is implemented was derived mostly by trial-and-error and
> sophisticated guessing. So any suggestions for improvement are most
> welcome.

I've tested your patch, but it segfaults on a real-world example and
with `make check':

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fa139a3d700 (LWP 19100)]
0x000000000040d117 in ly_car (x=0x404) at ./include/lily-guile.hh:188
188     inline SCM ly_car (SCM x) { return SCM_CAR (x); }
(gdb) bt
#0  0x000000000040d117 in ly_car (x=0x404) at ./include/lily-guile.hh:188
#1  0x00000000006620ef in Stem::beam_multiplicity (stem=0x30206b0)
    at stem.cc:1004
#2  0x000000000044ea9c in Beam::get_beam_count (me=0x30cd5a0) at beam.cc:118
#3  0x0000000000453e1f in Beam::get_beam_translation (me=0x30cd5a0)
    at beam.cc:95
#4  0x0000000000456054 in Beam::consider_auto_knees (me=0x30cd5a0)
    at beam.cc:767
#5  0x0000000000458ede in Beam::calc_direction (smob=0x7fa12f681990)
    at beam.cc:187

It's caused by this line:

+  int stem_dir = robust_scm2int(stem->get_property("direction"), 0);

I think it's too early to be checking the direction here, since you
can't be sure it's been calculated when the stem's acknowledged.  The
same problem applies to reading the script direction:  unless it's
forced using ^/_, you get loads of programming errors, and the script
attachment will be incorrect in many cases (since it's forced DOWN).

> BTW, in the bug's description it says that only staccato marks should
> be centered on the stem, but I personally find it more appealing if
> this applies to any kind of articulation. If you think otherwise, I'd
> be happy to adapt the patch but I don't know how to test whether the
> grob actually is a staccato mark or something else.

The music property 'articulation-type can be used to check what type
you're dealing with; see the code in
Script_engraver::listen_articulation (), where it's used to prevent
double articulations from being typeset.

Regards,
Neil




reply via email to

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