+2004-05-27 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * lily/music-output-def.cc (Music_output_def): remove separate
+ translator table. Lookup translators in scope directly. This
+ obviates Context suffix for context identifiers, i.e.
+
+ \context {
+ \Staff
+ ..
+ }
+
+
+ will work.
+
+
+ * Documentation/user/notation.itely (Chords mode): typo: 13 -> 3.
+
+ * Documentation/user/changing-defaults.itely (Horizontal spacing):
+ document spacing override hack.
+
2004-05-27 Jan Nieuwenhuizen <janneke@gnu.org>
* scm/output-gnome.scm: Add C-q, C-w keybindings. Update
2004-05-26 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * VERSION: 2.3.2 released
+
* lily/parser.yy (book_body): set default bookpaper.
* scm/output-tex.scm (header): kludge: hard code linewidth.
@itemize @bullet
+@item Context definitions are now stored in identifiers that match the
+context name, in other words, to modify a @code{Staff} context, the
+following code may be used.
+
+@example
+ \context @{
+ \Staff
+ ..
+ @}
+@end example
+
@item A new block, @code{\bookpaper} has been introduced to
hold settings for paper size and output scaling.
The default value is one octave below middle C.
@c update-me? formal definition of newaddlyrics, once it works
-@item Combining lyrics with music can be @code{\newlyrics}
+@item Combining lyrics with music can be done with @code{\newlyrics}
@example
-<<
\relative @{
\clef bass
d2 d c4 bes a2 \break
\newlyrics @{
Not much can go wrong!
@}
->>
@end example
Syntactically, @code{\newlyrics} acts like an infix operator.
\paper @{
@dots{}
\context @{
- \StaffContext
+ \Staff
\set fontSize = #-2
\override Stem #'thickness
Here
@example
- \StaffContext
+ \Staff
@end example
@noindent
takes the existing definition @context{Staff} from the identifier
-@code{StaffContext}. This works analogously to other contexts, so that
-the existing definition of @code{Voice} is in @code{\VoiceContext}.
+@code{Staff}. This works analogously to other contexts.
The statements
@example
\override Stem #'transparent = ##t
\alias Voice
}
- \context { \StaffContext
+ \context { \Staff
\accepts "ImproVoice"
}}
\score { \notes \relative c'' {
score, the part containing the longer durations will be spaced too
widely.
-There is no convenient mechanism to manually override spacing.
+There is no convenient mechanism to manually override spacing. The
+following work-around may be used to insert extra space into a score.
+@example
+ \once \override Score.SeparationItem #'padding = #1
+@end example
+No work-around exists for decreasing the amount of space.
@menu
ignored. Sometimes, they come in such big quantities that they obscure
other output. In this case, file a bug-report.
+@item Aborted (core dumped)
+This signals a serious programming error that caused the program to
+crash. Such errors are considered critical. If you stumble on one,
+send a bugreport.
+
+
@end table
@cindex errors, message format
@cindex @code{m}
Since an unaltered 11 does not sound good when combined with an
-unaltered 13, the 11 is removed in this case (unless it is added
+unaltered 3, the 11 is removed in this case (unless it is added
explicitly)
@c
@lilypond[quote,fragment,verbatim]
-\version "2.3.1"
+\version "2.3.2"
% TODO: split ancient-font into seperate files; possibly in
% different locations.
\header {
linethickness = #(/ staffspace 5.0)
indent = 0.0
\context {
- \ScoreContext
+ \Score
\accepts MensuralStaff
\accepts GregorianStaff
% timing = ##f %%%%%%%% FIXME: this has no effect
}
\context {
- \VoiceContext
+ \Voice
\name MensuralVoice
\alias Voice
\remove Ligature_bracket_engraver
autoBeaming = ##f
}
\context {
- \VoiceContext
+ \Voice
\name GregorianVoice
\alias Voice
\remove Ligature_bracket_engraver
autoBeaming = ##f
}
\context {
- \StaffContext
+ \Staff
\name MensuralStaff
\alias Staff
\accepts MensuralVoice
clefOctavation = #0
}
\context {
- \StaffContext
+ \Staff
\name GregorianStaff
\alias Staff
\accepts GregorianVoice
#include "duration.hh"
#include "context.hh"
-/*
- TODO: documentme.
- */
class Auto_beam_engraver : public Engraver
{
TRANSLATOR_DECLARATIONS (Auto_beam_engraver);
class Music_output_def
{
public:
- Scheme_hash_table * translator_tab_;
Input input_origin_;
- Array<String> targets_;
SCM scope_;
- virtual void derived_mark ();
+ void assign_context_def (SCM transdef);
+ SCM find_context_def (SCM name) const;
+
Music_output_def (Music_output_def const&);
Music_output_def ();
VIRTUAL_COPY_CONSTRUCTOR (Music_output_def, Music_output_def);
Context *get_group_translator (String type) const;
- void assign_context_def (SCM transdef);
- SCM find_context_def (SCM name) const;
String outname_string () ;
SCM c_variable (String id) const;
SCM lookup_variable (SCM sym) const;
void set_variable (SCM, SCM sym);
- // fixme: dependencies
- // virtual void add_target_file (String);
-
DECLARE_SMOBS (Music_output_def,);
};
Paper_def ();
Paper_def (Paper_def const&);
virtual ~Paper_def ();
- virtual void derived_mark ();
Paper_outputter* get_paper_outputter (String) const;
SCM font_descriptions () const;
Music_output_def::Music_output_def ()
{
- translator_tab_ = new Scheme_hash_table;
scope_ = SCM_EOL;
smobify_self ();
- scm_gc_unprotect_object (translator_tab_->self_scm ());
scope_ = ly_make_anonymous_module (false);
}
Music_output_def::Music_output_def (Music_output_def const &s)
{
scope_ = SCM_EOL;
- translator_tab_ = 0;
smobify_self ();
- translator_tab_ = new Scheme_hash_table (*s.translator_tab_);
- scm_gc_unprotect_object (translator_tab_->self_scm ());
-
scope_= ly_make_anonymous_module (false);
if (is_module (s.scope_))
ly_import_module (scope_, s.scope_);
Music_output_def::mark_smob (SCM m)
{
Music_output_def * mo = (Music_output_def*) SCM_CELL_WORD_1 (m);
- if (mo->translator_tab_)
- scm_gc_mark (mo->translator_tab_->self_scm ());
-
- mo->derived_mark ();
-
return mo->scope_;
}
-void
-Music_output_def::derived_mark ()
-{
-
-}
-
void
Music_output_def::assign_context_def (SCM transdef)
{
Context_def *tp = unsmob_context_def (transdef);
assert (tp);
- translator_tab_->set (tp->get_context_name (), transdef);
+ if (tp)
+ {
+ SCM sym = tp->get_context_name ();
+ scm_module_define (scope_, sym, transdef);
+ }
String nm = ly_symbol2string (tp->get_context_name ()) + "Context";
-
-
scm_module_define (scope_, ly_symbol2scm (nm.to_str0 ()), transdef);
}
SCM
Music_output_def::find_context_def (SCM name) const
{
- SCM val =SCM_EOL;
- translator_tab_->try_retrieve (name, &val);
- return val;
+ SCM var = ly_module_lookup (scope_, name);
+
+ if (var != SCM_BOOL_F)
+ {
+ var = scm_variable_ref (var);
+ Context_def *cd = (unsmob_context_def (var));
+ return cd ? cd->self_scm () : SCM_EOL;
+ }
+ else
+ return SCM_EOL;
}
int
"Return the description of translators in @var{output-def}.")
{
Music_output_def *id = unsmob_music_output_def (output_def);
- SCM al = id->translator_tab_->to_alist ();
+
+ SCM al =ly_module_to_alist (id->scope_);
+
SCM l = SCM_EOL;
for (SCM s = al ; ly_c_pair_p (s); s = ly_cdr (s))
{
Context_def * td = unsmob_context_def (ly_cdar (s));
- l = scm_cons (scm_cons (ly_caar (s), td->to_alist ()), l);
+ SCM key = ly_caar (s);
+ if (td && key == td->get_context_name ())
+ {
+
+ l = scm_cons (scm_cons (key, td->to_alist ()), l);
+ }
}
return l;
}
{
}
-void
-Paper_def::derived_mark ()
-{
- if (bookpaper_)
- scm_gc_mark (bookpaper_->self_scm ());
-}
-
Real
Paper_def::get_dimension (SCM s) const
{
ordered_rests[d].sort (Note_column::shift_compare);
} while (flip (&d) != LEFT);
- if (ordered_rests[UP].size () < 1
- || ordered_rests[DOWN].size () < 1)
- return SCM_UNSPECIFIED;
+ do {
+ if (ordered_rests[d].size () < 1)
+ {
+ if (ordered_rests[-d].size() > 1)
+ ordered_rests[-d][0]->warning (_("Too many colliding rests."));
+
+ return SCM_UNSPECIFIED;
+ }
+ } while (flip (&d) != LEFT);
Grob *common = common_refpoint_of_array (ordered_rests[DOWN], me, Y_AXIS);
common = common_refpoint_of_array (ordered_rests[UP], common, Y_AXIS);
ADD_INTERFACE (Rest_collision,"rest-collision-interface",
- "Move around ordinary rests (not multi-measure-rests) to avoid "
-"conflicts.",
- "minimum-distance positioning-done elements");
+ "Move around ordinary rests (not multi-measure-rests) to avoid "
+ "conflicts.",
+ "minimum-distance positioning-done elements");
Interval x (extent (this, X_AXIS));
Interval y (extent (this, Y_AXIS));
Paper_line *pl = new Paper_line (Offset (x.length (), y.length ()),
- stencils, penalty);
+ stencils, (bool) penalty); // FIXME.
return scm_gc_unprotect_object (pl->self_scm ());
}
))
;; Second level, part of Context description
-
(define name->engraver-table (make-vector 61 '()))
(map
(lambda (x)
;;; Library functions
+
(if (defined? 'set-debug-cell-accesses!)
(set-debug-cell-accesses! #f))
(let ((props (page-properties paper)))
(interpret-markup paper props
- (markup #:fill-line ("" (number->string page-number))))))
+ (markup #:fill-line ("" (number->string page-number))))))
(define TAGLINE
conversions.append (((2, 3, 1), conv,
'''\\apply -> \\applymusic'''))
+def conv (str):
+ def func(m):
+ if m.group(1) not in ['RemoveEmptyStaff',
+ ]:
+ return '\\' + m.group (1)
+ else:
+ return m.group (0)
+
+ return re.sub (r'\\([a-zA-Z]+)Context\b', func, str)
+
+conversions.append (((2, 3, 2), conv,
+ '''\\FooContext -> \\Foo'''))
+
################################
# END OF CONVERSIONS
################################