From 589ba7953e92ad4ad793d89291b97d738614408e Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Sat, 28 Jun 2008 14:07:25 +0200 Subject: [PATCH] New function: \ottava #oct, replaces #(set-octavation oct) --- Documentation/es/user/pitches.itely | 6 ++--- Documentation/es/user/tweaks.itely | 8 +++--- Documentation/fr/user/pitches.itely | 14 +++++----- Documentation/user/pitches.itely | 6 ++--- Documentation/user/tweaks.itely | 8 +++--- input/regression/backend-excercise.ly | 6 ++--- input/regression/clef-ottava.ly | 8 +++--- input/regression/line-dash-small-period.ly | 5 ++-- input/regression/ottava-broken.ly | 6 ++--- input/regression/ottava-edge.ly | 19 ++++++------- input/regression/ottava.ly | 31 +++++++++++----------- ly/music-functions-init.ly | 7 ++++- python/convertrules.py | 4 ++- python/musicexp.py | 4 +-- 14 files changed, 71 insertions(+), 61 deletions(-) diff --git a/Documentation/es/user/pitches.itely b/Documentation/es/user/pitches.itely index befae8abc3..3ae57fcf37 100644 --- a/Documentation/es/user/pitches.itely +++ b/Documentation/es/user/pitches.itely @@ -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. diff --git a/Documentation/es/user/tweaks.itely b/Documentation/es/user/tweaks.itely index 4c2c3cf3d6..d6e5fbc980 100644 --- a/Documentation/es/user/tweaks.itely +++ b/Documentation/es/user/tweaks.itely @@ -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 diff --git a/Documentation/fr/user/pitches.itely b/Documentation/fr/user/pitches.itely index da8265d08b..da5dc12ebb 100644 --- a/Documentation/fr/user/pitches.itely +++ b/Documentation/fr/user/pitches.itely @@ -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. diff --git a/Documentation/user/pitches.itely b/Documentation/user/pitches.itely index 6547f6ff51..46ec22246f 100644 --- a/Documentation/user/pitches.itely +++ b/Documentation/user/pitches.itely @@ -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. diff --git a/Documentation/user/tweaks.itely b/Documentation/user/tweaks.itely index 44a977e173..8d8925bd89 100644 --- a/Documentation/user/tweaks.itely +++ b/Documentation/user/tweaks.itely @@ -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 diff --git a/input/regression/backend-excercise.ly b/input/regression/backend-excercise.ly index 0305761119..fdd5567c42 100644 --- a/input/regression/backend-excercise.ly +++ b/input/regression/backend-excercise.ly @@ -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 4 \override TextScript #'color = #red diff --git a/input/regression/clef-ottava.ly b/input/regression/clef-ottava.ly index 6556bb3516..ac904455e1 100644 --- a/input/regression/clef-ottava.ly +++ b/input/regression/clef-ottava.ly @@ -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 } diff --git a/input/regression/line-dash-small-period.ly b/input/regression/line-dash-small-period.ly index ce12c95cec..e42e398c87 100644 --- a/input/regression/line-dash-small-period.ly +++ b/input/regression/line-dash-small-period.ly @@ -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 } diff --git a/input/regression/ottava-broken.ly b/input/regression/ottava-broken.ly index a4eed91310..a97629e714 100644 --- a/input/regression/ottava-broken.ly +++ b/input/regression/ottava-broken.ly @@ -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 } diff --git a/input/regression/ottava-edge.ly b/input/regression/ottava-edge.ly index 005ae10b69..604b583952 100644 --- a/input/regression/ottava-edge.ly +++ b/input/regression/ottava-edge.ly @@ -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} @@ -12,30 +13,30 @@ \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 } diff --git a/input/regression/ottava.ly b/input/regression/ottava.ly index f14dd831a1..3aa9e03532 100644 --- a/input/regression/ottava.ly +++ b/input/regression/ottava.ly @@ -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 } diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly index a9d38dbad1..10af2cfefb 100644 --- a/ly/music-functions-init.ly +++ b/ly/music-functions-init.ly @@ -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 diff --git a/python/convertrules.py b/python/convertrules.py index 12a3b6c5b6..5e6dfc23b9 100644 --- a/python/convertrules.py +++ b/python/convertrules.py @@ -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) diff --git a/python/musicexp.py b/python/musicexp.py index 940683aa11..01cd446f48 100644 --- a/python/musicexp.py +++ b/python/musicexp.py @@ -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): -- 2.39.2