Re: [frogs] Re: Enhancement: string bends (issue216051)

[ Thread Index | Date Index | More lilynet.net/frogs Archives ]




On 4/3/10 8:12 AM, "Marc Hohl" <marc@xxxxxxxxxx> wrote:

> Marc Hohl schrieb:
>> [...]
>> Now (given that the engraver structure is ok) I have to include the
>> actual
>> drawing routine. How do I tell the routine which note-events it should
>> use?
>> If I look at glissando-engraver.cc, I see a function called make_spanner,
>> but it is still mysterious to me how the function gets its starting
>> and ending points/events.
> It is still not clear to me how to proceed.
> Assume I have a note-event in
> 
> bend_reference_events_[string_nr]
> 
> and a corresponding note-event in
> 
> note_events_[string_nr]
> 
> How do I call make_spanner? It should draw a spanner between
> bend_reference_events_[string_nr] and note_events_[string_nr].
> 
> Any hints are welcome.

I've been really busy, and not had time to look this up at all, so I was
hoping somebody else would answer.  But since nobody has, I thought I'd tell
you what I've been able to find out.

I've been looking at lily/slur-engraver.cc.

In Slur_engraver::process_music(), line 187, a slur grob is created by
calling make_spanner.

In line 192, the slur is added to a vector of slurs.

In line 172-179, slurs are ended.

In Slur_engraver::stop_translation_timestep()

events are added to the encompass list for the active slurs.  I think this
gives the slur grob the info it needs to do the calculations.

I think this is the code that sets up the grob with all of its information.

lily/slur.cc is the c++ code (that is also exported to scheme) that does the
actual layout work.  You can see in that code that the encompassed columns
are available.

I think that what you need to do is at the time you create a bend_spanner,
you will pass in the start_note and the end_note.  Then at the time you want
to print the spanner, you will set the ends relative to the properties of
the start_note and the end_note.

I'm sorry I don't have a better answer for you than this.  I've never done
what you're doing.

HTH,

Carl


---
----
Join the Frogs!


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/