]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/snippets/defining-an-engraver-in-scheme--ambitus-engraver.ly
LSR local update
[lilypond.git] / Documentation / snippets / defining-an-engraver-in-scheme--ambitus-engraver.ly
index 88efc8c20f6c8bdca90cd4a1bf4edeab90fb6b8c..1e9e48026139d28cc6b1082d0a45a66e9e4907a2 100644 (file)
@@ -1,28 +1,25 @@
-% DO NOT EDIT this file manually; it is automatically
-% generated from Documentation/snippets/new
-% Make any changes in Documentation/snippets/new/
-% and then run scripts/auxiliar/makelsr.py
-%
-% This file is in the public domain.
-%% Note: this file works from version 2.16.0
-\version "2.16.0"
+%% DO NOT EDIT this file manually; it is automatically
+%% generated from LSR http://lsr.di.unimi.it
+%% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
+%% and then run scripts/auxiliar/makelsr.py
+%%
+%% This file is in the public domain.
+\version "2.18.0"
 
 \header {
-
   lsrtags = "contexts-and-engravers"
 
+  texidoc = "
+This example demonstrates how the ambitus engraver may be defined on
+the user side, with a Scheme engraver.
 
-  texidoc = "This example demonstrates how the ambitus engraver may be
-  defined on the user side, with a Scheme engraver.
+This is basically a rewrite in Scheme of the code from
+@code{lily/ambitus-engraver.cc}.
 
-  This is basically a rewrite in Scheme of the code from
-  @file{lily/ambitus-engraver.cc}.
 "
-
   doctitle = "Defining an engraver in Scheme: ambitus engraver"
 } % begin verbatim
 
-
 #(use-modules (oop goops))
 
 %%%
@@ -184,7 +181,7 @@ position of middle C and key signature from @var{translator}'s context."
                                     0))
          (set! (ambitus-start-key-sig ambitus)
                (ly:context-property (ly:translator-context translator)
-                                    'keySignature)))))
+                                    'keyAlterations)))))
 
 #(define-method (update-ambitus-notes (ambitus <ambitus>) note-grob)
    "Update the upper and lower ambitus pithes of @var{ambitus}, using
@@ -297,23 +294,23 @@ position of middle C and key signature from @var{translator}'s context."
      (let ((ambitus #f))
        ;; when music is processed: make the ambitus object, if not already built
        (make-engraver
-       ((process-music translator)
-        (if (not ambitus)
-            (set! ambitus (make-ambitus translator))))
-       ;; set the ambitus clef and key signature state
-       ((stop-translation-timestep translator)
-        (if ambitus
-            (initialize-ambitus-state ambitus translator)))
-       ;; when a note-head grob is built, update the ambitus notes
-       (acknowledgers
+    ((process-music translator)
+     (if (not ambitus)
+         (set! ambitus (make-ambitus translator))))
+    ;; set the ambitus clef and key signature state
+    ((stop-translation-timestep translator)
+     (if ambitus
+         (initialize-ambitus-state ambitus translator)))
+    ;; when a note-head grob is built, update the ambitus notes
+    (acknowledgers
           ((note-head-interface engraver grob source-engraver)
-          (if ambitus
-              (update-ambitus-notes ambitus grob))))
-       ;; finally, typeset the ambitus according to its upper and lower notes
-       ;; (if any).
-       ((finalize translator)
-        (if ambitus
-            (typeset-ambitus ambitus translator)))))))
+       (if ambitus
+           (update-ambitus-notes ambitus grob))))
+    ;; finally, typeset the ambitus according to its upper and lower notes
+    ;; (if any).
+    ((finalize translator)
+     (if ambitus
+         (typeset-ambitus ambitus translator)))))))
 
 %%%
 %%% Example