]> git.donarmstrong.com Git - lilypond.git/commitdiff
(conv): \apply -> \applymusic
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 7 May 2004 09:16:10 +0000 (09:16 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 7 May 2004 09:16:10 +0000 (09:16 +0000)
33 files changed:
ChangeLog
Documentation/user/notation.itely
Documentation/user/programming-interface.itely
input/regression/apply-context.ly
input/regression/apply-output.ly
input/regression/balloon.ly
input/regression/cluster-cross-staff.ly
input/regression/cluster.ly
input/regression/generic-output-property.ly
input/regression/music-map.ly
input/regression/repeat-unfold-all.ly
input/regression/repeat-unfold-tremolo.ly
input/regression/tag-filter.ly
input/regression/tuplet-nest.ly
input/screech-boink.ly
input/test/add-staccato.ly
input/test/add-text-script.ly
input/test/ambitus-mixed.ly
input/test/ancient-font.ly
input/test/bar-number-every-five-reset.ly
input/test/move-accidentals.ly
input/test/move-specific-text.ly
input/test/music-box.ly
input/test/polymetric-differing-notes.ly
input/test/reverse-music.ly
input/test/smart-transpose.ly
input/test/unfold-all-repeats.ly
input/wilhelmus.ly
lily/music-function.cc
lily/parser.yy
ly/grace-init.ly
scm/document-functions.scm
scripts/convert-ly.py

index a7b1661307e032656e55c8b38fea90cd86316e9d..59a9a7f8784bcfae1a9573ae12758eec30365fe6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2004-05-07  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * scripts/convert-ly.py (conv): \apply -> \applymusic
+
 2004-05-06  Kristof Bastiaensen  <kristof.bastiaensen@vleeuwen.org>
 
        * elisp/lilypond-mode.el: changed the order of some commands
index 8ac4acb22f3c2ab29988286971e9c0302092e2ec..32bb0ff04392ca3d0bb2f29a53070363f1e696fd 100644 (file)
@@ -4663,8 +4663,8 @@ filtered. For example,
 @example
 \simultaneous @{
   @var{the music}
-  \apply #(remove-tag 'score) @var{the music}
-  \apply #(remove-tag 'part) @var{the music}
+  \applymusic #(remove-tag 'score) @var{the music}
+  \applymusic #(remove-tag 'part) @var{the music}
 @}
 @end example
 would yield
@@ -7369,7 +7369,7 @@ applying the function @code{notes-to-clusters} to a sequence of
 chords, e.g.
 @c
 @lilypond[quote,relative=2,verbatim]
-\apply #notes-to-clusters {  <c e > <b f'>  }
+\applymusic #notes-to-clusters {  <c e > <b f'>  }
 @end lilypond
 
 The following example (from
index e5d06e78538ff12c8261d8d904b020a6f47c2416..8f8ac35cbce2f12f4d91630375875eaf1dc9c03f 100644 (file)
@@ -151,11 +151,11 @@ follows the general form of
 
 Such syntax can also be defined as user code. To do this, it is
 necessary to create a @em{music function}. This is a specially marked
-Scheme function. For example, the music function @code{\apply} applies
+Scheme function. For example, the music function @code{\applymusic} applies
 a user-defined function to a music expression.  Its syntax is
 
 @example
-\apply #@var{func} @var{music}
+\applymusic #@var{func} @var{music}
 @end example
 
 A music function is created with @code{ly:make-music-function},
@@ -164,7 +164,7 @@ A music function is created with @code{ly:make-music-function},
   (ly:make-music-function
 @end example
 
-@code{\apply} takes a Scheme function and a Music expression as
+@code{\applymusic} takes a Scheme function and a Music expression as
 argument. This is encoded in its first argument,
 
 @example
@@ -183,7 +183,7 @@ function
 @end example
 
 The above Scheme code only defines the functionality. The tag
-@code{\apply} is selected by defining
+@code{\applymusic} is selected by defining
 
 @example
   apply = #(ly:make-music-function
@@ -192,17 +192,17 @@ The above Scheme code only defines the functionality. The tag
      (func music)))
 @end example
 
-Examples of the use of @code{\apply} are in the next section.
+Examples of the use of @code{\applymusic} are in the next section.
 
 
 @node Manipulating music expressions
 @appendixsubsec Manipulating music expressions
 
 Music objects and their properties can be accessed and manipulated
-directly, through the @code{\apply} mechanism.
-The syntax for @code{\apply} is
+directly, through the @code{\applymusic} mechanism.
+The syntax for @code{\applymusic} is
 @example
-\apply #@var{func} @var{music}
+\applymusic #@var{func} @var{music}
 @end example
 
 @noindent
@@ -219,7 +219,7 @@ its argument:
      (ly:music-set-property! m 'elements (reverse
        (ly:music-property m 'elements)))
      m)
-  \score { \notes \apply #rev-music-1 { c4 d4 } }
+  \score { \notes \applymusic #rev-music-1 { c4 d4 } }
 @end lilypond
 
 The use of such a function is very limited. The effect of this
@@ -227,13 +227,13 @@ function is void when applied to an argument which is does not have
 multiple children.  The following function application has no effect:
 
 @example
-  \apply #rev-music-1 \grace @{ c4 d4 @}
+  \applymusic #rev-music-1 \grace @{ c4 d4 @}
 @end example
 
 @noindent
 In this case, @code{\grace} is stored as @internalsref{GraceMusic}, which has no
 @code{elements}, only a single @code{element}. Every generally
-applicable function for @code{\apply} must -- like music expressions
+applicable function for @code{\applymusic} must -- like music expressions
 themselves -- be recursive.
 
 The following example is such a recursive function: It first extracts
@@ -273,7 +273,7 @@ above by the internal equivalent of
     \context Voice = "2" @{ \voiceTwo b @} >>
 @end example
 
-Other applications of @code{\apply} are writing out repeats
+Other applications of @code{\applymusic} are writing out repeats
 automatically (@inputfileref{input/test,unfold-all-repeats.ly}),
 saving keystrokes (@inputfileref{input/test,music-box.ly}) and
 exporting
index 50a6807de6c6b00ca08f4103b59895109881721d..9bca0035a89e39e55f853953a38f32a26f48e54d 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.2.0"
+\version "2.3.1"
 
 
 \header {
index 426e64f9f0c56e65edec5c78096c3fde805d6492..853eb29ceff520fe1f6e9dd8120885e6ed7fa489 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.2.0
+\version "2.3.1
 \header {
 
 texidoc = "The @code{\applyoutput} expression is the most flexible way to
index fd71bbc544d845d22b81579ca6d5a61d763f5b6e..63fa72a1a8635f849bc402ddb040bab07d863e8f 100644 (file)
@@ -3,7 +3,7 @@
     texidoc = "With balloon texts, objects in the output can be marked,
 with lines and explanatory text added."
     }
-\version "2.2.0"
+\version "2.3.1"
 
 \score  {
  \notes {
index 9cc7ce6e0e1ae18792bbc40268b64c41bef651b1..ba52e278ae4e1de2b1daee51a5c547bf46b5a64b 100644 (file)
@@ -4,7 +4,7 @@
 
 }
 
-\version "2.2.0"
+\version "2.3.1"
 
 \score {
 \notes    \new PianoStaff <<
@@ -12,7 +12,7 @@
        s1 *2
        }
        \context Staff = down <<
-           \apply #notes-to-clusters \relative c  { <c e>4 <f a> <b e> \change Staff = up <e a>
+           \applymusic #notes-to-clusters \relative c  { <c e>4 <f a> <b e> \change Staff = up <e a>
                                                     <a d> <d g> }
 
            { \clef bass s1 * 2 }
index 70633f4214187b811bd40b9870eaca192398cbc1..aa16d053965532d8cce73ac3c51cd726ad6d972d 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.2.0"
+\version "2.3.1"
 \header {
     texidoc = "Clusters are a device to denote that a complete range of
 notes is to be played."
@@ -13,7 +13,7 @@ fragment =\notes \relative c' {
 \score {
  \notes <<
      \new Staff \fragment
-     \new Staff \apply #notes-to-clusters \fragment
+     \new Staff \applymusic #notes-to-clusters \fragment
      >>
  \paper { raggedright = ##t }
 }
index aac9f00dde4a470222ab52c18cd4563f3b844052..7a8bafbe8e0ba91c649657ecef60039c70a0e8da 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.2.0"
+\version "2.3.1"
 
 \header{
 texidoc="
index 67c5d7852ee58855ce522d8848f0f08a7321e6c7..6246f42dc6728b9ba4cd5bca6171d7da8e3ceebc 100644 (file)
@@ -10,7 +10,7 @@ dynamics are left over. These are put onto the 2nd measure."
 
 }
 
-\version "2.2.0"
+\version "2.3.1"
 
 #(define (notes-to-skip m)
 "Convert all stuff with duration (notes, lyrics, bass figures, etc.) to skips.
@@ -35,7 +35,7 @@ foobar = \notes \transpose c c' { c4\>-^ c4-^ c4\!-^ c4-^  }
   \notes \relative c''  \context Voice {
        \foobar
 
-       << \apply #(lambda (x) (music-map notes-to-skip x))
+       << \applymusic #(lambda (x) (music-map notes-to-skip x))
                \foobar
           { d2 d2 } >> 
 }}
index db3fc7de036d0a480337213b73edc7e21a1f3c3a..07d34f1c87ed78f490b4bcc7c487c9dc5381b95d 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.2.0"
+\version "2.3.1"
 
 \header { texidoc = "Volta repeats may be unfolded through the Scheme
     function @code{unfold-repeats}."
@@ -13,7 +13,7 @@ nots = \notes\relative c'   {
     \notes \context Voice {
        \nots
        \bar "||"
-       \apply #unfold-repeats \nots
+       \applymusic #unfold-repeats \nots
     }
     \paper {raggedright = ##t} 
 }
index ba1bde2268f7758f248b4330732dc5f987cedfca..350fa9e975e3fdcf77b13dfc0f958e18e2526cd9 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.2.0"
+\version "2.3.1"
 \header {
 
     texidoc = "Unfolding tremolo repeats. All fragments fill one
 \score{
     \notes{
        \time 2/4 
-       \apply #unfold-repeats  
+       \applymusic #unfold-repeats     
        { \repeat tremolo 4 { c'16 e' } |
          \repeat tremolo 8 c'16 } |
 
        \time 3/4 
-       \apply #unfold-repeats  
+       \applymusic #unfold-repeats     
        { \repeat tremolo 6 { c'16 e' } |
          \repeat tremolo 12 c'16 } | \bar "|."
        
index 4f3ff5dcbc3d66704f8688e1164c1f148b890104..593c89b2aa5b8181aaec88dab8e97001a67aefe4 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.2.0"
+\version "2.3.1"
 \header {
 
 texidoc = "The @code{\\tag} command marks music expressions with a
@@ -38,11 +38,11 @@ common =
        }
     \new Staff {
        \set Staff.instrument = #"part"
-       \apply #(remove-tag 'score) \common
+       \applymusic #(remove-tag 'score) \common
        }
     \new Staff {
        \set Staff.instrument = #"score"
-       \apply #(remove-tag 'part) \common
+       \applymusic #(remove-tag 'part) \common
        }
     }
 }
index 73facf8d3d984510cf862d892285797700ae082d..216ca7892f7101bb8bea0c01f8098d4227c7b2cb 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.2.0"
+\version "2.3.1"
 \header {
   texidoc="By a manual hack for nested tuplets, an outer tuplet can be moved up."
 }
index 31cbad7b7f3b3173d1d74e5ac9cf4426ee39eccc..3e7d3330a2e9c19fd69e3ece47ff5397c0504b9a 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.2.0"
+\version "2.3.1"
 \header {
     title = "Screech and boink"
     subtitle = "Random complex notation"
@@ -40,7 +40,7 @@
            \override Beam  #'thickness = #0.3
            \override Stem  #'thickness = #4.0
            g'16[ b16 fis16 g16]
-           << \apply #notes-to-clusters { 
+           << \applymusic #notes-to-clusters { 
                as16 <as b>
                <g b>
                <g cis>
index 7a0975085b560fd2a9bf95118cc2a4a6463823ac..fa6498658de0218bb813eaff4faee10f960bf287 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.2.0"
+\version "2.3.1"
 
 \header {
 
@@ -27,7 +27,7 @@ it is not necessary to use scm constructs (see @code{separate-staccato.ly}).
 
 \score {
   \notes\relative c'' {
-    a b \apply #(lambda (x) (music-map add-staccato x)) { c c } 
+    a b \applymusic #(lambda (x) (music-map add-staccato x)) { c c } 
   }
   \paper{ raggedright = ##t }
 }
index 2c6ead7bd92276ba1d17bcab853542495523ff21..c9d32e4da2ffaee0cb7b4be4ced4574e1ad2c7f4 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.2.0"
+\version "2.3.1"
 
 \header {
 texidoc= "@cindex make-music Fingering
@@ -28,7 +28,7 @@ create, then write a function that will structure the music for you.
    m)
 
 \score {
-  \apply #(lambda (x)  (add-text-script x "6") (display-music x) x ) \notes { c'4-3 }
+  \applymusic #(lambda (x)  (add-text-script x "6") (display-music x) x ) \notes { c'4-3 }
        \paper{ raggedright = ##t }
 }
 
index d166dacf6c2622dcee8ff3b778726ce9e957ef6c..5b1533c5d53b6063c55f29e85ce49df2ea16cdb6 100644 (file)
@@ -13,7 +13,7 @@ in the same score (not demonstrated in this file).
 "
 }
 
-\version "2.2.0"
+\version "2.3.1"
 
 #(define (kill-ambitus grob grob-context apply-context)
   (if (memq 'ambitus-interface (ly:grob-property grob 'interfaces))
index 354585fa2a52eec6fdb13246bda8a2b8bd12c89f..71bc283ee20cefd7ebcf12a88d11846a151e50d9 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.2.0"
+\version "2.3.1"
 % TODO: split ancient-font into seperate files; possibly in
 % different locations.
 \header {
index 2208f7d6e685c059dbab85c6912cd8cba590984e..571acee991bb5434111bd92071f9117c7397ae03 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.2.0"
+\version "2.3.1"
 
 \header {
     texidoc = "@cindex Bar Number Every Fifth Reset
index f3ee83c53128af59ffc6252f48ac222c444c9c2e..12ab42a909a59024102821f3dce5306766cace57 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.2.0"
+\version "2.3.1"
 
 % possible rename to scheme- or something like that.  -gp
 \header { texidoc= "@cindex Scheme Manual Accidentals
index a66a019e5c663ae7fa9f96cfde598ba8b3da646e..37aa14827f6d5291c6f79ca641f3986fa5d51c85 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.2.0"
+\version "2.3.1"
 % possible rename to scheme- or something like that.  -gp
 \header { texidoc = "@cindex Scheme Move Text
 Objects, like text, can be moved around by using some Scheme code.
index 7bcfcd1ff430af296e8aab747b898502c673341e..91182ee3c58f7c7b99ea80a73e965ff1e0d605a4 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.2.0"
+\version "2.3.1"
 \include "deutsch.ly"
 % possible rename to scheme- something.  -gp
 % TODO: ask if it needs to have so many empty bars in the middle.  -gp
@@ -62,7 +62,7 @@ using Scheme functions to avoid typing work. " }
 
 
 
-\version "2.2.0"
+\version "2.3.1"
 
 pat = \notes \transpose c c' \repeat unfold 2 {
   << { \context Staff=up {r8 e16 f g e f g } }
@@ -84,7 +84,7 @@ endc = \notes {\stemDown \tieDown c,,2~c,, c,,~c,, c,,1_\fermata }
   \notes \transpose c c' \context PianoStaff <<
     \context Staff=up   { \clef "G"  }
     \context Staff=down { \clef "F" }
-    { \apply #transform {\pat {c e g c' e' }
+    { \applymusic #transform {\pat {c e g c' e' }
                          \pat {c d a d' f' }
                         \pat {h, d g d' f' }
                         \pat {c e g c' e' }
index cb0f97ecdc5dd3434f52f4395b09fb92639c1cfb..0e8d843da86428228217f8afc0b0bfce5ea09360 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.2.0"
+\version "2.3.1"
 
 \header{ texidoc="
 
@@ -37,14 +37,14 @@ multiplied by 3/5, so that 3/5 * 10/8 = 3/4.
        \new Staff {
            \time 3/4
            \set Staff.timeSignatureFraction = #'(9 . 8)
-           \apply #(scale-music-function '(2 . 3))
+           \applymusic #(scale-music-function '(2 . 3))
              \repeat unfold 6 { c8[ c c] }
        }
        
        \new Staff {
            \time 3/4
            \set Staff.timeSignatureFraction = #'(10 . 8)
-           \apply #(scale-music-function '(3 . 5))
+           \applymusic #(scale-music-function '(3 . 5))
              { \repeat unfold 2 { c8[ c c] }
                \repeat unfold 2 { c8[  c] }
                |  c4. c4. \times 2/3 { c8 c c } c4  }
index 390fa7f8c24c322df201ff321807bb872295ed64..7dbfcaafd902fd2363f55525e7a9a97c3c7e74ef 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.2.0"
+\version "2.3.1"
 % possible rename to scheme-something.
 \header { texidoc="@cindex Scheme Reverse Music
 Symmetric, or palindromical music can be produced, first, by printing
@@ -33,7 +33,7 @@ music = \notes \relative c'' { c4 d4( e4 f4 }
 \score {
   \context Voice {
     \music
-    \apply #reverse-music \music
+    \applymusic #reverse-music \music
   }
   \paper { raggedright = ##t}
 }
index d8fdd1edaf67f0fd7443c05311444ad6b5ecf60d..3894820e815dd3d53763c99ad0c210bfe2b77239 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.2.0"
+\version "2.3.1"
 
 \header {
 texidoc="@cindex Smart Transpose
@@ -69,9 +69,9 @@ music = \notes \relative c' { c4 d  e f g a b  c }
 \score {
   \notes \context Staff {
     \transpose c ais \music
-    \apply #naturalise \transpose c ais \music
+    \applymusic #naturalise \transpose c ais \music
     \transpose c deses \music
-    \apply #naturalise \transpose c deses \music
+    \applymusic #naturalise \transpose c deses \music
   }
   \paper { raggedright = ##t}
 }
index ea1f233ff45ff5de6ac3366a315b687e1c0c765d..b5af649865a4ad8480e13c17416001623324479c 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.2.0"
+\version "2.3.1"
 % regression.  -gp
 
 \header { 
@@ -20,7 +20,7 @@ mel = \notes \context Staff {
 
 \score { \notes {
   \mel \break
-  \apply #unfold-repeats \mel 
+  \applymusic #unfold-repeats \mel 
  }
 }
 
index deee4d79d1d7b84c8e194ef289f64bdf0585a6f0..13da16aaad930d847c7b9f7b21cf4fe34cc9af28 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.3.0"
+\version "2.3.1"
 
 \header {
   texidoc = "Wilhelmus van Nassouwe"
index 11cda8255c495b6f8d159a559987a5212df6e00f..ed7e3fa4e6ecf2cf72cdfe8edc696d31fbf7f6a8 100644 (file)
@@ -18,7 +18,7 @@ print_music_function (SCM b, SCM port, scm_print_state *)
 {
   SCM value = SCM_CELL_OBJECT_1 (b);
 
-  scm_puts ("#<packaged object ", port);
+  scm_puts ("#<Music function ", port);
   scm_write (value, port);
   scm_puts (">", port);
 
@@ -78,4 +78,5 @@ init_music_function (void)
   scm_set_smob_mark (music_function_tag, scm_markcdr);
   scm_set_smob_print (music_function_tag, print_music_function);
 }
+
 ADD_SCM_INIT_FUNC (music_function_tag, init_music_function); 
index f8efe45b33006c255a4fe7138038aaf7b756832a..261aa720f712af381521faecff4f4cf8ee991d7a 100644 (file)
@@ -993,7 +993,7 @@ Generic_prefix_music:
                SCM func = ly_car ($1);
                Input *loc = unsmob_input (ly_cadr ($1));
                SCM args = ly_cddr ($1);
-               SCM sig = scm_object_property (func, ly_symbol2scm ("music-head-signature"));
+               SCM sig = scm_object_property (func, ly_symbol2scm ("music-function-signature"));
                int k = 0;
                bool ok  = true; 
                for (SCM s = sig, t = args;
@@ -1015,9 +1015,10 @@ Generic_prefix_music:
                        $$ = unsmob_music (m);
                        scm_gc_protect_object (m);
                        }
-               else
+               else 
                        {
-                       loc->error (_ ("Music head function should return Music object.")); 
+                       if (ok)
+                               loc->error (_ ("Music head function should return Music object.")); 
                        $$ = MY_MAKE_MUSIC ("Music");
                        }
                $$->set_spot (*loc);
index cdd041dca5d9971076e11cbf21578b1edc9ef78d..8cd9b0392d0d0135eeb0c99c7c4660c80f8fbe12 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.2.0"
+\version "2.3.1"
 
 
 startGraceMusic = \notes {
index 8924af01c62ee755e4fa5f38853956a01088161a..3bce48caf6750dd7a4686cedc93a1302eba6a5f6 100644 (file)
 (define all-scheme-functions
    (hash-fold
     (lambda (key val prior)
-      (cons (cons key val)  prior)
-      )
+      (cons (cons key val)  prior))
     '() (ly:get-all-function-documentation)))
 
 (define (all-scheme-functions-doc)
   (let*
-      (
-
-       (fdocs (map (lambda (x)
+      ((fdocs (map (lambda (x)
                (document-scheme-function (car x) (cadr x) (cddr x))
                )
              all-scheme-functions)
         )
        (sfdocs (sort fdocs string<?))
+       
        )
 
-
     (make <texi-node>
       #:name "Scheme functions"
       #:desc "Primitive functions exported by LilyPond"
       #:text
-      (apply string-append sfdocs)
-       ) 
+      (apply string-append sfdocs)) 
   ))
 
 
index a3e247c77dc442bdc69871ab78d5753102f30e5e..cc9bb0cd739f5c119759b9372245e71c86e56eff 100644 (file)
@@ -2082,6 +2082,12 @@ def conv (str):
 conversions.append (((2,2, 0), conv,
                     '''clean up version. '''))
 
+def conv (str):
+       return re.sub (r'\\apply\b', r'\\applymusic', str)
+
+conversions.append (((2, 3, 1), conv,
+                    '''\\apply -> \\applymusic'''))
+
 ################################
 #      END OF CONVERSIONS      
 ################################