From: Han-Wen Nienhuys Date: Tue, 24 Aug 2004 20:37:59 +0000 (+0000) Subject: * scm/lily.scm (postscript->png): use ~a iso. ~s X-Git-Tag: release/2.3.13~38 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a56e7512be4d7cf266c9e6eca8e86e631701dae3;p=lilypond.git * scm/lily.scm (postscript->png): use ~a iso. ~s * ly/property-init.ly (unHideNotes): hide accidentals at staff level. Fixes: hideNotes-accidental.ly --- diff --git a/ChangeLog b/ChangeLog index 3471e41d23..e46d4cd189 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-08-24 Han-Wen Nienhuys + + * 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 * scm/page-layout.scm (plain-header): fix bug that print page @@ -5,6 +12,21 @@ 2004-08-23 Han-Wen Nienhuys + * 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 @@ -283,6 +305,8 @@ 2004-08-03 Han-Wen Nienhuys + * VERSION: 2.3.11 released. + * scripts/lilypond-book.py (Lilypond_file_snippet.ly): reinstate renameinput. diff --git a/Documentation/topdocs/INSTALL.texi b/Documentation/topdocs/INSTALL.texi index b7609a0782..08aba505d4 100644 --- a/Documentation/topdocs/INSTALL.texi +++ b/Documentation/topdocs/INSTALL.texi @@ -93,7 +93,7 @@ Also, @TeX{}'s libkpathsea is used to find the fonts (@file{.mf}, (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 diff --git a/flower/include/interval.hh b/flower/include/interval.hh index 5ccb91feae..c2d012c4f1 100644 --- a/flower/include/interval.hh +++ b/flower/include/interval.hh @@ -35,6 +35,15 @@ struct Interval_t : public Drul_array 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 diff --git a/lily/accidental-placement.cc b/lily/accidental-placement.cc index 12b2117161..9327253f6c 100644 --- a/lily/accidental-placement.cc +++ b/lily/accidental-placement.cc @@ -25,7 +25,7 @@ MAKE_SCHEME_CALLBACK (Accidental_placement,alignment_callback, 2); 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"))) @@ -45,7 +45,7 @@ Accidental_placement::add_accidental (Grob* me, Grob* a) 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!"); @@ -271,7 +271,6 @@ Accidental_placement::position_accidentals (Grob * me) apes.push (ape); } - Grob *common[] = {me, 0}; /* @@ -428,8 +427,6 @@ Accidental_placement::position_accidentals (Grob * me) 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); diff --git a/lily/context-scheme.cc b/lily/context-scheme.cc index cbedf5ea3c..4288516f7a 100644 --- a/lily/context-scheme.cc +++ b/lily/context-scheme.cc @@ -33,6 +33,20 @@ LY_DEFINE (ly_context_name, "ly:context-name", 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 " diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 2205bee0f3..9e759e7e9f 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -10,6 +10,7 @@ #include #include +#include // gettext on macos x #include /* isinf */ #include /* strdup, strchr */ #include diff --git a/lily/ottava-bracket.cc b/lily/ottava-bracket.cc index 5e36048c3e..aadf68a55b 100644 --- a/lily/ottava-bracket.cc +++ b/lily/ottava-bracket.cc @@ -20,6 +20,7 @@ #include "note-column.hh" #include "directional-element-interface.hh" #include "tuplet-bracket.hh" +#include "rhythmic-head.hh" struct Ottava_bracket { @@ -30,26 +31,21 @@ 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 (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 broken; Direction d = LEFT; @@ -88,7 +84,16 @@ Ottava_bracket::print (SCM smob) 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 ()) diff --git a/lily/paper-book.cc b/lily/paper-book.cc index b90819a274..da5b2453c3 100644 --- a/lily/paper-book.cc +++ b/lily/paper-book.cc @@ -158,7 +158,11 @@ Paper_book::output (String outname) 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; diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index 7976b17a47..38faae2fff 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -70,8 +70,11 @@ SCM 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_; } diff --git a/lily/script-interface.cc b/lily/script-interface.cc index 9a3d2544ca..6d6c67263b 100644 --- a/lily/script-interface.cc +++ b/lily/script-interface.cc @@ -92,9 +92,9 @@ struct Text_script 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"); diff --git a/lily/slur-engraver.cc b/lily/slur-engraver.cc index d1749c96d6..2f1cc065e8 100644 --- a/lily/slur-engraver.cc +++ b/lily/slur-engraver.cc @@ -89,13 +89,16 @@ Slur_engraver::acknowledge_grob (Grob_info info) } 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 () { @@ -147,6 +150,6 @@ ENTER_DESCRIPTION (Slur_engraver, /* 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 */ ""); diff --git a/lily/slur-quanting.cc b/lily/slur-quanting.cc index d145f59bbb..10c2aa29b8 100644 --- a/lily/slur-quanting.cc +++ b/lily/slur-quanting.cc @@ -65,6 +65,7 @@ struct Slur_score_parameters Real EXTRA_OBJECT_COLLISION; Real ACCIDENTAL_COLLISION; Real FREE_HEAD_DISTANCE; + Real EXTRA_ENCOMPASS_FREE_DISTANCE; Slur_score_parameters (); }; @@ -185,6 +186,7 @@ init_score_param (Slur_score_parameters *score_param) 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() @@ -381,12 +383,20 @@ get_bound_info (Spanner* me, Grob **common) = 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); @@ -594,7 +604,10 @@ get_base_attachments (Spanner *me, 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); @@ -956,14 +969,16 @@ score_extra_encompass (Grob *me, Grob *common[], { 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); diff --git a/lily/vaticana-ligature.cc b/lily/vaticana-ligature.cc index ff6289feb2..a298e95c97 100644 --- a/lily/vaticana-ligature.cc +++ b/lily/vaticana-ligature.cc @@ -204,7 +204,6 @@ vaticana_brew_primitive (Grob *me) 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 = diff --git a/ly/chord-modifiers-init.ly b/ly/chord-modifiers-init.ly index e0ef33c286..9a2330a5b2 100644 --- a/ly/chord-modifiers-init.ly +++ b/ly/chord-modifiers-init.ly @@ -2,9 +2,9 @@ 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 = { 1-\markup { "+" } diff --git a/ly/property-init.ly b/ly/property-init.ly index e5b0b0abb0..b6b68f7877 100644 --- a/ly/property-init.ly +++ b/ly/property-init.ly @@ -143,12 +143,12 @@ hideNotes =\sequential { \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 diff --git a/python/midi.c b/python/midi.c index fc2906cacd..a8d8d4b8bf 100644 --- a/python/midi.c +++ b/python/midi.c @@ -399,6 +399,7 @@ static PyMethodDef MidiMethods[] = {0, 0} /* Sentinel */ }; +void initmidi () { PyObject *m, *d; diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index f766b8586e..25cb667623 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -287,6 +287,7 @@ slur, the closer it is to this height.") (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.") diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 1e4f8a1bdd..89cc2b752c 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -22,8 +22,7 @@ )) (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 diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm index 288e36ad20..67c35ebfc0 100644 --- a/scm/framework-ps.scm +++ b/scm/framework-ps.scm @@ -82,6 +82,9 @@ 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)) @@ -100,6 +103,11 @@ (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) @@ -252,9 +260,11 @@ ((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 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)) diff --git a/scm/lily.scm b/scm/lily.scm index a733a9f2e6..8c680eeda9 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -563,12 +563,12 @@ possibly turned off." (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))) @@ -585,7 +585,7 @@ possibly turned off." 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))) diff --git a/tex/GNUmakefile b/tex/GNUmakefile index 894856efab..82982372e3 100644 --- a/tex/GNUmakefile +++ b/tex/GNUmakefile @@ -15,7 +15,7 @@ $(outdir)/music-drawing-routines.ps: $(depth)/ps/music-drawing-routines.ps $(outdir)/latin1.enc: GNUmakefile echo '/ISOLatin1Encoding ' > $@ - echo 'ISOLatin1Encoding pstack' | gs -quiet - >> $@ + echo 'ISOLatin1Encoding pstack' | gs -sDEVICE=nullpage -quiet - >> $@ echo ' def ' >> $@ all: $(INSTALLATION_FILES)