]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.10
authorfred <fred>
Sun, 24 Mar 2002 19:57:00 +0000 (19:57 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:57:00 +0000 (19:57 +0000)
init/table_twenty.ly [deleted file]
input/standchen.ly [deleted file]
input/standchen.tex [deleted file]
mi2mu/include/my-midi-lexer.hh [deleted file]
mi2mu/include/my-midi-parser.hh [deleted file]
mi2mu/midi-lexer.l [deleted file]
mi2mu/midi-parser.y [deleted file]
mi2mu/my-midi-lexer.cc [deleted file]
mi2mu/my-midi-parser.cc [deleted file]

diff --git a/init/table_twenty.ly b/init/table_twenty.ly
deleted file mode 100644 (file)
index e4a5f78..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-%
-% spacing info for LilyPond. Do not edit this.
-% It has a lot of hard-wired stringconstants
-%
-
-table_twenty = \symboltables {
-
-    texid      "\musixtwentydefs"
-
-     "style" = \table {
-               "roman" "\settext{%}" 0pt 0pt 0pt 0pt
-               "italic"        "\setitalic{%}" 0pt 0pt 0pt 0pt
-     }
-     "align" = \table {
-               "-1"    "\leftalign{%}" 0pt 0pt 0pt 0pt
-               "0"     "\centeralign{%}" 0pt 0pt 0pt 0pt
-               "1"     "\rightalign{%}" 0pt 0pt 0pt 0pt
-       }
-
-
-    % index TeXstring,         xmin xmax ymin ymax
-    % be careful with editing this:
-    % the "index" entry is hardwired into lilypond.
-
-    "clefs" = \table {
-           "violin"    "\violinclef"   0pt     16pt    -12.5pt 22.5pt
-           "bass"      "\bassclef"             0pt     16pt    0pt     20pt
-           "alto"      "\altoclef"             0pt     16pt    0pt     20pt
-           "tenor"     "\altoclef"             0pt     16pt    0pt     20pt
-           "violin_change"     "\cviolinclef"  0pt     16pt    -12.5pt 22.5pt
-           "bass_change"       "\cbassclef"    0pt     16pt    0pt     20pt
-           "alto_change"       "\caltoclef"    0pt     16pt    0pt     20pt
-           "tenor_change"      "\caltoclef"    0pt     16pt    0pt     20pt
-    }
-
-    "balls" = \table {
-           "1" "\wholeball"    0pt     7.5pt   -2.5pt  2.5pt
-           "2" "\halfball"     0pt     6pt     -2.5pt  2.5pt
-           "4" "\quartball"    0pt     6pt     -2.5pt  2.5pt
-    }
-
-    "slur" = \table {
-           "whole"     "\slurchar%{%}" 0pt     0pt     0pt     0pt
-           "half"      "\hslurchar%{%}"        0pt     0pt     0pt     0pt
-    }
-    "accidentals" = \table {
-           "-2"        "\flatflat"     0pt     10.2pt  -2.5pt 7.5pt
-           "-1"        "\flat"         0pt     6pt     -2.5pt 7.5pt
-           "0" "\natural"      0pt     6pt     -7.5pt 7.5pt
-           "1" "\sharp"                0pt     6pt     -7.5pt 7.5pt
-           "2" "\sharpsharp"   0pt     6pt     -2.5pt 7.5pt
-    }
-
-    "streepjes" = \table {
-           "toplines"  "\toplines{%}"  -3pt    9pt 0pt 0pt
-           "botlines"  "\botlines{%}"  -3pt    9pt 0pt 0pt
-    }
-
-    "bars" = \table {
-           "empty"     "\emptybar"     0pt     0pt     0pt     0pt
-           "|" "\maatstreep"   0pt     5pt     -12pt   12pt
-           "||"        "\finishbar"    0pt     2pt     -12pt   12pt
-    }
-
-    "rests" = \table {
-           "1" "\wholerest"            -5pt    1pt     -1pt    1pt
-           "2" "\halfrest"             -5pt    1pt     -1pt    1pt
-           "4" "\quartrest"            -5pt    2pt     -5pt    5pt
-           "8" "\eighthrest"           0pt     5pt     0pt     8pt
-           "16"        "\sixteenthrest"                0pt     6pt     0pt     12pt
-           "32"        "\thirtysecondrest"     0pt     6pt     0pt     16pt
-    }
-
-    "meters" = \table {
-           "C" "\fourfourmeter"                0pt     10pt    -5pt    5pt
-           "C2"        "\allabreve"            0pt     10pt    -5pt    5pt
-    }
-
-    % dims ignored for this table
-    "param" = \table {
-           "meter"     "\generalmeter{%}{%}"   -3pt    10pt    -5pt    5pt
-           "linestaf"  "\linestafsym{%}{%}"    
-           "stem"      "\stem{%}{%}"           
-            "fill"     "\hbox{}"
-    }
-
-    "dots" = \table {
-           "1" "\lsingledot"           0pt     8pt     -1pt    1pt
-           "2" "\ldoubledot"           0pt     12pt    -1pt    1pt
-           "3" "\ltripledot"           0pt     16pt    -1pt    1pt
-    }
-
-    "flags" = \table {
-           "8" "\eigthflag"            0pt     5pt     0pt     0pt     
-           "16"        "\sixteenthflag"                0pt     5pt     0pt     0pt
-           "32"        "\thirtysecondflag"     0pt     5pt     0pt     0pt
-           "-8"        "\deigthflag"           0pt     5pt     0pt     0pt
-           "-16"       "\dsixteenthflag"               0pt     5pt     0pt     0pt
-           "-32"       "\dthirtysecondflag"    0pt     5pt     0pt     0pt
-    }
-
-    "beamslopes" = \table {
-           "slope"     "\beamslope{%}{%}"
-           "horizontal"        "\rulesym{%}{%}"        
-    }
-
-}
-default_table = \symboltables { table_twenty }
diff --git a/input/standchen.ly b/input/standchen.ly
deleted file mode 100644 (file)
index e9daad7..0000000
+++ /dev/null
@@ -1,493 +0,0 @@
-\header{
-filename       standchen.ly
-title          St\"andchen (Serenade) "Leise flehen meine Lieder"
-opus           D. 957 No. 4
-composers      Franz Schubert (1797-1828)
-               Text by Ludwig Rellstab (1799-1860)
-enteredby      JCN
-copyright      public domain
-}
-%{
- Tested Features: multivoice, accents, lyrics, chords, piano music
-
-EndMudelaHeader
-%}
-
-\version "0.1.1";
-
-commands = \melodic{
-       \skip 2.*4;
-       \bar ":|";
-       \skip 2.*24;
-%      volta1
-       \skip 2.*8;
-%      volta2
-       \bar ":|";
-       \skip 2.*22;
-       \bar "|."; 
-       }
-
-melodie = \melodic{ 
-       \meter 3/4;
-       \clef "violin";
-       \key bes;
-       \octave c';
-       \duration 8;
-       r \pp < [ d 'a-| > f-| < d 'a-| > f-| < d 'a-| ] > |
-%%2
-       r < [ d 'bes-| > f-| < d 'bes-| > f-| < d 'bes-| ] > |
-%%3
-       \textstyle "italic";
-       r_"simile" < [ d 'bes > e < d 'bes > e < d 'bes ] >|
-       \textstyle "roman";
-       
-%%4
-       r < [ 'a cis > e < 'a cis > e < 'a cis ] > |
-%%5
-       [2/3 a~ bes a ]1/1 d'4. a |
-%%6
-       [2/3 g~ a g ]1/1 d'4 g r |
-
-%%7
-       a4.^> g [2/3 g~ f e ]1/1 |
-%%8
-       f2 r4 |
-%%9
-
-       < { a'4.~  g' [2/3 g'( f' )e' ]1/1 }
-       { cis'4. e'_"dolce" \plet 2/3; e' \plet 1/1; } > |
-%%10
-       < f'2. d'2. > |
-%%11
-       [2/3 a ~  bes a ]1/1 f'4. a |
-%%12
-       [2/3 g~   a g ]1/1 e'4. d' |
-%%13
-       c'4. bes [2/3 bes~   a g ]1/1 |
-%%14
-       a2 r 
-       < { d'~  c'4. g [2/3 bes a g ]1/1 }
-       { f \p ~  e4._"dolce" bes 
-               \plet 2/3; g
-               \plet 1/1; 
-       } > |
-%%16
-       < a2. f2. > |
-%%17
-       \textstyle "italic";
-       [ a8._"cresc." cis'16 ] f'4. e'
-       \textstyle "roman";|
-%%18
-       [ d'8. a16 ] f4. d |
-%%19
-%#%    c'\grace\stemup
-       [2/3 bes ~   a bes ]1/1 d'4. bes |
-%%20
-       a2. |
-%%21
-%#%    a\grace
-       [2/3 g~  fis g ]1/1 bes4.^> g |
-%%22
-       f!2. |
-%%23
-       [ a8. \mf cis'16 ] f'4. e' |
-%%24
-       [ d'8. a16 ] fis4. d |
-%%25
-       [2/3 b \mf~   ais b ]1/1 d'4. b |
-%%26
-       < a2. fis2. > |
-%%27
-       [2/3 e' \f~  dis' e' ]1/1 g'4. cis' |
-%%28
-       < d'2. fis2. > |
-%#%\volta1
-%%29
-       < { bes2( [ d'8.~ )bes16 ] }
-       { g2 \mf [ bes8. g16 ] } > |
-%%30
-       < { a4. [ a-. a-. a-. ] }
-       { fis4. [ fis-.( fis-. )fis-. ] } > |
-%%31 
-       < { a4. [ a-. a-. a-. ] }
-       { g4. [ cis-.( e-. )g-. ] } > |
-%%32
-       < a2 fis2 \pp > < a4 fis4 > |
-%%33
-       < { b2( [ d'8.~ )b16 ] }
-       { g2 [ b8. g16 ] } > |
-%%34
-       < { a4. [ a-. a-. a-. ] }
-       { fis4. [ fis-.( fis-. )fis-. ] } > |
-%%35
-       < { a4. [ a-. a-. a-. ] }
-       { g4. [ cis-.( e-. )g-. ] } > |
-%%36
-       < a2. fis2. > |
-%#%\volta2
-%%37
-       [ a8. a16 ] [ cis'8. cis'16 ] [ e'8. e'16 ] |
-%%38
-       d'4~  cis'4 r4 |
-%%39
-%#%    > a4. [ cis' e'8. >! d'16 ] |
-       a4. \> [ cis' e'8. \! d'16 ] |
-%%40
-       cis'2 r4 |
-%%41
-       < fis'4. \> cis'4. \f > e' [2/3 e'~  d' \! cis' ]1/1 |
-%%42
-       [ b8. cis'16 ] d'4^> b r |
-%%43
-
-       [ b8. \f cis'16 ] d'4^> b r |
-%%44
-       [ b8. \> cis'16 ] d'4^> b \! r |
-%%45
-       [2/3 b \p ~  ais b ]1/1 d'4. b |
-%%46
-       <a!2. fis2. > |
-%%47
-       [2/3 e' \f~  dis' e' ]1/1 g'4.^> cis' |
-%%48
-       \textstyle "italic";
-       < 
-       { fis2.~
-       %\group "+1"; 
-               \stem \down; f2. }
-       { d'2. ~ \stem \up;
-               d'4 r4_"decresc." d'4 } 
-       >
-       \textstyle "roman"; |
-%%50
-       < bes2. e2. > |
-%%51
-       < a2. cis2. > |
-%%52
-       < fis2 d2 > < a4 fis4 \pp > |
-%%53
-
-       < bes2 g2 > < [ d'8.^> bes8. > < bes16 g16 ] > |
-%%54
-       < { a4. [ a-. a-. a-. ] }
-       { fis4. [ fis-.( fis-. )fis-.] } > |
-%%55
-       < { a4. [ a-. a-. a-. ] }
-       { g4. [ cis-.( e-. )g-. ] } > |
-%%56
-       \textstyle "italic";
-       < a2. fis2._"dim." >
-       \textstyle "roman"; |
-%%57
-       < a2. fis2. > |
-%%58
-       < a2.^\fermata fis2. > |
-%#%\tighten
-}
-
-begeleiding = \melodic{ 
-       \meter 3/4;
-       \clef"bass";
-       \key bes;
-       \octave c';
-       \duration 2;
-       'd r4 |
-%%2
-       ''bes r4 |
-
-%%3
-       ''g r4 |
-
-%%4
-       ''a r4 |
-%%5
-\duration 8;
-       < \multi 2; { \stem \up;        
-               [ 'f 'a d 'a d 'a ] 
-               [ 'd 'e 'g 'e 'g 'e ] 
-               [ 'cis 'e 'g 'e 'g e ]
-               [ 'd 'a d 'a d 'a ]
-               }
-       { \stem \down; 
-               'd2 r4 
-                ''bes2 r4 
-                ''a2 r4
-                'd2 r4         
-       } >
-%%9
-       [ 'a e g e g e ] |
-%%10
-       [ 'd 'a d 'a d 'a ] |
-%%11
-       < \multi 2;     
-       { \stem \up;
-               [ 'f 'a d 'a d 'a ]
-               [ 'd 'e 'g 'e 'g 'e ] 
-               [ 'e 'g 'bes 'g 'bes 'g ] 
-               [ 'a c f c f c ]
-       } { \stem \down; 
-               'd2 r4 
-                ''bes2 r4
-                'c2 r4 
-                'f2 r4 } 
-       >
-%%15
-       [ 'c 'g 'bes 'g 'bes 'g ] |
-%%16
-       [ ''f 'c 'f 'c 'f 'c ] |
-       < \multi 2;
-       { \stem \up; 
-               [ ''a 'e 'g 'e 'g 'e ][ 'd 'a d 'a d 'a ]
-               [ ''bes 'f 'bes 'f 'bes 'f ][ ''f 'c 'f 'c 'f 'c ] }
-       { \stem \down; 
-               ''a2 r4
-               'd2 r4 
-               ''bes2 r4 
-               ''f2 r4 
-       } > 
-%%21
-       < [ 'e 'c > 'g c 'g c 'g ] |
-%%22
-       [ 'f 'a c 'a 'f 'c ] |
-       < \multi 2; {
-               \stem \up;
-               [ ''a 'e 'g 'e 'g 'e ] 
-               [ 'd 'fis 'a 'fis 'a 'fis ] 
-               [ ''g 'd 'b 'd 'b 'd ] 
-               [ 'd 'a d 'a d 'a ] 
-       }
-       {\stem \down;
-               ''a2 r4 
-               'd2 r4 
-               ''g2 r4 
-               'd2 r4 
-       }
-       >
-       < [ 'cis ''a > 'e 'a 'e 'a 'e ] |
-%%28
-       [ 'd 'a d 'a d 'a ] |
-%%29
-       [ 'd 'g 'bes 'g 'bes 'g ] |
-%#%\volta1
-%%30 
-       [ 'd 'fis 'a 'fis 'a 'fis ] |
-%%31
-       [ ''a 'e 'a 'e 'a 'e ] |
-%%32
-       [ 'd 'fis 'a 'fis 'a 'fis ] |
-%%33
-       [ 'd 'g 'b 'g 'b 'g ] |
-%%34
-       [ 'd 'fis 'a 'fis 'a 'fis ] |
-%%35
-       [ ''a 'e 'a 'e 'a 'e ] |
-%%36
-       [ 'd 'fis 'a 'fis 'a 'fis ] |
-%#%\volta2
-%%37
-       [ ''a 'e 'g 'e ''bes^> 'e ] |
-%%38
-       [ ''a < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a ] > |
-%%39
-       [ ''a 'e 'g 'e ''bes^> 'e ] |
-%%40
-       [ ''a < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a ] > |
-%%41
-       [ ''ais 'e 'fis 'e 'fis 'e ] |
-%%42
-       < [ 'd ''b > 'fis 'b 'fis 'b 'fis ] |
-%%43
-       < [ 'e ''b > 'g 'b 'g 'b 'g ] |
-%%44
-       < [ 'd ''b > 'fis 'b 'fis 'b 'fis ] |
-%%45
-       < \multi 2; { \stem \up; 
-               [ ''g 'd 'b 'd 'b 'd ] 
-               [ 'd 'a d 'a d 'a ] 
-       } {
-               \stem \down;
-               ''g2 r4
-               'd2 r4 
-       } >
-
-%%47
-       < [ 'cis ''a > 'e 'a 'e 'a 'e ] |
-%%48
-       [ 'd 'fis 'a 'fis 'a 'fis ] |
-%%49
-       [ 'd 'a d 'a d 'a ] |
-%%50
-       [ ''g 'e 'g 'e 'g 'e ] |
-%%51
-       [ ''a 'e 'g 'e 'g 'e ] |
-%%52
-       [ ''d 'd 'fis 'd 'fis 'd ] |
-%%53
-       [ 'd 'g 'bes 'g 'bes 'g ] |
-%%54
-       [ 'd 'fis 'a 'fis 'a 'fis ] |
-%%55
-       [ ''a 'e 'g 'e 'g 'e ] |
-%%56
-       [ ''d ''a 'd ''a 'd ''a ] |
-%%57
-       [ ''d ''a 'd ''a 'd ''a ]
-%%58
-       < 'd2.^\fermata ''d2. > |
- }
-
-
-tekstI = \lyric{
-       \meter 3/4;
-       \duration 4;
-       _ _ _
-       _ _ _
-       _ _ _
-       _ _ _
-% 5
-       [2/3 Lei- se8 ]1/1 fleh-4. en8 
-       [2/3 mei- ne8 ]1/1 Lie- der8 _8
-       Durch4. die8 [2/3 Nacht zu8 ]1/1 
-       dir;2 _    
-       _ _ _ 
-       _ _ _
-% 11
-       [2/3 In den8 ]1/1 stil-4. len8 
-       [2/3 Hain her-8 ]1/1 nie-4. der,8
-       Lieb4. chen,8 [2/3 komm zu8 ]1/1 
-       mir!2 _
-       _ _ _ 
-       _ _ _
-
-% 17
-       Fl\"us-8. ternd16 schlan-4. ke8 
-       Wip-8. fel16 rau-4. schen8
-       [2/3 In des8 ]1/1 Mon-4. des8 
-       Licht;2.
-       _ _ _ 
-       _ _ _
-
-% 23
-       Des8. Ver-16 r\"a-4. ters8 
-       feind-8. lich16 Lau-4. schen8
-       [2/3 F\"urch- te,8 ]1/1 Hol-4. de,8 
-       nicht.2.
-       _ _ _ 
-       _ _ _
-
-% volta 1
-% 29
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-
-% volta 2
-% 37
-       La\ss8. auch16 dir8. die16 Brust8. be-16
-       we- gen, _
-       Lieb-4. chen,8 h\"o-8. re16 
-       mich!2 _
-       Be-8. bend16 harr' ich8 _8
-       dir8. ent-16 ge- gen!8 _8
-       [2/3 Komm, be-8 ]1/1 gl\"u4. cke8 
-       mich!2.
-       _ _ _ _ _ _
-% 47
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-% 57
-       _ _ _ _ _ _ 
-       
-}
-
-tekstII = \lyric{
-    \meter 3/4;
-       \duration 4;
-       _ _ _
-       _ _ _
-       _ _ _
-       _ _ _
-% 5
-       [2/3 H\"orst die8 ]1/1 Nach-4. ti-8 
-       [2/3 gal- len8 ]1/1 schla- gen?8 _8
-       Ach!4. sie8 [2/3 fleh- en8 ]1/1 
-       dich,2 _
-       _ _ _ 
-       _ _ _
-
-% 11
-       [2/3 Mit der8 ]1/1 T\"o-4. ne8
-       [2/3 s\"u\ss- en8 ]1/1 Kla-4. gen8
-       Fleh-4. en8 [2/3 sie f\"ur8 ]1/1
-       mich.2 _
-       _ _ _ 
-       _ _ _
-
-% 17
-       Sie-8. ver-16 stehn4. des8
-       Bus-8. ens16 Seh-4. nen,8
-       [2/3 Ken- nen8 ]1/1 Lieb-4. es-8 
-       schmerz,2.
-       _ _ _ 
-       _ _ _
-
-% 23
-       R\"uh-8. ren16 mit4. den8 
-       Sil-8. ber-16 t\"o-4. nen8
-       [2/3 Jed- es8 ]1/1 wei-4. che8 
-       Herz.2.
-       _ _ _ 
-       _ _ _
-% volta 1
-% 29
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-
-% volta 2
-% 37
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _ 
-       _ _ _ _ _ _
-% 47
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-% 57
-       _ _ _ _ _ _ 
-       
-}
-
-\score{
-       <       
-               <       \id "Lyric" "1";
-                       \tekstI
-                        \tekstII
-               >
-               < \id "Piano" "";
-                       \multi 2;
-                       \melodic < \melodie \commands >
-                       \melodic < \begeleiding \commands >
-               >
-       >
-       \paper{
-               linewidth= 150.\mm;
-
-               gourlay_maxmeasures = 8.;
-               % on two pages...
-               unitspace= 9.\mm;
-               \output "standchen.out";
-       }
-       \midi{
-               \tempo 4 = 54;
-       }
-}
diff --git a/input/standchen.tex b/input/standchen.tex
deleted file mode 100644 (file)
index be919a0..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-\documentclass{article}         %UGH
-\usepackage{a4}
-\oddsidemargin-1in\advance\oddsidemargin7.5mm
-\evensidemargin\oddsidemargin
-\hsize210mm\vsize297mm % so what does a4 do, anyway?
-\textwidth\hsize\advance\textwidth-15mm
-\topmargin-1in\advance\topmargin10mm
-\textheight\vsize\advance\textheight-35mm
-\pagestyle{empty}
-\begin{document}
-\input lilyponddefs
-\input titledefs
-\def\interscoreline{\vskip3mm}
-\title{St\"andchen\normalsize\\[2ex](Serenade)}
-\composer{Franz Schubert (1797-1828)}
-\instrument{M\"a\ss ig} % heu
-%#%\tempo{M\"a\ss ig}
-\maketit
-\input standchen.out
-\end{document}
diff --git a/mi2mu/include/my-midi-lexer.hh b/mi2mu/include/my-midi-lexer.hh
deleted file mode 100644 (file)
index 7b8b809..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// my-midi-lexer.hh -- declare My_midi_lexer
-//
-// copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
-
-#ifndef MY_MIDI_LEXER_HH
-#define MY_MIDI_LEXER_HH
-
-#include <FlexLexer.h>
-#include "proto.hh"
-#include "varray.hh"
-#include "string.hh"
-
-int yylex();
-void yyerror(const char *s);
-
-/// (midi_lexer)
-class My_midi_lexer : yyFlexLexer {
-public:
-    My_midi_lexer (String& filename_str, Sources*);
-    ~My_midi_lexer();
-
-    int close_i();
-    void error (char const* sz_l);
-    char const* here_ch_C();
-    static int varint2_i (String str);
-    int yylex();
-    Source_file* source_file_l_ ;
-
-private:
-    int char_count_;
-    int running_status_i_;
-
-public: // ugh
-    int errorlevel_i_;
-};
-
-extern My_midi_lexer* midi_lexer_l_g;
-
-#endif // MY_MIDI_LEXER_HH
-
diff --git a/mi2mu/include/my-midi-parser.hh b/mi2mu/include/my-midi-parser.hh
deleted file mode 100644 (file)
index bcebb14..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// my-midi-parser.hh -- declare My_midi_parser
-//
-// copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
-
-#ifndef MY_MIDI_PARSER_HH
-#define MY_MIDI_PARSER_HH
-
-#include "mi2mu-proto.hh"
-#include "proto.hh"
-#include "plist.hh"
-#include "string.hh"
-#include "moment.hh"
-
-#include "string.hh"
-#include "moment.hh"
-
-int yyparse();
-
-/** 
-  An interface to the YACC midi parser.
-  (midi_parser)
- */
-class My_midi_parser {
-public:
-    My_midi_parser (String filename_str,Sources *);
-    ~My_midi_parser();
-
-    void add_score (Mudela_score* mudela_score_p);
-    void error (char const* sz_l);
-    int parse();
-    void forward (int i);
-    Moment at_mom();
-    void note_begin (int channel_i, int pitch_i, int dyn_i);
-    void note_end (int channel_i, int pitch_i, int aftertouch_i);
-    void note_end_all();
-
-    void reset();
-    void set_division_4 (int division_4_i);
-    void set_key (int accidentals_i, int minor_i);
-    void set_meter (int num_i, int den_i, int clocks_i, int count_32_i);
-    void set_tempo (int useconds_per_4_i);
-
-    int bar_i_;
-
-    // ugh
-    int track_i_;
-    String filename_str_;
-    String copyright_str_;
-    String instrument_str_;
-    String track_name_str_;
-
-    // ugh
-    Mudela_key* mudela_key_p_;
-    Mudela_meter* mudela_meter_p_;
-    Mudela_tempo* mudela_tempo_p_;
-
-    Mudela_staff* mudela_staff_l_;
-    Mudela_score* mudela_score_p_;
-    Mudela_column* mudela_column_l_;
-
-private:
-    Link_list<Mudela_note*> open_mudela_note_l_list_;
-
-    int division_1_i_;
-
-    char const* defined_ch_C_;
-    int fatal_error_i_;
-    My_midi_lexer* midi_lexer_p_;
-};
-
-extern My_midi_parser* midi_parser_l_g;
-
-#endif // MY_MIDI_PARSER_HH
-
diff --git a/mi2mu/midi-lexer.l b/mi2mu/midi-lexer.l
deleted file mode 100644 (file)
index 485312b..0000000
+++ /dev/null
@@ -1,522 +0,0 @@
-%{//-*-Fundamental-*-
-// midi-lexer.l
-
-/* 
-  yes, i know that midi is not really a (n evolving?) language,
-  and that using lex/yacc to parse midi is overkill, as well as
-  a grand example of misuse and asking for performance loss.
-
-  it is, however, quite robust, simple, and very easy to extend
-  incrementally.
- */
-
-/*
-  backup rules
-
-  after making a change to the lexer rules, run 
-      flex -b <this lexer file>
-  and make sure that 
-      lex.backup
-  contains no backup states, but only the reminder
-      Compressed tables always back up.
-  (don-t forget to rm lex.yy.cc :-)
- */
-
-#include "string-convert.hh"
-#include "mi2mu-global.hh"
-#include "mi2mu-proto.hh"
-#include "my-midi-lexer.hh"
-#include "midi-parser.hh"
-
-#define YY_USER_ACTION char_count_ += YYLeng(); // ugh
-
-%}
-
-%option c++
-%option noyywrap
-%option nodefault
-%option debug
-%option yyclass="My_midi_lexer"
-%option stack
-
-%x data
-%x event
-%x i8
-%x u8
-%x int16
-%x int32
-%x meta_event
-%x track
-
-U8             [\x00-\xff]
-I8             {U8}
-INT16          {U8}{U8}
-BACKUP_INT16_0 {U8}
-INT32          {INT16}{INT16}
-BACKUP_INT32_0 {U8}
-BACKUP_INT32_1 {U8}{U8}
-BACKUP_INT32_2 {INT16}{U8}
-INT7_8UNSET    [\x00-\x7f]
-INT7_8SET      [\x80-\xff]
-VARINT         {INT7_8SET}{0,3}{INT7_8UNSET}
-BACKUP_VARINT_0 {INT7_8SET}
-BACKUP_VARINT_1 {INT7_8SET}{INT7_8SET}
-BACKUP_VARINT_2 {INT7_8SET}{INT7_8SET}{INT7_8SET}
-
-HEADER         MThd
-TRACK          MTrk
-BACKUP_TOP_0   MT
-BACKUP_TOP_1   MTh
-BACKUP_TOP_2   MTr
-
-RUNNING_STATUS [\x00-\x5f]
-DATA_ENTRY     [\x60-\x79]
-ALL_NOTES_OFF  [\x7a-\x7f]
-NOTE_OFF       [\x80-\x8f]
-NOTE_ON                [\x90-\x9f]
-POLYPHONIC_AFTERTOUCH  [\xa0-\xaf]
-CONTROLMODE_CHANGE     [\xb0-\xbf]
-PROGRAM_CHANGE [\xc0-\xcf]
-CHANNEL_AFTERTOUCH     [\xd0-\xdf]
-PITCHWHEEL_RANGE       [\xe0-\xef]
-
-SYSEX_EVENT1   [\xf0]
-SYSEX_EVENT2   [\xf7]
-
-META_EVENT     [\xff]
-
-SEQUENCE       [\x00][\x02]
-YYTEXT         [\x01] 
-YYCOPYRIGHT    [\x02]
-YYTRACK_NAME   [\x03]
-YYINSTRUMENT_NAME      [\x04]
-YYLYRIC                [\x05]
-YYMARKER               [\x06]
-YYCUE_POINT    [\x07]
-
-END_OF_TRACK   [\x2f][\x00]
-TEMPO          [\x51][\x03]
-SMPTE_OFFSET   [\x54][\x05]
-TIME           [\x58][\x04]
-KEY            [\x59][\x02]
-SSME           [\0x7f][\x03]
-
-%%
-
-{HEADER} {
-       LOGOUT(DEBUG_ver) << "lex: header" << endl;
-       yy_push_state(int16); 
-       yy_push_state(int16); 
-       yy_push_state(int16); 
-       yy_push_state(int32); 
-       return HEADER;
-}
-
-{TRACK} {
-       LOGOUT(DEBUG_ver) << "lex: track" << endl;
-       yy_push_state(track); 
-       yy_push_state(int32); 
-       return TRACK;
-}
-{U8}   {
-       error(String("top level: header expected: ")
-               + String_convert::bin2hex_str(String(*YYText())));
-       exit(1);
-}
-{BACKUP_TOP_0} {
-       error(String("top level: header expected: ")
-               + String_convert::bin2hex_str(String(*(YYText()))));
-       exit(1);
-}
-{BACKUP_TOP_1} {
-       error(String("top level: header expected: ")
-               + String_convert::bin2hex_str(String(*(YYText()))));
-       exit(1);
-}
-{BACKUP_TOP_2} {
-       error(String("top level: header expected: ")
-               + String_convert::bin2hex_str(String(*(YYText()))));
-       exit(1);
-}
-<int32>{INT32} { // really signed? 
-       LOGOUT(DEBUG_ver) << "lex: int32" << endl;
-       assert(YYLeng() == 4);
-       String str((Byte const*)YYText(), YYLeng());
-       yylval.i = String_convert::bin2_i(str);
-       yy_pop_state();
-       return INT32;
-}
-<int32>{BACKUP_INT32_0} {
-       error(String("int32: int32 expected: ")
-               + String_convert::bin2hex_str(String(*(YYText()))));
-       exit(1);
-}
-<int32>{BACKUP_INT32_1} {
-       error(String("int32: int32 expected: ")
-               + String_convert::bin2hex_str(String(*(YYText()))));
-       exit(1);
-}
-<int32>{BACKUP_INT32_2} {
-       error(String("int32: int32 expected: ")
-               + String_convert::bin2hex_str(String(*(YYText()))));
-       exit(1);
-}
-<int16>{INT16} { // really signed?
-       LOGOUT(DEBUG_ver) << "lex: int16" << endl;
-       assert(YYLeng() == 2);
-       String str((Byte const*)YYText(), YYLeng());
-       yylval.i = (short)String_convert::bin2_i(str);
-       yy_pop_state();
-       return INT16;
-}
-<int16>{BACKUP_INT16_0} {
-       error(String("int16: int16 expected: ")
-               + String_convert::bin2hex_str(String(*(YYText()))));
-       exit(1);
-}
-<i8>{I8}       {
-       LOGOUT(DEBUG_ver) << "lex: i8" << endl;
-       assert(YYLeng() == 1);
-//     yylval.byte = *(signed char*)YYText();
-       yylval.i = *(signed char*)YYText();
-       yy_pop_state(); 
-       return I8;
-}
-<u8>{U8}       {
-       LOGOUT(DEBUG_ver) << "lex: u8" << endl;
-       assert(YYLeng() == 1);
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state(); 
-       return U8;
-}
-
-<track>{VARINT} {
-       String str((Byte const*)YYText(), YYLeng());
-       yylval.i = My_midi_lexer::varint2_i(str);
-       LOGOUT(DEBUG_ver) << String("lex: track: varint(") 
-               + String(yylval.i) + "): "
-               + String_convert::bin2hex_str(str) << endl;
-       yy_push_state(event); 
-       return VARINT;
-}
-<track>{U8}    {
-       error(String("track: illegal byte: ") 
-               + String_convert::bin2hex_str(String(*YYText())));
-       exit(1);
-}
-<track>{BACKUP_VARINT_0}{U8} {
-       error(String("track: varint expected: ")
-               + String_convert::bin2hex_str(String(*(YYText()))));
-       exit(1);
-}
-<track>{BACKUP_VARINT_1}{U8} {
-       error(String("track: varint expected: ")
-               + String_convert::bin2hex_str(String(*(YYText()))));
-       exit(1);
-}
-<track>{BACKUP_VARINT_2}{U8} {
-       error(String("track: varint expected: ")
-               + String_convert::bin2hex_str(String(*(YYText()))));
-       exit(1);
-}
-<event>{RUNNING_STATUS}        {
-//     yylval.byte = *(Byte*)YYText();
-//     yylval.i = *(Byte*)YYText();
-       yylval.i = running_status_i_;
-       LOGOUT(DEBUG_ver) << String ("lex: running status: ") + String(yylval.i) << endl;
-       /*
-        'running status' rather means 'missing status'.
-        we'll put the running status data back, prepend (unput) 
-        the running status, and try again.
-        */
-       yyless(0);
-       unput(running_status_i_);
-       return RUNNING_STATUS;
-}
-<event>{DATA_ENTRY}    {
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       LOGOUT(DEBUG_ver) << String ("lex: undefined data entry: ") + String(yylval.i) << endl;
-       yy_pop_state(); 
-       yy_push_state(u8);
-       return DATA_ENTRY;
-}
-<event>{ALL_NOTES_OFF} {
-       LOGOUT(DEBUG_ver) << "lex: all note off" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       LOGOUT(DEBUG_ver) << String ("lex: all notes off: ") + String(yylval.i) << endl;
-       yy_pop_state(); 
-       yy_push_state(u8);
-       yy_push_state(u8);
-       return ALL_NOTES_OFF;
-}
-<event>{NOTE_OFF}      {
-       LOGOUT(DEBUG_ver) << "lex: note off" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       running_status_i_ = yylval.i;
-       yy_pop_state(); 
-       yy_push_state(u8);
-       yy_push_state(u8);
-       return NOTE_OFF;
-}
-<event>{NOTE_ON}       {
-       LOGOUT(DEBUG_ver) << "lex: note on" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       running_status_i_ = yylval.i;
-       yy_pop_state(); 
-       yy_push_state(u8);
-       yy_push_state(u8);
-       return NOTE_ON;
-}
-<event>{POLYPHONIC_AFTERTOUCH} {
-       LOGOUT(DEBUG_ver) << "lex: polyphonic aftertouch" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       running_status_i_ = yylval.i;
-       yy_pop_state(); 
-       yy_push_state(u8);
-       yy_push_state(u8);
-       return POLYPHONIC_AFTERTOUCH;
-}
-<event>{CONTROLMODE_CHANGE}    {
-       LOGOUT(DEBUG_ver) << "lex: controlmode change" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       running_status_i_ = yylval.i;
-       yy_pop_state(); 
-       yy_push_state(u8);
-       yy_push_state(u8);
-       return CONTROLMODE_CHANGE;
-}
-<event>{PROGRAM_CHANGE}        {
-       LOGOUT(DEBUG_ver) << "lex: program change" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       running_status_i_ = yylval.i;
-       yy_pop_state(); 
-       yy_push_state(u8);
-       return PROGRAM_CHANGE;
-}
-<event>{CHANNEL_AFTERTOUCH}    {
-       LOGOUT(DEBUG_ver) << "lex: channel aftertouch" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       running_status_i_ = yylval.i;
-       yy_pop_state(); 
-       yy_push_state(u8);
-       yy_push_state(u8);
-       return CHANNEL_AFTERTOUCH;
-}
-<event>{PITCHWHEEL_RANGE} {
-       LOGOUT(DEBUG_ver) << "lex: pitchwheel range" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       running_status_i_ = yylval.i;
-       yy_pop_state(); 
-       yy_push_state(u8);
-       yy_push_state(u8);
-       return PITCHWHEEL_RANGE;
-}
-<event>{SYSEX_EVENT1} {        // len data
-       LOGOUT(DEBUG_ver) << "lex: sysex1" << endl;
-       yy_pop_state(); 
-       yy_push_state(data);
-       return SYSEX_EVENT1;
-}
-<event>{SYSEX_EVENT2} {        // len data
-       LOGOUT(DEBUG_ver) << "lex: sysex2" << endl;
-       yy_pop_state(); 
-//     yy_push_state(u8); //?
-       yy_push_state(data);
-       return SYSEX_EVENT2;
-}
-<event>{META_EVENT}    {
-       LOGOUT(DEBUG_ver) << "lex: meta" << endl;
-       yy_push_state(meta_event);
-       return META_EVENT;
-}
-<event>{U8}    {
-       error(String("event: illegal byte: ") 
-               + String_convert::bin2hex_str(String(*YYText())));
-       exit(1);
-}
-<meta_event>{SEQUENCE} {       // ssss sequence number
-       LOGOUT(DEBUG_ver) << "lex: sequence" << endl;
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state(int16);
-       return SEQUENCE;
-}
-<meta_event>{YYTEXT}   {               // len data
-       LOGOUT(DEBUG_ver) << "lex: text" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state(data);
-       return YYTEXT;
-}
-<meta_event>{YYCOPYRIGHT}      {
-       LOGOUT(DEBUG_ver) << "lex: copyright" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state(data);
-       return YYCOPYRIGHT;
-}
-<meta_event>{YYTRACK_NAME}     {
-       LOGOUT(DEBUG_ver) << "lex: track name" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state(data);
-       return YYTRACK_NAME;
-}
-<meta_event>{YYINSTRUMENT_NAME}        {
-       LOGOUT(DEBUG_ver) << "lex: instrument name" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state(data);
-       return YYINSTRUMENT_NAME;
-}
-<meta_event>{YYLYRIC}  {
-       LOGOUT(DEBUG_ver) << "lex: lyric" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state(data);
-       return YYLYRIC;
-}
-<meta_event>{YYMARKER} {
-       LOGOUT(DEBUG_ver) << "lex: marker" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state(data);
-       return YYMARKER;
-}
-<meta_event>{YYCUE_POINT}      {
-       LOGOUT(DEBUG_ver) << "lex: cue point" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state(data);
-       return YYCUE_POINT;
-}
-<meta_event>{TEMPO}    {       // tttttt usec
-       LOGOUT(DEBUG_ver) << "lex: tempo" << endl;
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state(u8);
-       yy_push_state(u8);
-       yy_push_state(u8);
-       return TEMPO;
-}
-<meta_event>{SMPTE_OFFSET}     {               // hr mn se fr ff
-       LOGOUT(DEBUG_ver) << "lex: smpte offset" << endl;
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state(u8);
-       yy_push_state(u8);
-       yy_push_state(u8);
-       yy_push_state(u8);
-       yy_push_state(u8);
-       return SMPTE_OFFSET;
-}
-<meta_event>{TIME}     {               // nn dd cc bb
-       LOGOUT(DEBUG_ver) << "lex: time" << endl;
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state(u8);
-       yy_push_state(u8);
-       yy_push_state(u8);
-       yy_push_state(u8);
-       return TIME;
-}
-<meta_event>{KEY}      {       // sf mi
-       LOGOUT(DEBUG_ver) << "lex: key" << endl;
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state(i8);
-       yy_push_state(i8);
-       return KEY;
-}
-<meta_event>{SSME}     {       // len data
-       LOGOUT(DEBUG_ver) << "lex: smme" << endl;
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state(data);
-       return SSME;
-}
-<meta_event>{END_OF_TRACK} {
-       LOGOUT(DEBUG_ver) << "lex: end of track" << endl;
-       yy_pop_state();
-       yy_pop_state();
-       yy_pop_state();
-       return END_OF_TRACK;
-}
-<meta_event>{U8} {
-       warning(String("meta_event: unimplemented event: ")
-               + String_convert::bin2hex_str(String(*YYText()))
-// huh?
-//             ,this->here_ch_C() 
-       );
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state(u8); 
-       yy_push_state(u8);
-       return U8;
-}
-
-<data>{VARINT} {
-       LOGOUT(DEBUG_ver) << "lex: data" << endl;
-       String str((Byte const*)YYText(), YYLeng());
-       int i = My_midi_lexer::varint2_i(str);
-       String* str_p = new String;
-       while (i--)
-               *str_p += (char)yyinput();
-       yylval.str_p = str_p;
-       yy_pop_state();
-       return DATA;
-}
-<data>{U8}     {
-       error(String("data: illegal byte: ")
-               + String_convert::bin2hex_str(String(*YYText())));
-       exit(1);
-}
-<data>{BACKUP_VARINT_0}{U8} {
-       error(String("data: varint expected: ")
-               + String_convert::bin2hex_str(String(*(YYText()))));
-       exit(1);
-}
-<data>{BACKUP_VARINT_1}{U8} {
-       error(String("data: varint expected: ")
-               + String_convert::bin2hex_str(String(*(YYText()))));
-       exit(1);
-}
-<data>{BACKUP_VARINT_2}{U8} {
-       error(String("data: varint expected: ")
-               + String_convert::bin2hex_str(String(*(YYText()))));
-       exit(1);
-}
-
-<<EOF>> {
-//     LOGOUT(NORMAL_ver) << "<<EOF>>";
-
-       if (!close_i())
-         yyterminate(); // can't move this, since it actually rets a YY_NULL
-}
-
-%%
-
diff --git a/mi2mu/midi-parser.y b/mi2mu/midi-parser.y
deleted file mode 100644 (file)
index c1ec3ed..0000000
+++ /dev/null
@@ -1,332 +0,0 @@
-%{
-
-#include "mi2mu-proto.hh"
-#include "proto.hh"
-#include "plist.hh"
-#include "warn.hh"
-#include "mi2mu-global.hh"
-//#include "midi-parser.hh"
-#include "my-midi-parser.hh"
-#include "my-midi-lexer.hh"
-#include "duration-convert.hh"
-#include "string-convert.hh"
-#include "mudela-item.hh"
-#include "mudela-score.hh"
-#include "mudela-staff.hh"
-
-#ifndef NDEBUG
-#define YYDEBUG 1
-#endif
-
-%}
-
-%union {
-    Byte byte;
-    char c;
-    int i;
-    String* str_p;
-    Mudela_item* mudela_item_p;        // Voice_element* ? jup, just about :-)
-    Mudela_score* mudela_score_p; // Input_score* ?
-    Mudela_staff* mudela_staff_p; // Input_music* ?
-}
-
-%token HEADER TRACK
-%token SYSEX_EVENT1 SYSEX_EVENT2
-%token META_EVENT
-%token SEQUENCE
-%token END_OF_TRACK TEMPO SMPTE_OFFSET TIME KEY SSME
-
-%token<i> I8 U8 INT16 INT32 INT7_8UNSET INT7_8SET VARINT
-%token<i> RUNNING_STATUS DATA_ENTRY ALL_NOTES_OFF
-%token<i> NOTE_OFF NOTE_ON 
-%token<i> POLYPHONIC_AFTERTOUCH CONTROLMODE_CHANGE PROGRAM_CHANGE 
-%token<i> CHANNEL_AFTERTOUCH PITCHWHEEL_RANGE
-%token<i> YYTEXT YYCOPYRIGHT YYTRACK_NAME YYINSTRUMENT_NAME YYLYRIC YYMARKER YYCUE_POINT
-%token<str_p> DATA
-
-%type <i> varint
-%type <mudela_score_p> header mudela_score
-%type <mudela_staff_p> track
-%type <mudela_item_p> item
-%type <mudela_item_p> the_item meta_item the_meta_item text_item mudela_item sysex_item
-%type <mudela_item_p> running_status data_entry all_notes_off
-%type <mudela_item_p> note_off note_on
-%type <mudela_item_p> polyphonic_aftertouch controlmode_change program_change
-%type <mudela_item_p> channel_aftertouch pitchwheel_range
-
-%%
-
-midi:  /* empty */
-       | midi mudela_score {
-               midi_parser_l_g->add_score ($2);                
-       }
-       ;
-
-mudela_score:
-       header {
-       }
-       | mudela_score track {
-               $$->add_staff ($2);
-               // ugh
-               $2->set_tempo (midi_parser_l_g->mudela_tempo_p_->useconds_per_4_i());
-               $2->set_meter (midi_parser_l_g->mudela_meter_p_->num_i(), 
-                       midi_parser_l_g->mudela_meter_p_->den_i(), 
-                       midi_parser_l_g->mudela_meter_p_->clocks_1_i(), 
-                       8);
-               if  (midi_parser_l_g->copyright_str_.length_i())
-                       $2->copyright_str_ = midi_parser_l_g->copyright_str_;
-               if  (midi_parser_l_g->track_name_str_.length_i())
-                       $2->name_str_ = midi_parser_l_g->track_name_str_;
-               if  (midi_parser_l_g->instrument_str_.length_i())
-                       $2->instrument_str_ = midi_parser_l_g->instrument_str_;
-               midi_parser_l_g->reset();
-       }
-       ;
-
-header:        
-       HEADER INT32 INT16 INT16 INT16 {
-               // ugh, already constructed; 
-               // need to have score in My_midi_parser...
-//             $$ = new Mudela_score ($3, $4, $5);
-               $$ = midi_parser_l_g->mudela_score_p_;
-               $$->format_i_ = $3;
-               $$->tracks_i_ = $4;
-               $$->tempo_i_ =  $5;
-               midi_parser_l_g->set_division_4 ($5);
-       }
-       ;
-
-track: 
-       TRACK INT32 {
-               LOGOUT (NORMAL_ver) << "\ntrack " << midi_parser_l_g->track_i_ << ": " << flush;
-               $$ = new Mudela_staff (midi_parser_l_g->track_i_++,
-                       // silly, cause not set yet!
-                       midi_parser_l_g->copyright_str_,
-                       midi_parser_l_g->track_name_str_,
-                       midi_parser_l_g->instrument_str_);
-               //ugh, need to know now!
-               midi_parser_l_g->mudela_staff_l_ = $$;
-       }
-       | track item {
-               if  ($2) {
-                       $2->mudela_column_l_ = midi_parser_l_g->mudela_column_l_;
-                       $$->add_item ($2);
-               }
-       }
-       ;
-
-item:  
-       varint the_item {
-               $$ = $2;
-               if  ($2) {
-                       String str = $2->str();
-                       if  (str.length_i())
-                               LOGOUT (DEBUG_ver) << str << " " << flush;
-               }
-       }
-       ;
-       
-varint:
-       VARINT {
-               midi_parser_l_g->forward ($1);
-       }
-       ;
-
-the_item: 
-       meta_item { 
-       }
-       | mudela_item {
-       }
-       | sysex_item {
-       }
-       ;
-
-meta_item:
-       META_EVENT the_meta_item {
-               $$ = $2;
-       }
-       |
-       META_EVENT U8 U8 U8 {
-               $$ = 0;
-       }
-       ;
-
-the_meta_item:
-       SEQUENCE INT16 {
-       }
-       | text_item DATA {
-               Mudela_text::Type type = (Mudela_text::Type)$1;
-               $$ = 0;
-               switch  (type)
-                       {
-                       case Mudela_text::COPYRIGHT:
-                               midi_parser_l_g->copyright_str_ = *$2;
-                               break;
-                       case Mudela_text::TRACK_NAME:
-                               midi_parser_l_g->track_name_str_ = *$2;
-                               break;
-                       case Mudela_text::INSTRUMENT_NAME:
-                               midi_parser_l_g->instrument_str_ = *$2;
-                               break;
-                       default:
-                               $$ = new Mudela_text (type, *$2);
-                               break;
-                       }
-               LOGOUT (DEBUG_ver) << *$2 << endl;
-               delete $2;
-       }
-       | END_OF_TRACK {
-               $$ = 0;
-       }
-       | TEMPO U8 U8 U8 { 
-               $$ = new Mudela_tempo ( ($2 << 16) +  ($3 << 8) + $4);
-               LOGOUT (DEBUG_ver) << $$->str() << endl;
-               midi_parser_l_g->set_tempo ( ($2 << 16) +  ($3 << 8) + $4);
-       }
-       | SMPTE_OFFSET U8 U8 U8 U8 U8 { 
-               $$ = 0;
-       }
-       | TIME U8 U8 U8 U8 { 
-               $$ = new Mudela_meter ($2, $3, $4, $5);
-               LOGOUT (DEBUG_ver) << $$->str() << endl;
-               midi_parser_l_g->set_meter ($2, $3, $4, $5);
-       }
-       | KEY I8 I8 { 
-               $$ = new Mudela_key ($2, $3);
-               midi_parser_l_g->set_key ($2, $3 );
-       }
-       | SSME DATA {
-               $$ = new Mudela_text ((Mudela_text::Type)0, *$2);
-               delete $2;
-       }
-       ;
-
-text_item: 
-       YYTEXT {
-               LOGOUT (DEBUG_ver) << "\n% Text: ";
-       }
-       | YYCOPYRIGHT {
-               LOGOUT (DEBUG_ver) << "\n% Copyright: ";
-       }
-       | YYTRACK_NAME {
-               LOGOUT (DEBUG_ver) << "\n% Track  name: ";
-       }
-       | YYINSTRUMENT_NAME {
-               LOGOUT (DEBUG_ver) << "\n% Instrument  name: ";
-       }
-       | YYLYRIC {
-               LOGOUT (DEBUG_ver) << "\n% Lyric: ";
-       }
-       | YYMARKER {
-               LOGOUT (DEBUG_ver) << "\n% Marker: ";
-       }
-       | YYCUE_POINT {
-               LOGOUT (DEBUG_ver) << "\n% Cue point: ";
-       }
-       ;
-
-mudela_item: 
-       running_status {
-       }
-       | data_entry {
-       }
-       | all_notes_off {
-       }
-       | note_off {
-       }
-       | note_on {
-       }
-       | polyphonic_aftertouch {
-       }
-       | controlmode_change {
-       }
-       | program_change {
-       }
-       | channel_aftertouch {
-       }
-       | pitchwheel_range {
-       }
-       ;
-
-running_status:
-       RUNNING_STATUS mudela_item {
-               $$ = $2;
-       }
-       ;
-
-data_entry:
-       DATA_ENTRY U8 {
-               $$ = 0;
-       }
-       ;
-
-all_notes_off:
-       ALL_NOTES_OFF U8 U8 {
-               midi_parser_l_g->note_end_all();
-               $$ = 0;
-       }
-       ;
-
-note_off:
-       NOTE_OFF U8 U8 {
-               int i = $1;
-               i = i & ~0x80;
-               midi_parser_l_g->note_end ($1 & ~0x80, $2, $3);
-               $$ = 0;
-       }
-       ;
-
-note_on:
-       NOTE_ON U8 U8 {
-               int i = $1;
-               i = i & ~0x90;
-               $$ = 0;
-                if  ($3)
-                       midi_parser_l_g->note_begin ($1 & ~0x90, $2, $3);
-               /*
-                 sss: some broken devices encode NOTE_OFF as 
-                      NOTE_ON with zero volume
-                */
-               else 
-                       midi_parser_l_g->note_end ($1 & ~0x90, $2, $3);
-       }
-       ;
-
-polyphonic_aftertouch:
-       POLYPHONIC_AFTERTOUCH U8 U8 {
-               $$ = 0;
-       }
-       ;
-
-controlmode_change:
-       CONTROLMODE_CHANGE U8 U8 {
-               $$ = 0;
-       }
-       ;
-
-program_change:
-       PROGRAM_CHANGE U8 {
-               $$ = 0;
-       }
-       ;
-
-channel_aftertouch:
-       CHANNEL_AFTERTOUCH U8 U8 {
-               $$ = 0;
-       }
-       ;
-
-pitchwheel_range:
-       PITCHWHEEL_RANGE U8 U8 {
-               $$ = 0;
-       }
-       ;
-
-sysex_item:
-       SYSEX_EVENT1 DATA {
-               $$ = 0;
-       }
-       | SYSEX_EVENT2 DATA { // U8 ?
-               $$ = 0;
-       }
-       ;
diff --git a/mi2mu/my-midi-lexer.cc b/mi2mu/my-midi-lexer.cc
deleted file mode 100644 (file)
index 483fce6..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// my-midi-lexer.cc -- implement My_midi_lexer
-//
-// copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
-
-#include "string-convert.hh"
-#include "mi2mu-global.hh"
-#include "my-midi-lexer.hh"
-#include "source.hh"
-#include "source-file.hh"
-
-int
-yylex() 
-{
-  return midi_lexer_l_g->yylex();
-}
-
-My_midi_lexer* midi_lexer_l_g = 0;
-
-My_midi_lexer::My_midi_lexer (String &filename_str, Sources * sources)
-{
-  source_file_l_ = sources->get_file_l(filename_str);
-  if  (!source_file_l_)
-       ::error  ("can't find: `" + filename_str + "'");
-  switch_streams (source_file_l_->istream_l(), 0);
-  errorlevel_i_ = 0;
-  char_count_ = 0;
-  running_status_i_ = 0;
-}
-
-My_midi_lexer::~My_midi_lexer()
-{
-//    delete source_file_p_;
-}
-
-void
-My_midi_lexer::error (char const* sz_l)
-{
-  if (1|| !source_file_l_) 
-    {
-       cerr << "error at EOF: `" << sz_l << "'\n";
-    }
-  else 
-    {
-       
-       // FIXME
-       #if 0
-       char const* ch_C = here_ch_C();
-       if  (ch_C) 
-         {
-           ch_C--;
-           while  ( (*ch_C == ' ') ||  (*ch_C == '\t') ||  (*ch_C == '\n'))
-               ch_C--;
-           ch_C++;
-         }
-       errorlevel_i_ |= 1;
-       error (sz_l);
-       #endif
-    }
-}
-
-char const*
-My_midi_lexer::here_ch_C()
-{
-  return source_file_l_->ch_C() + char_count_ ;
-}
-
-int
-My_midi_lexer::varint2_i (String str)
-{
-  int var_i = 0;
-
-  for  (int i = 0; i < str.length_i(); i++) 
-    {
-       Byte byte = str[ i ];
-       var_i <<= 7;
-       var_i += byte & 0x7f;
-       if  (!  (byte & 0x80))
-           return var_i;
-    }
-  cout << "\nvarint2_i:" << String_convert::bin2hex_str (str) << endl;
-  assert (0); // illegal varint
-  return 0;
-}
-
-int
-My_midi_lexer::close_i()
-{
-  return 0;
-}
-
diff --git a/mi2mu/my-midi-parser.cc b/mi2mu/my-midi-parser.cc
deleted file mode 100644 (file)
index 2a7e2d7..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-//
-// my-midi-parser.cc -- implement My_midi_parser
-//
-// copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
-
-#include "string-convert.hh"
-#include "duration-convert.hh"
-#include "mi2mu-global.hh"
-#include "my-midi-lexer.hh"
-#include "my-midi-parser.hh"
-#include "mudela-column.hh"
-#include "mudela-item.hh"
-#include "mudela-score.hh"
-#include "mudela-staff.hh"
-
-void
-yyerror(char const* sz_l)
-{
-  midi_parser_l_g->error (sz_l);
-}
-
-
-My_midi_parser* midi_parser_l_g = 0;
-
-My_midi_parser::My_midi_parser (String filename_str, Sources *sources_l)
-{
-  filename_str_ = filename_str;
-  midi_lexer_p_ = new My_midi_lexer (filename_str_,sources_l);
-  midi_lexer_l_g = midi_lexer_p_;    // ugh
-
-  bar_i_ = 1;
-
-  defined_ch_C_ = 0;
-  fatal_error_i_ = 0;
-  
-  mudela_column_l_ = 0;
-  mudela_score_p_ = new Mudela_score (1, 1, 1);
-
-
-  // ugh, belong to Mudela_{score,staff}
-  track_i_ = 0;
-  mudela_staff_l_ = 0;
-  mudela_key_p_ = 0;
-  mudela_tempo_p_ = 0;
-  mudela_meter_p_ = 0;
-
-  reset();
-}
-
-My_midi_parser::~My_midi_parser()
-{
-  midi_lexer_l_g = 0;    // ugh
-
-  delete midi_lexer_p_;
-  delete mudela_key_p_;
-  delete mudela_tempo_p_;
-  delete mudela_meter_p_;
-  delete mudela_score_p_;
-}
-
-void
-My_midi_parser::reset()
-{
-//    open_mudela_note_l_list_.clear();
-  open_mudela_note_l_list_.junk_links();
-
-  // ugh
-  delete mudela_key_p_;
-  mudela_key_p_ = new Mudela_key (0, 0);
-  // useconds per 4: 250000 === 60 4 per minute
-  delete mudela_tempo_p_;
-  mudela_tempo_p_ = new Mudela_tempo (1000000);
-  delete mudela_meter_p_;
-  mudela_meter_p_ = new Mudela_meter (4, 2, 24, 8);
-
-  bar_i_ = 1;
-  mudela_column_l_ = mudela_score_p_->mudela_column_l (0);
-
-  // ugh
-  copyright_str_ = "";
-  track_name_str_ = "";
-  instrument_str_ = "";
-}
-
-void
-My_midi_parser::add_score (Mudela_score* mudela_score_p)
-{
-  assert (mudela_score_p_);
-
-#if 0 // ugh, already constructed
-  mudela_score_p_ = mudela_score_p;
-  if  (!mudela_column_l_)
-       mudela_column_l_ = mudela_score_p_->mudela_column_l (0);
-#endif
-       
-  mudela_score_p_->mudela_key_l_ = mudela_key_p_;
-  mudela_score_p_->mudela_meter_l_ = mudela_meter_p_;
-  mudela_score_p_->mudela_tempo_l_ = mudela_tempo_p_;
-  bar_i_ = 1;
-}
-
-void
-My_midi_parser::error (char const* sz_l)
-{
-  midi_lexer_l_g->error (sz_l);
-
-  if  (fatal_error_i_)
-       exit (fatal_error_i_);
-}
-
-void
-My_midi_parser::forward (int i)
-{
-  if  (!i)
-       return;
-
-  Duration dur;
-  dur.durlog_i_ = -100;
-  dur.set_ticks (i);
-  Moment mom = at_mom() + Duration_convert::dur2_mom (dur);
-
-  mudela_column_l_ = mudela_score_p_->mudela_column_l (mom);
-
-  if  (i) 
-    {
-       int bars_i = (int) (mom / mudela_meter_p_->bar_mom());
-       if  (bars_i > bar_i_)
-           LOGOUT(NORMAL_ver) << '[' << bar_i_ << ']' << flush; 
-       bar_i_ = bars_i;
-    }
-}
-
-Moment
-My_midi_parser::at_mom()
-{
-  assert (mudela_column_l_);
-//    return mudela_column_l_ ? mudela_column_l_->at_mom() : 0;
-  return mudela_column_l_->at_mom();
-}
-
-void
-My_midi_parser::note_begin (int channel_i, int pitch_i, int dyn_i)
-{
-  // junk dynamics
-  (void)dyn_i;
-
-  Mudela_note* p = new Mudela_note (mudela_column_l_, channel_i, pitch_i, dyn_i);
-//  ugh, score doesn't know about last staff yet...
-//    mudela_score_p_->add_item (p);
-  mudela_staff_l_->add_item (p);
-  open_mudela_note_l_list_.bottom().add (p);
-}
-
-void
-My_midi_parser::note_end (int channel_i, int pitch_i, int aftertouch_i)
-{
-  // junk dynamics
-  (void)aftertouch_i;
-
-  // find 
-  for  (PCursor<Mudela_note*> i (open_mudela_note_l_list_); i.ok(); i++) 
-    {
-       if  ( (i->pitch_i_ == pitch_i) &&  (i->channel_i_ == channel_i)) 
-         {
-           i->end_column_l_ = mudela_column_l_;
-           LOGOUT(DEBUG_ver) << "Note: " << pitch_i;
-           LOGOUT(DEBUG_ver) << "; " << i->mudela_column_l_->at_mom_;
-           LOGOUT(DEBUG_ver) << ", " << i->end_column_l_->at_mom_ << "\n";
-           i.remove_p();
-           return;
-         }
-    }
-  warning (String ("junking note-end event: ")
-       + " channel = " + String_convert::i2dec_str (channel_i, 0, ' ')
-       + ", pitch = " + String_convert::i2dec_str (pitch_i, 0, ' '));
-}
-
-void
-My_midi_parser::note_end_all()
-{
-  // find 
-  for  (PCursor<Mudela_note*> i (open_mudela_note_l_list_); i.ok(); i++) 
-    {
-       i->end_column_l_ = mudela_column_l_;
-       i.remove_p();
-       // ugh
-       if  (!i.ok())
-           break;
-    }
-}
-
-int
-My_midi_parser::parse()
-{
-  LOGOUT(NORMAL_ver) << "\nParsing..." << flush;
-  int i = ::yyparse();
-  if  (!i)
-       note_end_all();
-  return i;
-}
-
-void
-My_midi_parser::set_division_4 (int division_4_i)
-{
-  division_1_i_ = division_4_i * 4;
-  // ugh
-  Duration::division_1_i_s = division_1_i_;
-  if  (division_4_i < 0)
-       warning ("seconds iso metrical time");
-}
-
-void
-My_midi_parser::set_key (int accidentals_i, int minor_i)
-{
-  delete mudela_key_p_;
-  mudela_key_p_ = new Mudela_key (accidentals_i, minor_i);
-}
-
-void
-My_midi_parser::set_meter (int num_i, int den_i, int clocks_i, int count_32_i)
-{
-  delete mudela_meter_p_;
-  mudela_meter_p_ = new Mudela_meter (num_i, den_i, clocks_i, count_32_i);
-}
-
-void
-My_midi_parser::set_tempo (int useconds_per_4_i)
-{
-  delete mudela_tempo_p_;
-  mudela_tempo_p_ = new Mudela_tempo (useconds_per_4_i);
-}
-