Re: Doc: simplify example for unpure-pure containers (issue 5623044)

2012-03-03 Thread Carl Sorensen
On 3/2/12 11:58 PM, m...@apollinemike.com m...@apollinemike.com wrote:

On Feb 3, 2012, at 4:38 PM, plros...@gmail.com wrote:

 Why do stems fix the spacing?

I don't understand the question :(

I believe it's because stems are involved in optical spacing decisions.

Thanks,

Carl


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


Re: Doc: simplify example for unpure-pure containers (issue 5623044)

2012-03-03 Thread plroskin

I mean, why is this needed?
\remove Stem_engraver
Stems must be fixing the problem somehow.

http://codereview.appspot.com/5623044/

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


Re: Doc: simplify example for unpure-pure containers (issue 5623044)

2012-03-02 Thread plroskin

Since nobody is interested, I'm closing this issue.


http://codereview.appspot.com/5623044/

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


Re: Doc: simplify example for unpure-pure containers (issue 5623044)

2012-03-02 Thread dak

On 2012/02/03 15:38:16, Pavel Roskin wrote:

To be honest, there are many things I don't understand.  In fact, I

reduced the

example to understand it better.



Why is horizontal spacing affected even though the purity affects the

Y-axis

only?  Why do stems fix the spacing?  Why doesn't this cause the

spacing

problem:



   \override NoteHead #'text = \markup { o }
   \override NoteHead #'stencil = #ly:text-interface::print



But this does cause the problem:



   \override NoteHead #'text = \markup { o }
   \override NoteHead #'stencil =
#(lambda (grob) (ly:text-interface::print grob))



Cannot it happen a simple change would make Lilypond recognize lambda
expressions as pure functions, breaking this example?  Maybe I removed

some

future-proofing?



Perhaps some answers to those questions could be used to improve the
documentation.


See the end of define-grobs.scm.  purity detection is hardwired.

http://codereview.appspot.com/5623044/

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


Re: Doc: simplify example for unpure-pure containers (issue 5623044)

2012-03-02 Thread m...@apollinemike.com
On Feb 3, 2012, at 4:38 PM, plros...@gmail.com wrote:

 To be honest, there are many things I don't understand.  In fact, I
 reduced the example to understand it better.
 
 Why is horizontal spacing affected even though the purity affects the
 Y-axis only?

Because horizontal spacing is based on thing's height.  If something is tall, 
it may lead to wider spacing as it cannot be kerned.

 Why do stems fix the spacing?

I don't understand the question :(

 Why doesn't this cause the
 spacing problem:
 
  \override NoteHead #'text = \markup { o }
  \override NoteHead #'stencil = #ly:text-interface::print
 

text-interface::print is declared pure towards the bottom of define-grobs.scm

 But this does cause the problem:
 
  \override NoteHead #'text = \markup { o }
  \override NoteHead #'stencil =
   #(lambda (grob) (ly:text-interface::print grob))
 
 Cannot it happen a simple change would make Lilypond recognize lambda
 expressions as pure functions, breaking this example?

This is why unpure-pure-containers exist.

Cheers,
MS


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


Re: Doc: simplify example for unpure-pure containers (issue 5623044)

2012-02-03 Thread plroskin

To be honest, there are many things I don't understand.  In fact, I
reduced the example to understand it better.

Why is horizontal spacing affected even though the purity affects the
Y-axis only?  Why do stems fix the spacing?  Why doesn't this cause the
spacing problem:

  \override NoteHead #'text = \markup { o }
  \override NoteHead #'stencil = #ly:text-interface::print

But this does cause the problem:

  \override NoteHead #'text = \markup { o }
  \override NoteHead #'stencil =
   #(lambda (grob) (ly:text-interface::print grob))

Cannot it happen a simple change would make Lilypond recognize lambda
expressions as pure functions, breaking this example?  Maybe I removed
some future-proofing?

Perhaps some answers to those questions could be used to improve the
documentation.

http://codereview.appspot.com/5623044/

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


Doc: simplify example for unpure-pure containers (issue 5623044)

2012-02-02 Thread plroskin

Reviewers: ,

Message:
The example could be much simpler and still show the problem being
addressed by the unpure-pure containers.

Description:
Doc: simplify example for unpure-pure containers

Use of ly:event-property only confuses matters.  Squares are never used.

Draw circles unconditionally, make them empty inside (which would make
the wrong output easier to discern) and name the macros roundNotes and
smartRoundNotes.  No need to define a separate Scheme function, a
one-line lambda in stencil definition is enough.

Don't remove Stem_engraver, just use whole notes and adjust the time
signature.

Please review this at http://codereview.appspot.com/5623044/

Affected files:
  M Documentation/notation/changing-defaults.itely


Index: Documentation/notation/changing-defaults.itely
diff --git a/Documentation/notation/changing-defaults.itely  
b/Documentation/notation/changing-defaults.itely
index  
68aa8b8c4943a78b3d9a247d26679f991cc8d8b1..7fa9f19f80d9f5cc8b8972f90a08419d99dbcc11  
100644

--- a/Documentation/notation/changing-defaults.itely
+++ b/Documentation/notation/changing-defaults.itely
@@ -3752,32 +3752,26 @@ value which is then used for fine-tuning much later  
during the spacing

 process.

 @lilypond[verbatim,quote,ragged-right]
-#(define (square-line-circle-space grob)
-(let* ((pitch (ly:event-property (ly:grob-property grob 'cause) 'pitch))
-  (notename (ly:pitch-notename pitch)))
- (if (= 0 (modulo notename 2))
- (make-circle-stencil 0.5 0.0 #t)
- (make-filled-box-stencil '(0 . 1.0)
-  '(-0.5 . 0.5)
-
-squareLineCircleSpace = {
-  \override NoteHead #'stencil = #square-line-circle-space
+roundNotes = {
+  \override NoteHead #'stencil =
+   #(lambda (grob) (make-circle-stencil 0.5 0.1 #f))
 }

-smartSquareLineCircleSpace = {
-  \squareLineCircleSpace
+smartRoundNotes = {
+  \roundNotes
   \override NoteHead #'Y-extent =
#(ly:make-unpure-pure-container
   ly:grob::stencil-height
   (lambda (grob start end) (ly:grob::stencil-height grob)))
 }

-\new Voice \with { \remove Stem_engraver }
+\new Voice
 \relative c'' {
-  \squareLineCircleSpace
-  cis4 ces cisis c
-  \smartSquareLineCircleSpace
-  cis4 ces cisis c
+  \time 4/1
+  \roundNotes
+  cis1 ces cisis c
+  \smartRoundNotes
+  cis1 ces cisis c
 }
 @end lilypond




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


Re: Doc: simplify example for unpure-pure containers (issue 5623044)

2012-02-02 Thread graham

LGTM, but I'd like David or Mike to give it the ok.  If they do, I think
this can be pushed directly.

http://codereview.appspot.com/5623044/

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