From: fred Date: Mon, 2 Dec 1996 00:20:03 +0000 (+0000) Subject: lilypond-0.0.13 X-Git-Tag: release/1.5.59~6701 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a134dc14fa2da2e4feae3b03c8ab02d807f4495d;p=lilypond.git lilypond-0.0.13 --- diff --git a/hdr/melodicstaff.hh b/hdr/melodicstaff.hh index d97bfb17f8..c908f1dcb0 100644 --- a/hdr/melodicstaff.hh +++ b/hdr/melodicstaff.hh @@ -15,6 +15,7 @@ struct Melodic_staff : public Simple_staff /****************/ + virtual Rest *get_rest(Rest_req *rq); virtual void set_output(PScore *); virtual Melodic_staff*clone()const; virtual Item* get_TYPESET_item(Command*); diff --git a/maartje.ly b/maartje.ly index fcb64323ee..c1dd45a689 100644 --- a/maartje.ly +++ b/maartje.ly @@ -1,35 +1,48 @@ ritme = rhythmstaff { - voice { $ c2 c2 + $ + c8 c2 c2 %[c8( )'a8 c8 c8] c2 c2 [fis16 'dis16( fis16 'dis16 ][fis16) 'dis16 fis16 'dis16] - c2 r32 r32 r16 r8 r4 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 $ } + c2 r32 r32 r16 r8 r4 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 $ } melody= melodicstaff { - voice { $ c () `bes $ start 0.5 } - voice { $ - %[fis16 'dis16 fis16 'dis16 fis16 'dis16 fis16 'dis16] - c2 - 'fis ()'gisis $ } + $ + c8 + r1 + 'cis2.. r8 + r4 r8 r16 r32 r32 + \duration {4} \chord { + \voice { c () `bes c} + \voice {'fis ()'gisis fis } + \voice { d () d dis } + \voice { a () bes eis } + \voice { fis () g gis } + } + c4 - voice { $ d () d $ start 0.5 } - voice { $ a () bes $ start 0.5 } - voice { $ fis () g $ start 0.5 } - - - voice { $ - ''c2.. r8 r4 r8 r16 r32 r32 - [d8 e8 'f8 g8] [d8 e8 f8 g8] - ''fis1 + [d8 e8 'f8 g8] d8 e8 f8 g8 + ''fis2 a8 b8 'c8 'd8 ''c8 ```c8 c4 c4 c4 c4 - \duration 16 `b16 `a16 `g16 `f16 \duration 4 - c `b `a `g `f `e `d `c ``b ``a ``g ``f ``e ``d ``c$ - start 1.0 } + \duration{ 16 } `b `a `g `f \duration{ 4} + c `b `a `g `f `e `d `c ``b ``a ``g ``f ``e ``d ``c + $ + + +commands { + skip 2:0 + key $ fis cis gis $ + skip 2:0 + key $ $ + skip 5:0 + clef bass +} } + score { paper { geometric 1.4 @@ -39,10 +52,10 @@ score { staff { melody } % staff { melody } commands { + partial 0.125 skip 0:0.125 + meter 4 4 - key $ fis cis gis $ - skip 2:0 - key $ $ + skip 2:0 meter 2 4 skip 19:0 } diff --git a/src/staff.cc b/src/staff.cc index 4b3322fcef..9b65539de5 100644 --- a/src/staff.cc +++ b/src/staff.cc @@ -1,21 +1,57 @@ #include "staff.hh" +#include "score.hh" +#include "voice.hh" #include "swalker.hh" +#include "getcommand.hh" #include "stcol.hh" #include "sccol.hh" +#include "inputcommands.hh" +#include "staffcommands.hh" #include "debug.hh" Staff::Staff(Staff const&src) { PL_copy(voices,src.voices); - PL_copy(commands,src.commands); + staff_commands_ = src.staff_commands_; assert(!cols.size()); // cols is a runtime field. - + input_commands_ = src.input_commands_; + score_ = src.score_; pscore_ = src.pscore_; } +void +Staff::add(svec &s) +{ + input_commands_.add(get_reset_command()); + input_commands_.concat(s); +} +void +Staff::add(PointerList &l) +{ + for (PCursor i(l); i.ok(); i++) + voices.bottom().add(i); +} +void +Staff::process_input_commands(svec &s, Real l) +{ + Input_commands commands; + for (int i = 0 ; i< s.sz(); i++) + commands.add(new Command(*s[i])); + for (int i = 0 ; i< input_commands_.sz(); i++) + commands.add(input_commands_[i]); + commands.truncate(l); + commands.print(); + + staff_commands_ = commands.parse(); + staff_commands_->clean(l); + commands.print(); + print(); +} + Paperdef* -Staff::paper() const{ +Staff::paper() const +{ return score_->paper_; } @@ -60,7 +96,8 @@ Staff::get_col(Real w, bool mus) // ; assert((i-1).ok()) // todo! - // making a fix at 2:30 am, with several beers drunk. + // making a fix at 2:30 am, with several beers drunk. + // but it works :-) if ((i-1).ok()&& (i-1)->when() == newst->when()) { i--; } @@ -82,10 +119,8 @@ Staff::add_voice(Voice *v) */ void Staff::setup_staffcols() -{ - +{ for (PCursor vc(voices); vc.ok(); vc++) { - Real now = vc->start; for (PCursor ve(vc->elts); ve.ok(); ve++) { @@ -95,38 +130,12 @@ Staff::setup_staffcols() } } - for (PCursor cc(commands); cc.ok(); cc++) { + for (PCursor cc(*staff_commands_); cc.ok(); cc++) { Staff_column *sc=get_col(cc->when,false); sc->s_commands.add(cc); } } -/// merge commands from score -void -Staff::add_commands(PointerList const &cl) -{ - PCursor score_c(cl); - PCursor cc(commands); - - while (score_c.ok()) { - while (cc.ok() && cc->when <= score_c->when) - cc++; - - Command*nc = new Command (*(* score_c)); - if (cc.ok()) { - // cc->when > score_c->when - cc.insert( nc ); - } else { - commands.bottom().add( nc); - cc = commands.bottom(); - } - score_c++; - } - - // now integrate break commands with other commands. - // maybe do this in derived functions. -} - void Staff::process() { @@ -140,7 +149,6 @@ Staff::OK() const { #ifndef NDEBUG cols.OK(); - commands.OK(); voices.OK(); assert(score_); #endif @@ -164,15 +172,19 @@ Staff::print() const #ifndef NPRINT mtor << "Staff {\n"; for (PCursor vc(voices); vc.ok(); vc++) { - vc->print(); - + vc->print(); } + if (staff_commands_) + staff_commands_->print(); + for (int i =0; i print(); mtor <<"}\n"; #endif } Staff::Staff() { + staff_commands_ = 0; score_ =0; pscore_=0; }