]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/define-context-properties.scm
authorhanwen <hanwen>
Fri, 10 Sep 2004 10:37:13 +0000 (10:37 +0000)
committerhanwen <hanwen>
Fri, 10 Sep 2004 10:37:13 +0000 (10:37 +0000)
(all-internal-translation-properties): add property. Remove
definition of quotes property.

* Documentation/user/notation.itely (Quoting other voices):
document it

* lily/quote-iterator.cc (moment_less): add quotedEventTypes
property, to determine what events are processed in \quote.

ChangeLog
Documentation/topdocs/NEWS.texi
Documentation/user/notation.itely
input/regression/quote.ly
lily/quote-iterator.cc
ly/engraver-init.ly
scm/define-context-properties.scm

index 1d31b7fa2eb53aacf840c31e20f92c854b83b88f..32a74f7868e26b705ec6e19f6171b0483d4ad256 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2004-09-10  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * scm/define-context-properties.scm
+       (all-internal-translation-properties): add property. Remove
+       definition of quotes property.
+
+
+       * Documentation/user/notation.itely (Quoting other voices):
+       document it
+
+       * lily/quote-iterator.cc (moment_less): add quotedEventTypes
+       property, to determine what events are processed in \quote.
+
 2004-09-10  Juergen Reuter  <reuter@ipd.uka.de>
 
        * (many files): removed most occurrences of underscore ("_")
index 794a86b1de94e233060218aee8c5b22dd74a467d..c18aea855b266ea0a0d30a23ed67debcaa1b5715 100644 (file)
@@ -7,9 +7,14 @@
 @unnumbered New features in 2.3 since 2.2
 
 @itemize @bullet
+
+@item The types of events quoted with @code{\quote}  can  now be tuned
+with @code{quotedEventTypes}. By default, only notes and rests end up
+in quotes.
+
 @item  LilyPond will try to keep
 staves at the same distances across a page, but it will stretch
-distances to prevent collisions. This results in a more orderly
+distances to prevent collisions. This results in a more even
 appearance of the page.
 
 @item Key signature cancellations are now printed before the bar line,
index 81a78ea4fda519acfe7763ecfbf399099359b5f5..d014f92b0cd1288a2977094a9d559e948f5abb67 100644 (file)
@@ -5463,6 +5463,19 @@ instruments, if they are specified using the @code{\transposition} command.
 }
 @end lilypond
 
+The type of events that are present in cue notes can be trimmed with
+the @code{quotedEventTypes} property. The default value is
+@code{(note-event rest-event)}, which means that only notes of and
+rests of the cued voice end up in the @code{\quote}.
+Setting
+
+@example
+  \set Staff.quotedEventTypes = #'(note-event articulation-event dynamic-event)  
+@end example
+
+@noindent
+will quote notes (but no rests), together with scripts and dynamics.
 @refbugs
 
 Only the contents of the first @internalsref{Voice} occurring in an
index 12c1e0cba54912da3b770c6600d22c8bd2cb89fc..ca222ee135997a13cccf7fb9ff3f4cf9970a9a16 100644 (file)
@@ -1,20 +1,31 @@
 \header
 {
 
-    texidoc = "With @code{\quote}, fragments of previously entered
-music may be quoted. " 
+    texidoc = "With @code{\\quote}, fragments of previously entered
+music may be quoted. @code{quotedEventTypes} will determines what
+things are quoted. In this example, a 16th rests is not quoted, since
+@code{rest-event} is not in @code{quotedEventTypes}."
 
 }
 \version "2.3.4"
 \paper {
     raggedright = ##t
 }
+
 \addquote bla \relative c' {
-    fis4 g a b }
+    fis4 r16  a8.-> b-\ff }
+
+\relative c'' {
 
-\score {
-     \relative c'' {
-       c8 d8 \quote bla 2 es8 gis  
+    \set Staff.quotedEventTypes = #'(note-event articulation-event)
+    c8 d8  <<
+       s2 
+       \new Voice {
+           \set fontSize = #-2
+           \quote bla 2
+
+       } >>
+    es8 gis
+       
     }
-}
 
index 307b860dc9674b504d4b9725bab4ee061b5bf39b..8b101eb6e878b7288e65c4086cc82dfb6763c577 100644 (file)
@@ -31,6 +31,7 @@ public:
   
   DECLARE_SCHEME_CALLBACK (constructor, ()); 
 
+  bool accept_music_type (Music*) const;
 protected:
   virtual void derived_mark ();
   virtual void construct_children ();
@@ -39,6 +40,21 @@ protected:
   virtual bool ok () const;
 };
 
+bool
+Quote_iterator::accept_music_type (Music *mus) const
+{
+  SCM accept = get_outlet()->get_property ("quotedEventTypes");
+  for (SCM s =  mus->get_property ("types");
+       ly_c_pair_p (s);  s = ly_cdr (s))
+    {
+      if (scm_memq (ly_car (s), accept) != SCM_BOOL_F)
+       return true;
+    }
+
+  return false;
+}
+
+
 void
 Quote_iterator::derived_mark ()
 {
@@ -116,7 +132,6 @@ Quote_iterator::ok () const
   return ly_c_vector_p (event_vector_) && (event_idx_ <= end_idx_);
 }
 
-
 Moment
 Quote_iterator::pending_moment () const
 {
@@ -124,7 +139,6 @@ Quote_iterator::pending_moment () const
   return *unsmob_moment (ly_caar (entry)) - start_moment_;
 }
 
-
 void
 Quote_iterator::process (Moment m)
 {
@@ -155,9 +169,10 @@ Quote_iterator::process (Moment m)
        {
          SCM ev_acc = ly_car (s);
 
-
          Music * mus = unsmob_music (ly_car (ev_acc));
-         if (mus)
+         if (!mus)
+           programming_error ("need music in quote.");
+         else if (accept_music_type (mus))
            {
              if (quote_pitch || me_pitch)
                {
@@ -182,8 +197,6 @@ Quote_iterator::process (Moment m)
              if (!b)
                mus->origin ()->warning (_f ("In quotation: junking event %s", mus->name ()));
            }
-         else
-           programming_error ("need music in quote.");
        }
     }
   event_idx_ ++; 
index 8305a01c3bc73f8289334af3028dfcafb2675958..6169b829382572e6fa1a4ba16945e0457240a5a1 100644 (file)
@@ -556,7 +556,8 @@ AncientRemoveEmptyStaffContext = \context {
        (Voice Accidental font-size -4)
        (Voice Slur direction -1)
     )
-    
+
+  quotedEventTypes = #'(note-event rest-event)
 }
 
 EasyNotation = \context {      % TODO: why \context override? 
index f8e1c0b47928e96e88de1296b520697cc8e05c68..3606f842267581782bddc97548395aea07512a7c 100644 (file)
@@ -480,7 +480,10 @@ signature change.")
 Script_engraver for typesetting note-super/subscripts. See
 @file{scm/script.scm} for more information
 ")
-     (quotes ,hash-table? "Hash table, mapping names to music-event vectors.")
+     (quotedEventTypes ,list? "List of symbols, representing the
+event types that should be duplicated for @code{\\quote} commands.")
+
+;     (quotes ,hash-table? "Hash table, mapping names to music-event vectors.")
      (stavesFound ,grob-list? "list of all staff-symbols found.")
      (instrumentSupport ,grob-list? "list of grobs to attach instrument name
 to.")