]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.81
authorfred <fred>
Mon, 28 Aug 2000 12:32:18 +0000 (12:32 +0000)
committerfred <fred>
Mon, 28 Aug 2000 12:32:18 +0000 (12:32 +0000)
input/test/pushproperty.ly [new file with mode: 0644]

diff --git a/input/test/pushproperty.ly b/input/test/pushproperty.ly
new file mode 100644 (file)
index 0000000..7ca018f
--- /dev/null
@@ -0,0 +1,78 @@
+
+%{
+
+Look at ly/engraver.ly for inspiration on which basicXXXXProperties
+there are.
+
+Generally, you can find interesting element properties associated with
+\property in scm/generic-property.scm. For example, this file contains
+
+       (define generic-stem-properties
+         (cons 'stem-interface
+               (list
+                (list 'stemVerticalDirection dir? 'direction)
+                (list 'verticalDirection dir? 'direction)       
+                (list 'stemLength number? 'length)
+                (list 'flagStyle string? 'flag-style)
+       )))
+
+
+which means that setting \property stemVerticalDirection overrides
+setting \property verticalDirection, and that both have the effect of
+setting `direction' in Stem object. You can use \pushproperty for
+setting stem directions by doing.
+
+
+       \pushproperty #'(basicStemProperties) #'direction #1
+
+(#-1 if you want down).  
+
+Generally \pushproperty and \popproperty take precedence over
+\property, so in this example \property stemVerticalDirection will not
+work as long as you did a \pushproperty on basicStemProperties
+
+A modest amount of memory is involved each time you do a
+\pushproperty. If you do \popproperty in the right order (reversed
+from \pushproperty), then \popproperty doesn't cost memory.
+
+Correct:
+
+       \pushproperty #'(  ... ) #'symbolA #valueA
+       \pushproperty #'(  ... ) #'symbolB #valueB
+       \popproperty #'(  ... ) #'symbolB 
+       \popproperty #'(  ... ) #'symbolA 
+
+Incorrect (\popproperty costs memory):
+
+       \pushproperty #'(  ... ) #'symbolA #valueA
+       \pushproperty #'(  ... ) #'symbolB #valueB
+       \popproperty #'(  ... ) #'symbolA 
+       \popproperty #'(  ... ) #'symbolB 
+
+
+
+
+
+the syntax isn't likely to stay, so it is advisable to
+use identifiers, eg.
+
+    slursUp = \context Voice \pushproperty '(basicSlurProperties)
+           #'direction  #1
+    slursBoth = \context Voice \popproperty '(basicSlurProperties)
+
+%}
+
+\score { \notes
+\relative c' {
+       c4(
+       \context Voice \pushproperty #'(basicDotsProperties basicStemProperties
+       basicNoteColumnProperties basicScriptProperties basicTextProperties) #'direction #-1
+       ) c4 (
+       ) c4 (  
+       \context Voice \pushproperty #'(basicSlurProperties) #'direction #-1
+       ) c4 ( \context Voice  \popproperty #'(basicDotsProperties basicStemProperties
+               basicScriptProperties basicTextProperties) #'direction
+
+        ) c4  () c4 
+}
+}