Re: Directional NoteHead Stencil Support

2015-03-24 Thread Thomas Morley
2015-03-24 17:48 GMT+01:00 David Nalesnik david.nales...@gmail.com:
 Harm,

 On Sat, Mar 21, 2015 at 3:14 PM, Thomas Morley thomasmorle...@gmail.com
 wrote:


 Hi David,

 please consider to add it to our source.
 It's a very useful developing/debugging tool!


 Happy to oblige!

 https://code.google.com/p/lilypond/issues/detail?id=4328

 --David


Great.

Thanks,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-24 Thread Thomas Morley
2015-03-22 9:04 GMT+01:00 Marc Hohl m...@hohlart.de:
 Hi Harm,

 Am 21.03.2015 um 21:02 schrieb Thomas Morley:
 [...]

 Thanks Marc and David pointing me in the correct direction.

 This is issue 3289
 https://code.google.com/p/lilypond/issues/detail?id=3289

 Curing a regression detected in 2.17. which was introduced during 2.15.

 Though, I have never seen this commit-message before!
 During the revue on Rietvield some more extended message was wished
 and obviously added right before pushing - no chance for anyone to
 look at it.


 Well, there has been quite *a lot* of mail traffic concerning the committer
 and the use of comments both within the code and for commits.


 If I had seen:

  Lastly, there was no reason in the code base to keep a pointer to
 the
  arpeggio in the note column, so it is removed here.

 I would have protested strongly.

 Instead
 http://lsr.di.unimi.it/LSR/Item?id=621
 is partly broken.

 http://lilypondblog.org/2013/06/horizontally-aligning-full-measure-rests/
 is partly broken.

 Also, some of my custom-functions are partly broken or never reached
 usability because of that missing 'arpeggio-property.
 Letting me no reasonable chance to get back the needed info.
 For more than a year!


 I cannot judge on the technical reasons for having an 'arpeggio property
 versus some circular dependencies. If you think that this is crucial, then
 it's probably the best to raise an issue for that, otherwise this discussion
 and all your work gets lost.

 Color me annoyed and frustrated.
 Right now I have no interest in fixing the above.
 I'll let that to someone else, maybe the committer.


 One more reason to raise an issue on the tracker.

 Please keep up your valuable work for LilyPond!

I didn't mean to quit work on/with LilyPond.

Though sometime you have to love her very much ...

Cheers,
  Harm


 Cheers,

 Marc



 -Harm



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-24 Thread David Nalesnik
Harm,

On Sat, Mar 21, 2015 at 3:14 PM, Thomas Morley thomasmorle...@gmail.com
wrote:


 Hi David,

 please consider to add it to our source.
 It's a very useful developing/debugging tool!


Happy to oblige!

https://code.google.com/p/lilypond/issues/detail?id=4328

--David
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-24 Thread Paul Morris
David Nalesnik-2 wrote
 If  there's a property which indicates on which side of a stem the note
 falls, I don't find it.  Seems like there definitely should be one!

I don't think there is one.  The positioning of note heads to the left or
right of their stem appears to be determined in lily/stem.cc in
Stem::calc_positioning_done which starts around line 320.

But anyway, there are other ways to find out these note head positions.

David N, your display-pointers function looks really handy!  Glad you've
prepared a patch for that.

Cheers,
-Paul



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Directional-NoteHead-Stencil-Support-tp173361p173578.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: centering note columns [WAS: Directional NoteHead Stencil Support]

2015-03-23 Thread David Nalesnik
On Mon, Mar 23, 2015 at 8:47 AM, David Nalesnik david.nales...@gmail.com
wrote:

 Hi Kieren,

 On Sun, Mar 22, 2015 at 7:39 PM, Kieren MacMillan 
 kieren_macmil...@sympatico.ca wrote:

 Hi David,

  Try the attached out.  It will only center an object if the contents of
 all staves can reasonably be centered.

 So far, I would call that perfect”!  =)


 oh, it will be broken!

 Anyway, I'm a little unsure of the procedure for determining whether an
 object is alone in its measure.  There's a C++ procedure that determines
 this and maybe that ought to be made accessible from Scheme.

 [...]


 Any reason why this can’t be submitted as a patch?



 What bugs me is that the centering is done after measure-widths have been
 determined.  I would imagine that in most cases this routine will end up
 moving objects to the right.  When it does, that is infringing on what
 LilyPond has decided is an appropriate space between the objects in our
 column and the column holding the barline (and whatever else).  I would
 think that a good algorithm would ensure that the space after our objects
 would be increased, to match the space before.


Err...I think I mean the space *before* should be increased.  In any case
neither space before or after should fall below a minimum,
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: centering note columns [WAS: Directional NoteHead Stencil Support]

2015-03-23 Thread David Nalesnik
Hi Kieren,

On Sun, Mar 22, 2015 at 7:39 PM, Kieren MacMillan 
kieren_macmil...@sympatico.ca wrote:

 Hi David,

  Try the attached out.  It will only center an object if the contents of
 all staves can reasonably be centered.

 So far, I would call that perfect”!  =)


oh, it will be broken!

Anyway, I'm a little unsure of the procedure for determining whether an
object is alone in its measure.  There's a C++ procedure that determines
this and maybe that ought to be made accessible from Scheme.

[...]


 Any reason why this can’t be submitted as a patch?



What bugs me is that the centering is done after measure-widths have been
determined.  I would imagine that in most cases this routine will end up
moving objects to the right.  When it does, that is infringing on what
LilyPond has decided is an appropriate space between the objects in our
column and the column holding the barline (and whatever else).  I would
think that a good algorithm would ensure that the space after our objects
would be increased, to match the space before.  Basically, distances should
never fall below the ideal distance in either direction, which will involve
resizing the measure.

Now, I haven't seen results that look bad (in my limited study!) and
certain negative outcomes I can imagine could be guarded against.  Also, I
don't know how feasible the more integrated approach is, whether it would
slip nicely into the program as is, or would require extensive changes.

--David
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-22 Thread Marc Hohl

Am 21.03.2015 um 14:37 schrieb David Nalesnik:
[...]


P.S.  Just this moment, Marc Hohl posted the commit message I was ready
to cut-and-paste!  FWIW, I'll mention how I found it (though my bag of
tricks is pretty small).  I used

git log -p lily/rhythmic-column-engraver.cc


I just used

gitk lily/note-column.cc

and found the culprit very quickly. ;-)

Marc


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-22 Thread Pierre Perol-Schneider
Hi Marc,

2015-03-22 9:04 GMT+01:00 Marc Hohl m...@hohlart.de:


 Am 21.03.2015 um 21:02 schrieb Thomas Morley:
 [...]



 Color me annoyed and frustrated.
 Right now I have no interest in fixing the above.
 I'll let that to someone else, maybe the committer.


 [...]
 Please keep up your valuable work for LilyPond!


+1
Cheers,
Pierre
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-22 Thread Pierre Perol-Schneider
2015-03-22 5:11 GMT+01:00 tisimst tisimst.lilyp...@gmail.com:

 David,

 Yes!!! Yes! Yes! Yes! Yes! Yes!

 Seriously, that totally made my day. You are my hero. Scheme is not my
 native language ;-), but I am learning slowly. I did determine the need for
 that check, but was unsure how to do it. I think I have everything I need
 to make this sweet font work beautifully! Can't wait to show everyone!


Congrats to you and David, can't wait to see it!!
Pierre
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: centering note columns [WAS: Directional NoteHead Stencil Support]

2015-03-22 Thread Kieren MacMillan
Hi David,

As always, great work! I will use this on all my scores, once it’s “perfect”.

In the meantime, it doesn’t distinguish cases where centering *shouldn’t* be 
applied, e.g.

\new PianoStaff 
  \new Staff {
c' e' g' c''1\accent\fermata\f\arpeggio
c'4 d' e' f'
R1
  }
  \new Staff {
R1
R1
c' e' g' c''1\accent\fermata\f\arpeggio
  }
  \new Staff {
c'4 r r2
  }


Is there a way to:
(a) have the function automatically check all staves in the current system, 
and only enable centering if there are only multi-measure rests, full-measure 
notes, or skips/blank; and/or
(b) manually enable or disable the function on a per-measure basis?

Thanks!
Kieren.
___

Kieren MacMillan, composer
www:  http://www.kierenmacmillan.info
email:  i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-22 Thread David Nalesnik
On Sun, Mar 22, 2015 at 3:23 AM, Pierre Perol-Schneider 
pierre.schneider.pa...@gmail.com wrote:


 2015-03-22 9:04 GMT+01:00 Marc Hohl m...@hohlart.de:


 Am 21.03.2015 um 21:02 schrieb Thomas Morley:
 [...]



  Color me annoyed and frustrated.
 Right now I have no interest in fixing the above.
 I'll let that to someone else, maybe the committer.


 [...]
 Please keep up your valuable work for LilyPond!


 +1


Yes, please!

-DN
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


centering note columns [WAS: Directional NoteHead Stencil Support]

2015-03-22 Thread David Nalesnik
Hi,

In a recent thread, the topic of centering items within their measures came
up.  This post on Scores of Beauty (
http://lilypondblog.org/2013/06/horizontally-aligning-full-measure-rests/ )
shows an example where this nonstandard practice looks much better.
Normally, of course, a note filling a measure isn't centered, while a whole
rest is.  When the two occur at the same time, it's more appealing when
both are centered.

(See also the thread at
http://www.mail-archive.com/lilypond-user%40gnu.org/msg98447.html for a
usage case.)

The Scores of Beauty post comes with a code attachment which allows
automation of the process.

It just occurred to me that this might be done through PaperColumns.
Moving a PaperColumn will carry everything associated with it--the
NoteColumn, noteheads, dots, stem, articulations.  And _arpeggio_ (which
presented a difficulty discussed in the thread this branched off from).

Here is a sketch of that approach.  It doesn't yet allow for the
fine-grained control of the other code.

Note: measures aren't resized.  We simply use the available space.
However... one of the nice features of paper columns is that there is easy
access to adjoining paper columns.  I wonder if it's possible to manipulate
their X-extents to create a more flexible approach?

--David

%%

\version 2.19.17

\paper {
  right-margin = 3\in
}

#(define center-column
   (lambda (grob)
 (if (grob::has-interface grob 'note-column-interface)
 (let* ((col (ly:item-get-column grob))
(left-col (ly:grob-object col 'left-neighbor))
(right-col (ly:grob-object col 'right-neighbor)))
   ;; we only shift a PaperColumn if it is alone in its
   ;; measure
   (if (and (ly:grob-property left-col 'non-musical)
(ly:grob-property right-col 'non-musical))
   (let* ((sys (ly:grob-system grob))
  (col-center (interval-center
   (ly:grob-extent col sys X)))
  (left-right-X
   (cdr (ly:grob-extent left-col sys X)))
  (right-left-X
   (car (ly:grob-extent right-col sys X)))
  (middle-X
   (- (average left-right-X right-left-X)
 col-center)))
 (ly:grob-translate-axis! col middle-X X
 ;; do nothing if override applied to something other
 ;; than NoteColumn
 '()
 )))

%%

\new PianoStaff 
  \new Staff {
c' e' g' c''1\accent\fermata\f\arpeggio
c'4 d' e' f'
R1
  }
  \new Staff {
R1
R1
c' e' g' c''1\accent\fermata\f\arpeggio
  }


\layout {
  ragged-right = ##f
  \context {
\Voice
\override NoteColumn.after-line-breaking = #center-column
  }
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-22 Thread David Nalesnik
Hi Harm,

On Sat, Mar 21, 2015 at 3:14 PM, Thomas Morley thomasmorle...@gmail.com
wrote:

 2015-03-21 17:24 GMT+01:00 David Nalesnik david.nales...@gmail.com:
 
 
  On Fri, Mar 20, 2015 at 1:52 PM, David Nalesnik 
 david.nales...@gmail.com
  wrote:
 
 
  Probably this file will prove more useful as a hacking tool.  It will
 show
  you how the different pointer properties are populated.
 
 
  This is better written:
 
  --David
 

 Hi David,

 please consider to add it to our source.
 It's a very useful developing/debugging tool!


I think I will go ahead and do this!  I was hesitating, but it just helped
me enormously with something.  (I think I better start a new thread for
that something-- this one is going all sorts of directions!)

--David
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-22 Thread Marc Hohl

Hi Harm,

Am 21.03.2015 um 21:02 schrieb Thomas Morley:
[...]

Thanks Marc and David pointing me in the correct direction.

This is issue 3289
https://code.google.com/p/lilypond/issues/detail?id=3289

Curing a regression detected in 2.17. which was introduced during 2.15.

Though, I have never seen this commit-message before!
During the revue on Rietvield some more extended message was wished
and obviously added right before pushing - no chance for anyone to
look at it.


Well, there has been quite *a lot* of mail traffic concerning the 
committer and the use of comments both within the code and for commits.


If I had seen:

 Lastly, there was no reason in the code base to keep a pointer to the
 arpeggio in the note column, so it is removed here.

I would have protested strongly.

Instead
http://lsr.di.unimi.it/LSR/Item?id=621
is partly broken.

http://lilypondblog.org/2013/06/horizontally-aligning-full-measure-rests/
is partly broken.

Also, some of my custom-functions are partly broken or never reached
usability because of that missing 'arpeggio-property.
Letting me no reasonable chance to get back the needed info.
For more than a year!


I cannot judge on the technical reasons for having an 'arpeggio property 
versus some circular dependencies. If you think that this is crucial, 
then it's probably the best to raise an issue for that, otherwise this 
discussion and all your work gets lost.



Color me annoyed and frustrated.
Right now I have no interest in fixing the above.
I'll let that to someone else, maybe the committer.


One more reason to raise an issue on the tracker.

Please keep up your valuable work for LilyPond!

Cheers,

Marc



-Harm




___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: centering note columns [WAS: Directional NoteHead Stencil Support]

2015-03-22 Thread David Nalesnik
Hi Kieren,

On Sun, Mar 22, 2015 at 3:32 PM, Kieren MacMillan 
kieren_macmil...@sympatico.ca wrote:

 Hi David,

 As always, great work! I will use this on all my scores, once it’s
 “perfect”.


:)



 In the meantime, it doesn’t distinguish cases where centering *shouldn’t*
 be applied, e.g.

 \new PianoStaff 
   \new Staff {
 c' e' g' c''1\accent\fermata\f\arpeggio
 c'4 d' e' f'
 R1
   }
   \new Staff {
 R1
 R1
 c' e' g' c''1\accent\fermata\f\arpeggio
   }
   \new Staff {
 c'4 r r2
   }
 


Ah...that's because paper-columns encompass multiple staves...  And thus is
dashed all hope of simplicity...



 Is there a way to:
 (a) have the function automatically check all staves in the current
 system, and only enable centering if there are only multi-measure rests,
 full-measure notes, or skips/blank; and/or


Try the attached out.  It will only center an object if the contents of all
staves can reasonably be centered.


 (b) manually enable or disable the function on a per-measure basis?


Not sure about this.  It would be easy, of course, to define shortcuts for
\override/\once \override/\revert and the like, but I fear you have
something more difficult in mind :)

--David
\version 2.19.17

\paper {
  right-margin = 3\in
}

#(define center-column
   (lambda (grob)
 (if (grob::has-interface grob 'note-column-interface)
 (let* ((col (ly:item-get-column grob))
(sys (ly:grob-system col))
(all-cols
 (ly:grob-array-list
  (ly:grob-object sys 'columns)))
(measure-no
 (car (ly:grob-property col 'rhythmic-location)))
; we need to find out if there is another
; PaperColumn in the measure.  If there is,
; we make no adjustments.
(in-company?
 ; is there a column...
 (any
  (lambda (c)
(and
 ; which is NOT our column...
 (not (eq? col c))
 ; which is a PaperColumn...
 (not (eq? #t (ly:grob-property c 'non-musical)))
 ; which is in the same measure
 (eq?
  (car (ly:grob-property c 'rhythmic-location))
  measure-no)))
  all-cols))
(alone? (not in-company?))) ; :)
   (if alone?
   (let* ((left-col (ly:grob-object col 'left-neighbor))
  (right-col (ly:grob-object col 'right-neighbor))
  ;(measure-len (ly:grob-property left-col 'measure-length))
  (elts-list
   (ly:grob-array-list (ly:grob-object col 'elements)))
  (note-cols
   (filter
(lambda (elt)
  (grob::has-interface elt 'note-column-interface))
elts-list))
  (all-rests
   (map (lambda (c)
  (ly:grob-object c 'rest))
 note-cols))
  (all-rests (filter ly:grob? all-rests))
  (all-notes
   (map
(lambda (c)
  (ly:grob-object c 'note-heads))
note-cols))
  (all 
   (map (lambda (ga) 
  (if (ly:grob-array? ga)
  (ly:grob-array-list ga)
  '()))
 all-notes))
  (all (flatten-list all))
  (all (append all all-rests))
  (same-dur?
   (every (lambda (o) 
(equal?
 (ly:grob-property o 'duration-log)
 (ly:grob-property (car all)
   'duration-log)))
 all)))
 (if same-dur?
 (let* ((col-center (interval-center
 (ly:grob-extent col sys X)))
(left-right-X
 (cdr (ly:grob-extent left-col sys X)))
(right-left-X
 (car (ly:grob-extent right-col sys X)))
(middle-X
 (- (average left-right-X right-left-X)
   col-center)))
   (ly:grob-translate-axis! col middle-X X))
 ;; do nothing if override applied to something other
 ;; than NoteColumn
 '()
 )))

%%
{
  \new PianoStaff 
\new Staff {
  cis' eis' gis' cis''1\accent\fermata\f\arpeggio
  c'4 d' e' f'
  R1
}
\new Staff {
   

Re: centering note columns [WAS: Directional NoteHead Stencil Support]

2015-03-22 Thread Kieren MacMillan
Hi David,

 Try the attached out.  It will only center an object if the contents of all 
 staves can reasonably be centered.

So far, I would call that perfect”!  =)

 It would be easy, of course, to define shortcuts for \override/\once 
 \override/\revert and the like

As long as that’s all it takes (i.e., no Scheme or C++ work), then that’s great.

 but I fear you have something more difficult in mind

Nope. I only offered (b) as an option if (a) didn’t work out… but so far, your 
v2 solves the problem perfectly, as far as I can tell.

Any reason why this can’t be submitted as a patch?

Thanks!
Kieren.

___

Kieren MacMillan, composer
www:  http://www.kierenmacmillan.info
email:  i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-21 Thread David Nalesnik
Hi Harm,

On Sat, Mar 21, 2015 at 8:37 AM, David Nalesnik david.nales...@gmail.com
wrote:

 Hi Harm,

 On Fri, Mar 20, 2015 at 6:09 PM, Thomas Morley thomasmorle...@gmail.com
 wrote:

 2015-03-20 18:03 GMT+01:00 David Nalesnik david.nales...@gmail.com:


 Btw, the IR stating:

   conditional-elements (array of grobs)
   Internal use only.

 is a joke.


 How so?  (I'm not familiar with conditional-elements.)



OK, I think I see.  The description implies that a user would never need to
bother with its contents--or shouldn't.  But access to the arpeggio grob is
of potential interest.  Furthermore, there's no (convenient) documentation
which would lead us to find it where it's now placed/hidden.

BTW, here's the relevant output for

{

  \override NoteColumn.after-line-breaking = #display-pointers

  c' e' g' c''\arpeggio

}


which shows Arpeggio in its new place and also serves as an illustration of
the output of the functions earlier in the thread:


NoteColumn

 ((grob-interface

   ((axis-group-parent-X #Grob PaperColumn )

(axis-group-parent-Y #Grob VerticalAxisGroup )

(staff-symbol #Grob StaffSymbol )))

 (axis-group-interface

   ((elements

  #Grob_array#Grob NoteHead  #Grob NoteHead  #Grob NoteHead 
#Grob NoteHead  #Grob Stem  )

(pure-relevant-grobs

  #Grob_array#Grob NoteHead  #Grob NoteHead  #Grob NoteHead 
#Grob NoteHead  #Grob Stem  )

(pure-relevant-items ())

(pure-relevant-spanners ())

(pure-Y-common #Grob NoteColumn )

(staff-grouper ())

(X-common ())

(Y-common (

 (note-column-interface

   ((note-heads

  #Grob_array#Grob NoteHead  #Grob NoteHead  #Grob NoteHead 
#Grob NoteHead  )

(rest ())

(rest-collision ())

(stem #Grob Stem )))

 (separation-item-interface

   ((conditional-elements

  #Grob_array#Grob Arpeggio  )

(elements

  #Grob_array#Grob NoteHead  #Grob NoteHead  #Grob NoteHead 
#Grob NoteHead  #Grob Stem  


%


--David
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-21 Thread David Nalesnik
On Sat, Mar 21, 2015 at 10:26 AM, David Nalesnik david.nales...@gmail.com
wrote:

 Hi Harm,

 On Sat, Mar 21, 2015 at 8:37 AM, David Nalesnik david.nales...@gmail.com
 wrote:

 Hi Harm,

 On Fri, Mar 20, 2015 at 6:09 PM, Thomas Morley thomasmorle...@gmail.com
 wrote:

 2015-03-20 18:03 GMT+01:00 David Nalesnik david.nales...@gmail.com:


 Btw, the IR stating:

   conditional-elements (array of grobs)
   Internal use only.

 is a joke.


 How so?  (I'm not familiar with conditional-elements.)



 OK, I think I see.  The description implies that a user would never need
 to bother with its contents--or shouldn't.  But access to the arpeggio grob
 is of potential interest.  Furthermore, there's no (convenient)
 documentation which would lead us to find it where it's now placed/hidden.


And it tells us next to nothing :)

DN
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-21 Thread David Nalesnik
On Fri, Mar 20, 2015 at 1:52 PM, David Nalesnik david.nales...@gmail.com
wrote:


 Probably this file will prove more useful as a hacking tool.  It will show
 you how the different pointer properties are populated.


This is better written:

--David
\version 2.19.16

#(define (grob-interface::info iface)
   (hashq-get-handle (ly:all-grob-interfaces) iface))

#(define (grob-interface::properties iface-info)
   (if iface-info (last iface-info) '()))

#(define (grob-interface::pointers grob iface)
   (let* ((info (grob-interface::info iface))
  (props (grob-interface::properties info))
  (pointers
   (filter
(lambda (prop)
  (let ((type (object-property prop 'backend-type?)))
(or (eq? type ly:grob?)
(eq? type ly:grob-array?
props)))
 (if (pair? pointers)
 (list iface
   (map
(lambda (p) (list p (ly:grob-object grob p)))
pointers))
 '(

#(define (grob::all-pointers grob)   
   (let loop ((ifaces (ly:grob-interfaces grob)) (result '()))
 (if (null? ifaces)
 result
 (let ((entry (grob-interface::pointers grob (car ifaces
   (if (pair? entry)
   (loop (cdr ifaces) (append result (list entry)))
   (loop (cdr ifaces) result))

#(define (display-pointers grob)
   (format #t ~%~y ~y~%
 (grob::name grob)
 (grob::all-pointers grob)))

%%

{
  \override NoteColumn.after-line-breaking = #display-pointers
  c' e' g' c''\arpeggio
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-21 Thread Marc Hohl

Am 21.03.2015 um 00:40 schrieb Thomas Morley:

2015-03-21 0:09 GMT+01:00 Thomas Morley thomasmorle...@gmail.com:



The 'arpeggio-property was deleted somewhere during 2.17. and I never
managed to get back the info whether a NoteColumn has an arpeggio,


Btw, I tried again to find the commit on the tracker which removed the
'arpeggio-property (and probably the reason for it) and again without
success.


I think it is

5ab8335d106d736335698245af3c1b2b2455aed6


Adds arpeggio to conditional item grob array.

The actual function of conditional elements was not correctly reflected
in the comment above Separation_item::boxes.  This comment led one 
to believe

that conditional elements were only used when notes with accidentals
had ties coming to them.  This is not true.  Conditional elements 
are always

used for right columns when there is something to the left (see
Spacing_interface::skylines).  They are omitted _only_ when they are
accidentals with ties coming to them.

So why do we want an arpeggio to be a conditional element?  There is
nothing conditional about it (it will always be printed, unlike 
accidentals

with ties going to them).  It is because conditional elements have the
double duty of being conditional (i.e. accidentals) AND being factored
into springs in note spacing (see the long comment in
Note_spacing::get_spacing) in the calculation of a spring's ideal 
distance.
Other elements to the left of a note column, like scripts and 
fingerings,
are only factored into the minimum distance. We want arpeggios to 
factor

into the ideal distance because otherwise they will be too close to
left note-columns in tight spacing situations.

Lastly, there was no reason in the code base to keep a pointer to the
arpeggio in the note column, so it is removed here.

---
HTH,

Marc





-Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user




___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-21 Thread David Nalesnik
Hi Harm,

On Fri, Mar 20, 2015 at 6:09 PM, Thomas Morley thomasmorle...@gmail.com
wrote:

 2015-03-20 18:03 GMT+01:00 David Nalesnik david.nales...@gmail.com:
 
  Hi again,
 
  On Fri, Mar 20, 2015 at 9:21 AM, David Nalesnik 
 david.nales...@gmail.com wrote:
 
 
 
  Finding the path from one object to another is usually just a matter of
 trial-and-error, following this path, following that path, until you reach
 the pot of gold.
 
 
  You might find the attached file helpful.  Given a grob name, it will
 output a list of each interface supported by the grob and the objects
 accessible through those interfaces.   More information might be added--the
 type (whether a single grob or a grob-array) and the documentation string
 associated with it.
 
  Hope this is helpful!
  David


 Hi David,

 thanks a lot for this


You're very welcome!  When I wrote trial-and-error above that bugged me a
little.  Well, still trial and error is involved, but at least you don't
have to page back and forth through the Internals Reference.

Of course, the best thing would be to be able to write something like
(ly:grob-all-chains-of-reference grobA grobB)
and get the various chains of references.  (I suppose
ly:grob-shortest-chain-of-reference might not be a good idea, since you
would turn up links involving members of grob-arrays that would
change--like 'elements, for example.)  You'd need to figure in parents,
spanner bounds too, and my head is swimming.



 Btw, the IR stating:

   conditional-elements (array of grobs)
   Internal use only.

 is a joke.


How so?  (I'm not familiar with conditional-elements.)

--David

P.S.  Just this moment, Marc Hohl posted the commit message I was ready to
cut-and-paste!  FWIW, I'll mention how I found it (though my bag of tricks
is pretty small).  I used

git log -p lily/rhythmic-column-engraver.cc
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-21 Thread Thomas Morley
2015-03-21 14:32 GMT+01:00 Marc Hohl m...@hohlart.de:
 Am 21.03.2015 um 00:40 schrieb Thomas Morley:

 2015-03-21 0:09 GMT+01:00 Thomas Morley thomasmorle...@gmail.com:


 The 'arpeggio-property was deleted somewhere during 2.17. and I never
 managed to get back the info whether a NoteColumn has an arpeggio,


 Btw, I tried again to find the commit on the tracker which removed the
 'arpeggio-property (and probably the reason for it) and again without
 success.


 I think it is

 5ab8335d106d736335698245af3c1b2b2455aed6


 Adds arpeggio to conditional item grob array.

 The actual function of conditional elements was not correctly reflected
 in the comment above Separation_item::boxes.  This comment led one to
 believe
 that conditional elements were only used when notes with accidentals
 had ties coming to them.  This is not true.  Conditional elements are
 always
 used for right columns when there is something to the left (see
 Spacing_interface::skylines).  They are omitted _only_ when they are
 accidentals with ties coming to them.

 So why do we want an arpeggio to be a conditional element?  There is
 nothing conditional about it (it will always be printed, unlike
 accidentals
 with ties going to them).  It is because conditional elements have the
 double duty of being conditional (i.e. accidentals) AND being factored
 into springs in note spacing (see the long comment in
 Note_spacing::get_spacing) in the calculation of a spring's ideal
 distance.
 Other elements to the left of a note column, like scripts and
 fingerings,
 are only factored into the minimum distance. We want arpeggios to factor
 into the ideal distance because otherwise they will be too close to
 left note-columns in tight spacing situations.

 Lastly, there was no reason in the code base to keep a pointer to the
 arpeggio in the note column, so it is removed here.

 ---
 HTH,

 Marc


2015-03-21 14:37 GMT+01:00 David Nalesnik david.nales...@gmail.com:
[...]

 P.S.  Just this moment, Marc Hohl posted the commit message I was ready to
 cut-and-paste!  FWIW, I'll mention how I found it (though my bag of tricks
 is pretty small).  I used

 git log -p lily/rhythmic-column-engraver.cc


Thanks Marc and David pointing me in the correct direction.

This is issue 3289
https://code.google.com/p/lilypond/issues/detail?id=3289

Curing a regression detected in 2.17. which was introduced during 2.15.

Though, I have never seen this commit-message before!
During the revue on Rietvield some more extended message was wished
and obviously added right before pushing - no chance for anyone to
look at it.

If I had seen:
 Lastly, there was no reason in the code base to keep a pointer to the
 arpeggio in the note column, so it is removed here.
I would have protested strongly.

Instead
http://lsr.di.unimi.it/LSR/Item?id=621
is partly broken.

http://lilypondblog.org/2013/06/horizontally-aligning-full-measure-rests/
is partly broken.

Also, some of my custom-functions are partly broken or never reached
usability because of that missing 'arpeggio-property.
Letting me no reasonable chance to get back the needed info.
For more than a year!

Color me annoyed and frustrated.
Right now I have no interest in fixing the above.
I'll let that to someone else, maybe the committer.


-Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-21 Thread Thomas Morley
2015-03-21 17:24 GMT+01:00 David Nalesnik david.nales...@gmail.com:


 On Fri, Mar 20, 2015 at 1:52 PM, David Nalesnik david.nales...@gmail.com
 wrote:


 Probably this file will prove more useful as a hacking tool.  It will show
 you how the different pointer properties are populated.


 This is better written:

 --David


Hi David,

please consider to add it to our source.
It's a very useful developing/debugging tool!


Thanks again,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-21 Thread Pierre Perol-Schneider
Very instructive discussion.
So I feel sorry to come back to some poor basic questions...
And back again to these new glyphs :

\version 2.19.16
%#(set-global-staff-size 25)

#(define-markup-command (flip layout props arg) (markup?)
   (interpret-markup layout props
 (markup #:concat (#:null #:scale (cons -1 1) #:line (arg)

newStilRightDown = \markup {
  \override #'(filled . #t)
  \path #0.01 #'(
 (moveto0.00   -0.50)
 (curveto   0.00   -0.10   0.00   0.50  0.60   0.50)
 (curveto   1.560.50   1.62  -0.50  1.00  -0.50)
 (curveto   0.56   -0.50   0.58  -0.19  0.70   0.00)
 (curveto   0.780.13   0.80   0.45  0.50   0.45)
 (curveto   0.060.45   0.08  -0.13  0.08  -0.50)
 (closepath))
}

newStilLeftDown = \markup\flip\concat { \hspace #-.04 \newStilRightDown }
newStilLeftUp = \markup\rotate #180 \newStilRightDown
newStilRightUp =  \markup\flip\concat { \newStilLeftUp \hspace #-.04  }

#(define alt-notehead
   (lambda (grob)
 (let ((stem (ly:grob-object grob 'stem)))
   (if (ly:grob? stem) ;; perhaps unnecessary, but let's be safe
   (if (eq? (ly:grob-property stem 'direction) DOWN)
   (grob-interpret-markup grob newStilRightDown)
   (grob-interpret-markup grob newStilLeftUp))

#(define new-alt-notehead
   (lambda (grob)
 (let ((stem (ly:grob-object grob 'stem)))
   (if (ly:grob? stem) ;; perhaps unnecessary, but let's be safe
   (if (eq? (ly:grob-property stem 'direction) DOWN)
   ;;; Nonsense here:
(let ((note-heads (ly:grob-object grob 'note-heads)))
 (if (eq? (ly:grob-property note-heads 'X-offset)  0)
   (grob-interpret-markup grob newStilLeftDown)
   (grob-interpret-markup grob newStilRightDown)))
   ;;; Nonsense here:
 ;(if ( 0 (ly:note-head::stem-x-shift))
   ;(grob-interpret-markup grob newStilLeftUp)
   (grob-interpret-markup grob newStilRightUp))

{
  \override NoteHead.stem-attachment = #'(1 . 0.95)
  \override Stem.thickness = #1.0
  \override NoteHead.stencil = #alt-notehead
  %\override NoteHead.stencil = #new-alt-notehead
  c''
%% wanted flip:
\tweak stencil #(lambda (grob) (grob-interpret-markup grob
newStilLeftDown))
d''
  e''

  a'
   %% wanted flip:
   \tweak stencil #(lambda (grob) (grob-interpret-markup grob
newStilRightUp))
  g'
  f'
}

(I've added some tweaks to show a better output.)
Basically, I need four note heads instead of one: the idea of
'new-alt-notehead' is to determine whether its X-offset is negative or
positive in order to chose the right noteHead .
After many too many trials I feel a little lost.
Any idea ?

Cheers,
Pierre



2015-03-21 21:14 GMT+01:00 Thomas Morley thomasmorle...@gmail.com:

 2015-03-21 17:24 GMT+01:00 David Nalesnik david.nales...@gmail.com:
 
 
  On Fri, Mar 20, 2015 at 1:52 PM, David Nalesnik 
 david.nales...@gmail.com
  wrote:
 
 
  Probably this file will prove more useful as a hacking tool.  It will
 show
  you how the different pointer properties are populated.
 
 
  This is better written:
 
  --David
 

 Hi David,

 please consider to add it to our source.
 It's a very useful developing/debugging tool!


 Thanks again,
   Harm

 ___
 lilypond-user mailing list
 lilypond-user@gnu.org
 https://lists.gnu.org/mailman/listinfo/lilypond-user

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-21 Thread tisimst
You and me both, Pierre. I've tried for hours to find something that works 
automatically. I've managed to use a single notehead for both up- and down-stem 
notes, thanks to everyone's help here, but I still have one problem relating to 
chords. 

If a notehead, in a chord stack, is forced out of the main column (to the right 
for up-stem chords, to the left for down-stem chords) what property (or 
relationship between grobs) puts them there? I can't seem to figure it out. 

- Abraham

Sent from my iPhone

 On Mar 21, 2015, at 2:59 PM, Schneidy [via Lilypond] 
 ml-node+s1069038n173443...@n5.nabble.com wrote:
 
 Very instructive discussion.
 So I feel sorry to come back to some poor basic questions...
 And back again to these new glyphs :
 
 \version 2.19.16
 %#(set-global-staff-size 25)
 
 #(define-markup-command (flip layout props arg) (markup?) 
(interpret-markup layout props
  (markup #:concat (#:null #:scale (cons -1 1) #:line (arg)
 
 newStilRightDown = \markup {
   \override #'(filled . #t) 
   \path #0.01 #'(
  (moveto0.00   -0.50)
  (curveto   0.00   -0.10   0.00   0.50  0.60   0.50)
  (curveto   1.560.50   1.62  -0.50  1.00  -0.50)
  (curveto   0.56   -0.50   0.58  -0.19  0.70   0.00)
  (curveto   0.780.13   0.80   0.45  0.50   0.45)
  (curveto   0.060.45   0.08  -0.13  0.08  -0.50)
  (closepath))
 }
 
 newStilLeftDown = \markup\flip\concat { \hspace #-.04 \newStilRightDown }
 newStilLeftUp = \markup\rotate #180 \newStilRightDown
 newStilRightUp =  \markup\flip\concat { \newStilLeftUp \hspace #-.04  }
 
 #(define alt-notehead
(lambda (grob)
  (let ((stem (ly:grob-object grob 'stem)))
(if (ly:grob? stem) ;; perhaps unnecessary, but let's be safe
(if (eq? (ly:grob-property stem 'direction) DOWN)
(grob-interpret-markup grob newStilRightDown)
(grob-interpret-markup grob newStilLeftUp))
 
 #(define new-alt-notehead
(lambda (grob)
  (let ((stem (ly:grob-object grob 'stem)))
(if (ly:grob? stem) ;; perhaps unnecessary, but let's be safe
(if (eq? (ly:grob-property stem 'direction) DOWN)
;;; Nonsense here:
 (let ((note-heads (ly:grob-object grob 'note-heads)))
  (if (eq? (ly:grob-property note-heads 'X-offset)  0)
(grob-interpret-markup grob newStilLeftDown)
(grob-interpret-markup grob newStilRightDown)))
;;; Nonsense here:
  ;(if ( 0 (ly:note-head::stem-x-shift))
;(grob-interpret-markup grob newStilLeftUp)
(grob-interpret-markup grob newStilRightUp))
 
 {
   \override NoteHead.stem-attachment = #'(1 . 0.95)   
   \override Stem.thickness = #1.0
   \override NoteHead.stencil = #alt-notehead
   %\override NoteHead.stencil = #new-alt-notehead
   c'' 
 %% wanted flip:
 \tweak stencil #(lambda (grob) (grob-interpret-markup grob 
 newStilLeftDown))
 d''  
   e''
   
   a' 
%% wanted flip:
\tweak stencil #(lambda (grob) (grob-interpret-markup grob newStilRightUp))
   g' 
   f'
 }
 
 (I've added some tweaks to show a better output.)
 Basically, I need four note heads instead of one: the idea of 
 'new-alt-notehead' is to determine whether its X-offset is negative or 
 positive in order to chose the right noteHead .
 After many too many trials I feel a little lost.
 Any idea ?
 
 Cheers,
 Pierre
 
 
 
 2015-03-21 21:14 GMT+01:00 Thomas Morley [hidden email]:
 2015-03-21 17:24 GMT+01:00 David Nalesnik [hidden email]:
 
 
  On Fri, Mar 20, 2015 at 1:52 PM, David Nalesnik [hidden email]
  wrote:
 
 
  Probably this file will prove more useful as a hacking tool.  It will show
  you how the different pointer properties are populated.
 
 
  This is better written:
 
  --David
 
 
 Hi David,
 
 please consider to add it to our source.
 It's a very useful developing/debugging tool!
 
 
 Thanks again,
   Harm
 
 ___
 lilypond-user mailing list
 [hidden email]
 https://lists.gnu.org/mailman/listinfo/lilypond-user
 
 
 ___ 
 lilypond-user mailing list 
 [hidden email] 
 https://lists.gnu.org/mailman/listinfo/lilypond-user
 ~Pierre
 
 
 If you reply to this email, your message will be added to the discussion 
 below:
 http://lilypond.1069038.n5.nabble.com/Directional-NoteHead-Stencil-Support-tp173361p173443.html
 To start a new topic under User, email ml-node+s1069038n...@n5.nabble.com 
 To unsubscribe from Lilypond, click here.
 NAML




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Directional-NoteHead-Stencil-Support-tp173361p173445.html
Sent from the User mailing list archive at Nabble.com.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-21 Thread David Nalesnik
Hi,

On Sat, Mar 21, 2015 at 4:32 PM, tisimst tisimst.lilyp...@gmail.com wrote:

 You and me both, Pierre. I've tried for hours to find something that works
 automatically. I've managed to use a single notehead for both up- and
 down-stem notes, thanks to everyone's help here, but I still have one
 problem relating to chords.

 If a notehead, in a chord stack, is forced out of the main column (to the
 right for up-stem chords, to the left for down-stem chords) what property
 (or relationship between grobs) puts them there? I can't seem to figure it
 out.

 - Abraham


If  there's a property which indicates on which side of a stem the note
falls, I don't find it.  Seems like there definitely should be one!

Anyway, here's a snippet which suggests a possible way to go.  It prints
out the X-coordinate of the note heads in a chord, relative to the
organizing NoteColumn.

\version 2.19.17

{
  \override NoteColumn.before-line-breaking =
  #(lambda (grob)
 (let ((notes (ly:grob-array-list (ly:grob-object grob 'note-heads
   (for-each
(lambda (note)
  (format #t ~a at coordinate: ~a~%
(ly:event-property (event-cause note) 'pitch)
(ly:grob-relative-coordinate note grob X)))
notes)
   (newline)))
  c' d' e' g' c'' d''
  cis'' fis'' gis''
}



And the output:

#Pitch c'  at coordinate: 0.0

#Pitch d'  at coordinate: 1.251178

#Pitch e'  at coordinate: 0.0

#Pitch g'  at coordinate: 0.0

#Pitch c''  at coordinate: 0.0

#Pitch d''  at coordinate: 1.251178


#Pitch cis''  at coordinate: 0.0

#Pitch fis''  at coordinate: -1.251178

#Pitch gis''  at coordinate: 0.0


Hope this helps!!


-David
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-21 Thread tisimst
David,

You are a genius! I've almost got it, but I'm not sure how to handle 
rests. Here's my current function:

 #(define (flipnotes grob)
(let ((notes (ly:grob-array-list (ly:grob-object grob 
 'note-heads
  (for-each
(lambda (note)
  (let* ((pitch (ly:event-property (event-cause note) 'pitch))
 (stem (ly:grob-object note 'stem))
 (dir (ly:grob-property stem 'direction))
 (offset (ly:grob-relative-coordinate note grob X)))
(if (eq? dir DOWN)
(if (and ( offset 0.1) ( offset -0.1))
  (ly:grob-set-property! note 'rotation '(180 0 0))
  (ly:grob-set-property! note 'rotation '(0 0 0)))
(if (and ( offset 0.1) ( offset -0.1))
(ly:grob-set-property! note 'rotation '(0 0 0))
(ly:grob-set-property! note 'rotation '(180 0 0)))
)
))
notes)))

This works perfectly when there are NO rests, but I get this error when 
there is a rest in the NoteColumn:

 In procedure ly:grob-array-list in expression (ly:grob-array-list 
 (ly:grob-object grob #)): Wrong type argument in position 1 
 (expecting Grob_array): ()

Thanks so much for your help, everyone.

- Abraham

On Sat, Mar 21, 2015 at 5:27 PM, David Nalesnik-2 [via Lilypond] 
ml-node+s1069038n173452...@n5.nabble.com wrote:
 Hi,
 
 On Sat, Mar 21, 2015 at 4:32 PM, tisimst [hidden email] wrote:
 You and me both, Pierre. I've tried for hours to find something that 
 works automatically. I've managed to use a single notehead for both 
 up- and down-stem notes, thanks to everyone's help here, but I still 
 have one problem relating to chords. 
 
 If a notehead, in a chord stack, is forced out of the main column 
 (to the right for up-stem chords, to the left for down-stem chords) 
 what property (or relationship between grobs) puts them there? I 
 can't seem to figure it out. 
 
 - Abraham
 
 
 If  there's a property which indicates on which side of a stem the 
 note falls, I don't find it.  Seems like there definitely should be 
 one!
 
 Anyway, here's a snippet which suggests a possible way to go.  It 
 prints out the X-coordinate of the note heads in a chord, relative to 
 the organizing NoteColumn.
 
 \version 2.19.17
 
 {
   \override NoteColumn.before-line-breaking = 
   #(lambda (grob)
  (let ((notes (ly:grob-array-list (ly:grob-object grob 
 'note-heads
(for-each
 (lambda (note)
   (format #t ~a at coordinate: ~a~%
 (ly:event-property (event-cause note) 'pitch)
 (ly:grob-relative-coordinate note grob X)))
 notes)
(newline)))
   c' d' e' g' c'' d''
   cis'' fis'' gis''
 }
 
 
 
 And the output:
 
 #Pitch c'  at coordinate: 0.0
 #Pitch d'  at coordinate: 1.251178
 #Pitch e'  at coordinate: 0.0
 #Pitch g'  at coordinate: 0.0
 #Pitch c''  at coordinate: 0.0
 #Pitch d''  at coordinate: 1.251178
 
 #Pitch cis''  at coordinate: 0.0
 #Pitch fis''  at coordinate: -1.251178
 #Pitch gis''  at coordinate: 0.0
 
 Hope this helps!!
 
 -David
 
 ___ 
 lilypond-user mailing list 
 [hidden email] 
 https://lists.gnu.org/mailman/listinfo/lilypond-user
 
 
 If you reply to this email, your message will be added to the 
 discussion below:
 http://lilypond.1069038.n5.nabble.com/Directional-NoteHead-Stencil-Support-tp173361p173452.html
 To start a new topic under User, email 
 ml-node+s1069038n...@n5.nabble.com 
 To unsubscribe from Lilypond, click here.
 NAML




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Directional-NoteHead-Stencil-Support-tp173361p173459.html
Sent from the User mailing list archive at Nabble.com.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-21 Thread David Nalesnik
Hi Abraham,

On Sat, Mar 21, 2015 at 9:13 PM, tisimst tisimst.lilyp...@gmail.com wrote:

 David,

 You are a genius! I've almost got it, but I'm not sure how to handle
 rests. Here's my current function:

 #(define (flipnotes grob)
(let ((notes (ly:grob-array-list (ly:grob-object grob 'note-heads
  (for-each
(lambda (note)
  (let* ((pitch (ly:event-property (event-cause note) 'pitch))
 (stem (ly:grob-object note 'stem))
 (dir (ly:grob-property stem 'direction))
 (offset (ly:grob-relative-coordinate note grob X)))
(if (eq? dir DOWN)
(if (and ( offset 0.1) ( offset -0.1))
  (ly:grob-set-property! note 'rotation '(180 0 0))
  (ly:grob-set-property! note 'rotation '(0 0 0)))
(if (and ( offset 0.1) ( offset -0.1))
(ly:grob-set-property! note 'rotation '(0 0 0))
(ly:grob-set-property! note 'rotation '(180 0 0)))
)
))
notes)))


 This works perfectly when there are NO rests, but I get this error when
 there is a rest in the NoteColumn:

 In procedure ly:grob-array-list in expression (ly:grob-array-list
 (ly:grob-object grob #)): Wrong type argument in position 1 (expecting
 Grob_array): ()



Glad I could help!

If there's a rest, then the note-heads array will be empty.  To make this
work, just add a check that the note-heads list isn't the empty list '().


#(define (flipnotes grob)
   (let ((notes (ly:grob-array-list (ly:grob-object grob 'note-heads
 (if (pair? notes)
 (for-each
  (lambda (note)
(let* (;(pitch (ly:event-property (event-cause note) 'pitch))
;; don't need this
   (stem (ly:grob-object note 'stem))
   (dir (ly:grob-property stem 'direction))
   (offset (ly:grob-relative-coordinate note grob X)))
  (if (eq? dir DOWN)
  (if (and ( offset 0.1) ( offset -0.1))
  (ly:grob-set-property! note 'rotation '(180 0 0))
  (ly:grob-set-property! note 'rotation '(0 0 0)))
  (if (and ( offset 0.1) ( offset -0.1))
  (ly:grob-set-property! note 'rotation '(0 0 0))
  (ly:grob-set-property! note 'rotation '(180 0 0)))
  )
  ))
  notes)
 ; alternate return?

 )))



If you get a rest, this function will return an unspecified value, so you
might want to add another clause to the if-block if you need meaningful
output.

Hope this helps!

David
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-21 Thread tisimst
David,

Yes!!! Yes! Yes! Yes! Yes! Yes!

Seriously, that totally made my day. You are my hero. Scheme is not my native 
language ;-), but I am learning slowly. I did determine the need for that 
check, but was unsure how to do it. I think I have everything I need to make 
this sweet font work beautifully! Can't wait to show everyone!

Best regards,
Abraham

Sent from my iPhone

 On Mar 21, 2015, at 9:35 PM, David Nalesnik-2 [via Lilypond] 
 ml-node+s1069038n17346...@n5.nabble.com wrote:
 
 
 
 On Sat, Mar 21, 2015 at 10:06 PM, David Nalesnik [hidden email] wrote:
 Hi Abraham,
 
 On Sat, Mar 21, 2015 at 9:13 PM, tisimst [hidden email] wrote:
 David,
 
 [...]
  
 This works perfectly when there are NO rests, but I get this error when 
 there is a rest in the NoteColumn:
 
 In procedure ly:grob-array-list in expression (ly:grob-array-list 
 (ly:grob-object grob #)): Wrong type argument in position 1 (expecting 
 Grob_array): ()
 
 Glad I could help!
 
 If there's a rest, then the note-heads array will be empty.  To make this 
 work, just add a check that the note-heads list isn't the empty list '().
 
  Oh, shoot!  It's past my bedtime...
 
 The error happens because you're applying ly:grob-array-list to that 
 grob-array which is empty when there's a rest.  So the check has to be before 
 the conversion to a list:
 
 #(define (flipnotes grob)
(let ((notes (ly:grob-object grob 'note-heads)))
  (if (ly:grob-array? notes)
  (for-each
   (lambda (note)
 (let* (;(pitch (ly:event-property (event-cause note) 'pitch)) ;; 
 don't need this
(stem (ly:grob-object note 'stem))
(dir (ly:grob-property stem 'direction))
(offset (ly:grob-relative-coordinate note grob X)))
   (if (eq? dir DOWN)
   (if (and ( offset 0.1) ( offset -0.1))
   (ly:grob-set-property! note 'rotation '(180 0 0))
   (ly:grob-set-property! note 'rotation '(0 0 0)))
   (if (and ( offset 0.1) ( offset -0.1))
   (ly:grob-set-property! note 'rotation '(0 0 0))
   (ly:grob-set-property! note 'rotation '(180 0 0)))
   )
   ))
   (ly:grob-array-list notes))
  ; alternate return?
  
  )))
 
 
 --David
 
 
 ___ 
 lilypond-user mailing list 
 [hidden email] 
 https://lists.gnu.org/mailman/listinfo/lilypond-user
 
 
 If you reply to this email, your message will be added to the discussion 
 below:
 http://lilypond.1069038.n5.nabble.com/Directional-NoteHead-Stencil-Support-tp173361p173461.html
 To start a new topic under User, email ml-node+s1069038n...@n5.nabble.com 
 To unsubscribe from Lilypond, click here.
 NAML




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Directional-NoteHead-Stencil-Support-tp173361p173462.html
Sent from the User mailing list archive at Nabble.com.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-21 Thread David Nalesnik
On Sat, Mar 21, 2015 at 10:06 PM, David Nalesnik david.nales...@gmail.com
wrote:

 Hi Abraham,

 On Sat, Mar 21, 2015 at 9:13 PM, tisimst tisimst.lilyp...@gmail.com
 wrote:

 David,


[...]


 This works perfectly when there are NO rests, but I get this error when
 there is a rest in the NoteColumn:

 In procedure ly:grob-array-list in expression (ly:grob-array-list
 (ly:grob-object grob #)): Wrong type argument in position 1 (expecting
 Grob_array): ()



 Glad I could help!

 If there's a rest, then the note-heads array will be empty.  To make this
 work, just add a check that the note-heads list isn't the empty list '().


 Oh, shoot!  It's past my bedtime...

The error happens because you're applying ly:grob-array-list to that
grob-array which is empty when there's a rest.  So the check has to be
before the conversion to a list:

#(define (flipnotes grob)
   (let ((notes (ly:grob-object grob 'note-heads)))
 (if (ly:grob-array? notes)
 (for-each
  (lambda (note)
(let* (;(pitch (ly:event-property (event-cause note) 'pitch))
;; don't need this
   (stem (ly:grob-object note 'stem))
   (dir (ly:grob-property stem 'direction))
   (offset (ly:grob-relative-coordinate note grob X)))
  (if (eq? dir DOWN)
  (if (and ( offset 0.1) ( offset -0.1))
  (ly:grob-set-property! note 'rotation '(180 0 0))
  (ly:grob-set-property! note 'rotation '(0 0 0)))
  (if (and ( offset 0.1) ( offset -0.1))
  (ly:grob-set-property! note 'rotation '(0 0 0))
  (ly:grob-set-property! note 'rotation '(180 0 0)))
  )
  ))
  (ly:grob-array-list notes))
 ; alternate return?

 )))


--David
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-20 Thread Marc Hohl

Am 19.03.2015 um 19:56 schrieb Abraham Lee:
[...]

When I get the 'stem-attachment property of the notehead, it always
gives me the top-right value, regardless of where the stem is actually
attached. I'm hoping this will work for chords, too, though I haven't
experimented enough to know for sure. Any help is always appreciated!


I am not sure whether I understand you correctly, but the stem direction 
property gives you the info needed to decide whether to rotate the 
glyph, isn't it?


Marc


Regards,
Abraham


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user




___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-20 Thread Pierre Perol-Schneider
Hi Abraham, Hi All,

Yes Marc, the stem direction property is definitly the one, but I think his
question is how to?.
For instance I've come to this, which does not seem to work properly :

\version 2.19.16
#(set-global-staff-size 25)

stil = \markup {
  \override #'(filled . #t)
  \path #0.01 #'(
 (moveto0.00   -0.50)
 (curveto   0.00   -0.10   0.00   0.50  0.60   0.50)
 (curveto   1.560.50   1.62  -0.50  1.00  -0.50)
 (curveto   0.56   -0.50   0.58  -0.19  0.70   0.00)
 (curveto   0.780.13   0.80   0.45  0.50   0.45)
 (curveto   0.060.45   0.08  -0.13  0.08  -0.50)
 (closepath))
}

newstil = \markup\rotate #180 \stil

%% does not work properly
#(define alt-notehead
  (lambda (grob)
(if (eq? (ly:grob-property grob 'direction) DOWN)
 ;; does not work:
 ;(if (= DOWN (ly:grob-property grob 'direction))
 ;; does not work either:
 ;(if (= -1 (ly:grob-property grob 'direction))
 (grob-interpret-markup grob stil)
 (grob-interpret-markup grob newstil

{
  \override NoteHead.stem-attachment = #'(1 . 0.95)
  \override Stem.thickness = #1.0
  %% does not work propely:
  %\override NoteHead.stencil = #alt-notehead

  \once\override NoteHead.stencil = #(lambda (grob) (grob-interpret-markup
grob stil))
  c''

  \override NoteHead.stencil = #(lambda (grob) (grob-interpret-markup grob
newstil))
  a'
}

HTH,
Pierre

2015-03-20 8:05 GMT+01:00 Marc Hohl m...@hohlart.de:

 Am 19.03.2015 um 19:56 schrieb Abraham Lee:
 [...]

 When I get the 'stem-attachment property of the notehead, it always
 gives me the top-right value, regardless of where the stem is actually
 attached. I'm hoping this will work for chords, too, though I haven't
 experimented enough to know for sure. Any help is always appreciated!


 I am not sure whether I understand you correctly, but the stem direction
 property gives you the info needed to decide whether to rotate the glyph,
 isn't it?

 Marc


 Regards,
 Abraham


 ___
 lilypond-user mailing list
 lilypond-user@gnu.org
 https://lists.gnu.org/mailman/listinfo/lilypond-user



 ___
 lilypond-user mailing list
 lilypond-user@gnu.org
 https://lists.gnu.org/mailman/listinfo/lilypond-user

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-20 Thread Thomas Morley
2015-03-20 18:03 GMT+01:00 David Nalesnik david.nales...@gmail.com:

 Hi again,

 On Fri, Mar 20, 2015 at 9:21 AM, David Nalesnik david.nales...@gmail.com 
 wrote:



 Finding the path from one object to another is usually just a matter of 
 trial-and-error, following this path, following that path, until you reach 
 the pot of gold.


 You might find the attached file helpful.  Given a grob name, it will output 
 a list of each interface supported by the grob and the objects accessible 
 through those interfaces.   More information might be added--the type 
 (whether a single grob or a grob-array) and the documentation string 
 associated with it.

 Hope this is helpful!
 David


Hi David,

thanks a lot for this

Finally my question
http://lists.gnu.org/archive/html/lilypond-user/2014-03/msg00393.html
is answered:

\relative c'{
\override NoteColumn.after-line-breaking =
#(lambda (grob)
  (display
(ly:grob-object grob 'conditional-elements)
))
c e g\arpeggio
}

The 'arpeggio-property was deleted somewhere during 2.17. and I never
managed to get back the info whether a NoteColumn has an arpeggio,

Again, thanks tons!!!

Btw, the IR stating:

  conditional-elements (array of grobs)
  Internal use only.

is a joke.


Additionally the already mentioned LSR-snippet
http://lsr.di.unimi.it/LSR/Item?id=621
doesn't put out arpeggio-info any more and should be changed accordingly.


Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-20 Thread Thomas Morley
2015-03-21 0:09 GMT+01:00 Thomas Morley thomasmorle...@gmail.com:


 The 'arpeggio-property was deleted somewhere during 2.17. and I never
 managed to get back the info whether a NoteColumn has an arpeggio,

Btw, I tried again to find the commit on the tracker which removed the
'arpeggio-property (and probably the reason for it) and again without
success.

-Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-20 Thread David Nalesnik
Hi,

On Fri, Mar 20, 2015 at 7:14 AM, Paul Morris p...@paulwmorris.com wrote:

 There's a snippet in the lsr for accessing grobs laterally from another
 grob's callback:
 http://lsr.di.unimi.it/LSR/Item?id=621

 ...like accessing the stem grob from a note head grob.  There's also one
 on showing grob ancestry that's helpful for this kind of thing.


This is a helpful snippet.

If you look at the various interface pages, under Internal Properties in
the Internals Reference, you'll find other grobs (single grobs or multiple
grobs stored in a grob-array) that your grob stores pointers to, meaning
that you have easy access to the other object(s).  The grob NoteHead has
rhythmic-head-interface (see bottom of page at
http://lilypond.org/doc/v2.19/Documentation/internals/notehead).  Under the
Internals page for that interface
http://lilypond.org/doc/v2.19/Documentation/internals/rhythmic_002dhead_002dinterface
we find:

Internal properties:

dot (graphical (layout) object)

A reference to a Dots object.
stem (graphical (layout) object)

A pointer to a Stem object.


With ly:grob-object, we can get at either a Dot or a Stem.

So, with your function you could write:


#(define alt-notehead
   (lambda (grob)
 (let ((stem (ly:grob-object grob 'stem)))
   (if (ly:grob? stem) ;; perhaps unnecessary, but let's be safe
   (if (eq? (ly:grob-property stem 'direction) DOWN)
   (grob-interpret-markup grob stil)
   (grob-interpret-markup grob newstil))


Finding the path from one object to another is usually just a matter of
trial-and-error, following this path, following that path, until you reach
the pot of gold.

HTH,
David
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-20 Thread Paul Morris
There's a snippet in the lsr for accessing grobs laterally from another 
grob's callback:
http://lsr.di.unimi.it/LSR/Item?id=621

...like accessing the stem grob from a note head grob.  There's also one on 
showing grob ancestry that's helpful for this kind of thing.

HTH, 
-Paul
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-20 Thread David Nalesnik
On Fri, Mar 20, 2015 at 12:12 PM, David Nalesnik david.nales...@gmail.com
wrote:



 On Fri, Mar 20, 2015 at 12:03 PM, David Nalesnik david.nales...@gmail.com
  wrote:

 Hi again,

 On Fri, Mar 20, 2015 at 9:21 AM, David Nalesnik david.nales...@gmail.com
  wrote:



 Finding the path from one object to another is usually just a matter of
 trial-and-error, following this path, following that path, until you reach
 the pot of gold.


 You might find the attached file helpful.  Given a grob name, it will
 output a list of each interface supported by the grob and the objects
 accessible through those interfaces.


 Each interface that includes pointers, that is.


Probably this file will prove more useful as a hacking tool.  It will show
you how the different pointer properties are populated.

--David
\version 2.19.16

#(define (grob-interface::info iface)
   (hashq-get-handle (ly:all-grob-interfaces) iface))

#(define (grob-interface::properties iface-info)
   (if iface-info (cadddr iface-info) '()))

#(define (grob-interface::pointers grob iface)
   (let* ((info (grob-interface::info iface))
  (props (grob-interface::properties info))
  (pointers
   (and (pair? props)
(filter
 (lambda (prop)
   (let ((type (object-property prop 'backend-type?)))
 (or (eq? type ly:grob?)
 (eq? type ly:grob-array?
 props
 (if pointers
 (map
  (lambda (p) (list p (ly:grob-object grob p)))
  pointers

#(define (grob::all-pointers grob)
   (let ((ifaces (ly:grob-interfaces grob)))
 
 (define (entry iface)
   (let ((pointers (grob-interface::pointers grob iface)))
 (if (pair? pointers)
 (list (list iface pointers))
 '(
 
 (let loop ((ifaces ifaces) (result '()))
   (if (null? ifaces)
   result
   (loop (cdr ifaces)
 (append result (entry (car ifaces

#(define (display-pointers grob)
   (format #t ~%~y ~y~%
 (grob::name grob)
 (grob::all-pointers grob)))

%%

{
  \override NoteHead.after-line-breaking = #display-pointers
  \override Slur.after-line-breaking = #display-pointers
  cis''8.( c'!16)
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-20 Thread Pierre Perol-Schneider
Dear Paul, Dear David,

Thank you very much for your kind help.
Lots of info! I'll study you links and codes during the WE.

Cheers,
Pierre

2015-03-20 19:52 GMT+01:00 David Nalesnik david.nales...@gmail.com:



 On Fri, Mar 20, 2015 at 12:12 PM, David Nalesnik david.nales...@gmail.com
  wrote:



 On Fri, Mar 20, 2015 at 12:03 PM, David Nalesnik 
 david.nales...@gmail.com wrote:

 Hi again,

 On Fri, Mar 20, 2015 at 9:21 AM, David Nalesnik 
 david.nales...@gmail.com wrote:



 Finding the path from one object to another is usually just a matter of
 trial-and-error, following this path, following that path, until you reach
 the pot of gold.


 You might find the attached file helpful.  Given a grob name, it will
 output a list of each interface supported by the grob and the objects
 accessible through those interfaces.


 Each interface that includes pointers, that is.


 Probably this file will prove more useful as a hacking tool.  It will show
 you how the different pointer properties are populated.

 --David


 ___
 lilypond-user mailing list
 lilypond-user@gnu.org
 https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-20 Thread David Nalesnik
Hi again,

On Fri, Mar 20, 2015 at 9:21 AM, David Nalesnik david.nales...@gmail.com
wrote:



 Finding the path from one object to another is usually just a matter of
 trial-and-error, following this path, following that path, until you reach
 the pot of gold.


You might find the attached file helpful.  Given a grob name, it will
output a list of each interface supported by the grob and the objects
accessible through those interfaces.   More information might be added--the
type (whether a single grob or a grob-array) and the documentation string
associated with it.

Hope this is helpful!
David
\version 2.19.16

#(define (grob-interface::info iface)
   (hashq-get-handle (ly:all-grob-interfaces) iface))

#(define (grob-interface::properties ifaces)
   (if ifaces (cadddr ifaces) '()))

#(define (grob-interface::pointers iface)
   (let* ((info (grob-interface::info iface))
  (props (grob-interface::properties info)))
 (and (pair? props)
  (filter
   (lambda (prop)
 (let ((type (object-property prop 'backend-type?)))
   (or (eq? type ly:grob?)
   (eq? type ly:grob-array?
   props

#(define (grob::default-interfaces grob-name)
   (assoc-get 'interfaces
 (assoc-get 'meta
   (assoc-get grob-name all-grob-descriptions

#(define (grob::all-pointers grob-name)
   (let ((ifaces (grob::default-interfaces grob-name)))
 
 (define (entry iface)
   (let ((pointers (grob-interface::pointers iface)))
 (if (pair? pointers)
 (list (list iface (grob-interface::pointers iface)))
 '(
 
 (let loop ((ifaces ifaces) (result '()))
   (if (null? ifaces)
   result
   (loop (cdr ifaces)
 (append result (entry (car ifaces

#(define (display-pointers grob-name)
   (if (assoc-get grob-name all-grob-descriptions)
   (format #t ~%~y ~y~%
 grob-name
 (grob::all-pointers grob-name))
   (ly:message Not a grob name: ~a grob-name)))

%%

#(display-pointers 'NoteHead)

#(display-pointers 'NoteColumn)

#(display-pointers 'Beam)
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-20 Thread David Nalesnik
On Fri, Mar 20, 2015 at 12:03 PM, David Nalesnik david.nales...@gmail.com
wrote:

 Hi again,

 On Fri, Mar 20, 2015 at 9:21 AM, David Nalesnik david.nales...@gmail.com
 wrote:



 Finding the path from one object to another is usually just a matter of
 trial-and-error, following this path, following that path, until you reach
 the pot of gold.


 You might find the attached file helpful.  Given a grob name, it will
 output a list of each interface supported by the grob and the objects
 accessible through those interfaces.


Each interface that includes pointers, that is.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-20 Thread tisimst
David, Paul, and Pierre,

It will take me a short while to digest what you have shared with me, 
but thank you for sharing your knowledge concerning this matter. I'll 
contact you again if I do or don't figure out how to do what I need.

Regards,
Abraham

On Fri, Mar 20, 2015 at 1:06 PM, Schneidy [via Lilypond] 
ml-node+s1069038n173404...@n5.nabble.com wrote:
 Dear Paul, Dear David,
 
 Thank you very much for your kind help.
 Lots of info! I'll study you links and codes during the WE.
 
 Cheers,
 Pierre
 
 2015-03-20 19:52 GMT+01:00 David Nalesnik [hidden email]:
 
 
 On Fri, Mar 20, 2015 at 12:12 PM, David Nalesnik [hidden email] 
 wrote:
 
 
 On Fri, Mar 20, 2015 at 12:03 PM, David Nalesnik [hidden email] 
 wrote:
 Hi again,
 
 On Fri, Mar 20, 2015 at 9:21 AM, David Nalesnik [hidden email] 
 wrote:
 
 
 Finding the path from one object to another is usually just a 
 matter of trial-and-error, following this path, following that 
 path, until you reach the pot of gold.
 
 
 You might find the attached file helpful.  Given a grob name, it 
 will output a list of each interface supported by the grob and the 
 objects accessible through those interfaces. 
 
 Each interface that includes pointers, that is. 
 
 Probably this file will prove more useful as a hacking tool.  It 
 will show you how the different pointer properties are populated.
 
 --David 
 
 
 ___
 lilypond-user mailing list
 [hidden email]
 https://lists.gnu.org/mailman/listinfo/lilypond-user
 
 
 
 ___ 
 lilypond-user mailing list 
 [hidden email] 
 https://lists.gnu.org/mailman/listinfo/lilypond-user
 ~Pierre
 
 
 If you reply to this email, your message will be added to the 
 discussion below:
 http://lilypond.1069038.n5.nabble.com/Directional-NoteHead-Stencil-Support-tp173361p173404.html
 To start a new topic under User, email 
 ml-node+s1069038n...@n5.nabble.com 
 To unsubscribe from Lilypond, click here.
 NAML




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Directional-NoteHead-Stencil-Support-tp173361p173409.html
Sent from the User mailing list archive at Nabble.com.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-19 Thread Urs Liska
Just a very uneducated guess: couldn't you make rotated copies in the font 
itself?

Am 19. März 2015 19:56:16 MEZ, schrieb Abraham Lee tisimst.lilyp...@gmail.com:
I've been collaborating with an Italian design student that created
numerous music fonts for a school project, but they aren't actually
used in
any notation program (yet), but he has agreed to work with me and take
the
steps necessary to make them usable with LilyPond. Each of his fonts
are
quite stylized and are designed to represent a different genre of
music.
The one I'm doing first is meant to imitate the feeling of the famous
Didot
(or Bodoni) text font, with lots of thick and thin elements. Anyone
seen
this before? It is his designer that they be made available for free,
licensed under the OFL. He's pretty excited to see his work get out
there.

Before I can do this, however, there's one issue I haven't been able to
solve. The noteheads (quarter and half) are designed such that it
really
only has ONE stem attachment point (marked in orange in the attached
image).


​

For stems going up (right-side of image), it is the top-right point.
For
stems going down (left-side of image), the glyph must be rotated 180
degrees so the same attachment point is now at the bottom-left where
the
stem is located. The rotation part I've been able to figure out, but it
isn't automatic yet. My question is this: how do I determine when a
particular notehead's _true_ stem attachment at that moment is going to
be
at the bottom-left so I can rotate the notehead glyph? I don't care
what
the value is, though it may be needed to determine the event, I just
want
to know _when_ it happens. I hope that makes sense.

Here's my simple code so far:

#(define alt-notehead
  (lambda (grob)
(let* ((stil (ly:note-head::print grob))
   (newstil (ly:stencil-rotate stil 180 0 0)))
 newstil)))

Then, when I want to use it, I do:

(\once) \override NoteHead.stencil = #alt-notehead

When I get the 'stem-attachment property of the notehead, it always
gives
me the top-right value, regardless of where the stem is actually
attached.
I'm hoping this will work for chords, too, though I haven't
experimented
enough to know for sure. Any help is always appreciated!

Regards,
Abraham




___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-19 Thread tisimst
I definitely could, but, like I said, the rotation part isn't what I can't
do. I need to be able to know _when_ they are needed and when they aren't.
I can't figure out how to do that. Good thought, though.

- Abraham

On Thu, Mar 19, 2015 at 1:58 PM, Urs Liska [via Lilypond] 
ml-node+s1069038n173364...@n5.nabble.com wrote:

 Just a very uneducated guess: couldn't you make rotated copies in the font
 itself?

 Am 19. März 2015 19:56:16 MEZ, schrieb Abraham Lee [hidden email]
 http:///user/SendEmail.jtp?type=nodenode=173364i=0:

 I've been collaborating with an Italian design student that created
 numerous music fonts for a school project, but they aren't actually used in
 any notation program (yet), but he has agreed to work with me and take the
 steps necessary to make them usable with LilyPond. Each of his fonts are
 quite stylized and are designed to represent a different genre of music.
 The one I'm doing first is meant to imitate the feeling of the famous Didot
 (or Bodoni) text font, with lots of thick and thin elements. Anyone seen
 this before? It is his designer that they be made available for free,
 licensed under the OFL. He's pretty excited to see his work get out there.

 Before I can do this, however, there's one issue I haven't been able to
 solve. The noteheads (quarter and half) are designed such that it really
 only has ONE stem attachment point (marked in orange in the attached
 image).


 ​

 For stems going up (right-side of image), it is the top-right point. For
 stems going down (left-side of image), the glyph must be rotated 180
 degrees so the same attachment point is now at the bottom-left where the
 stem is located. The rotation part I've been able to figure out, but it
 isn't automatic yet. My question is this: how do I determine when a
 particular notehead's _true_ stem attachment at that moment is going to be
 at the bottom-left so I can rotate the notehead glyph? I don't care what
 the value is, though it may be needed to determine the event, I just want
 to know _when_ it happens. I hope that makes sense.

 Here's my simple code so far:

 #(define alt-notehead
   (lambda (grob)
 (let* ((stil (ly:note-head::print grob))
(newstil (ly:stencil-rotate stil 180 0 0)))
  newstil)))

 Then, when I want to use it, I do:

 (\once) \override NoteHead.stencil = #alt-notehead

 When I get the 'stem-attachment property of the notehead, it always
 gives me the top-right value, regardless of where the stem is actually
 attached. I'm hoping this will work for chords, too, though I haven't
 experimented enough to know for sure. Any help is always appreciated!

 Regards,
 Abraham

 --

 lilypond-user mailing list
 [hidden email] http:///user/SendEmail.jtp?type=nodenode=173364i=1
 https://lists.gnu.org/mailman/listinfo/lilypond-user


 ___
 lilypond-user mailing list
 [hidden email] http:///user/SendEmail.jtp?type=nodenode=173364i=2
 https://lists.gnu.org/mailman/listinfo/lilypond-user


 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://lilypond.1069038.n5.nabble.com/Directional-NoteHead-Stencil-Support-tp173361p173364.html
  To start a new topic under User, email ml-node+s1069038n...@n5.nabble.com
 To unsubscribe from Lilypond, click here
 http://lilypond.1069038.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=2code=dGlzaW1zdC5saWx5cG9uZEBnbWFpbC5jb218Mnw4MzU3Njg3MDU=
 .
 NAML
 http://lilypond.1069038.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml





--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Directional-NoteHead-Stencil-Support-tp173361p173366.html
Sent from the User mailing list archive at Nabble.com.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Directional NoteHead Stencil Support

2015-03-19 Thread Abraham Lee
I've been collaborating with an Italian design student that created
numerous music fonts for a school project, but they aren't actually used in
any notation program (yet), but he has agreed to work with me and take the
steps necessary to make them usable with LilyPond. Each of his fonts are
quite stylized and are designed to represent a different genre of music.
The one I'm doing first is meant to imitate the feeling of the famous Didot
(or Bodoni) text font, with lots of thick and thin elements. Anyone seen
this before? It is his designer that they be made available for free,
licensed under the OFL. He's pretty excited to see his work get out there.

Before I can do this, however, there's one issue I haven't been able to
solve. The noteheads (quarter and half) are designed such that it really
only has ONE stem attachment point (marked in orange in the attached
image).


​

For stems going up (right-side of image), it is the top-right point. For
stems going down (left-side of image), the glyph must be rotated 180
degrees so the same attachment point is now at the bottom-left where the
stem is located. The rotation part I've been able to figure out, but it
isn't automatic yet. My question is this: how do I determine when a
particular notehead's _true_ stem attachment at that moment is going to be
at the bottom-left so I can rotate the notehead glyph? I don't care what
the value is, though it may be needed to determine the event, I just want
to know _when_ it happens. I hope that makes sense.

Here's my simple code so far:

#(define alt-notehead
  (lambda (grob)
(let* ((stil (ly:note-head::print grob))
   (newstil (ly:stencil-rotate stil 180 0 0)))
 newstil)))

Then, when I want to use it, I do:

(\once) \override NoteHead.stencil = #alt-notehead

When I get the 'stem-attachment property of the notehead, it always gives
me the top-right value, regardless of where the stem is actually attached.
I'm hoping this will work for chords, too, though I haven't experimented
enough to know for sure. Any help is always appreciated!

Regards,
Abraham
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Directional NoteHead Stencil Support

2015-03-19 Thread Urs Liska



Am 19.03.2015 um 21:07 schrieb tisimst:
I definitely could, but, like I said, the rotation part isn't what I 
can't do. I need to be able to know _when_ they are needed and when 
they aren't. I can't figure out how to do that. Good thought, though.


As said I'm not really into this. But my reasoning was that when 
creating independent noteheads for stem up/down in the font you could 
make the decision manually and don't have to find a way to let 
LilyPond find it out for you.


Urs



- Abraham

On Thu, Mar 19, 2015 at 1:58 PM, Urs Liska [via Lilypond] [hidden 
email] /user/SendEmail.jtp?type=nodenode=173366i=0 wrote:


Just a very uneducated guess: couldn't you make rotated copies in
the font itself?

Am 19. März 2015 19:56:16 MEZ, schrieb Abraham Lee [hidden email]
http:///user/SendEmail.jtp?type=nodenode=173364i=0:

I've been collaborating with an Italian design student that
created numerous music fonts for a school project, but they
aren't actually used in any notation program (yet), but he has
agreed to work with me and take the steps necessary to make
them usable with LilyPond. Each of his fonts are quite
stylized and are designed to represent a different genre of
music. The one I'm doing first is meant to imitate the feeling
of the famous Didot (or Bodoni) text font, with lots of thick
and thin elements. Anyone seen this before? It is his designer
that they be made available for free, licensed under the OFL.
He's pretty excited to see his work get out there.

Before I can do this, however, there's one issue I haven't
been able to solve. The noteheads (quarter and half) are
designed such that it really only has ONE stem attachment
point (marked in orange in the attached image).


​

For stems going up (right-side of image), it is the top-right
point. For stems going down (left-side of image), the glyph
must be rotated 180 degrees so the same attachment point is
now at the bottom-left where the stem is located. The rotation
part I've been able to figure out, but it isn't automatic yet.
My question is this: how do I determine when a particular
notehead's _true_ stem attachment at that moment is going to
be at the bottom-left so I can rotate the notehead glyph? I
don't care what the value is, though it may be needed to
determine the event, I just want to know _when_ it happens. I
hope that makes sense.

Here's my simple code so far:

#(define alt-notehead
  (lambda (grob)
(let* ((stil (ly:note-head::print grob))
   (newstil (ly:stencil-rotate stil 180 0 0)))
 newstil)))

Then, when I want to use it, I do:

(\once) \override NoteHead.stencil = #alt-notehead

When I get the 'stem-attachment property of the notehead, it
always gives me the top-right value, regardless of where the
stem is actually attached. I'm hoping this will work for
chords, too, though I haven't experimented enough to know for
sure. Any help is always appreciated!

Regards,
Abraham



lilypond-user mailing list
[hidden email]  http:///user/SendEmail.jtp?type=nodenode=173364i=1
https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
[hidden email] http:///user/SendEmail.jtp?type=nodenode=173364i=2
https://lists.gnu.org/mailman/listinfo/lilypond-user



If you reply to this email, your message will be added to the
discussion below:

http://lilypond.1069038.n5.nabble.com/Directional-NoteHead-Stencil-Support-tp173361p173364.html

To start a new topic under User, email [hidden email]
/user/SendEmail.jtp?type=nodenode=173366i=1
To unsubscribe from Lilypond, click here.
NAML

http://lilypond.1069038.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml





View this message in context: Re: Directional NoteHead Stencil Support 
http://lilypond.1069038.n5.nabble.com/Directional-NoteHead-Stencil-Support-tp173361p173366.html
Sent from the User mailing list archive 
http://lilypond.1069038.n5.nabble.com/User-f3.html at Nabble.com.



___
lilypond-user mailing list
lilypond-user