+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 ("_")
@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,
}
@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
\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
+
}
-}
DECLARE_SCHEME_CALLBACK (constructor, ());
+ bool accept_music_type (Music*) const;
protected:
virtual void derived_mark ();
virtual void construct_children ();
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 ()
{
return ly_c_vector_p (event_vector_) && (event_idx_ <= end_idx_);
}
-
Moment
Quote_iterator::pending_moment () const
{
return *unsmob_moment (ly_caar (entry)) - start_moment_;
}
-
void
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)
{
if (!b)
mus->origin ()->warning (_f ("In quotation: junking event %s", mus->name ()));
}
- else
- programming_error ("need music in quote.");
}
}
event_idx_ ++;
(Voice Accidental font-size -4)
(Voice Slur direction -1)
)
-
+
+ quotedEventTypes = #'(note-event rest-event)
}
EasyNotation = \context { % TODO: why \context override?
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.")