From: Neil Puttock Date: Thu, 29 May 2008 21:11:26 +0000 (+0100) Subject: Fix 627, change \compressMusic to \scaleDurations. X-Git-Tag: release/2.11.48-1~21^2~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=eeec8de35d7090f0c4d41ce81e0c00b241a1e694;p=lilypond.git Fix 627, change \compressMusic to \scaleDurations. --- diff --git a/Documentation/es/user/rhythms.itely b/Documentation/es/user/rhythms.itely index a6236031ef..8e0071f8d8 100644 --- a/Documentation/es/user/rhythms.itely +++ b/Documentation/es/user/rhythms.itely @@ -308,7 +308,7 @@ modificar mediante un multiplicador. Esto es útil para saltar muchos compases, como por ejemplo @code{s1*23}. @cindex compresión de música -@funindex \compressMusic +@funindex \scaleDurations De la misma forma, se pueden comprimir por una fracción trozos de música más largos, como si cada nota, acorde o silencio tuviera la @@ -316,7 +316,7 @@ fracción como multiplicador. La sintaxis general de la iinstrucción que lo hace es: @example -\compressMusic #'(@emph{numerador} . @emph{denominador}) @{ @emph{música} @} +\scaleDurations #'(@emph{numerador} . @emph{denominador}) @{ @emph{música} @} @end example @noindent @@ -331,11 +331,11 @@ comprimir y expandir la música: % Normal durations 4 c8 a % Scale music by *2/3 -\compressMusic #'(2 . 3) { +\scaleDurations #'(2 . 3) { 4. c8 a f } % Scale music by *2 -\compressMusic #'(2 . 1) { +\scaleDurations #'(2 . 1) { 4 c8 b } @end lilypond diff --git a/Documentation/fr/user/rhythms.itely b/Documentation/fr/user/rhythms.itely index 49fdc49997..e1ae49040f 100644 --- a/Documentation/fr/user/rhythms.itely +++ b/Documentation/fr/user/rhythms.itely @@ -819,11 +819,11 @@ commune à toutes les portées, que vous proratiserez manuellement selon le cas en utilisant @code{timeSignatureFraction} pour obtenir la division adéquate pour chaque portée. Les durées, dans chacune des portées, seront alors échelonnées par rapport à la métrique commune. -L'échelle de représentation se règle avec @code{\compressMusic} --- +L'échelle de représentation se règle avec @code{\scaleDurations} --- qui fonctionne comme @code{\times}, sans toutefois créer de crochet. La syntaxe appropriée est : @example -\compressMusic #'(@var{numérateur} . @var{dénominateur}) @var{exprmusicale} +\scaleDurations #'(@var{numérateur} . @var{dénominateur}) @var{exprmusicale} @end example @@ -841,13 +841,13 @@ multipliées par 3/5, de telle sorte que @w{3/5 * 10/8 = 3/4}. \new Staff { \time 3/4 \set Staff.timeSignatureFraction = #'(9 . 8) - \compressMusic #'(2 . 3) + \scaleDurations #'(2 . 3) \repeat unfold 6 { c8[ c c] } } \new Staff { \time 3/4 \set Staff.timeSignatureFraction = #'(10 . 8) - \compressMusic #'(3 . 5) { + \scaleDurations #'(3 . 5) { \repeat unfold 2 { c8[ c c] } \repeat unfold 2 { c8[ c] } | c4. c4. \times 2/3 { c8 c c } c4 diff --git a/Documentation/user/rhythms.itely b/Documentation/user/rhythms.itely index 9219f8a06a..a6b736c665 100644 --- a/Documentation/user/rhythms.itely +++ b/Documentation/user/rhythms.itely @@ -11,10 +11,6 @@ @ignore GDP TODO list -\compressMusic -> \scaleDurations. -approved by Han-Wen; just needs somebody to kick up a fuss about -it. - 1.2.3.1 Time signature Needs an example of beatLength, which is broken (see my recent mail @@ -296,8 +292,6 @@ placed within tuplet brackets. @cindex scaling durations @cindex durations, scaling -TODO Change \compressMusic to \scaleDurations when implemented. - You can alter the duration of single notes, rests or chords by a fraction @code{N/M} by appending @code{*N/M} (or @code{*N} if @code{M} is 1) to the duration. @@ -326,7 +320,7 @@ a multiplier. This is useful for skipping many measures, e.g., @code{s1*23}. @cindex compressing music -@funindex \compressMusic +@funindex \scaleDurations Longer stretches of music may be compressed by a fraction in the same way, as if every note, chord or rest had the fraction as a @@ -341,11 +335,11 @@ and expanded: % Normal durations 4 c8 a % Scale music by *2/3 -\compressMusic #'(2 . 3) { +\scaleDurations #'(2 . 3) { 4. c8 a f } % Scale music by *2 -\compressMusic #'(2 . 1) { +\scaleDurations #'(2 . 1) { 4 c8 b } @end lilypond @@ -1212,7 +1206,7 @@ This notation can be created by setting a common time signature for each staff but replacing the symbol manually by setting @code{timeSignatureFraction} to the desired fraction and scaling the printed durations in each staff to the common time -signature. This done with @code{\compressMusic}, which +signature. This done with @code{\scaleDurations}, which is used in a similar way to @code{\times}, but does not create a tuplet bracket, see @ref{Scaling durations}. @@ -1231,13 +1225,13 @@ staff, shown durations are multiplied by 3/5, as 3/5 * 10/8 = 3/4. \new Staff { \time 3/4 \set Staff.timeSignatureFraction = #'(9 . 8) - \compressMusic #'(2 . 3) + \scaleDurations #'(2 . 3) \repeat unfold 6 { c8[ c c] } } \new Staff { \time 3/4 \set Staff.timeSignatureFraction = #'(10 . 8) - \compressMusic #'(3 . 5) { + \scaleDurations #'(3 . 5) { \repeat unfold 2 { c8[ c c] } \repeat unfold 2 { c8[ c] } | c4. c4. \times 2/3 { c8 c c } c4 diff --git a/input/lsr/changing-time-signatures-inside-a-polymetric-section-using--compressmusic.ly b/input/lsr/changing-time-signatures-inside-a-polymetric-section-using--compressmusic.ly deleted file mode 100644 index 46df9510c9..0000000000 --- a/input/lsr/changing-time-signatures-inside-a-polymetric-section-using--compressmusic.ly +++ /dev/null @@ -1,49 +0,0 @@ -%% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it -%% This file is in the public domain. -\version "2.11.46" - -\header { - lsrtags = "rhythms, contexts-and-engravers" - - texidoc = " -The @code{measureLength} property, together with -@code{measurePosition}, determines when a bar line is needed. However, -when using @code{\\compressMusic}, the scaling of durations makes it -difficult to change time signatures without making a mess of it. -Therefore, @code{measureLength} has to be set manually, using the -@code{ly:make-moment} callback. The second argument must be the same as -the second argument of @code{\\compressMusic}. - -" - doctitle = "Changing time signatures inside a polymetric section using \\compressMusic" -} % begin verbatim -\layout { - \context { - \Score - \remove "Timing_translator" - \remove "Default_bar_line_engraver" - } - \context { - \Staff - \consists "Timing_translator" - \consists "Default_bar_line_engraver" - } -} - -<< - \new Staff { - \compressMusic #'(8 . 5) { - \time 6/8 - \set Timing.measureLength = #(ly:make-moment 3 5) - b8 b b b b b - \time 2/4 - \set Timing.measureLength = #(ly:make-moment 2 5) - b4 b - } - } - \new Staff { - \clef bass - \time 2/4 - c2 d e f - } ->> diff --git a/input/lsr/changing-time-signatures-inside-a-polymetric-section-using-scaledurations.ly b/input/lsr/changing-time-signatures-inside-a-polymetric-section-using-scaledurations.ly new file mode 100644 index 0000000000..09dfad965d --- /dev/null +++ b/input/lsr/changing-time-signatures-inside-a-polymetric-section-using-scaledurations.ly @@ -0,0 +1,45 @@ +%% Do not edit this file; it is auto-generated from input/new +%% This file is in the public domain. +\version "2.11.48" +\header { + lsrtags = "rhythms,contexts-and-engravers" + texidoc = "The @code{measureLength} property, together with +@code{measurePosition}, determines when a bar line is needed. However, +when using @code{\\scaleDurations}, the scaling of durations makes it +difficult to change time signatures without making a mess of it. +Therefore, @code{measureLength} has to be set manually, using the +@code{ly:make-moment} callback. The second argument must be the same as +the second argument of @code{\\scaleDurations}." + doctitle = "Changing time signatures inside a polymetric section using @code{\\scaleDurations}" +} % begin verbatim + +\layout { + \context { + \Score + \remove "Timing_translator" + \remove "Default_bar_line_engraver" + } + \context { + \Staff + \consists "Timing_translator" + \consists "Default_bar_line_engraver" + } +} + +<< + \new Staff { + \scaleDurations #'(8 . 5) { + \time 6/8 + \set Timing.measureLength = #(ly:make-moment 3 5) + b8 b b b b b + \time 2/4 + \set Timing.measureLength = #(ly:make-moment 2 5) + b4 b + } + } + \new Staff { + \clef bass + \time 2/4 + c2 d e f + } +>> diff --git a/input/lsr/contexts-and-engravers.snippet-list b/input/lsr/contexts-and-engravers.snippet-list index 34d873ef8c..85119e8576 100644 --- a/input/lsr/contexts-and-engravers.snippet-list +++ b/input/lsr/contexts-and-engravers.snippet-list @@ -1,11 +1,11 @@ creating-blank-staves.ly vocal-ensemble-template-with-lyrics-aligned-below-and-above-the-staves.ly +changing-time-signatures-inside-a-polymetric-section-using-scaledurations.ly adding-a-figured-bass-above-or-below-the-notes.ly adding-an-extra-staff-at-a-line-break.ly adding-an-extra-staff.ly chant-or-psalms-notation.ly -changing-time-signatures-inside-a-polymetric-section-using--compressmusic.ly +use-square-bracket-at-the-start-of-a-staff-group.ly mensurstriche-layout-bar-lines-between-the-staves.ly engravers-one-by-one.ly -use-square-bracket-at-the-start-of-a-staff-group.ly nesting-staves.ly diff --git a/input/lsr/rhythms.snippet-list b/input/lsr/rhythms.snippet-list index 17f851a170..d36a0ea575 100644 --- a/input/lsr/rhythms.snippet-list +++ b/input/lsr/rhythms.snippet-list @@ -4,23 +4,23 @@ manually-controlling-beam-positions.ly adding-drum-parts.ly rest-styles.ly chant-or-psalms-notation.ly -heavily-customized-polymetric-time-signatures.ly controlling-tuplet-bracket-visibility.ly -skips-in-lyric-mode-2.ly +heavily-customized-polymetric-time-signatures.ly positioning-multi--measure-rests.ly using-ties-with-arpeggios.ly forcing-rehearsal-marks-to-start-from-a-given-letter-or-number.ly integrating-text-indications-in-metronome-marks.ly compound-time-signatures.ly +changing-time-signatures-inside-a-polymetric-section-using-scaledurations.ly modifying-tuplet-bracket-length.ly printing-metronome-and-rehearsal-marks-below-the-staff.ly -changing-time-signatures-inside-a-polymetric-section-using--compressmusic.ly making-an-object-invisible-with-the-transparent-property.ly merging-multi-measure-rests-in-a-polyphonic-part.ly automatic-beam-subdivisions.ly changing-the-tuplet-number.ly entering-several-tuplets-using-only-one--times-command.ly conducting-signs,-measure-grouping-signs.ly +skips-in-lyric-mode-2.ly changing-form-of-multi--measure-rests.ly rhythmic-slashes.ly automatic-beams-two-per-two-in-4-4-or-2-2-time-signature.ly diff --git a/input/new/changing-time-signatures-inside-a-polymetric-section-using-scaledurations.ly b/input/new/changing-time-signatures-inside-a-polymetric-section-using-scaledurations.ly new file mode 100644 index 0000000000..6cef1f8770 --- /dev/null +++ b/input/new/changing-time-signatures-inside-a-polymetric-section-using-scaledurations.ly @@ -0,0 +1,43 @@ +\version "2.11.48" +\header { + lsrtags = "rhythms,contexts-and-engravers" + texidoc = "The @code{measureLength} property, together with +@code{measurePosition}, determines when a bar line is needed. However, +when using @code{\\scaleDurations}, the scaling of durations makes it +difficult to change time signatures without making a mess of it. +Therefore, @code{measureLength} has to be set manually, using the +@code{ly:make-moment} callback. The second argument must be the same as +the second argument of @code{\\scaleDurations}." + doctitle = "Changing time signatures inside a polymetric section using @code{\\scaleDurations}" +} + +\layout { + \context { + \Score + \remove "Timing_translator" + \remove "Default_bar_line_engraver" + } + \context { + \Staff + \consists "Timing_translator" + \consists "Default_bar_line_engraver" + } +} + +<< + \new Staff { + \scaleDurations #'(8 . 5) { + \time 6/8 + \set Timing.measureLength = #(ly:make-moment 3 5) + b8 b b b b b + \time 2/4 + \set Timing.measureLength = #(ly:make-moment 2 5) + b4 b + } + } + \new Staff { + \clef bass + \time 2/4 + c2 d e f + } +>> diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly index 3f9ad80c5d..129f6a3ade 100644 --- a/ly/music-functions-init.ly +++ b/ly/music-functions-init.ly @@ -157,7 +157,7 @@ clef = (make-clef-set type)) -compressMusic = +scaleDurations = #(define-music-function (parser location fraction music) (number-pair? ly:music?) (ly:music-compress music (ly:make-moment (car fraction) (cdr fraction)))) diff --git a/python/convertrules.py b/python/convertrules.py index ebf2b5afb9..66c083599d 100644 --- a/python/convertrules.py +++ b/python/convertrules.py @@ -3050,3 +3050,9 @@ def conv (str): return str conversions.append (((2, 11, 46), conv, """\\set hairpinToBarline -> \\override Hairpin #'to-barline""")) + +def conv (str): + str = re.sub (r"compressMusic", r"scaleDurations", str) + return str + +conversions.append (((2, 11, 48), conv, """\\compressMusic -> \\scaleDurations"""))