]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.32
authorfred <fred>
Sun, 24 Mar 2002 19:32:26 +0000 (19:32 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:32:26 +0000 (19:32 +0000)
16 files changed:
input/Makefile
input/coriolan-alto.ly
input/error.ly
input/kortjakje.ly
input/maartje.ly
input/martien.ly
input/pavane.ly
input/rhythm.ly [new file with mode: 0644]
input/scales.ly
input/scsii-menuetto.ly
input/standchen.ly
input/twinkle.ly
src/parser.y
src/qlp.cc
src/qlpsolve.cc
src/stem.cc

index c9888dd680c8e1f6ede0a0d2aa962b2a270a2dbd..885dcf19a9ebd373203898ffe80f27d7fb1c261d 100644 (file)
@@ -4,7 +4,7 @@ DISTFILES=Makefile  kortjakje.ly pavane.ly  maartje.ly\
        cadenza.ly scales.ly standchen.ly twinkle.ly\
        wohltemperirt.ly error.ly\
        martien.ly mlalt.ly mlvio1.ly mlvio2.ly mlcello.ly\
-       coriolan-alto.ly\
+       coriolan-alto.ly rhythm.ly \
        standchen.tex pavane.tex scsii-menuetto.tex scsii-menuetto.ly\
        martien.tex
 
index 959c4d79a3b4bc2a10849f824cfafc5b0129d0af..683141814d55773b7bbd06f9a11221854ee22d86 100644 (file)
@@ -14,7 +14,9 @@
 alto = music { 
        $
        \duration{ 8 }
-
+       \key {$bes es as$}
+               
+       }                       \clef "alto"
        % these are chords (i.e. non-divisi)
        % that-s why i-d rather type chords, 
        % but how to type slurs?
@@ -68,15 +70,10 @@ alto = music {
 }
 
 score {
-       staff { melodic music { alto }
-               commands {
-                       clef "alto"
-                       key $c es as$ % c ??? 
-               }
-       }
+       staff { melodic music { alto }}
+
        commands { 
-               meter 4*4
-               skip 5:0
+               meter {4*4} grouping {4*4}
        }
        paper { 
                unitspace 14mm
index 9cc63116978f73466b34157b3345086d4706c482..922f9ebefd4641649d81c036c8c4d95d1dd7078a 100644 (file)
@@ -1,8 +1,7 @@
 mwa = music {
        $
-%      [ a8 a8 a8 a8 a8 ]      % assertion fail
-%      [ a8 a8 a8 ]    % assertion fail
-%      [ a8 ]  % assertion fail
+       [ a8 a8 a8 a8 a8 ]      % 
+       [ a8 ]  % 
        a ) b ] c       % warning
        &               % ok; error
        a b ) ]         % ok; error
@@ -37,6 +36,6 @@ score {
                melodic music { mwa }
        }
        commands {
-               meter 3*4
+               meter {3*4}
        }
 }
index ba78402109039db5fb9255e604e916af95ca9024..6da101c266ca06b3774aa611b4207ced558dd4ec 100644 (file)
@@ -11,6 +11,7 @@
 
 melodie = music {
        $                       % switch Lilypond in note-mode
+       \clef\violin
        \octave {}              % set the default octave
        % the default note duratino is 4
        %%% theme
@@ -32,7 +33,7 @@ $}
 
                                % more of this.
 begeleiding =
-$
+$      \clef "bass"            % bass-clef
        \music {                % as you can see, the $ sign obliges 
                                % you to precede keyword by a backslash: \
        \octave { ` }           % default octave: 1 below the first octave.
@@ -53,16 +54,12 @@ $
 bstaf = staff {
        melodic
        music { begeleiding }   % use the declared music
-               commands {      % commands with Staff-wide impact.
-                       clef "bass"     % bass-clef
-               }
        }
 
 % another one
 vstaf = staff {
        melodic
                music { melodie }
-               commands { clef "violin" }
                                % default clef is violin clef
        }
 
@@ -74,9 +71,7 @@ score {
                unitspace 2.5cm % a whole note takes 2.5 cm ideally.
        }
        commands {
-               meter 2* 4      % a 2/4 meter.
-               skip 33:0       % skip 32 measures, and generate the bars
-%              meter 6 8       % another meter
+               meter {2* 4}    % a 2/4 meter.
        }
 }
 
index 0f96005edff5e538639e54c0cf43a31e38253e7d..9a79cf47c3abecd803ea6495a0cc159d28f24444 100644 (file)
@@ -26,7 +26,7 @@ melody=
 staff {
        melodic
        music{$
-       c8
+       c8\key{fis cis gis}
        |r4 r4 r4 r4
        |'cis2..        r8
        | r4 r8 r16 r32 r32 
@@ -45,19 +45,11 @@ staff {
        |''fis2
        | a8 b8 'c8 'd8 |''c8 ```c8 c4 |c4  c4 |c4
        \duration{ 16 } `b `a `g `f \duration{ 4}
-       
+       \clef\bass      
 
        |c `b `a `g `f `e `d `c ``b ``a ``g ``f ``e ``d ``c
        $}
 
-       commands {
-               skip 3:0
-               key $ fis cis gis $
-               skip 2:0
-               key 
-               skip 5:0
-               clef bass
-       }
 }
 
 score {
@@ -68,13 +60,13 @@ score {
 %      staff { ritme }%broken for now
        staff { melody }
        commands {
-               meter 4* 4
+               meter {4* 4}
                partial 8
-               skip 1:2
+               skip 3*2
                bar ":|:"
-               skip 2:0
-               meter 2* 4
-               skip 19:0
+               skip 2*1
+               meter {2*4}
+
        }
 }
 
index b299340b3aa11cc80423719ccb718aadb0d29dd1..cf40cc97886f571e06c3cb778d8248a329853da8 100644 (file)
@@ -1,3 +1,6 @@
+%%%%%%%%% HAS TO BE ADJUSTED to pl32
+
+
 % martien.ly
 %
 % Viola Quartet
@@ -23,83 +26,30 @@ score {
        staff { 
                melodic 
                music { alto }
-               commands {
-%                      meter 2*4
-                       clef "alto"
-                       key $fis$
-                       skip 56:0
-                       key $bes es as$
-                       skip 8:0
-%                      meter 6*8
-                       skip 8:0
-%                      meter 2*4
-                       skip 16:0
-                       key $fis$
-               }
        }
        staff { 
                melodic 
                music { violin1 }
-               commands {
-%                      meter 2*4
-                       clef "violin"
-                       key $fis$
-                       skip 56:0
-                       key $bes es as$
-                       skip 8:0
-%                      meter 6*8
-                       skip 8:0
-%                      meter 2*4
-                       skip 16:0
-                       key $fis$
-               }
        }
        staff { 
                melodic 
                music { violin2 }
-               commands {
-%                      meter 2*4
-                       clef "violin"
-                       key $fis$
-                       skip 56:0
-                       key $bes es as$
-                       skip 8:0
-%                      meter 6*8
-                       skip 8:0
-%                      meter 2*4
-                       skip 16:0
-                       key $fis$
-               }
        } 
        staff { 
                melodic 
                music { cello }
-               commands {
-%                      meter 2*4
-                       clef "bass"
-                       key $fis$
-                       skip 56:0
-                       key $bes es as$
-                       skip 8:0
-%                      meter 6*8
-                       skip 8:0
-%                      meter 2*4
-                       skip 16:0
-                       key $fis$
-               }
        } 
        commands {
-               meter 2*4
-               skip 56:0
-               bar "||"
-               skip 8:0
-               meter 6*8
-               bar "||"
-               skip 8:0
-               meter 2*4
-               bar "||"
-               skip 16:0
-               bar "||"
+               meter {2*4}
+               key $fis$
+               skip 56*2
+               key $bes es as$
+               skip 8*2
+               meter {6*8}
+               skip 48*8
+               meter {2*4}
+               skip 16*2
+               key $fis$
        }
        paper {
 %              unitspace 16mm
index e3b1e50e0663cf9ff171f6bfb9de542bb07297dc..4f0b3b8812b390b1b3bbdc4e74a67997fe3597f0 100644 (file)
@@ -15,6 +15,7 @@ staff {
        melodic
        music{  $
        \octave { ' }
+       \key{  fis cis }
        \duration { 8 }
 
 % 1
@@ -39,8 +40,8 @@ staff {
        e4( fis4 () [fis e fis gis]     |
        cis4 `b4())`b8 r8 r4^"tr\`es soutenu"   |
 
      \command { \meter 2 *4 } r4 r4  |
      \command { \meter 4 *4 }
\meter {2 *4} r4 r4   |
\meter {4 *4}
        'cis4_"\dyn ppp"( 'd4 () ['d 'cis 'd 'e] |
        a4 )gis2.       |
        a4 (b4()[b a b 'cis]    |
@@ -76,8 +77,9 @@ staff {
        | [f a 'c] \plet{1/1} 'e4-^ () ['e f-> a-> 'c->]        |
        'e4._"sf" 'e8()'c4 r4 |
        r1      |
-       \command { \meter 2 *4 } r4 r4-\fermata
-       \command { \meter 4 *4 }
+       \meter {2 *4}
+       r4 r4-\fermata
+       \meter {4 *4}
 
        \octave { ' }
        |d2(( [)d e cis `b]     |
@@ -94,10 +96,7 @@ staff {
        )b [fis a b ] 'cis4 b4  |
        fis2 r2 |
        r1-\fermata     
-               $}
-       commands {      
-               key  $fis cis $
-       }
+       $}
 }
 score {
        staff {
@@ -110,14 +109,12 @@ score {
                width 12cm
        }
        commands  {
-               meter 4 *4
-               skip 18:0
-               skip 1:0
-               skip 20:0
+               meter {4 *4}
+               skip 39*1
                bar "|:"
-               skip 10:0
+               skip 10*1
                bar ":|"
-               skip 13:0
+               skip 13*1
                bar "||"
        }
 }
\ No newline at end of file
diff --git a/input/rhythm.ly b/input/rhythm.ly
new file mode 100644 (file)
index 0000000..c74c9d8
--- /dev/null
@@ -0,0 +1,60 @@
+%
+%      I've got rhythm!
+%
+% add any impressive examples here, please
+
+ritme = staff {
+       melodic
+
+       music { $
+       c8                                      |
+
+       [a8() a8. a8 a16 a16 a16] c4.           |       % watch the beams!
+        r32 r32 r16 r8 r4 r2                   |
+       \meter{  5*16}
+
+       % divide measure in 5 equal parts. Usually it 2+3 or 3+2
+       \grouping { 5*16 }      
+       [c8 c16 c8 ]                            |       % watch THIS!
+       \plet{5/4} [c16 c16 c16 c16]\plet{1/1} |
+       \meter{  2*8}
+       c4                              |
+       c4      c4      c4      c4
+       \meter {4*4}
+       c1 c1 c1
+       
+%      [c16 c16 c16 c16 ]                      |
+%      [c16 c16 c16 c16 c16 ]                  |
+%      [c16 c16 c16 c16 c16 ]                  |       
+       
+       $ }
+
+       commands {      % override "commands" section of Score.
+               partial 1*8
+               meter{ 4*4}
+       }
+}
+another = staff {
+       melodic
+       music { $
+               c1 c1 c1 c4 c4 c4 c4  {\meter 4*4} c1 c1 c1
+       $ }
+}
+
+yanother = staff {
+       melodic
+       music { $
+               c1 c1 c1 c4 c4 c4 c4  c1 c1 c1
+       $ }
+}
+
+score {
+       staff{ritme}
+       staff { another }
+       staff { yanother }
+       commands { meter {4*4 }}
+       paper {
+               unitspace 2cm
+               geometric 1.3
+       }
+}
\ No newline at end of file
index 97d8dd89cb045899cbb9139330df044ae6b7578b..fba2c9ff4d3e63f2d686b1658ea73dc845a81546 100644 (file)
@@ -41,9 +41,8 @@ c1
        |['c b a g][f e d c]
                        
                $}
-       commands {      
-       }
 }
+
 score {
        staff {
        blah
@@ -54,11 +53,8 @@ score {
                geometric 1.4
        }
        commands  {
-                meter 6*8
-                skip 6:0
-               meter 4*4
-               skip 2:0
-               skip 11:0
-
+                meter {6*8}
+                skip 36*8
+               meter {4*4}
        }
 }
index 2e7358db481ce9ef595b1606d3e4dd4462efe69c..00fde25284e75671c79334cebae0054041d51e55 100644 (file)
@@ -28,7 +28,8 @@
 %              % because piece is set very tightly
 %%1            % double comments are included in .tex file
 ii_menuetto = music {
-       $
+       $\clef"alto"
+       \key {bes}
        \octave{}
        \duration{8}
        { a2 f2 d2_"\f" } bes4-.  |
@@ -59,7 +60,7 @@ ii_menuetto = music {
 %      { 'cis2.-\upbow e2. `a2.\stemdown } :||:
        { 'cis2.-\upbow e2. `a2. } | % :||:
 %%9
-%      \clef "violin"
+       \clef "violin"
 %      { 'e2 a2_f\stemdown }
        { 'e2 a2_"\f" }
        [ 'd( 'e16 )'f16 ] |
@@ -76,7 +77,8 @@ ii_menuetto = music {
 % %13
 %      { bes2\stemup g4\stemdown } ( )  f4
 %      { 'c4\stemup e4\stemdown }
-%      { bes2 g4 } f4 { 'c4 e4 } | % \clef "alto" |
+%      { bes2 g4 } f4 { 'c4 e4 } |
+       \clef "alto"% 
        { \multivoice
                \music { \stem{1} bes2 'c4 }
                \music { \stem{-1} g4(\stem{-1}) f4 e4 }% ugh
@@ -125,24 +127,15 @@ ii_menuetto = music {
 score {
        staff { 
                melodic music { ii_menuetto }
-               commands {
-                       key $bes$
-                       clef "alto"     
-                       skip 8:0
-                       clef "violin"
-                       skip 5:0
-                       clef "alto"
-                       skip 12:0
-               }
        }
        commands {
-               meter 3*4
-               skip 8:0
+               meter {3 * 4}
+               skip {24 * 4}% 8 measures
                bar ":|:"
-%              clef "violin"
-               skip 5:0
-%              \clef "alto" 
-               skip 12:0
+
+               skip {15 * 4} % 5 meas.
+
+               skip {36*4}
                bar ":||"
        }
        paper {
@@ -153,4 +146,4 @@ score {
                geometric 1.4
                output "scsii-menuetto.out"
        }
-}
+o}
index 279cd513be7d13dedf171f1cc24436444f5c427a..edc487c9b06999704cf9a201020eb9d462446cc2 100644 (file)
@@ -35,7 +35,7 @@
 %#%%
 %#%\duration8
 %%1
-melodie = music { $ 
+melodie = music { $ \clef\violin
        \duration{ 8 }
        r_"\pp" { [ d `a-| } f-| { d `a-| } f-| { d `a-| ] } |
 %%2
@@ -194,7 +194,8 @@ melodie = music { $
 $ }
 
 begeleiding = music { $
-       \duration{2}
+\clef\bass
+\duration{2}
        `d r4
 %%2
        ``bes r4
@@ -472,26 +473,19 @@ score {
        staff { 
                melodic 
                music { melodie }
-               commands {
-                       key $bes$
-                       clef "violin"
-               }
        }
        staff { 
                melodic 
                music { begeleiding }
-               commands {
-                       key $bes$
-                       clef "bass"
-               }
        }
        commands { 
-               meter 3*4 
-               skip 4:0
+               meter { 3*4 }
+               key $bes$
+               skip 12*4
                bar ":|"
-               skip 32:0
+               skip 96*4
                bar ":|"
-               skip 22:0
+               skip 66*4
                bar "||"
        }
        paper {
index 80b8be6eee4ed9dc6e4b3f1710eaf50de39c65c8..9b081c43fab54d3900d09f9a65e4bf45915eca40 100644 (file)
@@ -5,7 +5,7 @@
 % Copyright: none
 
 melodie = music {
-       $
+       $\clef\violin
        c c | g g | a a | g g |
        f f | e e | d d8.( e16 | )c2 | % :|
 
@@ -19,7 +19,7 @@ melodie = music {
 }
 
 begeleiding = music {
-       $
+       $\clef \bass
        \octave{`}
        c 'c | 'e 'c | 'f 'c | 'e 'c | 
        'd b | 'c a | f g | c2 | 
@@ -106,13 +106,11 @@ text3 = music {
 mstaf = staff {
        melodic
        music { melodie }
-       commands { clef "violin" }
 }
 
 bass_staf = staff {
        melodic 
        music { begeleiding }
-       commands { clef "bass" }
 }
 
 
@@ -151,8 +149,8 @@ score {
                unitspace 2.5cm
        }
        commands {
-               meter 2 * 4
-               skip 24:0
+               meter {2 * 4}
+               skip 24*2
                bar "||"
        }
 }
index 5a307d847d8139c59d01c44daf1c2c1ce46e34a1..6c471fc95f1f1efb98b944b50004021b7abae696 100644 (file)
@@ -8,11 +8,12 @@
 #include "inputscore.hh"
 #include "main.hh"
 #include "keyword.hh"
-#include "inputcommand.hh"
 #include "debug.hh"
 #include "parseconstruct.hh"
 #include "dimen.hh"
 #include "identifier.hh"
+#include "commandrequest.hh"
+#include "musicalrequest.hh"
 
 #ifndef NDEBUG
 #define YYDEBUG 1
@@ -31,9 +32,8 @@ int fatal_error_i = 0;
 %union {
     Request * request;
     Real real;
-    Input_command *command;
     Identifier *id;    
-    Voice *voice;    
+   Voice *voice;    
     Voice_element *el; 
     String *string;
     const char *consstr;
@@ -47,9 +47,8 @@ int fatal_error_i = 0;
        Moment *moment;
 
     Array<String> * strvec;
-    Array<Input_command*> *commandvec;
     Array<int> *intvec;
-
+    Array<Melodic_req*> *melreqvec;
     Input_staff *staff;    
     Input_score *score;
     Symtables * symtables;
@@ -69,7 +68,7 @@ int fatal_error_i = 0;
 %token KEY CLEF  TABLE  VOICES STEM
 %token PARTIAL MUSIC GROUPING CADENZA
 %token END SYMBOLTABLES TEXID TABLE NOTENAMES SCRIPT TEXTSTYLE PLET
-%token MARK GOTO
+%token  GOTO
 
 %token <id>  IDENTIFIER
 %token <string> PITCHMOD DURATION RESTNAME
@@ -79,7 +78,7 @@ int fatal_error_i = 0;
 
 %token <i> DOTS INT
 %type <real> unit
-%type <intvec> pitch_list 
+%type <melreqvec> pitch_list 
 %type <c> open_request_parens close_request_parens
 %type <id> declaration
 %type <string> declarable_identifier
@@ -88,15 +87,13 @@ int fatal_error_i = 0;
 %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
-%type <command> score_command staff_command position_command
+%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> int_list intastint_list
-%type <commandvec> score_commands_block score_commands_body
-%type <commandvec> staff_commands_block staff_commands_body
-%type <request> post_request pre_request 
+%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
@@ -145,7 +142,7 @@ declarable_identifier:
 declaration:
        declarable_identifier '=' staff_block  {
                $$ = new Staff_id(*$1, $3);
-               delete $1; // this sux
+               delete $1; 
        }
        | declarable_identifier '=' music_voice {
                $$ = new M_voice_id(*$1, $3);
@@ -172,7 +169,7 @@ declaration:
                delete $1;
        }
        | declarable_identifier error '}' {
-//             warning( "parse error", lexer->here_ch_c_l() );
+
        }
        ;
 
@@ -195,13 +192,13 @@ notename_tab_body:                                {
 /*
        SCORE
 */
-score_block: SCORE 
-               { define_spots.push(lexer->here_ch_c_l()); }
-       '{' score_body '}'      {
+score_block:
+       SCORE { define_spots.push(lexer->here_ch_c_l()); }
+       /*cont*/ '{' score_body '}'     {
                $$ = $4;
                $$->defined_ch_c_l_ = define_spots.pop();
-               if (!$$->paper_)
-                       $$->paper_ = default_paper();
+               if (!$$->paper_p_)
+                       $$->paper_p_ = default_paper();
 
                /* handle error levels. */
                $$->errorlevel_i_ = lexer->errorlevel_i_;
@@ -213,68 +210,15 @@ score_body:               {
                $$ = new Input_score; 
        }
        | score_body staff_block        { $$->add($2); }
-       | score_body score_commands_block       {
-               $$->add(*$2);
-               delete $2;
+       | score_body COMMANDS '{' music_voice_body '}'          {
+               $$->set($4);
        }
        | score_body paper_block                { $$->set($2);  }
-       ;
-/*
-       COMMANDS
-*/
-score_commands_block:
-       COMMANDS '{' score_commands_body '}' { $$ =$3;}
-       | COMMANDS '{' error '}' {
-//             warning( "parse error", lexer->here_ch_c_l() );
-       }
-       ;
-
-score_commands_body:                   { $$ = new Array<Input_command*>; }
-       | score_commands_body score_command             {
-               $$->push($2);
-       }
-       | score_commands_body position_command          {
-               $$->push($2);
-       }
-       ;
-
-staff_commands_block: COMMANDS '{' staff_commands_body '}'     {       
-               $$ = $3; }
-       ;
-
-staff_commands_body:
-       /* empty */                     { $$ = new Array<Input_command*>; }
-       | staff_commands_body staff_command     {
-               $$->push($2);
-       }
-       | staff_commands_body position_command  {
-               $$->push($2);
-       }
-       ;
+       | score_body error {
 
-staff_command:
-       KEY pitch_list  {/*UGH*/
-               $$ = get_key_interpret_command(*$2);
-               delete $2;
-       }
-       | CLEF STRING                   {
-               $$ = get_clef_interpret_command(*$2);
-               delete $2;
-       }
-       ;
-
-position_command:
-       SKIP int ':' duration_length            {
-               $$ = get_skip_command($2, *$4);
-               delete $4;
-       }
-       | GOTO STRING   {
-               $$ = get_goto_command(*$2);
-               delete $2;
        }
        ;
 
-
 intastint_list:
        /* */   { $$ =new Array<int>; }
        | intastint_list int '*' int    {
@@ -282,28 +226,6 @@ intastint_list:
        }
        ;
 
-score_command:
-       BAR STRING                      {
-               $$ = get_bar_command(*$2);
-               delete $2;
-       }
-       | METER  int '*' int            {
-               $$ = get_meterchange_command($2, $4);
-       }
-       | PARTIAL duration_length               {
-               $$ = get_partial_command(*$2);
-               delete $2;
-       }
-       | GROUPING intastint_list               {
-               $$ = get_grouping_command(*$2);
-               delete $2;
-       }
-       | CADENZA int   {
-               $$ = get_cadenza_toggle($2);
-       }
-       ;
-
-
 
 /*
        PAPER
@@ -326,7 +248,7 @@ paper_body:
        | paper_body UNITSPACE dim      { $$->whole_width = $3; }
        | paper_body GEOMETRIC REAL     { $$->geometric_ = $3; }
        | paper_body error {
-//             warning( "parse error", lexer->here_ch_c_l() );
+
        }
        ;
 
@@ -353,16 +275,14 @@ staff_init:
 
 staff_body:
        staff_init
+       | staff_body COMMANDS '{' music_voice_body '}'  {
+               $$->set_score_wide($4);
+       }
        | staff_body music      {
                $2->set_default_group( "staff_music" + String($$->music_.size()));
                $$->add($2);
        }
-       | staff_body staff_commands_block {
-               $$->add(*$2);
-               delete $2;
-       }
        | staff_body error {
-//             warning( "parse error", lexer->here_ch_c_l() );
        }
        ;
 
@@ -393,7 +313,6 @@ music_voice_body:
                $$->add($2);
        }
        | music_voice_body error {
-//             warning( "parse error", lexer->here_ch_c_l() );
        }
        ;
 
@@ -411,13 +330,12 @@ music_chord_body:
                $$->concatenate($2->mchord(true));
        }
        | music_chord_body music {
-               $$ -> add($2);
+               $$->add($2);
        }
        | music_chord_body full_element {
                $$ ->add_elt($2);
        }
        | music_chord_body error {
-//             warning( "parse error", lexer->here_ch_c_l() );
        }
        ;
 
@@ -431,40 +349,77 @@ full_element:     pre_requests voice_elt post_requests {
                add_requests($2, post_reqs);
                $$ = $2;
        }
-       | MARK STRING   {
-               $$ = get_mark_element(*$2);
+       | lyrics_elt
+       | command_elt
+       ;
+
+command_elt:
+       command_req     {
+               $$ = new Voice_element;
+               $$->add($1);
+               $1-> defined_ch_c_l_ = lexer->here_ch_c_l();
+       }
+/* can't do this, since "| |" has  shift/reduce conflict. :
+       command_elt command_req { .. }
+*/
+       ;
+
+command_req:
+        '|'                            { 
+               $$ = new Barcheck_req;
+       }
+       | BAR STRING                    {
+               $$ = new Bar_req(*$2);
+               delete $2;
+       }
+       | METER '{' int '*' int '}'     {
+               Meter_change_req *m = new Meter_change_req;
+               m->set($3,$5);
+               $$ = m;
+       }
+       | SKIP duration_length {
+               Skip_req * skip_p = new Skip_req;
+               skip_p->duration_ = *$2;
                delete $2;
+               $$ = skip_p;
        }
-       | COMMAND '{' staff_command '}' { $$=get_command_element($3); }
-       | COMMAND '{' score_command '}' { $$=get_command_element($3); }
-       | '|'                           { 
-               req_defined_ch_c_l = lexer->here_ch_c_l();
-               $$ = get_barcheck_element(); 
+       | CADENZA int   {
+               $$ = new Cadenza_req($2);
+       }
+       | PARTIAL duration_length       {
+               $$ = new Partial_measure_req(*$2);
+               delete $2;
        }
        | STEM '{' int '}'              {
-               req_defined_ch_c_l = lexer->here_ch_c_l();
-               $$ = get_stemdir_element($3);
+               $$ = get_stemdir_req($3);
+       }
+       | CLEF STRING {
+               $$ = new Clef_change_req(*$2);
+               delete $2;
+       }
+       | KEY '{' pitch_list '}'        {       
+               Key_change_req *key_p= new Key_change_req;
+               key_p->melodic_p_arr_ = *$3;
+               $$ = key_p;
+               delete $3;
+       }
+       | GROUPING '{' intastint_list '}' {
+               $$ = get_grouping_req(*$3); delete $3;
        }
-       | lyrics_elt
-/*
-+      | pre_requests voice_elt post_requests error '|' { 
-+              warning( "parse error", lexer->here_ch_c_l() );
-+      }
-+ */
        ;
-               
+
 post_requests:
        {
                assert(post_reqs.empty());
        }
        | post_requests post_request {
+               $2->defined_ch_c_l_ = lexer->here_ch_c_l();
                post_reqs.push($2);
        }
        ;
 
 post_request:
        close_request_parens    { 
-               req_defined_ch_c_l = lexer->here_ch_c_l();
                $$ = get_request($1); 
        }
        | script_req
@@ -473,22 +428,18 @@ post_request:
 
 close_request_parens:
        '('     { 
-               req_defined_ch_c_l = lexer->here_ch_c_l();
                $$='(';
        }
        | ']'   { 
-               req_defined_ch_c_l = lexer->here_ch_c_l();
                $$ = ']';
        }
        ;
   
 open_request_parens:
        ')'     { 
-               req_defined_ch_c_l = lexer->here_ch_c_l();
                $$=')';
        }
        | '['   {
-               req_defined_ch_c_l = lexer->here_ch_c_l();
                $$='[';
        }
        ;
@@ -552,6 +503,7 @@ script_dir:
 pre_requests:
        | pre_requests pre_request {
                pre_reqs.push($2);
+               $2->defined_ch_c_l_ = lexer->here_ch_c_l();
        }
        ;
 
@@ -665,13 +617,15 @@ lyrics_elt:
 
 /*
        UTILITIES
-*/
+ */
 pitch_list:                    {
-               $$ = new Array<int>;
+               $$ = new Array<Melodic_req*>;
        }
        | pitch_list NOTENAME   {
-               $$->push($2[0]);
-               $$->push($2[1]);                
+               Melodic_req *m_p = new Melodic_req;
+               m_p->notename_i_ = $2[0];
+               m_p->accidental_i_ = $2[1];
+               $$->push(m_p);
        }
        ;
 
@@ -696,14 +650,6 @@ real:
        ;
        
 
-int_list:              {
-               $$ = new Array<int>;
-       }
-       | int_list int          {
-               $$->push($2);
-       }
-       ;
-
 
 dim:
        real unit       { $$ = $1*$2; }
@@ -784,8 +730,6 @@ dinterval: dim      dim             {
 void
 yyerror(const char *s)
 {
-//     if ( YYRECOVERING() ) 
-//             return;
        lexer->LexerError(s);
 
        if ( fatal_error_i )
@@ -816,7 +760,8 @@ parse_file(String init, String s)
    delete lexer;
    lexer = 0;
 
-   assert(define_spots.empty());
+   if(!define_spots.empty())
+       warning("Braces don't match.",0);
 }
 
 Paperdef*
index 1e3e2f67d495cf59dade64ff5ee47ae4beda1571..e6696acf39966b4a25c72a77f70d89f67d898370 100644 (file)
@@ -46,6 +46,14 @@ Ineq_constrained_qp::eval (Vector v)
 {
     return v * quad * v + lin * v + const_term;
 }
+
+/**
+    eliminate appropriate variables, until we have a Ineq_constrained_qp
+    then solve that.
+
+    PRE
+    cons should be ascending
+    */
 Vector
 Mixed_qp::solve(Vector start) const 
 {
@@ -65,6 +73,8 @@ Mixed_qp::solve(Vector start) const
 
 /*
     assume x(idx) == value, and adjust constraints, lin and quad accordingly
+
+    TODO: add const_term
     */
 void
 Ineq_constrained_qp::eliminate_var(int idx, Real value)
@@ -118,15 +128,6 @@ Ineq_constrained_qp::print() const
 
 /* *************** */
 
-/*
-    eliminate appropriate variables, until we have a Ineq_constrained_qp
-    then solve that.
-
-    PRE
-    cons should be ascending
-    */
-
-
 Mixed_qp::Mixed_qp(int n)
     : Ineq_constrained_qp(n)
 {
index ed49c2a02f8a5d2c6e3e0962a8a1f69dd78756ce..5738be2f3b0223c9236af8e481e72685f2f0bc17 100644 (file)
@@ -133,7 +133,7 @@ Active_constraints::Active_constraints(Ineq_constrained_qp const *op)
     H=chol.inverse();
 }
 
-/* Find the optimum which is in the planes generated by the active
+/** Find the optimum which is in the planes generated by the active
     constraints.        
     */
 Vector
@@ -158,8 +158,8 @@ min_elt_index(Vector v)
     return idx;
 }
 
-///the numerical solving
-/** Mordecai Avriel, Nonlinear Programming: analysis and methods (1976)
+
+/**the numerical solving. Mordecai Avriel, Nonlinear Programming: analysis and methods (1976)
     Prentice Hall.
 
     Section 13.3
@@ -183,8 +183,9 @@ Ineq_constrained_qp::solve(Vector start) const
     
     Vector x(start);
     Vector gradient=quad*x+lin;
-
-
+//    Real fvalue = x*quad*x/2 + lin*x + const_term;
+// it's no use.
+    
     Vector last_gradient(gradient);
     int iterations=0;
     
index 2a1f99e21a8adfffb1e7b88b0c4fdf216a264a15..b11386afec05672dfee0ebdf0d3b5bf5cf086d9b 100644 (file)
@@ -10,9 +10,9 @@
 
 const int STEMLEN=7;
 NAME_METHOD(Stem);
+
 Stem::Stem(int c) //, Moment len)
 {
-//    note_length = len;
     beams_left = 0;
     beams_right = 0;
     minnote = 1000;            // invalid values
@@ -188,7 +188,7 @@ Stem::brew_molecule_p()const return out;
 Real
 Stem::hpos()const
 {
-    return pcol_l_->hpos + stem_xoffset;
+    return pcol_l_->hpos + stem_xoffset; // hmm.  + offset_.x;
 }