lilypond --paper=paper16 foo.ly
lilypond --paper=paper20 foo.ly
lilypond --paper=paper-as9 foo.ly
+. * entangle ly/* paper-params papersize stuff
. * fix tremolos.
. * change ) c4 to c4-)
. * internationalize GUILE msgs.
. * unbroken marks.
+. * chubb:
+-- Take a piece of early music, and typeset it as closely as possible to
+the original edition. This means: moveable clefs, sometimes funny or no
+time signatures, few or no bar lines, few or no ties, slurs or
+phrasemarks, ornaments implied by the structure of the music, or
+indicated by, e.g., one or more thick lines through the stem of a note
+(Purcell and Farnaby both use this extensively, but with rather
+different meanings). For Dowland's music it may also mean being able
+to rotate one or more staves (but I can do this in LaTeX).
+
+-- Add to this music a set of critical marks that:
+ * regularises clef, time and key signature.
+ * add slurs, phrase marks, articulation, etc.
+ * Halve or quarter the durations, so that minims become crotchets, say.
+ * add ornaments (mordents, trills, turns etc)
+ * add regular barlines (which sometimes will mean splitting a note
+ and adding a tie, e.g., in some of Byrd's music)
+ * Add footnotes to particular symbols, groups of notes, etc.
+ * When translating from chant notation, add a square bracket over a
+ group of notes to indicate a ligature in the original
+etc.
+ * Discretionary sharp or flat signs, for Musica Ficta
+
+-- print out both editions from the same source.
. * write smobifying howto.
. * put property test files in refman.
. * alignment within @itemize
. * \grace { c d } c1 in midi
. * \prop slurdir in grace notes
. * Make fingering and playing instructions Music_wrappers?
-. * \eltproperty "=Context" "Elt_name" "prop-name" #value
. * script columns
. * Must stop before this music ends:
verse=\lyrics {
- if I change the property minVerticalAlign in a multi staff score with
lyrics the change affects the lyrics too. I would like the change to
_only_ affect staves.
-
-- I would like to be able to influence the sloping of xtuplet brackets
-
- after the leading measure in the above mentioned score I want a double
bar line fully drawn across the staves and after that keep to the
ChoirStaff bar line types in the rest of the scores
. * [c8. c16 c16 c16] in 6/8 timesig.
. * Rewrite Stem, Beam (hairy)
. * beams over barlines
-. * Rests and beams don't work too well together. Example:
- [ r8 g''16 des'] [r8 c16 a]
. * autoBeamMelisma: if I explicitly beam notes in a staff with auto
beaming disabled I would like to have these beams also to be
melismatic.
. * \selectmusic to cut pieces from music.
. * formatting of input stuff.
. * deps for ly2dvi
-. * TODO: merge atom & molecule; make tree from molecule.
. * Align_element::padding ?
. * use streambufs and iostream
to provide IO handling for TeX stream, mudela stream, data-file.
. * seriously buffer TeX output (do profile of writing .5 mb TeX file.)
-. * fix partial measures in meaningful way.
. * uniformise recent feta contributions.
. * bigger and fatter 4/4 C
. * relative mode for midi2ly
. * text-items clash with stems/beams
. * --include, -I option for ly2dvi (pass on to lily)
. * fix placement of beam-less abbrev
-. * \meter 3/4;
- <{\voiceone cis4. cis8 cis4 | cis4 cis cis | r1 }
- {\voicetwo cis,4 r r | r2. | r1 }> |
- }
. * Musical_pitch (analogous to Duration and Rhythmic_req)
think about, analogous to pitch:
* { a4 a16 } c <-- duration of c?
I understand the implementation of repeats well enough.
. * add mudela-book-doc source to webstie.
. * fix singleStaffBracket
-. * rename
-. * partial -> anacrouse
. * move paper vars into engraver properties
. * add new glyphs to font.ly
. * more intelligent file searching
. * disable spaces in TeX stuff
. * handle ^C for tmp/file creation.
. * make LilyPond RPM fully relocatable
-. * better hshift (dots, distance, head dependent)
. * didot / big point.
. * clefs (AG): The "8" should appear closer to the actual clef,
touching it.
.* FONT
. * the bracket is ugly (wings are too parabolic, should be more circular)
+. * fix accordion turning paths.
. * versioning for Feta
. * rewrite dynamic signs. They're kind of spaghetti now.
. * The `3' in the meter key is a one or two pixels too thin (at 600dpi)
. * work out sizes of character fonts.
. * more symbols
. * piano pedals: Ped/*
-. * maxima notehead
. * coda signs: Segno, O+
. * glissando, arpeggio
. * lengthened trill
do_one_file(String,String) [scores.cc:124]
Reading 4 bytes from 0xefffeca8 on the stack.
Address 0xefffeca8 is 728 bytes below frame pointer in function
-. * Array<Axis [2] > axeses;
-
- for (int i=0; i < loose_elems.size (); i++)
- {
- Score_element* elt = loose_elems[i];
- /*
- with which axes do we have to meddle?
- */
- int j =0;
- Axis as [2];
- for (int a = X_AXIS; a < NO_AXES; ++a)
- if (elt->parent_l (Axis (a)) == this)
- as[j++] = Axis (a);
- if (j == 1)
- as[j++] = as[0];
-
- axeses.push (as);
- }
-
. * patch: don't touch timestamp if all patches fail.
. * MetaPost: should not generate setgray for unfill
-. * check out GCC signatures?
. * glibc 2.0:
f = fopen ("/dev/null", "r")
assert (feof (f))
-. * tetex: mfplain.mem -> INSTALL
-. * mfplain.ini not in tetex 0.9 -> INSTALL
-
.* PROJECTS
. * Scripts:
. * output header info to MIDI too.
. * dump \header into easily parsable format.
-. * a musical dictionary. See Documentation/vocabulary-*, other
-languages:
-. * explanations
-. * italian
-. * german
-. * dutch
-. * swedish
-
. * chords
. * guitar chords (fret diagrams)
. * other chord name styles (american(?) style)
}
/**
- Find and return element. If #s# is not in the table, create an entry in the table, and init
- */
+ Find and return element. If #s# is not in the table, create an
+ entry in the table, and init */
V& elem (K s)
{
int l;
--- /dev/null
+
+\score { \notes <{ [ r8 g''16 des'] [r8 c16 a] }>}
afm_p->name_ = ly_symbol2scm (name.ch_C ());
progress_indication ("]");
- afm_p_dict_[sname] = afm_p->self_scm_;
- scm_unprotect_object (afm_p->self_scm_);
+ afm_p_dict_.set (sname,afm_p->self_scm_);
}
- return dynamic_cast<Adobe_font_metric*> (unsmob_metrics (afm_p_dict_[sname]));
+ return dynamic_cast<Adobe_font_metric*> (unsmob_metrics (afm_p_dict_.get (sname)));
}
Scaled_font_metric *
{
Font_metric *f = find_font (nm);
s = new Scaled_font_metric (f, m);
- scaled_p_dict_[sname] = s->self_scm_;
+ scaled_p_dict_.set (sname, s->self_scm_);
fm = s;
- scm_unprotect_object (s->self_scm_);
}
else
- fm = unsmob_metrics (scaled_p_dict_[sname]);
+ fm = unsmob_metrics (scaled_p_dict_.get (sname));
return dynamic_cast<Scaled_font_metric*> (fm);
}
tfm_p->name_ = ly_symbol2scm (name.ch_C( ));
progress_indication ("]");
- tfm_p_dict_[sname] = tfm_p->self_scm_;
- scm_unprotect_object (tfm_p->self_scm_);
+ tfm_p_dict_.set (sname, tfm_p->self_scm_);
}
return
- dynamic_cast<Tex_font_metric*> (unsmob_metrics (tfm_p_dict_[sname]));
+ dynamic_cast<Tex_font_metric*> (unsmob_metrics (tfm_p_dict_.get(sname)));
}
/*
engraver.cc -- implement Engraver
- Sourcefile of GNU LilyPond musictypesetter
+ Sourcefile of GNU LilyPond music type setter
(c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "debug.hh"
#include "paper-def.hh"
#include "score-element.hh"
+#include "group-interface.hh"
void
Engraver::fill_staff_info (Staff_info&)
void
Engraver::announce_element (Score_element_info i)
{
+ Score_element * e = i.elem_l_;
+ group (e, "interfaces").add_thing (ly_symbol2scm (e->name()));
+
if (!i.origin_trans_l_)
i.origin_trans_l_ = this;
daddy_grav_l()->announce_element (i);
/**
auto resizing hash table. This should come from GUILE.
*/
-class Scheme_hash_table : public Hash_table<SCM,SCM>
+class Scheme_hash_table : private Hash_table<SCM,SCM>
{
-public:
+public:
+ // bool elem_b (SCM k) const;
+ Hash_table<SCM,SCM>::try_retrieve;
+ Hash_table<SCM,SCM>::elem_b;
+ /**
+ WARNING: putting something in assumes responsibility for cleaning
+ up. */
+ void set (SCM k, SCM v);
+ SCM get (SCM k) const;
+
Scheme_hash_table ();
void operator = (Scheme_hash_table const &);
Scheme_hash_table (Scheme_hash_table const &);
void
Moment::do_smobify_self ()
-{}
+{
+}
SCM
make_rational (SCM n, SCM d)
{
+ Moment *r;
+ SCM retval = SCM_EOL;
if (SCM_INUMP (n) && SCM_INUMP(d))
{
- Moment *r = new Moment (gh_scm2int (n), gh_scm2int (d));
- return r->smobify_self ();
+ r= new Moment (gh_scm2int (n), gh_scm2int (d));
}
else
{
- ::error ("Not a number");
- assert(false);
+ ::error ("make-moment takes two integer arguments.");
+ r = new Moment (1,1);
}
+
+ retval = r->smobify_self ();
+ scm_unprotect_object (r->self_scm_);
+ return retval ;
}
#include "ly-smobs.icc"
Paper_column::Paper_column (Moment w)
{
- set_elt_property ("when", (new Moment (w))->smobify_self ());
+ SCM when = (new Moment (w))->smobify_self ();;
+ scm_unprotect_object (when);
+ set_elt_property ("when", when);
+
set_axes (X_AXIS, X_AXIS);
line_l_=0;
Interval
Paper_def::line_dimensions_int (int n) const
{
- SCM s = default_properties_ [ly_symbol2scm ("margin-shape")];
+ SCM s = default_properties_.get (ly_symbol2scm ("margin-shape"));
if (!gh_pair_p (s))
{
Real lw = get_var ("linewidth");
#include <time.h>
#include <fstream.h>
#include <math.h>
+#include <iostream.h>
#include "dimensions.hh"
#include "dictionary-iter.hh"
}
+int
+count_cells (SCM s)
+{
+ if (Atom * a = unsmob_atom (s))
+ {
+ return 2 + count_cells (a->func_);
+ }
+ else if (gh_pair_p (s))
+ {
+ return 2 + count_cells (gh_car (s))+ count_cells (gh_cdr (s));
+ }
+ else
+ return 1;
+}
+
void
Paper_outputter::dump_onto (Paper_stream *ps)
{
*ps << c;
free (c);
}
- }
+ }
}
void
SCM_UNDEFINED);
output_scheme (scm);
- gh_define (k.ch_l (), gh_double2scm (v));
+ // gh_define (k.ch_l (), gh_double2scm (v));
}
void
SCM_UNDEFINED);
output_scheme (scm);
- gh_define (k.ch_l (), ly_str02scm (v.ch_l ()));
+ // gh_define (k.ch_l (), ly_str02scm (v.ch_l ()));
}
void
SCM_UNDEFINED);
output_scheme (scm);
- gh_define (k.ch_l (), gh_int2scm (v));
+ // gh_define (k.ch_l (), gh_int2scm (v));
}
(c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+#include <stdio.h>
#include "scm-hash.hh"
#include "hash-table-iter.hh"
Scheme_hash_table::print_smob (SCM s, SCM p, scm_print_state*)
{
assert (SMOB_IS_TYPE_B (Scheme_hash_table, s));
+ char str[1000];
+ sprintf (str, "#<Scheme_hash_table 0x%0x ", s);
+ scm_puts (str, p);
Scheme_hash_table *me = SMOB_TO_TYPE(Scheme_hash_table,s);
for (Hash_table_iter<SCM,SCM> i (*me); i.ok(); i++)
{
scm_display (i.val (), p);
scm_puts ("\n",p);
}
+ scm_puts ("> ",p);
return 1;
}
+void
+Scheme_hash_table::set (SCM k, SCM v)
+{
+ elem (k ) = v;
+ scm_unprotect_object (v);
+}
+
+SCM
+Scheme_hash_table::get (SCM k)const
+{
+ return const_elem (k);
+}
Scheme_hash_table::~Scheme_hash_table( )
set_elt_property ("dependencies", SCM_EOL);
+ set_elt_property ("interfaces", SCM_EOL);
}
SCM ly_deep_copy (SCM);
{
Score_element *s = dynamic_cast<Score_element*>(c->element_l());
Molecule*m = s->do_brew_molecule_p();
- return m->extent()[c->axis ()];
+
+ Interval iv = m->extent()[c->axis ()];
+
+ delete m;
+ return iv;
}
{
return gh_cdr(a) == gh_cdr(b) ? SCM_BOOL_T : SCM_BOOL_F;
}
+
+
+SCM
+Score_element::ly_set_elt_property (SCM elt, SCM sym, SCM val)
+{
+ Score_element * sc = unsmob_element (elt);
+
+ if (!gh_symbol_p (sym))
+ {
+ error ("Not a symbol");
+ ly_display_scm (sym);
+ return SCM_UNDEFINED;
+ }
+
+ if (sc)
+ {
+ sc->element_property_alist_ = scm_assoc_set_x (sc->element_property_alist_, sym, val);
+ }
+ else
+ {
+ error ("Not a score element");
+ ly_display_scm (elt);
+ }
+
+ return SCM_UNDEFINED;
+}
+
+
+SCM
+Score_element::ly_get_elt_property (SCM elt, SCM sym)
+{
+ Score_element * sc = unsmob_element (elt);
+
+ if (sc)
+ {
+ SCM s = scm_assq(sym, sc->element_property_alist_);
+
+ if (s != SCM_BOOL_F)
+ return gh_cdr (s);
+ else
+ return SCM_UNDEFINED;
+ }
+ else
+ {
+ error ("Not a score element");
+ ly_display_scm (elt);
+ }
+ return SCM_UNDEFINED;
+}
+
+
+static void
+init_functions ()
+{
+ scm_make_gsubr ("ly-get-elt-property", 2, 0, 0, (SCM(*)(...))Score_element::ly_get_elt_property);
+ scm_make_gsubr ("ly-set-elt-property", 3, 0, 0, (SCM(*)(...))Score_element::ly_set_elt_property);
+}
+
+ADD_SCM_INIT_FUNC(scoreelt, init_functions);
Score_engraver::set_columns (Paper_column *new_command_l,
Paper_column *new_musical_l)
{
- if (command_column_l_ && command_column_l_->linked_b())
- {
- pscore_p_->add_column (command_column_l_);
- scoreline_l_->add_column (command_column_l_);
- }
- else
- command_column_l_ =0;
+ Paper_column * news[] = {new_command_l, new_musical_l};
+ Paper_column **current[] = {&command_column_l_, &musical_column_l_};
- if (new_command_l)
- command_column_l_ = new_command_l;
-
- if (musical_column_l_ && musical_column_l_->linked_b())
+ for (int i=00; i< 2; i++)
{
- pscore_p_->add_column (musical_column_l_);
- scoreline_l_->add_column (musical_column_l_);
- }
- else
- musical_column_l_ = 0;
-
- if (new_musical_l)
- {
- musical_column_l_ = new_musical_l;
+ if (*current[i])
+ {
+ if ((*current[i])->linked_b())
+ {
+ pscore_p_->add_column ((*current[i]));
+ scoreline_l_->add_column ((*current[i]));
+ }
+ else
+ {
+ /*
+ We're forgetting about this column. Dump it, and make SCM
+ forget it.
+
+ (UGH.) */
+ scm_unprotect_object ((*current[i])->self_scm_);
+ *current[i] =0;
+ }
+ }
+ if (news[i])
+ *current[i] = news[i];
}
}
(c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+#include <iostream.h>
+
#include "score.hh"
#include "debug.hh"
#include "music-output-def.hh"
Score::Score()
- : Input()
+ : Input()
{
header_p_ = 0;
music_p_ = 0;
Score::run_translator (Music_output_def *odef_l)
{
Cpu_timer timer;
+
+
Global_translator * trans_p = odef_l->get_global_translator_p();
if (!trans_p)
{
progress_indication ("\n");
output->process();
delete output ;
+
+ /*
+ force GC. At this point, GUILE may give back mallocated area to
+ the system.
+ */
+
+ scm_gc();
}
void
{
Link_array<Note_column> encompass_arr =
Group_interface__extract_elements (this, (Note_column*)0, "note-columns");
- set_bounds (LEFT, encompass_arr[0]);
- if (encompass_arr.size () > 1)
- set_bounds (RIGHT, encompass_arr.top ());
+
+ if (encompass_arr.size ())
+ {
+ set_bounds (LEFT, encompass_arr[0]);
+ if (encompass_arr.size () > 1)
+ set_bounds (RIGHT, encompass_arr.top ());
+ }
}
Paper_column * sc
= dynamic_cast<Paper_column*> (get_staff_info ().musical_pcol_l ());
- sc->set_elt_property ("shortest-playing-duration",
- (new Moment (shortest_playing))->smobify_self ());
+ SCM sh = (new Moment (shortest_playing))->smobify_self ();
+ SCM st = (new Moment (starter))->smobify_self ();
+
+ scm_unprotect_object (st);
+ scm_unprotect_object (sh);
- sc->set_elt_property ("shortest-starter-duration",
- (new Moment (starter))->smobify_self ());
+ sc->set_elt_property ("shortest-playing-duration", sh);
+ sc->set_elt_property ("shortest-starter-duration", st);
}
void
if (st)
return st->staff_space ();
else if (elt_l_->pscore_l_ && elt_l_->paper_l ())
- elt_l_->paper_l ()->get_var ("interline");
+ return elt_l_->paper_l ()->get_var ("interline");
return 0.0;
}
{
if (where_l)
*where_l = (Translator_group*) this; // ugh
- return properties_dict_[sym];
+ return properties_dict_.get (sym);
}
if (daddy_trans_l_)
void
Translator_group::set_property (String id, SCM val)
{
- properties_dict_[ly_symbol2scm (id.ch_C())] = val;
+ properties_dict_.set (ly_symbol2scm (id.ch_C()), val);
}