From ce9845392e4e22ae9c5f6ec1da914eb301f1892c Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 24 Sep 2000 18:55:08 +0200 Subject: [PATCH] release: 1.3.90 =========== * Changed lilypond to LilyPond in ly2dvi, Mudela to LilyPond source. * Website fixes: Changed \interline to \staffspace in manual, removed offending braces from mudela-book.tely. * Fixed slur attachment correction bug. * Made some fixes to Coriolan. 1.3.89.h --- CHANGES | 20 ++- DEDICATION | 7 +- Documentation/user/GNUmakefile | 4 +- NEWS | 5 + VERSION | 4 +- flower/file-path.cc | 14 ++ input/bugs/addlyrics.ly | 47 ------- input/bugs/bar-break.ly | 28 ---- input/bugs/bug1.ly | 5 - input/bugs/cross-staff-tuplet.ly | 10 -- input/bugs/different-time.ly | 3 + input/bugs/f.ly | 2 - input/bugs/hang.ly | 18 --- input/bugs/lyric-warning.ly | 6 - input/bugs/notreich.ly | 32 ----- input/bugs/shorthand-trickery.ly | 36 ------ input/bugs/staccato-quantisation.ly | 4 - input/bugs/volta.ly | 2 +- input/bugs/weird-x-staff-tuplet.ly | 10 -- input/scarlatti-paper.ly | 4 +- input/scarlatti-properties.ly | 8 +- input/test/auto-change.ly | 2 +- lily/auto-change-iterator.cc | 59 +++++++-- lily/beam.cc | 65 +++++----- lily/include/auto-change-iterator.hh | 4 + lily/include/beam.hh | 26 ++-- lily/include/lily-proto.hh | 2 +- lily/include/music-iterator.hh | 9 +- lily/include/musical-request.hh | 19 --- lily/include/simultaneous-music-iterator.hh | 1 + lily/include/slur.hh | 15 ++- lily/include/staff-symbol.hh | 2 + lily/note-heads-engraver.cc | 12 -- lily/rest-engraver.cc | 6 - lily/sequential-music-iterator.cc | 36 ++---- lily/side-position-interface.cc | 10 +- lily/simultaneous-music-iterator.cc | 29 +++-- lily/slur.cc | 23 ++-- lily/stem.cc | 18 +-- lily/text-engraver.cc | 16 +-- ly/engraver.ly | 36 +++--- ly/property.ly | 9 +- make/out/lilypond.lsm | 8 +- make/out/lilypond.spec | 4 +- mutopia/E.Satie/gnossienne-4.ly | 73 +++++------ scm/basic-properties.scm | 135 ++++++++++++++++++-- scm/lily.scm | 2 +- scm/paper.scm | 122 ------------------ scm/slur.scm | 22 +++- 49 files changed, 448 insertions(+), 586 deletions(-) delete mode 100644 input/bugs/addlyrics.ly delete mode 100644 input/bugs/bar-break.ly delete mode 100644 input/bugs/bug1.ly delete mode 100644 input/bugs/cross-staff-tuplet.ly delete mode 100644 input/bugs/f.ly delete mode 100644 input/bugs/hang.ly delete mode 100644 input/bugs/lyric-warning.ly delete mode 100644 input/bugs/notreich.ly delete mode 100644 input/bugs/shorthand-trickery.ly delete mode 100644 input/bugs/staccato-quantisation.ly delete mode 100644 input/bugs/weird-x-staff-tuplet.ly diff --git a/CHANGES b/CHANGES index 8e8ce43ea2..dc84c63d28 100644 --- a/CHANGES +++ b/CHANGES @@ -8,11 +8,25 @@ * Fixed slur attachment correction bug. -* Added some comments about brokenness of non-empty text, ie text that has - a width. - * Made some fixes to Coriolan. +1.3.89.hwn1 +=========== + +* Only open files, not directories + +* bugfix: textNonEmpty. + +* Look ahead in auto-change iterator for rests. This means rests +before the note leading to an automatic staff switch are switched as +well (improves the looks of scarlatti-test). Associated fixes and +additions for Music_iterator::skip () and friends. + +* Bugfix: only quantise staccato inside the staff. + +* cleanups for beam and stem. Removed global GUILE namespace calls +from Beam and Stem. + 1.3.89 ====== diff --git a/DEDICATION b/DEDICATION index 03d11e0b40..f6647fe0f1 100644 --- a/DEDICATION +++ b/DEDICATION @@ -5,10 +5,9 @@ met through music. - Those deserving special mentioning (in no particular order): -Esther, Marijke, Heike, Inge, Judith, Hannah, Auke, Ilse, Evelyn, -Maartje, Suzanne, Ilse (gee, again?) and last (but certainly not -least) Janneke! + Those deserving special mentioning (in no particular order): Esther, +Marijke, Heike, Inge, Judith, Hannah, Auke, Ilse, Evelyn, Maartje, Suzanne, +Ilse (gee, again?), Irene and last (but certainly not least) Janneke! HWN diff --git a/Documentation/user/GNUmakefile b/Documentation/user/GNUmakefile index a045e99d94..6b7186af4b 100644 --- a/Documentation/user/GNUmakefile +++ b/Documentation/user/GNUmakefile @@ -6,7 +6,9 @@ depth=../.. LATEX_FILES =$(wildcard *.latex) -DVI_FILES = $(addprefix $(outdir)/,$(LATEX_FILES:.latex=.dvi) $(TELY_FILES:.tely=.dvi)) + +# todo: add latex. +DVI_FILES = $(addprefix $(outdir)/, $(TELY_FILES:.tely=.dvi)) EXTRA_DIST_FILES= $(LATEX_FILES) $(wildcard *.itexi *.itely) diff --git a/NEWS b/NEWS index f2da758e45..277bd59a82 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ * Point and click functionality using emacs and Xdvi. +* Automatic part combining for orchestral scores. + * Improved design and implementation: Complete rewrite of the internals: LilyPond is smaller, cleaner, more flexible, etc. @@ -10,6 +12,9 @@ internals: LilyPond is smaller, cleaner, more flexible, etc. - Improved speed (undone for now, by .73 + .74), with comparable memory footprint + - More tweakability using less memory with new property push + mechanism. + - Improved robustness: Lily almost never crashes. * Piano pedal support diff --git a/VERSION b/VERSION index c3a40bd443..ce0904ffd5 100644 --- a/VERSION +++ b/VERSION @@ -1,8 +1,8 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 -PATCH_LEVEL=89 -MY_PATCH_LEVEL=jcn1 +PATCH_LEVEL=90 +MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/flower/file-path.cc b/flower/file-path.cc index 10df133946..501554ea65 100644 --- a/flower/file-path.cc +++ b/flower/file-path.cc @@ -2,7 +2,10 @@ path.cc - manipulation of paths and filenames. */ + #include +#include +#include #include "config.h" #include "file-path.hh" @@ -98,6 +101,17 @@ File_path::find (String nm) const path += nm; DEBUG_OUT << path << "? "; + + /* + Check if directory. TODO: encapsulate for autoconf + */ + struct stat sbuf; + if (stat (path.ch_C(), &sbuf) == ENOENT) + continue; + + if (!(sbuf.st_mode & __S_IFREG)) + continue; + FILE *f = fopen (path.ch_C(), "r"); // ugh! if (f) { diff --git a/input/bugs/addlyrics.ly b/input/bugs/addlyrics.ly deleted file mode 100644 index f38a604e1a..0000000000 --- a/input/bugs/addlyrics.ly +++ /dev/null @@ -1,47 +0,0 @@ -% Generated by mudela-book.py; options are nofly -\include "paper16.ly" -\paper { linewidth = 390.000000 \pt; } - -% copied from file `lyric-combine.ly' -\header{ -filename = "twinkle-pop.ly"; -%title = "Ah, vous dirais-je, maman "; -description = "twinkle twinkle in pop-song-settings"; -composer = "traditional"; -enteredby = "HWN, chords by Johan Vromans"; -copyright = "public domain"; -} - -\version "1.3.59"; - -m =\notes \relative c'' { - \property Staff.automaticMelismata = ##t - \autoBeamOff - g4 r8 \times 2/3 { g'8( f )e } r8 \grace { [d16 c b] } e4 - \emptyText - d8.^"melisma" \melisma c16 - \melismaEnd - b } - -noisebeat =\notes \relative c'' {g16 g g g } -noise = { \noisebeat \noisebeat \noisebeat \noisebeat \noisebeat \noisebeat } -textI = \lyrics { la2 __ la -- la __ la la la la la } -textII = \lyrics { da -- da __ da -- da da da da da } - -\score { - \notes < \context Staff = SA \m - \context Lyrics = LA { s1 } - \context Staff = SB { s1 } - \context Lyrics = LB { s1 } - \context Staff = SC \noise - - \addlyrics - \context Staff = SB \m - < \context Lyrics = LA \textI - \context Lyrics = LB \textII - > - - > -} - - diff --git a/input/bugs/bar-break.ly b/input/bugs/bar-break.ly deleted file mode 100644 index 94fd0dbbcf..0000000000 --- a/input/bugs/bar-break.ly +++ /dev/null @@ -1,28 +0,0 @@ -\score -{ - \context StaffGroup = a < - \context PianoStaff = b < - \context Staff = "c" \notes\relative c'' { b4 b \bar "empty"; \break b b } - \context Staff = "d" \notes\relative c'' { b4 b b b } - > - > - - \paper { - indent=100.0\mm; - linewidth=150.0\mm; - \translator { - \StaffContext - \consists "Instrument_name_engraver"; - numberOfStaffLines = #1 - marginScriptPadding = #30 % urg: this is in PT - instrument = #"Foo" - instr = #"Bar" - } - \translator { - \StaffGroupContext - \consists "Instrument_name_engraver"; - marginScriptPadding = #10 % urg: this is in PT - instrument = #"Piano\n(For rehearsal only)" - } - } -} diff --git a/input/bugs/bug1.ly b/input/bugs/bug1.ly deleted file mode 100644 index 124fa81af4..0000000000 --- a/input/bugs/bug1.ly +++ /dev/null @@ -1,5 +0,0 @@ -\score { - \notes \relative c'' { - c4 f - } -} diff --git a/input/bugs/cross-staff-tuplet.ly b/input/bugs/cross-staff-tuplet.ly deleted file mode 100644 index 10f689b469..0000000000 --- a/input/bugs/cross-staff-tuplet.ly +++ /dev/null @@ -1,10 +0,0 @@ - -\score { \context PianoStaff \notes < -\context Staff = up <{ c4 } - \times 2/3 { [c8 c\translator Staff = down c] }> - \context Staff = down c4 - - > - - } - diff --git a/input/bugs/different-time.ly b/input/bugs/different-time.ly index 9733e50271..927fd1af09 100644 --- a/input/bugs/different-time.ly +++ b/input/bugs/different-time.ly @@ -1,3 +1,6 @@ +% +% irregular spacing. + \score{ \context PianoStaff < \context Staff = upper \notes\relative c''{ diff --git a/input/bugs/f.ly b/input/bugs/f.ly deleted file mode 100644 index 2a7ee47918..0000000000 --- a/input/bugs/f.ly +++ /dev/null @@ -1,2 +0,0 @@ - -\score {\notes c4 } diff --git a/input/bugs/hang.ly b/input/bugs/hang.ly deleted file mode 100644 index efcd426500..0000000000 --- a/input/bugs/hang.ly +++ /dev/null @@ -1,18 +0,0 @@ -\score{ - < - \context Staff = flauti < - \context Voice=one \partcombine Voice - \context Thread=one \notes\relative c'' - { - %c1 - c2 c2 - } - \context Thread=two \notes\relative c'' - { - } - > - > - \paper{ - - } -} diff --git a/input/bugs/lyric-warning.ly b/input/bugs/lyric-warning.ly deleted file mode 100644 index 15e127b9a5..0000000000 --- a/input/bugs/lyric-warning.ly +++ /dev/null @@ -1,6 +0,0 @@ -% f.ly:4:20: warning: Must stop before this music ends: - - -\score { \notes { - \addlyrics { c4 } { f4} -}} diff --git a/input/bugs/notreich.ly b/input/bugs/notreich.ly deleted file mode 100644 index cef3c9c8dd..0000000000 --- a/input/bugs/notreich.ly +++ /dev/null @@ -1,32 +0,0 @@ - -% GENERATED AUTOMATICALLY - -\header { - title = "Not Clapping Music" ; - instrument = "For four hands"; - composer = "Not Steve Reich"; - year = "1972"; -} - - -beaming = \notes \repeat unfold 13 { \repeat unfold 3 { [ s2 ] } \bar ":|:"; } - -\score { - \notes < -% \property Score.midiInstrument = "woodblock" - \property Score.midiInstrument = "melodic tom" - \context RhythmicStaff = SA - \context Voice = VA < - \time 12/8 ; - { c8 c8 c8 r c8 r c8 c8 r c8 c8 r c8 c8 c8 r c8 r c8 c8 r c8 c8 r c8 c8 c8 r c8 r c8 c8 r c8 c8 r c8 c8 c8 r c8 r c8 c8 r c8 c8 r c8 c8 c8 r c8 r c8 c8 r c8 c8 r c8 c8 c8 r c8 r c8 c8 r c8 c8 r c8 c8 c8 r c8 r c8 c8 r c8 c8 r c8 c8 c8 r c8 r c8 c8 r c8 c8 r c8 c8 c8 r c8 r c8 c8 r c8 c8 r c8 c8 c8 r c8 r c8 c8 r c8 c8 r c8 c8 c8 r c8 r c8 c8 r c8 c8 r c8 c8 c8 r c8 r c8 c8 r c8 c8 r c8 c8 c8 r c8 r c8 c8 r c8 c8 r } \beaming - s8^"No accents whatsoever" - { s1. \mark "8$\\times$"; } - - - > - \context RhythmicStaff = SB - \context Voice = VA < { c8 c8 c8 r c8 r c8 c8 r c8 c8 r c8 c8 r c8 r c8 c8 r c8 c8 r c8 c8 r c8 r c8 c8 r c8 c8 r c8 c8 r c8 r c8 c8 r c8 c8 r c8 c8 c8 c8 r c8 c8 r c8 c8 r c8 c8 c8 r r c8 c8 r c8 c8 r c8 c8 c8 r c8 c8 c8 r c8 c8 r c8 c8 c8 r c8 r c8 r c8 c8 r c8 c8 c8 r c8 r c8 r c8 c8 r c8 c8 c8 r c8 r c8 c8 c8 c8 r c8 c8 c8 r c8 r c8 c8 r c8 r c8 c8 c8 r c8 r c8 c8 r c8 r c8 c8 c8 r c8 r c8 c8 r c8 c8 c8 c8 c8 r c8 r c8 c8 r c8 c8 r } \beaming > - > - \paper{ \translator { \ScoreContext \consists Mark_engraver; }} - \midi {\tempo 4 = 130;} - } diff --git a/input/bugs/shorthand-trickery.ly b/input/bugs/shorthand-trickery.ly deleted file mode 100644 index 6ad3025c85..0000000000 --- a/input/bugs/shorthand-trickery.ly +++ /dev/null @@ -1,36 +0,0 @@ -% -% Example of shorthand trickery -% \property Context.foo = bar -% -foo = \property Staff.foo = #"bar" -% -% -% - -one = \context Voice\notes\relative c { - a1 b c -} - - -two = \context Voice\notes { - a1\foo - b - < c\foo e > -} - -\score{ - \context OtherStaff=one < - \one - \two - > - \paper{ - \translator { - \StaffContext - \name "OtherStaff"; - } - \translator { - \ScoreContext - \accepts "OtherStaff"; - } - } -} diff --git a/input/bugs/staccato-quantisation.ly b/input/bugs/staccato-quantisation.ly deleted file mode 100644 index a8fd4cff1b..0000000000 --- a/input/bugs/staccato-quantisation.ly +++ /dev/null @@ -1,4 +0,0 @@ -\score { \notes \context Staff { -\stemup -f'-. g-. a-. b-. c-. d-. e-. -}} diff --git a/input/bugs/volta.ly b/input/bugs/volta.ly index 48889cf91a..c7d9f933c7 100644 --- a/input/bugs/volta.ly +++ b/input/bugs/volta.ly @@ -17,7 +17,7 @@ voice4 = \notes { } voicedefault = \notes { \property Staff.timeSignatureStyle="C" - \time 4/4; \key f; + \time 4/4; \key f \major; \tempo 4 = 200; } \score{ diff --git a/input/bugs/weird-x-staff-tuplet.ly b/input/bugs/weird-x-staff-tuplet.ly deleted file mode 100644 index 51d57cc733..0000000000 --- a/input/bugs/weird-x-staff-tuplet.ly +++ /dev/null @@ -1,10 +0,0 @@ - -\score { \context PianoStaff \notes < - -{ \times 2/3 { [c8 c\translator Staff = down c] }} - \context Staff = down c4 - - > - - } - diff --git a/input/scarlatti-paper.ly b/input/scarlatti-paper.ly index 8ed8e1e2a7..983c51bfdb 100644 --- a/input/scarlatti-paper.ly +++ b/input/scarlatti-paper.ly @@ -11,8 +11,8 @@ forced_stem_shorten3=0.; \translator{ \PianoStaffContext - maxVerticalAlign=42.\pt; - minVerticalAlign=42.\pt; + maxVerticalAlign=8.4; + minVerticalAlign=8.4; } \translator{\StaffContext timeSignatureStyle="C";} diff --git a/input/scarlatti-properties.ly b/input/scarlatti-properties.ly index 651de9a37b..53b117680d 100644 --- a/input/scarlatti-properties.ly +++ b/input/scarlatti-properties.ly @@ -7,8 +7,12 @@ rh=\property Thread.noteHeadStyle=##f lh=\property Thread.noteHeadStyle = #'diamond n=\property Thread.fontSize=#0 sm=\property Thread.fontSize=#-1 -su=\property Voice.verticalDirection=#1 -sd=\property Voice.verticalDirection=#-1 +% su=\property Voice.verticalDirection=#1 +% sd=\property Voice.verticalDirection=#-1 + +su=\property Voice.basicStemProperties \push #'direction = #1 +sd=\property Voice.basicStemProperties \push #'direction = #-1 + zs=\property Voice.forceHorizontalShift=#0.0 ls=\property Voice.forceHorizontalShift=#-0.6 sls=\property Voice.forceHorizontalShift=#-0.22 diff --git a/input/test/auto-change.ly b/input/test/auto-change.ly index 3a27cbe163..5d3d34f8e4 100644 --- a/input/test/auto-change.ly +++ b/input/test/auto-change.ly @@ -2,7 +2,7 @@ \score { \notes \context PianoStaff < \context Staff = "up" { - \autochange Staff \relative c' { g4 a b c d e f g } + \autochange Staff \context Voice = VA < \relative c' { g4 a b c d r4 a g } > } \context Staff = "down" { \clef bass; diff --git a/lily/auto-change-iterator.cc b/lily/auto-change-iterator.cc index cd4a350c85..cf291348c0 100644 --- a/lily/auto-change-iterator.cc +++ b/lily/auto-change-iterator.cc @@ -66,21 +66,58 @@ Auto_change_iterator::change_to (Music_iterator *it, String to_type, } -Pitch_interrogate_req* spanish_inquisition; // nobody expects it +/* + Look ahead to find first pitches to determine staff position. + WARNING: this means that -void -Auto_change_iterator::process (Moment m) + \autochange Staff \notes { .... \context Staff = otherstaff { .. } .. } + + will confuse the autochanger, since it will not notice that the + music for OTHERSTAFF is not his. + + PRECONDITION: this->ok() holds. +*/ +Array +Auto_change_iterator::pending_pitch (Moment m) const { - Music_wrapper_iterator::process (m); + Music_iterator * iter = child_iter_p_ ->clone (); + Array ps; + while (1) + { + SCM muses = iter->get_music (m); + for (SCM s = muses; gh_pair_p (s); s=gh_cdr (s)) + if (Note_req* nr = dynamic_cast (unsmob_music (gh_car (s)))) + { + ps.push (nr->pitch_); + } + + if (ps.size ()) + break; + + iter->skip (m); + if (!iter->ok()) + break; + + m = iter->pending_moment (); + } - if (!spanish_inquisition) - spanish_inquisition = new Pitch_interrogate_req; + delete iter; + return ps; +} - Music_iterator *it = try_music (spanish_inquisition); +void +Auto_change_iterator::process (Moment m) +{ + /* + first we get the pitches, then we do the real work. + Music_wrapper_iterator::process() might process (and throw away) + pitches we need. */ + Array ps = pending_pitch (m); - if (it && spanish_inquisition->pitch_arr_.size ()) + Music_wrapper_iterator::process (m); + if (ps.size ()) { - Musical_pitch p = spanish_inquisition->pitch_arr_[0]; + Musical_pitch p = ps[0]; Direction s = Direction (sign(p.steps ())); if (s != where_dir_) { @@ -88,11 +125,9 @@ Auto_change_iterator::process (Moment m) String to_id = (s >= 0) ? "up" : "down"; Auto_change_music const * auto_mus = dynamic_cast (music_l_); - change_to (it, auto_mus->what_str_, to_id); + change_to (child_iter_p_, auto_mus->what_str_, to_id); } } - - spanish_inquisition->pitch_arr_.clear (); } Auto_change_iterator::Auto_change_iterator( ) diff --git a/lily/beam.cc b/lily/beam.cc index 124dc7f9c0..10bf8d82e8 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -94,9 +94,6 @@ Beam::before_line_breaking (SCM smob) return SCM_EOL; } -/* - FIXME - */ Direction Beam::get_default_dir (Score_element*me) { @@ -124,14 +121,13 @@ Beam::get_default_dir (Score_element*me) } while (flip(&d) != DOWN); + SCM func = me->get_elt_property ("dir-function"); + SCM s = gh_call2 (func, + gh_cons (gh_int2scm (count[UP]), + gh_int2scm (count[DOWN])), + gh_cons (gh_int2scm (total[UP]), + gh_int2scm (total[DOWN]))); - SCM s = scm_eval2 (gh_list (ly_symbol2scm ("beam-dir-algorithm"), - ly_quote_scm (gh_cons (gh_int2scm (count[UP]), - gh_int2scm (count[DOWN]))), - ly_quote_scm (gh_cons (gh_int2scm (total[UP]), - gh_int2scm (total[DOWN]))), - SCM_UNDEFINED), - SCM_EOL); if (gh_number_p (s) && gh_scm2int (s)) return to_dir (s); @@ -244,9 +240,7 @@ Beam::set_stem_shorten (Score_element*m) int multiplicity = get_multiplicity (me); - // grace stems? - SCM shorten = scm_eval2 (ly_symbol2scm ("beamed-stem-shorten"), SCM_EOL); - + SCM shorten = me->get_elt_property ("beamed-stem-shorten"); if (shorten == SCM_EOL) return; @@ -452,10 +446,10 @@ Beam::calc_stem_y_f (Score_element*me,Item* s, Real y, Real dy) Real staffspace = me->paper_l ()->get_var ("staffspace"); - SCM space_proc = me->get_elt_property ("beam-space-function"); + SCM space_proc = me->get_elt_property ("space-function"); SCM space = gh_call1 (space_proc, gh_int2scm (beam_multiplicity)); - Real thick = gh_scm2double (me->get_elt_property ("beam-thickness")) *staffspace; + Real thick = gh_scm2double (me->get_elt_property ("thickness")) *staffspace; Real interbeam_f = gh_scm2double (space) * staffspace; // ugh -> use commonx @@ -556,8 +550,14 @@ Real Beam::quantise_dy_f (Score_element*me,Real dy) { Array a; - for (SCM s = scm_eval2 (ly_symbol2scm ("beam-height-quants"), SCM_EOL); - s !=SCM_EOL; s = gh_cdr (s)) + + SCM proc = me->get_elt_property ("height-quants"); + SCM quants = gh_call2 (proc, me->self_scm (), + gh_double2scm (me->paper_l ()->get_var ("stafflinethickness") + / me->paper_l ()->get_var ("staffspace"))); + + + for (SCM s = quants; gh_pair_p (s); s = gh_cdr (s)) a.push (gh_scm2double (gh_car (s))); if (a.size () <= 1) @@ -587,15 +587,20 @@ Beam::quantise_y_f (Score_element*me,Real y, Real dy, int quant_dir) int multiplicity = get_multiplicity (me); Real staff_space = Staff_symbol_referencer::staff_space (me); - SCM quants = scm_eval2 (gh_list (ly_symbol2scm ("beam-vertical-position-quants"), - gh_int2scm (multiplicity), - gh_double2scm (dy/staff_space), - SCM_UNDEFINED), - SCM_EOL); + Real thick = me->paper_l ()->get_var ("stafflinethickness"); + + SCM proc = me->get_elt_property ("vertical-position-quant-function"); + SCM quants = scm_apply (proc, + me->self_scm (), + gh_list (gh_int2scm (multiplicity), + gh_double2scm (dy/staff_space), + gh_double2scm (thick/staff_space), + SCM_EOL, SCM_UNDEFINED)); + Array a; - for (; quants != SCM_EOL; quants = gh_cdr (quants)) + for (; gh_pair_p (quants); quants = gh_cdr (quants)) a.push (gh_scm2double (gh_car (quants))); if (a.size () <= 1) @@ -635,8 +640,7 @@ Beam::set_beaming (Score_element*me,Beaming_info_list *beaming) /* beams to go with one stem. - BURP - clean me up. + FIXME: clean me up. */ Molecule Beam::stem_beams (Score_element*me,Item *here, Item *next, Item *prev) @@ -650,10 +654,10 @@ Beam::stem_beams (Score_element*me,Item *here, Item *next, Item *prev) int multiplicity = get_multiplicity (me); Real staffspace =me->paper_l ()->get_var ("staffspace"); - SCM space_proc = me->get_elt_property ("beam-space-function"); + SCM space_proc = me->get_elt_property ("space-function"); SCM space = gh_call1 (space_proc, gh_int2scm (multiplicity)); - Real thick = gh_scm2double (me->get_elt_property ("beam-thickness")) *staffspace; + Real thick = gh_scm2double (me->get_elt_property ("thickness")) *staffspace; Real interbeam_f = gh_scm2double (space) * staffspace; Real bdy = interbeam_f; @@ -669,16 +673,13 @@ Beam::stem_beams (Score_element*me,Item *here, Item *next, Item *prev) Molecule leftbeams; Molecule rightbeams; - /* - UGH: make a property of this. - */ Real nw_f; if (!Stem::first_head (here)) nw_f = 0; else { int t = Stem::type_i (here); - SCM proc = me->get_elt_property ("beam-flag-width-function"); + SCM proc = me->get_elt_property ("flag-width-function"); SCM result = gh_call1 (proc, gh_int2scm (t)); nw_f = gh_scm2double (result) * staffspace; } @@ -720,7 +721,7 @@ Beam::stem_beams (Score_element*me,Item *here, Item *next, Item *prev) int j = 0; Real gap_f = 0; - SCM gap = me->get_elt_property ("beam-gap"); + SCM gap = me->get_elt_property ("gap"); if (gh_number_p (gap)) { int gap_i = gh_scm2int ( (gap)); diff --git a/lily/include/auto-change-iterator.hh b/lily/include/auto-change-iterator.hh index 72b463c7ef..ac3c8dbd6d 100644 --- a/lily/include/auto-change-iterator.hh +++ b/lily/include/auto-change-iterator.hh @@ -22,7 +22,11 @@ public: protected: virtual void process (Moment); + + Array pending_pitch (Moment)const; private: + + Direction where_dir_; void change_to (Music_iterator* , String, String); }; diff --git a/lily/include/beam.hh b/lily/include/beam.hh index cd917f8d60..3ed32fae68 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -22,28 +22,36 @@ height -- real (dy) - damping -- amount of beam slope damping. (int) - should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams - - - molecule-callback -- - beam-thickness -- weight of beams, in staffspace + Read-only + ========= + + flag-width-function -- - beam-space-function -- function of type multiplicity -> real (in staffspace) + damping -- amount of beam slope damping. (int) + should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams default-neutral-direction -- which direction to choose if we're in the middle of the staff - after-line-breaking-callback -- + thickness -- weight of beams, in staffspace + + space-function -- function of type multiplicity -> real (in staffspace) + beamed-stem-shorten -- + + height-quants -- + + vertical-position-quant-function -- + + dir-function -- + damping -- damping factor (real). outer-stem-length-limit -- catch suspect beam slopes, set slope to zero if outer stem is lengthened more than this (in staffspace) slope-limit -- set slope to zero if slope is running away steeper than this. - */ class Beam { diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index d0de6ff36b..b1673f79f1 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -132,7 +132,7 @@ class Performance; class Performer; class Performer_group_performer; class Piano_bar_engraver; -class Pitch_interrogate_req; + class Pitch_squash_engraver; class Property_iterator; class Rational; diff --git a/lily/include/music-iterator.hh b/lily/include/music-iterator.hh index 1709a5d8e8..43d39505d7 100644 --- a/lily/include/music-iterator.hh +++ b/lily/include/music-iterator.hh @@ -25,9 +25,10 @@ ok () -- events left ? pending_mom () -- time tag of the next event to be processed. + PRECONDITION: this->ok() holds. - process (M) -- process all at M (Precondition: no events exist before - M). Side-effects: + process (M) -- process all at M (Precondition: no events exist + before M, this->ok() holds). Side-effects: * This removes all events at M from the pending queue. @@ -43,7 +44,7 @@ TODO: - merge pending_moment and process. + merge pending_moment and process? */ class Music_iterator @@ -55,8 +56,6 @@ public: VIRTUAL_COPY_CONS (Music_iterator); Moment music_length_mom () const; - - Music_iterator (); Music_iterator (Music_iterator const&); virtual ~Music_iterator (); diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh index 7b43113027..ee5728441c 100644 --- a/lily/include/musical-request.hh +++ b/lily/include/musical-request.hh @@ -157,25 +157,6 @@ public: VIRTUAL_COPY_CONS (Music); }; -/** - What pitches have ben acked ? - */ -class Pitch_interrogate_req : public Request -{ -public: - Array pitch_arr_; - VIRTUAL_COPY_CONS (Music); -}; - -/** - What rhythms have ben acked ? - */ -class Rhythm_interrogate_req : public Request -{ -public: - Array duration_arr_; - VIRTUAL_COPY_CONS (Music); -}; /** diff --git a/lily/include/simultaneous-music-iterator.hh b/lily/include/simultaneous-music-iterator.hh index e5ecdcd14b..1198a7dc84 100644 --- a/lily/include/simultaneous-music-iterator.hh +++ b/lily/include/simultaneous-music-iterator.hh @@ -29,6 +29,7 @@ public: virtual Moment pending_moment () const; virtual bool ok () const; virtual SCM get_music (Moment)const; + virtual void skip (Moment); protected: virtual void process (Moment); diff --git a/lily/include/slur.hh b/lily/include/slur.hh index 349b549dad..44e4ffaccf 100644 --- a/lily/include/slur.hh +++ b/lily/include/slur.hh @@ -28,7 +28,20 @@ y-free -- ? - */ + control-points -- + + + + Read-only + ========= + + extremity-rules -- + + extremity-offset-alist -- + + thickness -- + +*/ class Slur { public: diff --git a/lily/include/staff-symbol.hh b/lily/include/staff-symbol.hh index f78c4542bc..b854b76dfd 100644 --- a/lily/include/staff-symbol.hh +++ b/lily/include/staff-symbol.hh @@ -15,6 +15,8 @@ /** This spanner draws the lines of a pstaff. The bottom line is position 0. + + TODO: add stafflinethickness as parameter. */ class Staff_symbol { diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc index c7ad380cac..30ccf6e490 100644 --- a/lily/note-heads-engraver.cc +++ b/lily/note-heads-engraver.cc @@ -68,18 +68,6 @@ Note_heads_engraver::do_try_music (Music *m) { return now_mom () < note_end_mom_; } - else if (Pitch_interrogate_req *p = dynamic_cast (m)) - { - for (int i= note_req_l_arr_.size (); i--;) - p->pitch_arr_.push (note_req_l_arr_[i]->pitch_); // GUH UGH UGHUGH. - return true; - } - else if (Rhythm_interrogate_req *r = dynamic_cast (m)) - { - for (int i= note_req_l_arr_.size (); i--;) - r->duration_arr_.push (note_req_l_arr_[i]->duration_); // GUH UGH UGHUGH. - return true; - } return false; } diff --git a/lily/rest-engraver.cc b/lily/rest-engraver.cc index 23ff6e776b..40cba4eb91 100644 --- a/lily/rest-engraver.cc +++ b/lily/rest-engraver.cc @@ -99,12 +99,6 @@ Rest_engraver::do_try_music (Music *m) rest_req_l_ = r; return true; } - else if (Rhythm_interrogate_req *r = dynamic_cast (m)) - { - if (rest_req_l_) - r->duration_arr_.push (rest_req_l_->duration_); // GUH UGH UGHUGH. - return true; - } return false; } diff --git a/lily/sequential-music-iterator.cc b/lily/sequential-music-iterator.cc index bfeb3cd925..de480844e5 100644 --- a/lily/sequential-music-iterator.cc +++ b/lily/sequential-music-iterator.cc @@ -32,14 +32,7 @@ Sequential_music_iterator::Sequential_music_iterator (Sequential_music_iterator Sequential_music_iterator::~Sequential_music_iterator() { - if (iter_p_) - { -#if 0 - if (iter_p_->ok () ) - music_l_->origin ()->warning (_ ("Must stop before this music ends")); -#endif - delete iter_p_; - } + delete iter_p_; } void @@ -81,25 +74,19 @@ Sequential_music_iterator::descend_to_child () /* + Retrieve all music (starting at HERE), until a music with length L > + 0 is found. From the precondition, we know that UNTIL is later than + the earliest event. Hence we know - - Hier staat in feite: haal alle muziek op (startend op tijd HERE) tot - je iets met lengte L > 0 tegenkomt. Aangezien de preconditie is dat - UNTIL het eerstvolgende event is, weet je (per definitie) - L >= (UNTIL - HERE) - en iets wat hierna komt (op tijd T) komt dus na tijd + so something that comes after this thing with L > 0 happens after HERE + L >= HERE + (UNTIL - HERE) = UNTIL - Dus als je een L>0 tegenkomt, wil je de rest niet meer. Aangezien - alles wat tot nu toe hebt gespaard op HERE begint, is dat precies wat - je nodig hebt. - - Misschien kan je deze comment erbij stoppen, en moeten we de - eigenschappen van het muziek datatype wat formaliseren, zodat deze - redenering helderder is. + Hence all events after the one with L>0 are uninteresting, so we + ignore them. + */ SCM @@ -142,7 +129,6 @@ Sequential_music_iterator::get_music (Moment until)const void Sequential_music_iterator::skip (Moment until) { - SCM curs = cursor_; while (1) { Moment l =iter_p_->music_length_mom (); @@ -156,12 +142,12 @@ Sequential_music_iterator::skip (Moment until) delete iter_p_; iter_p_ =0; - curs = gh_cdr (curs); + cursor_ = gh_cdr (cursor_); - if (!gh_pair_p (curs)) + if (!gh_pair_p (cursor_)) return ; else - iter_p_ = get_iterator_p (unsmob_music (gh_car (curs))); + iter_p_ = get_iterator_p (unsmob_music (gh_car (cursor_))); } } diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index e82bf70465..bfb4ff7d84 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -148,7 +148,10 @@ directed_round (Real f, Direction d) /* Callback that quantises in staff-spaces, rounding in the direction - of the elements "direction" elt property. */ + of the elements "direction" elt property. + + Only rounds when we're inside the staff, as determined by + Staff_symbol_referencer::staff_radius() */ Real Side_position::quantised_position (Score_element *me, Axis ) { @@ -158,9 +161,10 @@ Side_position::quantised_position (Score_element *me, Axis ) { Real p = Staff_symbol_referencer::position_f (me); Real rp = directed_round (p, d); - + Real rad = Staff_symbol_referencer::staff_radius (me) *2 ; int ip = int (rp); - if ((ip % 2) == 0) + + if (abs (ip) < rad && (ip % 2) == 0) { ip += d; rp += d; diff --git a/lily/simultaneous-music-iterator.cc b/lily/simultaneous-music-iterator.cc index f860241448..4cc8d0c316 100644 --- a/lily/simultaneous-music-iterator.cc +++ b/lily/simultaneous-music-iterator.cc @@ -15,15 +15,13 @@ Simultaneous_music_iterator::Simultaneous_music_iterator () { separate_contexts_b_ = false; - cursor_i_ = 0; } Simultaneous_music_iterator::Simultaneous_music_iterator (Simultaneous_music_iterator const& src) : Music_iterator (src) { - cursor_i_ = src.cursor_i_; separate_contexts_b_ = src.separate_contexts_b_; - for (Cons *p = children_p_list_.head_; p; p = p->next_) + for (Cons *p = src.children_p_list_.head_; p; p = p->next_) { Music_iterator *i = p->car_; children_p_list_.append (new Killing_cons (i->clone (), 0)); @@ -35,12 +33,6 @@ Simultaneous_music_iterator::~Simultaneous_music_iterator () children_p_list_.junk (); } -/* - Should roll next () into this as well - - - huh? --hwn - */ SCM Simultaneous_music_iterator::get_music (Moment m)const { @@ -105,6 +97,23 @@ Simultaneous_music_iterator::process (Moment until) } } +void +Simultaneous_music_iterator::skip (Moment until) +{ + for (Cons **pp = &children_p_list_.head_; *pp;) + { + Music_iterator * i = (*pp)->car_; + if (i->pending_moment() <= until) + { + i->skip (until); + } + if (!i->ok()) + delete children_p_list_.remove_cons (pp); + else + pp = &(*pp)->next_; + } +} + Moment Simultaneous_music_iterator::pending_moment() const { @@ -132,3 +141,5 @@ Simultaneous_music_iterator::try_music_in_children (Music *m) const b =p->car_->try_music (m); return b; } + + diff --git a/lily/slur.cc b/lily/slur.cc index c0b3e4b9e4..a55a77812f 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -133,12 +133,7 @@ Slur::set_extremities (Score_element*me) { if (!gh_symbol_p (index_cell (me->get_elt_property ("attachment"), dir))) { - - // for (SCM s = get_elt_property ("slur-extremity-rules"); s != SCM_EOL; s = gh_cdr (s)) - - // FIXME: global GUILE scope used! - for (SCM s = scm_eval2 (ly_symbol2scm ("slur-extremity-rules"), - SCM_EOL); + for (SCM s = me->get_elt_property ("extremity-rules"); s != SCM_EOL; s = gh_cdr (s)) { SCM r = gh_call2 (gh_caar (s), me->self_scm (), @@ -289,17 +284,15 @@ Slur::get_attachment (Score_element*me,Direction dir, } - - // FIXME - int stemdir = stem ? Stem::get_direction (stem) : 1; + SCM alist = me->get_elt_property ("extremity-offset-alist"); +int stemdir = stem ? Stem::get_direction (stem) : 1; int slurdir = gh_scm2int (me->get_elt_property ("direction")); SCM l = scm_assoc - (scm_listify (a, - gh_int2scm (stemdir * dir), - gh_int2scm (slurdir * dir), - SCM_UNDEFINED), - scm_eval2 (ly_symbol2scm ("slur-extremity-offset-alist"), SCM_EOL)); - + (scm_listify (a, + gh_int2scm (stemdir * dir), + gh_int2scm (slurdir * dir), + SCM_UNDEFINED), alist); + if (l != SCM_BOOL_F) { o += ly_scm2offset (gh_cdr (l)) * ss * dir; diff --git a/lily/stem.cc b/lily/stem.cc index 68c93dad18..56c896838c 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -260,8 +260,7 @@ Stem::get_default_stem_end_position (Score_element*me) } else { - s = scm_eval2 (ly_symbol2scm ((type_str + "stem-length").ch_C()), - SCM_EOL); + s = me->get_elt_property("lengths"); for (SCM q = s; q != SCM_EOL; q = gh_cdr (q)) a.push (gh_scm2double (gh_car (q))); @@ -271,9 +270,8 @@ Stem::get_default_stem_end_position (Score_element*me) a.clear (); - s = scm_eval2 (ly_symbol2scm ((type_str + "stem-shorten").ch_C()), - SCM_EOL); - for (SCM q = s; q != SCM_EOL; q = gh_cdr (q)) + s = me->get_elt_property ("stem-shorten"); + for (SCM q = s; gh_pair_p (q); q = gh_cdr (q)) a.push (gh_scm2double (gh_car (q))); @@ -535,11 +533,11 @@ Stem::calc_stem_info (Score_element*me) int multiplicity = Beam::get_multiplicity (beam); - SCM space_proc = beam->get_elt_property ("beam-space-function"); + SCM space_proc = beam->get_elt_property ("space-function"); SCM space = gh_call1 (space_proc, gh_int2scm (multiplicity)); Real interbeam_f = gh_scm2double (space) * staff_space; - Real thick = gh_scm2double (beam->get_elt_property ("beam-thickness")); + Real thick = gh_scm2double (beam->get_elt_property ("thickness")); Stem_info info; info.idealy_f_ = chord_start_f (me); @@ -551,17 +549,15 @@ Stem::calc_stem_info (Score_element*me) Array a; SCM s; - String type_str = grace_b ? "grace-" : ""; - s = scm_eval2 (ly_symbol2scm ((type_str + "beamed-stem-minimum-length").ch_C()), SCM_EOL); + s = me->get_elt_property("beamed-minimum-lengths"); a.clear (); for (SCM q = s; q != SCM_EOL; q = gh_cdr (q)) a.push (gh_scm2double (gh_car (q))); Real minimum_length = a[multiplicity get_elt_property ("beamed-lengths"); a.clear(); for (SCM q = s; q != SCM_EOL; q = gh_cdr (q)) diff --git a/lily/text-engraver.cc b/lily/text-engraver.cc index ec8cc78071..521b7ac112 100644 --- a/lily/text-engraver.cc +++ b/lily/text-engraver.cc @@ -102,25 +102,13 @@ Text_engraver::do_process_music () if (r->style_str_.length_i ()) text->set_elt_property ("style", ly_str02scm (r->style_str_.ch_C())); - - /* - Text is empty by default, which means that the only condition - for not setting 'no-spacing-rods' should be: boolean && true. - - Anyway, non-empty text has been broken for some time now. - */ - - /// URG this is broken by basicTextScriptProperties which defines - /// no-spacing-rods - /// FIXME SCM nonempty = get_property ("textNonEmpty"); - if (!to_boolean (nonempty)) + if (to_boolean (nonempty)) /* empty text: signal that no rods should be applied. */ - text->set_elt_property ("no-spacing-rods" , SCM_BOOL_T); - + text->set_elt_property ("no-spacing-rods" , SCM_BOOL_F); announce_element (text, r); texts_.push (text); diff --git a/ly/engraver.ly b/ly/engraver.ly index 5194f47460..d6811d8884 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -164,13 +164,20 @@ GraceContext=\translator { basicNoteHeadProperties \push #'font-size = #-1 basicStemProperties \push #'font-size = #-1 + basicStemProperties \push #'stem-shorten = #'(0) basicBeamProperties \push #'font-size = #-1 basicTextScriptProperties \push #'font-size = #-1 basicSlurProperties \push #'font-size = #-1 basicLocalKeyProperties \push #'font-size = #-1 basicBeamProperties \push #'beam-thickness = #0.3 basicBeamProperties \push #'beam-space-function = #(lambda (x) 0.5) - + + basicStemProperties \push #'lengths = #(map (lambda (x) (* 0.8 x)) '(3.5 3.5 3.5 4.5 5.0)) + basicStemProperties \push #'beamed-lengths = + #'(0.0 2.5 2.0 1.5) + basicStemProperties \push #'minimum-beamed-lengths + = #(map (lambda (x) (* 0.8 x)) '(0.0 2.5 2.0 1.5)) + weAreGraceContext = ##t graceAccidentalSpace= 1.5 ; % in staff space } @@ -214,11 +221,6 @@ StaffGroupContext= \translator { \consists "Output_property_engraver"; \consists "System_start_delimiter_engraver"; systemStartDelimiterGlyph = #'bracket - - - - - \name StaffGroup; \accepts "Staff"; \accepts "RhythmicStaff"; @@ -671,19 +673,7 @@ ScoreContext = \translator { (before-line-breaking-callback . ,Script_column::before_line_breaking) (name . "script column") ) - basicSlurProperties = #`( - (interfaces . (slur-interface)) - (molecule-callback . ,Slur::brew_molecule) - (thickness . 1.2) - (spacing-procedure . ,Slur::set_spacing_rods) - (minimum-length . 1.5) - (after-line-breaking-callback . ,Slur::after_line_breaking) - - (de-uglify-parameters . ( 1.5 0.8 -2.0)) - (details . ((height-limit . 2.0) (ratio . 0.333) (force-blowfit . 0.5) (beautiful . 0.5))) - (y-free . 0.75) - (name . "slur") - ) + basicSlurProperties = #default-basic-slur-properties basicSpacingSpannerProperties =#`( (spacing-procedure . ,Spacing_spanner::set_springs) @@ -797,7 +787,15 @@ ScoreContext = \translator { (before-line-breaking-callback . ,Stem::before_line_breaking) (molecule-callback . ,Stem::brew_molecule) (thickness . 0.8) + (beamed-lengths . (0.0 2.5 2.0 1.5)) + (beamed-minimum-lengths . (0.0 1.5 1.25 1.0)) + +;; Stems in unnatural (forced) direction should be shortened, +;; according to [Roush & Gourlay]. Their suggestion to knock off +;; a whole staffspace seems a bit drastical: we'll do half. + (lengths . (3.5 3.5 3.5 4.5 5.0)) + (stem-shorten . (0.5)) ; if stem is on middle line, choose this direction. (default-neutral-direction . 1) (name . "stem") diff --git a/ly/property.ly b/ly/property.ly index cfed38993a..0ac31ec8c6 100644 --- a/ly/property.ly +++ b/ly/property.ly @@ -10,13 +10,16 @@ SEE THE REFERENCE MANUAL FOR EXPLANATIONS. \version "1.3.59"; -%hmm, (these) abbrevs suck, imo -% i guess they're meant as some form of doco -% that's what i use them for... +%{ stemup = \property Voice.verticalDirection = \up stemboth= \property Voice.verticalDirection = \center stemdown = \property Voice.verticalDirection = \down +%} + +stemup = \property Voice.basicStemProperties \push #'direction = #1 +stemdown = \property Voice.basicStemProperties \push #'direction = #-1 +stemboth= \property basicStemProperties \pop #'direction slurup = \property Voice.slurVerticalDirection = \up slurboth = \property Voice.slurVerticalDirection = \center diff --git a/make/out/lilypond.lsm b/make/out/lilypond.lsm index 546aa7ca7f..cbe2f20c30 100644 --- a/make/out/lilypond.lsm +++ b/make/out/lilypond.lsm @@ -1,15 +1,15 @@ Begin3 Title: LilyPond -Version: 1.3.89 -Entered-date: 23SEP00 +Version: 1.3.90 +Entered-date: 24SEP00 Description: Keywords: music notation typesetting midi fonts engraving Author: hanwen@cs.uu.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 - 1000k lilypond-1.3.89.tar.gz + 1000k lilypond-1.3.90.tar.gz Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 1000k lilypond-1.3.89.tar.gz + 1000k lilypond-1.3.90.tar.gz Copying-policy: GPL End diff --git a/make/out/lilypond.spec b/make/out/lilypond.spec index 47166fb29e..188340f524 100644 --- a/make/out/lilypond.spec +++ b/make/out/lilypond.spec @@ -1,9 +1,9 @@ Name: lilypond -Version: 1.3.89 +Version: 1.3.90 Release: 1 Copyright: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.89.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.90.tar.gz Summary: A program for printing sheet music. URL: http://www.cs.uu.nl/~hanwen/lilypond # Icon: lilypond-icon.gif diff --git a/mutopia/E.Satie/gnossienne-4.ly b/mutopia/E.Satie/gnossienne-4.ly index f3a510c59b..5b10edcb16 100644 --- a/mutopia/E.Satie/gnossienne-4.ly +++ b/mutopia/E.Satie/gnossienne-4.ly @@ -61,41 +61,41 @@ basloopje = \notes\relative c{ d,8( a' d f a d f d a f d )a } -accompany = \notes \relative c{ +accompany = \notes \relative c { % snapnie, hoevaak relative c heeft ze nodig? - \notes\relative c \basloopje - \notes\relative c \basloopje - \notes\relative c \basloopje - \transpose bes \notes\relative c{ \basloopje } - \transpose bes \notes\relative c{ \basloopje } - \notes\relative c \basloopje - \transpose bes \notes\relative c{ \basloopje } - \transpose bes \notes\relative c{ \basloopje } - \transpose a \notes\relative c{ \basloopje } - \transpose bes \notes\relative c{ \basloopje } - \transpose a \notes\relative c{ \basloopje } - \notes\relative c \basloopje - \notes\relative c \basloopje + \basloopje + \basloopje + \basloopje + \transpose bes \basloopje + \transpose bes \basloopje + \basloopje + \transpose bes \basloopje + \transpose bes \basloopje + \transpose a \basloopje + \transpose bes \basloopje + \transpose a \basloopje + \basloopje + \basloopje % huh? d' - \transpose d' \notes\relative c{ \basloopje } - \notes\relative c \basloopje - \notes\relative c \basloopje - \transpose d' \notes\relative c{ \basloopje } - \notes\relative c \basloopje - \notes\relative c \basloopje - \transpose e' \notes\relative c{ \basloopje } - \notes\relative c \basloopje - \notes\relative c \basloopje - \transpose bes \notes\relative c{ \basloopje } - \transpose a \notes\relative c{ \basloopje } - \notes\relative c \basloopje - \notes\relative c \basloopje - \transpose d' \notes\relative c{ \basloopje } - \notes\relative c \basloopje - \transpose d' \notes\relative c{ \basloopje } - \notes\relative c \basloopje - \notes\relative c \basloopje - \transpose e' \notes\relative c{ \basloopje } + \transpose d' \basloopje + \basloopje + \basloopje + \transpose d' \basloopje + \basloopje + \basloopje + \transpose e' \basloopje + \basloopje + \basloopje + \transpose bes \basloopje + \transpose a \basloopje + \basloopje + \basloopje + \transpose d' \basloopje + \basloopje + \transpose d' \basloopje + \basloopje + \basloopje + \transpose e' \basloopje < e1*6/4 b' e> ~ < e b' e> } @@ -104,15 +104,16 @@ accompany = \notes \relative c{ \context Staff=up < \global \context Voice=foo { - \property Voice.verticalDirection = #1 - \property Voice.scriptVerticalDirection = #1 + \stemup + \property Voice.basicScriptProperties \push #'direction = #1 + \melody } > \context Staff=down < \global \clef bass; - \autochange Staff \accompany + \autochange Staff \context Voice \accompany > > diff --git a/scm/basic-properties.scm b/scm/basic-properties.scm index 469cc1e3fe..3dadb920c0 100644 --- a/scm/basic-properties.scm +++ b/scm/basic-properties.scm @@ -11,13 +11,11 @@ (define mark-visibility end-of-line-invisible) -; ugh: should calculate from beam-thickness. -; result in staff-space -;beam_thickness = 0.52 * (\staffspace - \stafflinethickness); -;interbeam = (2.0 * \staffspace + \stafflinethickness - \beam_thickness) / 2.0; -;interbeam4 = (3.0 * \staffspace - \beam_thickness) / 3.0; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; BEAMS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define (default-beam-space-function multiplicity) (if (<= multiplicity 3) 0.816 0.844) @@ -34,19 +32,138 @@ )) +; This is a mess : global namespace pollution. We should wait +; till guile has proper toplevel environment support. + + +;; Beams should be prevented to conflict with the stafflines, +;; especially at small slopes +;; ---------------------------------------------------------- +;; ######## +;; ######## +;; ######## +;; --------------########------------------------------------ +;; ######## +;; +;; hang straddle sit inter hang + +;; inter seems to be a modern quirk, we don't use that + + +;; Note: quanting period is take as quants.top () - quants[0], +;; which should be 1 (== 1 interline) +(define (mean a b) (* 0.5 (+ a b))) +(define (default-beam-dy-quants beam stafflinethick) + (let ((thick (ly-get-elt-property beam 'thickness)) + ) + + (list 0 (mean thick stafflinethick) (+ thick stafflinethick) 1) + )) + +;; two popular veritcal beam quantings +;; see params.ly: #'beam-vertical-quants + +; (todo: merge these 2 funcs ? ) + +(define (default-beam-y-quants beam multiplicity dy staff-line) + (let* ((beam-straddle 0) + (thick (ly-get-elt-property beam 'thickness)) + (beam-sit (/ (+ thick staff-line) 2)) + (beam-hang (- 1 (/ (- thick staff-line) 2))) + (quants (list beam-hang)) + ) + + (if (or (<= multiplicity 1) (>= (abs dy) (/ staff-line 2))) + (set! quants (cons beam-sit quants))) + (if (or (<= multiplicity 2) (>= (abs dy) (/ staff-line 2))) + (set! quants (cons beam-straddle quants))) + ;; period: 1 (interline) + (append quants (list (+ 1 (car quants)))))) + +(define (beam-traditional-y-quants beam multiplicity dy staff-line) + (let* ((beam-straddle 0) + (thick (ly-get-elt-property beam 'thickness)) + (beam-sit (/ (+ thick staff-line) 2)) + (beam-hang (- 1 (/ (- thick staff-line) 2))) + (quants '()) + ) + (if (>= dy (/ staff-line -2)) + (set! quants (cons beam-hang quants))) + (if (and (<= multiplicity 1) (<= dy (/ staff-line 2))) + (set! quants (cons beam-sit quants))) + (if (or (<= multiplicity 2) (>= (abs dy) (/ staff-line 2))) + (set! quants (cons beam-straddle quants))) + ;; period: 1 (interline) + (append quants (list (+ 1 (car quants)))))) + + +;; There are several ways to calculate the direction of a beam +;; +;; * majority: number count of up or down notes +;; * mean : mean centre distance of all notes +;; * median : mean centre distance weighted per note + +(define (dir-compare up down) + (sign (- up down))) + +;; arguments are in the form (up . down) +(define (beam-dir-majority count total) + (dir-compare (car count) (cdr count))) + +(define (beam-dir-mean count total) + (dir-compare (car total) (cdr total))) + +(define (beam-dir-median count total) + (if (and (> (car count) 0) + (> (cdr count) 0)) + (dir-compare (/ (car total) (car count)) (/ (cdr total) (cdr count))) + (dir-compare (car count) (cdr count)))) + + + +;; [Ross] states that the majority of the notes dictates the +;; direction (and not the mean of "center distance") +;; +;; But is that because it really looks better, or because he wants +;; to provide some real simple hands-on rules? +;; +;; We have our doubts, so we simply provide all sensible alternatives. + + + + + +;; array index multiplicity, last if index>size +;; beamed stems + + +;; TODO +;; - take #forced stems into account (now done in C++)? +;; - take y-position of chord or beam into account + +;;;;;;;;;;;;;;;;;;;;;;; + + +; +; todo: clean this up a bit: the list is getting rather long. +; (define basic-beam-properties `( (interfaces . (beam-interface)) (molecule-callback . ,Beam::brew_molecule) - (beam-thickness . 0.42) ; staff-space, should use stafflinethick? + (thickness . 0.42) ; in staff-space, should use stafflinethick? (before-line-breaking-callback . ,Beam::before_line_breaking) (after-line-breaking-callback . ,Beam::after_line_breaking) (default-neutral-direction . 1) + (dir-function . ,beam-dir-majority) + (height-quants . ,default-beam-dy-quants) + (vertical-position-quant-function . ,default-beam-y-quants) + (beamed-stem-shorten . (0.5)) (outer-stem-length-limit . 0.2) (slope-limit . 0.2) - (beam-flag-width-function . ,default-beam-flag-width-function) - (beam-space-function . ,default-beam-space-function) + (flag-width-function . ,default-beam-flag-width-function) + (space-function . ,default-beam-space-function) (damping . 1) - (name . "beam") + (name . "beam") ) ) diff --git a/scm/lily.scm b/scm/lily.scm index e4385c0eef..81afc034bf 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -723,7 +723,7 @@ (define (sign x) (if (= x 0) 1 - (inexact->exact (/ x (abs x))))) + (if (< x 0) -1 1))) ;;;; AsciiScript as (define (as-scm action-name) diff --git a/scm/paper.scm b/scm/paper.scm index 9e8146da48..5712e0a15a 100644 --- a/scm/paper.scm +++ b/scm/paper.scm @@ -7,125 +7,3 @@ ;;; All dimensions are measured in staff-spaces -; This is a mess : global namespace pollution. We should wait -; till guile has proper toplevel environment support. - - -;; Beams should be prevented to conflict with the stafflines, -;; especially at small slopes -;; ---------------------------------------------------------- -;; ######## -;; ######## -;; ######## -;; --------------########------------------------------------ -;; ######## -;; -;; hang straddle sit inter hang - -;; inter seems to be a modern quirk, we don't use that - -(define staff-line 0.10) -(define beam-thickness (* 0.52 (- 1 staff-line))) -(define beam-straddle 0) -(define beam-sit (/ (+ beam-thickness staff-line) 2)) -(define beam-hang (- 1 (/ (- beam-thickness staff-line) 2))) - -;; Note: quanting period is take as quants.top () - quants[0], -;; which should be 1 (== 1 interline) - -(define beam-normal-dy-quants - (list 0 (/ (+ beam-thickness staff-line) 2) (+ beam-thickness staff-line) 1)) - -;; two popular veritcal beam quantings -;; see params.ly: #'beam-vertical-quants -(define (beam-normal-y-quants multiplicity dy) - (let ((quants (list beam-hang))) - (if (or (<= multiplicity 1) (>= (abs dy) (/ staff-line 2))) - (set! quants (cons beam-sit quants))) - (if (or (<= multiplicity 2) (>= (abs dy) (/ staff-line 2))) - (set! quants (cons beam-straddle quants))) - ;; period: 1 (interline) - (append quants (list (+ 1 (car quants)))))) - -(define (beam-traditional-y-quants multiplicity dy) - (let ((quants '())) - (if (>= dy (/ staff-line -2)) - (set! quants (cons beam-hang quants))) - (if (and (<= multiplicity 1) (<= dy (/ staff-line 2))) - (set! quants (cons beam-sit quants))) - (if (or (<= multiplicity 2) (>= (abs dy) (/ staff-line 2))) - (set! quants (cons beam-straddle quants))) - ;; period: 1 (interline) - (append quants (list (+ 1 (car quants)))))) - - -;; There are several ways to calculate the direction of a beam -;; -;; * majority: number count of up or down notes -;; * mean : mean centre distance of all notes -;; * median : mean centre distance weighted per note - -(define (dir-compare up down) - (if (= up down) - 0 - (if (> up down) - 1 - -1))) - -;; (up . down) -(define (beam-dir-majority count total) - (dir-compare (car count) (cdr count))) - -(define (beam-dir-mean count total) - (dir-compare (car total) (cdr total))) - -(define (beam-dir-median count total) - (if (and (> (car count) 0) - (> (cdr count) 0)) - (dir-compare (/ (car total) (car count)) (/ (cdr total) (cdr count))) - (dir-compare (car count) (cdr count)))) - - -;;; Default variables and settings - -(define beam-height-quants beam-normal-dy-quants) -(define beam-vertical-position-quants beam-normal-y-quants) - - -;; [Ross] states that the majority of the notes dictates the -;; direction (and not the mean of "center distance") -;; -;; But is that because it really looks better, or because he wants -;; to provide some real simple hands-on rules? -;; -;; We have our doubts, so we simply provide all sensible alternatives. -(define beam-dir-algorithm beam-dir-majority) - - -;; array index flag-2 (what a name!!), last if index>size -;; unbeamed stems -(define stem-length '(3.5 3.5 3.5 4.5 5.0)) -(define grace-length-factor 0.8) -(define grace-stem-length - (map (lambda (x) (* grace-length-factor x)) stem-length)) - -;; array index multiplicity, last if index>size -;; beamed stems -(define beamed-stem-shorten '(0.5)) -(define beamed-stem-length '(0.0 2.5 2.0 1.5)) -(define grace-beamed-stem-length '(0.0 2.5 2.0 1.5)) -(define beamed-stem-minimum-length '(0.0 1.5 1.25 1.0)) -(define grace-beamed-stem-minimum-length - (map (lambda (x) (* grace-length-factor x)) beamed-stem-minimum-length)) - -;; Stems in unnatural (forced) direction should be shortened, -;; according to [Roush & Gourlay]. Their suggestion to knock off -;; a whole staffspace seems a bit drastical: we'll do half. - -;; TODO -;; - take #forced stems into account (now done in C++)? -;; - take y-position of chord or beam into account - -(define stem-shorten '(0.5)) -(define grace-stem-shorten '(0.0)) - diff --git a/scm/slur.scm b/scm/slur.scm index 27f26ee0ef..f3f010acb3 100644 --- a/scm/slur.scm +++ b/scm/slur.scm @@ -23,7 +23,7 @@ ;; 'head 'along-side-stem 'stem 'loose-end ;; -(define slur-extremity-rules +(define default-slur-extremity-rules (list ;; (cons (lambda (slur dir) (begin (display "before sanity check") (newline))#f) #f) @@ -83,7 +83,7 @@ ;; head: Default position is centered in X, on outer side of head Y ;; along-side-stem: Default position is on stem X, on outer side of head Y ;; stem: Default position is on stem X, at stem end Y -(define slur-extremity-offset-alist +(define default-slur-extremity-offset-alist '( ((head 1 1) . (-0.25 . 0.25)) ((head 1 -1) . (-0.25 . -0.25)) @@ -98,3 +98,21 @@ ((loose-end -1 -1) . (-4 . 0)) ((loose-end -1 1) . (-4 . 0)) )) + + +(define default-basic-slur-properties + `( + (interfaces . (slur-interface)) + (molecule-callback . ,Slur::brew_molecule) + (thickness . 1.2) + (spacing-procedure . ,Slur::set_spacing_rods) + (minimum-length . 1.5) + (after-line-breaking-callback . ,Slur::after_line_breaking) + (extremity-rules . ,default-slur-extremity-rules) + (extremity-offset-alist . ,default-slur-extremity-offset-alist) + (de-uglify-parameters . ( 1.5 0.8 -2.0)) + (details . ((height-limit . 2.0) (ratio . 0.333) (force-blowfit . 0.5) (beautiful . 0.5))) + (y-free . 0.75) + (name . "slur") + ) + ) -- 2.39.2