lilypond-devel
[Top][All Lists]
Advanced

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

[PATCH] Re: Harp Pedals?


From: Reinhold Kainhofer
Subject: [PATCH] Re: Harp Pedals?
Date: Mon, 18 Aug 2008 02:10:34 +0200
User-agent: KMail/1.9.9

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Sonntag, 17. August 2008 schrieb Carl D. Sorensen:
> On 8/17/08 9:18 AM, "Reinhold Kainhofer" <address@hidden> wrote:
> > 1) It seems that the diagram has zero extent, so that it overlaps with
> > the staff and other diagrams. How can I make the stencil (created by
> > stencil-add) use the bounding box off all combined stencils?
>
> I think you are not putting extents on your stencils when you create them.

Actually, make-filled-box-stencil does that automatically. The problem was 
that I got the order of the y-coordinates wrong, i.e. (1.56 . 0.36) instead 
of (0.36 . 1.56). Although Lilypond correctly prints the box, for the extents 
this wrong order causes the stencil to have a height of 0...

For the two lines you are correct, though. It seems that there is currently no 
function to create a stencil for a simple line. Rather, one has to construct 
the contents of the stencil and its extent manually, meaning that one has to 
give the coordinates twice.

Attached is a patch for stencil.scm, which adds a make-line-stencil that does 
exactly that: You call it as 
    (make-line-stencil linewidth xstart ystart xend yend) 
and it will create the stencil and correctly set its extent (adding half the 
line width to all coordinates, too).

Okay to apply to master?

> > 2) How can I draw an ellipse around an object in lilypond? I only cound
> > find (circle-stencil stencil linewidth padding)... However, this places
> > the circle always at the horizontal line, even if the box stencil is
> > placed higher/lower. Furthermore its radius is too small to surround the
> > box. And of course, I don't want a circle but rather a vertical ellipse.
> > See the last diagram in the .ly file...
>
> circle-stencil will work if the extent of the stencil is correct. -- but it
> will be a circle.

Yeah, for now I suppose, I can live with the circle...
If I'll ever get bored (as if that could ever happen!), I'll add an ellipse 
stencil.

I tried using a rounded box, but unfortunately the rounded box will be filled, 
thus overprinting the box for the pedal...

> > 3) To make it more customizable, I'd like the user to be able to tweak
> > the linethickness, the spacing between the boxes, the box offsets and the
> > box width/heights. What's the proper way to do this?
>
> You should already have these coded in as variables.  Now you just need to
> get them from the calling string.

I'd rather not have them in the string, but inside a separate variable, just 
like you suggest.

> In fret-diagrams, I started out by adding a bunch of properties, because
> there are lots of things to vary in a fret diagram.  Han-Wen was concerned
> about the pollution of the LilyPond namespace with lots of variables that
> only had application to fret diagrams.  We solved this issue by putting
> all of the properties into a single property fret-diagram-details.
>
> Given the uniqueness of harp pedal diagrams, I think it would make sense to
> define a property harp-pedal-details that would be a place to stash all the
> harp-pedal-specific properties.

Okay, I'll try that.

BTW, the current version of harp_pedals.ly (which already requires that 
patch...) is attached, together with the pdf output (showing no overlaps, but 
working circled pedals; the harp-pedal-details are not yet implemented).

Cheers,
Reinhold

- -- 
- ------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: address@hidden, http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer maintainer
 * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIqL3/TqjEwhXvPN0RAo+OAKCfL/rsKzKjHFR2Hytg18kmraq8qQCfdSn5
lg24TRG9SnDuDCAU8/H+Ixc=
=q077
-----END PGP SIGNATURE-----

Attachment: 0001-Add-a-make-line-stencil-function-which-correctly-se.patch
Description: Text Data

Attachment: harp_pedals.ly
Description: Text Data

Attachment: harp_pedals.pdf
Description: Adobe PDF document


reply via email to

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