Re: Coloring of key signature accidentals based on their pitch

2015-08-22 Thread Paul Morris
Hi David, > On Aug 21, 2015, at 9:57 AM, David Nalesnik wrote: > > You're welcome. Just for kicks, I've attached a .cc file which you could > drop into the lily subdirectory and build. It makes Line_interface::line > available to Scheme. You'd just need to replace the two instances in the >

Re: Coloring of key signature accidentals based on their pitch

2015-08-21 Thread David Nalesnik
Hi Paul, On Thu, Aug 20, 2015 at 9:26 PM, Paul Morris wrote: > Hi David, > > > On Aug 19, 2015, at 10:27 PM, David Nalesnik > wrote: > > > > Thanks for doing this! (I should have thought to write it this way in > the first place!) > > Glad to! Thanks for leading the way on how to convert thes

Re: Coloring of key signature accidentals based on their pitch

2015-08-20 Thread Paul Morris
Hi David, > On Aug 19, 2015, at 10:27 PM, David Nalesnik wrote: > > Thanks for doing this! (I should have thought to write it this way in the > first place!) Glad to! Thanks for leading the way on how to convert these C++ functions to Scheme. > By the way, later in the thread I posted a co

Re: Coloring of key signature accidentals based on their pitch

2015-08-20 Thread Paul Morris
On Aug 18, 2015, at 9:20 AM, David Nalesnik wrote:In the attached file, I've recoded the print routine in SchemeThe attached file contains David’s Scheme recoding with the original C++ code inserted line by line as comments.  This helped me to understand how he did it by

Re: Coloring of key signature accidentals based on their pitch

2015-08-20 Thread David Nalesnik
Hi Paul, On Wed, Aug 19, 2015 at 8:56 PM, Paul Morris wrote: > On Aug 18, 2015, at 9:20 AM, David Nalesnik > wrote: > > In the attached file, I've recoded the print routine in Scheme > > > The attached file contains David’s Scheme recoding with the original C++ > code inserted line by line as c

Re: Coloring of key signature accidentals based on their pitch

2015-08-19 Thread David Nalesnik
On Tue, Aug 18, 2015 at 5:34 PM, David Nalesnik wrote: > > > Something else I can't explain: the spacing appears to be slightly > different between the default and modified stencils in both files. This > only affects the positioning of naturals: Padding should only be added in > case of an overla

Re: Coloring of key signature accidentals based on their pitch

2015-08-19 Thread David Kastrup
David Nalesnik writes: > On Tue, Aug 18, 2015 at 3:43 PM, Heikki Junes > wrote: > >> Thanks David! >> >> Yes, it provides the exactly the desired result! >> > > Glad I could help! See the attached for a completed adaptation. > > I wonder if this function would better be defined in Scheme than C

Re: Coloring of key signature accidentals based on their pitch

2015-08-19 Thread Heikki Junes
Thanks David! I adapted the colors and this key-sig-color-by-pitch.ly did exactly the trick I was looking after! That different color by octave is not actually needed, at least by me. I included that in the example, in order to repeat the different color in different octave found in your example

Re: Coloring of key signature accidentals based on their pitch

2015-08-18 Thread Paul Morris
> On Aug 18, 2015, at 9:31 PM, David Nalesnik wrote: > > (Not long ago I was looking at the C++ function that draws ledger lines > (ly:ledger-line-spanner::print in ledger-line-spanner.cc > ), thinking about overriding it with a custom > function. Well, I didn’

Re: Coloring of key signature accidentals based on their pitch

2015-08-18 Thread David Nalesnik
On Tue, Aug 18, 2015 at 8:11 PM, Paul Morris wrote: > > On Aug 18, 2015, at 7:13 PM, Thomas Morley > wrote: > > > >> I wonder if this function would better be defined in Scheme than C++. > If > >> someone wanted to do something like you're doing, it wouldn't be a > trivial > >> matter to first r

Re: Coloring of key signature accidentals based on their pitch

2015-08-18 Thread Paul Morris
> On Aug 18, 2015, at 7:13 PM, Thomas Morley wrote: > >> I wonder if this function would better be defined in Scheme than C++. If >> someone wanted to do something like you're doing, it wouldn't be a trivial >> matter to first redo the function in Scheme to make the necessary changes. > > I'd l

Re: Coloring of key signature accidentals based on their pitch

2015-08-18 Thread Thomas Morley
2015-08-19 1:13 GMT+02:00 Thomas Morley : > 2015-08-19 0:34 GMT+02:00 David Nalesnik : >> Hi, >> >> On Tue, Aug 18, 2015 at 3:43 PM, Heikki Junes >> wrote: >>> >>> Thanks David! >>> >>> Yes, it provides the exactly the desired result! >> >> >> Glad I could help! See the attached for a completed a

Re: Coloring of key signature accidentals based on their pitch

2015-08-18 Thread Thomas Morley
2015-08-19 0:34 GMT+02:00 David Nalesnik : > Hi, > > On Tue, Aug 18, 2015 at 3:43 PM, Heikki Junes > wrote: >> >> Thanks David! >> >> Yes, it provides the exactly the desired result! > > > Glad I could help! See the attached for a completed adaptation. > > I wonder if this function would better b

Re: Coloring of key signature accidentals based on their pitch

2015-08-18 Thread David Nalesnik
Hi, On Tue, Aug 18, 2015 at 3:43 PM, Heikki Junes wrote: > Thanks David! > > Yes, it provides the exactly the desired result! > Glad I could help! See the attached for a completed adaptation. I wonder if this function would better be defined in Scheme than C++. If someone wanted to do someth

Re: Coloring of key signature accidentals based on their pitch

2015-08-18 Thread Heikki Junes
Thanks David! Yes, it provides the exactly the desired result! With this kind of approach, where the note height in the staff is being used instead of the pitch of the note, the Staff.keySignature.stencil needs to be redefined on each clef change: \override Staff.KeySignature.stencil = #

Re: Coloring of key signature accidentals based on their pitch

2015-08-18 Thread David Nalesnik
Hi Heikki, On Mon, Aug 17, 2015 at 7:47 AM, Heikki Junes wrote: > > 2015-08-17 15:34 GMT+03:00 David Kastrup : >> >> >> Key signature is a single grob. Your best bet probably is recoding the >> print routine in lily/key-signature-interface.cc in Scheme (it appears >> rather straightforward) and

Re: Coloring of key signature accidentals based on their pitch

2015-08-17 Thread Heikki Junes
2015-08-17 15:34 GMT+03:00 David Kastrup : > Heikki Junes writes: > > > Hi, > > > > in Lilypond 2.19.25 notes and accidental before notes can be colored > based > > on their pitch: > > > > \override NoteHead.color = #color-notehead > > \override Accidental.color = #color-notehead > > Uh, no? > >

Re: Coloring of key signature accidentals based on their pitch

2015-08-17 Thread David Kastrup
Heikki Junes writes: > Hi, > > in Lilypond 2.19.25 notes and accidental before notes can be colored based > on their pitch: > > \override NoteHead.color = #color-notehead > \override Accidental.color = #color-notehead Uh, no? > Here is an example on NoteHeads: > > http://www.lilypond.org/doc/v

Coloring of key signature accidentals based on their pitch

2015-08-17 Thread Heikki Junes
Hi, in Lilypond 2.19.25 notes and accidental before notes can be colored based on their pitch: \override NoteHead.color = #color-notehead \override Accidental.color = #color-notehead Here is an example on NoteHeads: http://www.lilypond.org/doc/v2.19/Documentation/snippets-big-page#pitches-colo