From: fred Date: Sat, 21 Dec 1996 12:37:51 +0000 (+0000) Subject: lilypond-0.0.19 X-Git-Tag: release/1.5.59~6522 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8a974350c2e4903f36b4b17cc3ea1d1085312acb;p=lilypond.git lilypond-0.0.19 --- diff --git a/src/simplewalker.cc b/src/simplewalker.cc index fcf2558aac..9f5f0033f2 100644 --- a/src/simplewalker.cc +++ b/src/simplewalker.cc @@ -1,3 +1,7 @@ +/* + UGR + */ + #include "request.hh" #include "voice.hh" #include "clef.hh" @@ -19,22 +23,23 @@ Rhythmic_grouping parse_grouping(svec a) { - Rhythmic_grouping ret; Real one_beat =a[0]; a.del(0); svec r; for (int i= 0 ; i < a.sz(); i++) r.add(a[i]); Real here =0.0; + + svec children; for (int i=0; i < r.sz(); i++) { - ret.divisions.add(here); + Real last = here; here += one_beat * r[i]; - Rhythmic_grouping *child =new Rhythmic_grouping(Interval(last, here)); - child->split(r[i]); - ret.children.add(child); + children.add( + new Rhythmic_grouping(Interval(last, here), r[i] ) + ); } - ret.divisions.add(here); + return Rhythmic_grouping(children); } void @@ -46,7 +51,7 @@ Simple_walker::do_INTERPRET_command(Command*com) default_grouping = parse_grouping(args); }else if (com->args[0] == "BAR") { local_key_.reset(key_); - current_grouping = default_grouping; + } else if (com->args[0] == "KEY") { if (col()->when()) { @@ -129,6 +134,10 @@ Simple_walker::do_note(Rhythmic_req*rq) Notehead*n = s->get_notehead(req, clef_.c0_pos); stem_->add(n); + if (current_grouping) { + current_grouping->add_child( + c->moment_->whole_in_measure, rq->duration()); + } noteheads.add(n); int sidx =find_slur(v); if (sidx >= 0) { @@ -138,7 +147,7 @@ Simple_walker::do_note(Rhythmic_req*rq) if (wantkey) do_local_key(req); } - + if (rq->rest()) { c->typeset_item( s->get_rest(rq->rest()) ); } @@ -154,10 +163,11 @@ Simple_walker::process_requests() error("Too many beams (t = " +String(c->when())+")"); beam_ = new Beam; + current_grouping = new Rhythmic_grouping; } for (int i=0; i < c->slurs.sz(); i++) { Slur_req*sl = c->slurs[i]; - + if (sl->spantype == Span_req::START) { if (find_slur(sl->elt->voice_ )>=0) error("Too many slurs in voice"); @@ -176,20 +186,24 @@ Simple_walker::process_requests() if (beam_) { if (!stem_) - error("beamed note should have a stem (t = " - +String(c->when())+")"); - beam_->add(stem_); + WARN <<"beamed note should have a stem (t = " + <when())<<"\n"; + else + beam_->add(stem_); + + } if (stem_) { c->typeset_item(stem_); /* needed, otherwise placement of local_key fucks up */ -// stem_->set_default_extents(); - // can somebody explain myself? } if (c->beam_&& c->beam_->spantype == Span_req::STOP) { + beam_->set_grouping(default_grouping, *current_grouping); pscore_->typeset_spanner(beam_, s->theline); beam_ = 0; + delete current_grouping; + current_grouping =0; } for (int i = 0; i < noteheads.sz(); i++) { c->typeset_item(noteheads[i]); @@ -204,7 +218,7 @@ Simple_walker::process_requests() stem_ = 0; } for (int i=0; i < c->slurs.sz(); i++) { - Slur_req*sl = c->slurs[i]; + Slur_req *sl = c->slurs[i]; if (sl->spantype == Span_req::STOP) { int idx = find_slur(sl->elt->voice_); @@ -226,7 +240,7 @@ Simple_walker::Simple_walker(Simple_staff*s) stem_ = 0; beam_ =0; oldkey_undo = 0; - + current_grouping = 0; Local_key_item * i = s->get_local_key_item(); wantkey =i; delete i; diff --git a/symbol.ini b/symbol.ini index d0dd12453d..ed7b4f23be 100644 --- a/symbol.ini +++ b/symbol.ini @@ -11,12 +11,12 @@ table_sixteen = symboltables { "clefs" = table { - "violin" "\violinclef" 0pt 16pt -12.5pt 22.5pt - "bass" "\bassclef" 0pt 16pt 0pt 20pt - "viola" "\violaclef" 0pt 16pt 0pt 20pt - "violin_change" "\cviolinclef" 0pt 16pt -12.5pt 22.5pt - "bass_change" "\cbassclef" 0pt 16pt 0pt 20pt - "viola_change" "\cviolaclef" 0pt 16pt 0pt 20pt + "violin" "\violinclef" 0pt 12.8pt -10pt 18pt + "bass" "\bassclef" 0pt 11.2pt 0pt 16pt + "viola" "\violaclef" 0pt 12.8pt 0pt 16pt + "violin_change" "\cviolinclef" 0pt 11.2pt -12pt 12pt + "bass_change" "\cbassclef" 0pt 12.8pt 0pt 16pt + "viola_change" "\cviolaclef" 0pt 11.2pt 0pt 16pt } "balls" = table { @@ -71,18 +71,18 @@ table_sixteen = symboltables { } "dots" = table { - "1" "\lsingledot" 0pt 8pt -1pt 1pt - "2" "\ldoubledot" 0pt 12pt -1pt 1pt - "3" "\ltripledot" 0pt 16pt -1pt 1pt + "1" "\lsingledot" 0pt 2pt -1pt 1pt + "2" "\ldoubledot" 0pt 5pt -1pt 1pt + "3" "\ltripledot" 0pt 8pt -1pt 1pt } "flags" = table { - "8" "\eigthflag" 0pt 5pt 0pt 0pt - "16" "\sixteenthflag" 0pt 5pt 0pt 0pt - "32" "\thirtysecondflag" 0pt 5pt 0pt 0pt - "-8" "\deigthflag" 0pt 5pt 0pt 0pt - "-16" "\dsixteenthflag" 0pt 5pt 0pt 0pt - "-32" "\dthirtysecondflag" 0pt 5pt 0pt 0pt + "8" "\eigthflag" 0pt 4pt 0pt 0pt + "16" "\sixteenthflag" 0pt 4pt 0pt 0pt + "32" "\thirtysecondflag" 0pt 4pt 0pt 0pt + "-8" "\deigthflag" 0pt 4pt 0pt 0pt + "-16" "\dsixteenthflag" 0pt 4pt 0pt 0pt + "-32" "\dthirtysecondflag" 0pt 4pt 0pt 0pt } "beamslopes" = table {