[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Determining location of the staff lines
From: |
Carl Sorensen |
Subject: |
Re: Determining location of the staff lines |
Date: |
Wed, 10 Feb 2010 19:58:04 -0700 |
On 2/10/10 6:42 PM, "Eric Knapp" <address@hidden> wrote:
>
> With this in mind, my string marker function needs to have all the
> pitches and strings for a chord to determine where to draw the
> markers. I'm envisioning a function that receives two lists and can
> work out all the combinations. What I can't figure out is how to
> capture the chord and all its data together. I'm getting all the
> individual events, but that's not enough.
>
> Am I making sense and what do you suggest?
>
You're making great sense. This is *really* easy, once you understand how
LilyPond engravers work.
As an example, look at lily/fretboard-engraver.cc.
The engraver contains two vectors: note_events_ and tabstring_events_.
The listeners for notes and string-events do a push_back on note_events_
and tabstring_events_, respectively. That's all they do.
The process_music function, which is called after all the events are
listened to, then works with note_events_ and tabstring_events_. All of the
information on the notes and strings are there.
You can also see this same structure (but with a touch more complexity) in
lily/tab-note-heads-engraver.cc.
So your staff-tab-string-marker-engraver (or whatever it's called) will
listen to both note-events and string-number-events, and create these
vectors. Then, based on the contents of the vectors, it can create the
appropriate stringMarker grobs, with the correct X-offset to put the string
markers in the right position.
Let me know if you have more questions on this.
Thanks,
Carl
- Determining location of the staff lines, Eric Knapp, 2010/02/03
- Re: Determining location of the staff lines, Carl Sorensen, 2010/02/03
- Re: Determining location of the staff lines, Carl Sorensen, 2010/02/03
- Re: Determining location of the staff lines, Eric Knapp, 2010/02/10
- Re: Determining location of the staff lines,
Carl Sorensen <=
- Re: Determining location of the staff lines, Eric Knapp, 2010/02/14
- Re: Determining location of the staff lines, Carl Sorensen, 2010/02/15
- Re: Determining location of the staff lines, Eric Knapp, 2010/02/17
- Re: Determining location of the staff lines, Carl Sorensen, 2010/02/17
- Re: Determining location of the staff lines, David Kastrup, 2010/02/17
- Re: Determining location of the staff lines, Carl Sorensen, 2010/02/17
- Re: Determining location of the staff lines, Neil Puttock, 2010/02/17
- Re: Determining location of the staff lines, David Kastrup, 2010/02/18
- Re: Determining location of the staff lines, Han-Wen Nienhuys, 2010/02/18
- Re: Determining location of the staff lines, David Kastrup, 2010/02/18