]> git.donarmstrong.com Git - lilypond.git/commitdiff
(construct-chord): process transposition release/2.1.26
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 22 Feb 2004 23:46:16 +0000 (23:46 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 22 Feb 2004 23:46:16 +0000 (23:46 +0000)
after processing explicit-11.

12 files changed:
ChangeLog
Documentation/topdocs/NEWS.texi
Documentation/user/refman.itely
input/regression/quote.ly
input/test/music-creation.ly
lily/my-lily-lexer.cc
lily/parser.yy
ly/declarations-init.ly
make/lilypond.redhat.spec.in
scm/chord-entry.scm
scm/output-tex.scm
scripts/lilypond-book.py

index f36cba17b4227fb57ab5406a5183e004ac2ff38b..409312b4f4e48b9869c053929e581d144ec50dc5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
+2004-02-23  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * scm/chord-entry.scm (construct-chord): process transposition
+       after processing explicit-11.  
+
 2004-02-22  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/parser.yy (add_quote): add syntax for adding quotes:
+       \addquote "id-string" Music
+
        * scripts/lilypond-book.py (do_file): do not overwrite input file.
 
        * scripts/convert-ly.py (conv): add rules for name changes.
index e795c7b7363cf716f511a2f80da782b82771f71e..32d53d7fbfeff91a20e24980a819ceebe9ba9469 100644 (file)
@@ -18,6 +18,21 @@ Version 2.1.13
 
 @itemize @bullet
 
+@item Cue notes can  now be quoted directly from the parts that
+contain them. For example,
+
+@verbatim
+\addquote oboe \notes\relative c' { fis4 fis fis fis }
+
+\score {
+    \notes \relative c'' {
+       c8 d8 \quote 2 oboe es8 gis  
+    }
+}
+@end verbatim
+
+
+
 @item The naming of exported Scheme functions now follows Scheme conventions.
 Changes be applied to Scheme files with convert-ly:
 
index eae57ba9080c4827ef8aa7050ffe5d3c10725871..10c1061d1e339b7358103bfc3c9c09ee97f6304e 100644 (file)
@@ -4069,6 +4069,7 @@ some common problems in orchestral music.
 * Automatic part combining::    
 * Hiding staves::               
 * Different editions from one source::  
+* Quoting other voices::        
 * Sound output for transposing instruments::  
 @end menu
 
@@ -4467,7 +4468,7 @@ first part (with context called @code{one}) always gets up stems, and
 If you just want the merging parts, and not the textual markings, you
 may set the property @var{soloADue} to false:
 
-@lilypond[verbatim,raggedright,fragment]
+@lilypond[verbatim,raggedright,fragment,relative=1]
    \new Staff <<
     \set Staff.soloADue = ##f
     \partcombine 
@@ -4598,6 +4599,15 @@ of symbols, for example,
 Examples: @inputfileref{input/regression,tag-filter.ly}.
 
 
+@node Quoting other voices
+@subsection Quoting other voices
+
+TODO: document!
+
+
+
+
+
 @node Sound output for transposing instruments
 @subsection Sound output for transposing instruments
 
index 27f5fb676201cd90f472c35fab463c5672cfed42..fb6241af2563369cd8c1f6bb14bcd171008c45d6 100644 (file)
@@ -7,13 +7,11 @@ music may be quoted. "
 }
 \version "2.1.26"
 
-bla = \notes\relative c' { fis4 fis fis fis }
-
-#(add-quotable "bla" bla)
+\addquote bla \notes\relative c' { fis4 fis fis fis }
 
 \score {
     \notes \relative c'' {
-       c8 d8 \quote 2 "bla" es8 gis  
-       }
+       c8 d8 \quote 2 bla es8 gis  
+    }
 }
-    
+
index ce5e3f120e5cfd63628f9dd1d2000abd69d20358..db0204b7e0e0700a53636fc7d27bc1579f02d1ec 100644 (file)
@@ -1,4 +1,5 @@
-\version "1.9.6"  %% or actually: 1.7.1 ...
+\version "2.1.26"
+
 % possible rename to scheme- something.  -gp
 \header { texidoc = "@cindex Scheme Music Creation
 You can create music expressions from Scheme.  The
@@ -7,18 +8,18 @@ mechanism for this is rather clumsy to use, so avoid it if possible. "
 
 #(define (make-note-req p d)
    (let* ((ml (make-music-by-name 'NoteEvent)))
-   (ly:set-mus-property! ml 'duration d)
-   (ly:set-mus-property! ml 'pitch p)
+   (ly:music-set-property! ml 'duration d)
+   (ly:music-set-property! ml 'pitch p)
    ml))
 
 #(define (make-note elts)
    (let* ((ml (make-music-by-name 'EventChord)))
-   (ly:set-mus-property! ml 'elements elts)
+   (ly:music-set-property! ml 'elements elts)
    ml))
 
 #(define (seq-music-list elts)
    (let* ((ml (make-music-by-name 'SequentialMusic)))
-   (ly:set-mus-property! ml 'elements elts)
+   (ly:music-set-property! ml 'elements elts)
    ml))
 
 
index cceb376a6f4b2634e9dff47627ef1b190cd43828..53acda5cdd6d11403eb25fc7027d25556abc2216 100644 (file)
@@ -29,6 +29,7 @@ static Keyword_ent the_key_tab[]={
   {"acciaccatura", ACCIACCATURA},
   {"accepts", ACCEPTS},
   {"addlyrics", ADDLYRICS},
+  {"addquote", ADDQUOTE},
   {"alias", ALIAS},
   {"alternative", ALTERNATIVE},
   {"apply", APPLY},
index c296bef3f9364335d247a098fcb81daf3e425824..1ff6ab489e581f824eb3648dcd82ad7922a95df0 100644 (file)
@@ -237,6 +237,7 @@ yylex (YYSTYPE *s,  void * v)
 
 %token ACCEPTS
 %token ADDLYRICS
+%token ADDQUOTE
 %token NEWADDLYRICS
 %token ALIAS
 %token ALTERNATIVE
@@ -422,6 +423,8 @@ toplevel_expression:
        lilypond_header {
                THIS->input_file_->header_ = $1;
        }
+       | add_quote {
+       }
        | score_block {
                Score * sc = $1;
 
@@ -465,6 +468,7 @@ toplevel_expression:
        }
        ;
 
+
 embedded_scm:
        SCM_T
        | SCM_IDENTIFIER 
@@ -1333,6 +1337,17 @@ chord_body_element:
        }
        ;
 
+add_quote:
+       ADDQUOTE string Music {
+               static SCM adder;
+               if (!adder)
+                       adder = scm_c_eval_string ("add-quotable");
+               
+               scm_call_2 (adder, $2, $3->self_scm ());
+               scm_gc_unprotect_object ($3->self_scm ());
+       }
+       ;
+
 command_element:
        command_req {
                $$ = MY_MAKE_MUSIC("EventChord");
@@ -1363,7 +1378,7 @@ command_element:
                        quote->set_property ("duration", $2);
                        quote->set_property ("quoted-events", evs);
                } else {
-                       THIS->here_input ().warning (_f ("Can\'t find music.")); 
+                       THIS->here_input ().warning (_f ("Can\'t find music")); 
                        quote = MY_MAKE_MUSIC ("Event");
                }
                quote->set_spot (THIS->here_input ());
index 1e2f355132b43b3672a2ee78765ba775a23a5a94..b95af192718632b1f83e2f9f2eb599abfeb38f3d 100644 (file)
@@ -45,7 +45,7 @@ melismaEnd = #(make-span-event 'ManualMelismaEvent STOP)
 
 % Do units first; must be done before any units are specified.
 \paper {
-    unit = "mm"
+    unit = "mm"  %% ugh: coupled to LilyPond C++ code.
     mm = 1.0
     in = 25.4
     pt = #(/  in 72.27)
@@ -130,4 +130,6 @@ partCombineListener = \paper {
 % reset default duration
 unusedEntry = \notes { c4 }
 
-#(define musicQuotes (make-hash-table)) 
+
+% must have size argument for GUILE 1.6 compat.
+#(define musicQuotes (make-hash-table 29)) 
index fbc31225eaa5bc1872d9b78879688f5ca69cd6e7..88421d3fd1a9ee9808f71653490ccf088d5d88b4 100644 (file)
@@ -106,6 +106,10 @@ fi
 
 # chkfontpath --remove=%{_datadir}/share/lilypond/@TOPLEVEL_VERSION@/fonts/type1/
 
+%postun
+if [ -f /usr/share/lilypond/%{version}/ls-R ]; then
+  rm -f /usr/share/lilypond/%{version}/ls-R
+fi
 
 %post documentation
 scrollkeeper-update
index 0c4b8bb03a4ed86c3c94e13f384b20b2201b74f6..bc408de71fc651e02ef84225c508fb437801715c 100644 (file)
@@ -65,7 +65,7 @@ Entry point for the parser.
     
     (define (interpret-additions  chord mods)
       "Interpret additions. TODO: should restrict modifier use?"
-      
+
       (cond
        ((null? mods) chord)
        ((ly:pitch? (car mods))
@@ -168,15 +168,14 @@ the bass specified.
     (if (procedure? lead-mod)
        (set! base-chord (lead-mod base-chord)))
 
-
     (set! complete-chord
          (if start-additions
           (interpret-additions base-chord flat-mods)
           (interpret-removals base-chord flat-mods)
           ))
     
-    (set! complete-chord (map (lambda (x) (ly:pitch-transpose x root))
-                             (sort complete-chord ly:pitch<?)))
+    (set! complete-chord (sort complete-chord ly:pitch<?))
+
 
     ;; If natural 11 + natural 3 is present, but not given explicitly,
     ;; we remove the 11.
@@ -186,16 +185,20 @@ the bass specified.
             (= 0 (ly:pitch-alteration (get-step 11 complete-chord)))
             (= 0 (ly:pitch-alteration (get-step 3 complete-chord)))
             )
-       (begin
-         (set! complete-chord (remove-step 11  complete-chord))
-         )
-         
-       )
+       (set! complete-chord (remove-step 11  complete-chord)) )
+
+
+    ;; must do before processing inversion/bass, since they are
+    ;; not relative to the root. 
+    (set! complete-chord (map (lambda (x) (ly:pitch-transpose x root))
+                             complete-chord))
 
+    
     (if inversion
        (set! complete-chord (process-inversion complete-chord)))
     (if bass
        (set! bass (pitch-octavated-strictly-below bass root)))
+      
     
     (if #f
        (begin
index 4c0b11a08b404805b4bf511e4d0c44ebabae37b2..94f1739dcb007ba3d01a1b4c9ffcb53c7776a027 100644 (file)
        (string-append "\\" (cddr c)))))
 
 (define (top-of-file)
-  (comment
-   (string-append
-    "generated by LilyPond "
-    (lilypond-version) " (http://lilypond.org)." )
-   ))
+  (string-append
+   "% generated by LilyPond "
+    (lilypond-version) " (http://lilypond.org).\n"
+    "\\def\\lilypondtagline{Engraved by LilyPond (version "
+    (lilypond-version)
+    ")}\n"
+    ))
 
 (define (blank)
   "")
index 4877122d1bc4fe67da21225012f7209a964a1e63..f6629870619e19ecfa312efbe1a749ba0bc035d4 100644 (file)
@@ -667,7 +667,6 @@ LATEX_DOCUMENT = r'''
 '''
 #need anything else besides textwidth?
 def get_latex_textwidth (source):
-       print 'hoi\n', source
        m = re.search (r'''(?P<preamble>\\begin\s*{document})''', source)
        preamble = source[:m.start (0)]
        latex_document = LATEX_DOCUMENT % vars ()
@@ -757,7 +756,9 @@ def do_file (input_filename):
                                           + format2ext[format])
 
 
-               if os.path.samefile (output_filename, input_fullname):
+               if (os.path.exists (input_filename) and 
+                   os.path.exists (output_filename) and 
+                   os.path.samefile (output_filename, input_fullname)):
                        ly.error (_("Output would overwrite input file; use --output."))
                        sys.exit (2)
 
@@ -767,7 +768,6 @@ def do_file (input_filename):
 
        ly.progress (_ ("Reading %s...") % input_fullname)
        source = in_handle.read ()
-       print 'hoai', source, in_handle
        ly.progress ('\n')
        
        snippet_types = (