% setup for Request->Element conversion. Guru-only
%
-% nice to have, but let's first get some output
-
\requesttranslator {
Performer "Score_performer"
\alias "Score";
Performer "Performer_group_performer"
\consists "Lyric_performer";
\consists "Note_performer";
+
}
}
+ \consists "Key_performer";
+ \consists "Meter_performer";
+ \consists "Swallow_performer";
}
}
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)
{
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*);
--- /dev/null
+/*
+ key-performer.hh -- declare Key_performer
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
+*/
+
+#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
source file of the GNU LilyPond music typesetter
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
- Jan Nieuwenhuizen <jan@digicash.com>
+ (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
*/
Lyric_performer();
~Lyric_performer();
+protected:
+ void do_print() const;
+ virtual bool try_request( Request* req_l );
+ virtual void process_requests();
+
private:
Array<Lyric_req*> lreq_arr_;
- virtual bool do_try_request(Request*);
- virtual void do_process_requests();
- virtual void do_post_move_processing();
};
#endif // LYRIC_PERFOMER_HH
--- /dev/null
+/*
+ meter-performer.hh -- declare Meter_performer
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
+*/
+
+#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
class Voice_element : public Chord {
public:
NAME_MEMBERS();
+ Voice_element();
VIRTUAL_COPY_CONS(Voice_element,Music);
};
--- /dev/null
+/*
+ key-performer.cc -- implement Key_performer
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
+*/
+
+#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;
+}
+
source file of the GNU LilyPond music typesetter
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
- Jan Nieuwenhuizen <jan@digicash.com>
+ (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
*/
#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);
{
}
-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;
}
--- /dev/null
+/*
+ meter-performer.cc -- implement Meter_performer
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
+*/
+
+#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;
+}
+
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
+#include "proto.hh"
+#include "plist.hh"
#include "plist.tcc"
#include "pcursor.tcc"
+#include "proto.hh"
+#include "plist.hh"
#include "plist.tcc"
#include "pcursor.tcc"
% 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}}
\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%
}
\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}}
\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}