sourced.
* lily/tuplet-bracket.cc (make_bracket): change edge-widen to
bracket-flare
(make_bracket): simplify code.
* lily/parser.yy (verbose_command_req): catch typos in \key scale
argument.
* python/lilylib.py (lilypond_version_check): new function
* scripts/lilypond-book.py (TexiPaper.incl_opt): idem
* scripts/ly2dvi.py (run_lilypond): add version check.
* scripts/lilypond-book.py (option_definitions): typo
* scripts/ly2dvi.py (include_path): typo
* Documentation/user/refman.itely: updates, fixes.
2003-07-23 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ * buildscripts/lilypond-profile.sh: error message if script is not
+ sourced.
+
+ * lily/tuplet-bracket.cc (make_bracket): change edge-widen to
+ bracket-flare
+ (make_bracket): simplify code.
+
+ * lily/parser.yy (verbose_command_req): catch typos in \key scale
+ argument.
+
+ * python/lilylib.py (lilypond_version_check): new function
+
+ * scripts/lilypond-book.py (TexiPaper.incl_opt): idem
+
+ * scripts/ly2dvi.py (run_lilypond): add version check.
+
* scripts/lilypond-book.py (option_definitions): typo
* scripts/ly2dvi.py (include_path): typo
@menu
* Percussion staves::
-* Percussion midi output::
+* Percussion MIDI output::
@end menu
@node Percussion staves
# If run by hand or from you .profile, run as follows
# . lilypond-profile
-
-
+if [ `basename "$0"` = "lilypond-profile" ] ; then
+ echo "This script must be sourced, i.e."
+ echo ""
+ echo " . lilypond-profile"
+ echo ""
+
+ exit 2
+fi
if [ -z "$LILYPONDPREFIX" ]; then
datadir=`echo "@local_lilypond_datadir@" | sed 's!//!/!g'`
else
+++ /dev/null
-\version "1.7.18"
-\header{
-
-texidoc="
-Tuplets are indicated by a bracket with a number. There should be no
-bracket if there is a beam exactly matching the length of the tuplet.
-The bracket does not interfere with the stafflines, and the number is
-centered in the gap in the bracket.
-
-The bracket stops at the end of the stems, if the stems have the same
-direction as the
-
-
-"
-
-}
-\paper { raggedright= ##t }
-
-\score{
- \notes \context Voice \relative c'' {
- \times 2/3 { \times 2/3 { a8 b c} c }
- \times 2/3 { r8 b-[ f] }
- \times 2/3 { r8 b r8 }
- c4 |
-
- \times 3/4 { c4 c4 c4 c4 } c4 |
-
- \time 6/8
- \times 6/9 { c8 c c c c c c c c }
-
- }
-}
-
-
-
}
Molecule
-Lookup::line (Real th, Offset f, Offset t)
+Lookup::line (Real th, Offset from, Offset to)
{
SCM at = scm_list_n (ly_symbol2scm ("draw-line"),
gh_double2scm (th),
- gh_double2scm (f[X_AXIS]),
- gh_double2scm (f[Y_AXIS]),
- gh_double2scm (t[X_AXIS]),
- gh_double2scm (t[Y_AXIS]),
+ gh_double2scm (from[X_AXIS]),
+ gh_double2scm (from[Y_AXIS]),
+ gh_double2scm (to[X_AXIS]),
+ gh_double2scm (to[Y_AXIS]),
SCM_UNDEFINED);
Box box;
- box.add_point (f);
- box.add_point (t);
+ box.add_point (from);
+ box.add_point (to);
box[X_AXIS].widen (th/2);
box[Y_AXIS].widen (th/2);
$$ = key;
}
| KEY NOTENAME_PITCH SCM_IDENTIFIER {
+
Music *key= MY_MAKE_MUSIC("KeyChangeEvent");
-
- key->set_mus_property ("pitch-alist", $3);
- key->set_mus_property ("tonic", Pitch (0,0,0).smobbed_copy());
- ((Music*)key)->transpose (* unsmob_pitch ($2));
+ if (scm_ilength ($3) > 0)
+ {
+ key->set_mus_property ("pitch-alist", $3);
+ key->set_mus_property ("tonic", Pitch (0,0,0).smobbed_copy());
+ ((Music*)key)->transpose (* unsmob_pitch ($2));
+ } else {
+ THIS->parser_error (_("Second argument must be pitch list."));
+ }
$$ = key;
}
void
Piano_pedal_engraver::create_text_grobs (Pedal_info *p, SCM pedaltype)
{
- SCM b;
SCM s = SCM_EOL;
SCM strings = get_property ( ("pedal" + String (p->name_) + "Strings").to_str0 ());
if (gh_string_p (s))
{
String propname = String (p->name_) + "Pedal";
- b = get_property (propname.to_str0 ());
+
+ SCM b = get_property (propname.to_str0 ());
p->item_ = new Item (b);
p->item_->set_grob_property ("text", s);
Axis_group_interface::add_element (p->line_spanner_, p->item_);
/* Set this property for 'mixed style' pedals, Ped._______/\ ,
so the molecule function will shorten the ____ line by the length of the Ped. text.
*/
-
+
p->bracket_->set_grob_property ("text-start",
- pedaltype == ly_symbol2scm ("mixed") ?
- gh_bool2scm ( (bool) ! p->req_l_drul_[STOP]) :
- gh_bool2scm (false));
+ pedaltype == ly_symbol2scm ("mixed")
+ ? gh_bool2scm ( (bool) ! p->req_l_drul_[STOP])
+ : gh_bool2scm (false));
/*
Mixed style: Store a pointer to the preceding text for use in
while (flip (&d) != LEFT);
-#if 0
- /*
- FIXME. - this switch sucks. --hwn
- */
- // FIXME: ecs tells us -- only for (de)cresc. spanners
- width += gh_scm2double (me->get_grob_property ("width-correct"));
-#endif
SCM properties = Font_interface::font_alist_chain (me);
SCM edge_text = me->get_grob_property ("edge-text");
shorten[LEFT] = 0;
shorten[RIGHT] = 0;
+ SCM ew = me->get_grob_property ("edge-flare");
SCM s = me->get_grob_property ("shorten-pair");
if (gh_pair_p (s))
{
span_points[LEFT] += gh_scm2double (ly_car (s));
span_points[RIGHT] -= gh_scm2double (ly_cdr (s));
}
+ if (gh_pair_p (ew))
+ {
+ span_points[LEFT] += gh_scm2double (ly_car (ew));
+ span_points[RIGHT] -= gh_scm2double (ly_cdr (ew));
+ }
Real thick = me->get_paper ()->get_var ("linethickness");
SCM st = me->get_grob_property ("thickness");
Drul_array<Molecule> edge_line;
s = me->get_grob_property ("edge-height");
- SCM ew = me->get_grob_property ("edge-widen");
if (gh_pair_p (s))
{
Direction d = LEFT;
Drul_array<Real> height, width, shorten, r;
SCM pa = me->get_grob_property ("if-text-padding");
- SCM ew = me->get_grob_property ("edge-widen");
SCM eh = me->get_grob_property ("edge-height");
SCM sp = me->get_grob_property ("shorten-pair");
width[d] = 0;
height[d] = 0;
shorten[d] = 0;
- if (ly_number_pair_p (ew))
- width[d] += gh_scm2double (index_get_cell (ew, d));
if (!broken[d] && (ly_number_pair_p (eh)))
height[d] += gh_scm2double (index_get_cell (eh, d));
if (ly_number_pair_p (sp))
while (flip (&d) != LEFT);
Real extra_short = 0;
+
// For 'Mixed' style pedals, i.e. a bracket preceded by text: Ped._____|
// need to shorten by the extent of the text grob
if (to_boolean (me->get_grob_property ("text-start")))
}
me->set_grob_property ("edge-height", ly_interval2scm (height));
- me->set_grob_property ("edge-widen", ly_interval2scm(width));
me->set_grob_property ("shorten-pair", ly_interval2scm (shorten));
}
Spanner*sp = dynamic_cast<Spanner*> (me);
*equally_long= false;
- if (! ( b1 && (b1 == b2) && !sp->broken_b() ))
+ if (! (b1 && (b1 == b2) && !sp->broken_b()))
return 0;
Link_array<Grob> beam_stems = Pointer_group_interface__extract_grobs
lt *= gh_scm2double (thick);
SCM gap = me->get_grob_property ("gap");
- SCM ew = me->get_grob_property ("edge-widen");
+ SCM fl = me->get_grob_property ("bracket-flare");
SCM eh = me->get_grob_property ("edge-height");
SCM sp = me->get_grob_property ("shorten-pair");
Direction d = LEFT;
- Drul_array<Real> height, width, shorten;
+ Drul_array<Real> height, flare, shorten;
do {
- width[d] = height[d] = shorten[d] = 0.0;
- if ( ly_number_pair_p (ew) )
- width[d] += gh_scm2double (index_get_cell (ew, d));
- if ( ly_number_pair_p (eh) )
+ flare[d] = height[d] = shorten[d] = 0.0;
+ if (ly_number_pair_p (fl))
+ flare[d] += gh_scm2double (index_get_cell (fl, d));
+ if (ly_number_pair_p (eh))
height[d] += gh_scm2double (index_get_cell (eh, d)) * - dir;
- if ( ly_number_pair_p (sp) )
+ if (ly_number_pair_p (sp))
shorten[d] += gh_scm2double (index_get_cell (sp, d));
}
while (flip (&d) != LEFT);
w, ry - ly, lt,
height,
gh_scm2double (gap),
- width,
+ flare,
shorten);
mol.add_molecule (brack);
}
/*
should move to lookup?
+
+ TODO: this will fail for very short (shorter than the flare)
+ brackets.
*/
Molecule
Tuplet_bracket::make_bracket (Axis protusion_axis,
Real dx, Real dy, Real thick, Drul_array<Real> height,
Real gap,
- Drul_array<Real> widen,
+ Drul_array<Real> flare,
Drul_array<Real> shorten)
{
- Real len = Offset (dx,dy).length ();
- Real gapx = dx * (gap / len);
- Real gapy = dy * (gap / len);
- Drul_array<Real> shortx, shorty;
+ Offset dz = Offset (dx,dy);
+ Drul_array<Offset> corners (Offset(0,0), dz);
+
+ Real length = dz.length ();
+ Drul_array<Offset> gap_corners;
+
+
+ Axis bracket_axis = other_axis (protusion_axis);
+
+ Drul_array<Offset> straight_corners = corners;
+
Direction d = LEFT;
do {
- shortx[d] = dx * (shorten[d] / len);
- shorty[d] = dy * (shorten[d] / len);
- }
- while (flip (&d) != LEFT);
- Axis other = other_axis (protusion_axis);
-
- Molecule l1 = Lookup::line (thick, Offset(shortx[LEFT], shorty[LEFT]),
- Offset ( (dx - gapx)/2, (dy - gapy)/2 ));
-
- Molecule l2 = Lookup::line (thick, Offset((dx + gapx) / 2,(dy + gapy) / 2),
- Offset (dx - shortx[RIGHT], dy - shorty[RIGHT]));
-
- Offset protusion;
- protusion[other] = -widen[LEFT];
- protusion[protusion_axis] = height[LEFT];
- Molecule p1 = Lookup::line (thick,
- Offset(shortx[LEFT], shorty[LEFT]),
- Offset(shortx[LEFT], shorty[LEFT]) + protusion);
- protusion[other] = widen[RIGHT];
- protusion[protusion_axis] = height[RIGHT];
- Molecule p2 = Lookup::line (thick,
- Offset(dx - shortx[RIGHT], dy - shorty[RIGHT]),
- Offset(dx - shortx[RIGHT], dy - shorty[RIGHT]) + protusion);
+ straight_corners[d] += - d * shorten[d] /length * dz;
+ gap_corners[d] = (dz * 0.5) + d * gap / length * dz;
+ } while (flip (&d) != LEFT);
+
+ Drul_array<Offset> flare_corners = straight_corners;
+ do {
+ flare_corners[d][bracket_axis] = straight_corners[d][bracket_axis];
+ flare_corners[d][protusion_axis] += height[d];
+ straight_corners[d][bracket_axis] += - d * flare[d];
+ } while (flip (&d) != LEFT);
Molecule m;
- m.add_molecule (p1);
- m.add_molecule (p2);
- m.add_molecule (l1);
- m.add_molecule (l2);
+ do {
+
+ m.add_molecule (Lookup::line (thick, straight_corners[d],
+ gap_corners[d]));
+
+ m.add_molecule (Lookup::line (thick, straight_corners[d],
+ flare_corners[d]));
+ } while (flip (&d) != LEFT);
return m;
}
}
if (dynamic_cast<Spanner*> (me)->broken_b ())
{
- me->warning ( "Tuplet_bracket was across linebreak. Farewell cruel world.");
+ me->warning ("Tuplet_bracket was across linebreak. Farewell cruel world.");
me->suicide();
return SCM_UNSPECIFIED;
}
ADD_INTERFACE (Tuplet_bracket,"tuplet-bracket-interface",
"A bracket with a number in the middle, used for tuplets.",
- "note-columns edge-widen edge-height shorten-pair padding gap left-position right-position bracket-visibility number-visibility thickness direction");
+ "note-columns bracket-flare edge-height shorten-pair padding gap left-position right-position bracket-visibility number-visibility thickness direction");
return s
underscore = _
-program_version = '@TOPLEVEL_VERSION@'
-if program_version == '@' + 'TOPLEVEL_VERSION' + '@':
- program_version = '1.7.14'
-
def identify (port):
- port.write ('%s (GNU LilyPond) %s\n' % (__main__.program_name, program_version))
+ port.write ('%s (GNU LilyPond) %s\n' % (__main__.program_name, __main__.program_version))
def warranty ():
identify (sys.stdout)
(_ ("Report bugs to %s") % 'bug-lilypond@gnu.org'),
('\n')]
map (sys.stdout.write, ls)
+
+def lilypond_version (binary):
+ p = read_pipe ('%s --version ' % binary)
+ x = []
+ def catch_version (match):
+ x.append (match.group (1))
+ re.sub ('GNU LilyPond ([^\n]+)\n', catch_version, p)
+ x.append ('not found')
+
+ return x[0]
+
+def lilypond_version_check (binary, req):
+ if req[0] <> '@' :
+ v = lilypond_version (binary)
+ if v <> req:
+ error (_("Binary %s has version %s, looking for version %s") % \
+ (binary, v, req))
+ sys.exit (1)
+
def setup_temp ():
(grob-property-description 'dot-count integer? "number of dots.")
(grob-property-description 'duration-log integer? "2-log of the notehead duration, i.e. 0=whole note, 1 = half note, etc.")
(grob-property-description 'edge-height pair? "a cons that specifies the heights of the vertical edges '(LEFT-height . RIGHT-height).")
-(grob-property-description 'edge-widen pair? "a cons that specifies the widths of the slanted edges '(LEFT-width . RIGHT-width).")
+(grob-property-description 'bracket-flare number-pair? "a pair
+ that specifies how much edges of brackets should slant outward.
+ Value 0.0 means straight edges")
+
(grob-property-description 'edge-text pair? "a cons that specifies the texts to be set at the edges '(LEFT-text . RIGHT-text).")
(grob-property-description 'elements grob-list? "list of grobs, type depending on the Grob where this is set in.")
(grob-property-description 'expand-limit integer? "maximum number of measures expanded in church rests.")
global re;re = ly.re
# lilylib globals
+program_version = '@TOPLEVEL_VERSION@'
program_name = 'lilypond-book'
verbose_p = 0
pseudo_filter_p = 0
texfiles = string.join (tex)
cmd = string.join ((lilypond_binary, lilyopts, g_extra_opts,
texfiles))
+
+ ly.lilypond_version_check (lilypond_binary, '@TOPLEVEL_VERSION@')
+
ly.system (cmd, ignore_error = 0, progress_p = 1)
#
while datadir[-1] == os.sep:
datadir= datadir[:-1]
+
sys.path.insert (0, os.path.join (datadir, 'python'))
# Customize these
# lilylib globals
program_name = 'ly2dvi'
+program_version = '@TOPLEVEL_VERSION@'
verbose_p = 0
pseudo_filter_p = 0
original_dir = os.getcwd ()
if debug_p:
ly.print_environment ()
-
+
cmd = string.join ((lilypond_binary, opts, fs))
status = ly.system (cmd, ignore_error = 1, progress_p = 1)
signal = 0x0f & status
if 1:
ly.identify (sys.stderr)
+ ly.lilypond_version_check (lilypond_binary, '@TOPLEVEL_VERSION@')
+
original_output = output_name
# Ugh, maybe make a setup () function