This document explains what you need to install LilyPond, and what you
should do. If you are going to compile and install LilyPond often,
-e.g. when doing development, you might want to check out the
-@file{buildscripts/set-lily.sh} script. It sets some environment
-variables and symlinks, which comes in handly when you have to compile
-LilyPond more often.
+e.g. when doing development, you might want to check out the
+@file{buildscripts/set-lily.sh} script. It sets some environment
+variables and symlinks, which comes in handy when you have to compile
+LilyPond more often.
@section Obtaining
The version numbers are in Linux-kernel style: even numbered versions
are `stable'. The webpages for the stable version (1.2) reside at GNU,
here: @uref{http://www.gnu.org/software/lilypond}. Big enhancements go
-into the latest odd numbered version (1.3), which webpages are on
+into the latest odd numbered version (1.3); its webpages are on
@uref{http://www.cs.uu.nl/~hanwen/lilypond/,Han-Wen's site}.
If want more information, you can browse the
If you are interested in sheet music typeset by LilyPond, have a look at
-the examples included. We have @uref{./input/out-www/index.html,short
-examples} and @uref{./mutopia/out-www/index.html,longer examples}. The
+the examples included. We have @uref{short-examples.html,short
+examples} and @uref{long-examples.html,longer examples}. The
examples include sound bites in MIDI, pictures in PNG, printable scores
in PostScript, and LilyPond input.
If you want to compile LilyPond from source, download here:
@itemize @bullet
-@item Download stable releases at
+@item Download stable releases at
@uref{ftp://ftp.gnu.org/gnu/lilypond/}
-@item Download development releases at
+@item Download development releases at
@uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/development/}
@item Canadian mirror @uref{http://sca.uwaterloo.ca/lilypond/} and @uref{ftp://sca.uwaterloo.ca/pub/}
@item Another site in Europe
@end itemize
Installing and compiling requires many additional packages, which are
-listed in the @uref{Documentation/topdocs/out-www/INSTALL.html, installation instructions}.
+listed in the @uref{Documentation/topdocs/out-www/INSTALL.html,
+installation instructions}.
There are binaries available, but alas they are not updated for every version released.
@itemize @bullet
(But don't forget to read the @uref{Documentation/out-www/faq.html,
Frequently Asked Questions} first.)
-@html
-<p align=center>
-[
- <a href="#download">Download</a>
- |
- <a href="Documentation/out-www/faq.html">FAQ</a>
- |
- <a href="Documentation/out-www/index.html">Documentation</a>
- |
- <a href="#music">Music archives</a>
- |
- <a href="#mailing-lists">Mailing lists</a>
- |
- <a href="Documentation/programmer/out-www/regression-test.html">
- Regression test</a>
- |
- <a href="Documentation/out-www/CHANGES.txt">News</a>
-]
-@end html
@table @samp
@item info-gnu-music@@gnu.org
# FIXME breaks on multiple strings.
#
def read_mudela_header (fn):
- s = gulp_file(fn)
+ s = open(fn).read ()
s = re.sub('%.*$', '', s)
s = re.sub('\n', ' ', s)
sys.stdout.write (r"""Usage: mutopia-index [options] INFILE OUTFILE
Generate index for mutopia\n
Options:
- -h, --help print this help
- --prefix=PRE specify prefix
+ -h, --help print this help
+ -o,-output=FILE write output to file.
-s, --subdirs=DIR add subdir
--suffix=SUF specify suffix"""
)
sys.exit (0)
# ugh.
-def gen_list(inputs, subdir, filename):
- (pre, subdirs, post)=subdir
+def gen_list(inputs, filename):
print "generating HTML list %s\n" % filename
- list = open(filename, 'w')
+ if filename:
+ list = open(filename, 'w')
+ else:
+ list = sys.stdout
list.write ('<html><TITLE>Rendered Examples</TITLE>\n')
list.write ('<body bgcolor=white>')
- if subdirs:
- list.write ('<h2>subdirectories</h2>')
- list.write ('<ul>')
- for ex in subdirs:
- print 'subdir %s ' % ex
- list.write ('<li><a href=%s/index.html>Subdirectory: %s</a></li>\n' % (pre + ex + post , ex))
-
- list.write ('</ul>')
-
-
-
+
if inputs:
- list.write('<h2>Contents of this directory</h2>\n');
-
list.write (headertext)
else:
list.write (headertext_nopics)
for ex in inputs:
- ex_ext = '.ly'
+ (base, ext) = os.path.splitext (ex)
+ (base, ext2) = os.path.splitext (base)
+ ext = ext2 + ext
+
print '%s, ' % ex
- try:
- header = read_mudela_header(ex + ex_ext + '.txt')
- except:
- ex_ext = '.fly'
- header = read_mudela_header(ex + ex_ext + '.txt')
+ header = read_mudela_header(ex)
def read_dict(s, default, h =header):
try:
except KeyError:
ret = default
return ret
- head = read_dict('title', ex)
+ head = read_dict('title', os.path.basename (base))
composer = read_dict('composer', '')
desc = read_dict('description', '')
list.write('<hr>')
l.write (' (%s %dk)' % (type, (size + 512) / 1024))
pictures = ['jpeg', 'png', 'xpm']
l.write ('\n')
- list_item(ex + ex_ext + '.txt', 'The input', 'ASCII')
+
+ list_item(base + ext, 'The input', 'ASCII')
for pageno in range(1,100):
- f = ex + '-page%d.png' % pageno
+ f = base + '-page%d.png' % pageno
if not file_exist_b (f):
break
list_item(f, 'The output, page %d' % pageno, 'png')
- list_item(ex + '.ps.gz', 'The output', 'gzipped PostScript')
- list_item(ex + '.midi', 'The output', 'MIDI')
+ list_item(base + '.ps.gz', 'The output', 'gzipped PostScript')
+ list_item(base + '.midi', 'The output', 'MIDI')
list.write ("</ul>");
list.write( "</BODY></HTML>");
import getopt
(options, files) = getopt.getopt(sys.argv[1:],
- 'hp:s:', ['help', 'subdirs=', 'suffix=', 'prefix='])
-subdir_pre=''
-subdir_suf =''
+ 'ho:', ['help', 'output='])
+outfile = 'examples.html'
subdirs =[]
for opt in options:
o = opt[0]
a = opt[1]
- if o == '--subdirs' or o == '-s':
- subdirs.append (a)
- elif o == '--prefix':
- subdir_pre = a
- elif o == '--suffix':
- subdir_suf = a
+ if o == '--help' or o == '-h':
+ help()
+ elif o == '--output' or o == '-o':
+ outfile = a
-
-allfiles = find.find ('*.ly') + find.find ('*.ly.txt')
+dirs = []
+for f in files:
+ dirs = dirs + find.find ('out-www', f);
+
+if not dirs:
+ dirs = ['.']
+
+allfiles = []
+
+for d in dirs:
+ allfiles = allfiles + find.find ('*.ly.txt', d)
+
+print allfiles
-gen_list (files, (subdir_pre, subdirs, subdir_suf), 'index.html')
+gen_list (allfiles, outfile)
# input/test/Makefile
depth = ../..
-examples=font20 sleur
+examples=font20
LOCALSTEPMAKE_TEMPLATES=mutopia
include $(depth)/make/stepmake.make
\header{
+title = "sleur";
+subtitle = "test slurs.";
enteredby = "jcn";
copyright = "public domain";
-TestedFeatures = "This file tests Feta embedded slurs" +
- "(Feta definitively is not an abbreviation of Font-En-TjA)";
}
\version "1.3.5";
m->dim_.x () = Interval (0, width);
m->dim_.y () = Interval (-2*height, 2*height);
- Atom *a = new Atom(gh_list (ly_symbol2scm (hairpin),
+ SCM at = gh_list (ly_symbol2scm (hairpin),
gh_double2scm (thick),
gh_double2scm (width),
gh_double2scm (height),
gh_double2scm (continued ? height/2 : 0.0),
- SCM_UNDEFINED));
+ SCM_UNDEFINED);
- m->add_atom (a->self_scm_);
+ m->add_atom (at);
m->translate_axis (extra_left, X_AXIS);
return m;
}
Dimension_cache *
Dimension_cache::common_refpoint (Dimension_cache const* s) const
{
- Link_array<Dimension_cache> my_groups;
- for (Dimension_cache const *c = this; c ; c = c->parent_l_)
- my_groups.push ((Dimension_cache*)c);
-
- Dimension_cache const *common=0;
-
- for (Dimension_cache const * d = s; !common && d; d = d->parent_l_)
- common = (Dimension_cache const*)my_groups.find_l (d);
-
- return (Dimension_cache*) common;
+ /*
+ I don't like the quadratic aspect of this code. Maybe this should
+ be rewritten some time, but the largest chain of parents might be
+ 10 high or so, so it shouldn't be a real issue. */
+ for (Dimension_cache const *c = this; c; c = c->parent_l_)
+ for (Dimension_cache const * d = s; d; d = d->parent_l_)
+ if (d == c)
+ return (Dimension_cache*)d;
+
+ return 0;
}
Interval
#ifndef ATOM_HH
#define ATOM_HH
-#include "protected-scm.hh"
-#include "string.hh"
-#include "box.hh"
#include "lily-proto.hh"
+#include "box.hh"
#include "lily-guile.hh"
-#include "smobs.hh"
-
-/**
- Atoms should only be created on the heap, ie. with
- "new Atom"
- */
-class Atom {
- Offset off_;
-
- friend class Molecule;
- friend class Paper_outputter;
-public:
- Atom (SCM s);
- Atom (Atom const&);
-
- DECLARE_SMOBS;
-
- /*
- SCM expression that (when evaluated) gives a TeX string
-representing a musical notation symbol. */
- SCM func_;
- void fontify (Font_metric*);
-};
-Atom* unsmob_atom (SCM);
+SCM translate_atom (Offset, SCM);
+SCM translate_atom_axis (Real, Axis,SCM);
+SCM fontify_atom (Font_metric*, SCM atom);
#endif
String ly_symbol2string (SCM);
SCM ly_offset2scm (Offset o);
-
+Offset ly_scm2offset (SCM s);
SCM ly_eval (SCM a);
SCM ly_parse_scm (char const* s, int* n);
SCM ly_quote_scm (SCM s);
struct Align_element;
struct All_font_metrics;
struct Articulation_req;
-struct Atom;
struct Audio_column;
struct Audio_element;
struct Audio_element_info;
void add_column (Note_column*);
void add_beam (Beam*);
protected:
- void calc_position_and_height (Real*,Real*)const;
+ void calc_dy (Real *) const;
+ void calc_position_and_height (Real*,Real *dy)const;
virtual Molecule* do_brew_molecule_p () const;
VIRTUAL_COPY_CONS(Score_element);
return answer;
}
-/*
- scm_m_quote doesn't use any env, but needs one for a good signature in GUILE.
-*/
SCM
ly_quote_scm (SCM s)
{
{
return gh_cons (gh_double2scm (o[X_AXIS]), gh_double2scm(o[Y_AXIS]));
}
+
+Offset
+ly_scm2offset (SCM s)
+{
+ return Offset (gh_scm2double (gh_car (s)),
+ gh_scm2double (gh_cdr (s)));
+}
return m;
}
- Atom* at = new Atom (gh_list (ly_symbol2scm ("char"),
+ SCM at = (gh_list (ly_symbol2scm ("char"),
gh_int2scm (cm->code),
SCM_UNDEFINED));
- at->fontify (afm_l_);
+ at= fontify_atom (afm_l_,at);
m.dim_ = afm_bbox_to_box (cm->charBBox);
- m.add_atom (at->self_scm_);
+ m.add_atom (at);
return m;
}
m.dim_[Y_AXIS] = Interval (min_y, max_y);
- Atom *at = new Atom
- (gh_list (ly_symbol2scm ("beam"),
+ SCM at = (gh_list (ly_symbol2scm ("beam"),
gh_double2scm (width),
gh_double2scm (slope),
gh_double2scm (thick),
SCM_UNDEFINED));
- m.add_atom (at->self_scm_);
+ m.add_atom (at);
return m;
}
l = gh_cons (ly_offset2scm (b.control_[i]), l);
}
- Atom *at = new Atom(gh_list (ly_symbol2scm ("dashed-slur"),
+ SCM at = (gh_list (ly_symbol2scm ("dashed-slur"),
gh_double2scm (thick),
gh_double2scm (dash),
ly_quote_scm (l),
SCM_UNDEFINED));
Molecule m;
- m.add_atom (at->self_scm_);
+ m.add_atom (at);
return m;
}
{
Molecule m;
- Atom* at = new Atom(gh_list (ly_symbol2scm ("filledbox"),
+ SCM at = (gh_list (ly_symbol2scm ("filledbox"),
gh_double2scm (-b[X_AXIS][LEFT]),
gh_double2scm (b[X_AXIS][RIGHT]),
gh_double2scm (-b[Y_AXIS][DOWN]),
SCM_UNDEFINED));
m.dim_ = b;
- m.add_atom (at->self_scm_);
+ m.add_atom (at);
return m;
}
m.dim_ = metric_l->text_dimension (text);
- Atom *at = new Atom (gh_list (ly_symbol2scm ("text"),
+ SCM at = (gh_list (ly_symbol2scm ("text"),
ly_str02scm (text.ch_C()),
SCM_UNDEFINED));
- at->fontify (metric_l);
+ at = fontify_atom (metric_l,at);
- m.add_atom (at->self_scm_);
+ m.add_atom (at);
return m;
}
nm = ly_scm2string (gh_cdr (l));
nm += to_str (staff_size);
SCM e =gh_list (ly_symbol2scm ("char"), gh_int2scm (idx), SCM_UNDEFINED);
- Atom *at = new Atom (e);
+ SCM at = (e);
- at->fontify (all_fonts_global_p->find_font (nm));
+ at = fontify_atom (all_fonts_global_p->find_font (nm), at);
m.dim_[Y_AXIS] = Interval (-y/2,y/2);
m.dim_[X_AXIS] = Interval (0,0);
- m.add_atom (at->self_scm_);
+ m.add_atom (at);
return m;
}
}
- Atom *at = new Atom (gh_list (ly_symbol2scm ("bezier-sandwich"),
+ SCM at = (gh_list (ly_symbol2scm ("bezier-sandwich"),
ly_quote_scm (list),
gh_double2scm (linethick),
SCM_UNDEFINED));
Molecule m;
m.dim_[X_AXIS] = curve.extent (X_AXIS);
m.dim_[Y_AXIS] = curve.extent (Y_AXIS);
- m.add_atom (at->self_scm_);
+ m.add_atom (at);
return m;
}
Lookup::staff_bracket (Real height, Paper_def* paper_l)
{
Molecule m;
- Atom *at = new Atom ( gh_list (ly_symbol2scm ("bracket"),
+ SCM at = ( gh_list (ly_symbol2scm ("bracket"),
gh_double2scm (paper_l->get_var("bracket_arch_angle")),
gh_double2scm (paper_l->get_var("bracket_arch_width")),
gh_double2scm (paper_l->get_var("bracket_arch_height")),
gh_double2scm (paper_l->get_var("bracket_thick")),
SCM_UNDEFINED));
- m.add_atom (at->self_scm_);
+ m.add_atom (at);
m.dim_[Y_AXIS] = Interval (-height/2,height/2);
m.dim_[X_AXIS] = Interval (0,4 PT);
void
Paper_score::process ()
{
-
print ();
progress_indication (_ ("Preprocessing elements...") + " ");
line_l_->breakable_col_processing ();
Score_element *sc = unsmob_element (gh_car (s));
sc->handle_broken_dependencies ();
}
-
+
outputter_l_ = new Paper_outputter ;
outputter_l_->output_header ();
Real y0 = c.control_ [0][Y_AXIS];
c.control_[2][Y_AXIS] =
c.control_[1][Y_AXIS] =
- (c.control_[1][Y_AXIS] - y0) * (newy / y) + y0;
+ (c.control_[1][Y_AXIS] - y0) * ((newy - y0) / (y - y0)) + y0;
}
else
programming_error ("Tie is nowhere horizontal");
{
Real gap = paper_l () -> get_var ("tuplet_spanner_gap");
Real height = staff_space;
- Atom *at = new Atom (gh_list(ly_symbol2scm ("tuplet"),
+ SCM at =gh_list(ly_symbol2scm ("tuplet"),
gh_double2scm (height),
gh_double2scm (gap),
gh_double2scm (w),
gh_double2scm (dy),
gh_double2scm (thick),
gh_int2scm (dir),
- SCM_UNDEFINED));
+ SCM_UNDEFINED);
- mol_p->add_atom (at->self_scm_);
+ mol_p->add_atom (at);
}
mol_p->translate_axis (dir * staff_space, Y_AXIS);
}
}
+
+
/*
use first -> last note for slope, and then correct for disturbing
notes in between. */
Direction d = directional_element (this).get ();
- *dy = column_arr.top ()->extent (Y_AXIS) [d]
- - column_arr[0]->extent (Y_AXIS) [d];
+
+ /*
+ Use outer non-rest columns to determine slope
+ */
+ int l = 0;
+ while (l <column_arr.size() && column_arr[l]->rest_b())
+ l ++;
+
+ int r = column_arr.size ()- 1;
+ while (r >= l && column_arr[r]->rest_b())
+ r--;
+
+ if (l < r)
+ {
+ *dy = column_arr[r]->extent (Y_AXIS) [d]
+ - column_arr[l]->extent (Y_AXIS) [d];
+ }
+ else
+ * dy = 0;
+
*offset = - d * infinity_f;
}
}
+/*
+ use first -> last note for slope,
+*/
+void
+Tuplet_spanner::calc_dy (Real * dy) const
+{
+ Link_array<Note_column> column_arr=
+ Group_interface__extract_elements (this, (Note_column*)0, "columns");
+
+
+ Direction d = directional_element (this).get ();
+ *dy = column_arr.top ()->extent (Y_AXIS) [d]
+ - column_arr[0]->extent (Y_AXIS) [d];
+}
+
void
Tuplet_spanner::do_post_processing ()
{
}
Real dy, offset;
- calc_position_and_height (&offset, &dy);
+calc_position_and_height (&offset,&dy);
+ // calc_position (&offset, dy);
+
set_elt_property ("delta-y", gh_double2scm (dy));
translate_axis (offset, Y_AXIS);
Molecule volta;
- Atom *at = new Atom(gh_list (ly_symbol2scm ("volta"),
+ SCM at = (gh_list (ly_symbol2scm ("volta"),
gh_double2scm (h),
gh_double2scm (w),
gh_double2scm (t),
volta.dim_[Y_AXIS] = Interval (- h/2, h/2);
volta.dim_[X_AXIS] = Interval (0, w);
- volta.add_atom (at->self_scm_);
+ volta.add_atom (at);
Molecule num (lookup_l ()->text ("volta",
ly_scm2string (get_elt_property("text")),
all: $(OUT_FILES)
local-WWW: $(ly_examples) $(fly_examples) $(ps_examples) $(png_examples)
- (cd $(outdir); $(PYTHON) ../$(buildscripts)/mutopia-index.py --prefix=../ --suffix=/$(outdir) $(html_subdirs) $(all_examples))
- echo $^ > $(depth)/wwwlist
+# (cd $(outdir); $(PYTHON) ../$(buildscripts)/mutopia-index.py --prefix=../ --suffix=/$(outdir) $(html_subdirs) $(all_examples))
+# echo $^ > $(depth)/wwwlist
# $(footify) $(outdir)/index.html
local-web:
$(MAKE) CONFIGSUFFIX='www' -C input WWW
$(MAKE) CONFIGSUFFIX='www' -C mutopia WWW
$(footify-all-command)
+ $(PYTHON) $(buildscripts)/mutopia-index.py -o short-examples.html input/
+ $(PYTHON) $(buildscripts)/mutopia-index.py -o long-examples.html mutopia/
+
+
tar --exclude='*.dvi' --exclude='*.tex' --exclude='*.ps' --exclude='*.ppm' -czf $(outdir)/examples.tar.gz `find input mutopia -type d -name 'out-www' -print`
localinstall:
(map (lambda (x)
(font-load-command (car x) (cdr x))) font-name-alist)
))
-
+
+(define (fontify name exp)
+ (string-append (select-font name)
+ exp)
+ )
+
;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;; generic output
+(define (translate-atom offset exp)
+ exp)
;;;;;;;;;;;;;;;;;;; TeX output
this.write(r"""
%% \vfill\hfill{\mudelatagline}
\makeatletter
-\renewcommand{\@oddfoot}{\mudelatagline}%
+\renewcommand{\@oddfoot}{\hfil\mudelatagline}%
\makeatother
\end{document}
""")