From 164f801e44a5263b1ba9ccc68d8eebaeaa0c5445 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 14 Jul 1999 18:19:15 +0200 Subject: [PATCH] release: 1.1.59 --- BUGS | 11 + Documentation/index.yo | 1 - Documentation/man/lilypond.yo | 6 +- Documentation/man/out/lilypond.1 | 6 +- Documentation/tex/lilypond-regtest.doc | 1 + NEWS | 13 ++ TODO | 92 +++++++- VERSION | 2 +- input/bugs/2pianobrace.ly | 6 + input/bugs/choral.ly | 241 --------------------- input/test/collisions.ly | 15 +- input/test/repeat-semifold.ly | 1 + lily/bar-engraver.cc | 18 +- lily/break-align-item.cc | 7 + lily/col-info.cc | 2 - lily/colhpos.cc | 10 +- lily/gourlay-breaking.cc | 8 +- lily/include/col-info.hh | 2 +- lily/include/colhpos.hh | 7 +- lily/include/lily-guile.hh | 3 +- lily/include/ly-symbols.hh | 1 + lily/include/spring-spacer.hh | 5 - lily/line-of-score.cc | 4 +- lily/lookup.cc | 13 ++ lily/main.cc | 22 +- lily/spacing-spanner.cc | 18 +- lily/spring-spacer.cc | 132 +----------- lily/word-wrap.cc | 8 +- ly/engraver.ly | 4 +- ly/params.ly | 4 +- make/out/lelievijver.lsm | 6 +- make/out/lilypond.lsm | 6 +- make/out/lilypond.spec | 4 +- scm/lily.scm | 24 +-- tex/lily-pdf-defs.tex | 283 +++++++++++++++++++++++++ tex/lily-ps-defs.tex | 23 ++ tex/lilyponddefs.tex | 11 +- 37 files changed, 554 insertions(+), 466 deletions(-) create mode 100644 input/bugs/2pianobrace.ly delete mode 100644 input/bugs/choral.ly create mode 100644 tex/lily-pdf-defs.tex diff --git a/BUGS b/BUGS index 59f9f827ab..5fe9ab69ee 100644 --- a/BUGS +++ b/BUGS @@ -31,6 +31,17 @@ Lilypond 1.1.35-1.1.51,...: Wierd errors in guile scm_gc_mark () Some bugs may be captured in input/bugs/*y +[Linux i386, RedHat 5.2 with updates to 6.0] + +Compiling with + + configure --disable-checking --enable-printing --disable-optimise --disable-debugging + +results in core dumps, during parsing of init files. Cause unknown. +Solution: use + + --enable-checking and --enable-optimize + [Linux libg++ 2.7] LilyPond occasionally crashes while parsing the initialisation files. diff --git a/Documentation/index.yo b/Documentation/index.yo index ca106c5d6e..3271c33aa3 100644 --- a/Documentation/index.yo +++ b/Documentation/index.yo @@ -29,7 +29,6 @@ itemize( it() url(Why?)(AIMS.html) it() url(Design criteria)(MANIFESTO.html) it()url(The GNU Music project)(gnu-music.html) -it()url(Mutopia -- Music To the People)(mutopia.html) it()url(The lilypond logo (Big, format: .png))(DOEXPAND(pics)/lelieblond.png) it()url(The lilypond diff --git a/Documentation/man/lilypond.yo b/Documentation/man/lilypond.yo index d82b76d5c3..c26ca52f0f 100644 --- a/Documentation/man/lilypond.yo +++ b/Documentation/man/lilypond.yo @@ -26,12 +26,12 @@ manpageoptions() description( dit(-I,--include=) add file(FILE) to the search path for input files. -dit(-M,--midi) +dit(-m,--midi) Disable TeX output. If you have a \midi definition, it will do the midi output only. -dit(-d,--dependencies) +dit(-M,--dependencies) Also output rules to be included in Makefile. -dit(-D,--debug) +dit(-d,--debug) Turn debugging info on. GNU LilyPond reads the file file(.dstreamrc), which lists what functions and classes may produce copious debugging output. diff --git a/Documentation/man/out/lilypond.1 b/Documentation/man/out/lilypond.1 index 45d2a60fff..82839b59b5 100644 --- a/Documentation/man/out/lilypond.1 +++ b/Documentation/man/out/lilypond.1 @@ -16,12 +16,12 @@ description file into beautiful sheet music\&. .SH "OPTIONS" .IP "-I,--include=" add \fBFILE\fP to the search path for input files\&. -.IP "-M,--midi" +.IP "-m,--midi" Disable TeX output\&. If you have a \emidi definition, it will do the midi output only\&. -.IP "-d,--dependencies" +.IP "-M,--dependencies" Also output rules to be included in Makefile\&. -.IP "-D,--debug" +.IP "-d,--debug" Turn debugging info on\&. GNU LilyPond reads the file \fB\&.dstreamrc\fP, which lists what functions and classes may produce copious debugging output\&. diff --git a/Documentation/tex/lilypond-regtest.doc b/Documentation/tex/lilypond-regtest.doc index 611478d23a..2b5d51e917 100644 --- a/Documentation/tex/lilypond-regtest.doc +++ b/Documentation/tex/lilypond-regtest.doc @@ -130,6 +130,7 @@ Unfolded behavior: \mudelafile{repeat-unfold.ly} Semi (un)folded behavior. Voltas can start on non-barline moments. +If they don't barlines should still be shown. \mudelafile{repeat-semifold.ly} diff --git a/NEWS b/NEWS index cc7169ce80..c722b2bafa 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,16 @@ +pl 58.uu1 + - experimental pdftex support, courtesy Stephen Peters. + - --version support + - junked complicated loose column handling. + - only stretch the extra space after prefatory matter, not the +entire width of prefatory matter. + - standardise(d) switches:-d for debug, -M for Make deps, -m for midi-only. + - bf: non_musical_space_strength now works. Set to 8 (-> Strong! ) + - bf: space after time_sig. + - bf: decrescendi. + - bf: barlines on voltas + +************ pl 57.hwn1 - bf: accidentals on grace notes. - \property graceAccidentalSpace diff --git a/TODO b/TODO index 92e9b48a21..304e29b7fe 100644 --- a/TODO +++ b/TODO @@ -20,12 +20,88 @@ typeface. ie. leading is vertical space --hwn] . * junk delayed spanner breaking. . * check dangling_scm_sym working. . * revise pianobrace to put font stuff into Lookup -. * standardise(d) switches: -v, --version; -d, --debug, . * spacing of accidentals . * restorations & repeats -. * dotted rests? -. * input/test/grace.ly spacing (triplet!) +. * \score { + \context Staff \notes { +c'2 fis'~ +% accidential after bar +fis'4 % accidential should be here +fis' g'2 +\repeat semi 2 { +c' c' +} +\alternative { +% no bars at the beginning of alternative 1 and at the end of alternative 2 +{ +d' d' +} +{ +c'1 c' +} +} +d'4_"normal" d' \times 2/3 {e' e' e'} +% no triplet bracket in \tiny +\tiny d'4_"tiny" d' \times 2/3 {e' e' e'} + } +} + +. * +So how do I do what I want to do? + +In Caro Mio Ben, bar 8, there's a syllable that starts on a note, and +ends on a pair of grace notes. Standard practice is to mark this with +a slur starting on the main note and ending on the grace note, so a +singer knows where to break the words. + +In bar 26, there's a \p marker that should appear below the grace +note. + +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. + +How do I specify these? + +How can I control whether a grace note takes its time from the note +before or the note after it (for the purposes of alignment with +lyrics)? +. * / distance after 4/4 \key. . * spanners from grace to normal ctxt +. * Glen: +1. I got a vertical line where I asked for a decrescendo. + +2. Slurs -- good to see some spacing between slurs and lyrics, but not +there's several times too much space. + +3. Slurs with wrong slopes. Where a slur between two notes goes from the +head of one to the stem of another it can have the wrong slope: + | ___ + | / \ + | / | + x|/ | + | + x| + The music goes down but the slur goes up (or vice versa). This looks +wrong. + +4. Lyrics and \fermata collide. I know that the TODO has lyrics and scripts +colliding; I'm just including it here because it's really an issue for me +with fermata. Other scripts aren't a problem for me, but sometimes I need +fermata on both sides of the staff (when sop and alto hold different notes, +for example). In fact it's not just scripts and lyrics: In a choirstaff, +scripts above the bass clef collide with scripts below the treble clef. + +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. + +6. The bar line at the beginning of an \alternative section has disappeared +altogether. + +7. When it's a tight fit to get all the notes in the first line, the first +note collides with the time signature. Is this the same 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. @@ -53,16 +129,12 @@ typeface. ie. leading is vertical space --hwn] - The paper11/13/26 files have to be updated. . * Grace_slur_engraver. . * input/star-spangled-banner.ly: fold for lyrics? +. * don't create $srcdir/share/ . * Break_req handling is silly (break_forbid () + \break fucks up.) . * hangOnClef with non-breakable clefs. -. * do scaled fonts generally +. * account for accidentals in spacing. +. * collision of lyrics with span_bars. See star-spangled. . * fix partial measures in meaningful way. -. * Michael - -- The two spacing bugs in the choral-1.ly I sent you earlier, small -GIFs attached for easy reference: #1: time meter and first note on the -line are too close; #2: last note on the line and next bar are too -close. . * relative mode for midi2ly . * Crescendi/diminuendi that cross a line break lose their vertical diff --git a/VERSION b/VERSION index 0e9fb9aa7b..2e50a6e996 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=1 -PATCH_LEVEL=58 +PATCH_LEVEL=59 MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a diff --git a/input/bugs/2pianobrace.ly b/input/bugs/2pianobrace.ly new file mode 100644 index 0000000000..a5c7cb406a --- /dev/null +++ b/input/bugs/2pianobrace.ly @@ -0,0 +1,6 @@ +\score { \notes { +\context StaffGroup <\context PianoStaff = PA< c4 d4 > + \context PianoStaff =PB < c4 d4 > +>} +} + diff --git a/input/bugs/choral.ly b/input/bugs/choral.ly deleted file mode 100644 index 84a5d45011..0000000000 --- a/input/bugs/choral.ly +++ /dev/null @@ -1,241 +0,0 @@ - -% TODO: -% Copyright, Header etc. -% Begleitsatz -% Tempo - -\include "deutsch.ly" - -global = \notes { - \time 2/2; \partial 2*1; - \key g; - - s2 | s1 | s1 | - \time 3/2; - s1. | s1. | - \time 2/2; - s1 | s1 | s1 | s2 - - s2 | s1 | s1 | - \time 3/2; - s1. | s1. | - \time 2/2; - s1 | s1 - \time 3/2; - s1. \bar "||"; - - s1. | s1. | s1. | s1. | - s1. | s1. | s1. | s1. \bar "||"; - - \key es; - s1. | s1. | s1. | s1. | - s1. | s1. | s1. | s1 \bar "||"; - - \key g; - s2 | - \time 2/2; - s1 | s1 | - \time 3/2; - s1. | s1. | - \time 2/2; - s1 | s1 | s1 | s2 - - s2 | s1 | s1 | - \time 3/2; - s1. | s1. | - \time 2/2; - s1 | s1 | s1 \bar "|."; -} - -themeMelody = \notes \relative c'' { - g2 | g d' | h a | - g fis g | a ~ a \breathe b | - d b | a a | g ~ g ~ | g \breathe - - g2 | g d' | h a | - g fis g | a ~ a \breathe b | - d b | -} - -themeBeforeBreak1EndMelody = \notes \relative c'' { - a2 a | g ~ g ~ g4 r4 -} - -themeFinalEndMelody = \notes \relative c'' { - a2 a ~ | a1^\fermata -} - -themeRightHand = \notes \relative c' { - d2 | c | | d2 es es4 c4 | - | f2 | | - cis4 | - - | | | d2 es es4 c4 | - | f2 | -} - -themeBeforeBreak1EndRightHand = \notes \relative c' { - | cis4 r4 | -} - -themeFinalEndRightHand = \notes \relative c' { - | -} - -themeLeftHand = \notes \relative c { - | | c | | - | | | - a2 | h2 - - g2 | | c | | - | | -} - -themeBeforeBreak1EndLeftHand = \notes \relative c' { - | a2 h4 r4 | -} - -themeFinalEndLeftHand = \notes \relative c' { - | -} - -themePedal = \notes \relative c' { - g4 fis | f2 c | a' d, | - h c es | d ~ d b | - e, g | a a | d, f4 a | h2 - - c2 | e2 c | a' d, | - h c es | d ~ d b | - e, g | -} - -themeBeforeBreak1EndPedal = \notes \relative c { - a2 a | d,2 f4 a h4 r4 | -} - -themeFinalEndPedal = \notes \relative c { - a2 a | d,1_\fermata -} - -break1Melody = \notes \relative c'' { - g4( fis e fis d' h | )a1. | - g4( es g b es g | | - b,2 g es | d1. | - b'2 g d' | a1 r2 | -} - -break1RightHand = \notes \relative c' { - e1. | g4( fis e fis g fis | - )es1. | dis'2 d4 c b a \breathe | - s1. | s1. | - es1 | r2 | -} - -break1LeftHand = \notes \relative c { - < - \context Voice = oben { - \stemup - c'1. | d2. c4 h a | b1. | d1. | - } - \context Voice = unten { - \stemdown - | | | d2. e4 fis d | - } - > - r4 b2( g4 b c | d c b g fis d | - <)es1 c'1> |

r2 | -} - -break2RightHand = \notes \relative c'' { - g8 r8 c,8 r8 r8 c r g' r c, r | - r c r b' r es, r r es r | - b' r es, r r es r d' r r | - d' r f, r r f r d' r r | - d' r g, r r g r d' r g, r | - es' r g, r r g b es r r | - d8 r b r d8 f d b a r r | - \breathe -} - -break2LeftHand = \notes \relative c' { - r8 g r g r g r g r g r g | - r8 g r g r b r b r b r b | - r c r c r c r c r h r h | - r d r d r d r d r d r d | - r d r d r d r d r c r c | - r r r r r f' r | - r r r r r r | - -} - -break2Pedal = \notes \relative c { - c2 c g' | es1 d2 | c1 h2 | - b1 d2 \breathe | g2 g f2 | es1 f2 | - b,2 g a | d1 \breathe -} - -\score { - < - \context PianoStaff < - \context Staff = treble < - \global - \context Voice = melody { - \stemup \themeMelody \themeBeforeBreak1EndMelody - \break1Melody - \stemboth \break2RightHand - \stemup \themeMelody \themeFinalEndMelody - } - \context Voice = firstdown { - \stemdown \themeRightHand \themeBeforeBreak1EndRightHand - \break1RightHand - \notes { - s1. | s1. | s1. | s1. | - s1. | s1. | s1. | s1 - } - \themeRightHand \themeFinalEndRightHand - } - > - \context Staff = bass < - \clef "bass"; - \global - { - \themeLeftHand \themeBeforeBreak1EndLeftHand - \break1LeftHand - \break2LeftHand - \themeLeftHand \themeFinalEndLeftHand - } - > - > - \context Staff = pedal { - \clef "bass"; - < - \global - { - \themePedal \themeBeforeBreak1EndPedal - \notes { - s1. | s1. | s1. | s1. | - s1. | s1. | s1. | s1. | - } - \break2Pedal - \themePedal \themeFinalEndPedal - } - > - } - > - - \header { - title = "Choral I"; - subtitle = "(über ``Aus meines Herzens Grunde'')"; - composer = "Michael Krause 1999 (*1977)"; - enteredby = "Michael Krause"; - copyright = "dunno"; - } - - \paper { - linewidth = 18.0 \cm; - textheight = 28.0 \cm; - - indent = 0.0 \mm; - \translator { \OrchestralScoreContext } - } -} diff --git a/input/test/collisions.ly b/input/test/collisions.ly index 1e8796cc5f..370ce9463f 100644 --- a/input/test/collisions.ly +++ b/input/test/collisions.ly @@ -24,14 +24,21 @@ threevoice = \context Staff \notes < \context Voice=iii { \stemdown c4 d e d c d es } > +chordstest = \context Staff \notes < + \context Voice = i \relative c { + \stemup e4 dis c f g f a b b + } + \context Voice = ii \relative c { + \stemdown + } +> + \score{ \notes \transpose c'' { \twovoice \twovoicesteminvert - \threevoice - + \threevoice + \break \chordstest } - - % \midi { \tempo 4:80 } } diff --git a/input/test/repeat-semifold.ly b/input/test/repeat-semifold.ly index 58d03f8cc8..6baf4e60fd 100644 --- a/input/test/repeat-semifold.ly +++ b/input/test/repeat-semifold.ly @@ -4,6 +4,7 @@ \repeat semi 3 { c^"3$\\times$ 0alt" d } % less alts than body \repeat semi 4 { c^"4$\\times$ 2alt" d } \alternative { e f } + % more alts than body \repeat semi 2 { c^"2$\\times$ 3alt" d } \alternative { e f g } }} diff --git a/lily/bar-engraver.cc b/lily/bar-engraver.cc index 2d48eb6c4a..84ada321e8 100644 --- a/lily/bar-engraver.cc +++ b/lily/bar-engraver.cc @@ -74,11 +74,11 @@ Bar_engraver::create_bar () /** Make a barline. If there are both |: and :| requested, merge them - to :|: + to :|:. */ void -Bar_engraver::request_bar (String type_str) +Bar_engraver::request_bar (String requested_type) { Scalar prop = get_property ("barAtLineStart", 0); if (!now_mom ()) @@ -87,13 +87,17 @@ Bar_engraver::request_bar (String type_str) if (!prop.to_bool ()) return; } + bool bar_existed = bar_p_; create_bar (); - - if (((type_str == "|:") && (bar_p_->type_str_ == ":|")) - || ((type_str == ":|") && (bar_p_->type_str_ == "|:"))) + if (bar_existed && requested_type == "") + { + return; + } + else if (((requested_type == "|:") && (bar_p_->type_str_ == ":|")) + || ((requested_type == ":|") && (bar_p_->type_str_ == "|:"))) bar_p_->type_str_ = ":|:"; - else if (type_str_.length_i ()) - bar_p_->type_str_ = type_str; + else + bar_p_->type_str_ = requested_type; } void diff --git a/lily/break-align-item.cc b/lily/break-align-item.cc index 5f5079dad5..12aa5e08a0 100644 --- a/lily/break-align-item.cc +++ b/lily/break-align-item.cc @@ -108,13 +108,16 @@ Break_align_item::do_pre_processing() Real pre_space = elems[0]->extent (X_AXIS)[LEFT]; Real spring_len = elems.top ()->extent (X_AXIS)[RIGHT]; + Real stretch_distance =0.; if (SCM_CAR (symbol_list) == extra_space_scm_sym) { spring_len += dists.top (); + stretch_distance = dists.top (); } else if (SCM_CAR (symbol_list) == minimum_space_scm_sym) { spring_len = spring_len >? dists.top (); + stretch_distance = spring_len; } @@ -124,6 +127,10 @@ Break_align_item::do_pre_processing() column_l ()->set_elt_property (extra_space_scm_sym, scm_cons (gh_double2scm (pre_space), gh_double2scm (spring_len))); + + column_l ()->set_elt_property (stretch_distance_scm_sym, + gh_double2scm (stretch_distance)); + } diff --git a/lily/col-info.cc b/lily/col-info.cc index 47d9c69c33..2ebfd15d4f 100644 --- a/lily/col-info.cc +++ b/lily/col-info.cc @@ -33,7 +33,6 @@ Column_info::Column_info (Paper_column *col_l, Real const *fixed_C) { if (fixed_C) fixpos_p_.set_l (fixed_C); - ugh_b_ = false; pcol_l_ = col_l; width_ = pcol_l_->extent(X_AXIS); if (width_.empty_b()) @@ -43,7 +42,6 @@ Column_info::Column_info (Paper_column *col_l, Real const *fixed_C) Column_info::Column_info() { - ugh_b_ = false; pcol_l_ =0; } diff --git a/lily/colhpos.cc b/lily/colhpos.cc index 1e0a971a12..8d82c2c06d 100644 --- a/lily/colhpos.cc +++ b/lily/colhpos.cc @@ -15,7 +15,6 @@ Column_x_positions::Column_x_positions() { energy_f_ = infinity_f; - ugh_b_ = false; satisfies_constraints_b_ = false; spacer_l_ =0; } @@ -28,7 +27,7 @@ Column_x_positions::~Column_x_positions() void Column_x_positions::add_paper_column (Paper_column*c) { - cols.push (c); + cols_.push (c); } void @@ -36,8 +35,8 @@ Column_x_positions::print() const { #ifndef NPRINT DOUT << "energy : " << energy_f_ << '\n'; - DOUT << "line of " << config.size() << " cols\n"; - Vector v (config); + DOUT << "line of " << config_.size() << " cols\n"; + Vector v (config_); DOUT << v; #endif } @@ -54,8 +53,7 @@ void Column_x_positions::set_stupid_solution(Vector v) { energy_f_ = infinity_f; - ugh_b_ = true; - config = v; + config_ = v; } void diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index 284f1e83b3..cc494cfa88 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -90,13 +90,13 @@ Gourlay_breaking::do_solve () const break; Column_x_positions approx; - approx.cols = line; + approx.cols_ = line; approx.spacer_l_ = generate_spacing_problem (line, pscore_l_->paper_l_->line_dimensions_int (optimal_paths[start_idx].line_i_)); spacer_p_list.append (new Killing_cons (approx.spacer_l_,0)); - ( (Break_algorithm*)this)->approx_stats_.add (approx.cols); + ( (Break_algorithm*)this)->approx_stats_.add (approx.cols_); approx.approximate_solve_line (); if (approx.energy_f_ > energy_bound_f_) @@ -124,7 +124,7 @@ Gourlay_breaking::do_solve () const if (!candidate_lines[j].satisfies_constraints_b_) { candidate_lines[j].solve_line (); - ( (Break_algorithm*)this)->exact_stats_.add (candidate_lines[j].cols); + ( (Break_algorithm*)this)->exact_stats_.add (candidate_lines[j].cols_); } Real this_energy @@ -171,7 +171,7 @@ Gourlay_breaking::do_solve () const assert (i > optimal_paths[i].prev_break_i_); // there was no "feasible path" - if (!optimal_paths[i].line_config_.config.size ()) { + if (!optimal_paths[i].line_config_.config_.size ()) { final_breaks.set_size (0); break; } diff --git a/lily/include/col-info.hh b/lily/include/col-info.hh index d63c92b9ab..8aea10dbc4 100644 --- a/lily/include/col-info.hh +++ b/lily/include/col-info.hh @@ -39,7 +39,7 @@ struct Column_info { bool ugh_b_; Drul_array< Array > rods_; - Drul_array< Array > springs_; + // Drul_array< Array > springs_; Column_info(); Column_info (Paper_column *,Real const *); diff --git a/lily/include/colhpos.hh b/lily/include/colhpos.hh index 8b9d34b614..98b808a5bb 100644 --- a/lily/include/colhpos.hh +++ b/lily/include/colhpos.hh @@ -14,10 +14,9 @@ typedef Link_array Line_of_cols; struct Column_x_positions { Line_spacer * spacer_l_; - bool ugh_b_; - Line_of_cols error_col_l_arr_; - Line_of_cols cols; - Array config; + Line_of_cols cols_; + Array config_; + Real energy_f_; bool satisfies_constraints_b_; diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 395b277dd9..33d8eda649 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -8,8 +8,7 @@ #ifndef LILY_GUILE_HH #define LILY_GUILE_HH -// order of includes important? -#include "config.hh" + #include "string.hh" #include diff --git a/lily/include/ly-symbols.hh b/lily/include/ly-symbols.hh index 25a2b8b38b..28d10c7745 100644 --- a/lily/include/ly-symbols.hh +++ b/lily/include/ly-symbols.hh @@ -64,6 +64,7 @@ DECLARE_LY_SYMBOL(rulesym); DECLARE_LY_SYMBOL(rulethickness); DECLARE_LY_SYMBOL(script_priority); DECLARE_LY_SYMBOL(staffheight); +DECLARE_LY_SYMBOL(stretch_distance); DECLARE_LY_SYMBOL(style); DECLARE_LY_SYMBOL(text); DECLARE_LY_SYMBOL(transparent); diff --git a/lily/include/spring-spacer.hh b/lily/include/spring-spacer.hh index de2d4b4aee..354b664fb6 100644 --- a/lily/include/spring-spacer.hh +++ b/lily/include/spring-spacer.hh @@ -51,11 +51,8 @@ private: Spring_spacer (Spring_spacer const&s); Cons *ideal_p_list_; Array cols_; - Array loose_col_arr_; - /// mark column #i# as being loose. - void loosen_column (int i); /// the index of #c# in #cols# int col_id (Paper_column const *c) const; @@ -74,7 +71,6 @@ private: void handle_loose_cols(); - void position_loose_cols (Vector &) const; bool try_initial_solution_and_tell (Vector&)const; Vector try_initial_solution() const; @@ -82,7 +78,6 @@ private: Score_column* scol_l (int); void connect (int i,int j, Real,Real); - Line_of_cols error_pcol_l_arr() const; Real calculate_energy_f (Vector) const; public: static Line_spacer *constructor(); diff --git a/lily/line-of-score.cc b/lily/line-of-score.cc index be7a5e8dac..c53a33a9e8 100644 --- a/lily/line-of-score.cc +++ b/lily/line-of-score.cc @@ -28,8 +28,8 @@ Line_of_score::contains_b (Paper_column const* c) const Line_of_score* Line_of_score::set_breaking (Array const &breaking, int j) const { - const Link_array &curline (breaking[j].cols); - const Array &config (breaking[j].config); + const Link_array &curline (breaking[j].cols_); + const Array &config (breaking[j].config_); Line_of_score *line_l=0; line_l = dynamic_cast (clone()); diff --git a/lily/lookup.cc b/lily/lookup.cc index e82dd2f808..9dee0018d2 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -490,6 +490,19 @@ Molecule Lookup::staff_brace (Real y, int staff_size) const { Molecule m; + /* + (define (pianobrace y staffht) + (let* ((step 1.0) + (minht (* 2 staffht)) + (maxht (* 7 minht)) + ) + (string-append + (select-font (string-append "feta-braces" (number->string (inexact->exact staffht))) 0) + (char (max 0 (/ (- (min y (- maxht step)) minht) step)))) + ) + ) + */ + Atom at (gh_list (pianobrace_scm_sym, gh_double2scm (y), diff --git a/lily/main.cc b/lily/main.cc index 04e883c4de..abc2f5d169 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -65,14 +65,15 @@ Long_option_init theopts[] = { {0, "warranty", 'w'}, {0, "help", 'h'}, {0, "test", 't'}, - {0, "debug", 'D'}, + {0, "debug", 'd'}, {1, "init", 'i'}, {1, "include", 'I'}, - {0, "no-paper", 'M'}, - {0, "dependencies", 'd'}, + {0, "no-paper", 'm'}, + {0, "dependencies", 'M'}, // like GCC {0, "no-timestamps", 'T'}, // why do we have this option? {0, "find-old-relative", 'Q'}, {0, "ignore-version", 'V'}, + {0, "version", 'v'}, {1, "output-format", 'f'}, {0, "safe", 's'}, {0,0,0} @@ -91,10 +92,10 @@ usage () " -a, --about about LilyPond\n" ); cout << _ ( - " -D, --debug enable debugging output\n" + " -d, --debug enable debugging output\n" ); cout << _ ( - " -d, --dependencies write Makefile dependencies for every input file\n" + " -M, --dependencies write Makefile dependencies for every input file\n" ); cout << _ ( " -h, --help this help\n" @@ -109,7 +110,7 @@ usage () " -i, --init=FILE use FILE as init file\n" ); cout << _ ( - " -M, --no-paper produce midi output only\n" + " -m, --no-paper produce midi output only\n" ); cout << _ ( " -o, --output=FILE set FILE as default output base\n" @@ -322,6 +323,9 @@ main (int argc, char **argv) { switch (opt->shortname) { + case 'v': + exit (0); // we print a version anyway. + break; case 't': experimental_features_global_b = true; *mlog << "*** enabling experimental features, you're on your own now ***\n"; @@ -358,13 +362,13 @@ main (int argc, char **argv) case 's': safe_global_b = true; break; - case 'd': + case 'M': dependency_global_b = true; break; - case 'D': + case 'd': set_debug (true); break; - case 'M': + case 'm': no_paper_global_b = true; break; case 'T': diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index 1860a77d82..a307e1b104 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -90,19 +90,19 @@ Spacing_spanner::do_measure (int col1, int col2) const SCM hint = lc->get_elt_property (extra_space_scm_sym); SCM next_hint = rc->get_elt_property (extra_space_scm_sym); - + SCM stretch_hint = rc->get_elt_property (stretch_distance_scm_sym); + if (hint != SCM_BOOL_F) { hint = SCM_CDDR (hint); s.distance_f_ = gh_scm2double (hint); if (!lc->musical_b ()) - s.strength_f_ = 2.0; + s.strength_f_ = non_musical_space_strength; // fixed after complaints by michael krause 2.0; } else if (!lc->musical_b() && i+1 < col_count()) { s.distance_f_ = default_bar_spacing (lc,rc,shortest); - s.strength_f_ = non_musical_space_strength; // fixed after complaints by michael krause } else if (lc->musical_b()) { @@ -129,7 +129,7 @@ Spacing_spanner::do_measure (int col1, int col2) const s.distance_f_ += correction; } - if (s.distance_f_ <=0) + if (s.distance_f_ == 0.0) { /* \bar "". We give it 0 space, with high strength. @@ -137,6 +137,16 @@ Spacing_spanner::do_measure (int col1, int col2) const s.distance_f_ = 0.0 PT; s.strength_f_ = 20.0; } + else if (stretch_hint != SCM_BOOL_F) + { + Real hint_sp = gh_scm2double (SCM_CDR (stretch_hint)); + s.strength_f_ /= hint_sp; + } + else + { + s.strength_f_ /= s.distance_f_; + } + meas_springs.push (s); } } diff --git a/lily/spring-spacer.cc b/lily/spring-spacer.cc index 79ec147d69..9c1f6881d6 100644 --- a/lily/spring-spacer.cc +++ b/lily/spring-spacer.cc @@ -54,8 +54,6 @@ Spring_spacer::OK() const #ifndef NDEBUG for (int i = 1; i < cols_.size(); i++) assert (cols_[i].rank_i_ > cols_[i-1].rank_i_); - for (int i = 1; i < loose_col_arr_.size(); i++) - assert (loose_col_arr_[i].rank_i_ > loose_col_arr_[i-1].rank_i_); #endif } @@ -78,72 +76,17 @@ Spring_spacer::handle_loose_cols() for (int i=1; i < fixed.size(); i++) connected.connect (fixed[i-1], fixed[i]); + /* + connect unconnected columns with distances of 1.0; + */ for (int i = cols_.size(); i--;) { if (! connected.equiv (fixed[0], i)) { - warning (_f ("unconnected column: %d", i)); - loosen_column (i); + connected.connect (i-1, i); + connect (i-1, i, 1.0, 1.0); } } - OK(); -} - - -/** - Guess a stupid position for loose columns. Put loose columns at - regular distances from enclosing calced columns - */ -void -Spring_spacer::position_loose_cols (Vector &sol_vec) const -{ - if (!loose_col_arr_.size()) - return ; - assert (sol_vec.dim()); - Array fix_b_arr; - fix_b_arr.set_size (cols_.size() + loose_col_arr_.size ()); - Real utter_right_f=-infinity_f; - Real utter_left_f =infinity_f; - for (int i=0; i < loose_col_arr_.size(); i++) - { - fix_b_arr[loose_col_arr_[i].rank_i_] = false; - } - for (int i=0; i < cols_.size(); i++) - { - int r= cols_[i].rank_i_; - fix_b_arr[r] = true; - utter_right_f = utter_right_f >? sol_vec (i); - utter_left_f = utter_left_f 0) ?sol_vec (j-1) : utter_left_f; - Real right_pos_f = - (j < sol_vec.dim()) ? sol_vec (j) : utter_right_f; - int left_rank = (j>0) ? cols_[j-1].rank_i_ : 0; - int right_rank = (j left_rank && r < right_rank); - - v (i) = (r - left_rank)*left_pos_f/ d_r + - (right_rank - r) *right_pos_f /d_r; - } - } - sol_vec = v; } bool @@ -318,7 +261,7 @@ Spring_spacer::lower_bound_solution (Column_x_positions*positions) const DOUT << "Lower bound sol: " << solution_vec; positions->energy_f_ = calculate_energy_f (solution_vec); - positions->config = solution_vec; + positions->config_ = solution_vec; positions->satisfies_constraints_b_ = check_constraints (solution_vec); } @@ -350,10 +293,8 @@ Spring_spacer::solve (Column_x_positions*positions) const { WARN << _ ("solution doesn't satisfy constraints") << '\n' ; } - position_loose_cols (solution_vec); positions->energy_f_ = calculate_energy_f (solution_vec); - positions->config = solution_vec; - positions->error_col_l_arr_ = error_pcol_l_arr(); + positions->config_ = solution_vec; } else { @@ -402,68 +343,13 @@ Spring_spacer::add_column (Paper_column *col, bool fixed, Real fixpos) continue; if (cols_[idx].pcol_l_ != cr.other_l_) - continue; - - Real d = cr.distance_f_; - if (fabs (d) < EPS) - { - connect (idx, this_rank, cr.distance_f_, cr.strength_f_); // large strength. - } - else - connect (idx, this_rank, cr.distance_f_, - cr.strength_f_ / cr.distance_f_); + continue; + connect (idx, this_rank, cr.distance_f_, cr.strength_f_); } cols_.push (c); } -Line_of_cols -Spring_spacer::error_pcol_l_arr() const -{ - Link_array retval; - for (int i=0; i< cols_.size(); i++) - if (cols_[i].ugh_b_) - retval.push (cols_[i].pcol_l_); - for (int i=0; i < loose_col_arr_.size(); i++) - { - retval.push (loose_col_arr_[i].pcol_l_); - } - return retval; -} - -/* - Ugh. Should junk this. - */ -void -Spring_spacer::loosen_column (int idx) -{ - Column_info c=cols_.get (idx); - - Cons **pp = &ideal_p_list_; - - while (*pp) - { - Idealspacing *j = (*pp)->car_; - if (j->cols_drul_[LEFT] == idx|| j->cols_drul_[RIGHT] == idx) - { - delete remove_cons (pp); - } - else - { - pp = &(*pp)->next_; - } - } - c.ugh_b_ = true; - - int j=0; - for (; j < loose_col_arr_.size(); j++) - { - if (loose_col_arr_[j].rank_i_ > c.rank_i_) - break; - } - loose_col_arr_.insert (c,j); -} - void Spring_spacer::print() const diff --git a/lily/word-wrap.cc b/lily/word-wrap.cc index f9c7ea8dfa..81a407450e 100644 --- a/lily/word-wrap.cc +++ b/lily/word-wrap.cc @@ -66,13 +66,13 @@ Word_wrap::do_solve () const Paper_column* precol = dynamic_cast(pre); current.add_paper_column (precol); - current.spacer_l_ = generate_spacing_problem (current.cols, + current.spacer_l_ = generate_spacing_problem (current.cols_, pscore_l_->paper_l_->line_dimensions_int (line_no)); // try to solve - if (!feasible (current.cols)) + if (!feasible (current.cols_)) { - if (!minimum.cols.size ()) + if (!minimum.cols_.size ()) { warning (_ ("ugh, this measure is too long") + ", " + _f ("breakpoint: %d", break_idx) @@ -116,7 +116,7 @@ Word_wrap::do_solve () const // add nobreak version of breakable column - current.cols.top ()=breakpoints[break_idx]; + current.cols_.top ()=breakpoints[break_idx]; curcol_idx ++; break_idx++; } diff --git a/ly/engraver.ly b/ly/engraver.ly index 36fe345691..dfd6ca731e 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -9,8 +9,10 @@ StaffContext=\translator { voltaVisibility = "1"; \consists "Multi_measure_rest_engraver"; - \consists "Repeat_engraver"; \consists "Bar_engraver"; + % Bar_engraver must be first so default bars aren't overwritten +% with empty ones. + \consists "Repeat_engraver"; \consists "Clef_engraver"; \consists "Key_engraver"; \consists "Time_signature_engraver"; diff --git a/ly/params.ly b/ly/params.ly index ca52e36fab..6f606819cf 100644 --- a/ly/params.ly +++ b/ly/params.ly @@ -190,8 +190,8 @@ postBreakPadding = 0.0; stemSpacingCorrection = 0.5*\interline; -% relative strength of space following time signature, -non_musical_space_strength = 4.0; +% relative strength of space following tprefatory matter, and inline clefs. +non_musical_space_strength = 40.0; diff --git a/make/out/lelievijver.lsm b/make/out/lelievijver.lsm index 369539b369..a8197b2300 100644 --- a/make/out/lelievijver.lsm +++ b/make/out/lelievijver.lsm @@ -1,6 +1,6 @@ Begin3 Titel: LilyPond -Versie: 1.1.58 +Versie: 1.1.59 Inschrijf datum: 14JUL99 Beschrijving: @FLAPTEKST@ Trefwoorden: muziek typezetten midi notatie @@ -8,8 +8,8 @@ Auteur: hanwen@stack.nl (Han-Wen Nienhuys) janneke@gnu.org (Jan Nieuwenhuizen) Onderhouden door: hanwen@cs.ruu.nl (Han-Wen Nienhuys) Voornaamste plek: sunsite.unc.edu /pub/Linux/apps - 770k lilypond-1.1.58.tar.gz + 770k lilypond-1.1.59.tar.gz Oorspronkelijke plek: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 770k lilypond-1.1.58.tar.gz + 770k lilypond-1.1.59.tar.gz Copi-eer voorwaarden: GPL End diff --git a/make/out/lilypond.lsm b/make/out/lilypond.lsm index 07d36ef054..2041acb7ac 100644 --- a/make/out/lilypond.lsm +++ b/make/out/lilypond.lsm @@ -1,6 +1,6 @@ Begin3 Title: LilyPond -Version: 1.1.58 +Version: 1.1.59 Entered-date: 14JUL99 Description: @@ -12,8 +12,8 @@ Author: hanwen@cs.ruu.nl (Han-Wen Nienhuys) janneke@gnu.org (Jan Nieuwenhuizen) Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys) Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert - 770k lilypond-1.1.58.tar.gz + 770k lilypond-1.1.59.tar.gz Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 770k lilypond-1.1.58.tar.gz + 770k lilypond-1.1.59.tar.gz Copying-policy: GPL End diff --git a/make/out/lilypond.spec b/make/out/lilypond.spec index a6c7f5316a..9690f935a0 100644 --- a/make/out/lilypond.spec +++ b/make/out/lilypond.spec @@ -1,9 +1,9 @@ Name: lilypond -Version: 1.1.58 +Version: 1.1.59 Release: 1 Copyright: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.1.58.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.1.59.tar.gz Summary: A program for printing sheet music. URL: http://www.cs.uu.nl/~hanwen/lilypond Packager: Han-Wen Nienhuys diff --git a/scm/lily.scm b/scm/lily.scm index 139b94cfa8..cdeca540f1 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -105,8 +105,8 @@ (("Clef_item" "Span_bar") . (minimum_space 3.7)) (("Time_signature" "Span_bar") . (minimum_space 2.0)) (("Key_item" "Span_bar") . (minimum_space 2.5)) - (("Staff_bar" "Time_signature") . (minimum_space 2.0)) - (("Time_signature" "begin-of-note") . (extra_space 1.0)) ; Huh? see twinkle.ly + (("Staff_bar" "Time_signature") . (minimum_space 1.5)) ;double check this. + (("Time_signature" "begin-of-note") . (extra_space 2.0)) ;double check this. (("Key_item" "begin-of-note") . (extra_space 2.5)) (("Staff_bar" "begin-of-note") . (extra_space 1.0)) (("Clef_item" "begin-of-note") . (minimum_space 5.0)) @@ -118,8 +118,6 @@ ) ) - - (define (break-align-spacer this next) (let ((entry (assoc `(,this ,next) space-alist))) (if entry @@ -220,7 +218,7 @@ ; by executing a 0 0 moveto (define (embedded-ps s) - (string-append "\\special{ps: @beginspecial @setspecial " s " @endspecial}")) + (string-append "\\embeddedps{" s "}")) (define (end-output) "\n\\EndLilyPondOutput") @@ -238,17 +236,7 @@ ;; UGH - (define (header-end) (string-append -"\\special{!" -"/stafflinethickness \\mudelapaperstaffline0 def " ;may we burn in hell. -"/interline \\mudelapaperinterline0 %\n def " -"interline 3 div /bracket_b exch def " -"interline 2 mul /bracket_w exch def " -"stafflinethickness 2 mul /bracket_t exch def " -"interline 1.5 mul /bracket_v exch def " -"bracket_v /bracket_u exch def " -"50 /bracket_alpha exch def " -"1 setlinecap}")) + (define (header-end) "\\turnOnPostScript") (define (header creator generate) (string-append @@ -448,7 +436,7 @@ (define (beam width slope thick) (string-append - (numbers->string (list width slope thick)) " draw_beam " )) + (numbers->string (list width slope thick)) " draw_beam" )) (define (bracket h) (invoke-dim1 " draw_bracket" h)) @@ -470,7 +458,7 @@ (number->string (* 2 thick)) " ] 0 draw_dashed_slur")) - (define (decrescendo w h cont thick) + (define (decrescendo thick w h cont) (string-append (numbers->string (list w h (inexact->exact cont) thick)) " draw_decrescendo")) diff --git a/tex/lily-pdf-defs.tex b/tex/lily-pdf-defs.tex new file mode 100644 index 0000000000..0c15069c38 --- /dev/null +++ b/tex/lily-pdf-defs.tex @@ -0,0 +1,283 @@ +% A Native PDF version of lily-ps-defs.tex, in which the language +% features of the PS code are handled by TeX. This takes the place of +% lilyponddefs.ps, lily.ps, and lily-ps-defs.tex for PDFTeX. +% +% Note that this file will probably require changes if the lily.ps +% file changes, which is annoying in the long run. It might be best +% if sometime the intelligence embodied in lily.ps could be moved up +% to the GUILE level, so that the \embeddedps commands could consist +% simply of moveto, lineto, curveto, fill, and stroke commands, with +% numeric arguments. Such a setup would allow this file to be simpler +% and probably cause the resulting PostScript code to be faster as +% well. + +% Redefine @ and _ so we can use them in definition names here. +\catcode`\@=11 +\catcode`\_=11 + +% Define a helper procedure for PDF coding. This file really +% shouldn't be read if \pdfliteral is undefined, but the alternate +% definition is nice for testing. + +\ifx\pdfliteral\undefined + \def\LYPDF#1{\message{[ignored pdfliteral: #1]}} +\else + \let\LYPDF=\pdfliteral +\fi + +% Strip 'pt' off of dimensions. Borrowed from latex. +\begingroup + \catcode`P=12 + \catcode`T=12 + \lowercase{ + \def\x{\def\lypdf@rempt##1.##2PT{##1\ifnum##2>\z@.##2\fi}}} + \expandafter\endgroup\x +\def\lypdf@strippt{\expandafter\lypdf@rempt\the} + +\def\LYDIM#1{\expandafter\lypdf@strippt\dimen#1\space} + +\def\lypdf@correctfactor{65536} +\def\lypdf@divcorrect#1{\multiply\dimen#1 \lypdf@correctfactor\relax} + +%% Stack handling. The design for this is borrowed from supp-pdf.tex + +\newcount\nofLYPDFargs +\def\@@LYPDF{@@LYPDF} + +% Add an argument to the `stack' +\def\setLYPDFarg#1{ + \advance\nofLYPDFargs by 1 + \expandafter\def + \csname\@@LYPDF\the\nofLYPDFargs\endcsname + {#1} +} + +% Get the values for stack variables. The a form includes a closing +% \space and is thus useful for embedding in \LYPDF macros. +\def\gLYPDFa#1 + {\csname\@@LYPDF#1\endcsname\space} +\def\gLYPDFan#1 + {\csname\@@LYPDF#1\endcsname} + +% Reset the stack back to normal. +\def\resetLYPDFstack{\nofLYPDFargs=0} + +% A translator for \embeddedps commands. This simply stacks up the +% arguments and then passes the last arg to the appropriate lypdf@name +% macro. + +\def\embeddedps#1{ + \lypdf@handleArgs#1 \\} + +%% Handle the argument list. Note: when working with arrays, just +%% keep tacking things onto a string until we get a close bracket. +%% The various LYPDFarray... variables are used for that. +\newif\ifLYPDFarray +\def\LYPDFarraystart{[} +\def\LYPDFarrayend{]} +\def\LYPDFarraystring{} + +\def\lypdf@{lypdf@} +\def\lypdf@handleArgs#1 #2\\{ + \ifx\\#2\\% + \csname\lypdf@#1\endcsname + \resetLYPDFstack + \else + \edef\argstring{#1} + \ifLYPDFarray% + \edef\LYPDFarraystring{\LYPDFarraystring\space\argstring} + \ifx\argstring\LYPDFarrayend% + \LYPDFarrayfalse + \setLYPDFarg{\LYPDFarraystring} + \fi + \else + \ifx\argstring\LYPDFarraystart% + \LYPDFarraytrue + \edef\LYPDFarraystring{[} + \else + \setLYPDFarg{#1} + \fi + \fi + \lypdf@handleArgs#2\\ + \fi} + +% Here turning on PostScript sets up the bracket stuff. This should +% probably be called by a more generic header macro. +\def\turnOnPostScript{\lypdf@load_bracket_dimens}% +\def\turnOnExperimentalFeatures{}% + +%% TODO: lily-ps-defs sets a linecap of 1. I'm not yet sure how to do that +%% for the Page Description level in PDFTeX. + +%% What follows are the definitions for the embeddedps commands. +%% Notes that in general, \dimen0 and \dimen1 are the x and y +%% positions of the cursor (used for rlineto handling), and dimen2-9 +%% are used for local dimension handling in the various commands. + +\def\lypdf@resetstring{\edef\lypdf@curstring{}} + +\def\lypdf@moveto#1#2{ + \dimen0=#1pt + \dimen1=#2pt + \edef\lypdf@curstring{\lypdf@curstring\space\LYDIM0 \LYDIM1 m} +} + +\def\lypdf@rmoveto#1#2{ + \advance\dimen0 by #1 pt + \advance\dimen1 by #2 pt + \edef\lypdf@curstring{\lypdf@curstring\space\LYDIM0 \LYDIM1 m} +} + +\def\lypdf@rlineto#1#2{ + \advance\dimen0 by #1 pt + \advance\dimen1 by #2 pt + \edef\lypdf@curstring{\lypdf@curstring\space\LYDIM0 \LYDIM1 l} +} + +\def\lypdf@draw_beam{% takes width, slope, thick + \dimen2=\gLYPDFa3 pt\divide\dimen2 by 2 + \dimen3=\gLYPDFa1 pt\dimen3=\gLYPDFa2 \dimen3 + \lypdf@resetstring + \lypdf@moveto{0}{-\LYDIM2} + \lypdf@rlineto{\gLYPDFa1}{\LYDIM3} + \lypdf@rlineto{0}{\gLYPDFa3} + \LYPDF{\lypdf@curstring\space 0 \LYDIM2 l b} +} + +\def\lypdf@draw_decrescendo{% takes width, ht, cont, thick + \LYPDF{\gLYPDFa4 w + \gLYPDFa1 \gLYPDFa3 m 0 \gLYPDFa2 l S + \gLYPDFa1 -\gLYPDFa3 m 0 -\gLYPDFa2 l S} +} +\def\lypdf@draw_crescendo{% takes width, ht, cont, thick + \LYPDF{\gLYPDFa4 w + 0 \gLYPDFa3 m \gLYPDFa1 \gLYPDFa2 l S -\gLYPDFa3 m + \gLYPDFa1 -\gLYPDFa2 l S} +} + +\def\lypdf@draw_tuplet{% takes height, gap, dx, dy, thickness, dir + \dimen2=\gLYPDFa1 pt\multiply\dimen2 by \gLYPDFa6 \relax + % height*dir + \dimen3=\gLYPDFa2 pt % tuplet_gapx + \dimen0=\gLYPDFa3 pt + \dimen4=\gLYPDFa4 \dimen3 \divide\dimen4 by \dimen0 + \lypdf@divcorrect4 % tuplet_gapy + \dimen5=\gLYPDFa3 pt \advance\dimen5 by-\dimen3 + \divide\dimen5 by 2 % (dx-gx)/2 + \dimen6=\gLYPDFa4 pt \advance\dimen6 by-\dimen4 + \divide\dimen6 by 2 % (dx-gx)/2 + + \lypdf@resetstring + \lypdf@moveto{0}{0} + \lypdf@rlineto{0}{\LYDIM2} + \lypdf@rlineto{\LYDIM5}{\LYDIM6} + \lypdf@rmoveto{\LYDIM3}{\LYDIM4} + \lypdf@rlineto{\LYDIM5}{\LYDIM6} + \lypdf@rlineto{0}{-\LYDIM2} + \LYPDF{\gLYPDFa5 w 1 j 1 J \lypdf@curstring} +} + +\def\lypdf@draw_volta{% takes height, width, thickness, v_start, v_end + \dimen2=\gLYPDFa1 pt % volta height + \ifnum\gLYPDFa4 =0 + \edef\vstartstr{0 0 m 0 \LYDIM2 l\space} + \else + \edef\vstartstr{0 \LYDIM2 m\space} + \fi + \ifnum\gLYPDFa5 =0 + \edef\vendstr{\gLYPDFa2 0 l\space} + \else + \edef\vendstr{} + \fi + \LYPDF{\gLYPDFa3 w 1 J 1 j \vstartstr \gLYPDFa2 \LYDIM2 l \vendstr S} +} + +\def\lypdf@draw_bezier_sandwich{% sixteen coords, thickness + \LYPDF{\gLYPDFa17 w + \gLYPDFa15 \gLYPDFa16 m + \gLYPDFa9 \gLYPDFa10 \gLYPDFa11 \gLYPDFa12 \gLYPDFa13 \gLYPDFa14 c + \gLYPDFa7 \gLYPDFa8 l + \gLYPDFa1 \gLYPDFa2 \gLYPDFa3 \gLYPDFa4 \gLYPDFa5 \gLYPDFa6 c + b}} + +\def\lypdf@draw_dashed_slur{% + \LYPDF{1 J 1 j \gLYPDFa10 \gLYPDFa11 d \gLYPDFa9 w + \gLYPDFa1 \gLYPDFa2 m + \gLYPDFa3 \gLYPDFa4 \gLYPDFa5 \gLYPDFa6 \gLYPDFa7 \gLYPDFa8 c + S}} + +%% Definitions for the various dimensions used by the brackets. +\newdimen\lypdf@interline +\newdimen\lypdf@bracket_b +\newdimen\lypdf@bracket_w +\newdimen\lypdf@bracket_v +\newdimen\lypdf@bracket_u +\newdimen\lypdf@bracket_t + +\def\lypdf@load_bracket_dimens{ + \lypdf@interline=\mudelapaperinterline pt + \lypdf@bracket_b=0.3333\lypdf@interline + \lypdf@bracket_w=2\lypdf@interline + \lypdf@bracket_v=1.5\lypdf@interline + \lypdf@bracket_u=\lypdf@bracket_v + \lypdf@bracket_t=\mudelapaperstaffline pt + \lypdf@bracket_t=2\lypdf@bracket_t + \relax +} + +%alpha=50. We calculate the sin and cos directly because TeX can't. +\def\lypdf@bracket_sin{0.76604}% +\def\lypdf@bracket_cos{0.64279}% + +\def\lypdf@draw_half_bracket{% dimen2 is the bracket height + \dimen3=\dimen2\advance\dimen3 by -\lypdf@bracket_t % h - t + + % Here, dimen0 and dimen1 are the end points of the bracket + \dimen0=\lypdf@bracket_b\relax\advance\dimen0 by \lypdf@bracket_v + \dimen1=\dimen3\advance\dimen1 by \lypdf@bracket_u + + % bottom of half bracket and inner side + \edef\lypdf@halfbrack{0 0 m \lypdf@strippt\lypdf@bracket_b\space 0 l + \lypdf@strippt\lypdf@bracket_b\space \LYDIM3 l} + + % inner curve -- first control point is just 0.4*v to the right + \dimen4=\lypdf@bracket_b\advance\dimen4 by 0.4\lypdf@bracket_v + % ... second point is calc'd using alpha + \dimen5=-0.25\lypdf@bracket_v\relax + \dimen6=\dimen0\advance\dimen6 by \lypdf@bracket_cos\dimen5\relax + \dimen7=\dimen1\advance\dimen7 by \lypdf@bracket_sin\dimen5\relax + % draw the curve + \edef\lypdf@halfbrack + {\lypdf@halfbrack\space\LYDIM4 \LYDIM3 \LYDIM6 \LYDIM7 \LYDIM0 \LYDIM1 c} + + % outer curve -- second control point is just .5*v to the right + % (plus 1 pt) + \dimen4=0.5\lypdf@bracket_v\advance\dimen4 by 1pt + % ... first point is calc'd using alpha + \dimen5=-0.15\lypdf@bracket_v\relax + \dimen6=\dimen0\advance\dimen6 by \lypdf@bracket_cos\dimen5\relax + \dimen7=\dimen1\advance\dimen7 by \lypdf@bracket_sin\dimen5\relax + % draw the curve, close, stroke, fill + \edef\lypdf@halfbrack + {\lypdf@halfbrack\space\LYDIM6 \LYDIM7 \LYDIM4 \LYDIM2 0 \LYDIM2 c b} +} + +\def\lypdf@draw_bracket{% height + \dimen2=\gLYPDFa1 pt \divide\dimen2 by 2 + \advance\dimen2 by \lypdf@bracket_b\relax + % calculate the half bracket + \lypdf@draw_half_bracket + % set up graphics state, gsave, and flip the coord system + % then draw both half brackets. + \LYPDF{\lypdf@strippt\lypdf@bracket_t\space w + 1 J 1 j q 1 0 0 -1 0 0 cm + \lypdf@halfbrack\space Q \lypdf@halfbrack} + } + + +%% Clean up after ourselves. + +\catcode`\@=12 +\catcode`\_=8 + +\endinput diff --git a/tex/lily-ps-defs.tex b/tex/lily-ps-defs.tex index e94d198869..bad2bdc0a6 100644 --- a/tex/lily-ps-defs.tex +++ b/tex/lily-ps-defs.tex @@ -40,3 +40,26 @@ \expandafter\special{! \includelilyps } } + +\def\turnOnPostScript{% + % This sets CTM so that you get to the currentpoint + % by executing a 0 0 moveto + \def\embeddedps##1{% + \special{ps: @beginspecial @setspecial ##1 @endspecial} + } + % + + \special{! +/stafflinethickness \mudelapaperstaffline\space def +/interline \mudelapaperinterline\space def +interline 3 div /bracket_b exch def +interline 2 mul /bracket_w exch def +stafflinethickness 2 mul /bracket_t exch def +interline 1.5 mul /bracket_v exch def +bracket_v /bracket_u exch def +50 /bracket_alpha exch def +1 setlinecap} +} + +\def\turnOnExperimentalFeatures{} + diff --git a/tex/lilyponddefs.tex b/tex/lilyponddefs.tex index ada0b6442d..627e5987f0 100644 --- a/tex/lilyponddefs.tex +++ b/tex/lilyponddefs.tex @@ -39,7 +39,16 @@ \def\interscoreline{\vskip 16pt} \def\placebox#1#2#3{% \botalign{\hbox{\raise #1\leftalign{\kern #2{}#3}}}}% -\input lily-ps-defs + +% Are we using PDFTeX? If so, use pdf definitions to translate +% \embeddedps commands to embedded PDF. +\ifx\pdfoutput\undefined + \input lily-ps-defs +\else + \pdfoutput=1 + \input lily-pdf-defs +\fi + \def\EndLilyPondOutput{% \csname bye\endcsname } -- 2.39.2