From: fred Date: Mon, 28 Aug 2000 12:32:18 +0000 (+0000) Subject: lilypond-1.3.81 X-Git-Tag: release/1.5.59~5730 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a74e3b8ea65ca22f7ecb2d408654a0db347886af;p=lilypond.git lilypond-1.3.81 --- diff --git a/input/test/pushproperty.ly b/input/test/pushproperty.ly new file mode 100644 index 0000000000..7ca018f9b9 --- /dev/null +++ b/input/test/pushproperty.ly @@ -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 +} +}