]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 0.0.73pre.jcn1: epsilon performance
authorJan Nieuwenhuizen <janneke@gnu.org>
Tue, 8 Jul 1997 08:21:22 +0000 (10:21 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Tue, 8 Jul 1997 08:21:22 +0000 (10:21 +0200)
pl 72pre.jcn1

- naming fixes; some iter*() explicitations
        - removed acceptor.hh
- second draft of midi (audio/...) based on engraver hierarchy

44 files changed:
.version
BUGS
NEWS
flower/include/iterate.hh
init/midi.ini [new file with mode: 0644]
init/performer.ini [new file with mode: 0644]
init/symbol.ini
lily/.version
lily/engraver-group.cc
lily/global-performers.cc [new file with mode: 0644]
lily/identifier.cc
lily/include/acceptor.hh
lily/include/engraver-group.hh
lily/include/global-performers.hh [new file with mode: 0644]
lily/include/global-translator.hh
lily/include/identifier.hh
lily/include/input-performer.hh [new file with mode: 0644]
lily/include/lily-proto.hh
lily/include/midi-def.hh
lily/include/midi-walker.hh
lily/include/my-lily-parser.hh
lily/include/note-performer.hh [new file with mode: 0644]
lily/include/performer-group-performer.hh [new file with mode: 0644]
lily/include/performer.hh [new file with mode: 0644]
lily/include/score-performer.hh [new file with mode: 0644]
lily/include/score.hh
lily/include/staff-performer.hh [new file with mode: 0644]
lily/include/voice-group-performer.hh [new file with mode: 0644]
lily/input-engraver.cc
lily/input-performer.cc [new file with mode: 0644]
lily/midi-def.cc
lily/music-iterator.cc
lily/my-lily-lexer.cc
lily/note-performer.cc [new file with mode: 0644]
lily/parser.y
lily/performer-group-performer.cc [new file with mode: 0644]
lily/performer.cc [new file with mode: 0644]
lily/score-grav.cc
lily/score-performer.cc [new file with mode: 0644]
lily/score.cc
lily/staff-performer.cc [new file with mode: 0644]
lily/template3.cc
lily/template6.cc
lily/voice-group-performer.cc [new file with mode: 0644]

index a3dacf472d17d8f9ad9a66babc13c5e4a9c93596..e60f251d795ea9875aa538510fd9951979fce44e 100644 (file)
--- a/.version
+++ b/.version
@@ -4,4 +4,4 @@ TOPLEVEL_PATCH_LEVEL = 73
 # use to send patches, always empty for released version:
 # include separator: ".postfix", "-pl" makes rpm barf
 
-TOPLEVEL_MY_PATCH_LEVEL = pre
+TOPLEVEL_MY_PATCH_LEVEL = pre.jcn1
diff --git a/BUGS b/BUGS
index 2806cbad4df8f02f26ac261393eba61ed3040bb4..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -1,16 +0,0 @@
-This file documents bugs which were "re-introduced" in various pl's
-
-pl 70 
-       * r^"simile"
-
-       * hairpin pos.
-
-pl69
-       * slurs.ly
-
-pl68:
-       * opening rests wohltemperirt
-       
-       * lyrics broken,
-
-       * midi broken
diff --git a/NEWS b/NEWS
index b9d083dda759dff8eb7c180d125917229305f325..c1c73b8ec862f406a29cd633147f149af698439f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,9 @@
+pl 72pre.jcn1
+
+       - naming fixes; some iter*() explicitations
+        - removed acceptor.hh
+       - second draft of midi (audio/...) based on engraver hierarchy
+
 pl 73pre
        - some refs doco.
        - move Input_engraver into Paper_def
index 9aee1ec550641c7ca1ed0b7f08e0398bf28e5c58..74e6ff202c7ed09e4051bc7594a3d941a707ccf6 100644 (file)
 #ifndef ITERATE_HH
 #define ITERATE_HH
 
-
+/*
+ ugh.
+ jcn: kjoet.
+      if we wouldn't have had this, things might have been 
+      just a little bit easier to read, imho.
+      (it does save quite some disk space, though)
+ */
 
 #define iterator(set)          typeof((set).top())
 #define iterator_bot(set)              typeof((set).bottom())
diff --git a/init/midi.ini b/init/midi.ini
new file mode 100644 (file)
index 0000000..29f4c2d
--- /dev/null
@@ -0,0 +1,5 @@
+
+default_midi = \midi {
+        \tempo 4:60;
+       \include "performer.ini"
+}
diff --git a/init/performer.ini b/init/performer.ini
new file mode 100644 (file)
index 0000000..7dffbbf
--- /dev/null
@@ -0,0 +1,26 @@
+%
+% setup for Request->Element conversion. Guru-only
+%
+
+\requestperformer {
+       "Score_performer"
+       \alias "Score";
+       \consists "Clef_performer";
+       \consists "Key_performer";
+       \consists "Meter_performer";
+       \consists "Tempo_performer";
+
+       \contains\requestperformer {
+               "Staff_performers"
+               \alias "Midi";
+               \contains\requestperformer{
+                       "Voice_group_performers"
+                       \alias "Voice_group";
+                       \contains\requestperformer{
+                               "Performer_group_performer"
+                               \consists "Lyric_performer";
+                               \consists "Note_performer";
+                       }
+               }
+       }
+}
index 2c26af1cc53aba18ccd875b79ac377b68a8a46e8..77f7fdd5f6c2b9e671a40ae8e671bc7607039b25 100644 (file)
@@ -5,6 +5,9 @@
 \include "script.ini"
 \include "paper16.ini"
 
+% ugh
+\include "midi.ini"
+
 left = -1
 right = 1
 up = 1
index aa80b10d8e6266ea965d15d06f1680524e7f2b09..5e83560950a7e0c157964bb5003374b6b0ba571b 100644 (file)
@@ -4,4 +4,4 @@ PATCH_LEVEL = 73
 # use to send patches, always empty for released version:
 # include separator: ".postfix", "-pl" makes rpm barf
 
-MY_PATCH_LEVEL = pre
+MY_PATCH_LEVEL = pre.jcn1
index c91921cefc4a2365a8c2f8ec09ba8450da028b88..1fd484572bbba685927bda27e8bf395111e3de3c 100644 (file)
@@ -47,7 +47,8 @@ Engraver_group_engraver::Engraver_group_engraver()
 void
 Engraver_group_engraver::set_feature(Feature d)
 {
-    iter_top(grav_list_, i);
+    PCursor<Engraver*> i(grav_list_.top());
+    // why the while construct?
     while (i.ok()) {
        // this construction to ensure clean deletion
        Engraver *grav_l = i++; 
@@ -58,9 +59,8 @@ Engraver_group_engraver::set_feature(Feature d)
 void
 Engraver_group_engraver::sync_features()
 {
-    iter_top(grav_list_, i);
+    PCursor<Engraver*> i(grav_list_.top());
     while (i.ok()) {
-
        Engraver *grav_l = i++; 
        grav_l->sync_features();
     }
@@ -69,9 +69,8 @@ Engraver_group_engraver::sync_features()
 void
 Engraver_group_engraver::do_pre_move_processing()
 {
-    iter_top(grav_list_, i);
+    PCursor<Engraver*> i(grav_list_.top());
     while (i.ok()) {
-       
        Engraver *grav_l = i++; 
        grav_l->pre_move_processing();
     }
@@ -80,9 +79,8 @@ Engraver_group_engraver::do_pre_move_processing()
 void
 Engraver_group_engraver::do_process_requests()
 {
-    iter_top(grav_list_, i);
+    PCursor<Engraver*> i(grav_list_.top());
     while (i.ok()) {
-       
        Engraver *grav_l = i++; 
        grav_l->process_requests();
     }
@@ -92,7 +90,7 @@ Engraver_group_engraver::do_process_requests()
 void
 Engraver_group_engraver::do_post_move_processing()
 {
-    iter_top(grav_list_, i);
+    PCursor<Engraver*> i(grav_list_.top());
     while (i.ok()) {
                // this construction to ensure clean deletion
        Engraver *grav_l = i++; 
@@ -108,8 +106,8 @@ Engraver_group_engraver::contains_b(Engraver* grav_l)const
     
     if (parent_b)
        return true;
-    for (iter_top(grav_list_, j); j.ok(); j++)
-       if (j->contains_b(grav_l))
+    for (PCursor<Engraver*> i(grav_list_.top()); i.ok(); i++)
+       if (i->contains_b(grav_l))
            return true;
     return false;
 }
@@ -152,7 +150,7 @@ Engraver_group_engraver::remove_engraver_p(Engraver*grav_l)
 {
     group_l_arr_.substitute((Engraver_group_engraver*)grav_l,0);
     nongroup_l_arr_.substitute(grav_l,0);
-    iterator(grav_list_) grav_cur= grav_list_.find(grav_l);
+    PCursor<Engraver*> grav_cur( grav_list_.find(grav_l) );
     
     return grav_cur.remove_p();
 }
@@ -176,7 +174,7 @@ Engraver_group_engraver::do_print()const
 {
 #ifndef NPRINT
     mtor << "ID: " << id_str_ << "\n";
-    for (iter_top(grav_list_, i); i.ok(); i++) 
+    for (PCursor<Engraver*> i(grav_list_.top()); i.ok(); i++)
        i->print();
 #endif
 }
@@ -272,7 +270,7 @@ Engraver_group_engraver::do_announces()
 void
 Engraver_group_engraver::do_removal_processing()
 {
-    for (iter( grav_list_.top(), i); i.ok(); i++)
+    for (PCursor<Engraver*> i(grav_list_.top()); i.ok(); i++)
        i->do_removal_processing();
 }
 
diff --git a/lily/global-performers.cc b/lily/global-performers.cc
new file mode 100644 (file)
index 0000000..43c4ec3
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+  global-performers.cc -- implement 
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+           Jan Nieuwenhuizen <jan@digicash.com>
+*/
+
+#include "proto.hh"
+#include "plist.hh"
+#include "input-performer.hh"
+#include "debug.hh"
+#include "performer.hh"
+
+struct Performer_table_entry {
+    String name_str_;
+    Perf_ctor ctor_l_;
+    Performer_table_entry(String s, Perf_ctor f) {
+       name_str_ =s;
+       ctor_l_ = f;
+    }
+    Performer_table_entry()
+    {
+       ctor_l_ =0;
+    }
+};
+
+static Array<Performer_table_entry> *perf_table=0;
+
+void
+add_Performer(String s, Perf_ctor f)
+{
+    if (!perf_table)
+       perf_table = new Array<Performer_table_entry>;
+    
+    perf_table->push(Performer_table_entry(s, f));
+}
+
+
+Performer*
+get_performer_p(String s)
+{
+    for (int i=0; i < perf_table->size(); i++) {
+       if ((*perf_table)[i].name_str_ == s)
+           return (*(*perf_table)[i].ctor_l_)();
+    }
+    error("Unknown performer `" + s +"\'");
+    return 0;
+}
index 072cd4def41ccbba6f36c9ad7f9bd43bb7c51953..0a2c813f2f5879ae7a7c2db598399498d37d7387 100644 (file)
@@ -7,17 +7,18 @@
 */
 
 #include <assert.h>
+#include "midi-def.hh"
 #include "paper-def.hh"
 #include "score.hh"
 #include "identifier.hh"
 #include "my-lily-lexer.hh"
 #include "debug.hh"
-#include "input-engraver.hh"
 #include "symtable.hh"
 #include "lookup.hh"
 #include "script-def.hh"
 #include "request.hh"
 #include "input-engraver.hh"
+#include "input-performer.hh"
 
 IMPLEMENT_STATIC_NAME(Identifier);
 IMPLEMENT_IS_TYPE_B(Identifier);
@@ -67,6 +68,8 @@ DEFAULT_PRINT(Music_id,Music , music);
 DEFAULT_PRINT(Request_id, Request, request);
 DEFAULT_PRINT(Score_id, Score, score);
 DEFAULT_PRINT(Input_gravs_id, Input_engraver, igravs);
+DEFAULT_PRINT(Input_perfs_id, Input_performer, iperfs);
+DEFAULT_PRINT(Midi_def_id,Midi_def, mididef);
 DEFAULT_PRINT(Paper_def_id,Paper_def, paperdef);
 
 void
@@ -120,6 +123,8 @@ implement_id_class(Music_id, Music, music);
 implement_id_class(Score_id, Score, score);
 implement_id_class(Request_id, Request, request);
 implement_id_class(Input_gravs_id, Input_engraver, igravs);
+implement_id_class(Input_perfs_id, Input_performer, iperfs);
+implement_id_class(Midi_def_id, Midi_def, mididef);
 implement_id_class(Paper_def_id, Paper_def, paperdef);
 
 Identifier::Identifier(Identifier const&)
@@ -136,4 +141,6 @@ virtual_accessor(Music_id, Music, music);
 default_accessor(Score_id, Score, score);
 virtual_accessor(Request_id, Request, request);
 default_accessor(Input_gravs_id, Input_engraver, igravs);
+default_accessor(Input_perfs_id, Input_performer, iperfs);
+default_accessor(Midi_def_id, Midi_def, mididef);
 default_accessor(Paper_def_id, Paper_def, paperdef);
index 872f374aee2478554c9491d4837f3759d8b8a04b..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,41 +0,0 @@
-/*
-  acceptor.hh -- declare Translator
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef ACCEPTOR_HH
-#define ACCEPTOR_HH
-#error
-
-#include "string.hh"
-#include "lily-proto.hh"
-#include "interpreter.hh"
-#include "virtual-methods.hh"
-
-class Translator {
-public:
-    String id_str_;
-    
-    int iterator_count_;
-    
-    virtual Interpreter * interpreter_l() { return 0; }
-
-    /// Score_engraver = 0, Staff_engravers = 1, etc)
-    virtual int depth_i()const=0;
-    virtual Translator *find_get_translator_l(String name, String id)=0;
-    virtual Translator *ancestor_l(int l=1)=0;
-    virtual ~Translator(){}
-    NAME_MEMBERS();
-    Translator();
-    virtual Translator *get_default_interpreter()=0;
-};
-
-class Interpreter : public virtual Translator {
-public:
-    virtual bool interpret_request_b(Request*) { return false;}
-};
-#endif // ACCEPTOR_HH
index d65375e49276615bffd7da938a5cf7c3d2d52c0d..bf3c761a2a492b989a4d6d2202c5c376ae9e18d1 100644 (file)
@@ -10,6 +10,7 @@
 #ifndef ENGRAVERGROUP_HH
 #define ENGRAVERGROUP_HH
 
+#include "lily-proto.hh"
 #include "parray.hh"
 #include "plist.hh"
 #include "score-elem-info.hh"
diff --git a/lily/include/global-performers.hh b/lily/include/global-performers.hh
new file mode 100644 (file)
index 0000000..b3e6574
--- /dev/null
@@ -0,0 +1,33 @@
+
+/*
+  global-performers.hh -- declare global performer stuff
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+                 Jan Nieuwenhuizen <jan@digicash.com>
+*/
+
+#ifndef GLOBAL_PERFORMER_HH
+#define GLOBAL_PERFORMER_HH
+
+/**
+  A macro to automate administration of performers
+ */
+#define ADD_THIS_PERFORMER( c ) \
+struct c ## init { \
+    static Performer* globalctor () \
+    { \
+       return new c;\
+    } \
+    c ## init () \
+    { \
+       add_Performer( c::static_name(), globalctor ); \
+    } \
+} _ ## c ## init;
+
+// typedef Performer*(*Perf_ctor)(void); c++ ?
+typedef Performer*(*Perf_ctor)();
+void add_Performer(String s, Perf_ctor f);
+
+#endif // GLOBAL_PERFORMER_HH 
index 877020b10d462a0b5c7b7cb187338222e96ccd24..8344d3d898f9e4214690c2277e97800b4582c99e 100644 (file)
@@ -36,4 +36,4 @@ protected:
 
 
 
-#endif // Global_translator_HH
+#endif // GLOBAL_TRANSLATOR_HH
index 1fca04eee3f4f780c390d2602352026aa47f9b46..1c0aa862078bbb96e11cc0cc2c0cd974530d3b02 100644 (file)
@@ -32,8 +32,10 @@ struct Identifier : public Input {
     void error(String);
     IDACCESSOR(Music, music)
     IDACCESSOR(Input_engraver, igravs) 
+    IDACCESSOR(Input_performer, iperfs)        
     IDACCESSOR(General_script_def, script)
     IDACCESSOR(Symtables, symtables)
+    IDACCESSOR(Midi_def, mididef)
     IDACCESSOR(Paper_def, paperdef)
     IDACCESSOR(Lookup,lookup)
     IDACCESSOR(Real,real)
@@ -67,5 +69,7 @@ declare_id_class(Int_id, int, intid);
 declare_id_class(Score_id, Score, score);
 declare_id_class(Request_id, Request, request);
 declare_id_class(Input_gravs_id, Input_engraver, igravs);
+declare_id_class(Input_perfs_id, Input_performer, iperfs);
+declare_id_class(Midi_def_id,Midi_def, mididef);
 declare_id_class(Paper_def_id,Paper_def, paperdef);
 #endif // IDENTIFIER_
diff --git a/lily/include/input-performer.hh b/lily/include/input-performer.hh
new file mode 100644 (file)
index 0000000..b865148
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+  input-performer.hh -- declare Input_performer
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+           Jan Nieuwenhuizen <jan@digicash.com>
+*/
+
+#ifndef INPUT_PERFORMER_HH
+#define INPUT_PERFORMER_HH
+
+#include "plist.hh"
+#include "string.hh"
+#include "lily-proto.hh"
+#include "input.hh"
+#include "string.hh"
+#include "varray.hh"
+
+struct Input_performer_list : public Pointer_list<Input_performer*> 
+{
+    Input_performer_list(Input_performer_list const &);
+    Input_performer_list(){}
+};
+
+struct Input_performer : Input { 
+    Input_performer_list contains_iperf_p_list_;
+    Array<String> consists_str_arr_;
+    Array<String> alias_str_arr_;
+    String type_str_;
+
+    void add(Input_performer *);
+    bool is_name_b(String);
+    bool accept_req_b();
+    bool accepts_b(String);
+    void print() const;
+    Performer_group_performer * get_group_performer_p();
+    Input_performer * get_default_iperf_l();
+    Input_performer * recursive_find(String nm);
+    Input_performer * find_iperf_l(String nm);    
+};
+
+
+Performer*get_performer_p(String s);
+
+#endif // INPUT_PERFORMER_HH
index 468a656abb8a47d1214bf29befa2dee6e6d487c4..5aa2fb999804a3e0eab250872a7082426df02ea9 100644 (file)
@@ -31,6 +31,7 @@ struct Chord;
 struct Clef_change_req;
 struct Clef_item;
 struct Clef_engraver;
+struct Clef_performer;
 struct Col_hpositions;
 struct Chord;
 struct Colinfo;
@@ -62,12 +63,14 @@ struct Identifier;
 struct Interpreter;
 struct Input_file;
 struct Input_engraver;
+struct Input_performer;
 struct Input_score;
 struct Item;
 struct Key;
 struct Key_change_req;
 struct Key_item;
 struct Key_engraver;
+struct Key_performer;
 struct Keyword;
 struct Keyword_table;
 struct Lily_stream;
@@ -85,6 +88,7 @@ struct Melodic_req;
 struct Meter;
 struct Meter_change_req;
 struct Meter_engraver;
+struct Meter_performer;
 struct Midi_def;
 struct Midi_duration;
 struct Midi_header;
@@ -105,6 +109,7 @@ struct Music_list;
 struct My_lily_parser;
 struct Note_column;
 struct Note_column_engraver;
+struct Note_performer;
 struct Note_req;
 struct Note_head;
 struct Note_head_engraver;
@@ -120,6 +125,8 @@ struct Pulk_voice;
 struct Pulk_voices;
 struct Rational;
 struct Engraver_group_engraver;
+struct Performer;
+struct Performer_group_performer;
 struct Request;
 struct Request_column;
 struct Engraver;
index 9673783d25fed2cecd240c36ebd37f197d172e6d..788cf1dc4f6399eaa357eef34978abfc25b7f3b0 100644 (file)
@@ -7,8 +7,8 @@
 */
 
 
-#ifndef MIDIDEF_HH
-#define MIDIDEF_HH
+#ifndef MIDI_DEF_HH
+#define MIDI_DEF_HH
 #include "lily-proto.hh"
 #include "real.hh"
 #include "string.hh"
@@ -25,18 +25,25 @@ struct Midi_def {
     /// output file name
     String outfile_str_;
 
+    Assoc<String, Real> *real_vars_p_;
+    Input_performer* iperf_p_;
+
     /// duration of whole note
     Real whole_seconds_f_;
 
     Midi_def();
-    Midi_def(Midi_def const& midi_c_r);
+    Midi_def( Midi_def const& midi_c_r );
     ~Midi_def();
 
     Real duration_to_seconds_f(Moment);
+    Global_translator* get_global_translator_p() const;
+    Real get_var( String s ) const;
     int get_tempo_i( Moment moment );
-    void set_tempo( Moment moment, int count_per_minute_i );
     void print() const;
+    void set( Input_performer* iperf_p );
+    void set_var( String s, Real r );
+    void set_tempo( Moment moment, int count_per_minute_i );
 };
 
-#endif // MIDIDEF_HH //
+#endif // MIDI_DEF_HH
 
index d99b6efe67c9ad3b365d855a2be506468db296c9..5bdea63b14d507930f4a864f328ba397eaecf967 100644 (file)
    but this is very tough i think.
    
    */
-class Performer {
-    Performer_group_performer * daddy_perf_l_;
-    
-    virtual bool try_request(Request*r)
-    {
-       return daddy_perf_l_->try_request(r);
-    }
-    virtual void play_event( Midi_item i ) { daddy_perf_l_->play_event (i ); }
-};
-
-class Performer_group_performer : public Performer, public Translator {
-    Pointer_list<Performer*> perf_p_list_;
-    
-    Link_array<Performer_group_performer> group_l_arr_;
-    Link_array<Performer> nongroup_l_arr_;
-    
-    bool try_request(Request*r)
-    {
-        bool hebbes_b =false;
-        for (int i =0; !hebbes_b && i < nongroup_l_arr_.size() ; i++)
-            hebbes_b =nongroup_l_arr_[i]->try_request(req_l);
-        if (!hebbes_b)
-            hebbes_b = daddy_grav_l_->try_request(req_l);
-        return hebbes_b ;
-    }
-    
-};
-
-class Staff_performer : public Performer_group_performer 
-{
-    int midi_track_i_;
-    String instrument_str() { 
-       return Translator::id_str_; 
-    }
-    virtual void play_event ( Midi_item i)
-    {
-       i.track_i_ = midi_track_i_;
-       Performer::play_event(i);
-    }
-};
 
 class Voice_performer_group_performer : public Performer_group_performer {
 
 };
 
-class Note_performer : public Performer {
-    Melodic_req * current_l_;
-    Moment switch_off_at_,switch_on_at_;
-
-
-    virtual void process_request() {
-       if (when() == switch_off_at_ )
-           play_event( Note_event(current_l_->pitch()  ))
-};
-
-class Voice_performer : 
-       public Performer_group_performer, public Interpreter 
-{
-    
-};
-
-class Score_performer: 
-    public Performer_group_performer, public Global_translator 
-{
-    Midi_file * file_p_;
-    Moment prev_;
-    virtual void play_event(Midi_item i)
-    {
-       file_p_->output (i);
-    }
-    virtual void prepare(Moment m){
-       file_p_->move ( m -prev_ );
-    }
-};
-
 #endif
 
 #endif // MIDIWALKER_HH
index 5ecfd7d62c94577adfd6ba69e628b16415b35cc1..6c963824985e3b868182389a589325c1d309bf74 100644 (file)
@@ -55,6 +55,7 @@ public:
     Input pop_spot();
     
     Paper_def*default_paper();
+    Midi_def*default_midi();
     void do_yyparse();
     void parser_error(String);
     void clear_notenames();
diff --git a/lily/include/note-performer.hh b/lily/include/note-performer.hh
new file mode 100644 (file)
index 0000000..c4a25de
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+  note-performer.hh -- declare Note_performer
+
+  (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+                 Jan Nieuwenhuizen <jan@digicash.com>
+ */
+
+#ifndef NOTE_PERFORMER_HH
+#define NOTE_PERFORMER_HH
+
+#include "performer.hh"
+
+class Note_performer : public Performer {
+    Melodic_req* current_l_;
+    Moment off_mom_;
+    Moment on_mom_;
+
+public:
+    virtual void process_request() {
+       if ( when() == off_mom_ )
+           play_event( Note_event( current_l_->pitch() ) );
+};
+
+#endif // NOTE_PERFORMER_HH
diff --git a/lily/include/performer-group-performer.hh b/lily/include/performer-group-performer.hh
new file mode 100644 (file)
index 0000000..eeff9f6
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+  performer-group-performer.hh -- declare Performer_group_performer
+
+  (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+                 Jan Nieuwenhuizen <jan@digicash.com>
+ */
+
+#ifndef PERFORMER_GROUP_PERFORMER_HH
+#define PERFORMER_GROUP_PERFORMER_HH
+
+#include "lily-proto.hh"
+#include "parray.hh"
+#include "plist.hh"
+#include "performer.hh"
+#include "translator.hh"
+
+/**
+  Group a number of performers. Usually delegates everything to its contents.
+*/
+
+class Performer_group_performer : public Performer, public virtual Translator {
+    Pointer_list<Performer*> perf_p_list_;
+    
+    Link_array<Performer_group_performer> group_l_arr_;
+    Link_array<Performer> nongroup_l_arr_;
+    
+public:
+    Input_performer* iperf_l_;
+    
+    virtual bool try_request( Request* req_l );
+    virtual void add( Performer* perf_p );
+};
+
+#endif // PERFORMER_GROUP_PERFORMER_HH
+
diff --git a/lily/include/performer.hh b/lily/include/performer.hh
new file mode 100644 (file)
index 0000000..4fb1a29
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+  performer.hh -- declare Performer
+
+  (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+                 Jan Nieuwenhuizen <jan@digicash.com>
+ */
+
+#ifndef PERFORMER_HH
+#define PERFORMER_HH
+
+#include "lily-proto.hh"
+
+class Performer {
+    Performer_group_performer* daddy_perf_l_;
+    
+public:
+    NAME_MEMBERS();
+    Performer();
+    virtual ~Performer();
+
+    void print() const;
+
+    virtual void play_event( Midi_item i );
+    virtual bool try_request( Request* req_l );
+};
+
+#include "global-performers.hh"
+
+#endif // PERFORMER_HH
diff --git a/lily/include/score-performer.hh b/lily/include/score-performer.hh
new file mode 100644 (file)
index 0000000..6c5eb6e
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+  score-performer.hh -- declare Score_performer
+
+  (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+                 Jan Nieuwenhuizen <jan@digicash.com>
+ */
+
+#ifndef SCORE_PERFORMER_HH
+#define SCORE_PERFORMER_HH
+
+#include "performer-group-performer.hh"
+#include "global-translator.hh"
+
+class Score_performer: 
+    public Performer_group_performer, public Global_translator 
+{
+    Midi_file* file_p_;
+    Moment prev_mom_;
+
+public:
+    virtual void play_event( Midi_item i );
+    virtual void prepare( Moment mom );
+};
+
+#endif // SCORE_PERFORMER_HH
index b11118f17fc43bd2271fa68c79a0e37296f67a8e..15486e2aaaf333e0e044cba11110825659eb1064 100644 (file)
@@ -62,7 +62,9 @@ public:
 
 private:
     void run_translator(Global_translator*);
+    void midi_output();
     void paper_output();
+
     /// do midi stuff
     void midi();
 
diff --git a/lily/include/staff-performer.hh b/lily/include/staff-performer.hh
new file mode 100644 (file)
index 0000000..685aa82
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+  staff-performer.hh -- declare Staff_performer
+
+  (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+                 Jan Nieuwenhuizen <jan@digicash.com>
+ */
+
+#ifndef STAFF_PERFORMER_HH
+#define STAFF_PERFORMER_HH
+
+#include "performer-group-performer.hh"
+
+class Staff_performer : public Performer_group_performer 
+{
+    int midi_track_i_;
+
+public:
+    String instrument_str()
+    virtual void play_event( Midi_item i );
+};
+
+#endif // STAFF_PERFORMER_HH
diff --git a/lily/include/voice-group-performer.hh b/lily/include/voice-group-performer.hh
new file mode 100644 (file)
index 0000000..93f8ed0
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+  voice-group-performer.hh -- declare Voice_group_performer
+
+  (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+                 Jan Nieuwenhuizen <jan@digicash.com>
+ */
+
+#ifndef VOICE_GROUP_PERFORMER_HH
+#define VOICE_GROUP_PERFORMER_HH
+
+#include "performer-group-performer.hh"
+
+class Voice_performer_group_performer : public Performer_group_performer {
+
+};
+
+#if 0
+class Voice_performer : 
+       public Performer_group_performer, public Interpreter 
+{
+    
+};
+#endif
+
+#endif // VOICE_GROUP_PERFORMER_HH
index 938e5b7ad71b8bb08aaa84095bf832b4175fc2b4..706634b52b6fa50c2839e7c7ed8c3e7461ff8140 100644 (file)
@@ -31,7 +31,7 @@ Input_engraver::print() const
     for (int i=0; i< consists_str_arr_.size(); i++)
        mtor << consists_str_arr_[i] << ',';
     mtor << "contains " ;
-    for (iter(contains_igrav_p_list_.top(), i); i.ok(); i++) 
+    for (PCursor<Input_engraver*> i(contains_igrav_p_list_.top()); i.ok(); i++) 
        i->print();
 #endif 
 }
@@ -45,7 +45,7 @@ Input_engraver::recursive_find(String nm)
        return this;
 
     Input_engraver * r =0;
-    iter(contains_igrav_p_list_.top(), i);
+    PCursor<Input_engraver*> i(contains_igrav_p_list_.top());
     for (; !r &&i.ok(); i++) {
        if (i->recursive_find(nm))
            r = i.ptr();
@@ -57,7 +57,7 @@ Input_engraver::recursive_find(String nm)
 Input_engraver *
 Input_engraver::find_igrav_l(String nm)
 {
-    for (iter(contains_igrav_p_list_.top(), i); i.ok(); i++)
+    for (PCursor<Input_engraver*> i(contains_igrav_p_list_.top()); i.ok(); i++) 
        if (i->is_name_b( nm))
            return i;
 
diff --git a/lily/input-performer.cc b/lily/input-performer.cc
new file mode 100644 (file)
index 0000000..6d2ead1
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+  input-performer.cc -- implement Input_performer
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+           Jan Nieuwenhuizen <jan@digicash.com>
+*/
+
+#include "debug.hh"
+#include "performer.hh"
+#include "input-performer.hh"
+#include "parray.hh"
+#include "input-performer.hh"
+#include "performer-group-performer.hh"
+
+bool
+Input_performer::is_name_b(String n)
+{
+    for (int i=0; i < alias_str_arr_.size(); i++)
+       if (alias_str_arr_[i] == n)
+           return true;
+    return false;
+}
+
+void
+Input_performer::print() const
+{
+#ifndef NPRINT
+    mtor << "type " << type_str_;
+    mtor << "Consists of ";
+    for (int i=0; i< consists_str_arr_.size(); i++)
+       mtor << consists_str_arr_[i] << ',';
+    mtor << "contains " ;
+    for (PCursor<Input_performer*> i(contains_iperf_p_list_.top()); i.ok(); i++) 
+       i->print();
+#endif 
+}
+
+
+
+Input_performer *
+Input_performer::recursive_find(String nm)
+{
+    if ( is_name_b( nm) )
+       return this;
+
+    Input_performer * r =0;
+    PCursor<Input_performer*> i(contains_iperf_p_list_.top());
+    for (; !r &&i.ok(); i++) {
+       if (i->recursive_find(nm))
+           r = i.ptr();
+    }
+
+    return r;
+}
+
+Input_performer *
+Input_performer::find_iperf_l(String nm)
+{
+    for (PCursor<Input_performer*> i(contains_iperf_p_list_.top()); i.ok(); i++) 
+       if (i->is_name_b( nm))
+           return i;
+
+    return 0;
+}
+
+
+Performer_group_performer *
+Input_performer::get_group_performer_p()
+{
+    Performer_group_performer * perf_p = (Performer_group_performer*)
+       get_performer_p(type_str_);
+
+    for (int i=0; i < consists_str_arr_.size(); i++) {
+       perf_p->add( get_performer_p( consists_str_arr_[i]) );
+    }
+    perf_p -> iperf_l_ = this;
+    return perf_p;
+}
+
+
+bool
+Input_performer::accept_req_b()
+{
+    return ! contains_iperf_p_list_.size();
+}
+
+void
+Input_performer::add(Input_performer *ip)
+{
+    contains_iperf_p_list_.bottom().add(ip);
+}
+
+Input_performer*
+Input_performer::get_default_iperf_l()
+{
+    if ( contains_iperf_p_list_.size() )
+       return contains_iperf_p_list_.top();
+    else
+       return 0;
+}
+
+
+Input_performer_list::Input_performer_list(Input_performer_list const &s)
+{
+    for (PCursor<Input_performer*> pc(s); pc.ok(); pc++) {
+       Input_performer *q = pc;
+       Input_performer *p=new Input_performer(*q) ; 
+       bottom().add(p);
+    }
+}
index 2f703f01f8f3478bb9bc08f98de562544fd29f20..481515a836dc2172975692ad270f7563661ce20c 100644 (file)
@@ -8,6 +8,10 @@
 #include <math.h>
 #include "misc.hh"
 #include "midi-def.hh"
+#include "input-performer.hh"
+#include "performer-group-performer.hh"
+#include "assoc-iter.hh"
+
 #include "debug.hh"
 
 // classes, alphasorted
@@ -23,27 +27,48 @@ int Midi_def::num_i_s = 4;
 
 Midi_def::Midi_def()
 {
-    set_tempo( Moment( 1, 4 ), 60 );
     outfile_str_ = "lelie.midi"; 
+    iperf_p_ = 0;
+    real_vars_p_ = new Assoc<String,Real>;
+    // ugh
+    set_tempo( Moment( 1, 4 ), 60 );
 }
 
-Midi_def::Midi_def( Midi_def const& midi_c_r )
+Midi_def::Midi_def( Midi_def const& s )
 {
-    whole_seconds_f_ = midi_c_r.whole_seconds_f_;
-    outfile_str_ = midi_c_r.outfile_str_;
+    whole_seconds_f_ = s.whole_seconds_f_;
+    iperf_p_ = s.iperf_p_ ? new Input_performer( *s.iperf_p_ ) : 0;
+    real_vars_p_ = new Assoc<String,Real> ( *s.real_vars_p_ );
+    outfile_str_ = s.outfile_str_;
 }
 
 Midi_def::~Midi_def()
 {
+    delete iperf_p_;
+    delete real_vars_p_;
 }
 
 Real
-Midi_def::duration_to_seconds_f( Moment moment )
+Midi_def::duration_to_seconds_f( Moment mom )
 {
-    if (!moment)
+    if ( !mom )
        return 0;
     
-    return Moment( whole_seconds_f_ ) * moment;
+    return Moment( whole_seconds_f_ ) * mom;
+}
+
+Global_translator*
+Midi_def::get_global_translator_p() const
+{
+    return  iperf_p_->get_group_performer_p()->global_l();
+}
+
+Real
+Midi_def::get_var( String s ) const
+{
+    if ( !real_vars_p_->elt_b( s ) )
+       error ( "unknown midi variable `"  + s + "'" );
+    return real_vars_p_->elem( s );
 }
 
 int
@@ -56,14 +81,32 @@ void
 Midi_def::print() const
 {
 #ifndef NPRINT
-    mtor << "Midi {4/min: " << Real( 60 ) / ( whole_seconds_f_ * 4 );
+    mtor << "Midi {";
+    mtor << "4/min: " << Real( 60 ) / ( whole_seconds_f_ * 4 );
     mtor << "out: " << outfile_str_;
+    for (Assoc_iter<String,Real> i( *real_vars_p_ ); i.ok(); i++) {
+       mtor << i.key() << "= " << i.val() << "\n";
+    }
     mtor << "}\n";
 #endif
 }
 
+void
+Midi_def::set( Input_performer* iperf_p )
+{
+    delete iperf_p_;
+    iperf_p_ = iperf_p;
+}
+
 void
 Midi_def::set_tempo( Moment moment, int count_per_minute_i )
 {
     whole_seconds_f_ = Moment( count_per_minute_i ) / Moment( 60 ) / moment;
 }
+
+void
+Midi_def::set_var( String s, Real r )
+{
+   real_vars_p_->elem( s ) = r;
+}
+
index c7d6509b97b2a2c7897b541f176a5ef6098eeb19..9cbc9d77471fe5f34a5e067d6e47cfe844f82c8b 100644 (file)
@@ -45,15 +45,15 @@ Music_iterator::get_req_translator_l()
 }
 
 void
-Music_iterator::set_translator(Translator*reg)
+Music_iterator::set_translator(Translator*trans)
 {    
-    if (report_to_l_==reg)
+    if (report_to_l_==trans)
        return;
 
     if (report_to_l_)
        report_to_l_->iterator_count_ --;
 
-    report_to_l_ = reg;
+   report_to_l_ = trans;
  
     if (report_to_l_)
        report_to_l_->iterator_count_ ++;
@@ -147,9 +147,9 @@ Chord_iterator::Chord_iterator(Chord const *chord_C)
 void
 Chord_iterator::construct_children()
 {
-    int j =0;
-    for(iter(chord_C_->music_p_list_.top(), i); i.ok(); j++, i++) {
-       
+    int j = 0;
+    for(PCursor<Music*> i(chord_C_->music_p_list_.top());  //, int j = 0; 
+       i.ok(); j++, i++) {
        Music_iterator * mi =  get_iterator_p( i.ptr());
        set_translator(mi->report_to_l_->ancestor_l( chord_C_->multi_level_i_ ));
        if ( mi->ok() )
@@ -162,16 +162,16 @@ void
 Chord_iterator::do_print() const
 {
 #ifndef NPRINT
-     for (iter(children_p_list_.top(), i); i.ok(); i++ ) {
+    for (PCursor<Music_iterator*> i(children_p_list_.top()); i.ok(); i++) {
        i->print();
-     }
+    }
 #endif
 }
 
 void
 Chord_iterator::process_and_next(Moment until)
 {
-    for (iter(children_p_list_.top(), i); i.ok(); ) {
+    for (PCursor<Music_iterator*> i(children_p_list_.top()); i.ok(); ) {
        if  (i->next_moment() == until) {
            i->process_and_next(until);
        }
@@ -192,7 +192,7 @@ Moment
 Chord_iterator::next_moment()const
 {
     Moment next_ = INFTY;
-    for (iter(children_p_list_.top(), i); i.ok(); i++) 
+    for (PCursor<Music_iterator*> i(children_p_list_.top()); i.ok(); i++)
        next_ = next_ <? i->next_moment() ;
     return next_;
 }
index c0a0edb89ea1de7f2f773da199c91227622db99d..c3fa8a3d8f6d6b4adcfa3902915af7e33352ed54 100644 (file)
@@ -39,6 +39,7 @@ static Keyword_ent the_key_tab[]={
     {"in", IN_T},
     {"init_end", INIT_END},
     {"requestengraver", REQUESTENGRAVER},
+    {"requestperformer", REQUESTPERFORMER},
     {"lyric", LYRIC},
     {"key", KEY},
     {"melodic" , MELODIC},
diff --git a/lily/note-performer.cc b/lily/note-performer.cc
new file mode 100644 (file)
index 0000000..95adb43
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+  note-performer.cc -- implement Note_performer
+
+  (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+                 Jan Nieuwenhuizen <jan@digicash.com>
+ */
+
+#if 0
+#include "note-performer.hh"
+
+void 
+process_request() 
+{
+    if ( when() == off_mom_ )
+       play_event( Note_event( current_l_->pitch() ) );
+}
+#endif
index a19e4780b01965f658432f41d8d1fbe80465c05a..61e87b0cd934475672a89d0297ec6fb1b6852037 100644 (file)
@@ -1,6 +1,17 @@
 %{ // -*-Fundamental-*-
+
+/*
+  parser.y -- lily parser
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+           Jan Nieuwenhuizen <jan@digicash.com>
+*/
+
 #include <iostream.h>
 
+// mmm
 #define MUDELA_VERSION "0.0.61"
 
 #include "script-def.hh"
@@ -21,6 +32,7 @@
 #include "my-lily-parser.hh"
 #include "text-def.hh"
 #include "input-engraver.hh"
+#include "input-performer.hh"
 #include "score.hh"
 #include "music-list.hh"
 
@@ -47,7 +59,8 @@
     Chord * chord;
     Duration *duration;
     Identifier *id;    
-    Input_engraver * iregs;
+    Input_engraver * igravs;
+    Input_performer * iperfs;
     Music *music;
     Music_list *musiclist;
     Score *score;
@@ -107,6 +120,7 @@ yylex(YYSTYPE *s,  void * v_l)
 %token GROUPING
 %token GROUP
 %token REQUESTENGRAVER
+%token REQUESTPERFORMER
 %token HSHIFT
 %token IN_T
 %token ID
@@ -161,6 +175,7 @@ yylex(YYSTYPE *s,  void * v_l)
 %token <id>    REAL_IDENTIFIER
 %token <id>    INT_IDENTIFIER
 %token <id>    SCORE_IDENTIFIER
+%token <id>    MIDI_IDENTIFIER
 %token <id>    PAPER_IDENTIFIER
 %token <id>    REQUEST_IDENTIFIER
 %token <real>  REAL 
@@ -203,7 +218,8 @@ yylex(YYSTYPE *s,  void * v_l)
 %type <id>     old_identifier
 %type <symbol> symboldef
 %type <symtable>       symtable symtable_body
-%type <iregs>  input_engraver_spec input_engraver_spec_body
+%type <igravs> input_engraver_spec input_engraver_spec_body
+%type <iperfs> input_performer_spec input_performer_spec_body
 
 %left PRIORITY
 
@@ -288,6 +304,10 @@ declaration:
                $$ = new Paper_def_id(*$1, $3, PAPER_IDENTIFIER);
                delete $1;
        }
+       | declarable_identifier '=' midi_block {
+               $$ = new Midi_def_id(*$1, $3, MIDI_IDENTIFIER);
+               delete $1;
+       }
        | declarable_identifier '=' script_definition {
                $$ = new Script_id(*$1, $3, SCRIPT_IDENTIFIER);
                delete $1;
@@ -344,6 +364,32 @@ input_engraver_spec_body:
                $$->add($3);
        }
        ;
+
+input_performer_spec:
+       REQUESTPERFORMER '{' input_performer_spec_body '}'
+               { $$ = $3; }
+       ;
+
+input_performer_spec_body:
+       STRING  { 
+               $$ = new Input_performer; 
+               $$->type_str_ =*$1;
+               $$->set_spot ( THIS->here_input() );
+               delete $1;
+       }
+       | input_performer_spec_body ALIAS STRING ';' {
+               $$-> alias_str_arr_.push(*$3);
+               delete $3;
+       }
+       | input_performer_spec_body CONSISTS STRING ';' {
+               $$-> consists_str_arr_.push(*$3);
+               delete $3;
+       }
+       | input_performer_spec_body CONTAINS input_performer_spec {
+               $$->add($3);
+       }
+       ;
+
 /*
        SCORE
 */
@@ -399,7 +445,7 @@ paper_block:
 
 paper_body:
        /* empty */                     {
-               $$ = THIS->default_paper();
+               $$ = THIS->default_paper(); // paper / video / engrave
        }
        | paper_body OUTPUT STRING ';'  { $$->outfile_str_ = *$3;
                delete $3;
@@ -428,8 +474,8 @@ midi_block:
        '{' midi_body '}'       { $$ = $3; }
        ;
 
-midi_body: 
-               $$ = new Midi_def; 
+midi_body: /* empty */                 {
+               $$ = THIS->default_midi(); // midi / audio / perform
        }
        | midi_body OUTPUT STRING ';'   { 
                $$->outfile_str_ = *$3; 
@@ -438,14 +484,14 @@ midi_body: {
        | midi_body TEMPO notemode_duration ':' int ';' {
                $$->set_tempo( $3->length(), $5 );
        }
+       | midi_body input_performer_spec        {
+               $$->set( $2 );
+       }
        | midi_body error {
 
        }
        ;
 
-
-
-
 /*
        MUSIC
 */
@@ -1062,3 +1108,10 @@ My_lily_parser::default_paper()
        return id ? id->paperdef(true) : new Paper_def ;
 }
 
+Midi_def*
+My_lily_parser::default_midi()
+{
+       Identifier *id = lexer_p_->lookup_identifier( "default_midi" );
+       return id ? id->mididef(true) : new Midi_def ;
+}
+
diff --git a/lily/performer-group-performer.cc b/lily/performer-group-performer.cc
new file mode 100644 (file)
index 0000000..e8d1045
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+  performer-group-performer.cc -- implement Performer_group_performer
+
+  (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+                 Jan Nieuwenhuizen <jan@digicash.com>
+ */
+
+#if 0
+    bool try_request( Request* req_l )
+    {
+        bool hebbes_b =false;
+        for (int i =0; !hebbes_b && i < nongroup_l_arr_.size() ; i++)
+            hebbes_b =nongroup_l_arr_[i]->try_request(req_l);
+        if (!hebbes_b)
+            hebbes_b = daddy_grav_l_->try_request(req_l);
+        return hebbes_b ;
+    }
+#endif
diff --git a/lily/performer.cc b/lily/performer.cc
new file mode 100644 (file)
index 0000000..1ff6b02
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+  performer.cc -- declare Performer
+
+  (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+                 Jan Nieuwenhuizen <jan@digicash.com>
+ */
+
+#if 0
+
+#include "lily-proto.hh"
+#include "performer.hh"
+#include "performer-group-performer.hh"
+
+IMPLEMENT_STATIC_NAME(Performer);
+IMPLEMENT_IS_TYPE_B(Performer);
+
+Performer::Performer()
+{
+}
+
+Performer::~Performer()
+{
+}
+
+bool 
+Performer::try_request( Request* req_l );
+{
+    return daddy_perf_l_->try_request( req_l );
+}
+
+void 
+Performer::play_event( Midi_item i ) 
+{ 
+    daddy_perf_l_->play_event( i ); 
+}
+
+void
+Performer::print() const
+{
+#ifndef NPRINT
+    mtor << "\n" << name() << " {";
+    do_print();
+    mtor << "}";
+#endif
+}
+
+
+#endif
index ee3b325a00b77fa2278e0591e06db7957fddf4a4..f837dba557e00f413b15ad71d6342bdbfa4b8c73 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  score-reg.cc -- implement Score_engraver
+  score-grav.cc -- implement Score_engraver
 
   source file of the GNU LilyPond music typesetter
 
diff --git a/lily/score-performer.cc b/lily/score-performer.cc
new file mode 100644 (file)
index 0000000..ed96521
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+  score-performer.cc -- implement Score_performer
+
+  (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+                 Jan Nieuwenhuizen <jan@digicash.com>
+ */
+
+#if 0
+
+#include "score-performer.hh"
+
+void 
+Score_performer::play_event( Midi_item i )
+{
+    file_p_->output( i );
+}
+
+void 
+Score_performer::prepare(Moment m)
+{
+    file_p_->move( mom.prev_ );
+}
+
+#endif
index fd23b08522d8d1f82fcacc1eb38ddb51004002e5..38b30b50439a14407bfd0f20e003067dfb6fef0d 100644 (file)
@@ -60,8 +60,37 @@ void
 Score::process()
 {
     paper();
+    midi();
 }
 
+void
+Score::midi()
+{
+#if 0
+    if (!midi_p_)
+       return;
+    
+    *mlog << "\nCreating elements ..." << flush;
+//    pscore_p_ = new PScore(paper_p_);
+    
+    Global_translator * score_trans=  paper_p_->get_global_translator_p();
+    run_translator( score_trans );
+    delete score_trans;
+    
+    if( errorlevel_i_){
+       // should we? hampers debugging. 
+       warning("Errors found, /*not processing score*/");
+//     return;
+    }
+    print();
+    *mlog << endl;
+//    pscore_p_->process();
+
+    // output
+    midi_output();
+#endif
+}
+    
 void
 Score::paper()
 {
@@ -93,7 +122,6 @@ Score::paper()
 
     // output
     paper_output();
-    
 }
 
 /**
@@ -219,7 +247,7 @@ Score::paper_output()
 }
 
 void
-Score::midi()
+Score::midi_output()
 {
 #if 0
     if (!midi_p_)
diff --git a/lily/staff-performer.cc b/lily/staff-performer.cc
new file mode 100644 (file)
index 0000000..856551f
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+  staff-performer.cc -- implement Staff_performer
+
+  (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+                 Jan Nieuwenhuizen <jan@digicash.com>
+ */
+
+#if 0
+
+#include "staff-performer.hh"
+
+String 
+Staff_performer::instrument_str() 
+{ 
+    return Translator::id_str_; 
+}
+
+void 
+Staff_performer::play_event( Midi_item i )
+{
+    i.track_i_ = midi_track_i_;
+    Performer::play_event( i );
+}
+
+#endif 
index 247b2f0978b4e905a13fb6700d6aa35b2c6d1f36..d100cbce98d8fa0ca92d097c67383bf554a7a563 100644 (file)
@@ -9,9 +9,11 @@
 #include "symbol.hh"
 #include "request.hh"
 #include "input-engraver.hh"
+#include "input-performer.hh"
 #include "molecule.hh"
 #include "plist.tcc"
 #include "pcursor.tcc"
 
 IPL_instantiate(Atom);
 IPL_instantiate(Input_engraver);
+IPL_instantiate(Input_performer);
index 2fbc12167998bf931c3c5aedb2fc4cc38e649753..38344df6000db2fb012485e3df97d87ddd6402ef 100644 (file)
@@ -1,5 +1,7 @@
 #include "proto.hh"
 #include "plist.tcc"
 #include "engraver.hh"
+#include "performer.hh"
 
 IPL_instantiate(Engraver);
+IPL_instantiate(Performer);
diff --git a/lily/voice-group-performer.cc b/lily/voice-group-performer.cc
new file mode 100644 (file)
index 0000000..74df78e
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+  voice-group-performer.cc -- implement Voice_group_performer
+
+  (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+                 Jan Nieuwenhuizen <jan@digicash.com>
+ */
+
+#if 0
+
+#include "voice-group-performer.hh"
+
+#endif