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
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to