+
+1.3.83
+======
+
+* small doc updates.
+
+* Cleanups related to barline handling:
+
+ - Removed Translator_group::get_simple_translator (), and -
+
+ - use properties to communicate about barlines and time sigs. (NOTE:
+ by default a time-signature of 4/4 is printed.)
+
+ - fix repeat bar behavior.
+
+
+* cleaned up Directional_element_interface
+
+* add name field to score-elements.
+
+* comment in some unprotects for Music in parser. Should bring down
+ cpu time and plug some leaks.
+
+* robustness fixes for etf2ly, tuplets, grace notes.
+
1.3.82
======
title = {how to read and write tab: a guide to tab notation},
author = {Howard Wright},
email={Howard.Wright@ed.ac.uk},
- HTML={http://wabakimi.carleton.ca/~phacket2/guitar/tabfaq.html},
+ HTML={http://www.guitartabs.cc/tabfaq.shtml}
+% HTML={http://wabakimi.carleton.ca/~phacket2/guitar/tabfaq.html},
}
@node Miscellaneous, ,,top
@section Miscellaneous
+[FIXME: rewrite FAQ, include general questions]
+
@subsubsection HELP! I'm stuck!
Please read this document carefully. If you are still at loss, send
Yes, see the @file{twinkle-pop} example.
-@subsubsection Do you support guitar chord diagrams?
+@subsubsection Do you support guitar fret diagrams?
No. We ourselves don't play guitar, and don't know the fine points of
this notation. We would welcome anyone who could give this a try.
No. The same as for the previous question goes.
-
@subsubsection Do you support multiple staff-sizes?
Yes. At this time you can choose between 11, 13, 16, 19, 20, 23 and 20
@end example
-@subsubsection How do I put more than one marking on a note.
+@subsubsection How do I put more than one marking on a note?
You can stack them
@example
@end example
-@subsubsection How do I combine multiple pieces into one document
+@subsubsection How do I combine multiple pieces into one document?
There are several solutions:
There are several examples in the @file{mutopia} directory.
-@subsubsection How do I get bar numbers?
-
-See @file{input/test/bar-scripts.ly}.
-
@subsubsection How do I change the tagline 'Lily was here'?
In the @code{\header} field, add a @code{tagline} entry, e.g.
@subsubsection Is there a GUI frontend? Should I start building one?
-LilyPond currently has no graphical interface. We (LilyPond authors)
-don't feel the need to write a GUI, but several others do:
-
-Matthew Hiller has extended Midiscore and Koobase to handle mudela.
-Check out @uref{http://zoo.cs.yale.edu/~meh25/}. He is now working on
-`Denemo', a GTK based notation program (which is still being developed).
-
-Federico Mena-Quintero and Elliot Lee of RedHat Advanced Development
-labs have plans to write a GNOME based Music notation program. However,
-there is no code, only plans.
+Matthew Hiller has extended Midiscore and Koobase to handle mudela, He
+is now working on @uref{http://denemo.sourceforge.net/,Denemo}, a GTK
+based notation program. This is the most advanced LilyPond front-end
+currently available.
Chris Cannam is working a rewrite of Rosegarden. The new design should
be more modular, and could conceivably be used to output
mudela. However, the not much seems to have happened the past year. See
@uref{http://www.all-day-breakfast.com/rosegarden/development.html}.
-
@subsubsection I want to implement XXXX! How should I do this?
Your best bet of getting us to include code, is to present it as a
@example
define printstr
- print $arg0->strh_.data->data_byte_p_
+ print $arg0->ch_C()
end
define printscm
of memory it requires is proportional to the size of the score, in other
words. For a moderately complex piano scores of 5 pages, the footprint
can easily become 20 megs. (Our favorite test is the coriolan:
-approx. 100 megs for a 50 page orchestral). If your system has not got
-enough memory, it can easily start swapping.
+approx. 100 megs for a 50 page orchestral score). If your system has not
+got enough memory, it can easily start swapping.
A part of the memory is used as temporary storage, and is reclaimed
through GUILE's garbage collection. A way to trade in CPU time for
@end itemize
-Direct PS output is still experimental. For creating nice looking ps
-output, use TeX and @code{dvips}.
+Direct PS output is not used often, and therefore likely to exhibit
+bugs. For creating nice looking ps output, use TeX and @code{dvips}.
@subsubsection The beams and slurs are gone when using the XDvi magnifying glass!?
for a summary of copyright relative to old music, also for the
expert forum for such subsubsections.
+Benjy (benjy@@indiansprings.org)
+
+@quotation
+(In the UK, the typesetting of a piece of music goes out of copyright 25 year\s
+after it is published. Maybe you can tell me what copyright law says in othe\r
+countries.)
+@end quotation
+
+The US has had several schemes over the last century meaning that
+anything published after January 1, 1923 and before 1964 requires that
+you put in some work to determine its status. However, anything
+published before 1923 is fair game in the US. See
+@uref{http://www.loc.gov/copyright/circs/circ22.html} for the whole
+twisted tale.
+
@node Windows32,, ,top
@section Windows32
The website will build without this utility, but you will not see our
hypertextified bibliography.
-@item @uref{http://www.zib.de/Visual/software/doc++/index.html,DOC++}
- A documentation system for C++ sources, which is used for the
- LilyPond sources.
@end itemize
@section Configuring and compiling
This will install a number of files, something close to:
@example
- /usr/local/man/man1/mi2mu.1
+ /usr/local/man/man1/midi2ly.1
+ /usr/local/man/man1/abc2ly.1
+ /usr/local/man/man1/etf2ly.1
/usr/local/man/man1/convert-mudela.1
/usr/local/man/man1/mudela-book.1
/usr/local/man/man1/lilypond.1
/usr/local/bin/lilypond
- /usr/local/bin/mi2mu
+ /usr/local/bin/midi2ly
/usr/local/bin/convert-mudela
/usr/local/bin/mudela-book
/usr/local/bin/abc2ly
+ /usr/local/bin/etf2ly
/usr/local/share/lilypond/*
- /usr/local/share/locale/@{it,nl@}/LC_MESSAGES/lilypond.mo
+ /usr/local/share/locale/@{....@}/LC_MESSAGES/lilypond.mo
@end example
@end example
Precompiled i386 RedHat RPMS are available from
-@uref{ftp://freshmeat.net/pub/rpms/lilypond/,ftp://freshmeat.net/pub/rpms/lilypond/} and
-@uref{http://linux.umbc.edu/software/lilypond/rpms/,http://linux.umbc.edu/software/lilypond/rpms/}.
+@uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/RedHat/}.
For compilation on a RedHat system you need these packages,
in addition to the those needed for running:
If you find bugs, please send bug reports to
@email{bug-gnu-music@@gnu.org}.
-Known bugs that are LilyPond's fault are listed in @file{TODO}, or
-demonstrated in @file{input/bugs/}.
+Bugs that are LilyPond's fault are listed in our TODO list on the
+web, or demonstrated in @file{input/bugs/}.
-Known bugs that are not LilyPond's fault are documented here.
+Bugs that are not LilyPond's fault are documented here.
@unnumbered LinuxPPC Bugs:
will make the music as short as possible but without breaking the
line. Here is a well know harmonic progression:
@mudela[veryverbatim, intertext="produce a well known harmonic progression:"]
- <c' e g> <b d g> <c2 e g>
+ \context Voice { <c' e g> <b d g> <c2 e g> }
@end mudela
If you want to place music examples in the text,
@mudela[eps]
- <c' e g> <b d g> <c2 e g>
+\context Voice { <c' e g> <b d g> <c2 e g>}
@end mudela
, you can use the @code{eps} option. This will create the music as
eps graphics and include it into the document with the
The code used look like this:
@example
@@mudela[eps]
- <c' e g> <b d g> <c2 e g>
+ \context Voice { <c' e g> <b d g> <c2 e g> }
@@end mudela
@end example
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=3
-PATCH_LEVEL=82
+PATCH_LEVEL=83
MY_PATCH_LEVEL=
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
#include "musical-request.hh"
#include "multi-measure-rest.hh"
#include "command-request.hh"
-#include "timing-engraver.hh"
+
#include "engraver-group-engraver.hh"
#include "warn.hh"
#include "item.hh"
if (!bar_p_)
{
bar_p_ = new Item (get_property ("basicBarProperties"));
-
- SCM default_type = get_property ("defaultBarType");
- if (gh_string_p (default_type))
- {
- bar_p_->set_elt_property ("glyph", default_type); // ugh
- }
-
announce_element (bar_p_, 0);
}
}
-/**
- Make a barline. If there are both |: and :| requested, merge them
- to :|:.
-*/
-void
-Bar_engraver::request_bar (String requested_type)
+void
+Bar_engraver::do_creation_processing ()
{
- if (!now_mom ())
- {
- SCM prop = get_property ("barAtLineStart");
- if (!to_boolean (prop))
- return;
- }
- bool bar_existed = bar_p_;
- create_bar ();
- if (bar_existed && requested_type == "")
- {
- return;
- }
-
- String current = ly_scm2string (bar_p_->get_elt_property ("glyph"));
-
- if ((requested_type == "|:" && current== ":|")
- || (requested_type == ":|" && current == "|:"))
- requested_type = ":|:";
+}
-
- bar_p_->set_elt_property ("glyph",
- ly_str02scm (requested_type.ch_C ()));
+void
+Bar_engraver::do_removal_processing ()
+{
+ typeset_bar ();
}
-void
-Bar_engraver::do_creation_processing ()
+/*
+ Bar_engraver should come *after* any engravers that expect bars to
+ modify whichBar in do_process_music () be typeset
+*/
+void
+Bar_engraver::do_process_music()
{
+ SCM b =get_property ("whichBar");
+ if (gh_string_p (b))
+ {
+ create_bar ();
+ }
}
void
-Bar_engraver::do_removal_processing ()
+Bar_engraver::typeset_bar ()
{
if (bar_p_)
{
+ SCM gl = get_property ("whichBar");
+ if (scm_equal_p (gl, bar_p_->get_elt_property ("glyph")) != SCM_BOOL_T)
+ bar_p_->set_elt_property ("glyph", gl);
typeset_element (bar_p_);
bar_p_ =0;
}
}
-void
-Bar_engraver::do_process_music()
-{
- Translator * t = daddy_grav_l ()->get_simple_translator ("Timing_engraver"); // UGH.!
-
- Timing_engraver * te = dynamic_cast<Timing_engraver*>(t);
- String which = (te) ? te->which_bar () : "";
-
- if (which.length_i ())
- {
- create_bar();
- bar_p_->set_elt_property ("glyph", ly_str02scm (which.ch_C ()));
- }
-
+/*
+ lines may only be broken if there is a barline in all staffs
+*/
+void
+Bar_engraver::do_pre_move_processing()
+{
if (!bar_p_)
{
Score_engraver * e = 0;
{
e = dynamic_cast<Score_engraver*> (t);
}
-
+
if (!e)
programming_error ("No score engraver!");
else
- e->forbid_breaks ();
- }
-}
-
-
-void
-Bar_engraver::do_pre_move_processing()
-{
- if (bar_p_)
- {
- typeset_element (bar_p_);
- bar_p_ =0;
+ e->forbid_breaks (); // guh. Use properties!
}
+ else
+ typeset_bar ();
}
ADD_THIS_TRANSLATOR(Bar_engraver);
{
me->set_elt_property ("molecule-callback", SCM_BOOL_T);
me->set_extent_callback (0, X_AXIS);
+
// leave y_extent for spanbar?
}
- else if (! gh_equal_p (g, orig))
+
+ if (! gh_equal_p (g, orig))
me->set_elt_property ("glyph", g);
#include "musical-request.hh"
#include "warn.hh"
#include "debug.hh"
-#include "molecule.hh"
-#include "paper-def.hh"
-#include "lookup.hh"
-#include "lookup.hh"
+#include "music-list.hh"
+#include "musical-request.hh"
int
compare (Chord* left, Chord* right)
pitch_arr_p->insert (bass, 0);
}
+
+// junk me
+Simultaneous_music *
+get_chord (Musical_pitch tonic,
+ Array<Musical_pitch>* add_arr_p,
+ Array<Musical_pitch>* sub_arr_p,
+ Musical_pitch* inversion_p,
+ Musical_pitch* bass_p,
+ Duration d)
+{
+
+ /*
+ UARGAUGRAGRUAUGRUINAGRAUGIRNA
+
+ ugh
+ */
+ Chord chord = to_chord (tonic, add_arr_p, sub_arr_p, inversion_p, bass_p);
+ inversion_p = 0;
+ bass_p = 0;
+
+ Tonic_req* t = new Tonic_req;
+ t->pitch_ = tonic;
+ SCM l = gh_cons (t->self_scm (), SCM_EOL);
+
+ //urg
+ if (chord.inversion_b_
+ && Chord::find_notename_i (&chord.pitch_arr_, chord.inversion_pitch_) > 0)
+ {
+ Inversion_req* i = new Inversion_req;
+ i->pitch_ = chord.inversion_pitch_;
+ l = gh_cons (i->self_scm (), l);
+ }
+
+ if (chord.bass_b_)
+ {
+ Bass_req* b = new Bass_req;
+ b->pitch_ = chord.bass_pitch_;
+ l = gh_cons (b->self_scm (), l);
+ }
+
+ Array<Musical_pitch> pitch_arr = chord.to_pitch_arr ();
+ for (int i = pitch_arr.size (); --i >= 0;)
+ {
+ Musical_pitch p = pitch_arr[i];
+ Note_req* n = new Note_req;
+ n->pitch_ = p;
+ n->duration_ = d;
+ l = gh_cons (n->self_scm (), l);
+ }
+
+ Simultaneous_music*v = new Request_chord (l);
+
+ return v;
+}
+
+
#include "group-interface.hh"
#include "score-element.hh"
-Group_interface::Group_interface (Score_element const* e)
+/*
+ ugh: clean me, junk elt_l_ field
+ */
+Group_interface::Group_interface (Score_element * e)
{
elt_l_ = (Score_element*)e;
name_ = "elements";
}
-Group_interface::Group_interface (Score_element const *e, String s)
+Group_interface::Group_interface (Score_element *e, String s)
{
elt_l_ =(Score_element*)e;
name_ = s;
int compare (Chord*, Chord*);
+Simultaneous_music *get_chord (Musical_pitch tonic,
+ Array<Musical_pitch>* add_arr_p,
+ Array<Musical_pitch>* sub_arr_p,
+ Musical_pitch* inversion_p,
+ Musical_pitch* bass_p,
+ Duration d);
+
+
+
#endif // CHORD_HH
Score_element * elt_l_;
String name_;
public:
- Group_interface (Score_element const*);
- Group_interface (Score_element const*, String);
+ Group_interface (Score_element *);
+ Group_interface (Score_element *, String);
int count ();
void add_thing (SCM);
bool has_interface ();
Score_element * elt_l_;
String name_;
public:
- Pointer_group_interface (Score_element const*);
- Pointer_group_interface (Score_element const*, String);
+ Pointer_group_interface (Score_element*);
+ Pointer_group_interface (Score_element*, String);
int count ();
void set_interface ();
static bool has_interface (Score_element*);
Moment body_length_mom () const;
Moment alternatives_length_mom () const;
- void print() const;
/// Transpose, with the interval central C to #p#
virtual void transpose (Musical_pitch p);
Repeated_music (Music*, int , Music_sequence*);
Repeated_music (Repeated_music const&);
-protected:
- virtual void do_print() const;
};
static bool has_interface (Score_element*);
static Interval get_spanned_interval (Score_element*);
static void add_bar (Score_element*,Score_element*);
+ static void evaluate_glyph (Score_element*);
static void evaluate_empty (Score_element*);
static Interval width_callback(Score_element *, Axis) ;
static SCM get_bar_size (SCM);
#include "my-lily-lexer.hh"
#include "debug.hh"
#include "main.hh"
-#include "music-list.hh"
-#include "musical-request.hh"
-#include "command-request.hh"
-#include "lily-guile.hh"
#include "parser.hh"
-#include "scope.hh"
#include "file-results.hh"
-#include "midi-def.hh"
-#include "paper-def.hh"
-#include "identifier.hh"
-#include "chord.hh"
+#include "scope.hh"
My_lily_parser::My_lily_parser (Sources * source_l)
{
default_duration_ = *d;
}
-// junk me
-Simultaneous_music *
-My_lily_parser::get_chord (Musical_pitch tonic,
- Array<Musical_pitch>* add_arr_p,
- Array<Musical_pitch>* sub_arr_p,
- Musical_pitch* inversion_p,
- Musical_pitch* bass_p,
- Duration d)
-{
-
- /*
- UARGAUGRAGRUAUGRUINAGRAUGIRNA
-
- ugh
- */
- Chord chord = to_chord (tonic, add_arr_p, sub_arr_p, inversion_p, bass_p);
- inversion_p = 0;
- bass_p = 0;
-
- Tonic_req* t = new Tonic_req;
- t->pitch_ = tonic;
- SCM l = gh_cons (t->self_scm (), SCM_EOL);
-
- //urg
- if (chord.inversion_b_
- && Chord::find_notename_i (&chord.pitch_arr_, chord.inversion_pitch_) > 0)
- {
- Inversion_req* i = new Inversion_req;
- i->pitch_ = chord.inversion_pitch_;
- l = gh_cons (i->self_scm (), l);
- }
-
- if (chord.bass_b_)
- {
- Bass_req* b = new Bass_req;
- b->pitch_ = chord.bass_pitch_;
- l = gh_cons (b->self_scm (), l);
- }
-
- Array<Musical_pitch> pitch_arr = chord.to_pitch_arr ();
- for (int i = pitch_arr.size (); --i >= 0;)
- {
- Musical_pitch p = pitch_arr[i];
- Note_req* n = new Note_req;
- n->pitch_ = p;
- n->duration_ = d;
- l = gh_cons (n->self_scm (), l);
- }
-
- Simultaneous_music*v = new Request_chord (l);
- v->set_spot (here_input ());
-
- return v;
-}
-
-
Input
My_lily_parser::pop_spot()
#include "auto-change-music.hh"
#include "part-combine-music.hh"
#include "output-property.hh"
+#include "chord.hh"
bool
is_duration_b (int t)
Music *music;
Score *score;
Scope *scope;
- Interval *interval;
+
Musical_req* musreq;
Music_output_def * outputdef;
Musical_pitch * pitch;
Midi_def* midi;
- Moment *moment;
Real real;
Request * request;
/*
TODO: devise standard for protection in parser.
- if (SCM_NIMP($4))
- scm_unprotect_object ($4);
The parser stack lives on the C-stack, which means that
all objects can be unprotected as soon as they're here.
}
| translator_spec_block {
$$ = $1->self_scm ();
+ scm_unprotect_object ($$);
}
| Music {
$$ = $1->self_scm ();
+ scm_unprotect_object ($$);
}
| post_request {
$$ = $1->self_scm ();
+ scm_unprotect_object ($$);
}
| explicit_duration {
$$ = (new Duration_identifier ($1, DURATION_IDENTIFIER))->self_scm ();
$$->set_spot (THIS->here_input ());
SCM m = $1->self_scm ();
-// scm_unprotect_object (m);
+ scm_unprotect_object (m);
$$->music_ = m;
}
| SCORE_IDENTIFIER {
| Music_list Music {
SCM s = $$;
SCM c = gh_cons ($2->self_scm (), SCM_EOL);
-// scm_unprotect_object ($2->self_scm ()); /* UGH */
+ scm_unprotect_object ($2->self_scm ()); /* UGH */
if (gh_pair_p (gh_cdr (s)))
chord:
steno_tonic_pitch optional_notemode_duration chord_additions chord_subtractions chord_inversion chord_bass {
- $$ = THIS->get_chord (*$1, $3, $4, $5, $6, *$2);
+ $$ = get_chord (*$1, $3, $4, $5, $6, *$2);
+ $$->set_spot (THIS->here_input ());
};
chord_additions:
#include "group-interface.hh"
#include "score-element.hh"
-Pointer_group_interface::Pointer_group_interface (Score_element const* e)
+/*
+ UGH clean me .
+ */
+Pointer_group_interface::Pointer_group_interface (Score_element * e)
{
- elt_l_ = (Score_element*)e;
+ elt_l_ = e;
name_ = "elements";
}
-Pointer_group_interface::Pointer_group_interface (Score_element const *e, String s)
+Pointer_group_interface::Pointer_group_interface (Score_element *e, String s)
{
elt_l_ =(Score_element*)e;
name_ = s;
}
+
+/*
+ duh.
+ */
bool
Pointer_group_interface::has_interface ()
{
void
Pointer_group_interface::set_interface ()
{
- if (!has_interface ())
- {
- elt_l_->set_elt_property (name_.ch_C(), SCM_EOL);
- }
}
Repeated_music::Repeated_music(Music *beg, int times, Music_sequence * alts)
{
- set_mus_property ("body", beg->self_scm ());
+ if (beg)
+ {
+ set_mus_property ("body", beg->self_scm ());
+ scm_unprotect_object (beg->self_scm ());
+ }
fold_b_ = false;
repeats_i_ = times;
volta_fold_b_ = true;
{
alts->truncate (times);
set_mus_property ("alternatives", alts->self_scm ());
+ scm_unprotect_object (alts->self_scm ());
}
}
}
-void
-Repeated_music::do_print () const
-{
-#ifndef NPRINT
- DEBUG_OUT << "Fold = " << fold_b_ << " reps: " << repeats_i_;
-
- if (body ())
- body ()->print();
-
- if (alternatives ())
- alternatives ()->print();
-#endif
-}
-
Musical_pitch
Repeated_music::to_relative_octave (Musical_pitch p)
{
{
spanbar_p_ = new Item (get_property ("basicSpanBarProperties"));
Span_bar::set_interface (spanbar_p_);
- spanbar_p_->set_elt_property ("glyph", bar_l_arr_[0]->get_elt_property ("glyph"));
- spanbar_p_->set_elt_property ("visibility-lambda",
- bar_l_arr_[0]->get_elt_property ("visibility-lambda"));
-
+
spanbar_p_->set_parent (bar_l_arr_[0], Y_AXIS);
spanbar_p_->set_parent (bar_l_arr_[0], X_AXIS);
{
for (int i=0; i < bar_l_arr_.size() ; i++)
Span_bar::add_bar( spanbar_p_,bar_l_arr_[i]);
+
+ SCM vissym =ly_symbol2scm ("visibility-lambda");
+ SCM vis = bar_l_arr_[0]->get_elt_property (vissym);
+ if (scm_equal_p (spanbar_p_->get_elt_property (vissym), vis) != SCM_BOOL_T)
+ spanbar_p_->set_elt_property (vissym, vis);
+
typeset_element (spanbar_p_);
spanbar_p_ =0;
}
SCM
Span_bar::before_line_breaking (SCM smob)
{
- Bar::before_line_breaking (smob);
-
evaluate_empty (unsmob_element (smob));
+ evaluate_glyph (unsmob_element (smob));
+ /*
+ no need to call Bar::before_line_breaking (), because the info
+ in ELEMENTS already has been procced by Bar::before_line_breaking().
+ */
return SCM_UNSPECIFIED;
}
{
me->suicide ();
}
-
- SCM gl = me->get_elt_property ("glyph");
+}
+
+void
+Span_bar::evaluate_glyph (Score_element*me)
+{
+ SCM elts = me->get_elt_property ("elements");
+ Score_element * b = unsmob_element (gh_car (elts));
+ SCM glsym =ly_symbol2scm ("glyph");
+ SCM gl =b ->get_elt_property (glsym);
if (!gh_string_p (gl))
{
me->suicide ();
return ;
}
- else {
- String type_str = ly_scm2string (gl);
- String orig = type_str;
- if (type_str == "|:")
- {
- type_str= ".|";
- }
- else if (type_str== ":|")
- {
- type_str= "|.";
- }
- else if (type_str== ":|:")
- {
- type_str= ".|.";
- }
- if (orig != type_str)
- me->set_elt_property ("glyph", ly_str02scm (type_str.ch_C()));
- }
+
+ String type = ly_scm2string (gl);
+
+ if (type == "|:")
+ {
+ type = ".|";
+ }
+ else if (type== ":|")
+ {
+ type = "|.";
+ }
+ else if (type== ":|:")
+ {
+ type = ".|.";
+ }
+
+ gl = ly_str02scm (type.ch_C());
+ if (scm_equal_p (me->get_elt_property (glsym), gl) != SCM_BOOL_T)
+ me->set_elt_property (glsym, gl);
}
Interval
#include "command-request.hh"
#include "engraver.hh"
-#include "timing-engraver.hh"
+
#include "engraver-group-engraver.hh"
public:
VIRTUAL_COPY_CONS(Translator);
Item * time_signature_p_;
-
+ SCM last_time_fraction_;
Time_signature_engraver();
};
Time_signature_engraver::Time_signature_engraver()
{
time_signature_p_ =0;
+ last_time_fraction_ = SCM_EOL;
}
void
Time_signature_engraver::do_process_music()
{
/*
- UGH.
- this should use properties.
- */
- Translator * result =
- daddy_grav_l()->get_simple_translator ("Timing_engraver"); // ugh
-
- if (!result)
- {
- warning (_ ("lost in time:"));
- warning (_f ("can't find: `%s'", " Timing_translator"));
- return ;
- }
-
- Timing_engraver * timing_grav_l= dynamic_cast<Timing_engraver *> (result);
-
- Time_signature_change_req *req = timing_grav_l->time_signature_req_l();
- if (req)
+ not rigorously safe, since the value might get GC'd and
+ reallocated in the same spot */
+ SCM fr= get_property ("timeSignatureFraction");
+ if (last_time_fraction_ != fr)
{
+ last_time_fraction_ = fr;
time_signature_p_ = new Item (get_property ("basicTimeSignatureProperties"));
- time_signature_p_->set_elt_property ("fraction",
- gh_cons (gh_int2scm (req->beats_i_),
- gh_int2scm (req->one_beat_i_)));
+ time_signature_p_->set_elt_property ("fraction",fr);
}
-
if (time_signature_p_)
- announce_element (time_signature_p_, req);
+ announce_element (time_signature_p_, 0);
}
void
(c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "score-engraver.hh"
-#include "timing-engraver.hh"
+#include "translator-group.hh"
#include "command-request.hh"
#include "score-element-info.hh"
#include "multi-measure-rest.hh"
+#include "timing-translator.hh"
+#include "engraver.hh"
+
+/**
+ Do time bookkeeping
+ */
+class Timing_engraver : public Timing_translator, public Engraver
+{
+ Bar_req * bar_req_l_;
+protected:
+ virtual bool do_try_music (Music * );
+ virtual void do_post_move_processing ();
+ virtual void do_process_music ();
+public:
+ String which_bar ();
+ VIRTUAL_COPY_CONS(Translator);
+};
ADD_THIS_TRANSLATOR(Timing_engraver);
{
bar_req_l_ = 0;
Timing_translator::do_post_move_processing ();
+
+ SCM nonauto = get_property ("barNonAuto");
+ SCM which = now_mom () ? SCM_UNDEFINED : ly_str02scm ("|");
+ if (which == SCM_UNDEFINED && !to_boolean (nonauto))
+ {
+ SCM always = get_property ("barAlways");
+ if (!measure_position ()
+ || (to_boolean (always)))
+ {
+ which=get_property ("defaultBarType" );
+ }
+ }
+
+ daddy_trans_l_->set_property ("whichBar", which);
}
bool
{
if (Bar_req * b= dynamic_cast <Bar_req *> (m))
{
- if (bar_req_l_ && !bar_req_l_->equal_b (b)) // huh?
+ if (bar_req_l_ && !bar_req_l_->equal_b (b))
return false;
bar_req_l_ = b;
return Timing_translator::do_try_music (m);
}
-/*
- TODO make properties of this.
- */
-String
-Timing_engraver::which_bar ()
+void
+Timing_engraver::do_process_music ()
{
- if (!bar_req_l_)
- {
- if (!now_mom ())
- return "|";
-
- SCM nonauto = get_property ("barNonAuto");
- if (!to_boolean (nonauto))
- {
- SCM always = get_property ("barAlways");
- if (!measure_position ()
- || (to_boolean (always)))
- {
- SCM def=get_property ("defaultBarType" );
- return (gh_string_p (def))? ly_scm2string (def) : "";
- }
- }
- return "";
- }
- else
- {
- return bar_req_l_->type_str_;
- }
+ if (bar_req_l_)
+ daddy_trans_l_->set_property ("whichBar", bar_req_l_->get_mus_property ("type"));
}
+
\consists "Repeat_engraver";
+ \consists "Separating_line_group_engraver";
% staffspace (distances)
%
basicBarProperties = #`(
+ (interfaces . (bar-interface staff-bar-interface))
(break-align-symbol . Staff_bar)
+ (glyph . "|")
(barsize-procedure . ,Bar::get_staff_bar_size)
(molecule-callback . ,Bar::brew_molecule)
(visibility-lambda . ,all-visible)
(thin-kern . 3.0)
(hair-thickness . 1.6)
(thick-thickness . 6.0)
-
- (interfaces . (bar-interface staff-bar-interface))
+ (name . "barline")
)
basicBarNumberProperties = #`(
(molecule-callback . ,Text_item::brew_molecule)
(breakable . #t)
(visibility-lambda . ,begin-of-line-visible)
+ (name . "barnumber")
)
basicBeamProperties = #`(
(default-neutral-direction . 1)
(interfaces . (beam-interface))
(damping . 1)
+ (name . "beam")
)
basicBreakAlignProperties = #`(
(interfaces . (break-align-interface))
(stacking-dir . 1)
(axes 0)
+ (name . "break alignment")
)
basicBreakAlignGroupProperties = #`(
(interfaces . (axis-group-interface))
(axes . (0))
+ (name . "break alignment group")
)
basicBreathingSignProperties = #`(
+ (interfaces . (breathing-sign-interface))
(break-align-symbol . Breathing_sign)
(breakable . #t )
(molecule-callback . ,Breathing_sign::brew_molecule)
(visibility-lambda . ,begin-of-line-invisible)
- (interfaces . (breathing-sign-interface))
+ (name . "breathing sign")
)
basicClefItemProperties = #`(
+ (interfaces . (clef-interface))
(molecule-callback . ,Score_element::brew_molecule)
(before-line-breaking-callback . ,Clef::before_line_breaking)
(breakable . #t)
(break-align-symbol . Clef_item)
(visibility-lambda . ,begin-of-line-visible)
- (interfaces . (clef-interface))
+ (name . "clef")
)
basicChordNameProperties = #`(
(molecule-callback . ,Chord_name::brew_molecule)
(interfaces . (chord-name-interface))
- (after-line-breaking-callback . ,Chord_name::after_line_breaking)
+ (after-line-breaking-callback . ,Chord_name::after_line_breaking)
+ (name . "chord name")
)
basicCollisionProperties = #`(
(axes 0 1)
(interfaces . (collision-interface))
+ (name . "note collision")
)
basicCrescendoProperties = #`(
(molecule-callback . ,Crescendo::brew_molecule)
(interfaces . (crescendo-interface dynamic-interface))
+ (name . "crescendo")
)
basicDotColumnProperties = #`(
(interfaces . (dot-column-interface axis-group-interface ))
(axes 0 )
+ (name . "dot column")
)
basicDotsProperties = #`(
+ (interfaces . (dot-interface))
(molecule-callback . ,Dots::brew_molecule)
(dot-count . 1)
- (interfaces . (dot-interface))
+ (name . "augmentation dot")
)
- basicDynamicTextProperties = # `(
+ basicDynamicTextProperties = #`(
(style . "dynamic")
(interfaces . (dynamic-interface))
(molecule-callback . ,Text_item::brew_molecule)
(script-priority . 100)
(self-alignment-Y . 0)
+ (name . "dynamic text")
)
basicDynamicLineSpannerProperties = #`(
(axes . ( 1))
(padding . 3)
(minimum-space . 6)
+ (name . "dynamic alignment")
)
+
leftEdgeBasicProperties = #`(
(break-align-symbol . Left_edge_item)
(breakable . #t)
+ (name . "left edge")
)
basicGraceAlignItemProperties = #`(
(axes . (0))
(interfaces . (axis-group-interface align-interface))
(before-line-breaking-callback . ,Grace_align_item::before_line_breaking)
+ (name . "grace alignment")
)
basicHaraKiriVerticalGroupspannerProperties = #`(
(interfaces . (hara-kiri-interface))
(axes 1)
+ (name . "hara kiri")
)
basicHyphenSpannerProperties = #`(
(thickness . 1.0)
(height . 0.4)
(minimum-length . 0.5)
(molecule-callback . ,Hyphen_spanner::brew_molecule)
+ (name . "hyphen")
)
basicInstrumentNameProperties = #`(
(molecule-callback . ,Text_item::brew_molecule)
(break-align-symbol . Instrument_name)
(visibility-lambda . ,begin-of-line-visible)
+ (name . "instrument name")
)
basicKeyProperties = #`(
(molecule-callback . ,Key_item::brew_molecule)
(break-align-symbol . Key_item)
(visibility-lambda . ,begin-of-line-visible)
(breakable . #t)
+ (name . "key signature")
)
basicLocalKeyProperties = #`(
(molecule-callback . ,Local_key_item::brew_molecule)
(left-padding . 0.2)
(right-padding . 0.4)
(interfaces . (accidentals-interface))
+ (name . "accidentals")
)
basicLineOfScoreProperties = #`(
(axes . (0 1))
(interfaces . (axis-group-interface))
+ (name . "godzilla")
)
basicLyricExtenderProperties = #`(
+ (interfaces . (lyric-extender-interface))
(molecule-callback . ,Lyric_extender::brew_molecule)
(right-trim-amount . 0.5)
- (interfaces . (lyric-extender-interface))
+ (name . "extender line")
)
basicLyricTextProperties = #`(
+ (interfaces . (lyric-syllable-interface text-item-interface))
(molecule-callback . ,Text_item::brew_molecule)
(self-alignment-X . 0)
(non-rhythmic . #t)
(word-space . 0.6)
- (interfaces . (lyric-syllable-interface text-item-interface))
+ (name . "lyric syllable")
)
basicMarkProperties = #`(
+ (interfaces . (mark-interface))
(molecule-callback . ,Text_item::brew_molecule)
(breakable . #t)
- (interfaces . (mark-interface))
(visibility-lambda . ,end-of-line-invisible)
(padding . 4.0)
+ (name . "rehearsal mark")
)
basicMultiMeasureRestProperties = #`(
(spacing-procedure . ,Multi_measure_rest::set_spacing_rods)
(molecule-callback . ,Multi_measure_rest::brew_molecule)
(staff-position . 0)
+ (name . "multi-measure rest")
)
basicNoteColumnProperties = #`(
- (axes 0 1)
(interfaces . (axis-group-interface note-column-interface))
+ (axes 0 1)
+ (name . "note column")
)
basicNoteHeadProperties = #`(
(interfaces . (note-head-interface rhythmic-head-interface))
(molecule-callback . ,Note_head::brew_molecule)
+ (name . "note head")
)
basicNoteNameProperties = #`(
(molecule-callback . ,Text_item::brew_molecule)
+ (name . "note name")
)
basicOctavateEightProperties = #`(
(self-alignment-X . 0)
(after-line-breaking-callback . ,Rest::after_line_breaking)
(molecule-callback . ,Rest::brew_molecule)
(minimum-beam-collision-distance . 1.5)
+ (name . "rest")
)
basicRestCollisionProperties = #`(
- (minimum-distance . 0.75)
(interfaces . (rest-collision-interface))
+ (minimum-distance . 0.75)
+ (name . "rest collision")
)
- basicScriptProperties = #`(
+ basicScriptProperties = #`(
(molecule-callback . ,Script::brew_molecule)
(interfaces . (script-interface))
+ (name . "script")
)
basicScriptColumnProperties = #`(
(before-line-breaking-callback . ,Script_column::before_line_breaking)
+ (name . "script column")
)
basicSlurProperties = #`(
+ (interfaces . (slur-interface))
(molecule-callback . ,Slur::brew_molecule)
(thickness . 1.2)
- (spacing-procedure . ,Slur::set_spacing_rods) e
+ (spacing-procedure . ,Slur::set_spacing_rods)
(minimum-length . 1.5)
- (after-line-breaking-callback . ,Slur::after_line_breaking)
+ (after-line-breaking-callback . ,Slur::after_line_breaking)
+ (name . "slur")
)
basicSpacingSpannerProperties =#`(
(spacing-procedure . ,Spacing_spanner::set_springs)
;; assume that notes at least this long are present.
(maximum-duration-for-spacing . ,(make-moment 1 8))
+ (name . "spacing spanner")
)
basicSpanBarProperties = #`(
+ (interfaces . (bar-interface span-bar-interface))
(break-align-symbol . Staff_bar)
(barsize-procedure . ,Span_bar::get_bar_size)
(molecule-callback . ,Bar::brew_molecule)
(visibility-lambda . ,begin-of-line-invisible)
(breakable . #t)
+ (glyph . "|")
(before-line-breaking-callback . ,Span_bar::before_line_breaking)
-
;; ugh duplication!
;;
(thin-kern . 3.0)
(hair-thickness . 1.6)
(thick-thickness . 6.0)
- (interfaces . (bar-interface span-bar-interface))
+ (name . "cross staff bar-line")
)
basicStanzaNumberProperties = #`(
(breakable . #t)
(molecule-callback . ,Text_item::brew_molecule)
(break-align-symbol . Clef_item)
(visibility-lambda . ,begin-of-line-visible)
+ (name . "stanza number")
)
staffSymbolBasicProperties = #`(
+ (interfaces . (staff-symbol-interface ))
(molecule-callback . ,Staff_symbol::brew_molecule)
(staff-space . 1.0)
(line-count . 5 )
- (interfaces . (staff-symbol-interface ))
+ (name . "staff symbol")
)
basicSystemStartDelimiterProperties = #`(
(molecule-callback . ,System_start_delimiter::brew_molecule)
(arch-width . 1.5)
(bracket-thick . 0.25)
(bracket-width . 2.0)
+ (name . "system start bracket")
)
basicTextScriptProperties = #`(
(molecule-callback . ,Text_item::brew_molecule)
(no-spacing-rods . #t)
(interfaces . (text-script-interface text-item-interface))
- (padding . 3.0)
+ (padding . 3.0)
+ (name . "text script")
)
basicTieProperties = #`(
+ (interfaces . (tie-interface))
(molecule-callback . ,Tie::brew_molecule)
(spacing-procedure . ,Tie::set_spacing_rods)
(thickness . 1.2)
(minimum-length . 2.5)
- (interfaces . (tie-interface))
+ (name . "tie")
)
basicTieColumnProperties = #`(
(after-line-breaking-callback . ,Tie_column::after_line_breaking)
(interfaces . (tie-column-interface))
+ (name . "tie column")
)
basicTimeSignatureProperties = #`(
+ (interfaces . (time-signature-interface))
(molecule-callback . ,Time_signature::brew_molecule)
(break-align-symbol . Time_signature)
(visibility-lambda . ,all-visible)
(breakable . #t)
- (interfaces . (time-signature-interface))
+ (name . "time signature")
)
basicTupletSpannerProperties = #`(
(number-gap . 2.0)
(style . "italic")
(no-spacing-rods . #t)
(self-alignment-X . 0)
+ (name . "sostenuto pedal")
)
basicStemTremoloProperties = #`(
(molecule-callback . ,Stem_tremolo::brew_molecule)
(beam-width . 2.0) ; staff-space
(beam-thickness . 0.42) ; staff-space
+ (name . "stem tremolo")
)
basicStemProperties = #`(
+ (interfaces . (stem-interface))
(before-line-breaking-callback . ,Stem::before_line_breaking)
(molecule-callback . ,Stem::brew_molecule)
; if stem is on middle line, choose this direction.
(default-neutral-direction . 1)
- (interfaces . (stem-interface))
+ (name . "stem")
)
basicSeparationItemProperties = #`(
(interfaces . (separation-item-interface))
+ (name . "separation item")
)
basicSeparatingGroupSpannerProperties = #`(
(interfaces . (separation-spanner-interface))
(spacing-procedure . ,Separating_group_spanner::set_spacing_rods)
+ (name . "separation spanner")
)
basicSustainPedalProperties = #`(
+ (interfaces . (sustain-pedal-interface))
(no-spacing-rods . #t)
(molecule-callback . ,Sustain_pedal::brew_molecule)
(self-alignment-X . 0)
- (interfaces . (sustain-pedal-interface))
+ (name . "sustain pedal")
)
basicUnaChordaPdealProperties = #`(
(molecule-callback . ,Text_item::brew_molecule)
(style . "italic")
(no-spacing-rods . #t)
(self-alignment-X . 0)
+ (name . "una chorda pedal")
)
basicVoltaSpannerProperties = #`(
(molecule-callback . ,Volta_spanner::brew_molecule)
- (interfaces . (volta-spanner-interface))
+ (interfaces . (volta-spanner-interface side-position-interface))
+ (direction . 1)
(padding . 5)
(minimum-space . 25)
+ (name . "volta brace")
)
basicVerticalAxisGroupProperties = #`(
(axes 1)
(interfaces . (axis-group-interface))
+ (name . "Y-axis group")
)
};