]> git.donarmstrong.com Git - lilypond.git/commitdiff
New function: \ottava #oct, replaces #(set-octavation oct)
authorReinhold Kainhofer <reinhold@kainhofer.com>
Sat, 28 Jun 2008 12:07:25 +0000 (14:07 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Tue, 29 Jul 2008 10:10:20 +0000 (12:10 +0200)
14 files changed:
Documentation/es/user/pitches.itely
Documentation/es/user/tweaks.itely
Documentation/fr/user/pitches.itely
Documentation/user/pitches.itely
Documentation/user/tweaks.itely
input/regression/backend-excercise.ly
input/regression/clef-ottava.ly
input/regression/line-dash-small-period.ly
input/regression/ottava-broken.ly
input/regression/ottava-edge.ly
input/regression/ottava.ly
ly/music-functions-init.ly
python/convertrules.py
python/musicexp.py

index befae8abc3ada45167d6811fa27f70eb567b513c..3ae57fcf3743f871140982737829ae5acd93e94f 100644 (file)
@@ -918,14 +918,14 @@ de una octava para el pentagrama.
 
 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
 a'2 b
-#(set-octavation 1)
+\ottava #1
 a b
-#(set-octavation 0)
+\ottava #0
 a b
 @end lilypond
 
 
-La función @code{set-octavation} también admite los valores -1 (para
+La función @code{ottava} también admite los valores -1 (para
 8va bassa), 2@tie{}(para 15ma) y -2 (para 15ma bassa) como argumentos.
 
 
index 4c2c3cf3d694766dafe801726290e9814a8e7aa1..d6e5fbc9808a3be175d97d2642fdcc17d1b5189f 100644 (file)
@@ -1777,7 +1777,7 @@ de ellos.
 % Place dynamics above staff
 \dynamicUp
 % Start Ottava Bracket
-#(set-octavation 1)
+\ottava #1
 c' \startTextSpan
 % Add Dynamic Text
 c\pp
@@ -1789,7 +1789,7 @@ c c
 % Add Dynamic Text
 c\ff c \stopTextSpan
 % Stop Ottava Bracket
-#(set-octavation 0)
+\ottava #0
 c, c c c
 @end lilypond
 
@@ -1842,7 +1842,7 @@ recordando que @code{OttavaBracket} se crea dentro del contexto de
 %Place following Ottava Bracket below Text Spanners
 \once \override Staff.OttavaBracket #'outside-staff-priority = #340
 % Start Ottava Bracket
-#(set-octavation 1)
+\ottava #1
 c' \startTextSpan
 % Add Dynamic Text
 c\pp
@@ -1854,7 +1854,7 @@ c c
 % Add Dynamic Text
 c\ff c \stopTextSpan
 % Stop Ottava Bracket
-#(set-octavation 0)
+\ottava #0
 c, c c c
 @end lilypond
 
index da8265d08b1be847c2cd706f6b618db68a3b233f..da5dc12ebb1d72860cd6fe1d66071c17f7c8af8d 100644 (file)
@@ -669,7 +669,7 @@ Référence du programme : @rinternals{KeyCancellation},
 
 Les marques d'octaviation, @emph{Ottava}, permettent d'introduire une
 transposition spécifique d'une octave pour la portée en cours.  C'est
-la fonction @code{set-octavation} qui s'en charge.
+la fonction @code{ottava} qui s'en charge.
 
 @cindex ottava
 @cindex 15ma
@@ -678,24 +678,24 @@ la fonction @code{set-octavation} qui s'en charge.
 @lilypond[quote,ragged-right,verbatim,fragment]
 \relative c''' {
   a2 b
-  #(set-octavation 1)
+  \ottava #1
   a b
-  #(set-octavation 0)
+  \ottava #0
   a b
 }
 @end lilypond
 
-La fonction @code{set-octavation} peut aussi prendre en argument les
+La fonction @code{ottava} peut aussi prendre en argument les
 valeurs -1@tie{}(pour 8va bassa), 2@tie{}(pour 15ma --- 2 octaves) ou
 -2@tie{}(pour 15ma bassa).   En interne, cette fonction détermine les
 propriétés @code{ottavation} (p.ex. en @code{"8va"} ou @code{"8vb"})
 et @code{centralCPosition}.  Vous pouvez modifier le texte d'une marque
 d'octaviation en définissant @code{ottavation} après avoir fait appel
-à @code{set-octavation} :
+à @code{ottava} :
 
 @lilypond[quote,ragged-right,verbatim]
 {
-  #(set-octavation 1)
+  \ottava #1
   \set Staff.ottavation = #"8"
   c'''
 }
@@ -709,7 +709,7 @@ Référence du programme : @rinternals{OttavaBracket}.
 
 @knownissues
 
-@code{set-octavation} gère difficilement les changements de clé qui
+@code{ottava} gère difficilement les changements de clé qui
 pourraient intervenir alors qu'elle est effective.
 
 
index 6547f6ff5194b10032329abbcdb3f91162cd1a72..46ec22246f6e33181d64b4e42391135a353c30a6 100644 (file)
@@ -910,13 +910,13 @@ octave for the staff:
 
 @lilypond[verbatim,quote,relative=2]
 a'2 b
-#(set-octavation 1)
+\ottava #1
 a b
-#(set-octavation 0)
+\ottava #0
 a b
 @end lilypond
 
-The @code{set-octavation} function also takes -1 (for 8va bassa),
+The @code{ottava} function also takes -1 (for 8va bassa),
 2@tie{}(for 15ma), and -2 (for 15ma bassa) as arguments.
 
 
index 44a977e173440a8273fa6d9046bc93d6430ba6a0..8d8925bd89aa4688ef2c609d37fa52342c3711f2 100644 (file)
@@ -1753,7 +1753,7 @@ these.
 % Place dynamics above staff
 \dynamicUp
 % Start Ottava Bracket
-#(set-octavation 1)
+\ottava #1
 c' \startTextSpan
 % Add Dynamic Text
 c\pp
@@ -1765,7 +1765,7 @@ c c
 % Add Dynamic Text
 c\ff c \stopTextSpan
 % Stop Ottava Bracket
-#(set-octavation 0)
+\ottava #0
 c, c c c
 @end lilypond
 
@@ -1816,7 +1816,7 @@ that @code{OttavaBracket} is created in the @code{Staff} context:
 %Place following Ottava Bracket below Text Spanners
 \once \override Staff.OttavaBracket #'outside-staff-priority = #340
 % Start Ottava Bracket
-#(set-octavation 1)
+\ottava #1
 c' \startTextSpan
 % Add Dynamic Text
 c\pp
@@ -1828,7 +1828,7 @@ c c
 % Add Dynamic Text
 c\ff c \stopTextSpan
 % Stop Ottava Bracket
-#(set-octavation 0)
+\ottava #0
 c, c c c
 @end lilypond
 
index 030576111996cb125a466575a65927306bb0e188..fdd5567c42970ea2ad45a992ce31ea5220c2f119 100644 (file)
@@ -2,7 +2,7 @@
   texidoc = "Excercise all output functions"
 }
 
-\version "2.11.51"
+\version "2.11.53"
 
 \paper { ragged-right = ##t }
 
@@ -10,9 +10,9 @@
   \new StaffGroup \new PianoStaff <<
     \new Staff
       {
-       #(set-octavation 1)
+       \ottava #1
        \times 2/3 {  c'8[\< f]( f''\!)  }
-       #(set-octavation 0)
+       \ottava #0
        <f,, \5>4
 
        \override TextScript #'color = #red
index 6556bb351621da7a4a9244bdbf562da5ccd0a080..ac904455e150734f20670d79191ec4b38e8f91d0 100644 (file)
@@ -5,21 +5,21 @@
 but they don't confuse one another."
 }
 
-\version "2.11.51"
+\version "2.11.53"
 
 \layout { ragged-right = ##t} 
 
 \relative c''  {
   \clef "alto"
   a b c a
-  #(set-octavation 1)
+  \ottava #1
   a b c a
   \clef "bass"
   a b c a
-  #(set-octavation 2)
+  \ottava #2
   a b c a
   \clef "treble"
-  #(set-octavation -1)
+  \ottava #-1
   a b c a
 }
 
index ce12c95cec27e8c6307bbcbc2e8f4dc5be289f52..e42e398c878dc0e177cac9d421540b60d99f2b2b 100644 (file)
@@ -5,12 +5,13 @@
 
 }
 
-\version "2.11.51"
+\version "2.11.53"
+
 \relative {
   \override Staff.OttavaBracket #'dash-period = #0.1
   \override Score.OttavaBracket #'dash-fraction = #1
 
-  #(set-octavation 1)
+  \ottava #1
   c4 c
 }
 
index a4eed913102dd20ba1977cf07e47952fd497c11b..a97629e7145a43bcae8dcc9909f364d0d16b3b60 100644 (file)
@@ -10,16 +10,16 @@ the end of the line (regardless of prefatory matter).
 
 }
 
-\version "2.11.51"
+\version "2.11.53"
 
 
 \layout { ragged-right = ##t }
 \relative c'''  {
     a2 b
-    #(set-octavation 1)
+    \ottava #1
     a2 b \time 3/4  \break c''2. \break
     a
-    #(set-octavation 0)
+    \ottava #0
     g,,2 b4 c2 a4 
 }
 
index 005ae10b69e506a563037a16c6835e9a9f80d51a..604b5839521d2c5b0a9cc3d31961e55c1a0d502a 100644 (file)
@@ -4,7 +4,8 @@
   texidoc = 
   "Both edge heights of an ottava bracket can be specified."
 }
-\version "2.11.51"
+
+\version "2.11.53"
 
 
 \layout { ragged-right = ##t} 
 \relative c'''  {
 
   %standard ottavation
-  #(set-octavation 1)
+  \ottava #1
   a b c
-  #(set-octavation 0)
+  \ottava #0
   a
   
   %override the left edge height to produce standard text with a left edge
-  #(set-octavation 1)
+  \ottava #1
   \once \override Staff.OttavaBracket #'edge-height = #'(1.2 . 1.2)
   a b c
-  #(set-octavation 0)
+  \ottava #0
   a
   
   % Look! we can make them go up!
-  #(set-octavation 1)
+  \ottava #1
   \once \override Staff.OttavaBracket #'edge-height = #'(-1 . -1)
   a b c
-  #(set-octavation 0)
+  \ottava #0
   a
   
   % and have them go in different directions
-  #(set-octavation 1)
+  \ottava #1
   \once \override Staff.OttavaBracket #'edge-height = #'(-1.2 . 1.2)
   a b c
-  #(set-octavation 0)
+  \ottava #0
   a
  
 }
index f14dd831a15822d2ab5a939a0e7c5667e2174abe..3aa9e035329eea80e1e4cdb766d7c06d89eb2435 100644 (file)
@@ -2,7 +2,7 @@
 \header
 {
   texidoc = "Ottava brackets are supported, through the
-use of the scheme function @code{set-octavation}.
+use of the music function @code{\\ottava}.
 
 The spanner should go below a staff for 8va bassa, and the ottavation
 markup can be tuned with @code{Staff.ottavation}.
@@ -10,7 +10,8 @@ markup can be tuned with @code{Staff.ottavation}.
 "
 
 }
-\version "2.11.51"
+
+\version "2.11.53"
 
 %% . There must be a minimum distance between the octavation line and the
 %%   topmost staff line, taking into account the height of the closing
@@ -36,33 +37,33 @@ markup can be tuned with @code{Staff.ottavation}.
 
 \relative c'''  {
   a b c a
-  #(set-octavation 1)
+  \ottava #1
   a b c a
-  #(set-octavation 0)
-  #(set-octavation 2)
+  \ottava #0
+  \ottava #2
   a b c a
-  #(set-octavation 0)
-  #(set-octavation -1)
+  \ottava #0
+  \ottava #-1
   a b c a
-  #(set-octavation 0)
+  \ottava #0
   \break
   a, 
-  #(set-octavation 1)
+  \ottava #1
   \set Staff.ottavation = #"8"
   b
-  #(set-octavation 0)
+  \ottava #0
   c a 
-  #(set-octavation -1)
+  \ottava #-1
   \set Staff.ottavation = \markup { \concat { 8 \tiny \raise #0.8 vb }}
   b a g
-  #(set-octavation 0)
+  \ottava #0
   c 
-  #(set-octavation -1)
+  \ottava #-1
   \set Staff.ottavation = #"8"
   c,,16
-  #(set-octavation 0)
+  \ottava #0
   c'16
-  #(set-octavation -1)
+  \ottava #-1
   \set Staff.ottavation = #"8"
   g,,16
 }
index a9d38dbad13b9508f3bbf44370c4a5b104e7181f..10af2cfefb8f720f02b034d67d9894b0e08a02b4 100644 (file)
@@ -453,7 +453,12 @@ octaveCheck =
    (make-music 'RelativeOctaveCheck
               'origin location
               'pitch (pitch-of-note pitch-note) 
-              ))
+           ))
+
+ottava = #(define-music-function (parser location octave) (number?)
+  (_i "set the octavation ")
+  (make-ottava-set octave))
+
 partcombine =
 #(define-music-function (parser location part1 part2) (ly:music? ly:music?)
                 (make-part-combine-music parser
index 12a3b6c5b64655ea8d76e9d08fd534f96e512aa2..5e6dfc23b932d5d6ea8bf5c26dc980eedeba7e3d 100644 (file)
@@ -2785,10 +2785,12 @@ def conv (str):
     str = str.replace ("setHairpinDim", "dimHairpin")
     return str
 
-@rule ((2, 11, 53), "infinite-spacing-height -> extra-spacing-height")
+@rule ((2, 11, 53), "infinite-spacing-height -> extra-spacing-height, \
+#(set-octavation oct) -> \\ottava #oct")
 def conv (str):
     str = re.sub (r"infinite-spacing-height\s+=\s+##t", r"extra-spacing-height = #'(-inf.0 . +inf.0)", str)
     str = re.sub (r"infinite-spacing-height\s+=\s+##f", r"extra-spacing-height = #'(0 . 0)", str)
+    str = re.sub (r"#\(set-octavation (-*[0-9]+)\)", r"\\ottava #\1", str)
     return str
 
 # Guidelines to write rules (please keep this at the end of this file)
index 940683aa11f1cc267012b2c3e9368ac9698f0de4..01cd446f481fc0b83c33fed9e5783aea3d78c00f 100644 (file)
@@ -901,10 +901,10 @@ class OctaveShiftEvent (SpanEvent):
         dir = self.ly_octave_shift_indicator ()
         value = ''
         if dir:
-            value = '#(set-octavation %s)' % dir
+            value = '\ottava #%s' % dir
         return { 
             -1: value,
-            1: '#(set-octavation 0)'}.get (self.span_direction, '')
+            1: '\ottava #0'}.get (self.span_direction, '')
 
 class TrillSpanEvent (SpanEvent):
     def ly_expression (self):