From: fred Date: Sun, 24 Mar 2002 19:48:33 +0000 (+0000) Subject: lilypond-0.0.76 X-Git-Tag: release/1.5.59~4427 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4da16b8f1318140ed877b8bde1d0bfa5caf80eab;p=lilypond.git lilypond-0.0.76 --- diff --git a/init/performer.ini b/init/performer.ini index 6c77837edf..fa184d11e7 100644 --- a/init/performer.ini +++ b/init/performer.ini @@ -2,8 +2,6 @@ % setup for Request->Element conversion. Guru-only % -% nice to have, but let's first get some output - \requesttranslator { Performer "Score_performer" \alias "Score"; @@ -22,7 +20,11 @@ Performer "Performer_group_performer" \consists "Lyric_performer"; \consists "Note_performer"; + } } + \consists "Key_performer"; + \consists "Meter_performer"; + \consists "Swallow_performer"; } } diff --git a/lily/elem-group.cc b/lily/elem-group.cc index e104187fc2..1bf661a271 100644 --- a/lily/elem-group.cc +++ b/lily/elem-group.cc @@ -150,6 +150,10 @@ Elbement_group::Elbement_group() IMPLEMENT_IS_TYPE_B2(Horizontal_vertical_group, Horizontal_group, Vertical_group); IMPLEMENT_STATIC_NAME(Horizontal_vertical_group); +Horizontal_vertical_group::Horizontal_vertical_group() +{ +} + void Horizontal_vertical_group::do_substitute_dependency(Score_elem*o,Score_elem*n) { diff --git a/lily/include/elem-group.hh b/lily/include/elem-group.hh index c49c425a45..245b2dfcf1 100644 --- a/lily/include/elem-group.hh +++ b/lily/include/elem-group.hh @@ -60,7 +60,7 @@ class Horizontal_vertical_group : public Vertical_group, protected: virtual Horizontal_vertical_group* elem_group() { return this; } public: - Element_group(); + Horizontal_vertical_group(); bool contains_b(Score_elem const *)const; NAME_MEMBERS(); virtual void do_substitute_dependency(Score_elem*,Score_elem*); diff --git a/lily/include/key-performer.hh b/lily/include/key-performer.hh new file mode 100644 index 0000000000..b2612147f0 --- /dev/null +++ b/lily/include/key-performer.hh @@ -0,0 +1,30 @@ +/* + key-performer.hh -- declare Key_performer + + source file of the GNU LilyPond music typesetter + + (c) 1997 Jan Nieuwenhuizen +*/ + +#ifndef KEY_PERFOMER_HH +#define KEY_PERFOMER_HH + +#include "lily-proto.hh" +#include "performer.hh" + +class Key_performer : public Performer { +public: + NAME_MEMBERS(); + Key_performer(); + ~Key_performer(); + +protected: + void do_print() const; + virtual bool try_request( Request* req_l ); + virtual void process_requests(); + +private: + Key_change_req* key_req_l_; +}; + +#endif // KEY_PERFOMER_HH diff --git a/lily/include/lyric-performer.hh b/lily/include/lyric-performer.hh index 3abb55b0ba..e9bd22a2ee 100644 --- a/lily/include/lyric-performer.hh +++ b/lily/include/lyric-performer.hh @@ -3,8 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1997 Han-Wen Nienhuys - Jan Nieuwenhuizen + (c) 1997 Jan Nieuwenhuizen */ @@ -21,11 +20,13 @@ public: Lyric_performer(); ~Lyric_performer(); +protected: + void do_print() const; + virtual bool try_request( Request* req_l ); + virtual void process_requests(); + private: Array lreq_arr_; - virtual bool do_try_request(Request*); - virtual void do_process_requests(); - virtual void do_post_move_processing(); }; #endif // LYRIC_PERFOMER_HH diff --git a/lily/include/meter-performer.hh b/lily/include/meter-performer.hh new file mode 100644 index 0000000000..13cbec5bd0 --- /dev/null +++ b/lily/include/meter-performer.hh @@ -0,0 +1,30 @@ +/* + meter-performer.hh -- declare Meter_performer + + source file of the GNU LilyPond music typesetter + + (c) 1997 Jan Nieuwenhuizen +*/ + +#ifndef METER_PERFOMER_HH +#define METER_PERFOMER_HH + +#include "lily-proto.hh" +#include "performer.hh" + +class Meter_performer : public Performer { +public: + NAME_MEMBERS(); + Meter_performer(); + ~Meter_performer(); + +protected: + void do_print() const; + virtual bool try_request( Request* req_l ); + virtual void process_requests(); + +private: + Meter_change_req* meter_req_l_; +}; + +#endif // METER_PERFOMER_HH diff --git a/lily/include/music-list.hh b/lily/include/music-list.hh index 30d5793253..6ea2ae0f47 100644 --- a/lily/include/music-list.hh +++ b/lily/include/music-list.hh @@ -56,6 +56,7 @@ public: class Voice_element : public Chord { public: NAME_MEMBERS(); + Voice_element(); VIRTUAL_COPY_CONS(Voice_element,Music); }; diff --git a/lily/key-performer.cc b/lily/key-performer.cc new file mode 100644 index 0000000000..0ed1f33afa --- /dev/null +++ b/lily/key-performer.cc @@ -0,0 +1,65 @@ +/* + key-performer.cc -- implement Key_performer + + source file of the GNU LilyPond music typesetter + + (c) 1997 Jan Nieuwenhuizen +*/ + +#include "key-performer.hh" +#include "command-request.hh" +#include "midi-item.hh" + + +IMPLEMENT_STATIC_NAME(Key_performer); +IMPLEMENT_IS_TYPE_B1(Key_performer,Performer); +ADD_THIS_PERFORMER(Key_performer); + +Key_performer::Key_performer() +{ + key_req_l_ = 0; +} + +Key_performer::~Key_performer() +{ +} + +void +Key_performer::do_print() const +{ +#ifndef NPRINT + if ( key_req_l_ ) + key_req_l_->print(); +#endif +} + +void +Key_performer::process_requests() +{ + if ( key_req_l_ ) { + int sharps_i = key_req_l_->sharps_i(); + int flats_i = key_req_l_->flats_i(); + // midi cannot handle non-conventional keys + if ( !( flats_i && sharps_i ) ) { + Midi_key k( sharps_i - flats_i, key_req_l_->minor_b() ); + play_event( &k ); + } + key_req_l_ = 0; + } +} + +bool +Key_performer::try_request( Request* req_l ) +{ + if ( key_req_l_ ) + return false; + + if ( req_l->command() ) + key_req_l_ = req_l->command()->keychange(); + + if ( key_req_l_ ) + return true; + + return false; +} + diff --git a/lily/lyric-performer.cc b/lily/lyric-performer.cc index aa24dcac25..81014b9d5d 100644 --- a/lily/lyric-performer.cc +++ b/lily/lyric-performer.cc @@ -3,15 +3,13 @@ source file of the GNU LilyPond music typesetter - (c) 1997 Han-Wen Nienhuys - Jan Nieuwenhuizen + (c) 1997 Jan Nieuwenhuizen */ #include "lyric-performer.hh" +#include "text-def.hh" #include "musical-request.hh" -//#include "text-item.hh" -//#include "paper-def.hh" -//#include "lookup.hh" +#include "midi-item.hh" IMPLEMENT_STATIC_NAME(Lyric_performer); @@ -26,37 +24,34 @@ Lyric_performer::~Lyric_performer() { } -bool -Lyric_performer::do_try_request( Request* req_l ) +void +Lyric_performer::do_print() const { - Musical_req* m_l = req_l->musical(); - if ( !m_l || ! m_l->lreq_l() ) - return false; - lreq_arr_.push( m_l->lreq_l() ); - - return true; +#ifndef NPRINT + if ( lreq_arr_.size() ) + lreq_arr_[ 0 ]->print(); +#endif } void -Lyric_performer::do_process_requests() +Lyric_performer::process_requests() { -#if 0 - Text_item * last_item_l =0; - for (int i=0; i < lreq_arr_.size(); i++) { - Text_item *lp = new Text_item(lreq_arr_[i]->tdef_p_ ); - lp->dir_i_ = -1; - lp->fat_b_ = true; - if (last_item_l) - lp->add_support(last_item_l); - last_item_l = lp; - typeset_element(lp); + if ( lreq_arr_.size() ) { + Midi_text t( Midi_text::LYRIC, lreq_arr_[ 0 ]->tdef_p_->text_str_ ); + play_event( &t ); } -#endif + + lreq_arr_.clear(); } -void -Lyric_performer::do_post_move_processing() +bool +Lyric_performer::try_request( Request* req_l ) { - lreq_arr_.set_size(0); + Musical_req* m_l = req_l->musical(); + if ( !m_l || ! m_l->lreq_l() ) + return false; + lreq_arr_.push( m_l->lreq_l() ); + + return true; } diff --git a/lily/meter-performer.cc b/lily/meter-performer.cc new file mode 100644 index 0000000000..c04bf3bf56 --- /dev/null +++ b/lily/meter-performer.cc @@ -0,0 +1,60 @@ +/* + meter-performer.cc -- implement Meter_performer + + source file of the GNU LilyPond music typesetter + + (c) 1997 Jan Nieuwenhuizen +*/ + +#include "meter-performer.hh" +#include "command-request.hh" +#include "midi-item.hh" + + +IMPLEMENT_STATIC_NAME(Meter_performer); +IMPLEMENT_IS_TYPE_B1(Meter_performer,Performer); +ADD_THIS_PERFORMER(Meter_performer); + +Meter_performer::Meter_performer() +{ + meter_req_l_ = 0; +} + +Meter_performer::~Meter_performer() +{ +} + +void +Meter_performer::do_print() const +{ +#ifndef NPRINT + if ( meter_req_l_ ) + meter_req_l_->print(); +#endif +} + +void +Meter_performer::process_requests() +{ + if ( meter_req_l_ ) { + Midi_time m( meter_req_l_->beats_i_, meter_req_l_->one_beat_i_, 18 ); + play_event( &m ); + meter_req_l_ = 0; + } +} + +bool +Meter_performer::try_request( Request* req_l ) +{ + if ( meter_req_l_ ) + return false; + + if ( req_l->command() ) + meter_req_l_ = req_l->command()->meterchange(); + + if ( meter_req_l_ ) + return true; + + return false; +} + diff --git a/lily/template7.cc b/lily/template7.cc index 602fdeb2b6..6a5bb7d83f 100644 --- a/lily/template7.cc +++ b/lily/template7.cc @@ -6,6 +6,8 @@ (c) 1997 Han-Wen Nienhuys */ +#include "proto.hh" +#include "plist.hh" #include "plist.tcc" #include "pcursor.tcc" diff --git a/lily/template8.cc b/lily/template8.cc index db1531f0a9..bd33a49eb3 100644 --- a/lily/template8.cc +++ b/lily/template8.cc @@ -1,3 +1,5 @@ +#include "proto.hh" +#include "plist.hh" #include "plist.tcc" #include "pcursor.tcc" diff --git a/tex/dimen.tex b/tex/dimen.tex index c67dee6551..fb9d6d9d59 100644 --- a/tex/dimen.tex +++ b/tex/dimen.tex @@ -2,9 +2,11 @@ % A tex file to help determine dims. % -\font\musicfont=musix16 +\font\musicfont=musixsps \font\slurfont=xslu16 -\def\thefont{\musicfont} +\font\specfont=musixspx +% \def\thefont{\musicfont} +\def\thefont{\specfont} \def\mb#1{{\thefont\char#1}} @@ -18,7 +20,7 @@ \divide\wid by 2 \here=-\wid \loop\ifdim\here<\wid\advance\here by\inc - \hbox to0pt{\kern\here\vrule width0.05pt height 2pt\hss}% + \hbox to0pt{\kern\here\vrule width0.05pt height 4pt\hss}% \repeat% } diff --git a/tex/lilyponddefs.tex b/tex/lilyponddefs.tex index bbfef12dfc..58a4e11029 100644 --- a/tex/lilyponddefs.tex +++ b/tex/lilyponddefs.tex @@ -127,28 +127,31 @@ \def\emptybar{} -\def\thinbar#1{\vrule height #1 width 1.6\staffrulethickness} % TODO parametric. -\def\thickbar#1{\vrule height #1 width 2\smallspace} -\def\maatstreep#1{\thinbar{#1}} \def\defaultthinbar{\thinbar{\balkheight}} \def\defaultthickbar{\thickbar{\balkheight}} %? what-s wrong with rightalign? -\def\finishbar#1{\rightalign{\thinbar{#1}\kern\smallspace\thickbar{#1}}} - \def\repeatstopbar{\hss\rightalign{\repeatcolon\hskip2\smallspace\defaultthinbar\hskip\smallspace\defaultthickbar}} \def\repeatstartbar{\hbox{\defaultthickbar\kern\smallspace\defaultthinbar\kern2\smallspace\repeatcolon}} \def\repeatstopstart{\hbox{\repeatcolon\kern2\smallspace\defaultthinbar\kern\smallspace\defaultthickbar\kern\smallspace\defaultthickbar\kern\smallspace\defaultthinbar\kern2\smallspace\repeatcolon}} -\def\doublebar#1{\hbox{\thinbar{#1}\hskip\smallspace\thinbar{#1}}} %compatibility \def\repeatbar{\repeatstopbar} \def\startrepeat{\repeatstartbar} \def\repeatbarstartrepeat{\repeatstopstart} + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % parametric symbols %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\doublebar#1{\hbox{\thinbar{#1}\hskip\smallspace\thinbar{#1}}} +\def\thinbar#1{\vrule height #1 width 1.6\staffrulethickness} % TODO parametric. +\def\thickbar#1{\vrule height #1 width 2\smallspace} +\def\maatstreep#1{\thinbar{#1}} +\def\finishbar#1{\rightalign{\thinbar{#1}\kern\smallspace\thickbar{#1}}} + +\def\pianobrace#1{{\musicdraw\char#1}} \def\slurcharh#1{{\slurhfont\char#1}} \def\slurcharu#1{{\slurufont\char#1}} \def\slurchard#1{{\slurdfont\char#1}} @@ -194,9 +197,10 @@ \def\beamslope#1#2{{\count0=#2\advance\count0 by#1\musicfnt\char\count0}} -\def\rulesym#1#2{\vrule height #1 width #2} +\def\brace#1{\count0=148\advance\count0 by #1\musicdraw\char\count0} \def\crescendosym#1{\count0=84\advance\count0 by #1\musicdraw\char\count0} \def\decrescendosym#1{\count0=116\advance\count0 by #1\musicdraw\char\count0} +\def\rulesym#1#2{\vrule height #1 width #2} \def\settext#1{\textfont #1} \def\setitalic#1{\italicfont #1} \def\setdynamic#1{\dynfont #1}