Grep -i for TODO, FIXME and ugh/ugr/urg.
.* TODO
-. * make this file understandable for 3rd parties.
-. * break align order from SCM list.
+. * agressive type-checking for SCM stuff.
+. * TODO^2:
+. *make a TODO.texi, like http://www.gnu.org/software/guile/ideas.html
+. * make this file understandable for 3rd parties.
. * \accepts -> \acceptedby
. * context in embedded SCM errors.
. * eradicate all VIRTUAL_COPY_CONS () macros ; use indexed creation,
ctor_dict["Score_element"]->clone_func (orig);
ctor_dict["Score_element"]->create_func ();
-
. * acc at tied note after linebreak.
. * fix font-naming and selecting
. * fix naming: \interline Context.staffLineLeading, staff_line_leading (),
. * chord tonic: placement of accidental C#, Cb (from scm and C++)
. * note head on stem err msg in dutch.
. * why need to run -C mf twice?
-. * setting indent to 0 with \shape fails
. * here's no difference at all in output. When either is jacked up to 7.0,
everything works and matches up; when either is set just a bit above the
default 5.0 (5.4 is what I was hoping to use), stems miss note heads. So
it's some sort of a numerical (truncation/roundoff) problem.
John
+. * fix #'margin-shape; setting indent to 0 with \shape fails
. * Fixed size staff/system heights;
-. * ly2dvi : don't repeat opus if same.
-. * breaks before mmrests are favored.
-. * hara kiri _8 clef.
-. * junk -M ?
+. *
+. * ly2dvi : don't repeat opus if same.
+. * hara kiri _8 clef.
+. * junk -M ?
. * mudela-book doco
. * fix or replace feta-accordion.mf
. * script engraver
. * bracket pdf hack
-
. * Mondrup:
-- I would like an option to define the number of systems on which the
-score must be distributed. As it is now it seems that I may only
-influence that indirectly through the gourlay_maxmeasures property.
-
- 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.
. * make all Feta (including dynamics) available to the user in
textual scripts. Examples: "D.S. al \coda", "\mf espress.".
-. * Write script that uses --find-old-relative to do auto relativization.
+. * Write script that uses --find-old-relative to do auto relativization.
. * Junk shared cruft (duration, moment) in lib/
.* Cleanups needed
-. * \$ and $ identifier syntax in examples.
+. * \$ and $ identifier syntax in examples.
. * Junk ghost positioning objects eg, Script leans on Staffside
leans on Staff.
-. * bracket ps code.
. * Key_engraver, Local_key_item
. * Think of comprehensive solution for "if (grace_b == self_grace_b_)"
. * String[String.length] doesn't trap.
. * junk Music_iterator::first_b_
. * Bezier
+.* ACCIDENTALS
+. * half-sharps, half-flats
+. * adaptive accidental spacing.
+. * accidentals closer to note head
+
+
.* Beams
. * [c8. c16 c16 c16] in 6/8 timesig.
. * Rewrite Stem, Beam (hairy)
In bar 27, there's a crescendo that's supposed to start at the start
of the grace notes and extend to the note after the grace notes.
-. * 5. Sometimes lyrics extend past the right end of the staff. I guess that
-this is a similar problem (if not another symptom of the same problem) as
-one of the spacing bugs mentioned in the TODO.
-. * 4. Lyrics and grace sections don't go too well together.
- The words are aligned with the main note, not the start of the
- grace note. This is usually wrong, but is sometimes right.
-. * decimal point in \paper {}
+. * 4. Lyrics and grace sections don't go too well together.
+ The words are aligned with the main note, not the start of the
+ grace note. This is usually wrong, but is sometimes right.
. * tie-direction
. * repeats and partial measures.
. * rhythmic staff & accidentals.
. * Matanya's tips:
. * don't shorten stems/staffs closer to each other.
-. * accidentals closer to note head
. * to space the staffs/staffgroups contained in the score.
. * heavier beams?
. * split error/warning in error/warning/non_fatal_error
. * add a Duration_convert member to Duration_iter to set parameters.
Junk global duration settings.
-. * en-,discouraged linebreaking:
-. * handle DISALLOW < penalty > FORCE
. * discourage breaking of slurs
. * fix variable define/lookup parser global<->paper
. * fix title/instrument placements; see input/test/title.ly
. * I'd like to change the \repetitions command to Jan's suggested
syntax: \repeat "repeatsymbol" 2 {...}, but I'm not sure that
I understand the implementation of repeats well enough.
-. * add full cello suites to web site (kom op, Maarten!)
. * add mudela-book-doc source to webstie.
-. * Rethink Time_description
-\cadenza , \meter, should all be \properties
. * fix singleStaffBracket
. * rename
. * partial -> anacrouse
. * move paper vars into engraver properties
. * add new glyphs to font.ly
-. * check for groff / troff/ nroff et
. * more intelligent file searching
. * disable spaces in TeX stuff
. * handle ^C for tmp/file creation.
touching it.
. * put errorlevel in Input class
. * junk nesting slurs
-. * distinguish between unset and empty properties.
+
.* FONT
. * the bracket is ugly (wings are too parabolic, should be more circular)
. * patch: don't touch timestamp if all patches fail.
. * MetaPost: should not generate setgray for unfill
-. * mfplain.ini not in tetex 0.9
+
. * mf-to-table -> add space 'before ; in AFM output. (-> check AFM
spec. Is this a bug in afm2tfm?)
. * check out GCC signatures?
. * glibc 2.0:
f = fopen ("/dev/null", "r")
assert (feof (f))
-. * tetex: mfplain.mem
+. * tetex: mfplain.mem -> INSTALL
+. * mfplain.ini not in tetex 0.9 -> INSTALL
+
.* PROJECTS
. * Scripts:
. * stack parameterised scripts for fingering and footing:
. * convert-mudela:
-. * automatically add a \version if not present.
. * better parsing
. * make smarter
. * convert-mudela -e empty.ly
. * use properties for:
. * default tempo.
-. * cadenza mode?
. * page handling:
. * PS output
. * \header
. * output header info to MIDI too.
+. * dump \header into easily parsable format.
. * a musical dictionary. See Documentation/vocabulary-*, other
languages:
. * speed up PS code.
. * PS lines to .eps files
. * write custom prolog
+. * fix ps font switching
. * more spanners (smallish)
. * Glissando
. * should adjust stemlength for flag number.
. * breaking:
-. * saving them
. * specify number of lines
.* INPUTLANGUAGE
.* SMALLISH PROJECTS
-. * A range for context errors (eg. mark both { and }. )
-
. * lyric in staff (sharpsharp in staff, text below)
. * write Dynamic_line (to group dynamics horizontally)
-. * half-sharps, half-flats
-
-. * adaptive accidental spacing.
. * handle EOF graciously in error messages.
(where "to" is a tiny bow)
. * auxilliary file for caching info.
+
. * Text_crescendo
.* IDEAS
. * Output data structures of Mudela in XML/SGML.
. * create libmudela, or liblily_frontend
. * move MIDI stuff (including Quantization) to a ANSI C libmidi library.
-. * Spacing_request for manually adjusting spacing
-. * caching breakpoints
-. * used fixedpoint arithmetic for min. energy.
* OUTLINE SETUP
.* .EMACS
echo
(set -x; TEX_TFMDIR=$TEX_TFMDIR ./configure --prefix=$prefix --enable-debugging --enable-printing --enable-checking --disable-optimise)
+echo "making tags in background"
+make TAGS >& log &
+/*
+ all-font-metrics.cc -- implement All_font_metrics
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
#include "main.hh"
-#include "all-fonts.hh"
+#include "all-font-metrics.hh"
#include "debug.hh"
#include "warn.hh"
#include "afm.hh"
#include "tfm.hh"
+#include "dictionary-iter.hh"
+#include "lily-guile.hh"
+#include "tfm-reader.hh"
const char * default_font_sz_ = "cmr10";
*mlog << "[" << path;
Adobe_font_metric
* afm_p = new Adobe_font_metric (read_afm_file (path));
+
+ afm_p->name_str_ = name;
+
*mlog << "]" << flush ;
afm_p_dict_[name] = afm_p;
return afm_p_dict_[name];
}
+Scaled_font_metric *
+All_font_metrics::find_scaled (String nm, int m)
+{
+ Scaled_font_metric * s=0;
+ String index = nm + "@" + to_str (m);
+ if (!scaled_p_dict_.elem_b (index))
+ {
+ Font_metric *f = find_font (nm);
+ s = new Scaled_font_metric (f, m);
+ scaled_p_dict_[index] = s;
+ return s;
+ }
+ else
+ return scaled_p_dict_[index];
+}
+
Tex_font_metric *
All_font_metrics::find_tfm (String name)
{
path = search_path_.find (path);
if (path.empty_b ())
return 0;
-
+
*mlog << "[" << path;
- Tex_font_metric * tfm_p = new Tex_font_metric;
- tfm_p->read_file (path);
+ Tex_font_metric * tfm_p = Tex_font_metric_reader::read_file (path);
+ tfm_p->name_str_ = name;
+
*mlog << "]" << flush ;
tfm_p_dict_[name] = tfm_p;
error (_f ("(search path: `%s'", search_path_.str ()));
error (_ ("Giving up"));
}
+
+SCM
+All_font_metrics::font_descriptions () const
+{
+ SCM l = SCM_EOL;
+ for (Dictionary_iter<Adobe_font_metric*> ai(afm_p_dict_); ai.ok (); ai++)
+ l = gh_cons (ai.val ()->description (), l);
+ for (Dictionary_iter<Tex_font_metric*> ai(tfm_p_dict_); ai.ok (); ai++)
+ l = gh_cons(ai.val ()->description (), l);
+
+ for (Dictionary_iter<Scaled_font_metric*> ai(scaled_p_dict_); ai.ok (); ai++)
+ l = gh_cons (ai.val ()->description (),l);
+
+ return l;
+}
#include "lookup.hh"
#include "main.hh"
#include "global-ctor.hh"
+#include "font-metric.hh"
Atom::Atom(SCM s)
{
func_ = s;
- magn_ = gh_int2scm (0);
+}
+
+void
+Atom::fontify (Font_metric * met)
+{
+
+ SCM desc = ly_quote_scm (met->description ());
+ SCM font_switch = gh_list (ly_symbol2scm ("select-font"),
+ desc,
+ SCM_UNDEFINED);
+
+ SCM f =func_;
+ func_ = gh_list (ly_symbol2scm ("string-append"),
+ font_switch , f,
+ SCM_UNDEFINED);
+
}
axis_ = Y_AXIS;
type_ = "barNumber";
visibility_lambda_
- = ly_ch_C_eval_scm ("postbreak-only-visibility");
+ = ly_eval_str ("postbreak-only-visibility");
}
void
text_p_ =0;
hang_on_clef_b_ = false;
visibility_lambda_
- = ly_ch_C_eval_scm ("non-postbreak-visibility");
+ = ly_eval_str ("non-postbreak-visibility");
}
void
break;
}
}
+
+
if (remove_elt_property ("at-line-start") == SCM_BOOL_T // UGR.
&& (break_status_dir () == RIGHT) && (type_str_ == ""))
{
String visnam = String(name()) + "-visibility";
spanbar_p_->set_elt_property ("visibility-lambda",
- ly_ch_C_eval_scm (visnam.ch_C()));
+ ly_eval_str (visnam.ch_C()));
if (use_priority_b_)
{
SCM a = get_elt_property ("beam-dir-algorithm");
- if (a == gh_symbol2scm ("majority")) // should get default from paper.
+ if (a == ly_symbol2scm ("majority")) // should get default from paper.
beam_dir = (count[UP] == count[DOWN]) ? neutral_dir
: (count[UP] > count[DOWN]) ? UP : DOWN;
- else if (a == gh_symbol2scm ("mean"))
+ else if (a == ly_symbol2scm ("mean"))
// mean center distance
beam_dir = (total[UP] == total[DOWN]) ? neutral_dir
: (total[UP] > total[DOWN]) ? UP : DOWN;
- else if (a == gh_symbol2scm ("median"))
+ else if (a == ly_symbol2scm ("median"))
{
// median center distance
if (count[DOWN] && count[UP])
{
Real interbeam_f = paper_l ()->interbeam_f (multiple_i_);
- Real beam_f = paper_l ()->get_var ("beam_thickness");;
+ Real beam_f = gh_scm2double (get_elt_property ("beam-thickness"));
Real staffline_f = paper_l ()-> get_var ("stafflinethickness");
Real epsilon_f = staffline_f / 8;
Real dy_f = 0.0;
SCM q = get_elt_property ("slope-quantisation");
- if (q == gh_symbol2scm ("none"))
+ if (q == ly_symbol2scm ("none"))
return;
Real interline_f = stems_[0]->staff_line_leading_f ();
Real internote_f = interline_f / 2;
Real staffline_f = paper_l ()->get_var ("stafflinethickness");
- Real beam_f = paper_l ()->get_var ("beam_thickness");;
+ Real beam_f = gh_scm2double (get_elt_property ("beam-thickness"));;
Real dx_f = stems_.top ()->hpos_f () - stems_[0]->hpos_f ();
Real space = stems_[0]->staff_line_leading_f ();
Real internote_f = space /2;
Real staffline_f = paper_l ()->get_var ("stafflinethickness");
- Real beam_f = paper_l ()->get_var ("beam_thickness");;
+ Real beam_f = gh_scm2double (get_elt_property ("beam-thickness"));;
/*
[TODO]
Real beamdy_f = beamdx_f * slope_f_ * internote_f;
Array<Real> allowed_position;
- if (q == gh_symbol2scm ("normal"))
+ if (q == ly_symbol2scm ("normal"))
{
if ((multiple_i_ <= 2) || (abs (beamdy_f) >= staffline_f / 2))
allowed_position.push (straddle);
allowed_position.push (sit);
allowed_position.push (hang);
}
- else if (q == gh_symbol2scm ("traditional"))
+ else if (q == ly_symbol2scm ("traditional"))
{
// TODO: check and fix TRADITIONAL
if ((multiple_i_ <= 2) || (abs (beamdy_f) >= staffline_f / 2))
Real interbeam_f = paper_l ()->interbeam_f (multiple_i_);
Real internote_f = here->staff_line_leading_f ()/2;
- Real beam_f = paper_l ()->get_var ("beam_thickness");;
+ Real beam_f = gh_scm2double (get_elt_property ("beam-thickness"));;
Real dy = interbeam_f;
Real stemdx = staffline_f;
/*
Handle spacing for prefatory matter.
-
-
TODO: rewrite this. It is kludgy
*/
next_origin = ly_str02scm ("begin-of-note");
SCM extra_space
- = scm_eval (scm_listify (ly_symbol ("break-align-spacer"),
+ = scm_eval (scm_listify (ly_symbol2scm ("break-align-spacer"),
current_origin, next_origin, SCM_UNDEFINED));
SCM symbol = SCM_CAR (extra_space);
Real spc = gh_scm2double (SCM_CADR(extra_space));
Real stretch_distance =0.;
- if (SCM_CAR (symbol_list) == gh_symbol2scm ("extra-space"))
+ if (SCM_CAR (symbol_list) == ly_symbol2scm ("extra-space"))
{
spring_len += dists.top ();
stretch_distance = dists.top ();
}
- else if (SCM_CAR (symbol_list) == gh_symbol2scm ("minimum-space"))
+ else if (SCM_CAR (symbol_list) == ly_symbol2scm ("minimum-space"))
{
spring_len = spring_len >? dists.top ();
stretch_distance = spring_len;
Molecule
Chord::pitch2molecule (Musical_pitch p) const
{
- SCM name = scm_eval (gh_list (gh_symbol2scm ("user-pitch-name"), ly_quote_scm (pitch2scm (p)), SCM_UNDEFINED));
+ SCM name = scm_eval (gh_list (ly_symbol2scm ("user-pitch-name"), ly_quote_scm (pitch2scm (p)), SCM_UNDEFINED));
if (name != SCM_UNSPECIFIED)
{
}
Molecule mol = lookup_l ()->text ("", p.str ().left_str (1).upper_str (), paper_l ());
+
+ /*
+ We want the smaller size, even if we're big ourselves.
+ */
if (p.accidental_i_)
mol.add_at_edge (X_AXIS, RIGHT,
- paper_l ()->lookup_l (-2)->accidental (p.accidental_i_, 0), 0);
+
+ paper_l ()->lookup_l (-2)->afm_find (String ("accidentals-") + to_str (p.accidental_i_)), 0.0);
return mol;
}
for (int i= chord_type.size (); i--; )
chord = gh_cons (pitch2scm (chord_type[i]), chord);
- SCM name = scm_eval (gh_list (gh_symbol2scm ("user-chord-name"), ly_quote_scm (chord), SCM_UNDEFINED));
+ SCM name = scm_eval (gh_list (ly_symbol2scm ("user-chord-name"), ly_quote_scm (chord), SCM_UNDEFINED));
if (name != SCM_UNSPECIFIED)
{
name_p->modifier_mol = ly_text2molecule (gh_car (name));
create_clef();
if(!default_clef)
clef_p_->set_elt_property("visibility-lambda",
- ly_ch_C_eval_scm ("all-visibility"));
+ ly_eval_str ("all-visibility"));
}
/* ugh; should make Clef_referenced baseclass */
Molecule*
Clef_item::do_brew_molecule_p() const
{
- Molecule*output = new Molecule (lookup_l ()->clef (symbol_));
+ Molecule*output = new Molecule (lookup_l ()->afm_find (String ("clefs-" + symbol_)));
+
return output;
}
This should be done better, probably.
- TODO: forced hshift
-
*/
Array< Shift_tup >
Collision::automatic_shift ()
Dots::Dots ()
{
dots_i_ =0;
- resolve_dir_ =CENTER;
}
void
Dots::do_post_processing ()
{
- if (!resolve_dir_)
- resolve_dir_ = UP;
-
- if (!(position_i_ % 2))
- position_i_ += resolve_dir_;
-
if (!dots_i_)
{
set_elt_property ("transparent", SCM_BOOL_T);
set_empty (true, X_AXIS, Y_AXIS);
}
-}
+ else
+ {
+ if (!get_direction ())
+ set_direction (UP);
+ int p = int (position_f ());
+ if (!(p % 2))
+ set_position (p + get_direction ());
+ }
+}
Molecule*
Dots::do_brew_molecule_p () const
{
Interval (0,0)));
out->add_molecule (fill);
- Molecule d = lookup_l ()->dots ();
+ Molecule d = lookup_l ()->afm_find (String ("dots-dot"));
Real dw = d.dim_[X_AXIS].length ();
d.translate_axis (-dw, X_AXIS);
d.translate_axis (2*dw,X_AXIS);
out->add_molecule (d);
}
- out->translate_axis (staff_line_leading_f () * position_i_ /2., Y_AXIS);
+
return out;
}
--- /dev/null
+/*
+ font-metric.cc -- implement Font_metric
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include <math.h>
+#include <ctype.h>
+
+
+#include "font-metric.hh"
+
+Box
+Font_metric::text_dimension (String text) const
+{
+ Interval ydims;
+ Real w=0.0;
+
+ for (int i = 0; i < text.length_i (); i++)
+ {
+
+ if (text[i]=='\\')
+ {
+ for (i++; (i < text.length_i ()) && isalpha(text[i]); i++)
+ ;
+ // ugh.
+ i--; // Compensate for the increment in the outer loop!
+ }
+ else
+ {
+ Character_metric const *c = get_char ((unsigned char)text[i],false);
+
+ // Ugh, use the width of 'x' for unknown characters
+ if (c->dimensions()[X_AXIS].length () == 0)
+ c = get_char ((unsigned char)'x',false);
+
+ w += c->dimensions()[X_AXIS].length ();
+ ydims.unite (c->dimensions()[Y_AXIS]);
+ }
+ }
+ if (ydims.empty_b ())
+ ydims = Interval (0,0);
+
+ return Box(Interval (0, w), ydims);
+}
+
+
+Box
+Scaled_font_metric::text_dimension (String t) const
+{
+ Real realmag = pow (1.2, magstep_i_);
+ Box b (orig_l_->text_dimension (t));
+
+ return Box(b[X_AXIS]* realmag, b[Y_AXIS]*realmag);
+}
+
+
+Box
+Character_metric::dimensions () const
+{
+ return Box(Interval(0,0), Interval(0,0));
+}
+
+Font_metric::~Font_metric ()
+{
+}
+
+Character_metric::~Character_metric()
+{
+}
+
+Character_metric const *
+Font_metric::get_char (int, bool)const
+{
+ return 0;
+}
+
+Scaled_font_metric::Scaled_font_metric (Font_metric* m, int s)
+{
+ magstep_i_ = s;
+ orig_l_ = m;
+}
+
+SCM
+Font_metric::description () const
+{
+ return gh_cons (ly_symbol2scm (name_str_.ch_C()), gh_int2scm (0));
+}
+
+
+SCM
+Scaled_font_metric::description () const
+{
+ SCM od = orig_l_->description ();
+ gh_set_cdr_x (od, gh_int2scm (magstep_i_));
+ return od;
+}
#include "grace-align-item.hh"
#include "lookup.hh"
#include "paper-column.hh"
+#include "paper-def.hh"
Grace_align_item::Grace_align_item ()
{
void
Grace_align_item::do_pre_processing ()
{
- Real nhw = lookup_l ()->notehead (2, "").dim_[X_AXIS].length();
+ Real nhw = // lookup_l ()->notehead (2, "").dim_[X_AXIS].length();
+ paper_l ()->get_var ("quartwidth");
+
threshold_interval_[MIN] = nhw* 1.5;
column_l ()->set_elt_property ("contains-grace", SCM_BOOL_T);
--- /dev/null
+/*
+ all-fonts.hh -- declare All_font_metrics
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef ALL_FONTS_HH
+#define ALL_FONTS_HH
+
+#include "dictionary.hh"
+#include "file-path.hh"
+#include "lily-proto.hh"
+#include "font-metric.hh"
+#include "lily-guile.hh"
+
+/**
+ Interface to all .afm files living in the filesystem.
+ */
+class All_font_metrics
+{
+ Dictionary<Adobe_font_metric*> afm_p_dict_;
+ Dictionary<Tex_font_metric*> tfm_p_dict_;
+ Dictionary<Scaled_font_metric*> scaled_p_dict_;
+ File_path search_path_;
+public:
+
+ Adobe_font_metric *find_afm (String name);
+ Tex_font_metric *find_tfm (String);
+ Font_metric *find_font (String name);
+ Scaled_font_metric* find_scaled (String , int);
+
+ All_font_metrics (String search_path);
+
+ SCM font_descriptions () const;
+};
+
+
+
+
+#endif /* ALL_FONTS_HH */
+
#include "lily-guile.hh"
class Atom {
+ Offset off_;
+ friend class Molecule;
+ friend class Paper_outputter;
public:
Atom (SCM s);
- Offset off_;
+
/*
SCM expression that (when evaluated) gives a TeX string
representing a musical notation symbol. */
Protected_scm func_;
- Protected_scm font_;
-
- /*
- TODO: move this into the font_ field.
- */
- Protected_scm magn_;
+ void fontify (Font_metric*);
};
#include "item.hh"
#include "staff-symbol-referencer.hh"
+#include "directional-element.hh"
+
/**
The dots to go with a notehead/rest. A separate class, since they
are a party in collision resolution.
*/
-class Dots : public Item, public Staff_symbol_referencer
+class Dots : public Item, public Staff_symbol_referencer,
+ public Directional_element
{
protected:
virtual Molecule * do_brew_molecule_p () const;
virtual void do_post_processing ();
public:
int dots_i_;
- Direction resolve_dir_;
Dots ();
};
#define FONT_METRIC_HH
#include "box.hh"
-/*
- sigh.
-
- signature -> Internal compiler error
-*/
+#include "lily-guile.hh"
struct Character_metric
{
- virtual Box dimensions () const=0;
- virtual ~Character_metric () {}
+ virtual Box dimensions () const;
+ virtual ~Character_metric ();
};
struct Font_metric
{
- virtual Character_metric const *get_char (int ascii, bool warn) const=0;
- virtual ~Font_metric () {}
+ String name_str_;
+ virtual SCM description () const;
+ virtual Character_metric const *get_char (int ascii, bool warn) const;
+ virtual ~Font_metric ();
+ virtual Box text_dimension (String) const;
};
+struct Scaled_font_metric : public Font_metric
+{
+ Font_metric *orig_l_;
+ int magstep_i_;
+
+ Scaled_font_metric (Font_metric*, int);
+ virtual SCM description () const;
+ virtual Box text_dimension (String) const;
+};
#endif /* FONT_METRIC_HH */
#include "direction.hh"
SCM ly_str02scm (char const*c);
-SCM ly_ch_C_eval_scm (char const*c);
-SCM ly_symbol (String name);
-String symbol_to_string (SCM);
-SCM ly_set_scm (String name , SCM val);
+SCM ly_eval_str (char const*c);
+SCM ly_symbol2scm (char const *);
+String ly_symbol2string (SCM);
+SCM ly_set_x (String name , SCM val);
SCM ly_append (SCM a, SCM b);
SCM ly_eval (SCM a);
struct Extender;
struct Extender_req;
struct Folded_repeat_iterator;
+struct Font_metric;
struct General_script_def;
struct Global_translator;
struct Grace_align_item;
/**
Accidentals which can be different for each octave.
- TODO:
- update item if Items are removed
-
- TODO
- figure out private/public
+ TODO
+
+ Make an item for each accidental separately, and make a
+ Accidental_column to group them.
*/
+
class Local_key_item : public Note_head_side, public Staff_symbol_referencer {
Array<Local_key_cautionary_tuple> accidental_arr_;
+ Molecule accidental (int,bool) const;
public:
int c0_position_i_;
Local_key_item ();
Lookup (Lookup const&);
Molecule simple_bar (String s, Real w, Paper_def*) const;
- Molecule accidental (int, bool cautionary) const;
Molecule afm_find (String, bool warn=true) const;
- Molecule notehead (int, String) const;
Molecule bar (String, Real height, Paper_def*) const;
Molecule beam (Real, Real, Real) const;
- Molecule clef (String) const;
Molecule dashed_slur (Array<Offset> controls, Real thick, Real dash) const;
- Molecule dots () const;
Molecule ledger_line (Interval) const;
Molecule fill (Box b) const;
Molecule filledbox (Box b) const;
Molecule hairpin (Real width, Real height, Real thick, bool decresc, bool continued) const;
Molecule tuplet_bracket (Real dy, Real dx, Real gap, Real thick,Real height, Direction dir) const;
- Molecule rest (int, bool outside, String) const;
Molecule accordion (SCM arg, Real interline_f) const;
Molecule slur (Array<Offset> controls, Real thick) const;
Molecule text (String style, String text, Paper_def*) const;
SCM_SETCDR(s,me_p); \
scm_protect_object (s); \
\
+/* no scm_done_malloc() ! */ \
do_smobify_self(); \
return s; \
} \
return 0; \
SCM_CAR(ses) = SCM_EOL;\
\
- return sizeof(CL); \
+ return 0;\
} \
ADD_SCM_INIT_FUNC(CL, CL::init_smobs)\
void flip_around_stem (Direction);
static int compare (Note_head * const &a, Note_head *const &b) ;
protected:
+ Molecule make_molecule () const;
+
+
virtual Interval do_width () const;
virtual void do_pre_processing();
virtual Molecule* do_brew_molecule_p() const;
static void reset_default_count();
void output_settings (Paper_outputter*) const;
- Paper_outputter* paper_outputter_p (Paper_stream*, Scope*, String) const;
+
Paper_stream* paper_stream_p () const;
String base_output_str () const;
#include "array.hh"
#include "string.hh"
#include "lily-guile.hh"
+#include "protected-scm.hh"
#ifdef __powerpc__
#include "protected-scm.hh"
class Paper_outputter
{
public:
- Paper_outputter (Paper_stream *);
- ~Paper_outputter ();
+ Protected_scm molecules_;
+ SCM last_cons_;
+ Paper_outputter ();
+
+ void dump_onto (Paper_stream *);
+
void output_int_def (String k, int v);
void output_Real_def (String k, Real v);
void output_molecule (Molecule const *, Offset, char const *);
void output_comment (String s);
void output_scheme (SCM scm);
+
void start_line (Real height);
void stop_line ();
void stop_last_line ();
- void switch_to_font (String fontname);
-
- Paper_stream* outstream_l_;
};
#endif // PAPER_OUTPUTTER_HH
*/
class Staff_symbol_referencer : public virtual Score_element
{
+ int position_i_;
protected:
Staff_symbol * staff_sym_l_;
- int position_i_;
+
public:
Staff_symbol_referencer ();
void set_position (int);
class Tex_font_metric_reader
{
public:
- Tex_font_metric_reader (String name);
- Tex_font_metric read_tfm ();
+ static Tex_font_metric * read_file (String name);
private:
+ Tex_font_metric_reader (Tex_font_metric *, String name);
+
Real get_U32_fix_f ();
Real get_U32_fix_scaled_f ();
String get_bcpl_str ();
Tex_font_char_metric read_char ();
void read_lig_kern_program (Array<Tfm_ligature>* ligature_arr_p, Array <Tfm_kern>* kern_arr_p);
- Tex_font_metric tfm_;
+ Tex_font_metric *tfm_l_;
Binary_source_file input_;
};
void clear (int n);
Character_metric const *get_char (int, bool) const;
Tex_font_char_metric const &find_ascii (int ascii, bool warn=true) const;
- void read_file (String name);
+
String str () const;
Tfm_info info_;
if (!def)
{
item_p_->set_elt_property ("visibility-lambda",
- ly_ch_C_eval_scm ("all-visibility"));
+ ly_eval_str ("all-visibility"));
}
}
|| (old_pitch_arr_[i] == pitch_arr_[j]
&& old_acc_arr_[i] != acc_arr_[j]))
{
- Molecule m =lookup_l ()->accidental (0,false);
+ Molecule m =lookup_l ()->afm_find ("accidentals-0");
+
m.translate_axis (calculate_position(old_pitch_arr_[i], old_acc_arr_[i]) * inter, Y_AXIS);
output->add_at_edge (X_AXIS, RIGHT, m,0);
}
for (int i =0; i < pitch_arr_.size(); i++)
{
- Molecule m =lookup_l ()->accidental (acc_arr_[i],false);
+ Molecule m = lookup_l ()->afm_find ("accidentals-" + to_str (acc_arr_[i]));
m.translate_axis (calculate_position(pitch_arr_[i], acc_arr_[i]) * inter, Y_AXIS);
output->add_at_edge (X_AXIS, RIGHT, m, 0);
}
(c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- TODO
- transposition.
*/
#include "key.hh"
}
SCM
-ly_ch_C_eval_scm (char const*c)
+ly_eval_str (char const*c)
{
// this all really sucks, guile should take char const* arguments!
return gh_eval_str ((char*)c);
/*
scm_m_quote doesn't use any env, but needs one for a good signature in GUILE.
*/
-
+// apparently env arg is ignored.
SCM
ly_quote_scm (SCM s)
{
- return scm_m_quote (scm_cons2 (SCM_EOL, s, SCM_EOL) ,SCM_EOL); // apparently env arg is ignored.
+ return scm_m_quote (scm_cons2 (SCM_EOL, s, SCM_EOL) ,SCM_EOL);
}
-/*
- See: libguile/symbols.c
- SCM
- scm_string_to_symbol(s)
-
-*/
SCM
-ly_symbol (String name)
+ly_symbol2scm(const char *s)
{
- return gh_symbol2scm ((char*)name.ch_C());
+ return gh_symbol2scm ((char *)s);
}
String
-symbol_to_string (SCM s)
+ly_symbol2string (SCM s)
{
return String((Byte*)SCM_CHARS (s), (int) SCM_LENGTH(s));
}
+#if 0
SCM
-ly_set_scm (String name, SCM val)
+ly_set_x (String name, SCM val)
{
return scm_sysintern ((char*)name.ch_C(), val);
}
+#endif
/**
Read a file, and shove it down GUILE. GUILE also has file read
Simple_file_storage f(s);
- ly_ch_C_eval_scm ((char *) f.ch_C());
+ ly_eval_str ((char *) f.ch_C());
*mlog << "]" << flush;
}
Simple_file_storage f(s);
- return ly_str02scm (f.ch_C());
+ SCM result = ly_str02scm (f.ch_C());
+ *mlog << "]";
+ return result;
}
void
}
+
void
Local_key_item::do_pre_processing()
{
Note_head_side::do_pre_processing ();
}
+Molecule
+Local_key_item::accidental (int j, bool cautionary) const
+{
+ Molecule m (lookup_l ()->afm_find (String ("accidentals-") + to_str (j)));
+ if (cautionary)
+ {
+ Molecule open = lookup_l ()->afm_find (String ("accidentals-("));
+ Molecule close = lookup_l ()->afm_find (String ("accidentals-)"));
+ m.add_at_edge(X_AXIS, LEFT, Molecule(open), 0);
+ m.add_at_edge(X_AXIS, RIGHT, Molecule(close), 0);
+ }
+
+ return m;
+}
+
Molecule*
Local_key_item::do_brew_molecule_p() const
{
Real dy =
(c0_position_i_ + p.notename_i_)
* note_distance;
- Molecule m (lookup_l ()->accidental (p.accidental_i_,
- accidental_arr_[i].cautionary_b_));
+
+ Molecule m (accidental (p.accidental_i_, accidental_arr_[i].cautionary_b_));
m.translate_axis (dy, Y_AXIS);
octave_mol_p->add_at_edge (X_AXIS, RIGHT, m, 0);
#include "file-path.hh"
#include "main.hh"
#include "lily-guile.hh"
-#include "all-fonts.hh"
+#include "all-font-metrics.hh"
#include "afm.hh"
#include "scope.hh"
#include "molecule.hh"
}
-Molecule
-Lookup::accidental (int j, bool cautionary) const
-{
- Molecule m(afm_find (String ("accidentals-") + to_str (j)));
- if (cautionary)
- {
- Molecule open = afm_find (String ("accidentals-("));
- Molecule close = afm_find (String ("accidentals-)"));
- m.add_at_edge(X_AXIS, LEFT, Molecule(open), 0);
- m.add_at_edge(X_AXIS, RIGHT, Molecule(close), 0);
- }
- return m;
-}
-
Molecule
return m;
}
- Atom at (gh_list (gh_symbol2scm ("char"),
+ Atom at (gh_list (ly_symbol2scm ("char"),
gh_int2scm (cm.code ()),
SCM_UNDEFINED));
- at.font_ = ly_symbol (font_name_.ch_C());
- at.magn_ = gh_int2scm (0);
-
+
+ at.fontify (afm_l_);
m.dim_ = cm.dimensions();
m.add_atom (&at);
return m;
}
-Molecule
-Lookup::notehead (int j, String type) const
-{
- if (j > 2)
- j = 2;
- if (type == "harmonic" || type == "cross")
- j = 2;
-
- return afm_find (String ("noteheads-") + to_str (j) + type);
-}
-
Molecule
Lookup::simple_bar (String type, Real h, Paper_def* paper_l) const
{
- SCM thick = ly_symbol ("barthick_" + type);
+ SCM thick = ly_symbol2scm (("barthick_" + type).ch_C());
Real w = 0.0;
if (paper_l->scope_p_->elem_b (thick))
Molecule m;
Atom at
- (gh_list (gh_symbol2scm ("beam"),
+ (gh_list (ly_symbol2scm ("beam"),
gh_double2scm (width),
gh_double2scm (slope),
gh_double2scm (thick),
return m;
}
-Molecule
-Lookup::clef (String st) const
-{
- return afm_find (String ("clefs-" + st));
-}
-
SCM
offset2scm (Offset o)
{
}
Atom at
- (gh_list (gh_symbol2scm ("dashed-slur"),
+ (gh_list (ly_symbol2scm ("dashed-slur"),
gh_double2scm (thick),
gh_double2scm (dash),
ly_quote_scm (array_to_list (sc, 4)),
return m;
}
-Molecule
-Lookup::dots () const
-{
- return afm_find (String ("dots-dot"));
-}
return m;
}
-Molecule
-Lookup::rest (int j, bool o, String style) const
-{
- return afm_find (String ("rests-") + to_str (j) + (o ? "o" : "") + style);
-}
Molecule
{
Molecule m;
- Atom at (gh_list (gh_symbol2scm ("filledbox"),
+ Atom at (gh_list (ly_symbol2scm ("filledbox"),
gh_double2scm (-b[X_AXIS][LEFT]),
gh_double2scm (b[X_AXIS][RIGHT]),
gh_double2scm (-b[Y_AXIS][DOWN]),
return m;
}
+/*
+ TODO: THIS IS UGLY. Since the user has direct access to TeX
+ strings, we try some halfbaked attempt to detect TeX trickery.
+ */
+String
+sanitise_TeX_string (String text)
+{
+ int brace_count =0;
+ for (int i= 0; i < text.length_i (); i++)
+ {
+ if (text[i] == '\\')
+ continue;
+
+ if (text[i] == '{')
+ brace_count ++;
+ else if (text[i] == '}')
+ brace_count --;
+ }
+
+ if(brace_count)
+ {
+ warning (_f ("Non-matching braces in text `%s', adding braces", text.ch_C()));
+ if (brace_count < 0)
+ {
+ text = to_str ('{', -brace_count) + text;
+ }
+ else
+ {
+ text = text + to_str ('}', brace_count);
+ }
+ }
+
+ return text;
+}
/**
- Magnification steps. These are powers of 1.2. The numbers are
- taken from Knuth's plain.tex: */
-
+ TODO!
+ */
+String
+sanitise_PS_string (String t)
+{
+ return t;
+}
/**
- TODO: THIS IS UGLY. Since the user has direct access to TeX
- strings, we try some halfbaked attempt to detect TeX trickery.
*/
Molecule
}
- Real realmag = 1.0;
if (paper_l->scope_p_->elem_b ("magnification_" + style))
{
font_mag = (int)paper_l->get_var ("magnification_" + style);
- realmag = pow (1.2, font_mag);
}
/*
UGH.
*/
- SCM l = ly_ch_C_eval_scm (("(style-to-cmr \"" + style + "\")").ch_C());
+ SCM l = ly_eval_str (("(style-to-cmr \"" + style + "\")").ch_C());
if (l != SCM_BOOL_F)
{
style = ly_scm2string (gh_cdr(l)) +to_str ((int)font_h);
}
- Real w = 0;
- Interval ydims (0,0);
-
- Font_metric* afm_l = all_fonts_global_p->find_font (style);
- DEBUG_OUT << "\nChars: ";
-
-
- int brace_count =0;
- for (int i = 0; i < text.length_i (); i++)
- {
-
- if (text[i]=='\\')
- {
- for (i++; (i < text.length_i ()) && isalpha(text[i]); i++)
- ;
- i--; // Compensate for the increment in the outer loop!
- }
- else
- {
- if (text[i] == '{')
- brace_count ++;
- else if (text[i] == '}')
- brace_count --;
- Character_metric *c = (Character_metric*)afm_l->
- get_char ((unsigned char)text[i],false);
-
- // Ugh, use the width of 'x' for unknown characters
- if (c->dimensions()[X_AXIS].length () == 0)
- c = (Character_metric*)afm_l->get_char ((unsigned char)'x',false);
- w += c->dimensions()[X_AXIS].length ();
- ydims.unite (c->dimensions()[Y_AXIS]);
- }
- }
-
- if(brace_count)
- {
- warning (_f ("Non-matching braces in text `%s', adding braces", text.ch_C()));
-
- if (brace_count < 0)
- {
- text = to_str ('{', -brace_count) + text;
- }
- else
- {
- text = text + to_str ('}', brace_count);
- }
- }
+
- ydims *= realmag;
- m.dim_.x () = Interval (0, w*realmag);
- m.dim_.y () = ydims;
+ Font_metric* metric_l = 0;
+ if (font_mag)
+ metric_l = all_fonts_global_p->find_scaled (style, font_mag);
+ else
+ metric_l = all_fonts_global_p->find_font (style);
- Atom at (gh_list (gh_symbol2scm ("text"),
+
+ if (output_global_ch == "tex")
+ text = sanitise_TeX_string (text);
+ else if (output_global_ch == "ps")
+ text = sanitise_PS_string (text);
+
+ m.dim_ = metric_l->text_dimension (text);
+
+ Atom at (gh_list (ly_symbol2scm ("text"),
ly_str02scm (text.ch_C()),
SCM_UNDEFINED));
- at.font_ = ly_symbol (style);
- at.magn_ = gh_int2scm (font_mag);
+ at.fontify (metric_l);
m.add_atom (&at);
return m;
}
+
+
Molecule
Lookup::time_signature (int num, int den, Paper_def *paper_l) const
{
int maxht = 7 * minht;
int idx = int (((maxht - step) <? y - minht) / step);
idx = idx >? 0;
-
- SCM f = ly_symbol (String ("feta-braces" + to_str (staff_size)));
- SCM e =gh_list (gh_symbol2scm ("char"), gh_int2scm (idx), SCM_UNDEFINED);
+
+
+ String nm = String ("feta-braces" + to_str (staff_size));
+ SCM e =gh_list (ly_symbol2scm ("char"), gh_int2scm (idx), SCM_UNDEFINED);
Atom at (e);
- at.font_ = f;
+
+ at.fontify (all_fonts_global_p->find_font (nm));
m.dim_[Y_AXIS] = Interval (-y/2,y/2);
m.dim_[X_AXIS] = Interval (0,0);
{
Molecule m;
- String hairpin = String (decresc ? "de" : "") + "crescendo";
- Atom at (gh_list (ly_symbol (hairpin),
+ const char* hairpin = decresc ? "decrescendo" : "crescendo";
+ Atom at (gh_list (ly_symbol2scm (hairpin),
gh_double2scm (thick),
gh_double2scm (width),
gh_double2scm (height),
{
Molecule m;
- Atom at (gh_list(gh_symbol2scm ("tuplet"),
+ Atom at (gh_list(ly_symbol2scm ("tuplet"),
gh_double2scm (height),
gh_double2scm (gap),
gh_double2scm (dx),
scontrols[i] = offset2scm (controls[indices[i]]);
- Atom at (gh_list (ly_symbol ("bezier-sandwich"),
+ Atom at (gh_list (ly_symbol2scm ("bezier-sandwich"),
ly_quote_scm (array_to_list (scontrols, 8)),
gh_double2scm (linethick),
SCM_UNDEFINED));
Lookup::staff_bracket (Real height, Paper_def* paper_l) const
{
Molecule m;
- Atom at ( gh_list (gh_symbol2scm ("bracket"),
+ Atom 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")),
{
Molecule m;
- Atom at (gh_list (gh_symbol2scm ("volta"),
+ Atom at (gh_list (ly_symbol2scm ("volta"),
gh_double2scm (h),
gh_double2scm (w),
gh_double2scm (thick),
#include "lily-guile.hh"
#include "lily-version.hh"
-#include "all-fonts.hh"
+#include "all-font-metrics.hh"
#include "proto.hh"
#include "dimensions.hh"
#include "getopt-long.hh"
mark_req_l_ = 0;
axis_ = Y_AXIS;
type_ = "mark";
- visibility_lambda_ = ly_ch_C_eval_scm ("mark-visibility");
+ visibility_lambda_ = ly_eval_str ("mark-visibility");
}
void
}
else if (measures_i_ == 1 || measures_i_ == 2 || measures_i_ == 4)
{
- s = lookup_l ()->rest (- intlog2(measures_i_), 0, "");
+ s = lookup_l ()->afm_find ("rests-" + to_str (- intlog2(measures_i_)));
s.translate_axis (-s.extent ()[X_AXIS].length () / 2, X_AXIS);
}
else
{
- s = lookup_l ()->rest (-4, 0, "");
+ String idx = ("rests-") + to_str (-4);
+ s = lookup_l ()->afm_find (idx);
}
+
mol_p->add_molecule (s);
Real interline_f = staff_line_leading_f ();
if (measures_i_ == 1 && rest_symbol)
{"addlyrics", ADDLYRICS},
{"score", SCORE},
{"script", SCRIPT},
- {"shape", SHAPE},
{"skip", SKIP},
{"textscript", TEXTSCRIPT},
{"tempo", TEMPO},
Identifier*
My_lily_lexer::lookup_identifier (String s)
{
- SCM sym = ly_symbol (s.ch_C());
+ SCM sym = ly_symbol2scm (s.ch_C());
for (int i = scope_l_arr_.size (); i--; )
if (scope_l_arr_[i]->elem_b (sym))
Note_head::do_pre_processing ()
{
Rhythmic_head::do_pre_processing ();
+
// 8 ball looks the same as 4 ball:
- if (balltype_i_ > 2)
+ String type;
+ SCM style = get_elt_property ("style");
+ if (style != SCM_UNDEFINED)
+ {
+ type = ly_scm2string (style);
+ }
+
+
+ if (balltype_i_ > 2 || type == "harmonic" || type == "cross")
balltype_i_ = 2;
+
if (dots_l_) // move into Rhythmic_head?
dots_l_->set_position(int (position_f ()));
+
+
}
Interval
Note_head::do_width () const
{
- Molecule a = lookup_l ()->notehead (balltype_i_, ""); // UGH
- Interval i = a.dim_[X_AXIS];
- return i;
+ return make_molecule ().dim_[X_AXIS];
+}
+
+Molecule
+Note_head::make_molecule () const
+{
+ String type;
+ SCM style = get_elt_property ("style");
+ if (style != SCM_UNDEFINED)
+ {
+ type = ly_scm2string (style);
+ }
+
+ return lookup_l()->afm_find (String ("noteheads-")
+ + to_str (balltype_i_) + type);
}
Molecule*
int streepjes_i = abs (position_f ()) < sz
? 0
- : (abs(position_f ()) - sz) /2;
-
+ : (abs((int)position_f ()) - sz) /2;
- String type;
- SCM style = get_elt_property ("style");
- if (style != SCM_UNDEFINED)
- {
- type = ly_scm2string (style);
- }
-
- Molecule* out = new Molecule (lookup_l()->notehead (balltype_i_, type));
+ Molecule* out = new Molecule (make_molecule ());
Box b = out->dim_;
Dots * d = new Dots;
note_p->dots_l_ = d;
d->dots_i_ = note_req_l->duration_.dots_i_;
-
- SCM dir = get_property ("verticalDirection",0);
- if (isdir_b (dir))
- {
- d->resolve_dir_ = to_dir (dir);
- }
-
announce_element (Score_element_info (d,0));
dot_p_arr_.push (d);
}
*/
#include <math.h>
+#include "all-font-metrics.hh"
#include "string.hh"
#include "misc.hh"
#include "paper-def.hh"
Real
Paper_def::get_var (String s) const
{
- return get_realvar (ly_symbol (s));
+ return get_realvar (ly_symbol2scm (s.ch_C()));
}
Real
Paper_def::get_realvar (SCM s) const
{
if (!scope_p_->elem_b (s))
- error (_f ("unknown paper variable: `%s'", symbol_to_string (s)));
+ error (_f ("unknown paper variable: `%s'", ly_symbol2string (s)));
Real * p = scope_p_->elem (s)->access_content_Real (false);
if (!p)
{
return *p;
}
+
Interval
Paper_def::line_dimensions_int (int n) const
{
- if (!shape_int_a_.size ())
+ SCM s = default_properties_ [ly_symbol2scm ("margin-shape")];
+ if (!gh_pair_p (s))
{
Real lw = get_var ("linewidth");
Real ind = n? 0.0:get_var ("indent");
return Interval (ind, lw);
}
-
- if (n >= shape_int_a_.size ())
- n = shape_int_a_.size () -1;
- return shape_int_a_[n];
-}
+
+ SCM last = SCM_EOL;
+ while (gh_pair_p (s) && n --)
+ {
+ last = s;
+ s = gh_cdr (s);
+ }
+ if (s == SCM_EOL)
+ {
+ s = last;
+ }
+
+ SCM pair = gh_car (s);
+
+ return Interval (gh_scm2double (gh_car (pair)),
+ gh_scm2double (gh_cdr (pair)));
+}
Real
Paper_def::length_mom_to_dist (Moment d,Real k) const
default_count_i_ = 0;
}
-Paper_outputter*
-Paper_def::paper_outputter_p (Paper_stream* os_p, Scope* header_l, String origin_str) const
-{
- Paper_outputter* p = new Paper_outputter (os_p);
-
- // for now; breaks -fscm output
- p->output_comment (_ ("Outputting Score, defined at: "));
- p->output_comment (origin_str);
-
- p->output_version();
- if (header_global_p)
- p->output_scope (header_global_p, "mudela");
- if (header_l)
- p->output_scope (header_l, "mudela");
- if (scope_p_)
- p->output_scope (scope_p_, "mudelapaper");
-
-
- // *p->outstream_l_ << *scope_p_->elem (String (output_global_ch) + "setting")->access_content_String (false);
-
- SCM scm = gh_list (ly_symbol ("experimental-on"), SCM_UNDEFINED);
- p->output_scheme (scm);
- scm = gh_list (ly_symbol ("header-end"), SCM_UNDEFINED);
- p->output_scheme (scm);
-
- return p;
-}
Paper_stream*
Paper_def::paper_stream_p () const
#include "lily-version.hh"
#include "atom.hh"
-Paper_outputter::Paper_outputter (Paper_stream *s)
+Paper_outputter::Paper_outputter ()
{
- outstream_l_ = s;
- output_header ();
-
- if (output_global_ch == String ("scm"))
- *outstream_l_->os << ""
- "(primitive-load-path 'lily.scm)\n"
- "(eval (tex-scm 'all-definitions))\n"
- ";(eval (ps-scm 'all-definitions))\n"
- "(display (map (lambda (x) (string-append (eval x) \"\\n\")) '(\n"
- ;
+ molecules_ = gh_cons (SCM_EOL, SCM_EOL);
+ last_cons_ = molecules_;
}
-Paper_outputter::~Paper_outputter ()
-{
- SCM scm = gh_list (ly_symbol ("end-output"), SCM_UNDEFINED);
- output_scheme (scm);
-
- if (String (output_global_ch) == "scm")
- {
- *outstream_l_->os << ")))";
- }
-}
void
Paper_outputter::output_header ()
{
if (safe_global_b)
{
- ly_set_scm ("security-paranoia", SCM_BOOL_T);
- // ly_ch_C_eval_scm ("(set! security-paranoia #t)");
+ // ly_set_x ("security-paranoia", SCM_BOOL_T);
+ gh_define ("security-paranoia", SCM_BOOL_T);
}
String s = String ("(eval (") + output_global_ch + "-scm 'all-definitions))";
- ly_ch_C_eval_scm (s.ch_C ());
+ ly_eval_str (s.ch_C ());
String creator;
if (no_timestamps_global_b)
gh_list (ly_str02scm (creator.ch_l ()),
ly_str02scm (generate.ch_l ()), SCM_UNDEFINED);
-#ifndef NPRINT
- DEBUG_OUT << "output_header\n";
- if (flower_dstream && !flower_dstream->silent_b ("Guile"))
- {
- gh_display (args_scm); gh_newline ();
- }
-#endif
- SCM scm = gh_cons (gh_symbol2scm ("header"), args_scm);
+ SCM scm = gh_cons (ly_symbol2scm ("header"), args_scm);
output_scheme (scm);
}
void
Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm)
{
- if (flower_dstream)
- *outstream_l_ << String ("\n%start: ") << nm << "\n";
-
-
if (flower_dstream)
{
output_comment (nm);
}
-#ifdef ATOM_SMOB
- for (SCM ptr = m->atom_list_; ptr != SCM_EOL; ptr = SCM_CDR(ptr))
- {
- Atom *i = Atom::atom_l (SCM_CAR(ptr));
-#else
for (Cons<Atom> *ptr = m->atom_list_; ptr; ptr = ptr->next_)
{
Atom * i = ptr->car_;
-#endif
-#if 0
- }
-#endif
+
Offset a_off = i->off_;
a_off += o;
}
}
- if (i->font_)
- {
- output_scheme (gh_list (ly_symbol ("select-font"),
- ly_str02scm (symbol_to_string (i->font_).ch_C()),
- SCM (i->magn_),
- SCM_UNDEFINED));
- }
-
SCM box_scm
- = gh_list (gh_symbol2scm ("placebox"),
+ = gh_list (ly_symbol2scm ("placebox"),
gh_double2scm (a_off.x ()),
gh_double2scm (a_off.y ()),
SCM(i->func_),
SCM_UNDEFINED);
-
+
output_scheme (box_scm);
}
}
void
Paper_outputter::output_comment (String str)
{
- if (String (output_global_ch) == "scm")
- {
- *outstream_l_ << "; " << str << "\n";
- }
- else
- {
- *outstream_l_ << "% " << str << "\n";
- }
+ output_scheme (gh_list (ly_symbol2scm ("comment"),
+ ly_str02scm ((char*)str.ch_C()),
+ SCM_UNDEFINED)
+ );
}
void
Paper_outputter::output_scheme (SCM scm)
{
- if (String (output_global_ch) == "scm")
+ SCM c = gh_cons (scm,gh_cdr (last_cons_));
+ gh_set_cdr_x(last_cons_, c);
+ last_cons_ = c;
+}
+
+
+void
+Paper_outputter::dump_onto (Paper_stream *os)
+{
+
+ if (output_global_ch == String ("scm"))
+ *os << ""
+ "(primitive-load-path 'lily.scm)\n"
+ "(eval (tex-scm 'all-definitions))\n"
+ ";(eval (ps-scm 'all-definitions))\n"
+ "(display (map (lambda (x) (string-append (eval x) \"\\n\")) '(\n"
+ ;
+
+ for (SCM s = gh_cdr (molecules_); gh_pair_p (s); s = gh_cdr (s))
{
- SCM result = scm_eval (scm_listify (ly_symbol ("scm->string"), ly_quote_scm (scm), SCM_UNDEFINED));
- *outstream_l_->os << ly_scm2string (result) << endl;
+ if (String (output_global_ch) == "scm")
+ {
+ SCM result = scm_eval (scm_listify (ly_symbol2scm ("scm->string"),
+ ly_quote_scm (gh_car (s)), SCM_UNDEFINED));
+
+ *os << ly_scm2string (result);
+ }
+ else
+ {
+ SCM result = scm_eval (gh_car (s));
+ char *c=gh_scm2newstr (result, NULL);
+
+ *os << c;
+ free (c);
+ }
+
}
- else
- {
- SCM result = scm_eval (scm);
- char *c=gh_scm2newstr (result, NULL);
- *outstream_l_ << c;
- free (c);
+
+ if (String (output_global_ch) == "scm")
+ {
+ *os << ")))";
}
}
programming_error ("Improbable system height");
height = 50 CM;
}
- SCM scm = gh_list (ly_symbol ("start-line"),
+ SCM scm = gh_list (ly_symbol2scm ("start-line"),
gh_double2scm (height),
SCM_UNDEFINED);
output_scheme (scm);
void
Paper_outputter::output_font_def (int i, String str)
{
- SCM scm = gh_list (ly_symbol ("font-def"),
+ SCM scm = gh_list (ly_symbol2scm ("font-def"),
gh_int2scm (i),
ly_str02scm (str.ch_l ()),
SCM_UNDEFINED);
Paper_outputter::output_Real_def (String k, Real v)
{
- SCM scm = gh_list (ly_symbol ("lily-def"),
+ SCM scm = gh_list (ly_symbol2scm ("lily-def"),
ly_str02scm (k.ch_l ()),
ly_str02scm (to_str(v).ch_l ()),
SCM_UNDEFINED);
Paper_outputter::output_String_def (String k, String v)
{
- SCM scm = gh_list (ly_symbol ("lily-def"),
+ SCM scm = gh_list (ly_symbol2scm ("lily-def"),
ly_str02scm (k.ch_l ()),
ly_str02scm (v.ch_l ()),
SCM_UNDEFINED);
void
Paper_outputter::output_int_def (String k, int v)
{
- SCM scm = gh_list (ly_symbol ("lily-def"),
+ SCM scm = gh_list (ly_symbol2scm ("lily-def"),
ly_str02scm (k.ch_l ()),
ly_str02scm (to_str (v).ch_l ()),
SCM_UNDEFINED);
void
Paper_outputter::stop_line ()
{
- SCM scm = gh_list (ly_symbol ("stop-line"), SCM_UNDEFINED);
+ SCM scm = gh_list (ly_symbol2scm ("stop-line"), SCM_UNDEFINED);
output_scheme (scm);
}
void
Paper_outputter::stop_last_line ()
{
- SCM scm = gh_list (ly_symbol ("stop-last-line"), SCM_UNDEFINED);
+ SCM scm = gh_list (ly_symbol2scm ("stop-last-line"), SCM_UNDEFINED);
+ output_scheme (scm);
+ scm = gh_list (ly_symbol2scm ("end-output"), SCM_UNDEFINED);
output_scheme (scm);
}
+
#include "paper-outputter.hh"
#include "file-results.hh"
#include "misc.hh"
+#include "all-font-metrics.hh"
Paper_score::Paper_score ()
{
void
Paper_score::process ()
{
- Dictionary<int> type_stats;
- type_stats["Item"] =0;
- type_stats["Spanner"] =0;
- type_stats["Total"]=0;
print ();
*mlog << _ ("Preprocessing elements...") << " " << flush;
Array<Column_x_positions> breaking = calc_breaking ();
- Paper_stream* paper_stream_p = paper_l_->paper_stream_p ();
- outputter_l_ = paper_l_->paper_outputter_p (paper_stream_p, header_l_, origin_str_);
+ outputter_l_ = new Paper_outputter ;
+ outputter_l_->output_header ();
+ outputter_l_->output_version();
+
+ if (header_global_p)
+ outputter_l_->output_scope (header_global_p, "mudela");
+ if (header_l_)
+ outputter_l_->output_scope (header_l_, "mudela");
+
+ outputter_l_->output_comment (_ ("Outputting Score, defined at: "));
+ outputter_l_->output_comment (origin_str_);
+
+ if (paper_l_->scope_p_)
+ outputter_l_->output_scope (paper_l_->scope_p_, "mudelapaper");
+
+ SCM scm = gh_list (ly_symbol2scm ("experimental-on"), SCM_UNDEFINED);
+ outputter_l_->output_scheme (scm);
+ scm = gh_list (ly_symbol2scm ("header-end"), SCM_UNDEFINED);
+ outputter_l_->output_scheme (scm);
+
+
+ /*
+ This is tricky: we have to put the font definitions before the
+ actual output, but we don't know all fonts in advanced: generating
+ the output might trigger loading of a new font. So we store the
+ place to insert the font definitions, generate the output and then
+ insert the definitions
+
+ */
+ SCM before_output = outputter_l_->last_cons_;
+
Link_array<Line_of_score> lines;
for (int i=0; i < breaking.size (); i++)
{
line_l->post_processing ();
*mlog << i << flush;
- line_l->output_all (i + 1 == lines.size());
+ line_l->output_all (i + 1 == lines.size ());
*mlog << ']' << flush;
- }
+ }
+
+ SCM font_names = ly_quote_scm (all_fonts_global_p->font_descriptions ());
+ gh_set_cdr_x (before_output,
+ gh_cons (gh_list (ly_symbol2scm ("define-fonts"),
+ font_names,
+ SCM_UNDEFINED),
+ gh_cdr (before_output)));
+ Paper_stream* psp = paper_l_->paper_stream_p ();
+ outputter_l_->dump_onto (psp);
// huh?
delete outputter_l_;
- delete paper_stream_p;
+
outputter_l_ = 0;
-
-
- /*
- todo: sort output
- */
- if (experimental_features_global_b)
- {
- for (Dictionary_iter<int> i(type_stats); i.ok(); i++)
- {
- *mlog << i.key () << ": " << i.val () << " objects\n";
- }
- }
- *mlog << '\n' << flush;
-
+ delete psp;
+
}
Link_array<Item>
Rest::do_add_processing ()
{
if (balltype_i_ == 0)
- position_i_ += 2; // guh.
+ set_position (position_f () + 2);
Rhythmic_head::do_add_processing ();
}
{
style = ly_scm2string (style_sym);
}
-
- Molecule s(lookup_l ()->rest (balltype_i_, ledger_b, style));
- Molecule * m = new Molecule ( Molecule (s));
- return m;
+ String idx = ("rests-") + to_str (balltype_i_) + (ledger_b ? "o" : "") + style;
+
+ return new Molecule(lookup_l ()->afm_find (idx));
}
bool
Scope::elem_b (String s) const
{
- return elem_b (ly_symbol (s.ch_C()));
+ return elem_b (ly_symbol2scm (s.ch_C()));
}
Identifier *&
Scope::elem (String s)
{
- return elem (ly_symbol (s.ch_C()));
+ return elem (ly_symbol2scm (s.ch_C()));
}
Scope_iter::key () const
{
SCM s= Hash_table_iter<Protected_scm,Identifier*>::key ();
- return symbol_to_string (s);
+ return ly_symbol2string (s);
}
bool
SCM
Score_element::get_elt_property (String nm) const
{
- SCM sym = ly_symbol (nm);
+ SCM sym = ly_symbol2scm (nm.ch_C());
SCM s = scm_assq(sym, element_property_alist_);
if (s != SCM_BOOL_F)
if (pscore_l_)
{
- SCM sym2 = ly_symbol (name () + ("::" + nm));
+ SCM sym2 = ly_symbol2scm ((name () + ("::" + nm)).ch_C());
SCM val;
// should probably check for Type::sym as well.
Score_element::remove_elt_property (String key)
{
SCM s = get_elt_property (key);
- SCM sym = ly_symbol (key);
+ SCM sym = ly_symbol2scm (key.ch_C());
element_property_alist_ = scm_assq_remove_x (element_property_alist_, sym);
return s;
}
void
Score_element::set_elt_property (String k, SCM v)
{
- SCM s = ly_symbol (k);
+ SCM s = ly_symbol2scm (k.ch_C( ));
element_property_alist_ = scm_assoc_set_x (element_property_alist_, s, v);
}
{
Articulation_req* l=script_req_l_arr_[i];
- SCM list = ly_ch_C_eval_scm (("(articulation-to-scriptdef \"" + l->articulation_str_ + "\")").ch_C());
+ SCM list = ly_eval_str (("(articulation-to-scriptdef \"" + l->articulation_str_ + "\")").ch_C());
if (list == SCM_BOOL_F)
{
assert (s != SCM_UNDEFINED);
SCM key = SCM_CAR (s);
- if (key == ly_symbol ("feta"))
+ if (key == ly_symbol2scm ("feta"))
{
return lookup_l ()->afm_find ("scripts-" +
ly_scm2string (index_cell (gh_cdr (s), d)));
}
- else if (key == ly_symbol ("accordion"))
+ else if (key == ly_symbol2scm ("accordion"))
{
return lookup_l ()->accordion (s, paper_l()->get_var("interline"));
}
}
else
{
- sep_span_p_->padding_f_ = paper_l ()->get_realvar (ly_symbol ("postBreakPadding"));
+ sep_span_p_->padding_f_ = paper_l ()->get_realvar (ly_symbol2scm ("postBreakPadding"));
}
sep_span_p_->set_bounds (RIGHT, get_staff_info ().command_pcol_l ());
{
axis_ = X_AXIS;
type_ = "margin";
- visibility_lambda_ = ly_ch_C_eval_scm ("postbreak-only-visibility");
+ visibility_lambda_ = ly_eval_str ("postbreak-only-visibility");
}
Staff_performer::new_instrument_str ()
{
// mustn't ask Score for instrument: it will return piano!
- SCM minstr = get_property (gh_symbol2scm ("midiInstrument"), 0);
+ SCM minstr = get_property (ly_symbol2scm ("midiInstrument"), 0);
if (!gh_string_p(minstr))
- minstr = get_property (gh_symbol2scm ("instrument"), 0);
+ minstr = get_property (ly_symbol2scm ("instrument"), 0);
if (ly_scm2string (minstr) == instrument_str_)
return "";
Real
Staff_symbol_referencer::staff_line_leading_f () const
{
- return (staff_sym_l_) ? staff_sym_l_->staff_line_leading_f_ : paper_l ()->get_var ("interline");
+ if (staff_sym_l_)
+ return staff_sym_l_->staff_line_leading_f_;
+ else if (pscore_l_ && paper_l ())
+ paper_l ()->get_var ("interline");
+
+ return 0.0;
}
Real
void
Staff_symbol_referencer::set_position (int p)
{
- /*
- UGH. Use position_f() as well.
- */
- position_i_ = p;
+ Real halfspace = staff_line_leading_f ()* 0.5;
+ translate_axis (- halfspace * position_f (), Y_AXIS);
+ if (staff_sym_l_)
+ translate_axis (halfspace * p, Y_AXIS);
+ else
+ position_i_ = p;
}
/*
FIXME: y dims should not be in internote.
- */
+
+
+ GURG UGRGINRG INA UG R
+
+ JUNKME -> This should be in Beam
+*/
Stem_info::Stem_info (Stem*s, int mult)
{
mult_i_ =mult;
stem_l_ = s;
+ Beam* beam_l = stem_l_->beam_l_;
+
x_ = stem_l_->hpos_f ();
set_direction (stem_l_->get_direction ());
SCM bd = stem_l_->remove_elt_property ("beam-dir");
Paper_def* paper_l = stem_l_->paper_l ();
Real internote_f = stem_l_->staff_line_leading_f ()/2;
Real interbeam_f = paper_l->interbeam_f (mult_i_);
- Real beam_f = paper_l->get_var ("beam_thickness");;
+ Real beam_f = gh_scm2double (beam_l->get_elt_property ("beam-thickness"));
// strangely enough, dim(chord_start_f) == pt (and not internote!)
idealy_f_ = maxy_f_ <? idealy_f_;
idealy_f_ = miny_f_ >? idealy_f_;
- // interstaff beam
- Beam* beam_l = stem_l_->beam_l_;
-
interstaff_f_ = calc_interstaff_dist (stem_l_, beam_l) / internote_f;
idealy_f_ += interstaff_f_* beam_dir_;
miny_f_ += interstaff_f_ * beam_dir_;
}
Real interbeam_f = paper_l ()->interbeam_f (mult);
- Real w = 1.5 * lookup_l ()->notehead (2, "").dim_[X_AXIS].length ();
+ Real w = gh_scm2double (get_elt_property ("beam-width"));
Real space = stem_l_->staff_line_leading_f ();
Real internote_f = space/2;
- Real beam_f = paper_l ()->get_var ("beam_thickness");
+ Real beam_f = gh_scm2double (get_elt_property ("beam-thickness"));
int beams_i = 0;
Real slope_f = internote_f / 4 / internote_f; // HUH?
static const Real fix_to_real (Fix f);
-Tex_font_metric_reader::Tex_font_metric_reader (String name)
+Tex_font_metric_reader::Tex_font_metric_reader (Tex_font_metric* fp, String name)
: input_ (name)
{
- tfm_.clear (TFM_SIZE);
-}
-
-Tex_font_metric
-Tex_font_metric_reader::read_tfm ()
-{
+ tfm_l_=fp;
+ tfm_l_->clear (TFM_SIZE);
read_header ();
read_params ();
read_char_metrics ();
- return tfm_;
+
+}
+
+Tex_font_metric *
+Tex_font_metric_reader::read_file (String name)
+{
+ Tex_font_metric * tfmp = new Tex_font_metric;
+ Tex_font_metric_reader tfm_reader (tfmp, name);
+
+ return tfmp;
}
+
+
static const Real
fix_to_real (Fix f)
{
Real
Tex_font_metric_reader::get_U32_fix_scaled_f ()
{
- return get_U32_fix_f () * tfm_.info_.design_size;
+ return get_U32_fix_f () * tfm_l_->info_.design_size;
}
String
(void) file_length;
U16 header_length = input_.get_U16 ();
- tfm_.info_.first_charcode = input_.get_U16 ();
- tfm_.info_.last_charcode = input_.get_U16 ();
+ tfm_l_->info_.first_charcode = input_.get_U16 ();
+ tfm_l_->info_.last_charcode = input_.get_U16 ();
U16 width_word_count = input_.get_U16 ();
U16 height_word_count = input_.get_U16 ();
U16 depth_word_count = input_.get_U16 ();
U16 extensible_word_count = input_.get_U16 ();
(void)extensible_word_count;
- tfm_.header_.param_word_count = input_.get_U16 ();
- tfm_.info_.parameter_count = tfm_.header_.param_word_count;
-
- tfm_.header_.char_info_pos = (6 + header_length) * 4;
- tfm_.header_.width_pos = tfm_.header_.char_info_pos
- + (tfm_.info_.last_charcode
- - tfm_.info_.first_charcode + 1) * 4;
- tfm_.header_.height_pos = tfm_.header_.width_pos + width_word_count * 4;
- tfm_.header_.depth_pos = tfm_.header_.height_pos + height_word_count * 4;
- tfm_.header_.italic_correction_pos = tfm_.header_.depth_pos
+ tfm_l_->header_.param_word_count = input_.get_U16 ();
+ tfm_l_->info_.parameter_count = tfm_l_->header_.param_word_count;
+
+ tfm_l_->header_.char_info_pos = (6 + header_length) * 4;
+ tfm_l_->header_.width_pos = tfm_l_->header_.char_info_pos
+ + (tfm_l_->info_.last_charcode
+ - tfm_l_->info_.first_charcode + 1) * 4;
+ tfm_l_->header_.height_pos = tfm_l_->header_.width_pos + width_word_count * 4;
+ tfm_l_->header_.depth_pos = tfm_l_->header_.height_pos + height_word_count * 4;
+ tfm_l_->header_.italic_correction_pos = tfm_l_->header_.depth_pos
+ depth_word_count * 4;
- tfm_.header_.lig_kern_pos = tfm_.header_.italic_correction_pos
+ tfm_l_->header_.lig_kern_pos = tfm_l_->header_.italic_correction_pos
+ italic_correction_word_count * 4;
- tfm_.header_.kern_pos = tfm_.header_.lig_kern_pos + lig_kern_word_count * 4;
+ tfm_l_->header_.kern_pos = tfm_l_->header_.lig_kern_pos + lig_kern_word_count * 4;
/* We don't care about the extensible table. */
if (header_length < 2)
error (_f ("TFM header of `%s' has only %u word(s)",
input_.name_str ().ch_C (), header_length));
- tfm_.info_.checksum = input_.get_U32 ();
- tfm_.info_.design_size = get_U32_fix_f ();
+ tfm_l_->info_.checksum = input_.get_U32 ();
+ tfm_l_->info_.design_size = get_U32_fix_f ();
/* Although the coding scheme might be interesting to the caller, the
font family and face byte probably aren't. So we don't read them. */
- tfm_.info_.coding_scheme = header_length > 2
+ tfm_l_->info_.coding_scheme = header_length > 2
? get_bcpl_str () : "unspecified";
DEBUG_OUT << format_str ("TFM checksum = %u, design_size = %fpt, coding scheme = `%s'.\n",
- tfm_.info_.checksum,
- tfm_.info_.design_size,
- tfm_.info_.coding_scheme.ch_C ());
+ tfm_l_->info_.checksum,
+ tfm_l_->info_.design_size,
+ tfm_l_->info_.coding_scheme.ch_C ());
}
/* Although TFM files are only usable by TeX if they have at least seven
Tex_font_metric_reader::read_params ()
{
/* If we have no font parameters at all, we're done. */
- if (tfm_.header_.param_word_count == 0)
+ if (tfm_l_->header_.param_word_count == 0)
return;
//brrr
/* Move to the beginning of the parameter table in the file. */
- input_.seek_ch_C (-4 * tfm_.header_.param_word_count);
+ input_.seek_ch_C (-4 * tfm_l_->header_.param_word_count);
/* It's unlikely but possible that this TFM file has more fontdimens
than we can deal with. */
- if (tfm_.header_.param_word_count > TFM_MAX_FONTDIMENS)
+ if (tfm_l_->header_.param_word_count > TFM_MAX_FONTDIMENS)
{
warning (_f ("%s: TFM file has %u parameters, which is more than the %u I can handle",
input_.name_str ().ch_C (),
- tfm_.header_.param_word_count,
+ tfm_l_->header_.param_word_count,
TFM_MAX_FONTDIMENS));
- tfm_.header_.param_word_count = TFM_MAX_FONTDIMENS;
+ tfm_l_->header_.param_word_count = TFM_MAX_FONTDIMENS;
}
/* The first parameter is different than all the rest, because it
isn't scaled by the design size. */
- tfm_.info_.parameters[(TFM_SLANT_PARAMETER) - 1] = get_U32_fix_f ();
+ tfm_l_->info_.parameters[(TFM_SLANT_PARAMETER) - 1] = get_U32_fix_f ();
- for (Char_code i = 2; i <= tfm_.header_.param_word_count; i++)
- tfm_.info_.parameters[i - 1] = get_U32_fix_scaled_f ();
+ for (Char_code i = 2; i <= tfm_l_->header_.param_word_count; i++)
+ tfm_l_->info_.parameters[i - 1] = get_U32_fix_scaled_f ();
#ifdef PRINT
- for (Char_code i = 1; i <= tfm_.header_.param_word_count; i++)
- DEBUG_OUT << format_str ("TFM parameter %d: %.3f", i, tfm_.info_.parameters[i - 1]);
+ for (Char_code i = 1; i <= tfm_l_->header_.param_word_count; i++)
+ DEBUG_OUT << format_str ("TFM parameter %d: %.3f", i, tfm_l_->info_.parameters[i - 1]);
#endif
}
void
Tex_font_metric_reader::read_char_metrics ()
{
- for (int i = tfm_.info_.first_charcode; i <= tfm_.info_.last_charcode; i++)
+ for (int i = tfm_l_->info_.first_charcode; i <= tfm_l_->info_.last_charcode; i++)
{
Tex_font_char_metric tfm_char = read_char_metric (i);
if (tfm_char.exists_b_)
- tfm_.ascii_to_metric_idx_[tfm_char.code_] = tfm_.char_metrics_.size ();
- tfm_.char_metrics_.push (tfm_char);
+ tfm_l_->ascii_to_metric_idx_[tfm_char.code_] = tfm_l_->char_metrics_.size ();
+ tfm_l_->char_metrics_.push (tfm_char);
}
}
/* If the character is outside the declared bounds in the file, don't
try to read it. */
- if (code < tfm_.info_.first_charcode || code > tfm_.info_.last_charcode)
+ if (code < tfm_l_->info_.first_charcode || code > tfm_l_->info_.last_charcode)
return tfm_char;
//brr
/* Move to the appropriate place in the `char_info' array. */
- input_.seek_ch_C (tfm_.header_.char_info_pos + (code - tfm_.info_.first_charcode) * 4);
+ input_.seek_ch_C (tfm_l_->header_.char_info_pos + (code - tfm_l_->info_.first_charcode) * 4);
/* Read the character. */
tfm_char = read_char ();
#define GET_CHAR_DIMEN(d) \
if (d##_index != 0) \
{ \
- input_.seek_ch_C (tfm_.header_.##d##_pos + d##_index*4); \
+ input_.seek_ch_C (tfm_l_->header_.##d##_pos + d##_index*4); \
tfm_char.d##_fix_ = input_.get_U32 (); \
tfm_char.d##_ = fix_to_real (tfm_char.d##_fix_) \
- * tfm_.info_.design_size; \
+ * tfm_l_->info_.design_size; \
}
GET_CHAR_DIMEN (width);
if (tag == 1)
{
- input_.seek_ch_C (tfm_.header_.lig_kern_pos + remainder * 4);
+ input_.seek_ch_C (tfm_l_->header_.lig_kern_pos + remainder * 4);
read_lig_kern_program (&tfm_char.ligature_arr_, &tfm_char.kern_arr_);
}
kern_element.character = next_char;
char const* old_pos = input_.pos_ch_C ();
- input_.seek_ch_C (tfm_.header_.kern_pos + remainder * 4);
+ input_.seek_ch_C (tfm_l_->header_.kern_pos + remainder * 4);
kern_element.kern = get_U32_fix_scaled_f ();
input_.set_pos (old_pos);
{
warning (_f ("Can't find ascii character: `%d'", ascii));
-
}
return dummy_static_char_metric;
}
ascii_to_metric_idx_.push (-1);
}
-void
-Tex_font_metric::read_file (String name)
-{
- Tex_font_metric_reader tfm_reader (name);
- *this = tfm_reader.read_tfm ();
-}
void
Translator_group::set_property (String id, SCM val)
{
- properties_dict_[ly_symbol (id)] = val;
+ properties_dict_[ly_symbol2scm (id.ch_C())] = val;
}
SCM
Translator::get_property (String id, Translator_group **where_l) const
{
- return daddy_trans_l_->get_property (ly_symbol (id), where_l);
+ return daddy_trans_l_->get_property (ly_symbol2scm (id.ch_C()), where_l);
}
SCM
% Toplevel initialisation file.
-\version "1.1.52";
+\version "1.3.5";
\include "declarations.ly"
font_number = 4.;
font_dynamic = 10.;
font_mark = 6.;
+
+ % UGH!
magnification_dynamic = -4.0;
-1=\font "feta11"
+%{
+
+ Six Petits Preludes,
+ Collection Johann Peter Kellner
+ ca 1703 - 1707
+
+ Kellner was a student of Bach's that copied some 90 works of his master.
+
+%}
\header{
-filename = "preludes-1.ly";
-%
-% page 1
-%
-% Clavierb"uchlein f"ur W. Fr. Bach
-% Clav. W. Fr. Bach: 2-Praeambulum I
-% ca 1720
-composer = "Johann Sebastian Bach (1685-1750)";
-enteredby = "jcn";
-copyright = "public domain";
+ copyright = "public domain";
+ source = "Ed. Henry Lemoine Urtext";
+ title = "Pr\\\"aludum";
+
+ opus = "BWV 924";
+ composer = "Johann Sebastian Bach (1685-1750)";
+ enteredby = "jcn,hwn";
+
+ % mutopia headers.
+ mutopiatitle = "Prelude";
+ mutopiacomposer = "J.S.Bach";
+ mutopiaopus = "BWV924";
+ mutopiainstrument = "Piano";
+ style = "baroque";
+ copyright = "Public Domain";
+ maintainer = "Jan Nieuwenhuizen";
+ maintainer_email = "janneke@gnu.org";
+ tagline = "\\\\This music is part of the Mutopia project, http://sca.uwaterloo.ca/Mutopia/\\\\It has been typeset and placed in the public domain by " + \maintainer + ".\\\\Unrestricted modification and redistribution is permitted and encouraged - copy this music and share it!";
+ maintainer = "janneke@gnu.org";
+ lastupdated = "1999/Nov/14";
}
+%{
+
+TODO: this file needs additional layouting: the trills look
+differently in Lemoine, and the sharps should be below the trill.
+
+Additionally, the performance of trills should be explained.
+
+Lemoine puts fermatas on ending bar lines everywhere.
+
+1.2.x versions of lily contain a version with dynamics and fingerings.
+
+%}
+
+
\version "1.3.4";
upper = \context Staff=upper \notes\relative c {
\context Voice=i
\property Voice . textStyle = "italic"
-% rediculous dim...
-% r16\p_"legato"\< g''-1( c-3 )e-5 r g,-1( c )e
- r16\p\< g''-1( c-3 )e-5 r g,-1( c )e
- r g,( c )d r b-1( d-2 \!)g-5 |
- r16\mf a,( d-2 ) g-5 r a,(\< d )f-4
- r a,( d )e-3 r c-1( e-2 \!)a-5 |
- r16\f b, e a-5 r b, e-3 g-5
- r c,-1 e-3 f-4 r g, d'-3 f-5 |
-% all text is fat currently...
-% r g,-"poco a poco dim." d'-4 e r g, c-2 e
- r g, d'-4 e r g, c-2 e
- r a,-1 c-3 d-4 r e, b'-3 d-5 |
- r e, b' c-4 r e, a-2 c
- r f,-1 a-3 bes-4 r c, g'-3 bes-5 |
- r c, g' a-4 r c, f-2 a
- r d, f-2 b-5 r e, g-2 c-5 |
- r\p d, g c-5 r d, g b-4
- r c, g'-3 b-5 r c, fis-2 a-4 |
- r b, d a'-5 r b, d g-4
- r a, c g'-5 r a, c f!-4 |
+
+ r16 g'' c e r g, c e
+ r g, c d r b d g |
+ r16 a, d g r a, d f
+ r a, d e r c e a |
+ r16 b, e a r b, e g
+ r c, e f r g, d' f |
+
+ r g, d' e r g, c e
+ r a, c d r e, b' d |
+ r e, b' c r e, a c
+ r f, a bes r c, g' bes |
+ r c, g' a r c, f a
+ r d, f b r e, g c |
+ r d, g c r d, g b
+ r c, g' b r c, fis a |
+ r b, d a' r b, d g
+ r a, c g' r a, c f! |
% ugh arpeggio
<
{ \stemup f4 r }
>
\stemboth
\translator Staff=lower\stemup
- r16 g,,-5( b-4 d
- [ f-1 \translator Staff=upper\stemdown g16-1 b d ] |
- \stemup )b
+ r16 g,, b d
+ [ f \translator Staff=upper\stemdown g16 b d ] |
+ \stemup b
\translator Staff=lower\stemdown
- [ g-5( b-4 d-2 ] f-1
+ [ g b d ] f
\translator Staff=upper\stemup
- [ g16-1 b-2 d ] )b
+ [ g16 b d ] b
\translator Staff=lower\stemup
\clef "violin";
- [ g-4 b-2 d-1 ]
+ [ g b d ]
\stemup
% urg, below translator change affects previous beam too!?
% howto separate translator command from previous beam end?
- \translator Staff=upper f-2 g-3 b-5 f-2 |
+ \translator Staff=upper f g b f |
\stemboth
- e-1\f c'-5( g-3 f-2 e-1 c'-5 g-3 e-2
- )d c'-5( f,-3 e-2 d-1 b'-5 f-3 d-2 |
- )c b'-5( e,-3 d-2 c-1 a'-5 e-3 c-2
- )b-1 a'-5( d,-3 c-2 b-1 g'-5 d-3 b-2 |
-% )a g'-5 c,-4 b a-"poco a poco dim." fis'-5 c-2 a-1
- )a g'-5 c,-4 b a fis'-5 c-2 a-1
- b-2 f' d-4 c b f' d-4 b-2 |
- g e' c-3 b a e'-5 c-3 a-1
- fis-2 d' b-3 a g-1 d'-5 b-4 g-2 |
- e c'-5 a-4 g-3 fis-2 c'-5 a-4 fis-2
- d c'-5 b-4 a b-4 g-2 d'-5 f,-1 |
- g-4 e-2 f-1 d'-5 c-4 b a g
- f'-5 d-3 es-4 c-2 fis,-1 es'-4 d-3 c-2 |
-% b-1 d-5 b-3 g-1 as-4-"cresc. e rall." f-2 g-3 d-1
- b-1 d-5 b-3 g-1 as-4 f-2 g-3 d-1
- es-2 fis-3 a-4 c-5
+ e c' g f e c' g e
+ d c' f, e d b' f d |
+ c b' e, d c a' e c
+ b a' d, c b g' d b |
+ a g' c, b a fis' c a
+ b f' d c b f' d b |
+ g e' c b a e' c a
+ fis d' b a g d' b g |
+ e c' a g fis c' a fis
+ d c' b a b g d' f, |
+ g e f d' c b a g
+ f' d es c fis, es' d c |
+ b d b g as f g d
+ es fis a c
<
{ \stemup r c8 b16 }
- \context Voice=ii { \stemdown d,8 f-2 }
+ \context Voice=ii { \stemdown d,8 f }
>
\stemboth |
- <c1\mf g e>
+ <c1 g e>
\bar "|.";
}
lower = \context Staff=lower \notes\relative c{
\context Voice=i
\property Voice . textStyle = "roman"
- c4-5 e-3 g-\mordent^"(\\textsharp)" g,4 |
- d'4-\mordent-5 f-3 a-\mordent^"(\\textsharp)" a,4 |
- e'-5 e'-\mordent-1 a,-4 b-\upprall |
- c4 e,-4 fis gis-\downprall |
- a4 c,-4 d e-\upprall |
- f4-1 e d-3-\prall c |
- g'-\mordent^"(\\textsharp)" g, g'-\mordent g, |
+ c4 e g^"\\textsharp"-\mordent g,4 |
+ d'4-\mordent f a-\mordent^"\\textsharp" a,4 |
+ e' e'-\mordent a, b-\upprall |
+ c4 e, fis gis-\downprall |
+ a4 c, d e-\upprall |
+ f4 e d-\prall c |
+ g'-\mordent^"\\textsharp" g, g'-\mordent g, |
g'-\mordent g, g'-\mordent g, |
g' r s s | s s s s \clef "bass"; |
<
\lower
>
>
- \paper{
- % no slur damping
- slur_slope_damping = 10.0;
- }
+ \paper { linewidth = 18.0 \cm; }
\midi{ \tempo 4 = 80; }
\header {
opus = "BWV 924";
\header{
copyright = "public domain";
source = "Ed. Henry Lemoine Urtext";
-
-
+ title = "Pr\\\"aludum";
composer = "Johann Sebastian Bach (1685-1750)";
enteredby = "jcn,hwn";
- copyright = "public domain";
+
+ opus= "393";
% mutopia headers.
mutopiatitle = "Prelude";
mutopiacomposer = "J.S.Bach";
+ mutopiaopus = "BWV939";
mutopiainstrument = "Piano";
style = "baroque";
copyright = "Public Domain";
- tagline = "\\\\This music is part of the Mutopia project, http://sca.uwaterloo.ca/Mutopia/\\\\It has been typeset and placed in the public domain by Jan Nieuwenhuizen.\\\\Unrestricted modification and redistribution is permitted and encouraged - copy this music and share it!";
+
+ maintainer = "Jan Nieuwenhuizen";
+ maintainer_email = "janneke@gnu.org";
+ tagline = "\\\\This music is part of the Mutopia project, http://sca.uwaterloo.ca/Mutopia/\\\\It has been typeset and placed in the public domain by " + \maintainer + ".\\\\Unrestricted modification and redistribution is permitted and encouraged - copy this music and share it!";
maintainer = "janneke@gnu.org";
- lastupdated = "1999/Nov/8";
+ lastupdated = "1999/Nov/14";
}
+
+
%{
Old versions of LilyPond include this prelude with dynamics and fingerings.
-
%}
upper = \context Staff \notes\relative c{
\context Voice=i
\property Voice . textStyle = "italic"
- r8 c'( e g e c bes' g |
- )a c,( f a f c c' a |
- )b g( b d b g f' d |
+ r8 c' e g e c bes' g |
+ a c, f a f c c' a |
+ b g b d b g f' d |
<
- {\stemup )e2 r4 e }
+ {\stemup e2 r4 e }
\context Voice = ii {\stemdown <c2 g > r4 <c g > }
>
\stemboth |
\context Voice = ii { \stemdown <b 8 g > }
>
\stemboth
- g, 8( b d
+ g, 8 b d
<
- { \stemup )b 4 e }
+ { \stemup b 4 e }
\context Voice = ii { \stemdown g, 4 b }
>
\stemboth |
\context Voice=ii { \stemdown c2 r4 e, 4 ~ e 8 }
>
\stemboth
- d,( fis a fis d c' a |
- )b g( b d b g f'! d |
- )e g,( c e c g g' e |
- )fis a,( c fis c a a' fis |
+ d, fis a fis d c' a |
+ b g b d b g f'! d |
+ e g, c e c g g' e |
+ fis a, c fis c a a' fis |
<
- { \stemup )g2 }
+ { \stemup g2 }
\context Voice = ii { \stemdown <d2 b > }
>
\stemboth
- r4 b4( |
+ r4 b4 |
c,8 e g c g e bes' g |
- )a16-> g f e d c b ! a
+ a16 g f e d c b ! a
b g a b c d e f |
g4
<
>
\stemboth
<
- { \stemup c1^5 }
- \context Voice=ii { \stemdown e, 1_1}
+ { \stemup c1 }
+ \context Voice=ii { \stemdown e, 1}
>
\stemboth
\bar "|.";
\context Voice=ii { \stemdown c,1 ~ | c ~ | c }
>
\stemboth |
- r8 c( e g e c c' e, |
- )fis d( fis a fis d d' fis, |
- )g2 r4 g( |
- )a8 a,( c e c a g' e |
- )fis2 r4 d |
+ r8 c e g e c c' e, |
+ fis d fis a fis d d' fis, |
+ g2 r4 g |
+ a8 a, c e c a g' e |
+ fis2 r4 d |
g-\mordent-"(\\textsharp)" g, 4 g'-\mordent g, |
% mordents in brackets...
g'-\mordent g, g'-\mordent g, |
g'-\mordent g, g'-\mordent g, |
- g'8 g,( b d b g f'! d |
- )e c e g e c c' e, |
- \property Voice . textStyle = "finger"
- f1^"3\\_1" ~ |
- f8 d e c g'4 g,^"5\\_2" |
+ g'8 g, b d b g f'! d |
+ e c e g e c c' e, |
+
+ f1 |
+ f8 d e c g'4 g, |
<c1 c,1>
\bar "|.";
}
>
>
\paper{
- }
+ linewidth = 18.0 \cm;
+ }
\midi{ \tempo 4 = 100; }
\header {
opus = "BWV 939";
- Kellner was a student of Bach's.
+
+ Kellner was a student of Bach's that copied some 90 works of his master.
+
%}
\header{
mutopiainstrument = "Piano";
style = "baroque";
copyright = "Public Domain";
- tagline = "\\\\This music is part of the Mutopia project, http://sca.uwaterloo.ca/Mutopia/\\\\It has been typeset and placed in the public domain by Jan Nieuwenhuizen.\\\\Unrestricted modification and redistribution is permitted and encouraged - copy this music and share it!";
+
+ maintainer = "Jan Nieuwenhuizen";
+ maintainer_email = "janneke@gnu.org";
+ tagline = "\\\\This music is part of the Mutopia project, http://sca.uwaterloo.ca/Mutopia/\\\\It has been typeset and placed in the public domain by " + \maintainer + ".\\\\Unrestricted modification and redistribution is permitted and encouraged - copy this music and share it!";
maintainer = "janneke@gnu.org";
- lastupdated = "1999/Oct/16";
-
+ lastupdated = "1999/Nov/14";
}
+
%{
TODO: this file needs additional layouting: the upper voice should
switch staffs to avoid leger lines.
+Not all editions agree on the last note: ed. Lemoine has a quarter
+note, some have dotted half notes.
+
+
%}
\version "1.3.4";
r16 [fis, c es] [c fis, c fis,] r fis, r fis, |
r16 [fis, c es] [c fis, c fis,] r fis, r fis, |
r16 [g, b, d] [b, g, b, d] [es c a, fis] |
+
+
\context Staff <
- \context Voice=i {\stemup g2.-\fermata\mf}
- \context Voice=ii {\stemdown <b,2. d>}
+ \context Voice=i {\stemup g4-\fermata}
+ \context Voice=ii {\stemdown <b,4 d>}
>
\stemboth
\bar "|.";
c4 r [as8 f] |
c4 r [as8 f] |
- c4-- r [es8 c] |
- bes,!4-- r [es8 c] |
- as,!4-- r [es8 c] |
+ c4 r [es8 c] |
+ bes,!4 r [es8 c] |
+ as,!4 r [es8 c] |
- g,4-- r [es8 c] |
- fis,4-- r [es8 c] |
+ g,4 r [es8 c] |
+ fis,4 r [es8 c] |
fis,4 r [fis8 d] |
g,4 r [d8 bes,] |
+%{
+
+ Six Petits Preludes,
+ Collection Johann Peter Kellner
+ ca 1703 - 1707
+
+ Kellner was a student of Bach's that copied some 90 works of his master.
+
+%}
\header{
-filename = "preludes-4.ly";
-%
-% page 8
-%
-% Clavierb"uchlein f"ur W. Fr. Bach
-% Clav. W. Fr. Bach: 27-Praeludium ex d neutral
-% ca 1720
-composer = "Johann Sebastian Bach (1685-1750)";
-enteredby = "jcn";
-copyright = "public domain";
+ copyright = "public domain";
+ source = "Ed. Henry Lemoine Urtext";
+ title = "Pr\\\"aludum";
+ opus = "BWV 925";
+ composer = "Johann Sebastian Bach (1685-1750)";
+ enteredby = "jcn,hwn";
+
+ % mutopia headers.
+ mutopiatitle = "Prelude";
+ mutopiacomposer = "J.S.Bach";
+ mutopiaopus = "BWV925";
+ mutopiainstrument = "Piano";
+ style = "baroque";
+ copyright = "Public Domain";
+ maintainer = "Jan Nieuwenhuizen";
+ maintainer_email = "janneke@gnu.org";
+ tagline = "\\\\This music is part of the Mutopia project, http://sca.uwaterloo.ca/Mutopia/\\\\It has been typeset and placed in the public domain by " + \maintainer + ".\\\\Unrestricted modification and redistribution is permitted and encouraged - copy this music and share it!";
+ maintainer = "janneke@gnu.org";
+ lastupdated = "1999/Nov/14";
}
-\version "1.3.4";
+
+%{
+
+This stretches LilyPond capabilities a little.
+
+%}
one = \context Staff \notes\relative c {
\context Voice=i
\property Voice . textStyle = "italic"
-% r16\p_"legato"
- r16\p
+% r16_"legato"
+ r16
\property Voice . textStyle = "finger"
- d'-1( fis-3 d-1 a'-2 b-3 cis-4 a-3
- d-3 cis-2 d-1 e-2 d-1 fis-3 e-2 d-1 |
+ d'( fis d a' b cis a
+ d cis d e d fis e d |
\property Voice . textStyle = "finger"
\stemup
- )cis4-2 fis-5 ~ fis8 fis-4 e4-3 ~ |
- e16\< \stemboth a,16( cis a d-2 e fis d-1
- g-3 fis g a-4 g-3 b a \!g |
+ )cis4 fis ~ fis8 fis e4 ~ |
+ e16 \stemboth a,16( cis a d e fis d
+ g fis g a g b a g |
\stemup
-% )fis4-"2\\_3" e8-2 a-5 <fis4-4 d-2> <gis-5 e-3> |
- )fis4 e8-2 a-5 <fis4-4 d-2> <gis-5 e-3> |
+
+ )fis4 e8 a <fis4 d> <gis e> |
%5
- <a4-5( e> <fis-4 d-2> < )g!16-5 d> fis-2 g-3 a-4
+ <a4( e> <fis d> < )g!16 d> fis g a
\stemboth
- g-3 b a g |
+ g b a g |
\property Voice . textStyle = "italic"
-% fis_"dim." e fis-3 g fis-3 a-5 g fis
- fis e fis-3 g fis-3 a-5 g fis
+
+ fis e fis g fis a g fis
\property Voice . textStyle = "finger"
% e4-"2\\_5" ~ e16 e,( fis g |
e4 ~ e16 e,( fis g |
\property Voice . textStyle = "italic"
-% a-4_"dim." g-1 a b a-2 c-4 b a
- a-4 g-1 a b a-2 c-4 b a
- g-1 fis-2 g-3 a g-3 b a g |
+
+ a g a b a c b a
+ g fis g a g b a g |
\stemup
- )fis4\p
+ )fis4
\skip 4*7; |
%10
\property Voice . textStyle = "finger"
-% d'4.\mf cis8-"4\\_5" ~ cis b4-5 a8-"4\\_5" ~ |
- d'4.\mf cis8 ~ cis b4-5 a8 ~ |
+% d'4. cis8-"4\\_5" ~ cis b4 a8-"4\\_5" ~ |
+ d'4. cis8 ~ cis b4 a8 ~ |
\property Voice . textStyle = "italic"
-% a g4-5 fis8-4 ~ fis16 fis-4-"dim." e-3 d-2
- a g4-5 fis8-4 ~ fis16 fis-4 e-3 d-2
+
+ a g4 fis8 ~ fis16 fis e d
\property Voice . textStyle = "finger"
% e4-"3\\_5" ~ |
e4 ~ |
- e16 e-5 d cis d4-5 ~ d16 d-5 cis b cis4-5 |
+ e16 e d cis d4 ~ d16 d cis b cis4 |
\stemboth
- fis,16-1\p a-2 d-5\< c-4 b-1 d-2 g-5 fis-4
- d-1 b'-5 a g fis-2 e-1 d-4 \!c!-3 |
- b-2 d-1 g a fis8-\prall e16-4 d-3
+ fis,16 a d c b d g fis
+ d b' a g fis e d c! |
+ b d g a fis8-\prall e16 d
d8. e16~ e d8 cis16 |
%15
\stemup
- r16 d-1\< fis d g a b g-1 c-3 b c d c e d-4 \!c |
- b4-5 a ~ a8 g-5 ~ g16 fis8-4 e16-3 |
- fis8-4 e-5~ e d-5~ d4 cis-4 |
-% d2\p-"rall." ~ d16 a-2( b-3 cis-4 )d4-5 |
- d2\p ~ d16 a-2( b-3 cis-4 )d4-5 |
+ r16 d fis d g a b g c b c d c e d c |
+ b4 a ~ a8 g ~ g16 fis8 e16 |
+ fis8 e~ e d~ d4 cis |
+
+ d2 ~ d16 a( b cis )d4 |
\bar "|.";
}
\context Voice=ii
\stemup
\property Voice . textStyle = "finger"
- fis4-1( e8-2 a4 a4 gis8-2 |
+ fis4( e8 a4 a4 gis8 |
) a8
\translator Staff=upper \stemdown
-% a'4 a8 b4.-"2\\_1" cis8 ~ |
+
a'4 a8 b4. cis8 ~ |
cis8
\translator Staff=lower \stemup
a,8 ~ a d ~ d d4-> cis8 |
d8
\translator Staff=upper \stemdown
- d'4-> cis8-1 ~ cis b4-1 b8 |
+ d'4-> cis8 ~ cis b4 b8 |
%5
r8 a4 a8
\translator Staff=lower \stemup
- g8-1( fis-2 )e4-1 ~ |
- e4 d ~ d16 d-1 cis-2 b-1 cis4-2 ~ |
- cis8 a-3 d4.-1 d4^> cis8-2 |
+ g8( fis )e4 ~ |
+ e4 d ~ d16 d cis b cis4 ~ |
+ cis8 a d4. d4^> cis8 |
\translator Staff=upper \stemdown
- d4 \stemboth r16 b-1\< d-2 b~ <g'4-5 e-3 b>
- r16 cis,-1 e-2 \!cis~ |
- <a'4-5 fis-3 cis> r16 d,-1 fis-2 d~ <b'4-5 g-3 d>
- r16 fis-1 a fis~ |
+ d4 \stemboth r16 b d b~ <g'4 e b>
+ r16 cis, e cis~ |
+ <a'4 fis cis> r16 d, fis d~ <b'4 g d>
+ r16 fis a fis~ |
%10
\stemdown
fis4 e d cis |
b a b4. b8 |
a4
\translator Staff=lower \stemup
- r16 b-3 fis-1 a-2 g4-1 r16 a-3 e-1 g-2 |
+ r16 b fis a g4 r16 a e g |
\skip 1*1;
s16
\translator Staff=upper \stemdown
- d'8.-1 ~ d8 c d4 a8 g |
+ d'8. ~ d8 c d4 a8 g |
%15
- fis8 \translator Staff=lower \stemup c'-1 b4-1 \stemdown <a
+ fis8 \translator Staff=lower \stemup c' b4 \stemdown <a
\translator Staff=upper \stemdown
- a'4.-2>
+ a'4.>
\stemdown
a'8~ |
- a g-3~ g16 e fis8~ fis16 d8.~ d8. cis!16 |
+ a g~ g16 e fis8~ fis16 d8.~ d8. cis!16 |
\translator Staff=lower \stemup
\context Staff <
- \context Voice=i { \stemup d8-2 a~ a4 }
- \context Voice=ii { \stemdown a8-1 g fis16-2 e-1 fis-2 d-1 }
+ \context Voice=i { \stemup d8 a~ a4 }
+ \context Voice=ii { \stemdown a8 g fis16 e fis d }
>
\stemup
- g-1 fis-2 g-1 a-2 g-1 b-3 a-2 g-1 ~ |
- g g-1 fis-2 e-1 fis4-2 ~ fis2
+ g fis g a g b a g ~ |
+ g g fis e fis4 ~ fis2
\bar "|.";
}
three = \notes\relative c{
\context Voice=iii
\stemdown
- d4-3 cis-4 b e-3 |
- a16 a,-5\mf( cis-3 a-5 d-2 e-1 fis-2 d-4
- g-1 fis-3 g a g b a g |
- )fis4 fis e a-4 |
- d16 \stemboth d,-5\f( fis-3 d-5 a'-2 b-1 cis-2 a-4
- d-1 cis-3 d e d-4 fis-2 e-1 ) d |
+ d4 cis b e |
+ a16 a,( cis a d e fis d
+ g fis g a g b a g |
+ )fis4 fis e a |
+ d16 \stemboth d,( fis d a' b cis a
+ d cis d e d fis e ) d |
%5
- cis-3 b-4 cis-3 d-2 c-4 e-2 d-3 c-4
- \stemdown b4-5 cis8-4 b-3( |
- a-4 )fis-5 b-2 a-3 gis-4 e-5 a-3 g-4 |
- fis4. d8-5 e4-5 a4-3 |
+ cis b cis d c e d c
+ \stemdown b4 cis8 b( |
+ a )fis b a gis e a g |
+ fis4. d8 e4 a4 |
\stemboth
- r16 d,-4( fis-2 d-4 )g8-.-1 g,-.-5
- r16 e'-4( g-2 e-4 )a8-. a,-.-5 |
- r16 fis'-4( a fis )b8-. b,-. r16 g'-4( b g )d'8-. d,-. |
+ r16 d,( fis d )g8-. g,-.
+ r16 e'( g e )a8-. a,-. |
+ r16 fis'( a fis )b8-. b,-. r16 g'( b g )d'8-. d,-. |
%10
- r16 d,16-5( fis-3 d a'-2 b-1 cis-2 a-4 d b-5 d-3 b
- fis'-2 g a-2 fis-4 |
- )fis16 g,( b g d'-2 e fis-2 d-4 )g8-. g,-. r16 cis-4( e cis |
- )fis8-. fis,-. \stemdown r16 b-4( d b )e8-. e,-.
- r16 a-4 cis a |
+ r16 d,16( fis d a' b cis a d b d b
+ fis' g a fis |
+ )fis16 g,( b g d' e fis d )g8-. g,-. r16 cis( e cis |
+ )fis8-. fis,-. \stemdown r16 b( d b )e8-. e,-.
+ r16 a cis a |
\stemboth
- d-1 e-3 fis-2 d-4 g-1 fis-2 e-3 d-1 cis!-3 a-5 b cis
- d-2 e fis-2 d-4 |
- g8 e-3 \stemdown a a, b8.-4 g16-5 a4-4 |
+ d e fis d g fis e d cis! a b cis
+ d e fis d |
+ g8 e \stemdown a a, b8. g16 a4 |
%15
- d8-5 a'-2~ a g-3~ g g-3 fis4-4 |
+ d8 a'~ a g~ g g fis4 |
\stemup
- r16 g-2 b-1 g-3 d'8.-1 c16-1 b8.-2 bes16-3 a8-1 g |
+ r16 g b g d'8. c16 b8. bes16 a8 g |
\stemdown
- r16 a,-2 cis!-1 a'-2 d,-1 e fis d e8-1 d-2 e-1 a,-2 |
- d a-2~ a16 a-2 b cis-2 d2 |
+ r16 a, cis! a' d, e fis d e8 d e a, |
+ d a~ a16 a b cis d2 |
}
four = \context Staff \notes\relative c{
\skip 1*2; |
s4
\translator Staff=lower \stemup
- a4 ~ a16 d,-2 g8-1 fis e-1 |
+ a4 ~ a16 d, g8 fis e |
%15
\stemdown
d1 ~ |
>
>
\paper{
+ linewidth = 18.0 \cm;
}
\midi{ \tempo 4 = 70; }
\header{
+%{
+
+ Six Petits Preludes,
+ Collection Johann Peter Kellner
+ ca 1703 - 1707
+
+ Kellner was a student of Bach's that copied some 90 works of his master.
+
+%}
+
\header{
-filename = "preludes-5.ly";
-%
-% page 2
-%
-% Clavierb"uchlein f"ur W. Fr. Bach
-% Clav. W. Fr. Bach: 4-Praeludium 2
-% ca 1720
-composer = "Johann Sebastian Bach (1685-1750)";
-enteredby = "jcn";
-copyright = "public domain";
+ copyright = "public domain";
+ source = "Ed. Henry Lemoine Urtext";
+ title = "Pr\\\"aludum";
+ opus = "BWV 926";
+ composer = "Johann Sebastian Bach (1685-1750)";
+ enteredby = "jcn,hwn";
+
+ % mutopia headers.
+ mutopiatitle = "Prelude";
+ mutopiacomposer = "J.S.Bach";
+ mutopiaopus = "BWV926";
+ mutopiainstrument = "Piano";
+ style = "baroque";
+ copyright = "Public Domain";
+ maintainer = "Jan Nieuwenhuizen";
+ maintainer_email = "janneke@gnu.org";
+ tagline = "\\\\This music is part of the Mutopia project, http://sca.uwaterloo.ca/Mutopia/\\\\It has been typeset and placed in the public domain by " + \maintainer + ".\\\\Unrestricted modification and redistribution is permitted and encouraged - copy this music and share it!";
+ maintainer = "janneke@gnu.org";
+ lastupdated = "1999/Nov/14";
+
}
-\version "1.3.4";
+\version "1.3.4";
-upper = \context Staff \notes\relative c{
+upper = \context Staff \notes\relative c
+ \context Voice=i {
\property Voice . textStyle = "italic"
- \context Voice=i
-% d'8-1\p a'-5-"legato" f-3 d-1 a'-5 f-3 |
- d'8-1\p a'-5 f-3 d-1 a'-5 f-3 |
- d-1 a'-5 f-3 d-1 a'-5 f-3 |
- d-1\< bes'-4 g-2 d-1 bes'-4 \!g-2 |
- d-1 bes'-4 g-2 d-1 bes'-5 g-3 |
+
+
+ [d'8 a' f d a' f] |
+ d a' f d a' f |
+ d bes' g d bes' g |
+ d bes' g d bes' g |
%5
- cis,-1\mf g'-4 e-2 cis-1 g'-4 e-2 |
- cis-1 bes'-5 g-4 e-2 a-5 g-4 |
- f-3\< d-1 f-2 a-4 f-1 a-2 |
- d-5 a-1 d-2 f-4 d-1 \!f-2 |
- b\> f-3 e d c-3 b |
+ cis, g' e cis g' e |
+ cis bes' g e a g |
+ f d f a f a |
+ d a d f d f |
+ b ( f e d c b |
%10
- a gis-3 fis e d'-5 \!b-2 |
+ a gis fis )e d' b |
<
{
\stemup
\property Voice . textStyle = "roman"
- c4-\mordent^"(\\textsharp)"\p r r |
+ c4-\mordent^"(\\textsharp)" r r |
c4-\mordent^"(\\textsharp)" r r
\property Voice . textStyle = "italic"
}
\context Voice=ii { \stemdown a4 r r | a4 r r }
> |
\stemboth
- a'8\mf( es-3\> d c bes!-3 a |
- g fis-3 e!-2 d-1 c'-4 \!a |
+ a'8( es d c bes a |
+ g fis e! )d c' a |
%15
- )bes8-\mordent\p( d8-5 bes-3 g-1 )g'4 |
- r8 d-5( c bes a-\prall g |
- )a-2 c-4( a f ) f'4 |
- r8 c-5 bes a g-\prall f |
- g-2 bes-4 a g f-1 e-2 |
+ bes8-\mordent d8 bes g g'4 |
+ r8 d c bes a-\prall g |
+ a c a f f'4 |
+ r8 c bes a g-\prall f |
+ g bes a g f e |
%20
- f-3 d-1 f-2 a-3 d-5 g,-2 |
+ f d f a d g, |
<
{
\stemup
% ... textnatural
-% cis8-\prall e8-5-"poco cresc." cis-3 a e' cis
- cis8-\prall e8-5 cis-3 a e' cis
+% cis8-\prall e8-"poco cresc." cis a e' cis
+ cis8-\prall e8 cis a e' cis
}
\context Voice=ii { \stemdown a4 }
>
\stemboth
- a8 e'-5 cis a bes!-3 a |
- g e'-5 cis-3 g e'-5 cis-3 |
- g-1 e'-5 cis g a-3 g |
-% f-"dim." d'-5 bes f d' bes |
- f d'-5 bes f d' bes |
+ a8 e' cis a bes! a |
+ g e' cis g e' cis |
+ g e' cis g a g |
+
+ f d' bes f d' bes |
%25
- f d'-5 bes f d' bes |
-% fis-2-"dim." c'-5 a-3 fis-2 c'-5 a-3 |
- fis-2 c'-5 a-3 fis-2 c'-5 a-3 |
- fis-2 c'-5 a-3 fis-2 c'-5 a-3 |
- bes-4 g-1 fis-2 g-3 d-1 g-2 |
- bes-4 g-2 d-1 bes'-5 g-3 d-1 |
+ f d' bes f d' bes |
+
+ fis c' a fis c' a |
+ fis c' a fis c' a |
+ bes g fis g d g |
+ bes g d bes' g d |
%30
- e-2\p g-4 fis-3 g-1 bes-4 g-2 |
- es-1 bes'-4 g-2 es bes' g |
- cis,-1 bes'-4 g-2 cis, bes' g |
- cis,-1 bes'-4 g-2 cis,-1 a'-5 g-4 |
- f-3 a f d a'-5 f |
+ e g fis g bes g |
+ es bes' g es bes' g |
+ cis, bes' g cis, bes' g |
+ cis, bes' g cis, a' g |
+ f a f d a' f |
%35
- d-1 a'-5 f-3 d-1 cis-2 d-1 |
- e-3\< g-5 e-3 bes-1 g'-5 e-3 |
- bes-1 g'-5 e-3 \!cis-2 a-1 g'-5 |
- f16-4\mf d-2 c-1 bes-3 \stemup a-2 s16 s8 s4 |
+ d a' f d cis d |
+ e g e bes g' e |
+ bes g' e cis a g' |
+ f16 d c bes \stemup a s16 s8 s4 |
% ugh
% s1 |
s4 s4 s4 |
%40
- s4 s16 [d16-1-"m.d." f-2 a-4] \stemdown [d,-2-"m.g." f a] \stemup d-1 |
+ s4 s16 [d16 f a] \stemdown [d, f a] \stemup d |
\stemboth
- f a-4 f d f-4 d b d-5 gis,-2 b a gis |
- <g'!4.-5\f e a,> a8-5
- <
- {
- \stemup
- f4-4\> ~ | [\!f8 e] [e32-4 f e8.] ~ [e8 d-3]
+ f a f d f d b d gis, b a gis |
+
+ % arpeggio
+ <g'!4. e a,> a8
+ < f4 d a > ~
+ [f8 e]
+ < { \stemup
+ e4.^\prall d8
}
- \context Voice=ii { \stemdown <d4 a> r4 cis-2 }
- > |
+ \context Voice=ii { \stemdown cis2 }
+ >
\stemboth
- d8-4 c!-3 a-1 d-4 bes-2 g-1 |
+ d8 c! a d bes g |
%45
- c-5 a-3 fis-2 bes-4 g e |
-% a-5 fis-"dim. e rall." d g-5 e cis-2 |
- a-5 fis d g-5 e cis-2 |
- <
- { \stemup <fis2-.-5\p a,> }
- \context Voice=ii { \stemdown [d32( cis d8.] ~ ) d2 }
- > |
- \bar "|.";
+ c a fis bes g e |
+
+ a fis d g e cis |
+
+ % the mordent is on the D !
+ <fis2. d-\mordent a>
}
lower = \context Staff \notes\relative c{
\context Voice=i
-% d32( cis )d8. r4 r |
+
d4-\mordent r r |
d,4 r r |
d'-\mordent r r |
d,4 r r |
d'-\mordent r r |
-% d r r |
+
d,4 r r |
- d'8-2 a-5 d-2 f-1 d-4 f-2 |
- a-1 f-4 a-2 d-1 a-2 d-1 |
- gis,4-3 r r |
- e-4( )gis-2 e |
- a8-4 e'-1 c-2 a-4 e'-1 c-2 |
- g!-5 es'-1 c-1 g-5 es'-1 c-1 |
- fis,4-5 r r
- d-4( ) fis d-5 |
+ d'8 a d f d f |
+ a f a d a d |
+ gis,4 r r |
+ e gis e |
+ a8 e' c a e' c |
+ g! es' c g es' c |
+ fis,4 r r
+ d fis d |
\property Voice . textStyle = "roman"
g4-\mordent^"(\\textsharp)" r r8 f!8 |
\property Voice . textStyle = "italic"
e4-\prall r r |
f4-\mordent r r8 e |
- d4 r8 f-1 e d |
- e-2 d-3 cis-4 e-1 d-2 cis-3 |
- d4-2( )c! bes-4 |
- a( )a' a, |
- a( )a' a, |
- a( )a' a, |
- a( )a' a, |
+ d4 r8 f e d |
+ e d cis e d cis |
+ d4 c! bes |
+ a a' a, |
+ a a' a, |
+ a a' a, |
+ a a' a, |
bes r r |
- bes-5( )bes' bes, |
+ bes bes' bes, |
a r r |
- a-2( )d-1 d, |
+ a d d, |
g r r |
- g( )g' g, |
+ g g' g, |
g r r |
- g( )g' g, |
+ g g' g, |
a r r |
- a( )a' a, |
+ a a' a, |
a r r |
- a( )a' a, |
+ a a' a, |
cis, r r |
- cis( )cis' cis, |
- d-4 s16
+ cis cis' cis, |
+ d s16
\stemdown
- [g'16-1-"m.g." f e] f-2 a d,-3 f |
- a, \stemup [d-5-"m.d." c bes]
- a \stemdown [ g-2 f-"m.g." e] d f-4 a-2 d-1 |
+ [g'16 f e] f a d, f |
+ a, \stemup [d c bes]
+ a \stemdown [ g f e] d f a d |
\stemup
-% f-2\ped a
- [f-2-"Ped." a]
+
+ [f a]
\stemdown
-% d-4-"m.g." f-"cresc." a s s8 s4\dep |
-% d,-4-"m.g." f-"cresc." a s s8 s4-"*" |
- [d,-4-"m.g." f] a s s8 s4-"*" |
+ [d, f] a s s8 s4-"*" |
\stemboth
% ugh whole rest has duration of one bar
-% r1 |
- r4 r r |
- cis,8-3( e cis a d16-1 c bes a |
- )g8 g' a-2( g-3 a-1 a, |
- )d4-3 d'-1 d, |
+ R2. |
+% r4 r r |
+ cis,8 e cis a d16 c bes a |
+ g8 g' a g a a, |
+ d4 d' d, |
d r r |
- d,( )d' d, |
+ d, d' d, |
d2. |
- \bar "|.";
}
global = \notes{
\context PianoStaff <
\context Staff = upper <
\global
- \upper
+ { \upper \bar "|." }
>
\context Staff = lower <
\global
>
>
\paper{
+ linewidth = 18.0 \cm;
+
}
\midi{ \tempo 4 = 90; }
\header{
+%{
+
+ Six Petits Preludes,
+ Collection Johann Peter Kellner
+ ca 1703 - 1707
+
+ Kellner was a student of Bach's that copied some 90 works of his master.
+
+%}
+
\header{
-filename = "preludes-6.ly";
-%
-% page 11
-%
-% Six Petits Preludes
-% Collection Johann Peter Kellner
-% ca 1703 - 1707
-composer = "Johann Sebastian Bach (1685-1750)";
-enteredby = "jcn";
-copyright = "public domain";
+ copyright = "public domain";
+ source = "Ed. Henry Lemoine Urtext";
+ title = "Pr\\\"aludum";
+ opus = "BWV 940";
+ composer = "Johann Sebastian Bach (1685-1750)";
+ enteredby = "jcn,hwn";
+
+ % mutopia headers.
+ mutopiatitle = "Prelude";
+ mutopiacomposer = "J.S.Bach";
+ mutopiaopus = "BWV940";
+ mutopiainstrument = "Piano";
+ style = "baroque";
+ copyright = "Public Domain";
+ maintainer = "Jan Nieuwenhuizen";
+ maintainer_email = "janneke@gnu.org";
+ tagline = "\\\\This music is part of the Mutopia project, http://sca.uwaterloo.ca/Mutopia/\\\\It has been typeset and placed in the public domain by " + \maintainer + ".\\\\Unrestricted modification and redistribution is permitted and encouraged - copy this music and share it!";
+ maintainer = "janneke@gnu.org";
+ lastupdated = "1999/Nov/14";
+
}
+
\version "1.3.4";
+
one = \context Staff \notes\relative c{
\context Voice=i
\skip 1; |
\stemup
- r4 d''2-5( cis4-4 |
+ r4 d''2 cis4 |
\stemboth
- )d16-5\mf a'-4( g f e f-4 cis-2 d-1
- e8.-\mordent f16 d8.-\prall-1 cis16-3 |
+ d16 a' g f e f cis d
+ e8.-\mordent f16 d8.-\prall cis16 |
\stemup
- )cis4\> ~ cis16 a \!d8 ~ d4 a( |
+ cis4 ~ cis16 a d8 ~ d4 a |
%5
- )b2-4 ~ b4 a-5 ~ |
- a16 a-5 \stemup g! f g4-4\< ~ g f-3 ~ |
- \!f16 a g f e16 g8.-5 ~ g16 g-5 f-4 e-3 d-1 f8.-4 ~ |
- f16 f-3 e d b'4 a-5 g-5 |
-% fis4-4 g r8\<-"rall." g16-1( bes-2 \!e4-5 |
- fis4-4 g r8\< g16-1( bes-2 \!e4-5 |
+ b2 ~ b4 a ~ |
+ a16 a \stemup g! f g4 ~ g f ~ |
+ f16 a g f e16 g8. ~ g16 g f e d f8. ~ |
+ f16 f e d b'4 a g |
+
+ fis4 g r8 g16 bes e4 |
%10
- )d1-5
+ d1
\bar "|.";
}
two = \context Staff \notes\relative c{
\context Voice=ii
- r16\p d''-5( c-4 bes-3 a-2 bes-3 f-1 g-2
- a8.-\mordent bes16-1 g8.-\prall f16-1 |
+ r16 d'' c bes a bes f g
+ a8.-\mordent bes16 g8.-\prall f16 |
\stemdown
- )f2 e2 |
+ f2 e2 |
\translator Staff=lower \stemup
- r4 a,-1 bes-2 b-1 |
+ r4 a, bes b |
\translator Staff=upper \stemdown
- r16 b'-3 a-1 g-2 f8. f16-2 e2 ~ |
+ r16 b' a g f8. f16 e2 ~ |
%5
- e2 ~ e4 ~ e16 e-2 f! d-1 |
+ e2 ~ e4 ~ e16 e f! d |
s4 e32 d e8.~ e4 d4 ~ |
- d4. cis16-2 d-1 cis4 d-1 ~ |
- d8 r r16 e-2 f d r16 e-2 f d r d-1 e-3 cis |
- r16 e-3 d-1 c!-2 bes! d8. s4 r16\> bes'-2 a-2 \!g-1 |
+ d4. cis16 d cis4 d ~ |
+ d8 r r16 e f d r16 e f d r d e cis |
+ r16 e d c! bes! d8. s4 r16 bes' a g |
%10
- fis1-2
+ fis1
}
three = \context Staff \notes\relative c{
\context Voice=iii
\stemup
- f2-1( e-2 |
+ f2 e |
\stemboth
- )d16 d'( c bes a-4 bes-2 f-5 g-4
- a8.-\mordent bes16-2
- g8.-\prall-4 f16-5 |
- )f2-5 g4-4 gis |
- a2-2 ~ a16 a-1( g f e-4 f-2 c-5 d |
+ d16 d' c bes a bes f g
+ a8.-\mordent bes16
+ g8.-\prall f16 |
+ f2 g4 gis |
+ a2 ~ a16 a g f e f c d |
%5
- e8.-\mordent f16 d8.-\prall-4 c16-5 \stemboth )c4.-5 d8-4 |
+ e8.-\mordent f16 d8.-\prall c16 \stemboth c4. d8 |
\stemdown
- e4 ~ e16 f-2( e-3 d-4 cis a b cis-3 d-4 e-3 f-2 d-4 |
+ e4 ~ e16 f e d cis a b cis d e f d |
\property Voice . textStyle = "finger"
- )bes!2-"5\\_4" a ~ |
+ bes!2 a ~ |
a a |
- d, cis'-5 |
+ d, cis' |
%10
- a'1-2
+ a'1
\bar "|.";
}
four = \context Staff \notes\relative c{
\context Voice=iv
\stemdown
- d2-3 cis-4 |
+ d2 cis |
\skip 1*2; |
\skip 4*3;
\translator Staff=upper \stemup \property Voice.horizontalNoteShift = 1
- c''4-5 |
+ c''4 |
%5
- a gis-2 ~ gis16 gis-3 fis e
+ a gis ~ gis16 gis fis e
\skip 4*1;
\translator Staff=lower \stemdown \property Voice.horizontalNoteShift = 0
\stemup
- b2-1 a-1 |
+ b2 a |
g a4. gis16 a |
- gis2 < g8 cis,> <f-3 d-1> e4-2 |
- d4. fis16-3 g-2 r16 bes8.-1 ~ bes4 |
+ gis2 < g8 cis,> <f d> e4 |
+ d4. fis16 g r16 bes8. ~ bes4 |
%10
\stemdown
- d,1-5
+ d,1
}
global = \notes{
>
>
\paper{
+ linewidth = 18.0 \cm;
+
}
\midi{ \tempo 4 = 40; }
\header{
- piece = "6";
opus = "BWV 940";
}
}
mutopiainstrument = "Piano";
style = "baroque";
copyright = "Public Domain";
- tagline = "\\\\This music is part of the Mutopia project, http://sca.uwaterloo.ca/Mutopia/\\\\It has been typeset and placed in the public domain by Jan Nieuwenhuizen.\\\\Unrestricted modification and redistribution is permitted and encouraged - copy this music and share it!";
+ tagline = "\\\\This music is part of the Mutopia project, http://sca.uwaterloo.ca/Mutopia/\\\\It has been typeset and placed in the public domain by " + \maintainer + ".\\\\Unrestricted modification and redistribution is permitted and encouraged - copy this music and share it!";
maintainer = "janneke@gnu.org";
lastupdated = "1999/Oct/16";
copyright = "\\\\This music is part of the Mutopia project, http://sca.uwaterloo.ca/Mutopia/\\\\It has been typeset and placed in the public domain by Han-Wen Nienhuys.\\\\Unrestricted modification and redistribution is permitted and encouraged - copy this music and share it!";
maintainer = "hanwen@cs.uu.nl";
lastupdated = "1999/Oct/14";
-
- }
+}
% It would be nice to squeeze this onto two pages, but I am not sure
))
)
+(define generic-dot-properties
+ (cons "Dots" (list
+ (list 'dotDirection dir? 'direction)
+ (list 'verticalDirection dir? 'direction)
+ )
+ ))
+
(define generic-text-properties
(cons "Text_item" (list
(list 'textStyle string? 'style)
(define generic-voice-properties
(list
generic-stem-properties
+ generic-tie-properties
generic-rest-properties
generic-slur-properties
generic-beam-properties
)
(define generic-thread-properties
- (list generic-All-properties))
+ (list generic-All-properties
+ generic-dot-properties
+
+ )
+
+ )
; :use-module (ice-9 regex))
+;; do nothing in .scm output
+(define (comment s)
+ ""
+ )
+
+
(define
(xnumbers->string l)
(string-append
(map (lambda (n) (string-append (number->string n ) " ")) l)))
+(define (mm-to-pt x)
+ (* (/ 72.27 25.40) x)
+ )
+
+(define (cons-map f x)
+ (cons (f (car x)) (f (cdr x))))
+
(define (reduce operator list)
(if (null? (cdr list)) (car list)
(operator (car list) (reduce operator (cdr list)))
("volta" . "feta-nummer"))
)
+(define (string-encode-integer i)
+ (cond
+ ((= i 0) "o")
+ ((< i 0) (string-append "n" (string-encode-integer (- i))))
+ (else (string-append
+ (make-string 1 (integer->char (+ 65 (modulo i 26))))
+ (string-encode-integer (quotient i 26))
+ )
+ )
+ )
+ )
+
+(define (magstep i)
+ (cdr (assoc i '((-4 . 482)
+ (-3 . 579)
+ (-2 . 694)
+ (-1 . 833)
+ (0 . 1000)
+ (1 . 1200)
+ (2 . 1440)
+ (3 . 1728)
+ (4 . 2074))
+ )
+ )
+ )
+
(define script-alist '())
(define (articulation-to-scriptdef a)
(assoc a script-alist)
(assoc s cmr-alist )
)
+(define (define-font name-mag)
+ (cons name-mag
+ (string-append "\\magfont"
+ (string-encode-integer (hash (car name-mag) 1000000))
+ "m"
+ (string-encode-integer (cdr name-mag)))
-(define (tex-scm action-name)
+ )
+ )
+
+(define font-name-alist '())
+(define (define-fonts names)
+ (set! font-name-alist (map define-font names))
+ (apply string-append (map (lambda (x)
+ (string-append "\\font" (cdr x) "="
+ (symbol->string (caar x))
+ " scaled "
+ (number->string (magstep (cdar x)))
+ "\n"))
+ font-name-alist
+ )
+ )
+ )
+
+
+(define (tex-scm action-name)
(define (unknown)
"%\n\\unknown%\n")
- (define font-alist '())
- (define font-count 0)
- (define current-font "")
- (define (clear-fontcache)
- (begin
- (set! font-alist '())
- (set! font-count 0)
- (set! current-font "")))
-
- (define (cached-fontname i)
- (string-append
- "\\lilyfont"
- (make-string 1 (integer->char (+ 65 i)))))
- (define (select-font font-name magnification)
- (if (not (equal? font-name current-font))
- (let* ((font-cmd (assoc font-name font-alist)))
- (set! current-font font-name)
- (if (eq? font-cmd #f)
- (begin
- (set! font-cmd (cached-fontname font-count))
- (set! font-alist (acons font-name font-cmd font-alist))
- (set! font-count (+ 1 font-count))
- (if (equal? font-name "")
- (error "Empty fontname -- SELECT-FONT"))
- (if (> magnification 0)
- (string-append "\\font" font-cmd "=" font-name
- " scaled \\magstep "
- (number->string magnification) font-cmd)
- (string-append "\\font" font-cmd "=" font-name font-cmd)))
-
- (cdr font-cmd)))
- "" ;no switch needed
- ))
+ (define (select-font font-name-symbol)
+ (let*
+ (
+ (c (assoc font-name-symbol font-name-alist))
+ )
+
+ (if (eq? c #f)
+ (begin
+ (ly-warn (string-append
+ "Programming error: No such font known " (car font-name-symbol)))
+ "") ; issue no command
+ (cdr c))
+
+
+ ))
(define (beam width slope thick)
(embedded-ps ((ps-scm 'beam) width slope thick)))
(define (embedded-ps s)
(string-append "\\embeddedps{" s "}"))
+ (define (comment s)
+ (string-append "% " s))
+
(define (end-output)
"\n\\EndLilyPondOutput")
(define (start-line ht)
(begin
- (clear-fontcache)
(string-append"\\vbox to " (number->dim ht) "{\\hbox{%\n"))
)
(define (stop-line)
(define font-alist '())
(define font-count 0)
(define current-font "")
- (define (clear-fontcache)
- (begin
- (set! font-alist '())
- (set! font-count 0)
- (set! current-font "")))
+
(define (cached-fontname i)
(string-append
(define (mag-to-size m)
(number->string (case m
- ('0 12)
- ('1 12)
- ('2 14) ; really: 14.400
- ('3 17) ; really: 17.280
- ('4 21) ; really: 20.736
- ('5 24) ; really: 24.888
- ('6 30) ; really: 29.856
+ (0 12)
+ (1 12)
+ (2 14) ; really: 14.400
+ (3 17) ; really: 17.280
+ (4 21) ; really: 20.736
+ (5 24) ; really: 24.888
+ (6 30) ; really: 29.856
)))
(define (select-font font-name magnification)
(string-append
(numbers->string (list width slope thick)) " draw_beam" ))
+ (define (comment s)
+ (string-append "% " s))
+
(define (bracket arch_angle arch_width arch_height width height arch_thick thick)
(string-append
(numbers->string (list arch_angle arch_width arch_height width height arch_thick thick)) " draw_bracket" ))
(define (start-line height)
(begin
- (clear-fontcache)
"\nstart_line {\n"))
(define (stem breapth width depth height)
\def\leftalign#1{\hbox to 0pt{#1\hss}}
\input feta20.tex
-\font\textmusic=cmmi10
-\def\textsharp{\raise.4ex\hbox{\textmusic\char"5D}}
-\def\textnatural{\raise.4ex\hbox{\textmusic\char"5C}}
-\def\textflat{\raise.2ex\hbox{\textmusic\char"5B}}
-
-
-
-
% stacked horizontal lines
\def\interscoreline{\vskip 16pt}