]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.41
authorfred <fred>
Sun, 24 Mar 2002 19:34:48 +0000 (19:34 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:34:48 +0000 (19:34 +0000)
52 files changed:
.dstreamrc
Documentation/language.pod
TODO
init/dutch.ini
init/dynamic.ini
init/swedish.ini
input/standchen.ly
lib/include/proto.hh
lily/bar-reg.cc
lily/clef-reg.cc
lily/crescendo.cc [new file with mode: 0644]
lily/dynamic-reg.cc
lily/headreg.cc
lily/identifier.cc
lily/include/command-request.hh [new file with mode: 0644]
lily/include/commandrequest.hh
lily/include/crescendo.hh [new file with mode: 0644]
lily/include/identifier.hh
lily/include/identparent.hh
lily/include/input-music.hh
lily/include/lexer.hh
lily/include/musical-request.hh [new file with mode: 0644]
lily/include/parseconstruct.hh
lily/include/slur.hh
lily/input-music.cc
lily/key-reg.cc
lily/lexer.l
lily/local-key-item.cc
lily/local-key-reg.cc
lily/lyric-item.cc
lily/meter-reg.cc
lily/molecule.cc
lily/musical-request.cc [new file with mode: 0644]
lily/mylexer.cc
lily/note.cc
lily/notehead.cc
lily/parser.y
lily/register.cc
lily/script-reg.cc
lily/script.cc
lily/slur-reg.cc
lily/staff-walker.cc
lily/staff.cc
lily/stem-beam-reg.cc
lily/template2.cc
lily/text-item.cc
lily/text-reg.cc
lily/voice-elt.cc
lily/voice-group-regs.cc
lily/voice-regs.cc
lily/voice.cc
lily/walk-regs.cc

index 2b36f415449e3174887323e13c18a7b64ab8ec00..c7b8c24c7701b001462656df759bc49e81c7938e 100644 (file)
@@ -1,4 +1,5 @@
 # class name           silence?
+Dstream                        1
 
 My_flex_lexer          1
 yyFlexLexer            1
@@ -23,9 +24,9 @@ Lexer                 1
 parse_duration         1
 parse_pitchmod         1
 Col_configuration      1
-Request                        1
-Note_req               1
-Rhythmic_req           1
+Request                        0
+Note_req               0
+Rhythmic_req           0
 Rest_req               1
 delete_identifiers     1
 Command                        1
@@ -39,7 +40,7 @@ Input_cursor          1
 Commands_at            1
 Input_command          1
 Time_description       1
-Melodic_req            1
+Melodic_req            0
 Midi_walker            1
 Stem_req               1
 Group_change_req       1
index e316fdc14e9c969ed5132154bfd460a8555ae550..88a008ca2351353bbdc688f2d6d34b3dd38f3396 100644 (file)
@@ -1,3 +1,4 @@
+
 =head1 NAME
 
 language.pod -- state of the art mudela-vapourware.
@@ -129,6 +130,17 @@ voices on one staff?
 We might be able to do without the staff{} construct, but I doubt if
 it will make things easier.
 
+=head1 CONCRETE PROPOSAL
+
+Any optional request/modifier should follow the note/rest-name/lyric:
+
+       old             new
+       ''!a            a!''
+       [a()a]()a       a[( a)]( a) 
+
+the []() construct doesn't look nice. We might make an exception for
+spanning requests.
+
 =head1 THOUGHTS
 
 =head2 Typing
diff --git a/TODO b/TODO
index b3d03f91ba5704e96dfc1766f2dd24140eb2437a..89b5570bf1a421e4ca6488e35a60f2a25bb89b61 100644 (file)
--- a/TODO
+++ b/TODO
@@ -14,12 +14,12 @@ before 0.1
 
        * caching of Register_group_register hierarchies.
 
-       * midi esp.: use I32 iso int where 32 bits are needed (or assumed...)
-
 This is an assorted collection of stuff that will be done, might be
 done, or is an idea that I want to think about
 
 STUFF
+       * midi esp.: use I32 iso int where 32 bits are needed (or assumed...)
+
        * generate all (.hh) files into out dirs
 
        * sort out headers, see m2m
@@ -29,9 +29,6 @@ STUFF
        * make install.
        
 BUGS
-
-       * barf if no score_wde_music
-
        * plet bugs: scales.ly
 
        * key at clef change.
@@ -46,12 +43,12 @@ BUGS
 
        * Group_feature at start of music. 
 
+       * parser error handling (can you say Segfault?)
+
 SEVERELY LACKING:
 
        * grace notes
 
-       * dynamics (hairpins) 
-
 INPUTLANGUAGE
 
        * lose the $ and @ ?
@@ -134,7 +131,9 @@ FUTURE
 
        * implement better breaking algorithm
 
-       * Implement all requests
+       * Text_crescendo
+
+       * clean solution for staffsize in items.
 
        * merge key{item} & localkey{item}?
 
index 6502ec445206602136b64b1397b3daa883bf7b48..884dfd0df748581d4b5381dc05442c699e9b8353 100644 (file)
@@ -2,17 +2,82 @@
 % common dutch names for notes. "es" means flat, "is" means sharp
 %
 
+ceses  = melodic { 0 0 -2 0 }
+ces    = melodic { 0 0 -1 0 }
+c      = melodic { 0 0 0 0 }
+cis    = melodic { 0 0 1 0 }
+cisis  = melodic { 0 0 2 0 }
+deses  = melodic { 0 1 -2 0 }
+des    = melodic { 0 1 -1 0 }
+d      = melodic { 0 1 0 0 }
+dis    = melodic { 0 1 1 0 }
+disis  = melodic { 0 1 2 0 }
+eses   = melodic { 0 2 -2 0 }
+es     = melodic { 0 2 -1 0 }
+e      = melodic { 0 2 0 0 }
+eis    = melodic { 0 2 1 0 }
+eisis  = melodic { 0 2 2 0 }
+feses  = melodic { 0 3 -2 0 }
+fes    = melodic { 0 3 -1 0 }
+f      = melodic { 0 3 0 0 }
+fis    = melodic { 0 3 1 0 }
+fisis  = melodic { 0 3 2 0 }
+geses  = melodic { 0 4 -2 0 }
+ges    = melodic { 0 4 -1 0 }
+g      = melodic { 0 4 0 0 }
+gis    = melodic { 0 4 1 0 }
+gisis  = melodic { 0 4 2 0 }
+ases   = melodic { 0 5 -2 0 }
+as     = melodic { 0 5 -1 0 }
+a      = melodic { 0 5 0 0 }
+ais    = melodic { 0 5 1 0 }
+aisis  = melodic { 0 5 2 0 }
+beses  = melodic { 0 6 -2 0 }
+bes    = melodic { 0 6 -1 0 }
+b      = melodic { 0 6 0 0 }
+bis    = melodic { 0 6 1 0 }
+bisis  = melodic { 0 6 2 0 }
 
-dutch_names = 
-notenames {
-       "ceses" 0 -2 "ces" 0 -1         "c" 0 0         "cis" 0 1 "cisis" 0 2
-       "deses" 1 -2 "des" 1 -1         "d" 1 0         "dis" 1 1 "disis" 1 2
-       "eses"  2 -2 "es"  2 -1         "e" 2 0         "eis" 2 1 "eisis" 2 2
-       "feses" 3 -2 "fes" 3 -1         "f" 3 0         "fis" 3 1 "fisis" 3 2
-       "geses" 4 -2 "ges" 4 -1         "g" 4 0         "gis" 4 1 "gisis" 4 2
-       "ases"  5 -2 "as"  5 -1         "a" 5 0         "ais" 5 1 "aisis" 5 2
-       "beses" 6 -2 "bes" 6 -1         "b" 6 0         "bis" 6 1 "bisis" 6 2
-}
+
+%
+% upper case: 1 octave lower.
+%
+
+
+Ceses  = melodic { -1 0 -2 0 }
+Ces    = melodic { -1 0 -1 0 }
+C      = melodic { -1 0 0 0 }
+Cis    = melodic { -1 0 1 0 }
+Cisis  = melodic { -1 0 2 0 }
+Deses  = melodic { -1 1 -2 0 }
+Des    = melodic { -1 1 -1 0 }
+D      = melodic { -1 1 0 0 }
+Dis    = melodic { -1 1 1 0 }
+Disis  = melodic { -1 1 2 0 }
+Eses   = melodic { -1 2 -2 0 }
+Es     = melodic { -1 2 -1 0 }
+E      = melodic { -1 2 0 0 }
+Eis    = melodic { -1 2 1 0 }
+Eisis  = melodic { -1 2 2 0 }
+Feses  = melodic { -1 3 -2 0 }
+Fes    = melodic { -1 3 -1 0 }
+F      = melodic { -1 3 0 0 }
+Fis    = melodic { -1 3 1 0 }
+Fisis  = melodic { -1 3 2 0 }
+Geses  = melodic { -1 4 -2 0 }
+Ges    = melodic { -1 4 -1 0 }
+G      = melodic { -1 4 0 0 }
+Gis    = melodic { -1 4 1 0 }
+Gisis  = melodic { -1 4 2 0 }
+Ases   = melodic { -1 5 -2 0 }
+As     = melodic { -1 5 -1 0 }
+A      = melodic { -1 5 0 0 }
+Ais    = melodic { -1 5 1 0 }
+Aisis  = melodic { -1 5 2 0 }
+Beses  = melodic { -1 6 -2 0 }
+Bes    = melodic { -1 6 -1 0 }
+B      = melodic { -1 6 0 0 }
+Bis    = melodic { -1 6 1 0 }
+Bisis  = melodic { -1 6 2 0 }
 
 
-notenames { dutch_names }
\ No newline at end of file
index 000439dce6dea0133d0ac4518bca84d7c43e0e2c..da3725b2edffd39f06fb4e35a0a373cc91a76676 100644 (file)
@@ -4,7 +4,7 @@ pp = dynamic { 6 }
 p = dynamic { 5 }
 mp = dynamic { 4 }
 mf = dynamic { 3 }
-f = dynamic { 2 }
+df = dynamic { 2 } % f is a notename too.
 ff = dynamic { 1 }
 fff = dynamic { 0 }
 
index b3c26940dab844c39c86f71a0f66cd5c2a4019eb..f120a6a701e97aac4ff3928105ce8c5c811a7e66 100644 (file)
@@ -3,17 +3,39 @@
 %
 % by Mats Bengtsson.
 
-swedish_names = 
-notenames {
-       "cessess" 0 -2 "cess" 0 -1      "c" 0 0         "ciss" 0 1 "cississ" 0 2
-       "dessess" 1 -2 "dess" 1 -1      "d" 1 0         "diss" 1 1 "dississ" 1 2
-       "essess"  2 -2 "ess"  2 -1      "e" 2 0         "eiss" 2 1 "eississ" 2 2
-       "fessess" 3 -2 "fess" 3 -1      "f" 3 0         "fiss" 3 1 "fississ" 3 2
-       "gessess" 4 -2 "gess" 4 -1      "g" 4 0         "giss" 4 1 "gississ" 4 2
-       "assess"  5 -2 "ass"  5 -1      "a" 5 0         "aiss" 5 1 "aississ" 5 2
-       "hessess" 6 -2 "b" 6 -1         "h" 6 0         "hiss" 6 1 "hississ" 6 2
-}
-
-
-notenames { swedish_names }
 
+cessess        = melodic { 0 0 -2 0 }
+cess   = melodic { 0 0 -1 0 }
+c      = melodic { 0 0 0 0 }
+ciss   = melodic { 0 0 1 0 }
+cississ        = melodic { 0 0 2 0 }
+dessess        = melodic { 0 1 -2 0 }
+dess   = melodic { 0 1 -1 0 }
+d      = melodic { 0 1 0 0 }
+diss   = melodic { 0 1 1 0 }
+dississ        = melodic { 0 1 2 0 }
+essess         = melodic { 0 2 -2 0 }
+ess    = melodic { 0 2 -1 0 }
+e      = melodic { 0 2 0 0 }
+eiss   = melodic { 0 2 1 0 }
+eississ        = melodic { 0 2 2 0 }
+fessess        = melodic { 0 3 -2 0 }
+fess   = melodic { 0 3 -1 0 }
+f      = melodic { 0 3 0 0 }
+fiss   = melodic { 0 3 1 0 }
+fississ        = melodic { 0 3 2 0 }
+gessess        = melodic { 0 4 -2 0 }
+gess   = melodic { 0 4 -1 0 }
+g      = melodic { 0 4 0 0 }
+giss   = melodic { 0 4 1 0 }
+gississ        = melodic { 0 4 2 0 }
+assess         = melodic { 0 5 -2 0 }
+ass    = melodic { 0 5 -1 0 }
+a      = melodic { 0 5 0 0 }
+aiss   = melodic { 0 5 1 0 }
+aississ        = melodic { 0 5 2 0 }
+hessess        = melodic { 0 6 -2 0 }
+b      = melodic { 0 6 -1 0 }
+h      = melodic { 0 6 0 0 }
+hiss   = melodic { 0 6 1 0 }
+hississ        = melodic { 0 6 2 0 }
index 672d747bf5aa552ed32bf9ba006769b5ecce2f85..98daf3b69f2501067be93f49630dff386383a7ed 100644 (file)
@@ -93,28 +93,28 @@ melodie = music { $ \clef\violin
 %#%    =f2. |
        f2. |
 %%23
-       [ a8._\mf 'cis16 ] 'f4. 'e |
+       [ a8.\mf 'cis16 ] 'f4. 'e |
 %%24
        [ 'd8. a16 ] fis4. d |
 %%25
 %#%    'cis\grace\stemup
-       [ b_\mf( ) ais b ]2/3 'd4. b |
+       [ b\mf( ) ais b ]2/3 'd4. b |
 %%26
        { a2. fis2. } |
 %#%\tighten\newline
 %%27
-       [ 'e_\f( )'dis 'e ]2/3 'g4. 'cis |
+       [ 'e\df( )'dis 'e ]2/3 'g4. 'cis |
 %%28
        { 'd2. fis2. } |
 %#%\volta1
 %%29
-       { \music { bes2( [ 'd8.( ))g16 ] } \music{ g2_\mf [ bes8. bes16 ] } } |
+       { \music { bes2( [ 'd8.( ))g16 ] } \music{ g2\mf [ bes8. bes16 ] } } |
 %%30
        { \music{ a4. [ a-. a-. a-. ] } \music{ fis4. [ fis-.( fis-. )fis-. ] } } |
 %%31  
        { \music{ a4. [ a-. a-. a-. ] } \music{ g4. [ cis-.( e-. )g-. ] } } |
 %%32
-       { a2 fis2_\pp } { a4 fis4 } |
+       { a2 fis2\pp } { a4 fis4 } |
 %%33
 %#%    { b2(^ g2 } [v { 'd8.( b8. } { b16 ) ) g16 } ] |
        { \music{ b2( [ 'd8.( ) )g16 ] } \music{ g2 [ b8. b16 ] } } |
@@ -141,12 +141,12 @@ melodie = music { $ \clef\violin
        'cis2 r4 |
 %%41
 %#%    { > 'fis4. 'cis4._f } 'e [ 'e( ) 'd >! 'cis ]  |
-       { 'fis4. 'cis4.\f } 'e  [ 'e( )'d 'cis ]2/3  |
+       { 'fis4. 'cis4.\df } 'e  [ 'e( )'d 'cis ]2/3  |
 %%42
        [ b8. 'cis16 ] 'd4^> b r |
 %%43
 %#%    [^ { b8._{ }_{ }_{ }_{ }_{ }_f g2. } 'cis16 ] 'd4^> b r |
-       [ b8.\f 'cis16 ] 'd4^> b r |
+       [ b8.\df 'cis16 ] 'd4^> b r |
 %%44
 %#%    [^ { > b8. fis2 } 'cis16 ] 'd4^> b >! r |
        [ b8. 'cis16 ] 'd4^> b r |
@@ -157,7 +157,7 @@ melodie = music { $ \clef\violin
 %#%    { =a2. fis2. } |
        { a2. fis2. } |
 %%47
-       [ 'e\f( )'dis 'e ]2/3  'g4.^> 'cis |
+       [ 'e\df( )'dis 'e ]2/3  'g4.^> 'cis |
 %%48
 %#%    { fis2.(v ='d2.\stemup(^ }
 %      { fis2. 'd2. } |
@@ -171,7 +171,7 @@ melodie = music { $ \clef\violin
 %%51
        { a2. cis2. } |
 %%52
-       { fis2 d2 } { a4 fis4_\pp } |
+       { fis2 d2 } { a4 fis4\pp } |
 %%53
 %#%    { bes2 g2 } [ { 'd8.^>( bes8. } { ) bes16 g16 } ] |
        { bes2 g2 } { [ 'd8.^> bes8. } { bes16 g16 ] } |
index 4b3a8f91c5831d2d87558780ace5b44316e2c134..a58e2969c1cfce33edb2dd6b3bf791cae052caed 100644 (file)
@@ -1,3 +1,4 @@
+
 /*
   proto.hh -- part of LilyPond
 
@@ -100,7 +101,6 @@ struct Command_req;
 struct Note_req;
 struct Notehead;
 struct Notehead_register;
-struct Notename_tab;
 struct Offset;
 struct Output;
 struct PCol;
@@ -135,6 +135,7 @@ struct Source;
 struct Source_file;
 struct Spacing_req ;
 struct Span_req;
+struct Span_dynamic_req;
 struct Spanner;
 struct Subtle_req;
 struct Staff;
index b72eca87550c880d3681a92044dbd159f017fde6..c7c0d05e3d5f61d64a4028c8c1ffa47c4e8518ad 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "bar-reg.hh"
 #include "bar.hh"
-#include "commandrequest.hh"
+#include "command-request.hh"
 #include "score-column.hh"
 #include "time-description.hh"
 
index 2d9dcc112b08fecd50b8c37f9fba505368187b9a..791b72408347d00bc3f8fad4dfaa4738b1db2337 100644 (file)
@@ -10,7 +10,7 @@
 #include "clef-reg.hh"
 #include "clef-item.hh"
 #include "debug.hh"
-#include "commandrequest.hh"
+#include "command-request.hh"
 #include "time-description.hh"
 #include "staff-column.hh"
 
diff --git a/lily/crescendo.cc b/lily/crescendo.cc
new file mode 100644 (file)
index 0000000..9b2a169
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+  crescendo.cc -- implement Crescendo
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "crescendo.hh"
+#include "lookup.hh"
+#include "paper-def.hh"
+
+Crescendo::Crescendo(int s)
+{
+    staff_size_i_ = s;
+    grow_dir_i_ =0;
+    dir_i_ = -1 ;
+}
+
+Spanner*
+Crescendo::do_break_at(PCol*, PCol*)const
+{
+    return new Crescendo(*this);
+}
+
+
+Molecule*
+Crescendo::brew_molecule_p() const return m_p ;
+{
+    m_p = new Molecule;
+    Real w_f = width().length();
+    Symbol s( paper()->lookup_l()->hairpin(w_f, grow_dir_i_ < 0) );
+    m_p->add(Atom(s));
+    int pos = (dir_i_ >0) ? staff_size_i_ + 4 : - 4 ;
+    m_p->translate(Offset(0,pos * paper()->internote()));
+}
index 88f0b502f4df06023a1853cafe4b5d5132cc2843..0ea23ac689c86f908dd625caa0d712cf1d6ebeef 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 #include "dynamic-reg.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "text-item.hh"
 #include "lookup.hh"
 #include "paper-def.hh"
index dc5d72d572aa1ab02782c6c2965ab0348794c2fa..7f1a9bbae899ff49d2a56438f7f4681dc70b5670 100644 (file)
@@ -8,7 +8,7 @@
 #include "headreg.hh"
 #include "paper-def.hh"
 #include "complex-walker.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 
 Notehead_register::Notehead_register()
 {
index fbf806edf7af918cf1e76e0e00eb5e72535a8f7c..e4712f8a5a9e8b630a98bf52c952679c085c0112 100644 (file)
@@ -49,9 +49,3 @@ Real_id::do_print() const
     mtor << *((Real_id*)this)->real(false)<< "\n";
 }
 
-void
-Notetab_id::do_print() const
-{
-    mtor << "unknown" << "\n";
-}
-
diff --git a/lily/include/command-request.hh b/lily/include/command-request.hh
new file mode 100644 (file)
index 0000000..3d5a1eb
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+  command-request.hh -- declare Non musical requests
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef COMMANDREQUEST_HH
+#define COMMANDREQUEST_HH
+
+#include "request.hh"
+#include "varray.hh"
+
+/** Request which are  assumed to be "happening" before the
+  musical requests. */
+struct Command_req : virtual Request {
+    REQUESTMETHODS(Command_req, command);
+
+    virtual Measure_grouping_req * measuregrouping() { return 0; }
+    virtual Clef_change_req * clefchange() { return 0; }
+    virtual Key_change_req * keychange() { return 0; }
+    virtual Partial_measure_req * partial() { return 0; }
+    virtual Meter_change_req * meterchange() { return 0; }
+    virtual Bar_req *bar() { return 0; }
+    virtual Cadenza_req *cadenza() { return 0; }
+    virtual Timing_req*timing() {  return 0; }
+};
+
+
+/** Baseclass for meter/partial req. It has to be handled by
+  Staff_{walker,column} baseclass.  */
+struct Timing_req : Command_req {
+    REQUESTMETHODS(Timing_req, timing);
+};
+
+
+struct Partial_measure_req : Timing_req {
+    Moment duration_;
+
+    Partial_measure_req(Moment);
+    REQUESTMETHODS(Partial_measure_req, partial);
+};
+
+/**
+  todo: allow C meter
+ */
+struct Meter_change_req : Timing_req {
+    int beats_i_, one_beat_i_;
+
+    Meter_change_req();
+    void set(int,int);
+    REQUESTMETHODS(Meter_change_req, meterchange);
+};
+
+/// toggle Cadenza mode
+struct Cadenza_req : Timing_req {
+    /// turn on?
+    bool on_b_;
+    Cadenza_req(bool);
+    REQUESTMETHODS(Cadenza_req,cadenza);
+};
+
+/// check if we're at start of a  measure.
+struct Barcheck_req : Timing_req {
+
+    REQUESTMETHODS(Barcheck_req,barcheck);
+};
+
+struct Measure_grouping_req: Timing_req {
+    Array<int> beat_i_arr_;
+    Array<Moment> elt_length_arr_;
+
+    REQUESTMETHODS(Measure_grouping_req, measuregrouping);
+};
+
+struct Group_change_req : Command_req {
+    String newgroup_str_;
+    REQUESTMETHODS(Group_change_req, groupchange);
+};
+
+/** draw a (repeat)-bar. This something different than #Barcheck_req#,
+  the latter should only happen at the start of a measure.  */
+struct Bar_req : Command_req {
+    String type_str_;
+    Bar_req(String);
+    int compare(const Bar_req&)const;
+    REQUESTMETHODS(Bar_req,bar);
+};
+struct Terminate_voice_req : Command_req {
+    REQUESTMETHODS(Terminate_voice_req,terminate);
+};
+
+struct Group_feature_req : Command_req {
+    int stemdir_i_;
+    Group_feature_req();
+    REQUESTMETHODS(Group_feature_req, groupfeature);
+};
+
+
+struct Key_change_req : Command_req {
+    Array<Melodic_req*> melodic_p_arr_;
+
+    Key_change_req();
+    Key_change_req(Key_change_req const&);
+    ~Key_change_req();
+    REQUESTMETHODS(Key_change_req, keychange);
+};
+
+struct Clef_change_req : Command_req {
+    String clef_str_;
+    Clef_change_req(String);
+    REQUESTMETHODS(Clef_change_req, clefchange);
+};
+
+#endif // COMMANDREQUEST_HH
index 71b83316610e27e7d04191ed0c043c678de89b4d..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,117 +0,0 @@
-/*
-  commandrequest.hh -- declare Non musical requests
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef COMMANDREQUEST_HH
-#define COMMANDREQUEST_HH
-
-#include "request.hh"
-#include "varray.hh"
-
-/** Request which are  assumed to be "happening" before the
-  musical requests. */
-struct Command_req : virtual Request {
-    REQUESTMETHODS(Command_req, command);
-
-    virtual Measure_grouping_req * measuregrouping() { return 0; }
-    virtual Clef_change_req * clefchange() { return 0; }
-    virtual Key_change_req * keychange() { return 0; }
-    virtual Partial_measure_req * partial() { return 0; }
-    virtual Meter_change_req * meterchange() { return 0; }
-    virtual Bar_req *bar() { return 0; }
-    virtual Cadenza_req *cadenza() { return 0; }
-    virtual Timing_req*timing() {  return 0; }
-};
-
-
-/** Baseclass for meter/partial req. It has to be handled by
-  Staff_{walker,column} baseclass.  */
-struct Timing_req : Command_req {
-    REQUESTMETHODS(Timing_req, timing);
-};
-
-
-struct Partial_measure_req : Timing_req {
-    Moment duration_;
-
-    Partial_measure_req(Moment);
-    REQUESTMETHODS(Partial_measure_req, partial);
-};
-
-/**
-  todo: allow C meter
- */
-struct Meter_change_req : Timing_req {
-    int beats_i_, one_beat_i_;
-
-    Meter_change_req();
-    void set(int,int);
-    REQUESTMETHODS(Meter_change_req, meterchange);
-};
-
-/// toggle Cadenza mode
-struct Cadenza_req : Timing_req {
-    /// turn on?
-    bool on_b_;
-    Cadenza_req(bool);
-    REQUESTMETHODS(Cadenza_req,cadenza);
-};
-
-/// check if we're at start of a  measure.
-struct Barcheck_req : Timing_req {
-
-    REQUESTMETHODS(Barcheck_req,barcheck);
-};
-
-struct Measure_grouping_req: Timing_req {
-    Array<int> beat_i_arr_;
-    Array<Moment> elt_length_arr_;
-
-    REQUESTMETHODS(Measure_grouping_req, measuregrouping);
-};
-
-struct Group_change_req : Command_req {
-    String newgroup_str_;
-    REQUESTMETHODS(Group_change_req, groupchange);
-};
-
-/** draw a (repeat)-bar. This something different than #Barcheck_req#,
-  the latter should only happen at the start of a measure.  */
-struct Bar_req : Command_req {
-    String type_str_;
-    Bar_req(String);
-    int compare(const Bar_req&)const;
-    REQUESTMETHODS(Bar_req,bar);
-};
-struct Terminate_voice_req : Command_req {
-    REQUESTMETHODS(Terminate_voice_req,terminate);
-};
-
-struct Group_feature_req : Command_req {
-    int stemdir_i_;
-    Group_feature_req();
-    REQUESTMETHODS(Group_feature_req, groupfeature);
-};
-
-
-struct Key_change_req : Command_req {
-    Array<Melodic_req*> melodic_p_arr_;
-
-    Key_change_req();
-    Key_change_req(Key_change_req const&);
-    ~Key_change_req();
-    REQUESTMETHODS(Key_change_req, keychange);
-};
-
-struct Clef_change_req : Command_req {
-    String clef_str_;
-    Clef_change_req(String);
-    REQUESTMETHODS(Clef_change_req, clefchange);
-};
-
-#endif // COMMANDREQUEST_HH
diff --git a/lily/include/crescendo.hh b/lily/include/crescendo.hh
new file mode 100644 (file)
index 0000000..858cd44
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+  crescendo.hh -- declare Crescendo
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef CRESCENDO_HH
+#define CRESCENDO_HH
+
+#include "spanner.hh"
+
+class Crescendo : public Spanner {
+    int staff_size_i_;
+public:
+    int grow_dir_i_;
+    int dir_i_;
+    Crescendo(int staff_size_i);
+private:
+    Spanner* do_break_at( PCol*, PCol*) const;
+    Molecule*brew_molecule_p()const;
+    NAME_MEMBERS(Crescendo);
+};
+
+#endif // CRESCENDO_HH
index aa8d1100127f13bd2892d17c304603ed08febcd8..6312582bf0d923f13096559b92b7cb2c928b24c6 100644 (file)
@@ -12,7 +12,6 @@
 #include "symtable.hh"
 #include "input-staff.hh"
 #include "input-music.hh"
-#include "notename.hh"
 #include "lookup.hh"
 #include "script-def.hh"
 #include "request.hh"
@@ -38,7 +37,6 @@ make_id_class(Symtables_id, Symtables, symtables);
 make_id_class(Staff_id, Input_staff, staff);
 make_id_class(M_chord_id, Music_general_chord, mchord);
 make_id_class(M_voice_id, Music_voice, mvoice);
-make_id_class(Notetab_id, Notename_tab, notename_tab);
 make_id_class(Request_id, Request, request);
 
 #endif // IDENTIFIER_HH
index 8071dcd4f549b411f0670778daf51b0fc650d670..a8b75b0fd3695473f7fc82681f114c3855405e3a 100644 (file)
@@ -34,7 +34,6 @@ struct Identifier {
     IDACCESSOR(Music_general_chord, mchord)
     IDACCESSOR(Lookup,lookup)
     IDACCESSOR(Real,real)
-    IDACCESSOR(Notename_tab, notename_tab)
     IDACCESSOR(Request, request)
        
 protected:
index 1d7a8caa665355087afc4ad4bce9f4c29ec9ed82..7a35bbfd19b037827ac59d040b8a7f097d5460d7 100644 (file)
@@ -61,7 +61,6 @@ struct Simple_music : Input_music {
     virtual Input_music *clone() const {
        return new Simple_music(*this);
     }
-
 };
 
 /// Complex_music consists of multiple voices
@@ -76,7 +75,6 @@ struct Complex_music : Input_music {
     void concatenate(Complex_music*);
     virtual bool find_plet_start_bo(char c, Moment& moment_r);
     virtual void set_plet_backwards(Moment& now_moment_r, Moment until_moment, int num_i, int den_i);
 };
 
 
index 6a9d21a98ed7314e566ed04e94d3257b7ab4fb42..8a55f1a585d3dc95afc00df68039f1de3304f75c 100644 (file)
@@ -23,15 +23,14 @@ void set_lexer();
 /// lexer with provisions for include files.
 struct My_flex_lexer : yyFlexLexer {
 
-    Array<Input_file*> include_stack;
-    Assoc<String, Identifier*> *the_id_tab;
-    Keyword_table * keytable;
-    Notename_tab * defaulttab;
+    Array<Input_file*> include_stack_;
+    Assoc<String, Identifier*> *identifier_assoc_p_;
+    Keyword_table * keytable_p_;
     int errorlevel_i_;
+
     /* *************** */
-    int ret_notename(int *p, String text, int octave_mod);    
+
     char const* here_ch_c_l();
-    void set(Notename_tab *n);
     int lookup_keyword(String);
     void lookup_notename(int &large, int &small, String s);
     void LexerError(const char *);
diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh
new file mode 100644 (file)
index 0000000..6d96117
--- /dev/null
@@ -0,0 +1,236 @@
+/*
+  musical-request.hh -- declare Musical requests
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef MUSICALREQUESTS_HH
+#define MUSICALREQUESTS_HH
+
+#include "request.hh"
+
+
+/**
+  A request which is coupled to a #Voice_element# with nonzero duration.
+  Base class only
+ */
+struct Musical_req : virtual Request {
+    
+    virtual Skip_req* skip() { return 0; }
+    virtual Dynamic_req* dynamic() { return 0; }
+    virtual Absolute_dynamic_req * absdynamic() { return 0; }
+    virtual Subtle_req * subtle() { return 0; }
+    virtual Span_dynamic_req * span_dynamic() { return 0; }
+    REQUESTMETHODS(Musical_req, musical);
+};
+
+
+struct Skip_req : Musical_req {
+    Moment duration_;
+    
+    virtual Moment duration() const;
+    REQUESTMETHODS(Skip_req, skip);
+};
+/** a request with a duration.
+  This request is used only a base class.
+ */
+struct Rhythmic_req : virtual Musical_req {
+    int balltype;
+    int dots;
+    Moment plet_factor;
+    /* *************** */
+    static int compare(const Rhythmic_req &, const Rhythmic_req &);
+    virtual Moment duration() const;
+    Rhythmic_req();
+    Rhythmic_req(int,int);
+    REQUESTMETHODS(Rhythmic_req, rhythmic);
+};
+
+struct Spacing_req :virtual Request {
+    Moment next;
+    Real distance;
+    Real strength;
+    /* *************** */
+    Spacing_req();
+    REQUESTMETHODS(Spacing_req, spacing);
+};
+
+struct Blank_req : Spacing_req, Rhythmic_req {
+    REQUESTMETHODS(Spacing_req, spacing);
+    
+};
+
+/// Put a text above or below (?) this staff.
+struct Text_req : virtual Musical_req {
+    /// preferred position (above/below)
+    int dir_i_;
+    /// the characteristics of the text
+    Text_def *tdef_p_;
+    /* *************** */
+    Text_req(int d, Text_def*);
+    ~Text_req();
+    Text_req(Text_req const&);
+    static int compare(const Text_req&,const Text_req&);
+    REQUESTMETHODS(Text_req,text);
+};
+
+/** Put a text in lyric_staff
+  @see Lyric_staff
+  */
+struct Lyric_req : public Rhythmic_req, Text_req {
+    Lyric_req(Text_def* t_p);
+    REQUESTMETHODS(Lyric_req, lreq_l);
+};
+
+/// request which has some kind of pitch
+struct Melodic_req :virtual Musical_req
+{
+    /// 0 is c, 6 is b
+    int notename_i_;
+    /// 0 is central c
+    int octave_i_;
+
+    /// 0 natural, 1 sharp, etc
+    int accidental_i_;
+
+    /// force/supress printing of accidental.
+    bool forceacc_b_;
+
+    /// return height from central c (in halflines)
+    int height()const; 
+    /// return pitch from central c (in halfnotes)
+    int pitch()const; 
+    Melodic_req();
+   
+    REQUESTMETHODS(Melodic_req,melodic);
+};
+
+/// Put a note of specified type, height, and with accidental on the staff.
+struct Note_req : Rhythmic_req, virtual Melodic_req {
+    
+
+    Rhythmic_req* rhythmic() { return Rhythmic_req::rhythmic(); }
+    REQUESTMETHODS(Note_req, note);
+ };
+
+/**
+Put a rest on the staff. Why a request? It might be a good idea to not typeset the rest, if the paper is too crowded.
+*/
+class Rest_req : public Rhythmic_req {
+public:
+    REQUESTMETHODS(Rest_req,rest);
+};
+
+/**
+  attach a stem to the noteball.
+  Rhythmic_req parent needed to  determine if it will fit inside a beam.
+  */
+struct Stem_req : Rhythmic_req {
+    /// preferred direction for the stem
+    int dir_i_;
+    Stem_req(int s, int dots);
+    REQUESTMETHODS(Stem_req,stem);
+};
+
+/**
+  Requests to start or stop something.
+ This type of request typically results in the creation of a #Spanner#
+*/
+struct Span_req : virtual Musical_req {
+    /// should the spanner start or stop, or is it unwanted?
+    enum {
+       NOSPAN, START, STOP
+    } spantype ;
+    static int compare(const Span_req &r1, const Span_req &r2);
+    REQUESTMETHODS(Span_req,span);
+
+    Span_req();
+  
+};
+
+/** 
+ request for backward plet generation.
+
+ ugr. Place in hierarchy?
+ */
+struct Plet_req : virtual Request {
+     char type_c_;
+     int dur_i_;
+     int type_i_;
+     Plet_req();
+     REQUESTMETHODS(Plet_req,plet);
+};
+
+/** Start / stop a beam at this note.  if #nplet# is set, the staff will try to put an
+appropriate number over the beam
+    */
+struct Beam_req : Span_req {
+    int nplet;
+
+    /* *************** */
+     REQUESTMETHODS(Beam_req,beam);
+
+    Beam_req();
+};
+
+/// a slur
+struct Slur_req : Span_req {
+ REQUESTMETHODS(Slur_req,slur);
+
+};
+
+
+/** Put a script above or below this ``note''. eg upbow, downbow. Why
+  a request? These symbols may conflict with slurs and brackets, so
+  this also a request */
+struct Script_req : Musical_req {
+    int dir_i_;
+    Script_def *scriptdef_p_;
+
+    /* *************** */
+    static int compare(const Script_req &, const Script_req &);
+    Script_req(int d, Script_def*);
+    REQUESTMETHODS(Script_req,script);
+    ~Script_req();
+    Script_req(Script_req const&);
+};
+
+/** A helper in the hierarchy. Each dynamic is bound to one note ( a
+    crescendo spanning multiple notes is thought to be made of two
+    "dynamics": a start and a stop).  Dynamic changes can occur in a
+    smaller time than the length of its note, therefore fore each
+    Dynamic request carries a time, measured from the start of its
+    note.
+ */
+struct Subtle_req : virtual Musical_req {
+    Moment subtime_;
+    REQUESTMETHODS(Subtle_req, subtle);
+};
+
+struct Dynamic_req : Subtle_req {
+    /// for absolute dynamics
+    enum Loudness {
+       FFF, FF, F, MF, MP, P, PP, PPP
+    };
+    static String loudness_str(Loudness);
+    REQUESTMETHODS(Dynamic_req, dynamic);
+};
+
+struct Absolute_dynamic_req : Dynamic_req {
+    Loudness loudness_;
+    Absolute_dynamic_req();
+    REQUESTMETHODS(Absolute_dynamic_req, absdynamic);
+};
+
+struct Span_dynamic_req : Dynamic_req, Span_req {
+    /// Grow or shrink the volume: 1=cresc, -1 = decresc 
+    int dynamic_dir_i_;
+    Span_dynamic_req();
+    REQUESTMETHODS(Span_dynamic_req, span_dynamic);
+};
+
+#endif // MUSICALREQUESTS_HH
index 7b9e3e3ec216c59fd1f4d238c6527e42f6ae1b85..ff47bdcbadf9563a0631a0af621b5e2ea6e6b50f 100644 (file)
@@ -17,7 +17,7 @@ void set_duration_mode(String s);
 void get_default_duration(int *);
 void set_default_octave(String);
 void set_plet(int,int);
-Voice_element * get_note_element(String,int * ,int *);
+Voice_element * get_note_element(Note_req * ,int *);
 Voice_element* get_rest_element(String,int *);
 Voice_element* get_word_element(Text_def*, int*);
 void add_requests( Voice_element*v, Array<Request*>&req);
index 87f1fe855ea71bd7fc623a4dd818e8bae80fb26c..c8363075c4569bde2fe96e71f44b5fe628c84111 100644 (file)
@@ -25,8 +25,7 @@ struct Slur : Directional_spanner {
     void add(Notehead*);
     void set_default_dir();
 
-    Spanner* do_break_at( PCol*, PCol*) const;
-    void process();
+    Spanner* do_break_at( PCol*, PCol*) const; 
 private:
     Molecule*brew_molecule_p()const;
     NAME_MEMBERS(Slur);
index f1047e8bf9fbc5312b977d662860e5d7a4340cfb..8ccc9071b8813b8b28d874f1498a3c61f0ad4b28 100644 (file)
@@ -1,7 +1,7 @@
 #include "debug.hh"
 #include "input-music.hh"
 #include "voice.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "voice-element.hh"
 
 void
index 84b0e268c66592b7774b189cabc865da2b9b9884..24189a532b61d50191418e7f5f9374274f55713f 100644 (file)
 #include "time-description.hh"
 #include "key-reg.hh"
 #include "key-item.hh"
-#include "commandrequest.hh"
+#include "command-request.hh"
 #include "staff-column.hh"
 #include "local-key-reg.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 
 Key_register::Key_register()
 {
index 10c5ee6b03c8264f949da3e429f891fb45452380..29738a70aa1f83d59845a4653327cf6609b8bdd3 100644 (file)
@@ -4,7 +4,6 @@
 
 #include "string.hh"
 #include "string-convert.hh"
-#include "notename.hh"
 #include "lexer.hh"
 #include "varray.hh"
 #include "parser.hh"
 #include "main.hh"
 #include "identparent.hh"
 
+#define start_quote()  \
+       yy_push_state(quote);\
+       yylval.string = new String
+
+
 %}
 
 %option c++
@@ -35,8 +39,8 @@ A             [a-zA-Z]
 AA             {A}|_
 N              [0-9]
 AN             {AA}|{N}
-PUNCT          [?!,.:;]
-ACCENT         [\\'"^]
+PUNCT          [?!,.:;']
+ACCENT         \\[`'"^]
 NATIONAL       [\241-\377]
 TEX            {AA}|-|{PUNCT}|{ACCENT}|{NATIONAL}
 
@@ -49,8 +53,6 @@ OPTSIGN               !?
 PITCHMOD       ['`]*{OPTSIGN}
 RESTNAME       r|s|p
 NOTECOMMAND    \\{WORD}
-NOTENAME       [a-z]+
-UNOTENAME      [A-Z][a-z]*
 DOTS           \.+
 LYRICS         {TEX}+
 COMMENT                [%#].*\n
@@ -71,16 +73,18 @@ COMMENT             [%#].*\n
        mtor << "rest:"<< yylval.string;
        return RESTNAME;
 }
-<notes>{UNOTENAME}     {
-       int *p=yylval.ii;
-       return ret_notename(p, YYText(), -1);
-}
+<notes>{ALPHAWORD}     {
+       String str = YYText();
+       mtor << "word: " << str<< eol;
+       Identifier * id = lookup_identifier(str);
+       if (id) {               
+               yylval.id = id;
+               return id->token_code_i_;
+       }
 
-<notes>{NOTENAME}      {
-       int *p=yylval.ii;
-       return ret_notename(p, YYText(), 0);
+       yylval.string=new String( str );
+       return STRING;
 }
-
 <notes>{NOTECOMMAND}   {
        String c = YYText() +1;
        mtor << "\\word: " << YYText()+1<<eol;
@@ -97,12 +101,6 @@ COMMENT             [%#].*\n
        return STRING;
 }
 
-<notes>{PITCHMOD}      {
-       const char *s = YYText();
-       mtor << "pitchmod:"<< YYText()<<eol;
-       yylval.string = new String (s);
-       return PITCHMOD;
-}
 <notes>{DOTS}          {
        yylval.i = strlen(YYText());
        return DOTS;
@@ -119,28 +117,29 @@ COMMENT           [%#].*\n
 <notes>\$      {
        yy_pop_state();
 }
-<notes>\"[^"]*\" {
-       String s (YYText()+1);
-       s = s.left_str(s.length_i()-1);
-       yylval.string = new String(s);
-       return STRING;
+<notes>\" {
+       start_quote();
 }
 <notes>.       {
        return yylval.c = YYText()[0];
 }
 
+
 \"             {
-       yy_push_state(quote);
+       start_quote();
 }
-<quote>[^"]*   {
-       yylval.string = new String (YYText());
+<quote>[^"]+   {
+       *yylval.string += YYText();
 }
 <quote>\"      {
-       mtor << "quoted string\n";
+       mtor << "quoted string: `" << *yylval.string << "'\n";
        yy_pop_state();
        return STRING;
 }
 
+<lyrics>\" {
+       start_quote();
+}
 <lyrics>{DOTS}         {
        yylval.i = strlen(YYText());
        return DOTS;
@@ -157,7 +156,9 @@ COMMENT             [%#].*\n
                return l;
 
 /* let's try passing tex's typesetting macros like \ss \alpha \c */
-       String* str_p = new String(YYText());//huh?
+       String* str_p = new String(YYText());
+       yylval.string=str_p;
+       mtor << "\\word: `" << *str_p << "'\n";
        return STRING;  
 
 /* and skip identifiers...
@@ -169,16 +170,12 @@ COMMENT           [%#].*\n
        String *sp = new String( c);
 
        yylval.string=sp;
+
        return STRING;
 */
 }
-<lyrics>\"[^"]*\" {
-       String s (YYText()+1);
-       s = s.left_str(s.length_i()-1);
-       yylval.string = new String(s);
-       return STRING;
-}
 <lyrics>{LYRICS} {
+       /* ugr. This sux. */
        String s (YYText()); 
        int i = 0;
        while ((i=s.index_i("_")) != -1) // change word binding "_" to " "
@@ -189,6 +186,7 @@ COMMENT             [%#].*\n
                s = s.left_str(i+2) + " " + s.right_str(s.length_i()-i-2);
                }
        yylval.string = new String(s);
+       mtor << "lyric : `" << s << "'\n";
        return STRING;
 }
 <lyrics>\|     {
index a0152c9f3cab4407909421d34785e800de91d6dd..ff0814f21694b1d4919f9a9858f83476f252e1fc 100644 (file)
@@ -3,7 +3,7 @@
 #include "scalar.hh"
 #include "lookup.hh"
 #include "paper-def.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "notehead.hh"
 #include "misc.hh"
 
index f13ec98b9fd471f422ff77d95572ebd93a9d1e91..ddbd8dc5f842fe277a70bfe6e6d59f3a215fb3b5 100644 (file)
@@ -4,8 +4,8 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
-#include "musicalrequest.hh"
-#include "commandrequest.hh"
+#include "musical-request.hh"
+#include "command-request.hh"
 #include "local-key-reg.hh"
 #include "local-key-item.hh"
 #include "complex-walker.hh"
index cb8c7547e43d9180264935af3892a95c3714a47f..6e3fdf02b81db8c5e0f60c53c4fdb4eb68881c30 100644 (file)
@@ -1,4 +1,4 @@
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "paper-def.hh"
 #include "lyric-item.hh"
 #include "stem.hh"
index a27737c076b8c37e251b45d7f6f0405306c4d562..f15e5ddb0928b9206dd5e1b7fc4c927538645a60 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "meter-reg.hh"
 #include "meter.hh"
-#include "commandrequest.hh"
+#include "command-request.hh"
 
 Meter_register::Meter_register()
 
index c52fdc7b329b324a974f625bc2fce765b85095bc..bfd298bfacfb8879ad394d86d099315e675255df 100644 (file)
@@ -30,6 +30,10 @@ Atom::Atom(Symbol s)
 String
 Atom::TeXstring() const
 {
+    /* infinity checks. */
+    assert( abs(off.x) < 100 CM);
+    assert( abs(off.y) < 100 CM);
+    
     // whugh.. Hard coded...
     String s("\\placebox{%}{%}{%}");
     Array<String> a;
diff --git a/lily/musical-request.cc b/lily/musical-request.cc
new file mode 100644 (file)
index 0000000..be9667c
--- /dev/null
@@ -0,0 +1,359 @@
+/*
+  request.cc -- implement all musical requests.
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "musical-request.hh"
+#include "misc.hh"
+#include "debug.hh"
+#include "script-def.hh"
+#include "text-def.hh"
+#include "voice.hh"
+#include "voice-element.hh"
+
+void
+Stem_req::do_print() const
+{
+    Rhythmic_req::do_print();
+    mtor << "dir : " << dir_i_;
+}
+
+Stem_req::Stem_req(int s, int d)
+    : Rhythmic_req(s,d)
+{
+    dir_i_ = 0;
+}
+
+/* ************** */
+void Musical_req::do_print()const{}
+void Request::do_print() const{}
+
+/* *************** */
+
+void
+Request::print() const
+{
+    mtor << name() << " {";
+    do_print();
+    mtor << "}\n";
+}
+     
+
+
+void
+Span_req::do_print() const    
+{
+#ifndef NPRINT
+    mtor  << spantype ;
+#endif
+}
+
+Request::Request()
+{
+    elt_l_ = 0;
+    defined_ch_c_l_ = 0;
+}
+Request::Request(Request const&src)
+{
+    elt_l_ = 0;
+    defined_ch_c_l_ = src.defined_ch_c_l_;
+}
+/* *************** */
+Spacing_req::Spacing_req()
+{
+    next = 0;
+    distance = 0;
+    strength = 0;
+}
+void
+Spacing_req::do_print()const
+{
+#ifndef NPRINT
+    mtor << "next " << next << "dist " << distance << "strength\n";
+#endif
+}
+
+void
+Blank_req::do_print()const
+{
+    Spacing_req::do_print();
+}
+/* *************** */
+Melodic_req::Melodic_req()
+{
+    notename_i_ = 0;
+    octave_i_ = 0;
+    accidental_i_ = 0;
+    forceacc_b_ = false;
+}
+
+void
+Melodic_req::do_print() const
+{
+    mtor << "notename: " << notename_i_ << " acc: " <<accidental_i_<<" oct: "<< octave_i_;
+}
+
+int
+Melodic_req::height() const
+{
+    return  notename_i_ + octave_i_*7;
+}
+
+/*
+ should be settable from input to allow "viola"-mode
+ */
+static Byte pitch_byte_a[ 7 ] = { 0, 2, 4, 5, 7, 9, 11 };      
+
+int
+Melodic_req::pitch() const
+{
+    return  pitch_byte_a[ notename_i_ % 7 ] + accidental_i_ + octave_i_ * 12;
+}
+
+Plet_req::Plet_req()
+{
+    type_c_ = ']';
+    dur_i_ = 1;
+    type_i_ = 1;
+}
+
+void
+Plet_req::do_print() const
+{
+    mtor << "plet: " << type_c_ << ": " << dur_i_ << "/" << type_i_;
+}
+
+/* *************** */
+int
+Rhythmic_req::compare(const Rhythmic_req &r1, const Rhythmic_req &r2)
+{
+    return sign(r1.duration() - r2.duration());
+}
+Rhythmic_req::Rhythmic_req(int b, int d)
+{
+    plet_factor = 1;
+    balltype = b;
+    dots = d;
+}
+
+Rhythmic_req::Rhythmic_req()
+{
+    plet_factor = 1;
+    balltype = 1;
+    dots = 0;
+}
+
+void
+Rhythmic_req::do_print() const
+{
+    mtor << "ball: " << balltype ;
+    int d =dots;
+    while (d--)
+       mtor << '.';
+    
+    mtor<<", plet factor"<<plet_factor<<"\n";
+}
+
+
+Moment
+Rhythmic_req::duration() const {    
+    return wholes(balltype,dots)*plet_factor;
+}
+/* *************** */
+
+Lyric_req::Lyric_req(Text_def* def_p)
+    :Text_req(0, def_p)
+{
+    def_p->align_i_ = 0;       // centre
+    dir_i_ = -1;               // lyrics below (invisible) staff
+}
+
+void
+Lyric_req::do_print() const
+{    
+    Rhythmic_req::do_print();
+    Text_req::do_print();
+}
+/* *************** */
+void
+Note_req::do_print() const
+{
+    Melodic_req::do_print();
+    Rhythmic_req::do_print();
+}
+/* *************** */
+void
+Rest_req::do_print() const
+{
+        Rhythmic_req::do_print();
+}
+
+/* *************** */
+Beam_req::Beam_req()
+{
+    nplet = 0;
+}
+
+void Beam_req::do_print()const{}
+/* *************** */
+void Slur_req::do_print()const{}
+/* *************** */
+int
+Span_req:: compare(const Span_req &r1, const Span_req &r2)
+{
+     return r1.spantype - r2.spantype;
+}
+
+Span_req::Span_req()
+{
+    spantype = NOSPAN;
+}
+
+/* *************** */
+Script_req::Script_req(int d , Script_def*def)
+{
+    dir_i_ = d;
+    scriptdef_p_ = def;
+}
+
+int
+Script_req::compare(const Script_req &d1, const Script_req &d2)
+{
+    return d1.dir_i_ == d2.dir_i_ &&
+       d1.scriptdef_p_->compare(*d2.scriptdef_p_);
+}
+
+Script_req::Script_req(Script_req const &s)
+    : Request( s )
+{
+    dir_i_ = s.dir_i_;
+    scriptdef_p_ = new Script_def(*s.scriptdef_p_);
+}
+
+void
+Script_req::do_print() const
+{
+    mtor << " dir " << dir_i_ ;
+    scriptdef_p_->print();
+}
+
+
+Script_req::~Script_req()
+{
+    delete scriptdef_p_;
+}
+/* *************** */
+int
+Text_req:: compare(const Text_req &r1, const Text_req &r2)
+{
+    bool b1 = (r1.dir_i_ == r2.dir_i_);
+    bool b2 = (r1.tdef_p_ ->compare(*r2.tdef_p_));
+    return b1 && b2;
+}
+Text_req::~Text_req()
+{
+    delete tdef_p_;
+    tdef_p_ = 0;
+}
+
+Text_req::Text_req(Text_req const& src)
+{
+    tdef_p_ = new Text_def(*src.tdef_p_);
+    dir_i_ = src.dir_i_;
+}
+
+Text_req::Text_req(int dir_i, Text_def* tdef_p)        
+{
+    dir_i_ = dir_i;
+    tdef_p_ = tdef_p;
+}
+
+void
+Text_req::do_print() const
+{
+    mtor << " dir " << dir_i_ ;
+    tdef_p_->print();
+}
+
+/* *************** */
+
+Moment
+Skip_req::duration() const
+{
+    return duration_;
+}
+
+void
+Skip_req::do_print() const
+{
+    mtor << "duration: " << duration();
+}
+
+Voice *
+Request::voice_l()
+{
+    if (!elt_l_)
+       return 0;
+    else
+       return (Voice*)elt_l_->voice_l_;
+}
+/* *************** */
+
+void
+Subtle_req::do_print() const
+{
+    mtor << " subtime " <<  subtime_;
+}
+
+void
+Dynamic_req::do_print() const
+{
+    Subtle_req::do_print();
+}
+
+void
+Absolute_dynamic_req::do_print() const
+{
+    Dynamic_req::do_print();
+    mtor << " loudness_" <<loudness_;
+}
+
+String
+Dynamic_req::loudness_str(Loudness l) 
+{
+    switch (l) {
+    case FFF: return "fff";
+    case FF: return "ff";
+    case F: return "f";
+    case MF: return "mf";
+    case MP: return "mp";
+    case P: return "p";
+    case PP: return "pp";
+    case PPP: return "ppp";
+    }
+    assert(false);
+    return "";
+}
+
+Absolute_dynamic_req::Absolute_dynamic_req()
+{
+    loudness_ = MF;
+}
+
+
+Span_dynamic_req::Span_dynamic_req()
+{
+    dynamic_dir_i_  = 0;
+}
+
+void
+Span_dynamic_req::do_print()const
+{
+#ifndef NPRINT
+    Span_req::do_print();
+    mtor << "louder/louder: " <<dynamic_dir_i_;
+#endif
+}
index 9c9179c856d4237b5aa65df59d402b5a4bc1873f..2907a339659b00e54fa91fca457e92c1937d5485 100644 (file)
@@ -10,7 +10,7 @@
 #include "assoc.hh"
 #include "lexer.hh"
 #include "debug.hh"
-#include "notename.hh"
+
 #include "source-file.hh"
 #include "parseconstruct.hh"
 
@@ -27,6 +27,7 @@ static Keyword_ent the_key_tab[]={
     "goto", GOTO,
     "in", IN_T,
     "key", KEY,
+    "melodic" , MELODIC,
     "meter", METER,
     "midi", MIDI,
     "mm", MM_T,
@@ -45,7 +46,6 @@ static Keyword_ent the_key_tab[]={
     "stem", STEM,
     "table", TABLE,
     "symboltables", SYMBOLTABLES,
-    "notenames", NOTENAMES,
     "tempo", TEMPO,
     "texid", TEXID,
     "textstyle", TEXTSTYLE,
@@ -58,81 +58,56 @@ static Keyword_ent the_key_tab[]={
     0,0
 };
 
-int
-My_flex_lexer::ret_notename(int *p, String text, int octave_mod)
-{
-    text = text.lower_str();
-    char const* ch_c_l = here_ch_c_l();
-    if ( ch_c_l ) {
-       ch_c_l--;
-       while ( ( *ch_c_l == ' ' )
-               || ( *ch_c_l == '\t' ) || ( *ch_c_l == '\n' ) )
-           ch_c_l--;
-       ch_c_l++;
-    }
-       
-    lookup_notename(p[0], p[1], text);
-    p[2] = octave_mod;
-    mtor << "notename: "<< text <<eol;
-    if (p[0] < 0) {
-
-       errorlevel_i_ |= 1;
-       error( String( "notename does not exist: " ) + YYText(), ch_c_l );
-       p[0] = p[1] = 0;
-    }
-    return NOTENAME;
-}
-
 My_flex_lexer::My_flex_lexer()
 {
-    keytable = new Keyword_table(the_key_tab);
-    the_id_tab = new Assoc<String, Identifier*>;
-    defaulttab = 0;
+    keytable_p_ = new Keyword_table(the_key_tab);
+    identifier_assoc_p_ = new Assoc<String, Identifier*>;
     errorlevel_i_ = 0;
 }
 
 int
 My_flex_lexer::lookup_keyword(String s)
 {
-    return keytable->lookup(s);
+    return keytable_p_->lookup(s);
 }
 
 Identifier*
 My_flex_lexer::lookup_identifier(String s)
 {
-    if (!the_id_tab->elt_query(s))
+    if (!identifier_assoc_p_->elt_query(s))
        return 0;
     
-    return (*the_id_tab)[s];
+    return (*identifier_assoc_p_)[s];
 }
 
 char const*
 My_flex_lexer::here_ch_c_l()
 {
-    return include_stack.top()->sourcefile_l_->ch_c_l() + yyin->tellg();
+    return include_stack_.top()->sourcefile_l_->ch_c_l() + yyin->tellg();
 }
 
 void
 My_flex_lexer::add_identifier(Identifier*i)
 {
     delete lookup_identifier(i->name);
-    (*the_id_tab)[i->name] = i;
+    (*identifier_assoc_p_)[i->name] = i;
 }
 
 My_flex_lexer::~My_flex_lexer()
 {
-    delete keytable;
-    delete defaulttab;
-    for (Assoc_iter<String,Identifier*> ai(*the_id_tab); ai.ok(); ai++) {
+    delete keytable_p_;
+
+    for (Assoc_iter<String,Identifier*>
+            ai(*identifier_assoc_p_); ai.ok(); ai++) {
        mtor << "deleting: " << ai.key()<<'\n';
        delete ai.val();
     }
-    delete the_id_tab;
+    delete identifier_assoc_p_;
 }
 void
 My_flex_lexer::print_declarations()const
 {
-    for (Assoc_iter<String,Identifier*> ai(*the_id_tab); ai.ok(); ai++) {
+    for (Assoc_iter<String,Identifier*> ai(*identifier_assoc_p_); ai.ok(); ai++) {
        ai.val()->print();
     }
 }
@@ -140,13 +115,13 @@ My_flex_lexer::print_declarations()const
 String
 My_flex_lexer::spot()const
 {
-    return include_stack.top()->name +  ": " + String( lineno() );
+    return include_stack_.top()->name +  ": " + String( lineno() );
 }
 
 void
 My_flex_lexer::LexerError(const char *s)
 {
-    if (lexer->include_stack.empty()) {
+    if (lexer->include_stack_.empty()) {
        *mlog << "error at EOF" << s << '\n';
     } else {
        char const* ch_c_l = here_ch_c_l();
@@ -165,14 +140,14 @@ My_flex_lexer::LexerError(const char *s)
 void
 My_flex_lexer::new_input(String s)
 {    
-   if (!include_stack.empty()) {
-       include_stack.top()->line = lineno();
+   if (!include_stack_.empty()) {
+       include_stack_.top()->line = lineno();
             // should this be saved at all?
-       include_stack.top()->defined_ch_c_l_ = defined_ch_c_l;
+       include_stack_.top()->defined_ch_c_l_ = defined_ch_c_l;
    }
 
    Input_file *newin = new Input_file(s);
-   include_stack.push(newin);
+   include_stack_.push(newin);
    switch_streams(newin->is);
 
    yylineno = 1;
@@ -182,12 +157,12 @@ My_flex_lexer::new_input(String s)
 bool
 My_flex_lexer::close_input()
 {
-    Input_file *old = include_stack.pop();
+    Input_file *old = include_stack_.pop();
      bool ok =         true;
-    if (include_stack.empty()) {
+    if (include_stack_.empty()) {
        ok = false;
     } else {
-       Input_file *i = include_stack.top();
+       Input_file *i = include_stack_.top();
        switch_streams(i->is);
        yylineno = i->line;     
        defined_ch_c_l = i->defined_ch_c_l_;
index 496d892e5b872223cb717d22c181a0b527e8e3b1..475e3e08ba0cbd251859c3c631e584a4da9bf3e3 100644 (file)
@@ -6,10 +6,10 @@
 #include "string.hh"
 #include "real.hh"
 #include "debug.hh"
-#include "musicalrequest.hh"
-#include "commandrequest.hh"
+#include "musical-request.hh"
+#include "command-request.hh"
 #include "voice.hh"
-#include "notename.hh"
+
 #include "identparent.hh"
 #include "varray.hh"
 #include "text-def.hh"
@@ -77,30 +77,11 @@ parse_octave (const char *a, int &j, int &oct)
     }
 }
 
-void 
-parse_pitch( const char *a, Melodic_req* mel_l)
-{
-    int j=0;
-
-    // octave
-    mel_l->octave_i_ = default_octave;
-    parse_octave(a,j,mel_l->octave_i_);
-
-    // accidental
-    mel_l->forceacc_b_ = false;
-    
-    if (a[j] == '!'){
-       mel_l->forceacc_b_ = true;
-       j++;
-    }
-}
-
 Voice_element *
-get_note_element(String pitch, int * notename, int * duration )
+get_note_element(Note_req *rq, int * duration )
 {
     Voice_element*v = new Voice_element;
     v->defined_ch_c_l_ = defined_ch_c_l;
-
     
     int dur = duration[0];
     int dots = duration[1];
@@ -115,12 +96,6 @@ get_note_element(String pitch, int * notename, int * duration )
     if ( !defined_ch_c_l )
         defined_ch_c_l = lexer->here_ch_c_l();
 
-    Note_req * rq = new Note_req;
-    rq->notename_i_ =notename[0];
-    rq->accidental_i_ = notename[1];
-    parse_pitch(pitch, rq);
-    rq->octave_i_ += notename[2];
-
     rq->balltype = dur;
     rq->dots = dots;
     rq->plet_factor = Moment(default_plet_dur, default_plet_type);
index 4d0157abe9aa4271b5ee0fcb01c1458cc3517355..fb0c1166c1dd28a7bb7a1cc6905340420b6c00ae 100644 (file)
@@ -5,7 +5,7 @@
 #include "paper-def.hh"
 #include "lookup.hh"
 #include "molecule.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 
 
 
index ebec63fbefe15feddea069cc597865d552392508..bc8876b5e4baea49dffa2119309e314708b9dbd9 100644 (file)
@@ -13,8 +13,8 @@
 #include "parseconstruct.hh"
 #include "dimen.hh"
 #include "identifier.hh"
-#include "commandrequest.hh"
-#include "musicalrequest.hh"
+#include "command-request.hh"
+#include "musical-request.hh"
 #include "voice-element.hh"
 
 #ifndef NDEBUG
@@ -32,90 +32,127 @@ int fatal_error_i = 0;
 
 
 %union {
-    Request * request;
-    Real real;
-    Identifier *id;    
-   Voice *voice;    
-    Voice_element *el; 
-    String *string;
-    const char *consstr;
-    Paper_def *paper;
-    Midi_def* midi;
-    Input_music *music;
-    Music_general_chord *chord;
-    Music_voice *mvoice; 
-    int i;
-    char c;
-    int ii[10];
-       Moment *moment;
-
+    Array<Melodic_req*> *melreqvec;
     Array<String> * strvec;
     Array<int> *intvec;
-    Array<Melodic_req*> *melreqvec;
-    Input_staff *staff;    
+    Box *box;
+    Identifier *id;    
+    Input_music *music;
     Input_score *score;
-    Symtables * symtables;
-    Symtable * symtable;
-    Symbol * symbol;
-    Lookup*lookup;
+    Input_staff *staff;    
     Interval *interval;
-    Box *box;
-    Notename_tab *notename_tab;
+    Lookup*lookup;
+    Melodic_req * melreq;
+    Midi_def* midi;
+    Moment *moment;
+    Music_general_chord *chord;
+    Music_voice *mvoice;
+    Note_req *notereq;
+    Paper_def *paper;
+    Real real;
+    Request * request;
     Script_def * script;
+    String *string;
+    Symbol * symbol;
+    Symtable * symtable;
+    Symtables * symtables;
     Text_def * textdef;
+    Voice *voice;    
+    Voice_element *el; 
+    char c;
+    const char *consstr;
+    int i;
+    int ii[10];
 }
 
-%token VOICE STAFF SCORE TITLE  BAR  OUTPUT MULTIVOICE DYNAMIC
-%token CM_T IN_T PT_T MM_T PAPER WIDTH METER UNITSPACE SKIP COMMANDS COMMAND
-%token GEOMETRIC START_T DURATIONCOMMAND OCTAVECOMMAND
-%token KEY CLEF  TABLE  VOICES STEM
-%token PARTIAL MUSIC GROUPING CADENZA
-%token END SYMBOLTABLES TEXID TABLE NOTENAMES SCRIPT TEXTSTYLE PLET
-%token  GOTO
-%token MIDI TEMPO
-
-%token <id>  IDENTIFIER REAL_IDENTIFIER REQUEST_IDENTIFIER 
-%token <string> PITCHMOD DURATION RESTNAME
-%token <ii> NOTENAME 
-%token <real> REAL 
-%token <string> STRING
-
-%token <i> DOTS INT
-%type <real> unit
-%type <melreqvec> pitch_list 
-%type <c> open_request_parens close_request_parens close_plet_parens
-%type <id> declaration
-%type <string> declarable_identifier
-%type <paper> paper_block paper_body
-%type <midi> midi_block midi_body
-%type <real> dim real
-%type <ii>  default_duration explicit_duration notemode_duration mudela_duration
-%type <ii> notename
-%type <moment> duration_length
-%type <el> voice_elt full_element lyrics_elt command_elt
-
-%type <score> score_block score_body
-%type <staff> staff_block staff_init staff_body
-%type <i> int
-%type <intvec> intastint_list
-%type <request> post_request pre_request command_req 
-%type <string> pitchmod
-%type <music> music 
-%type <chord> music_chord music_chord_body
-
-%type <mvoice>  music_voice_body music_voice 
-
-%type <interval> dinterval
-%type <box> box
-%type <symtable> symtable symtable_body
-%type <lookup> symtables symtables_body
-%type <symbol> symboldef
-%type <notename_tab> notename_tab notename_tab_body
-%type <i> script_dir
-%type <script> script_definition script_body mudela_script
-%type <request> script_req textscript_req dynamic_req basic_request
-%type <textdef> mudela_text
-
+%token BAR
+%token CADENZA
+%token CLEF
+%token CM_T
+%token COMMAND
+%token COMMANDS
+%token DURATIONCOMMAND
+%token DYNAMIC
+%token END
+%token GEOMETRIC
+%token GOTO
+%token GROUPING
+%token IN_T
+%token KEY
+%token MELODIC
+%token METER
+%token MIDI
+%token MM_T
+%token MULTIVOICE
+%token MUSIC
+%token OCTAVECOMMAND
+%token OUTPUT
+%token PAPER
+%token PARTIAL
+%token PLET
+%token PT_T
+%token SCORE
+%token SCRIPT
+%token SKIP
+%token STAFF
+%token START_T
+%token STEM
+%token SYMBOLTABLES
+%token TABLE
+%token TABLE
+%token TEMPO
+%token TEXID
+%token TEXTSTYLE
+%token TITLE
+%token UNITSPACE
+%token VOICE
+%token VOICES
+%token WIDTH
+
+%token <i>     DOTS
+%token <i>     INT
+%token <id>    IDENTIFIER
+%token <id>    MELODIC_REQUEST_IDENTIFIER 
+%token <id>    POST_REQUEST_IDENTIFIER
+%token <id>    REAL_IDENTIFIER
+%token <id>    REQUEST_IDENTIFIER
+%token <real>  REAL 
+%token <string>        DURATION RESTNAME
+%token <string>        STRING
+
+%type <box>    box
+%type <c>      open_request_parens close_request_parens close_plet_parens
+%type <chord>  music_chord music_chord_body
+%type <el>     voice_elt full_element lyrics_elt command_elt
+%type <i>      int
+%type <i>      octave_quotes octave_quote
+%type <i>      script_dir
+%type <id>     declaration
+%type <ii>     default_duration explicit_duration notemode_duration
+%type <ii>     mudela_duration
+%type <interval>       dinterval
+%type <intvec> intastint_list
+%type <lookup> symtables symtables_body
+%type <melreq> melodic_request
+%type <notereq>        steno_note_req
+%type <melreqvec>      pitch_list 
+%type <midi>   midi_block midi_body
+%type <moment> duration_length
+%type <music>  music 
+%type <mvoice>  music_voice_body music_voice 
+
+%type <paper>  paper_block paper_body
+%type <real>   dim real
+%type <real>   unit
+%type <request>        post_request pre_request command_req pure_post_request
+%type <request>        script_req textscript_req dynamic_req 
+%type <score>  score_block score_body
+%type <script> script_definition script_body mudela_script
+%type <staff>  staff_block staff_init staff_body
+%type <string> declarable_identifier
+%type <symbol> symboldef
+%type <symtable>       symtable symtable_body
+%type <textdef>        mudela_text
 
 %%
 
@@ -124,12 +161,8 @@ mudela:    /* empty */
                add_score($2);          
        }
        | mudela add_declaration { }
-       | mudela mudela_command  {}
        ;
 
-mudela_command:
-       notename_tab                    { lexer->set($1); }
-       ;
 
 /*
        DECLARATIONS
@@ -140,7 +173,11 @@ add_declaration: declaration       {
        ;
 
 declarable_identifier:
-       STRING { $$ = $1; }
+       STRING { $$ = $1;
+          if (lexer->lookup_identifier(*$1))
+               warning("redeclaration of `" + *$1 + "'",
+                       lexer->here_ch_c_l());
+       }
        | IDENTIFIER { $$ = new String($1->name); }
        ;
 
@@ -165,10 +202,6 @@ declaration:
                $$ = new Lookup_id(*$1, $3, IDENTIFIER);
                delete $1;
        }
-       | declarable_identifier '=' notename_tab {
-               $$ = new Notetab_id(*$1, $3, IDENTIFIER);
-               delete $1;
-       }
        | declarable_identifier '=' real        {
                $$ = new Real_id(*$1, new Real($3), REAL_IDENTIFIER);
                delete $1;
@@ -176,28 +209,17 @@ declaration:
        | declarable_identifier error '}' {
 
        }
-       | declarable_identifier '=' basic_request {
-               $$ = new Request_id(*$1, $3, REQUEST_IDENTIFIER);
+       | declarable_identifier '=' pure_post_request {
+               $$ = new Request_id(*$1, $3, POST_REQUEST_IDENTIFIER);
                delete $1;
        }
-       ;
-
-notename_tab:
-       NOTENAMES '{' notename_tab_body '}'     { $$ = $3; }
-       ;
-
-notename_tab_body:                             {
-               $$ = new Notename_tab;
-       }
-       | IDENTIFIER                            {
-               $$ = $1->notename_tab(true);
-       }
-       | notename_tab_body STRING int int                      {
-               $$->set($3, $4, *$2);
-               delete $2;
+       | declarable_identifier '=' melodic_request {
+               $$ = new Request_id(*$1, $3, MELODIC_REQUEST_IDENTIFIER);
+               delete $1;
        }
        ;
 
+
 /*
        SCORE
 */
@@ -212,6 +234,11 @@ score_block:
                /* handle error levels. */
                $$->errorlevel_i_ = lexer->errorlevel_i_;
                lexer->errorlevel_i_ = 0;
+
+               /* unbarf score without global music. */
+               if (!$$-> score_wide_music_p_) {
+                       $$-> score_wide_music_p_ = new Music_voice; 
+               }
        }
        ;
 
@@ -305,6 +332,9 @@ staff_init:
                $$ = new Input_staff(*$1);
                delete $1;
        }
+       | MELODIC {
+               $$ = new Input_staff("melodic");
+       }
        ;
 
 staff_body:
@@ -379,12 +409,6 @@ music_chord_body:
        }
        ;
 
-basic_request:
-       command_req
-       | pre_request
-       | post_request
-       ;
-
 /*
        VOICE ELEMENTS
 */
@@ -425,6 +449,10 @@ command_req:
        | METER '{' int '*' int '}'     {
                Meter_change_req *m = new Meter_change_req;
                m->set($3,$5);
+               // sorry hw, i need meter at output of track,
+               // but don-t know where to get it... statics should go.
+               Midi_def::num_i_s = $3;
+               Midi_def::den_i_s = $5;
                $$ = m;
        }
        | SKIP '{' duration_length '}' {
@@ -474,14 +502,57 @@ post_requests:
        ;
 
 post_request:
+       pure_post_request
+       | POST_REQUEST_IDENTIFIER       {
+               $$ = $1->request(false)->clone();
+       }
+       ;
+
+pure_post_request:
        close_request_parens    { 
                $$ = get_request($1); 
        }
        | script_req
        | textscript_req
        | dynamic_req
-       | REQUEST_IDENTIFIER    {
-               $$ = $1->request(false)->clone();
+       ;
+
+
+octave_quote:
+       '\''            { $$ = 1; }
+       | '`'           { $$ = -1; }
+       ;
+
+octave_quotes:
+       /**/ { $$ = 0; }
+       | octave_quotes octave_quote{ $$ += $2; }
+       ;
+
+/*
+       URG!!
+*/
+steno_note_req:
+       MELODIC_REQUEST_IDENTIFIER      {
+               $$ = new Note_req;
+               * (Melodic_req *) $$ = *$1->request(false)->melodic();
+       }
+       | octave_quote steno_note_req   {  
+               $2-> octave_i_ += $1;
+               $$ = $2; //ugh!!
+       }
+       | '!' steno_note_req            {
+               $$ = $2;
+               $2->forceacc_b_ = ! $2->forceacc_b_;
+       } 
+       ;
+
+melodic_request:
+       MELODIC '{' int int int int '}' {/* ugh */
+               $$ = new Melodic_req;
+               $$->octave_i_ = $3;
+               $$->notename_i_ = $4;
+               $$->accidental_i_ = $5;
+               $$->forceacc_b_ = $6;
        }
        ;
 
@@ -599,9 +670,8 @@ voice_command:
        | DURATIONCOMMAND '{' notemode_duration '}'     {
                set_default_duration($3);
        }
-       | OCTAVECOMMAND '{' pitchmod '}'        {
-               set_default_octave(*$3);
-               delete $3;
+       | OCTAVECOMMAND '{' octave_quotes '}'   {
+               set_default_octave($3);
        }
        | TEXTSTYLE STRING      {
                set_text_style(*$2);
@@ -660,34 +730,19 @@ explicit_duration:
        ;
 
 default_duration:
-       {
+       /* empty */     {
                get_default_duration($$);
        }
        ;
 
-pitchmod:              { 
-               defined_ch_c_l = lexer->here_ch_c_l();
-               $$ = new String; 
-       }
-       | PITCHMOD      { 
-               defined_ch_c_l = lexer->here_ch_c_l();
-               $$ = $1;
-       }
-       ;
-
-notename:
-       NOTENAME
-       ;
 
 voice_elt:
-       pitchmod notename notemode_duration                     {
-               $$ = get_note_element(*$1, $2, $3);
-               delete $1;
+       steno_note_req notemode_duration                {
+               $$ = get_note_element($1, $2);
        }
        | RESTNAME notemode_duration            {
                $$ = get_rest_element(*$1, $2);
                delete $1;
-
        }
        ;
 
@@ -702,11 +757,8 @@ lyrics_elt:
 pitch_list:                    {
                $$ = new Array<Melodic_req*>;
        }
-       | pitch_list NOTENAME   {
-               Melodic_req *m_p = new Melodic_req;
-               m_p->notename_i_ = $2[0];
-               m_p->accidental_i_ = $2[1];
-               $$->push(m_p);
+       | pitch_list MELODIC_REQUEST_IDENTIFIER {
+               $$->push($2->request(false)->clone()->melodic());
        }
        ;
 
@@ -823,7 +875,7 @@ parse_file(String init, String s)
    *mlog << "Parsing ... ";
    lexer = new My_flex_lexer;
 
-#ifdef YYDEBUG
+#ifndef NPRINT
    yydebug = !monitor->silence("InitParser") && check_debug;
    lexer->set_debug( !monitor->silence("InitLexer") && check_debug);
 #endif
@@ -831,13 +883,20 @@ parse_file(String init, String s)
    lexer->new_input(init);
    yyparse();
 
-#ifdef YYDEBUG
+#ifndef NPRINT
+   if (!monitor->silence("InitDeclarations") && check_debug)
+       lexer->print_declarations();
+
    yydebug = !monitor->silence("Parser") && check_debug;
    lexer->set_debug( !monitor->silence("Lexer") && check_debug);
 #endif
 
    lexer->new_input(s);
    yyparse();
+#ifdef NPRINT
+   if (!monitor->silence("Declarations") && check_debug)
+       lexer->print_declarations();
+#endif
    delete lexer;
    lexer = 0;
 
index 126507cc6b9ecbfaea032b88060490986c934b7d..dfaa3ce05b57bec7de44559aaa2ce2bfb3ead363 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 #include "voice.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "register.hh"
 #include "notehead.hh"
 #include "complex-walker.hh"
index 6cfba0f397b41fafd158b57419b21b569263cc06..7ba3212e9216fdfe927e5cf58e1443adb64624dd 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "script-reg.hh"
 #include "script.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "complex-walker.hh"
 #include "stem.hh"
 
index 1bcbd518a8eeb899f6b562d1502d3ab285eac778..46c253588012d03c28ba660271eba8801de00602 100644 (file)
@@ -1,4 +1,4 @@
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "paper-def.hh"
 #include "script.hh"
 #include "stem.hh"
index f2b7113ca0cc277ca86647192ecdff15bd8f469b..34bffee73d162c8af81999099d7df9e9b52ad944 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "proto.hh"
 #include "plist.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "complex-walker.hh"
 #include "slur-reg.hh"
 #include "slur.hh"
index 74c18f3b18f274fb27dcc8e94cd16cb160f61ef2..9a817f0190e6b7ae8b53fe48ff0c5e62640d5f5f 100644 (file)
 #include "plist.hh"
 #include "grouping.hh"
 #include "staff.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "staff-walker.hh"
 #include "staff-column.hh"
 #include "score-column.hh"
 #include "debug.hh"
 #include "time-description.hh"
-#include "commandrequest.hh"
+#include "command-request.hh"
 #include "grouping.hh"
 #include "score-walker.hh"
 
index 71fa8a813fa873f744b8005c019dfd24151c8ad0..31cba7801f99e39c19b87fa420f69684bae4638b 100644 (file)
@@ -19,8 +19,8 @@
 #include "score-column.hh"
 #include "voice-element.hh"
 #include "debug.hh"
-#include "musicalrequest.hh"
-#include "commandrequest.hh" // todo
+#include "musical-request.hh"
+#include "command-request.hh" // todo
 #include "midi-stream.hh"
 #include "pqueue.hh"
 void
index 54579d337d4b7efae1e09095053537b54f4fbdab..67c7b5b54dcd31c0eadf98323f1e6a0254a58c09 100644 (file)
@@ -4,7 +4,7 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "stem-beam-reg.hh"
 #include "beam.hh"
 #include "stem.hh"
index 0f581474c3f1b7f8747f9b999d21f52c4d4364e9..f29c5b9f56bb9c32eae7137b3da33c974c5e038e 100644 (file)
@@ -9,7 +9,7 @@
 #include "symbol.hh"
 #include "voice.hh"
 #include "voice-element.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "staff.hh"
 #include "score-column.hh"
 #include "staff-column.hh"
index b0f6ab410762ed0ee2d4ed2cce16dbb8885cf2bd..adadda663248a70f58701e06ee47a3c86f21114f 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "paper-def.hh"
 #include "text-item.hh"
 #include "stem.hh"
index 5461b833682a514adcd57daed84cc5cb778f0dd7..a15e47548ea9a6db1fad24d63e5b2c6cf0977631 100644 (file)
@@ -4,7 +4,7 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "text-reg.hh"
 #include "text-item.hh"
 
index e932e4d4033fb7863b2e1e77b746089706d579d2..f244327c5fe6b190ba5c4cd52aeefe156960347c 100644 (file)
@@ -11,8 +11,8 @@
 #include "debug.hh"
 #include "voice.hh"
 #include "voice-element.hh"
-#include "musicalrequest.hh"
-#include "commandrequest.hh"
+#include "musical-request.hh"
+#include "command-request.hh"
 
 
 void
index d789fda2b15c92ac20d81d3703bc40d9660d5399..8a602a520152f282713e09afb331244f3d84d7a7 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "proto.hh"
 #include "plist.hh"
-#include "musicalrequest.hh"
+#include "musical-request.hh"
 #include "voice-regs.hh"
 #include "voice-group-regs.hh"
 #include "register.hh"
@@ -16,7 +16,7 @@
 #include "stem-beam-reg.hh"
 #include "script-reg.hh"
 #include "complex-walker.hh"
-#include "commandrequest.hh"
+#include "command-request.hh"
 #include "debug.hh"
 #include "dynamic-reg.hh"
 
index 5cf14d1a015335b977cff8eedc3ebaa2dada6421..ca39524be0e0969bcec91cb0a3b79998db01546e 100644 (file)
@@ -7,8 +7,8 @@
 */
 #include "proto.hh"
 #include "plist.hh"
-#include "commandrequest.hh"
-#include "musicalrequest.hh"
+#include "command-request.hh"
+#include "musical-request.hh"
 #include "voice-regs.hh"
 #include "register.hh"
 #include "slur-reg.hh"
index 810a15dd36f2cbf946345f9fe1f09c46a5b70f55..47e9e28378bb80086b0535507360cfa6bcc261ed 100644 (file)
@@ -10,8 +10,8 @@
 #include "plist.hh"
 #include "debug.hh"
 #include "voice.hh"
-#include "musicalrequest.hh"
-#include "commandrequest.hh"
+#include "musical-request.hh"
+#include "command-request.hh"
 #include "midi-item.hh"
 #include "midi-stream.hh"
 #include "voice-element.hh"
index ab242065d54a45426b32e5ba94ce4ebccb9f48c3..425167422f70bdef03dd428df5385a775417f376 100644 (file)
@@ -20,7 +20,7 @@
 #include "staff-column.hh"
 #include "voice-group-regs.hh"
 #include "voice-regs.hh"
-#include "commandrequest.hh"
+#include "command-request.hh"
 #include "score-walker.hh"
 
 Walker_registers::Walker_registers(Complex_walker *w)