]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.76
authorfred <fred>
Sun, 24 Mar 2002 19:48:33 +0000 (19:48 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:48:33 +0000 (19:48 +0000)
14 files changed:
init/performer.ini
lily/elem-group.cc
lily/include/elem-group.hh
lily/include/key-performer.hh [new file with mode: 0644]
lily/include/lyric-performer.hh
lily/include/meter-performer.hh [new file with mode: 0644]
lily/include/music-list.hh
lily/key-performer.cc [new file with mode: 0644]
lily/lyric-performer.cc
lily/meter-performer.cc [new file with mode: 0644]
lily/template7.cc
lily/template8.cc
tex/dimen.tex
tex/lilyponddefs.tex

index 6c77837edfc22b60236e60f983b190f8212c9857..fa184d11e7728be5273e5ce514c23fc6d5889154 100644 (file)
@@ -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";
                                Performer "Performer_group_performer"
                                \consists "Lyric_performer";
                                \consists "Note_performer";
+                               
                        }
                }
+               \consists "Key_performer";
+               \consists "Meter_performer";
+               \consists "Swallow_performer";
        }
 }
index e104187fc24c85cbb21dc9a3a49f78a5a75ab9f4..1bf661a27140846c11cd1d2c3eb325258b67adf2 100644 (file)
@@ -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)
 {
index c49c425a45e3493cfdbb2ff47c9f5d8f08861c32..245b2dfcf15646a60b6caef7f5232080b3627664 100644 (file)
@@ -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 (file)
index 0000000..b261214
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+  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
index 3abb55b0baafbb0ddd3c1ab9b06e400aad3de589..e9bd22a2ee278e862f841eb01ee40cc75c23781a 100644 (file)
@@ -3,8 +3,7 @@
 
   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>
 */
 
 
@@ -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<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
diff --git a/lily/include/meter-performer.hh b/lily/include/meter-performer.hh
new file mode 100644 (file)
index 0000000..13cbec5
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+  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
index 30d5793253970fc3271c9ef179e1edb717ba1959..6ea2ae0f478907d4d587a40f53fb37cd35f62112 100644 (file)
@@ -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 (file)
index 0000000..0ed1f33
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+  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;
+}
+
index aa24dcac2501e7a34c7a57a32952ae7371a8d7ee..81014b9d5df526522d8042636c1eb4669c320ac6 100644 (file)
@@ -3,15 +3,13 @@
 
   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);
@@ -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 (file)
index 0000000..c04bf3b
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+  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;
+}
+
index 602fdeb2b62326e7f3890620fbbc1ce9c74ac1ee..6a5bb7d83f7f7c1dee7d232b35771fd6682bfb90 100644 (file)
@@ -6,6 +6,8 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
+#include "proto.hh"
+#include "plist.hh"
 #include "plist.tcc"
 #include "pcursor.tcc"
 
index db1531f0a9750e5fb0d5aec0d49174963682ff3b..bd33a49eb311d64c380d93cbfa5c0a87ac1f3437 100644 (file)
@@ -1,3 +1,5 @@
 
+#include "proto.hh"
+#include "plist.hh"
 #include "plist.tcc"
 #include "pcursor.tcc"
index c67dee6551d12b58178a83f3bc1d13152f2fd82a..fb9d6d9d59e97f56e9017becc564791eccf135f5 100644 (file)
@@ -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%
 }
 
index bbfef12dfca9788d0ee971201cfff4ce7910dcf4..58a4e11029588a8cdafc543267677a5db322a86b 100644 (file)
 
 \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}