From: fred Date: Tue, 26 Mar 2002 23:56:03 +0000 (+0000) Subject: lilypond-1.3.90 X-Git-Tag: release/1.5.59~1302 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3ca37c5f543612c79f1b694f205398847b9a9a3a;p=lilypond.git lilypond-1.3.90 --- 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/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/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/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/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/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/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 > >