+2004-08-24 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * scm/lily.scm (postscript->png): use ~a iso. ~s
+
+ * ly/property-init.ly (unHideNotes): hide accidentals at staff
+ level. Fixes: hideNotes-accidental.ly
+
2004-08-23 Pedro Kroger <kroeger@pedrokroeger.net>
* scm/page-layout.scm (plain-header): fix bug that print page
2004-08-23 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * scm/framework-ps.scm (define-fonts): use UPCASE for Bluesky
+ fonts. Fixes triangle markup for chords.
+
+ * lily/slur-quanting.cc (score_extra_encompass): make score depend
+ on distance. This fixes slur-tenuto.ly and slur-tie.ly
+
+ * flower/include/interval.hh (T>): add distance() function
+
+ * lily/ottava-bracket.cc (print): add dots to extent. Fixes
+ octaviation-dot.ly
+
+ * lily/context-scheme.cc: ly_context_grob_definition: new function.
+
+ * VERSION (MY_PATCH_LEVEL): release 2.3.12
+
* lily/new-slur.cc (add_column): remove set_interface()
2004-08-22 Han-Wen Nienhuys <hanwen@xs4all.nl>
2004-08-03 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * VERSION: 2.3.11 released.
+
* scripts/lilypond-book.py (Lilypond_file_snippet.ly): reinstate
renameinput.
(1.0.6 is known to work). You may need to install a tetex-devel (or
tetex-dev or libkpathsea-dev) package too.
-@item @uref{ftp://ftp.gnu.org/gnu/texinfo/,Texinfo} (version 4.6 or newer).
+@item @uref{ftp://ftp.gnu.org/gnu/texinfo/,Texinfo} (version 4.7 or newer).
@item The
@uref{ftp://ftp.ctan.org/tex-archive/macros/latex/contrib/supported/geometry,geometry
elem_ref (RIGHT) += t;
}
+ T distance (T t) const
+ {
+ if (t > elem (RIGHT))
+ return T (t - elem (RIGHT));
+ else if (t < elem (LEFT))
+ return T (elem (LEFT) - t);
+ else
+ return T (0);
+ }
/**
PRE
*this and h are comparable
SCM
Accidental_placement::alignment_callback (SCM s, SCM )
{
- Grob * me =unsmob_grob (s);
+ Grob * me = unsmob_grob (s);
Grob * par = me->get_parent (X_AXIS);
if (!to_boolean (par->get_property ("positioning-done")))
a->add_offset_callback (alignment_callback_proc, X_AXIS);
SCM cause = a->get_parent (Y_AXIS)->get_property ("cause");
- Music *mcause =unsmob_music (cause);
+ Music *mcause = unsmob_music (cause);
if (!mcause)
{
programming_error ("Note head has no music cause!");
apes.push (ape);
}
-
Grob *common[] = {me, 0};
/*
left_extent[LEFT] -= robust_scm2double (me->get_property ("left-padding"), 0);
-
-
Interval width (left_extent[LEFT], right_extent[RIGHT]);
SCM scm_width = ly_interval2scm (width);
return ly_symbol2scm (tr->context_name ().to_str0 ());
}
+LY_DEFINE (ly_context_grob_definition, "ly:context-grob-definition",
+ 1, 0, 0, (SCM context, SCM name),
+ "Return the definition of @var{name} (a symbol) within @var{context} "
+ "as an alist")
+{
+ Context *tr = unsmob_context (context);
+ SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
+ SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+
+
+ return updated_grob_properties (tr, name);
+}
+
+
LY_DEFINE (ly_context_pushpop_property, "ly:context-pushpop-property",
3, 1, 0, (SCM context, SCM grob, SCM eltprop, SCM val),
"Do a single @code{\\override} or @code{\\revert} operation "
#include <stdio.h>
#include <stdlib.h>
+#include <libintl.h> // gettext on macos x
#include <math.h> /* isinf */
#include <string.h> /* strdup, strchr */
#include <ctype.h>
#include "note-column.hh"
#include "directional-element-interface.hh"
#include "tuplet-bracket.hh"
+#include "rhythmic-head.hh"
struct Ottava_bracket
{
/*
TODO: the string for ottava shoudl depend on the available space, ie.
-
Long: 15ma Short: 15ma Empty: 15
8va 8va 8
8va bassa 8ba 8
*/
-
MAKE_SCHEME_CALLBACK (Ottava_bracket, print, 1);
SCM
Ottava_bracket::print (SCM smob)
{
Spanner*me = dynamic_cast<Spanner*> (unsmob_grob (smob));
-
-
Interval span_points;
Grob *common = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS);
Output_def * paper = me->get_paper ();
-
Drul_array<bool> broken;
Direction d = LEFT;
if (Note_column::has_interface (b))
{
for (SCM s = b->get_property ("note-heads"); ly_c_pair_p (s); s =ly_cdr (s))
- ext.unite (unsmob_grob (ly_car (s))->extent (common, X_AXIS));
+ {
+ Grob * h = unsmob_grob (ly_car (s));
+ ext.unite (h->extent (common, X_AXIS));
+ Grob * dots = Rhythmic_head::get_dots (h);
+
+ if (dots && d == RIGHT)
+ {
+ ext.unite (dots->extent (common, X_AXIS));
+ }
+ }
}
if (ext.is_empty ())
for (SCM s = formats; ly_c_pair_p (s); s = ly_cdr (s))
{
String format = ly_scm2string (ly_car (s));
- String file_name = outname + "." + format;
+ String file_name = outname;
+
+ if (file_name != "-")
+ file_name += "." + format;
+
Paper_outputter *out = get_paper_outputter (file_name, format);
SCM scopes = SCM_EOL;
Paper_outputter::file ()
{
if (file_ == SCM_EOL)
- file_ = scm_open_file (scm_makfrom0str (filename_.to_str0 ()),
- scm_makfrom0str ("w"));
+ if (filename_ == "-")
+ file_ = scm_current_output_port();
+ else
+ file_ = scm_open_file (scm_makfrom0str (filename_.to_str0 ()),
+ scm_makfrom0str ("w"));
return file_;
}
ADD_INTERFACE (Text_script,"text-script-interface",
"An object that is put above or below a note",
- "script-priority");
+ "script-priority inside-slur");
ADD_INTERFACE (Script_interface, "script-interface",
"An object that is put above or below a note",
- "script-priority script-stencil");
+ "script-priority script-stencil inside-slur");
}
else
{
- for (int i = slurs_.size (); i--; )
- New_slur::add_extra_encompass (slurs_[i], e);
- for (int i = end_slurs_.size (); i--; )
- New_slur::add_extra_encompass (end_slurs_[i], e);
+ if (Tie::has_interface (e)
+ || to_boolean (e->get_property ("inside-slur")))
+ {
+ for (int i = slurs_.size (); i--; )
+ New_slur::add_extra_encompass (slurs_[i], e);
+ for (int i = end_slurs_.size (); i--; )
+ New_slur::add_extra_encompass (end_slurs_[i], e);
+ }
}
}
-
void
Slur_engraver::finalize ()
{
/* descr */ "Build slurs grobs from slur events",
/* creats*/ "Slur",
/* accepts */ "slur-event",
- /* acks */ "note-column-interface accidental-interface fingering-interface script-interface",
+ /* acks */ "note-column-interface accidental-interface fingering-interface script-interface tie-interface",
/* reads */ "slurMelismaBusy doubleSlurs",
/* write */ "");
Real EXTRA_OBJECT_COLLISION;
Real ACCIDENTAL_COLLISION;
Real FREE_HEAD_DISTANCE;
+ Real EXTRA_ENCOMPASS_FREE_DISTANCE;
Slur_score_parameters ();
};
score_param->FREE_HEAD_DISTANCE = 0.3;
score_param->EXTRA_OBJECT_COLLISION = 50;
score_param->ACCIDENTAL_COLLISION = 3;
+ score_param->EXTRA_ENCOMPASS_FREE_DISTANCE = 0.5;
}
Slur_score_parameters::Slur_score_parameters()
= extremes[d].stem_->extent (common[Y_AXIS], Y_AXIS);
extremes[d].slur_head_
= Stem::extremal_heads (extremes[d].stem_)[dir];
- extremes[d].slur_head_extent_
- = extremes[d].slur_head_->extent (common[X_AXIS], X_AXIS);
+ if (!extremes[d].slur_head_
+ && Note_column::has_rests (extremes[d].bound_))
+ {
+ extremes[d].slur_head_ = Note_column::get_rest (extremes[d].bound_);
+ }
+
+ if (extremes[d].slur_head_)
+ extremes[d].slur_head_extent_
+ = extremes[d].slur_head_->extent (common[X_AXIS], X_AXIS);
+
extremes[d].staff_ = Staff_symbol_referencer
- ::get_staff_symbol (extremes[d].slur_head_);
+ ::get_staff_symbol (extremes[d].stem_);
extremes[d].staff_space_ = Staff_symbol_referencer
- ::staff_space (extremes[d].slur_head_);
+ ::staff_space (extremes[d].stem_);
}
else
extremes[d].neighbor_y_ = broken_trend_y (me, common, d);
y += 1.5 * staff_space * dir / 10;
Grob * fh = Note_column::first_head (extremes[d].note_column_);
- x = fh->extent (common[X_AXIS], X_AXIS).linear_combination (CENTER);
+ x =
+ (fh ? fh->extent (common[X_AXIS], X_AXIS)
+ : extremes[d].bound_->extent (common[X_AXIS], X_AXIS))
+ .linear_combination (CENTER);
}
base_attachment[d] = Offset (x, y);
{
y = scores->elem (i).curve_.get_other_coordinate (X_AXIS, x);
}
+
+ Real collision_demerit =
+ (Accidental_interface::has_interface (encompasses[j]))
+ ? score_param->ACCIDENTAL_COLLISION
+ : score_param->EXTRA_OBJECT_COLLISION;
- if (yexts[j].contains (y))
- {
- if (Accidental_interface::has_interface (encompasses[j]))
- demerit += score_param->ACCIDENTAL_COLLISION;
- else
- demerit += score_param->EXTRA_OBJECT_COLLISION;
- }
+ Real dist = yexts[j].distance (y);
+ demerit +=
+ fabs (0 >? (score_param->EXTRA_ENCOMPASS_FREE_DISTANCE - dist)) /
+ score_param->EXTRA_ENCOMPASS_FREE_DISTANCE * collision_demerit;
}
#if DEBUG_SLUR_QUANTING
(*scores)[i].score_card_ += to_string ("X%.2f", demerit);
String glyph_name = ly_scm2string (glyph_name_scm);
Stencil out;
- int flexa_height = 0;
Real thickness = robust_scm2double ( me->get_property ("thickness"), 1);
Real line_thickness =
chordmodifiers = #default-chord-modifier-list
-whiteTriangleMarkup = \markup { \override #'(font-encoding . TeX-math) "M" }
+whiteTriangleMarkup = \markup { \override #'(font-encoding . TeX-math) \char #77 }
-blackTriangleMarkup = \markup { \override #'(font-encoding . TeX-math) "N" }
+blackTriangleMarkup = \markup { \override #'(font-encoding . TeX-math) \char #78 }
ignatzekExceptionMusic = {
<c e gis>1-\markup { "+" }
\override NoteHead #'transparent = ##t
\override Stem #'transparent = ##t
\override Beam #'transparent = ##t
- \override Staff.Accidental #'transparent = ##t
+ \override Accidental #'transparent = ##t
}
unHideNotes = \sequential {
- \revert Staff.Accidental #'transparent
+ \revert Accidental #'transparent
\revert Beam #'transparent
\revert Stem #'transparent
\revert NoteHead #'transparent
{0, 0} /* Sentinel */
};
+void
initmidi ()
{
PyObject *m, *d;
(horizontal-shift ,integer? "An integer that identifies ranking
of note-column for horizontal shifting. This is used by
@internalsref{note-collision-interface}.")
+ (inside-slur ,boolean? "If set, this object should be inside the slur")
(inspect-quants ,number-pair? "If debugging is set,
set beam quant to this position, and print the respective scores.")
))
(AccidentalPlacement
- . (
- (X-extent-callback . ,Axis_group_interface::group_extent_callback)
+ . ((X-extent-callback . ,Axis_group_interface::group_extent_callback)
(left-padding . 0.2)
;; this is quite small, but it is very ugly to have
plain " " coding-vector " /" command " reencode-font\n"
"/" command "{ /" command " findfont 1 scalefont } bind def\n")))
+ (define (standard-tex-font? x)
+ (or (equal? (substring x 0 2) "ms")
+ (equal? (substring x 0 2) "cm")))
(define (font-load-command font)
(let* ((specced-font-name (ly:font-name font))
(ops (ly:output-def-lookup bookpaper 'outputscale))
(scaling (* ops magnification designsize)))
+ ;; Bluesky pfbs have UPCASE names (sigh.)
+ ;;
+ (if (standard-tex-font? fontname)
+ (set! fontname (string-upcase fontname)))
+
;; debugging: [output]encoding is broken
;; found so far: coding-alist is empty!
(pdebug "font: ~S\n" font)
((defs (ly:paper-book-book-paper book))
(size (ly:output-def-lookup defs 'papersize)))
- (postscript->pdf (if (string? size) size "a4")
- name)))
-
+ (if (equal? name "-")
+ (ly:warn "Can't convert <stdout> to PDF")
+ (postscript->pdf (if (string? size) size "a4")
+ name))))
+
(define-public (convert-to-png book name)
(let*
((defs (ly:paper-book-book-paper book))
(regexp-substitute/global #f "\\.ps" name 'pre ".pdf" 'post)))
(newline (current-error-port))
- (display (format (_ "Converting to ~s...") output-name)
+ (display (format (_ "Converting to `~a'...") output-name)
(current-error-port))
(newline (current-error-port))
(if (ly:get-option 'verbose)
- (display (format "Invoking `~s'..." cmd) (current-error-port)))
+ (display (format "Invoking `~a'..." cmd) (current-error-port)))
(system cmd)))
name)))
(if (ly:get-option 'verbose)
(begin
- (display (format (_ "Invoking `~s'...") cmd) (current-error-port))
+ (display (format (_ "Invoking `~a'...") cmd) (current-error-port))
(newline (current-error-port))))
(system cmd)))
$(outdir)/latin1.enc: GNUmakefile
echo '/ISOLatin1Encoding ' > $@
- echo 'ISOLatin1Encoding pstack' | gs -quiet - >> $@
+ echo 'ISOLatin1Encoding pstack' | gs -sDEVICE=nullpage -quiet - >> $@
echo ' def ' >> $@
all: $(INSTALLATION_FILES)