]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 0.1.14 release/0.1.14
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 13 Sep 1997 22:22:31 +0000 (00:22 +0200)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 13 Sep 1997 22:22:31 +0000 (00:22 +0200)
134 files changed:
AUTHORS.text
Documentation/AUTHORS.pod
Documentation/index.pod
Documentation/mudela-course.doc
INSTALL.text
NEWS
README
TODO
VERSION
bin/convert-mudela.in
bin/make-website.in
flower/NEWS
flower/VERSION
flower/cpu-timer.cc [new file with mode: 0644]
flower/include/cpu-timer.hh [new file with mode: 0644]
flower/include/timer.hh [new file with mode: 0644]
flower/lgetopt.cc
init/performer.ly
init/symbol.ly
init/table16.ly
input/abbrev.ly
input/beams.ly
input/cadenza.ly
input/collisions.ly
input/coriolan-alto.ly
input/gallina.ly
input/keys.ly
input/kortjakje.ly
input/multi.ly
input/pedal.ly
input/rhythm.ly
input/scales.ly
input/scripts.ly
input/scsii-menuetto.ly
input/slurs.ly
input/standchen.ly
input/toccata-fuga-E.ly
input/twinkle-pop.ly
input/twinkle.ly
input/wtk1-fugue1.ly
input/wtk1-fugue2.ly
input/wtk1-prelude1.ly
lily/Stable.make
lily/VERSION
lily/axis-group-administration.cc [new file with mode: 0644]
lily/axis-group-element.cc [new file with mode: 0644]
lily/axis-group-item.cc
lily/axis-group-spanner.cc
lily/axis-group.cc [deleted file]
lily/bar.cc
lily/beam-grav.cc
lily/beam.cc
lily/boxes.cc
lily/break-caching.cc [deleted file]
lily/break.cc
lily/change-iterator.cc [new file with mode: 0644]
lily/change-translator.cc [new file with mode: 0644]
lily/chord-iterator.cc
lily/clef-grav.cc
lily/clef-item.cc
lily/elem-group.cc
lily/gourlay-breaking.cc
lily/graphical-element.cc [new file with mode: 0644]
lily/horizontal-align-item.cc
lily/include/axis-group-administration.hh
lily/include/axis-group-element.hh
lily/include/axis-group.hh [deleted file]
lily/include/break.hh
lily/include/change-iterator.hh [new file with mode: 0644]
lily/include/change-translator.hh [new file with mode: 0644]
lily/include/elem-group-item.hh
lily/include/elem-group.hh
lily/include/graphical-element.hh [new file with mode: 0644]
lily/include/head-column.hh [new file with mode: 0644]
lily/include/horizontal-group-item.hh
lily/include/input-translator.hh [deleted file]
lily/include/lily-proto.hh
lily/include/lookup.hh
lily/include/my-lily-parser.hh
lily/include/offset.hh
lily/include/outputter.hh [new file with mode: 0644]
lily/include/p-score.hh
lily/include/rest-column-grav.hh [new file with mode: 0644]
lily/include/rest-column.hh [new file with mode: 0644]
lily/include/score-elem.hh
lily/include/score-grav.hh
lily/include/score-performer.hh
lily/include/scoreline.hh
lily/include/spanner.hh
lily/include/stem-grav.hh
lily/include/stem.hh
lily/include/super-elem.hh
lily/include/tie-grav.hh
lily/include/translator-group.hh
lily/include/translator.hh
lily/include/vertical-group-spanner.hh
lily/item.cc
lily/key-item.cc
lily/lookup.cc
lily/music-iterator.cc
lily/my-lily-parser.cc
lily/note-column.cc
lily/offset.cc [new file with mode: 0644]
lily/outputter.cc [new file with mode: 0644]
lily/p-col.cc
lily/p-score.cc
lily/parser.y
lily/rest-collision.cc
lily/score-elem.cc
lily/score-grav.cc
lily/score-performer.cc
lily/score.cc
lily/scoreline.cc
lily/script-grav.cc
lily/script.cc
lily/slur.cc
lily/span-bar.cc
lily/span-score-bar.cc
lily/spanner.cc
lily/stem-grav.cc
lily/stem.cc
lily/super-elem.cc
lily/tie-grav.cc
lily/translator-group.cc
lily/translator.cc
lily/vertical-align-elem.cc
lily/word-wrap.cc
make/lilypond.lsm
make/lilypond.spec
mf/dimen.tex
mudela-mode.el [new file with mode: 0644]
tex/dyndefs.tex
tex/lilyponddefs.tex
tex/taupindefs.tex

index 3c7e95d0a0c9e44ad697adf2a05fd73dde1ce47f..7de007d52283f2849154b944e1d3cef7017fa252 100644 (file)
@@ -37,6 +37,9 @@ C\bC\bC\bCO\bO\bO\bON\bN\bN\bNT\bT\bT\bTR\bR\bR\bRI\bI\bI\bIB\bB\bB\bBU\bU\bU\bUT\bT\bT\bTO\bO\bO\bOR\bR\bR\bRS\bS
        +\bo   Werner Lemberg <xlwy01@uxp1.hrz.uni-dortmund.de>, misc
            bugfixes, some Beam and Stem code.
 
+       +\bo   Donald Ervin Knuth, mf/ital-*.mf (these were taken
+           from the CM fonts)
+
        +\bo   Alexandre Oliva <oliva@dcc.unicamp.br>, testing
 
        +\bo   Anthony Fok <foka@gpu.srv.ualberta.ca>, debian
@@ -58,9 +61,6 @@ C\bC\bC\bCO\bO\bO\bON\bN\bN\bNT\bT\bT\bTR\bR\bR\bRI\bI\bI\bIB\bB\bB\bBU\bU\bU\bUT\bT\bT\bTO\bO\bO\bOR\bR\bR\bRS\bS
 
 
 
-
-
-
-11/Sep/97                LilyPond 0.1.13                        1
+11/Sep/97                LilyPond 0.1.14                        1
 
 
index c910644bfa3be863863fac4c3f691c6e65b98db7..313befdca00b670c07fdda7312fb6b1e396f794d 100644 (file)
@@ -47,6 +47,10 @@ Beam and Stem code.
 
 =item *
 
+Donald Ervin Knuth, mf/ital-*.mf (these were taken from the CM fonts)
+
+=item *
+
 Alexandre Oliva <oliva@dcc.unicamp.br>, testing
 
 =item *
index 9a36c9f3fb51626a1c35959d2b43a312dd580995..767db76fe249b7752268144f021db4f7927b7e35 100644 (file)
@@ -11,9 +11,9 @@ TeX file and and (mechanical) performances to MIDI files.
 This is not a Fanmail/Hype page. These pages were entirely created from
 the LilyPond package-sources. 
 
-B<These pages are created from the latest development
-snapshots of LilyPond>.  You can look at the bottom if you want to
-know which version this was.
+Note: These pages are created from the latest B<development snapshots>
+of LilyPond.  You can look at the bottom if you want to know which
+version this was.
 
 =head2 Examples
 
index 196ea9d1b0b4019bfddc3b6e639da52af2db8156..3b0d0f8dcd4a6a448cb427d92c8936b388f29107 100644 (file)
@@ -184,19 +184,19 @@ etc.
 \score{
   \melodic 
     { \octave c'; c4 c4 
-      < \multi 1;  { c2 c2 } { c'2 c'2 } > 
-      < \multi 2;  { \stem -1; c2 c2 } { \stem 1; c'2 c'2 } > 
-      < \multi 3;
+       \multi 1 <  { c2 c2 } { c'2 c'2 } > 
+       \multi 2 <  { \stemdown c2 c2 } { \stemup c'2 c'2 } > 
+       \multi 3 <
         { \clef "bass"; c2 c2 }
         { \meter 2/4;\bar "||";
           \key fis cis gis; c'2 c'2 } > 
          c2 c1 
       c1 c1
-      < \multi 1; < \multi 3; 
-        { \meter 2/4; \clef "violin"; c2 c2 }
+       \multi 1< \multi 3 <
+      { \meter 2/4; \clef "violin"; c2 c2 }
         { \meter 2/4; \clef "bass"; c2 c2 }
       >
-      < \multi 3; 
+      \multi 3 <
         { \meter 2/4; \clef "violin"; c2 c2 }
         { \meter 2/4; \clef "bass"; c2 c2 }
       >
@@ -215,50 +215,52 @@ handled graciously (well, somewhat). If the noteheads of different
 voices collide, they are moved horizontally. Rests are moved
 vertically.
 
-\begin[verbatim]{mudela}
+[FIXME]
+\def\bla{
+\begin[verbatim]{mudelaXX}
 two_voice = \melodic 
-        < \multi 2; 
-          {     \octave c'; \stem -1;
+         \multi 2 <
+          {     \octave c'; \stemdown
                 c4 d e f g2~  g4 a [c8 d e f] c2| }
-          { \stem 1;
+          { \stemup
                 g4 f e g ~ g2 g2  c4 g4 g2 } 
 
         >
 
 two_voice_steminvert = \melodic 
-        < \multi 2;  
-          {     \octave c'; \stem 1;
+        \multi 2 <  
+          {     \octave c'; \stemup
 % the f and g on 4th beat are exceptionally ugh.
                 c4 d e f g2 g4 a | }
-          { \stem -1;
+          { \stemdown
                 g4 f e g  g2 g2 } 
 
         >
 
 three_voice = \melodic 
-        < \multi 2;
-        { \stem 1; 
+        \multi 2 <
+        { \stemup 
                 g4 f e f g a g2 }
-        { \hshift 1; \stem 1; 
+        { \property Voice.hshift = 1 \stemup 
                 e2  e2  e2  e2 }
-        { \stem -1;
+        { \stemdown
                 c4 d e d c d es }
         >
 
 
 restsII = \melodic {
         \octave c'; 
-                        < \multi2;  
-                                { \stem 1;  g'8 f' e' d' c' b a g f e d c }
-                                { \stem -1; r  r  r  r  r  r r r r r r r }
+                        \multi2 <
+                                { \stemup  g'8 f' e' d' c' b a g f e d c }
+                                { \stemdown r  r  r  r  r  r r r r r r r }
                         >
                         r8 r4
-                        < \multi2;  r8 r8 >
-                        < \multi2;  r8 r8 r8 >
-                        < \multi2;  r8 r8 r8 r8 >
-                        < \multi2;  r r >
-                        < \multi2;  r r r >
-                        \stem 1;
+                        \multi 2 <  r8 r8 >
+                        \multi 2 <  r8 r8 r8 >
+                        \multi 2 <  r8 r8 r8 r8 >
+                        \multi 2 <  r r >
+                        \multi 2 <  r r r >
+                        \stemup
                         [c''8 r8 c''8 c''8]
                         [c8 r8 c8 c8]
 }
@@ -268,6 +270,5 @@ restsII = \melodic {
                         \$three_voice  \restsII }
 }
 
-\end{mudela}
-
+}
 \end{document}
index 2a831c996609a6edfd12f165fca8cd1c74af6ec0..88723a48bb7221605b8ec6ae3f81d9ed0c3ed642 100644 (file)
@@ -61,7 +61,7 @@ R\bR\bR\bRU\bU\bU\bUN\bN\bN\bNN\bN\bN\bNI\bI\bI\bIN\bN\bN\bNG\bG\bG\bG
 
 
 
-8/Aug/97                 LilyPond 0.1.13                        1
+8/Aug/97                 LilyPond 0.1.14                        1
 
 
 
@@ -127,7 +127,7 @@ C\bC\bC\bCO\bO\bO\bON\bN\bN\bNF\bF\bF\bFI\bI\bI\bIG\bG\bG\bGU\bU\bU\bUR\bR\bR\bRI\bI\bI\bIN\bN\bN\bNG\bG\bG\bG a\b
 
 
 
-8/Aug/97                 LilyPond 0.1.13                        2
+8/Aug/97                 LilyPond 0.1.14                        2
 
 
 
@@ -193,7 +193,7 @@ INSTALL(1)            LilyPond documentation           INSTALL(1)
 
 
 
-8/Aug/97                 LilyPond 0.1.13                        3
+8/Aug/97                 LilyPond 0.1.14                        3
 
 
 
@@ -259,7 +259,7 @@ I\bI\bI\bIN\bN\bN\bNS\bS\bS\bST\bT\bT\bTA\bA\bA\bAL\bL\bL\bLL\bL\bL\bLI\bI\bI\bIN\bN\bN\bNG\bG\bG\bG
 
 
 
-8/Aug/97                 LilyPond 0.1.13                        4
+8/Aug/97                 LilyPond 0.1.14                        4
 
 
 
@@ -325,7 +325,7 @@ R\bR\bR\bRE\bE\bE\bED\bD\bD\bDH\bH\bH\bHA\bA\bA\bAT\bT\bT\bT L\bL\bL\bLI\bI\bI\bIN\bN\bN\bNU\bU\bU\bUX\bX\bX\bX
 
 
 
-8/Aug/97                 LilyPond 0.1.13                        5
+8/Aug/97                 LilyPond 0.1.14                        5
 
 
 
@@ -391,6 +391,6 @@ A\bA\bA\bAU\bU\bU\bUT\bT\bT\bTH\bH\bH\bHO\bO\bO\bOR\bR\bR\bRS\bS\bS\bS
 
 
 
-8/Aug/97                 LilyPond 0.1.13                        6
+8/Aug/97                 LilyPond 0.1.14                        6
 
 
diff --git a/NEWS b/NEWS
index 739797cd39080d4b85c1007b3142ba04d8029cb5..34ebe729b29c9a0cda3b7d4dfb7c6e6e25beb9ca 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,10 +1,32 @@
-pl 13.jcn2
+pl 14
+       - Simple but nifty mudela-mode.el for Emacs
+       - slightly better syntax for single-note-repeat, now default kept in
+Stem_engraver
+       - bf: Abbrev_beams are not the only beams (see: jcn4, stem-info, thanks, Jan)
+       - a CPU timer for Interpreting and Breaking
+       - Separate Score_elem:
+         * invoke-once stuff in Super_elem (using function pointers; much cleaner now)
+         * geometrical stuff into Graphical_element
+         * Axis_group_* accept Graphical_elements iso. Score_elems
+         * A dimension cache, hopefully this makes lily a bit faster
+         * TeX output moved out of Score_elem, separate interface Outputter
+       
+       - < \multi 2; bla >  -> \multi 2 < bla > (mudela 0.1.6)
+       - bf: don't do \multi if \type specified
+       - Translator switching: Change_translator, Change_iterator
+       
+
+pl 12.jcn4
+       - fixed dynamic f, magstep bug
        - gaps on abbrev-beams 
        - bf: stem-info
        - bf: last abbrev
        - bf: stem: do_width
        - bf: removed rest-column.hh
 
+*******
+sep 11
+
 pl 13
        - big Rest/notehead rewrite:
          * separated Rest, Note_head and Dots
@@ -36,8 +58,6 @@ by the parser (mudela 0.1.4)
        - Molecule::add_XXXX -> Molecule::add_at_edge ()
        - doco updeet: why no midi FAQ, index, CodingStyle hungarian
 
-pl 12.jcn4
-       - fixed dynamic f, magstep bug
 
 pl 12.jcn3
        - try at better dynamic font, copied from cmbxti10: mf/*
diff --git a/README b/README
index 331108b90f6f7332abea2278562b35c2717de51f..6b8828bc889e2f002c1ed3e41a897245be4735d0 100644 (file)
--- a/README
+++ b/README
@@ -24,7 +24,7 @@ MusixTeX-fonts. Please refer to the installation instructions on how
 to obtain and install them.
 
 
-3. INSTALLATINON
+3. INSTALLATION
 
 For your convenience, a formatted copy of the INSTALL instructions are
 in the toplevel directory, as INSTALL.text
diff --git a/TODO b/TODO
index ac8a74e7d6c0ce1ae0ded41556921645f5a9e2f2..47cd313b8122253b06a3049a31e143f45e4f90a0 100644 (file)
--- a/TODO
+++ b/TODO
@@ -6,6 +6,8 @@ done, or is an idea that I want to think about
 Most of the items are marked in the code as well, with full explanation. 
 grep for TODO and ugh/ugr
 
+       - bf: abbrevs over whole note
+
        * use properties for:
        - Text_style
        - default_octave
@@ -49,8 +51,7 @@ PROJECTS
        * \header
        - revise lexer mode
        - write perl script for handling it into databases
-
-       * emacs-mode for mudela
+       - write TeX macros to generate titles
 
        * Makefile stuff:
        - have make dist produce tarball in out/ directory.
@@ -100,7 +101,7 @@ languages:
 ******************
 
        \score { < 
-               \melodic { \id "Staff" ""; c'4 g'4 }
+               \melodic \type Staff { c'4 g'4 }
                \lyric {   \id "Lyric" ""; hello4 bye4 < a chord > }
                \lyric {   \id "Lyric" ""; bye4 hello4 }
                \melodic { \id "Staff" ""; c'4 g'4 }
@@ -337,9 +338,6 @@ SMALLISH PROJECTS
 
 IDEAS
 
-       * scoping in Lexer: do general id- assignments in mudela.
-
-       ID '=' EXPR;
 
        * create libmudela, or liblily_frontend
 
@@ -395,7 +393,6 @@ IDEAS
 
        * lyrics in chords still fuck up.
 
-       *
        - rewire acknowledge_element() logic with a process_acknowledged()
 
        * pushgroup/popgroup
@@ -405,3 +402,7 @@ IDEAS
        * multi threading?
          - 1 thread per element/ 1 thread per line
          - 1 thread per Translator
+
+       * Use hooks/dependency graphs for properties
+
+       * Make general "spanning"-elements and "placer"-elements
diff --git a/VERSION b/VERSION
index 1ac534dd994cab283e022f1cbf9eefd5b62b43b9..b32b21946e07e61f02a9cbaab0e0f8e74b91dfce 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 TOPLEVEL_MAJOR_VERSION = 0
 TOPLEVEL_MINOR_VERSION = 1
-TOPLEVEL_PATCH_LEVEL = 13
+TOPLEVEL_PATCH_LEVEL = 14
 
 # use to send patches, always empty for released version:
-TOPLEVEL_MY_PATCH_LEVEL = .jcn2
+TOPLEVEL_MY_PATCH_LEVEL = 
index 530e7818f20b54bffe87c46736b3861046c42a65..1efde362a5740671d6c7382612ebbabb6c13b1d6 100644 (file)
@@ -125,6 +125,12 @@ sub convert_0_1_4_to_0_1_5
     s/([<{]) *\\id (.+) (.+);/\\type $2 = $3 $1/;
 }
 
+       
+sub convert_0_1_5_to_0_1_6
+{
+    s/< *\\multi (.*);/\\multi $1 </;
+}
+       
 ###############################################################
 
 sub    last_conversion
@@ -169,7 +175,8 @@ my %minor_conversions = ("0.0.50" => \&no_conv,
                         "0.1.2" => \&no_conv,
                         "0.1.3" => \&convert_0_1_2_to_0_1_3,
                         "0.1.4" => \&no_conv,
-                        "0.1.5" => \&convert_0_1_4_to_0_1_5
+                        "0.1.5" => \&convert_0_1_4_to_0_1_5,
+                        "0.1.6" => \&convert_0_1_5_to_0_1_6
                         );
  
 
index aa1eda0b1d6c2ae76a0625ba0b8d58e5c2353004..98b49fd31dde2de6e71646ac8a8c3412f11aa6b2 100644 (file)
@@ -84,7 +84,7 @@ local @examples=("twinkle-pop", "twinkle", "multi", "wtk1-fugue2",
                 "toccata-fuga-E", 
                 "scsii-menuetto",
                 "cadenza", "scales", 
-               #"rhythm", 
+               "rhythm", 
                 "gallina");
 
 
@@ -146,7 +146,7 @@ files have been scaled to eliminate aliasing.";
        $name=$a; print HTMLLIST "<h1>example file: $name</h1>\n<XMP>\n";
 
        open IF, "$depth/input/$a.ly";
-       input_record_separator IF "%}";
+       input_record_separator IF "\n}";
        
        $desc = <IF>;
        close IF;
index a53c1a47516b0eb44483c312c1e8f421d149b5a9..7d080f2cd13402e24205ebbeef06d9b62b98eba0 100644 (file)
@@ -1,3 +1,5 @@
+pl 30
+       - Cpu_timer
 pl 29 
        - Dictionary_iter, Dictionary
 
index da049c7e3ce08c50392011a1bae57291b64c4284..ab5a2361a9cb0749631f15c124c270b4e7d13b3f 100644 (file)
@@ -1,6 +1,6 @@
 MAJOR_VERSION = 1
 MINOR_VERSION = 1
-PATCH_LEVEL = 28
+PATCH_LEVEL = 30
 # use to send patches, always empty for released version:
 MY_PATCH_LEVEL = # include separator: "-1" or ".a"
 #
diff --git a/flower/cpu-timer.cc b/flower/cpu-timer.cc
new file mode 100644 (file)
index 0000000..e10985e
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+  cpu-timer.cc -- implement Cpu_timer
+
+  source file of the Flower Library
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "cpu-timer.hh"
+
+Cpu_timer::Cpu_timer ()
+{
+  restart ();
+}
+void
+Cpu_timer::restart ()
+{
+  start_clock_ = clock ();
+}
+
+Real
+Cpu_timer::read ()
+{
+  clock_t stop = clock ();
+  return (stop-start_clock_)/Real(CLOCKS_PER_SEC);
+}
diff --git a/flower/include/cpu-timer.hh b/flower/include/cpu-timer.hh
new file mode 100644 (file)
index 0000000..3205c42
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+  cpu-timer.hh -- declare Cpu_timer
+
+  source file of the Flower Library
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef CPU_TIMER_HH
+#define CPU_TIMER_HH
+
+#include <time.h>
+#include "real.hh"
+
+class Cpu_timer {
+  clock_t start_clock_;
+public:
+  Cpu_timer ();
+  void restart ();
+  Real read ();
+};
+
+#endif // CPU_TIMER_HH
diff --git a/flower/include/timer.hh b/flower/include/timer.hh
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
index d8f18fd5ab6ceec59853425a45bd52726fe705e1..8e9fd408ddb85a590e7a87aed72aa9a11c51ba3f 100644 (file)
@@ -13,8 +13,8 @@ Getopt_long::argument_to_i()
 {
   long l;
   if (!optional_argument_ch_C_ 
-       || sscanf (optional_argument_ch_C_, "%ld", &l) != 1)
-       report (E_ILLEGALARG);
+      || sscanf (optional_argument_ch_C_, "%ld", &l) != 1)
+    report (E_ILLEGALARG);
   
   return l;
 }
@@ -31,19 +31,19 @@ Getopt_long::parselong()
   found_option_l_=0;
   for (int i=0; i< table_len_i_; i++) 
     {
-       char const *ln = option_a_[i].longname;
+      char const *ln = option_a_[i].longname;
 
-       if (ln && !strncmp (ln, optnm, searchlen)) 
-         {
-           found_option_l_ = option_a_+i;
-           break;
-         }
-  }    
+      if (ln && !strncmp (ln, optnm, searchlen)) 
+       {
+         found_option_l_ = option_a_+i;
+         break;
+       }
+    }  
 
   if (!found_option_l_) 
     {
-       report (E_UNKNOWNOPTION);
-       return 0;
+      report (E_UNKNOWNOPTION);
+      return 0;
     }
   array_index_i_++;
   argument_index_i_ = 0;
@@ -51,22 +51,22 @@ Getopt_long::parselong()
   
   if (found_option_l_->take_arg) 
     {
-       if (endopt)
-           optional_argument_ch_C_ = endopt +1; // a '='
-       else 
-         {
-           optional_argument_ch_C_ = arg_value_ch_a_a_[array_index_i_];
-           array_index_i_++;
-         }
-       if (!optional_argument_ch_C_)
-           report (E_ARGEXPECT);
+      if (endopt)
+       optional_argument_ch_C_ = endopt +1; // a '='
+      else 
+       {
+         optional_argument_ch_C_ = arg_value_ch_a_a_[array_index_i_];
+         array_index_i_++;
+       }
+      if (!optional_argument_ch_C_)
+       report (E_ARGEXPECT);
 
     }
   else 
     {
-       optional_argument_ch_C_ = 0;
-       if (endopt)
-           report (E_NOARGEXPECT);
+      optional_argument_ch_C_ = 0;
+      if (endopt)
+       report (E_NOARGEXPECT);
     }
   
   return found_option_l_;
@@ -77,11 +77,11 @@ void
 Long_option_init::printon (ostream &errorout) const
 {
   if (shortname)       
-       errorout <<"-" << shortname;
+    errorout <<"-" << shortname;
   if (shortname && longname)
-       errorout << ", ";
+    errorout << ", ";
   if (longname)        
-       errorout << "`--" << longname << "'";
+    errorout << "`--" << longname << "'";
 }
 
 // report an error, GNU style.
@@ -90,35 +90,35 @@ Getopt_long::report (Errorcod c)
 {
   error_ = c;
   if (!error_ostream_l_)
-       return;
+    return;
 
   *error_ostream_l_ << arg_value_ch_a_a_[0] << ": ";
   switch (c) 
     {
-  case E_ARGEXPECT:
-       *error_ostream_l_<< "option ";
-       found_option_l_->printon (*error_ostream_l_);
-       *error_ostream_l_ << "requires an argument"<<endl;
-       break;
-  case  E_NOARGEXPECT:
-       *error_ostream_l_ << "option `--" <<
-           found_option_l_->longname << "' does not allow an argument"<<endl;
-       break;
+    case E_ARGEXPECT:
+      *error_ostream_l_<< "option ";
+      found_option_l_->printon (*error_ostream_l_);
+      *error_ostream_l_ << "requires an argument"<<endl;
+      break;
+    case  E_NOARGEXPECT:
+      *error_ostream_l_ << "option `--" <<
+       found_option_l_->longname << "' does not allow an argument"<<endl;
+      break;
        
-  case E_UNKNOWNOPTION:
-       *error_ostream_l_ << "unrecognized option ";
-       if (argument_index_i_)
-           *error_ostream_l_ << "-" << arg_value_ch_a_a_[array_index_i_][argument_index_i_] << endl;
-       else
-           *error_ostream_l_ << arg_value_ch_a_a_[array_index_i_] << endl;
+    case E_UNKNOWNOPTION:
+      *error_ostream_l_ << "unrecognized option ";
+      if (argument_index_i_)
+       *error_ostream_l_ << "-" << arg_value_ch_a_a_[array_index_i_][argument_index_i_] << endl;
+      else
+       *error_ostream_l_ << arg_value_ch_a_a_[array_index_i_] << endl;
 
-       break;
-  case E_ILLEGALARG:
-       *error_ostream_l_ << "illegal argument `" << optional_argument_ch_C_ << "\'to option ";
-       found_option_l_->printon (*error_ostream_l_);
-       *error_ostream_l_ << '\n';
-  default:
-       assert (false);
+      break;
+    case E_ILLEGALARG:
+      *error_ostream_l_ << "illegal argument `" << optional_argument_ch_C_ << "\'to option ";
+      found_option_l_->printon (*error_ostream_l_);
+      *error_ostream_l_ << '\n';
+    default:
+      assert (false);
     }
   exit (2); 
 }
@@ -131,23 +131,23 @@ Getopt_long::parseshort()
   assert (c);
   
   for (int i=0; i < table_len_i_; i++)
-       if (option_a_[i].shortname == c) 
-         {
-           found_option_l_  = option_a_+i;
-           break;
-         }
+    if (option_a_[i].shortname == c) 
+      {
+       found_option_l_  = option_a_+i;
+       break;
+      }
 
   if (!found_option_l_)
     {
-       report (E_UNKNOWNOPTION);
-       return 0;
+      report (E_UNKNOWNOPTION);
+      return 0;
     }
 
   argument_index_i_++;
   if (!found_option_l_->take_arg)
     {
-       optional_argument_ch_C_ = 0;
-       return found_option_l_;
+      optional_argument_ch_C_ = 0;
+      return found_option_l_;
     }
   optional_argument_ch_C_ = arg_value_ch_a_a_[array_index_i_] + argument_index_i_;
 
@@ -156,12 +156,12 @@ Getopt_long::parseshort()
   
   if (!optional_argument_ch_C_[0]) 
     {
-       optional_argument_ch_C_ = arg_value_ch_a_a_[array_index_i_];
-       array_index_i_ ++;
+      optional_argument_ch_C_ = arg_value_ch_a_a_[array_index_i_];
+      array_index_i_ ++;
     }
   if (!optional_argument_ch_C_) 
     {
-       report (E_ARGEXPECT);
+      report (E_ARGEXPECT);
     }
   
   return found_option_l_;
@@ -171,35 +171,37 @@ const Long_option_init *
 Getopt_long::operator()() 
 {
   if (!ok())
-       return 0;
+    return 0;
   
   next();
+  if (!ok ())
+    return 0;
   
   if (argument_index_i_)
-       return parseshort();
+    return parseshort();
   
   const char * argument_C = arg_value_ch_a_a_[array_index_i_];
   
   if (argument_C[0] != '-')
-       return 0;
+    return 0;
 
   if (argument_C[1] == '-') {// what to do with "command  --  bla"
-       if (argument_C[2])
-           return parselong();
-       else
-           return 0;
-    }
+    if (argument_C[2])
+      return parselong();
+    else
+      return 0;
+  }
   else 
     {
-       if (argument_C[ 1 ]) 
-         {
-           argument_index_i_ = 1;
-           return parseshort();
-         }
-       else 
-         {
-           return 0;
-         }
+      if (argument_C[ 1 ]) 
+       {
+         argument_index_i_ = 1;
+         return parseshort();
+       }
+      else 
+       {
+         return 0;
+       }
     }
 }
 
@@ -215,7 +217,7 @@ Getopt_long::Getopt_long (int c, char  **v, Long_option_init *lo)
   //    reached end of option table?
   table_len_i_ =0;
   for (int i = 0;  option_a_[i].longname ||option_a_[i].shortname; i++)
-       table_len_i_ ++;
+    table_len_i_ ++;
 }
 
 bool
@@ -229,10 +231,10 @@ Getopt_long::next()
 {
   error_ = E_NOERROR;
   while (array_index_i_ < argument_count_i_
-          && !arg_value_ch_a_a_[array_index_i_][argument_index_i_]) 
-            {
-       array_index_i_++;
-       argument_index_i_ = 0;
+        && !arg_value_ch_a_a_[array_index_i_][argument_index_i_]) 
+    {
+      array_index_i_++;
+      argument_index_i_ = 0;
     }
 }
    
@@ -240,7 +242,7 @@ char const *
 Getopt_long::current_arg()
 {
   if (array_index_i_ >= argument_count_i_)
-       return 0;
+    return 0;
   char const * a = arg_value_ch_a_a_[array_index_i_];
   return a + argument_index_i_;
 }
@@ -251,8 +253,8 @@ Getopt_long::get_next_arg()
   char const * a = current_arg();
   if (a) 
     {
-       array_index_i_ ++;
-       argument_index_i_= 0;
+      array_index_i_ ++;
+      argument_index_i_= 0;
     }
   return a;
 }
index a45e0ce2716b585597303a18cf4ad4cde76a55fe..90b3688412fcdf13a5aaafd4b40c13946ad2ae9e 100644 (file)
@@ -9,7 +9,6 @@ Staff = \translator {
        \consists "Meter_performer";
 }
 
-
 Thread =\translator
 {
        \type "Performer_group_performer";
@@ -40,12 +39,19 @@ Lyrics = \translator {
        \consists "Meter_performer";
 }
 
+Staff_group = \translator
+{
+       \type Performer_group_performer;
+       \accepts Staff;
+}
+
 Score = \translator {
        \type "Score_performer";
        instrument = piano;
        \accepts Staff;
        \accepts Grandstaff;
        \accepts Lyrics; 
+       \accepts Staff_group;
        \consists "Swallow_performer";
 }
 
index 445a8a7a6440de8f7b87131eb623834ebda3cfda..2ca0c7f7d96fca85063f64b84b23c102d8951ed6 100644 (file)
@@ -1,6 +1,6 @@
 % symbol.ly
   
-\version "0.1.5";
+\version "0.1.6";
   
 breve = \duration { -1 0 }
 longa = \duration { -2 0 }
index 0642176070886ee3097c572107854d5e5dc78077..265098ce1794a7f5b3ce0c1680082b196d981d87 100644 (file)
@@ -7,9 +7,7 @@
 
 table_sixteen= 
 \symboltables {
-
    \texid      "\input lilyponddefs \musixsixteendefs"
-
    % index TeXstring,  xmin xmax ymin ymax
 
     "scripts" = \table {
@@ -156,16 +154,16 @@ table_sixteen=
      }
 
      "flags" = \table {
-       "8"     "\eighthflag"           0.0\pt  4.0\pt  0.0\pt  0.0\pt
-       "16"    "\sixteenthflag"                0.0\pt  4.0\pt  0.0\pt  0.0\pt
-       "32"    "\thirtysecondflag"     0.0\pt  4.0\pt  0.0\pt  0.0\pt
-       "64"    "\sixtyfourthflag"      0.0\pt  4.0\pt  0.0\pt  0.0\pt
-       "128"   "\hundredtwentyeighthflag"      0.0\pt  4.0\pt  0.0\pt  0.0\pt
-       "-8"    "\deighthflag"          0.0\pt  4.0\pt  0.0\pt  0.0\pt
-       "-16"   "\dsixteenthflag"               0.0\pt  4.0\pt  0.0\pt  0.0\pt
-       "-32"   "\dthirtysecondflag"    0.0\pt  4.0\pt  0.0\pt  0.0\pt
-       "-64"   "\dsixtyfourthflag"     0.0\pt  4.0\pt  0.0\pt  0.0\pt
-       "-128"  "\dhundredtwentyeighthflag"     0.0\pt  4.0\pt  0.0\pt  0.0\pt
+       "u3"    "\eighthflag"           0.0\pt  4.0\pt  0.0\pt  0.0\pt
+       "u4"    "\sixteenthflag"                0.0\pt  4.0\pt  0.0\pt  0.0\pt
+       "u5"    "\thirtysecondflag"     0.0\pt  4.0\pt  0.0\pt  0.0\pt
+       "u6"    "\sixtyfourthflag"      0.0\pt  4.0\pt  0.0\pt  0.0\pt
+       "u7"    "\hundredtwentyeighthflag"      0.0\pt  4.0\pt  0.0\pt  0.0\pt
+       "d3"    "\deighthflag"          0.0\pt  4.0\pt  0.0\pt  0.0\pt
+       "d4"    "\dsixteenthflag"               0.0\pt  4.0\pt  0.0\pt  0.0\pt
+       "d5"    "\dthirtysecondflag"    0.0\pt  4.0\pt  0.0\pt  0.0\pt
+       "d6"    "\dsixtyfourthflag"     0.0\pt  4.0\pt  0.0\pt  0.0\pt
+       "d7"    "\dhundredtwentyeighthflag"     0.0\pt  4.0\pt  0.0\pt  0.0\pt
      }
 
      "beamslopes" = \table {
index 4c91009e0e9d302292d2af32f520a6a75bdec97b..2ea0b483ceb688e35c5ec7727453901619d406fa 100644 (file)
@@ -1,22 +1,17 @@
-%{MudelaHeader
-
- filename: abbrev.ly
- title: 
- description: 
- composer(s): 
- entered-by: jcn
- copyright: PD
-
- Tested Features: simple abbreviations
-EndMudelaHeader
-%}
+\header{
+enteredby      jcn
+copyright      PD
+TestedFeatures simple abbreviations
+}
 
-\version "0.1.5";
+\version "0.1.6";
 
 \score{
        \melodic{ 
                \octave c'';
                \meter 4/4;
+               % default abbreviations
+               c4 c4: c4:32 c4: c4 c2.
                'a1
                'a1:32
                'c4:8 c' 'c4:16 c'
index 2b815e3b47bba7409b0502edd4bfc6927fe16d5f..8dffc79edb96bc9bd0364e271e70c2a29f5bd0bd 100644 (file)
  Tested Features: beams and beamflags
 EndMudelaHeader
 %}
-\version "0.1.5"
+\version "0.1.6"
 
 \score{
-       \melodic <\multi 3; 
+       \melodic \multi 3 < 
                { \octave c'; 
                        \meter 8/4;
                        \duration8;
index fc143d0287d01d2fe9b06120611a4c20b3251559..7127940dd43856f2dd651acac6ac2d7e797ca9de 100644 (file)
@@ -11,7 +11,7 @@ copyright     public domain
 Tested Features: cadenza mode
 %}
 
-\version "0.1.5";
+\version "0.1.6";
 
 
 cad = \melodic  {
index c65800b9618393b1e4dee2395ae401e5e8908c1c..15f5b3969e7618a6273260369e2f94ff6b53a4d7 100644 (file)
  Tested Features:test the Collision resolution 
 EndMudelaHeader
 %}
-\version "0.1.5";
+\version "0.1.6";
 
 
 
 two_voice = \melodic 
-       < \multi 2; 
+       \multi 2 < 
          { \stemdown \octave c'; 
                c4 d e f g2~  g4 a [c8 d e f] c2| }
          { \stemup
@@ -24,7 +24,7 @@ two_voice = \melodic
        >
 
 two_voice_steminvert = \melodic 
-       < \multi 2;  
+       \multi 2 <  
          { 
                \octave c'; \stemup
 % the f and g on 4th beat are exceptionally ugh.
@@ -35,7 +35,7 @@ two_voice_steminvert = \melodic
        >
 
 three_voice = \melodic 
-       < \multi 2;
+       \multi 2 <
        { \stemup 
                g4 f e f g a g2 }
        { \stemup \property Voice.hshift = 1 
@@ -46,7 +46,7 @@ three_voice = \melodic
 
 
 rests = \melodic  
-       < \multi 2;
+       \multi 2 <
        { \stemup
                | r8 r r r  r r r r 
                [c' b a g] [f e d c]
@@ -59,20 +59,20 @@ rests = \melodic
 
 restsII = \melodic {
        \octave c'; 
-                       < \multi2;  
+       \multi 2 < 
                                { \stemup  g' f' e' d' c' b a g f e d c }
                                { \stemdown r  r  r  r  r  r r r r r r r }
                        >
-                       < \multi2;  
+       \multi 2 <
                                { \stemup  r r r r r r r r  r  r  r  r }
                                { \stemdown c d e f g a b c' d' e' f' g' }
                        >
                        r8 r4
-                       < \multi2;  r8 r8 >
-                       < \multi2;  r8 r8 r8 >
-                       < \multi2;  r8 r8 r8 r8 >
-                       < \multi2;  r r >
-                       < \multi2;  r r r >
+                       \multi 2 <  r8 r8 >
+                       \multi 2 <  r8 r8 r8 >
+                       \multi 2 <  r8 r8 r8 r8 >
+                       \multi 2 <  r r >
+                       \multi 2 <  r r r >
                        \stemup
                        [c''8 r8 c''8 c''8]
                        [c8 r8 c8 c8]
index 62d21690bafc054d72357fd07e8bf2a085cdcc58..8fd27dd47e76383a2385f5ee9141b8b112ec0faf 100644 (file)
@@ -17,7 +17,7 @@ EndMudelaHeader
 % (maybe even sooner :-)
 %
 
-\version "0.1.5";
+\version "0.1.6";
 
 alto = \melodic{ 
        
index 9c0498c412acd861186899e37a1fcc23f6cd89f6..c13e9fdbf62db061d5ba6af1a83b3a484240b514 100644 (file)
@@ -39,7 +39,7 @@ part of the basso continuo
  
 %}
 
-\version "0.1.5";
+\version "0.1.6";
 
 vi1=\melodic{
   \meter 4/4;
@@ -221,7 +221,7 @@ bc=\melodic{
 }
 
 \score{
-  < \multi 3;
+  \type Staff_group <
     \vi1
     \vi2
     \bc
index 1c3b99bd6d96a21dee461d077744b60e835a14f1..da9286456c0987e33645ba2c508be8ff9e70834b 100644 (file)
@@ -10,7 +10,7 @@
  Tested Features: local key, key, forced accidentals
 EndMudelaHeader
 %}
-\version "0.1.5";
+\version "0.1.6";
 
 
 blah = \melodic{
index 924c84a979e240291a32f8ca7e111dd54f294890..fb1eec4e062ea95ef1039fecd551f055c4bb0405 100644 (file)
@@ -11,7 +11,7 @@ copyright             public domain
 Tested Features: example file with comments
 
 %}
-\version "0.1.5";
+\version "0.1.6";
 
 
 % the % is a comment.
index 8270bfd80931a3390360d2c9162c5a4fc14c3ad5..0ee5fb140572615b643a8dc532bb0f78b1a303d5 100644 (file)
@@ -10,21 +10,24 @@ Tested Features: \multi
 %}
 
 
-\version "0.1.5";
+\version "0.1.6";
 
 \score{
        \melodic 
                { \octave c'; c4 c4 
-                       < \multi 1;  { c2 c2 } { c'2 c'2 } > 
-                       < \multi 2;  { \stemdown c2 c2 } { \stemup c'2 c'2 } > 
-                       < \multi 3;  { \clef "bass"; c2 c2 } { \meter 2/4;\bar "||"; \key fis cis gis; c'2 c'2 } > 
+                       \multi 1 <  { c2 c2 } { c'2 c'2 } > 
+                       \multi 2 <  { \stemdown c2 c2 } { \stemup c'2 c'2 } > 
+                       \multi 3 < { \clef "bass"; c2 c2 } 
+                           { \meter 2/4;\bar "||";
+                                \key fis cis gis; c'2 c'2 } 
+> 
                                c2 c1 
                        c1 c1
-                       < \multi 1; < \multi 3; 
+                       \multi 1 < \multi 3 < 
                                { \meter 2/4; \clef "violin"; c2 c2 }
                                { \meter 2/4; \clef "bass"; c2 c2 }
                        >
-                       < \multi 3; 
+                       \multi 3 < 
                                { \meter 2/4; \clef "violin"; c2 c2 }
                                { \meter 2/4; \clef "bass"; c2 c2 }
                        >
index 2827ed2bedadc49edf01c28e0712aba7188f7ffc..cb22bd22d980c0f3106ed60fddbb10ec3e13f7e2 100644 (file)
@@ -24,7 +24,7 @@
 % \lbheel \lbheel \lfheel \lftoe
 % \rbheel \rbtoe \rfheel \rftoe
 
-\version "0.1.5";
+\version "0.1.6";
 
 \score{
                \melodic {
index ef4481d1f8b902cf8b77b31454b11ada6804b73b..cc1511bf167e6902cdf82985fedecfacdc3b3c79 100644 (file)
@@ -7,7 +7,7 @@ TestedFeatures   multiple meters, beaming, unsynced bars, userdefd engravers
 
 
 
-\version "0.1.5";
+\version "0.1.6";
 
 ritme = \melodic{ %\octave ;
        \partial 8;
@@ -49,7 +49,7 @@ yanother =
 
 
 \score{
-        < \multi 3;
+       \type Staff_group <
                \ritme
                \another
                \yanother
@@ -79,6 +79,7 @@ yanother =
        %% add Timing_engraver to the staff
        Staff = \translator {
          \type "Engraver_group_engraver";
+       defaultclef=    violin;
 
        \consists "Timing_engraver";
          \consists "Bar_engraver";
index 64acc42bea9576df14357a5f4a436e4e623a4949..e1736b9f7710f59558175419e34dc5553b1258c2 100644 (file)
@@ -12,7 +12,7 @@ EndMudelaHeader
 % scales with accents.
 %
 
-\version "0.1.5";
+\version "0.1.6";
 blah =         \melodic {
                \meter 6/8;     
                \octave  'c ;
index b4e95203c4aaa3f304c9fea6eef64772595fa0e8..120902812719aff631a34e55a8054422e4593718 100644 (file)
@@ -10,7 +10,7 @@
  Tested Features: scripts, text.
 EndMudelaHeader
 %}
-\version "0.1.5";
+\version "0.1.6";
 
 
 blah =         \melodic {
index 247cf7901bb66e5fe73c211c842aaadcbdb70f6f..4e3590437c3b867946f4489e3caa1ff6146e0bfe 100644 (file)
@@ -13,7 +13,7 @@ copyright     public domain
  Tested Features:breaking algorithm, chords, multivoice, accents
 %}
 
-\version "0.1.5";
+\version "0.1.6";
 
 %% Stuff from MPP version
 % \lefttitle{Menuetto}
@@ -60,14 +60,14 @@ IImenuetto = \melodic{
 %%10
        < [ e'8 g8 > d' cis'_"2" e' a~  g8 ] |
 %%11
-       < \multi 2;  
+       \multi 2 <  
                {\stemup a4~  d'4 cis'4-. }
                { \stemdown f2 e4 } > |
 %%12
        < [ g'8^"4" d8 > f' e' f' d'^"3"~   c' ] |
 %%13
        \clef "alto";
-       < \multi 2;
+       \multi 2 <
                 { \stemup bes2 c'4 }
                 { \stemdown g4~  f4 e4 }% ugh
        > |
@@ -86,9 +86,9 @@ IImenuetto = \melodic{
 %%20
        < { [ c'8 ( bes8 a8 )bes g~  bes8 ] }  d8  g8  > |
 %%21
-       < \multi 2;  
-               {\stemup  d'4 (\stemup ) cis'4 d'4 }  
-               { \stemdown g2 f4 } 
+       \multi 2 <  
+               {\stemup  d'4( \stemup )cis'4 d'4 }  
+               { \stemdown g2 f4 }
        > |
 %%22
        < { [ g8 ~  f8 g8 e8 ] }  cis8  > < f4 d4 > |
index 4fe7e5418695c5c85a8fd70469e665cf2df88d90..e7ddad01eed140c24273724749845fc723918e9b 100644 (file)
@@ -11,7 +11,7 @@
 EndMudelaHeader
 %}
 
-\version "0.1.5";
+\version "0.1.6";
 
 \score{
        \melodic{\octave c';
@@ -28,7 +28,7 @@ EndMudelaHeader
                < { c ~ d }
                  { e ~ f }
                >
-       < \multi 2;
+       \multi 2 <
        { \stemup c'8 ~g ~e( ~c~ [c'~ g' e' )c'] c'' ~ c'' c~c }
        { \stemdown c (e g )c'~( [b a g )d]     r2 } 
        >
index ba5f3d82415ff7370e3c36959b15a0c304947d08..bbe4c65570fb9e415b25b4e3a963a9d0963381ee 100644 (file)
@@ -13,7 +13,7 @@ copyright     public domain
 multiple \paper{}s in one \score 
 %}
 
-\version "0.1.5";
+\version "0.1.6";
 
 commands = \melodic{
        \skip 2.*4;
@@ -202,7 +202,7 @@ begeleiding = \melodic{
        ''a r4 |
 %%5
 \duration 8;
-       < \multi 2; { \stemup   
+       \multi 2 < { \stemup    
                [ 'f 'a d 'a d 'a ] 
                [ 'd 'e 'g 'e 'g 'e ] 
                [ 'cis 'e 'g 'e 'g 'e ]
@@ -220,7 +220,7 @@ begeleiding = \melodic{
 %%10
        [ 'd 'a d 'a d 'a ] |
 %%11
-       < \multi 2;     
+       \multi 2 <      
        { \stemup
                [ 'f 'a d 'a d 'a ]
                [ 'd 'e 'g 'e 'g 'e ] 
@@ -237,7 +237,7 @@ begeleiding = \melodic{
        [ 'c 'g 'bes 'g 'bes 'g ] |
 %%16
        [ ''f 'c 'f 'c 'f 'c ] |
-       < \multi 2;
+       \multi 2 <
        { \stemup 
                [ ''a 'e 'g 'e 'g 'e ][ 'd 'a d 'a d 'a ]
                [ ''bes 'f 'bes 'f 'bes 'f ][ ''f 'c 'f 'c 'f 'c ] }
@@ -252,7 +252,7 @@ begeleiding = \melodic{
        < [ 'e 'c > 'g c 'g c 'g ] |
 %%22
        [ 'f 'a c 'a 'f 'c ] |
-       < \multi 2; {
+       \multi 2 < {
                \stemup
                [ ''a 'e 'g 'e 'g 'e ] 
                [ 'd 'fis 'a 'fis 'a 'fis ] 
@@ -305,7 +305,7 @@ begeleiding = \melodic{
 %%44
        < [ 'd ''b > 'fis 'b 'fis 'b 'fis ] |
 %%45
-       < \multi 2; { \stemup 
+       \multi 2 < { \stemup 
                [ ''g 'd 'b 'd 'b 'd ] 
                [ 'd 'a d 'a d 'a ] 
        } {
@@ -479,7 +479,6 @@ themusic =
                         \tekstII
                >
                \type Grandstaff   <
-                       \multi 2;
                        \melodic < \melodie \commands >
                        \melodic < \begeleiding \commands >
                >
index 1702aef9d02df619ed5ac1d28ba63a09994adb07..cb1f2fc770a61aa6ede2be6dc2754b62d3cd1057 100644 (file)
@@ -1,5 +1,4 @@
 \header{
-
 filename       toccata-fuga-E.ly
 title  toccata and fuga in E-major 
 opus   BWV 566
@@ -21,7 +20,7 @@ copyright     public domain
 %}
 
 
-\version "0.1.5";
+\version "0.1.6";
 
 toccata_commands = \melodic{
        \meter 4/4;
@@ -32,7 +31,7 @@ toccata_right = \melodic{
        \$toccata_commands 
        % 13 -- how to type -- where to split -- this more neatly ?
        \octave c';
-       <\multi 2;
+       \multi 2 <
                { \stemup r4 dis'4 e'4.-. e'8( | \property Voice.hshift = 1 )e'4 [d'8 fis'8] \property Voice.hshift = 0 gis'4 [gis'8 fis'16 e'16] | fis'4~  [fis'8 e'16 dis'16] e'4 r8 e'8 }
                { \stemup \property Voice.hshift = 1 r4 bis4 cis'4-. cis'4 | \property Voice.hshift = 0 a'4~  [a'16 gis'16 a'16 b'16] \property Voice.hshift = 1 dis'4 cis'4~  [cis'8 dis'16 a16] bis4 cis'4 r8 b8 }
                { \stemdown r4 < gis4 fis4 dis4 > gis4-. gis4 | a4. cis'8 gis2 | fis4 gis4 gis4 r8 e8 }
@@ -45,7 +44,7 @@ toccata_left = \melodic{
        \octave c;
        \clef bass;
        % 13
-       <\multi 2;
+       \multi 2 <
                { \stemup bis2 cis'4-. cis'4~  [cis'8 a8 d'8 cis'8] [bis8 gis8] cis'4 | dis'2 cis'4 r8 cis'8 }
                { \stemup \property Voice.hshift = 1 r4 gis4. gis8~  gis4 | \stemdown \property Voice.hshift = 0 a4. fis8 gis4. a8~  a4 gis4-. gis4 r8 gis8 }
                { \stemdown r4 < dis4 fis4 > < cis4 e4 > }
@@ -76,7 +75,7 @@ fuga2_right = \melodic{
        \clef violin;
        % 15
        \octave c';
-       <\multi 2;
+       \multi 2 <
                { \stemup [b8 fis8] b4 }
                { \stemdown fis2 }
        >
@@ -88,14 +87,14 @@ fuga2_right = \melodic{
            |x
            |
        %}
-       < \multi 2;
+       \multi 2 <
                { \stemup \property Voice.hshift = 0 e'4 }
                { \stemup \property Voice.hshift = 1 cis'4 }
                { \stemup \property Voice.hshift = 2 ais4 }
                { \stemdown fis4 }
        > |
        % 16
-       <\multi 2;
+       \multi 2 <
                { \stemup dis'2 dis'4 | cis'2 cis'4 | b4~  [b8 cis'8 dis'8 e'8] }
                { \stemup \property Voice.hshift = 1 [b8 fis8] b2~  [b8 a16 g16] a2 | a4 gis2 }
                { \stemdown fis2.~  fis2.~  fis4 e2 }
@@ -109,7 +108,7 @@ fuga2_left = \melodic{
        \clef bass;
        % 15
        b2 
-       <\multi 2; 
+       \multi 2 < 
                { \stemup ais4 | bes2. }
                { \stemdown e4  | fis2 fis4 }
        >
@@ -140,8 +139,8 @@ break = \melodic{
 
 % these should be two separate scores...
 \score{
-       < \multi 1;
-                \type Grandstaff = ""  < \multi 3;
+       \multi 1 <
+                \type Grandstaff  \multi 3 <
                   {\toccata_right     \break   \fuga2_right }
                   { \toccata_left  \break   \fuga2_left }
                > 
index 3f3fffccea3494893e769e627d10a6de1e012c3d..d6aa38a153535148b7d98e5a8acb6d54c6a8704b 100644 (file)
@@ -12,7 +12,7 @@ copyright             public domain
 Tested Features                lyrics and chords
 %}
 
-\version "0.1.5";
+\version "0.1.6";
 
 melodie = \melodic {
         \clef"violin";
index 52625da9bce0e0f0cbc152cc4b57b78787a80797..2ec9b40ee0f2b3d69cb87af620cdb82d2c08236a 100644 (file)
@@ -14,11 +14,12 @@ copyright   public domain
 Tested Features: lyrics
 
 %}
-\version "0.1.5";
+\version "0.1.6";
 
 melody = \melodic{
        \clef violin;
        \octave c';
+       
        c4 c | g g | a a | g g |
        f f | e e | d d8.( e16 | )c2 | % :|
 
@@ -121,12 +122,11 @@ textiii = \lyric{
 
 \score{
        < 
-               \melodic <
-                       \type Grandstaff
-                       < \multi 2; \global 
-                               \melody >
+               \type Grandstaff <
+                       < \global 
+                         \melody >
                        < \global 
-                               \accompany >
+                       \accompany >
                >
                
                % ugh
index 53764efbd08596cc9c169f4d5a4ba87979cec252..62a25c5338eb4832776797e6d26a422e801ab4a2 100644 (file)
@@ -11,7 +11,7 @@ copyright             Public Domain
 %{
        
 %}
-\version "0.1.5";
+\version "0.1.6";
 
 
 global = 
@@ -183,13 +183,12 @@ bass =
         
 \score {
     \melodic \type Grandstaff < 
-              \multi 1;
-                 < \multi 2;
+                \multi 2 <
                        \global 
                        \soprane
                        \tenor
                  >
-                 < \multi 2;
+                 \multi 2 <
                        \global
                        \alt
                       \bass
index 92ce1d3a12c41b2bd2cf5917a5a0f17f1eda6c84..608ec4b8735aa39a3316aae8c4a8f3baad8ed50f 100644 (file)
@@ -12,7 +12,7 @@ copyright             Public Domain
  Tested Features: stem direction, multivoice, forced accidentals.
 %}
 
-\version "0.1.5";
+\version "0.1.6";
 
                                     % should add \need{dutch.ini} for
                                     % correct parsing of note names
@@ -157,21 +157,21 @@ bassdux =
         [F16 G] As4 [G16 F] Es4 r8 es |
         [d c g G]
 %% 30
-        < \multi 2;
-        { \stemup c2~ | c1~ | c1 }
-        { \stemdown C2~ | C1~ | C1 }
+        \multi 2 <
+               { \stemup c2~ | c1~ | c1 }
+               { \stemdown C2~ | C1~ | C1 }
         >
     }
 
         
 \score {
     \melodic \type Grandstaff < 
-       \type Staff=treble < \multi 2; 
+       \type Staff=treble  < 
                        \global 
                        \dux
                        \comes 
                  >
-       \type Staff=bass < \multi 2;
+       \type Staff=bass  <
                        \global
                        \bassdux
                  >
index 49ae054af725dddcb5d7b9b19f5204e59829bf21..060b5866a5526f42414e73241bf76cc0f5eaf209 100644 (file)
@@ -8,7 +8,7 @@ enteredby               Shay Rojansky
 copyright              Public Domain
 }
 
-\version "0.1.5";
+\version "0.1.6";
 
 global = 
     \melodic {
@@ -23,7 +23,7 @@ soprane =
         \clef "violin";
         \octave c';
 
-       <\multi 2;
+       \multi 2 <
        % Real soprane
        {\stemup
        r8 [g16 c'] [e' g c' e'] r8 [g16 c'] [e' g c' e'] |
@@ -94,7 +94,7 @@ bass =
        b b |
        a a |   
 %% 10
-       <\multi 2;
+       \multi 2 <
        % Alt
        {\stemup
        r16 a8. ~ a4 r16 a8. ~ a4 |
@@ -163,12 +163,11 @@ bass =
         
 \score {
     \melodic \type Grandstaff < 
-              \multi 1;
-                 < \multi 2;
+                  <
                        \global 
                        \soprane
                  >
-                 < \multi 2;
+                  <
                        \global
                       \bass
                  >
index c6d2ee88d978a3da62dbe4afbc6fb75c6a5cca22..079e634ce38211e616931c2e66def5d6b2019fbe 100644 (file)
@@ -1,7 +1,7 @@
 # kept in dist bo stripping stable stuff, still to copy...
 
 # a bit of a hack to keep exec size under control.
-stablecc=atom.cc  bar.cc boxes.cc \
+stablecc=atom.cc  offset.cc meter.cc boxes.cc \
        keyword.cc leastsquares.cc \
        lookup.cc meter.cc\
        parser.cc notename-table.cc lexer.cc\
index deb594da78b432f066b6ea9dada5a5d513b00327..7876a844d8c5263a77494217365182cfbeacdf0b 100644 (file)
@@ -1,6 +1,6 @@
 MAJOR_VERSION = 0
 MINOR_VERSION = 1
-PATCH_LEVEL = 13
+PATCH_LEVEL = 14
 # use to send patches, always empty for released version:
 # include separator: ".postfix", "-pl" makes rpm barf
 
diff --git a/lily/axis-group-administration.cc b/lily/axis-group-administration.cc
new file mode 100644 (file)
index 0000000..5537d74
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+  axis-group.cc -- implement Axis_group_administration
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "interval.hh"
+#include "axis-group-administration.hh"
+#include "graphical-element.hh"
+#include "debug.hh"
+
+/** don't copy anything: an element can only be in one
+  Axis_group_element at one time.  */
+Axis_group_administration::Axis_group_administration (Axis_group_administration const&)
+{
+}
+
+bool 
+Axis_group_administration::contains_b (Graphical_element const *e) const
+{
+  return elem_l_arr_.find_l (e);
+}
+
+Interval
+Axis_group_administration::extent (Axis axis) const
+{
+  Interval r;
+  for (int i=0; i < elem_l_arr_.size(); i++) 
+    r.unite (elem_l_arr_[i]->extent (axis));
+  return r;
+}
+
+void
+Axis_group_administration::add_element (Graphical_element*e,
+                                       Axis_group_element*g, Axis a1, Axis a2)
+{
+  Axis_group_element *& g1 = e->axis_group_l_a_[a1];
+  Axis_group_element *& g2 = e->axis_group_l_a_[a2];
+  
+  assert (!g1 || g1 == g);
+  assert (!g2 || g2 == g);
+  g1 = g;
+  g2 = g;
+  elem_l_arr_.push (e);
+}
+
+
+
+void
+Axis_group_administration::remove_element (Graphical_element*e, Axis a1, Axis a2)
+{
+  assert (contains_b (e));
+  elem_l_arr_.unordered_substitute (e,0);
+  
+  e->axis_group_l_a_[a1] = 0;
+  e->axis_group_l_a_[a2] = 0;    
+}
+
+void
+Axis_group_administration::remove_all (Axis a1, Axis a2)
+{
+  for (int i=0; i < elem_l_arr_.size(); i++) 
+    {
+      Graphical_element*e=elem_l_arr_[i];
+      e->axis_group_l_a_[a1] = 0;
+      e->axis_group_l_a_[a2] = 0;  
+    }
+  elem_l_arr_.clear ();
+}
+
+
+void    
+Axis_group_administration::print() const
+{
+#ifndef NPRINT
+  for (int i=0; i < elem_l_arr_.size(); i++) 
+    DOUT << elem_l_arr_[i]->name () << ' ';
+#endif
+}
diff --git a/lily/axis-group-element.cc b/lily/axis-group-element.cc
new file mode 100644 (file)
index 0000000..8ef35c0
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+  axis-group-element.cc -- implement Axis_group_element
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "axis-group-element.hh"
+
+void
+Axis_group_element::do_unlink()
+{
+  remove_all();
+}
+
+void
+Axis_group_element::do_junk_links()
+{
+  axis_admin_.elem_l_arr_.set_size (0);
+}
+
+
+bool
+Axis_group_element::contains_b (Graphical_element const*e) const
+{
+  return axis_admin_.contains_b (e);
+}
+
+Link_array<Score_elem>
+Axis_group_element::get_extra_dependencies() const
+{
+  return elem_l_arr ();
+}
+
+Link_array<Score_elem>
+Axis_group_element::elem_l_arr () const
+{  
+  /*
+    ugh. I know
+   */
+  Link_array<Score_elem> r;
+  for (int i=0; i < axis_admin_.elem_l_arr_.size (); i++)
+    r.push ((Score_elem*)axis_admin_.elem_l_arr_[i]);
+  return r;
+}
+
+void
+Axis_group_element::do_print() const
+{
+  axis_admin_.print();
+}
+
+
+Axis_group_element::Axis_group_element()
+{
+  transparent_b_ = true;
+}
+
index d033d9757166add91c8e565dda288b1cb3741856..f22332098be9e7e77984fdb5b93d935c1e30c13a 100644 (file)
@@ -13,7 +13,7 @@ IMPLEMENT_IS_TYPE_B2(Axis_group_item, Axis_group_element, Item);
 void
 Axis_group_item::OK() const
 {
-  Link_array<Score_elem> elems = axis_admin_.elem_l_arr_; 
+  Link_array<Score_elem> elems = elem_l_arr ();
   for (int i=0; i < elems.size(); i++) 
     {
       Item * it_l = elems[i]->item();
@@ -31,7 +31,7 @@ Axis_group_item::do_breakable_col_processing()
   copy_breakable_items();
   
            
-  Link_array<Score_elem> elems = axis_admin_.elem_l_arr_; 
+  Link_array<Score_elem> elems = elem_l_arr ();
   for (int i=0; i < elems.size(); i++) 
     {
       Item* it_l = elems[i]->item();
@@ -51,4 +51,5 @@ void
 Axis_group_item::do_print() const
 { 
   Axis_group_element::do_print(); 
+  Item::do_print ();
 }
index 033a55b33a25be97a84e0af417556f87249d7bc6..42050ae5b4499fda404da13cd5c55757b7890361 100644 (file)
@@ -17,7 +17,7 @@
 void
 Axis_group_spanner::do_break_processing_if_unbroken()
 {
-  Link_array<Score_elem> elems = axis_admin_.elem_l_arr_;
+  Link_array<Score_elem> elems = elem_l_arr ();
   Line_of_score *my_line = line_l();
   for (int i=0; i < elems.size(); i++) 
     {
@@ -49,7 +49,7 @@ Axis_group_spanner::do_break_processing()
     }
 
   break_into_pieces ();
-  Link_array<Score_elem> loose_elems = axis_admin_.elem_l_arr_;
+  Link_array<Score_elem> loose_elems = elem_l_arr ();
   remove_all();
   
   for (int i=0; i < loose_elems.size(); i++) 
diff --git a/lily/axis-group.cc b/lily/axis-group.cc
deleted file mode 100644 (file)
index b0161fa..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
-  axis-group.cc -- implement Axis_group_administration
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-#include "interval.hh"
-#include "axis-group-administration.hh"
-#include "score-elem.hh"
-#include "debug.hh"
-
-/** don't copy anything: an element can only be in one
-  Axis_group_element at one time.  */
-Axis_group_administration::Axis_group_administration (Axis_group_administration const&)
-{
-}
-
-bool 
-Axis_group_administration::contains_b (Score_elem const *e) const
-{
-  return elem_l_arr_.find_l (e);
-}
-
-Interval
-Axis_group_administration::extent (Axis axis) const
-{
-  Interval r;
-  for (int i=0; i < elem_l_arr_.size(); i++) 
-    r.unite (elem_l_arr_[i]->extent (axis));
-  return r;
-}
-
-void
-Axis_group_administration::add_element (Score_elem*e,
-                                       Axis_group_element*g, Axis a1, Axis a2)
-{
-  Axis_group_element *& g1=e->axis_group_l_a_[a1];
-  Axis_group_element *& g2 = e->axis_group_l_a_[a2];
-  
-  assert (!g1 || g1 == g);
-  assert (!g2 || g2 == g);
-  g1 = g;
-  g2 = g;
-  elem_l_arr_.push (e);
-}
-
-
-
-void
-Axis_group_administration::remove_element (Score_elem*e, Axis a1, Axis a2)
-{
-  assert (contains_b (e));
-  elem_l_arr_.unordered_substitute (e,0);
-  
-  e->axis_group_l_a_[a1] = 0;
-  e->axis_group_l_a_[a2] = 0;    
-}
-
-void
-Axis_group_administration::remove_all (Axis a1, Axis a2)
-{
-  for (int i=0; i < elem_l_arr_.size(); i++) 
-    {
-      Score_elem*e=elem_l_arr_[i];
-      e->axis_group_l_a_[a1] = 0;
-      e->axis_group_l_a_[a2] = 0;  
-    }
-  elem_l_arr_.clear();
-}
-
-
-void    
-Axis_group_administration::print() const
-{
-#ifndef NPRINT
-  for (int i=0; i < elem_l_arr_.size(); i++) 
-    DOUT << elem_l_arr_[i]->name() << ' ';
-#endif
-}
index 7ba3f2d77b953fea9b87b3709005d290857c3a56..43811f88c63fd8ccf9a788c4046b89fa35bb9cd3 100644 (file)
@@ -35,7 +35,7 @@ Bar::brew_molecule_p() const
 {    
   Paper_def *p = paper();
   Symbol s = p->lookup_l()->bar (type_str_, 
-                                  p->get_var ("bar_size"));
+                                p->get_var ("bar_size"));
   Molecule*output = new Molecule (Atom (s));
   return output;
 }
index bfaf3e12ace8a6a1be9eb8368b8f446d88be99ea..68d798ae25e5d146e7a73cbe8cb2de67aac8c71a 100644 (file)
@@ -116,11 +116,7 @@ Beam_engraver::acknowledge_element (Score_elem_info i)
    */
   current_grouping_p_->add_child (get_staff_info().time_C_->whole_in_measure_,
                                  rhythmic_req->duration ());
-  /* 
-   TODO
-   should change repr. of flags too.
-   */
-  s->flag_i_ = Duration_convert::type2_i (rhythmic_req->duration_.durlog_i_);
+  s->flag_i_ = rhythmic_req->duration_.durlog_i_;
   beam_p_->add (s);
 } 
     
index a696c646ce371f7dc97ff914350547210869244d..27825954b61eddc731d51582e61f7bad803e0b4d 100644 (file)
@@ -262,7 +262,7 @@ Beam::set_grouping (Rhythmic_grouping def, Rhythmic_grouping cur)
       {
        Stem *s = stems[j];
 
-       int f = intlog2(abs (s->flag_i_))-2;
+       int f = s->flag_i_ - 2;
        assert (f>0);
        flags.push (f);
       }
index 4a219a4864cbac2e299372ec8df701dee2fc630d..1bf7177336a380ca81c506c0f645fabe56d59860 100644 (file)
@@ -1,3 +1,11 @@
+/*
+  boxes.cc -- implement Box
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include "boxes.hh"
 #include "varray.hh"
 
diff --git a/lily/break-caching.cc b/lily/break-caching.cc
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
index 7f5139a831cf183e000918246d0cd60f0c1ab618..5ee9de0a0ba03311c66c3803c55c4779fbfe860a 100644 (file)
@@ -14,6 +14,7 @@
 #include "scoreline.hh"
 #include "p-score.hh"
 #include "p-col.hh"
+#include "cpu-timer.hh"
 
 String
 Col_stats::str() const { 
@@ -163,7 +164,17 @@ Break_algorithm::OK() const
 Array<Col_hpositions>
 Break_algorithm::solve() const
 {
-  return do_solve();
+  Cpu_timer timer;
+
+  Array<Col_hpositions> h= do_solve();
+  
+  if (approx_stats_.count_i_)
+    *mlog << "\nApproximated: " << approx_stats_.str() << "\n";
+  if (exact_stats_.count_i_)
+    *mlog << "Calculated exactly: " << exact_stats_.str() << "\n";
+  *mlog << "Time: " << String(timer.read (), "%.2f") << " seconds\n";
+  
+  return h;
 }
 
 void
@@ -172,11 +183,3 @@ Break_algorithm::do_set_pscore()
   
 }
 
-void
-Break_algorithm::print_stats() const
-{
-  if (approx_stats_.count_i_)
-    *mlog << "\nApproximated: " << approx_stats_.str() << "\n";
-  if (exact_stats_.count_i_)
-    *mlog << "Calculated exactly: " << exact_stats_.str() << "\n";
-}
diff --git a/lily/change-iterator.cc b/lily/change-iterator.cc
new file mode 100644 (file)
index 0000000..c6ebf29
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+  change-iterator.cc -- implement 
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "change-iterator.hh"
+#include "translator-group.hh"
+#include "change-translator.hh"
+
+Change_iterator::Change_iterator (Change_translator *change_l)
+{
+  change_l_ = change_l;
+}
+
+/*
+  move to construct_children ?
+ */
+void
+Change_iterator::process_and_next (Moment m)
+{
+  Translator_group * current = report_to_l ();
+  Translator_group * last = 0;
+  while  (current && current->type_str_ != change_l_->change_to_type_str_)
+    {
+      last = current;
+      current = current->daddy_trans_l_;
+    }
+  if (current) 
+    {
+      Translator_group * dest = 
+       report_to_l ()->find_create_translator_l (change_l_->change_to_type_str_, 
+                                                 change_l_->change_to_id_str_);
+      current->remove_translator_p (last);
+      dest->add (last);
+    }
+  
+  Music_iterator::process_and_next (m);
+}
+
+IMPLEMENT_IS_TYPE_B1 (Change_iterator, Music_iterator);
diff --git a/lily/change-translator.cc b/lily/change-translator.cc
new file mode 100644 (file)
index 0000000..be406c7
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+  change-translator.cc -- implement Change_translator
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "change-translator.hh"
+#include "debug.hh"
+
+IMPLEMENT_IS_TYPE_B1(Change_translator,Music);
+
+void
+Change_translator::do_print () const
+{
+  DOUT << "change " << change_to_type_str_ << " to " << change_to_id_str_ ;
+}
+  
index 80db90709c23e2ee6997dee17865b5cdfc4a2e25..83c5435ed6aa043031c25407e532ec273caa5bc7 100644 (file)
@@ -26,13 +26,14 @@ void
 Chord_iterator::construct_children()
 {
   int j = 0;
-  for (PCursor<Music*> i (chord_C_->music_p_list_.top());  //, int j = 0; 
+  for (PCursor<Music*> i (chord_C_->music_p_list_.top());  
        i.ok(); j++, i++) 
     {
-      Music_iterator * mi =  get_iterator_p (i.ptr());
+      Music_iterator * mi = get_iterator_p (i.ptr());
       if (mi->ok()) 
        {
-         set_translator (mi->report_to_l()->ancestor_l (chord_C_->multi_level_i_));
+         if  (!chord_C_->translator_type_str_)
+           set_translator (mi->report_to_l()->ancestor_l (chord_C_->multi_level_i_));
          children_p_list_.bottom().add (mi);
        }
       else 
index ad4814202cdad50c9fdbd61e8ecb1e2f26f7a1c0..5571327077b044327266ec917131e3020cf01c1b 100644 (file)
@@ -63,7 +63,7 @@ Clef_engraver::read_req (Clef_change_req*c_l)
 void
 Clef_engraver::acknowledge_element (Score_elem_info info)
 {
-  if (info.elem_l_->name() == Bar::static_name ()) 
+  if (info.elem_l_->name() == Bar::static_name () && clef_type_str_
     {
       create_clef();
       if (!clef_req_l_)
@@ -74,12 +74,11 @@ Clef_engraver::acknowledge_element (Score_elem_info info)
 void
 Clef_engraver::do_creation_processing()
 {
-   Scalar def = get_property ("defaultclef");
+  Scalar def = get_property ("defaultclef");
   if (def)
     set_type (def);
-  else
-    set_type ("violin");
- create_clef();
+  if (clef_type_str_)
+    create_clef();
   clef_p_->default_b_ = false;
 }
 
@@ -90,8 +89,7 @@ Clef_engraver::do_try_request (Request * r_l)
   if (!creq_l || !creq_l->clefchange())
     return false;
 
-  clef_req_l_ = creq_l->clefchange();
-  
+  clef_req_l_ = creq_l->clefchange();  
   read_req (clef_req_l_); 
   return true;
 }
@@ -120,12 +118,12 @@ Clef_engraver::do_process_requests()
 void
 Clef_engraver::do_pre_move_processing()
 {
-  if (!clef_p_)
-    return;
-  typeset_element (clef_p_);
-  clef_p_ = 0;
+  if (clef_p_)
+    {
+      typeset_element (clef_p_);
+      clef_p_ = 0;
+    }
 }
-  
 void
 Clef_engraver::do_post_move_processing()
 {
index fc579ec3475298fb3b631e87e482ba53a342ec5d..920d2c5512fda8c06d55f21e120f2fb036416fc9 100644 (file)
@@ -21,7 +21,7 @@ Clef_item::do_pre_processing()
 
   if (default_b_)
     {
-      empty_b_ = (break_status_i() != 1);
+      set_empty(break_status_i() != 1);
       transparent_b_ = (break_status_i() != 1);
     }
 }
index 8c4c573b26e478654de6b38fca1bb58536c05eaa..4e215381cf37f1e6104012a34997d5f197fe33eb 100644 (file)
 #include "item.hh"
 #include "debug.hh"
 
-void
-Axis_group_element::do_unlink()
-{
-  remove_all();
-}
-
-void
-Axis_group_element::do_junk_links()
-{
-  axis_admin_.elem_l_arr_.set_size (0);
-}
-
-
-bool
-Axis_group_element::contains_b (Score_elem const*e) const
-{
-  return axis_admin_.contains_b (e);
-}
-
-Link_array<Score_elem>
-Axis_group_element::get_extra_dependencies() const
-{
-  return axis_admin_.elem_l_arr_;
-}
-
-void
-Axis_group_element::do_print() const
-{
-  axis_admin_.print();
-}
-
-
-Axis_group_element::Axis_group_element()
-{
-  transparent_b_ = true;
-}
-
-// ****************
-
 
 void
-Vertical_group_element::add_element (Score_elem*e)
+Vertical_group_element::add_element (Graphical_element*e)
 {
   axis_admin_.add_element (e, this, Y_AXIS, Y_AXIS);
 }
 
 void
-Vertical_group_element::remove_element (Score_elem*e)
+Vertical_group_element::remove_element (Graphical_element*e)
 {
   axis_admin_.remove_element (e, Y_AXIS, Y_AXIS);
 }
@@ -84,13 +45,13 @@ Horizontal_group_element::remove_all()
 }
 
 void
-Horizontal_group_element::add_element (Score_elem*e)
+Horizontal_group_element::add_element (Graphical_element*e)
 {
   axis_admin_.add_element (e,this, X_AXIS,X_AXIS);
 }
 
 void
-Horizontal_group_element::remove_element (Score_elem*e)
+Horizontal_group_element::remove_element (Graphical_element*e)
 {
   axis_admin_.remove_element (e,X_AXIS,X_AXIS);
 }
@@ -111,13 +72,13 @@ Horizontal_vertical_group_element::remove_all()
   axis_admin_.remove_all (X_AXIS,Y_AXIS);
 }
 void
-Horizontal_vertical_group_element::add_element (Score_elem *e)
+Horizontal_vertical_group_element::add_element (Graphical_element *e)
 {
   axis_admin_.add_element (e, this, X_AXIS, Y_AXIS);
 }
 
 void
-Horizontal_vertical_group_element::remove_element (Score_elem*e)
+Horizontal_vertical_group_element::remove_element (Graphical_element*e)
 {
   axis_admin_.remove_element (e, X_AXIS, Y_AXIS);
 }
index 740899418b133a2f71c053397ecc3d16f31f98ed..9806130d140f79d2502223e44505bf889bc6d9c8 100644 (file)
@@ -14,7 +14,6 @@
 #include "p-score.hh"
 #include "paper-def.hh"
 
-
 const HAPPY_DOTS_I = 3;
 
 /**
@@ -41,7 +40,6 @@ struct Break_node {
 Array<Col_hpositions>
 Gourlay_breaking::do_solve() const
 {
-
   Array<Break_node> optimal_paths;
   Line_of_cols all = all_cols();
   Array<int> breaks = find_break_indices();
@@ -170,20 +168,9 @@ Gourlay_breaking::do_solve() const
       i = optimal_paths[i].prev_break_i_;
     }
 
-  print_stats();
-  /*
-    TODO print variation in energy
-   */
-  if (max_energy_f) 
-    {
-      ;
-    }
-  
-  
 
   for (int i= final_breaks.size(); i--;) 
     lines.push (optimal_paths[final_breaks[i]].line_config_);
-
   
   return lines;
 }
diff --git a/lily/graphical-element.cc b/lily/graphical-element.cc
new file mode 100644 (file)
index 0000000..98f29f7
--- /dev/null
@@ -0,0 +1,188 @@
+/*
+  graphical-element.cc -- implement Graphical_element
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "graphical-element.hh"
+#include "axis-group-element.hh"
+#include "debug.hh"
+
+Graphical_element::Graphical_element ()
+{
+  init ();
+}
+
+Graphical_element::Graphical_element (Graphical_element const &s)
+{
+  init ();
+  empty_b_ = s.empty_b_;
+  axis_group_l_a_[0] = axis_group_l_a_[1] =0;
+  offset_ = Offset (0,0);
+} 
+
+Graphical_element::~Graphical_element ()
+{
+  
+}
+
+void
+Graphical_element::init ()
+{
+  empty_b_ = false;
+  axis_group_l_a_[X_AXIS] = axis_group_l_a_[Y_AXIS] =0;
+  offset_ = Offset (0,0);
+  cached_valid_b_a_ [X_AXIS] = cached_valid_b_a_[Y_AXIS] = false;
+}
+
+void
+Graphical_element::invalidate_cache (Axis a)
+{
+  Graphical_element * g = this;
+  while (g && g->cached_valid_b_a_[a])
+    {
+      g->cached_valid_b_a_ [a] = false;  
+      g = g->axis_group_l_a_[a];
+    }
+}
+
+Real
+Graphical_element::absolute_coordinate (Axis a) const
+{
+  Real r = offset_[a];
+  for (Axis_group_element * axis_group_l = axis_group_l_a_[a];
+       axis_group_l; axis_group_l = axis_group_l->axis_group_l_a_[a])
+       
+    r += axis_group_l->offset_[a];
+  return r;
+}
+
+Offset
+Graphical_element::absolute_offset() const
+{
+  return Offset (absolute_coordinate (X_AXIS), absolute_coordinate (Y_AXIS));
+}
+
+void
+Graphical_element::translate (Real y, Axis a)
+{
+  if (axis_group_l_a_[a])
+    axis_group_l_a_[a]->invalidate_cache (a);
+  offset_[a] += y;
+}
+
+Real
+Graphical_element::relative_coordinate (Axis_group_element*e, Axis a) const
+{
+  Real r =0.0;
+  for (Axis_group_element * axis_group_l = axis_group_l_a_[a];
+       axis_group_l != e;
+       axis_group_l = axis_group_l->axis_group_l_a_[a])
+    r +=  axis_group_l->offset_[a];
+
+  return r;
+}
+
+Axis_group_element* 
+Graphical_element::common_group (Graphical_element const* s, Axis a) const
+{
+  Link_array<Axis_group_element> my_groups;
+  for (Axis_group_element * axis_group_l = axis_group_l_a_[a];
+       axis_group_l;
+       axis_group_l = axis_group_l->axis_group_l_a_[a])
+    my_groups.push (axis_group_l);
+
+  Axis_group_element* common_l=0;
+  for (Axis_group_element * axis_group_l = s->axis_group_l_a_[a];
+       !common_l && axis_group_l;
+       axis_group_l = axis_group_l->axis_group_l_a_[a])
+    common_l = my_groups.find_l (axis_group_l);
+
+  return common_l;
+}
+
+
+
+void
+Graphical_element::translate (Offset offset)
+{
+  translate (offset[Y_AXIS], Y_AXIS);
+  translate (offset[X_AXIS], X_AXIS);
+}
+
+Interval
+Graphical_element::width() const
+{
+  return extent (X_AXIS);
+}
+
+void
+Graphical_element::set_empty (bool b)
+{
+  if (empty_b_ != b)
+    {
+      empty_b_ = b;
+      if (!empty_b_)
+       {
+         invalidate_cache (X_AXIS);
+         invalidate_cache (Y_AXIS);
+       }
+    }
+  
+}
+
+Interval
+Graphical_element::extent (Axis a) const
+{
+  if (empty_b_)
+    return Interval ();
+  
+  if (!cached_valid_b_a_[a])
+    {
+      Graphical_element *self = (Graphical_element*)this;
+      self->cached_dimension_a_[a] = (a == X_AXIS)? do_width(): do_height ();
+      self->cached_valid_b_a_[a] = true;
+    }
+  
+  Interval r(cached_dimension_a_[a]);
+  if (!r.empty_b()) // float exception on DEC Alpha
+    r+=offset_[a];
+
+  return r;
+}
+
+Interval
+Graphical_element::height() const
+{
+  return extent (Y_AXIS);
+}
+
+void
+Graphical_element::unlink ()
+{
+    for (int j=0; j < 2; j++)
+    if (axis_group_l_a_[j])
+      axis_group_l_a_[j]->remove_element (this);
+}
+
+void
+Graphical_element::junk_links ()
+{
+    axis_group_l_a_[X_AXIS] = axis_group_l_a_[Y_AXIS] =0;
+}
+
+void
+Graphical_element::print () const
+{
+#ifndef NPRINT
+  if (offset_.x() || offset_.y ())
+    DOUT << "offset: " << offset_.str() ;
+  DOUT << "\n";
+#endif
+}
+
+IMPLEMENT_IS_TYPE_B(Graphical_element);
+
index 48701d148a9b9e9545209da0af0c15baf8ec8ec2..6e63be3daa6177a9e19226e0b76ef56d3a202100 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 #include "horizontal-align-item.hh"
-
+#include "debug.hh"
 
 IMPLEMENT_IS_TYPE_B1(Horizontal_align_item,Item);
 
@@ -114,12 +114,18 @@ Horizontal_align_item::do_width() const
 void
 Horizontal_align_item::do_print() const
 {
+#ifndef NPRINT
+  Item::do_print ();
+  DOUT << "contains: ";
+  for (int i=0 ;  i < item_l_arr_.size(); i++) 
+    DOUT << item_l_arr_[i]->name () << ", ";
+#endif
 }
 
 Horizontal_align_item::Horizontal_align_item()
 {
   center_l_ = 0;
   align_i_ = 0;
-  empty_b_ = true;
+  set_empty (true);
   transparent_b_ = true;
 }
index 77007f8ff1ab66ee97eb29b3f4261be0cb1d72a4..d7e33e4c7e35e587bafeec8bebe1be3eb30a4645 100644 (file)
@@ -20,7 +20,7 @@
   Do the dirty work for Axis_group_element.
  */
 struct Axis_group_administration {
-  Link_array<Score_elem> elem_l_arr_;
+  Link_array<Graphical_element> elem_l_arr_;
     
   Interval extent (Axis) const;
   void print() const ;
@@ -28,9 +28,9 @@ struct Axis_group_administration {
   Axis_group_administration(){}
   void remove_all (Axis a1,   Axis a2);
 
-  bool contains_b (Score_elem const *) const;
-  void add_element (Score_elem*, Axis_group_element*, Axis a1, Axis a2);
-  void remove_element (Score_elem*, Axis a1, Axis a2);
+  bool contains_b (Graphical_element const *) const;
+  void add_element (Graphical_element*, Axis_group_element*, Axis a1, Axis a2);
+  void remove_element (Graphical_element*, Axis a1, Axis a2);
 };
 
 #endif // AXIS_GROUP_ADMINISTRATION_HH
index 42a31fd42365842d9fcf8bd6a2c01353bba64334..b79b70084ecb25a89e2b3725c95e035f611b74b9 100644 (file)
@@ -25,11 +25,12 @@ protected:
   virtual void do_junk_links();
 
 public:
+  virtual Link_array<Score_elem> elem_l_arr() const;
   Axis_group_element();
   virtual void remove_all()=0;
-  virtual void add_element (Score_elem*)=0;
-  virtual void remove_element (Score_elem*)=0;
-  virtual bool contains_b (Score_elem const *) const;
+  virtual void add_element (Graphical_element*)=0;
+  virtual void remove_element (Graphical_element*)=0;
+  virtual bool contains_b (Graphical_element const *) const;
   DECLARE_MY_RUNTIME_TYPEINFO;
 };
 
diff --git a/lily/include/axis-group.hh b/lily/include/axis-group.hh
deleted file mode 100644 (file)
index 152688c..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
-axis-group-element.hh -- declare Axis_group_administration, Axis_group_element
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#error
-#ifndef Axis_group_administration_HH
-#define Axis_group_administration_HH#endif // Axis_group_administration_HH
index b77414482e8a4ee6abd8619728ea4ea87e52b259..851aa726cfd7543752fe4b1fc31a1efe150ffb46 100644 (file)
  */
 struct Col_stats
 {
-    int count_i_;
-    int cols_i_;
+  int count_i_;
+  int cols_i_;
 
-    Col_stats(); 
-    void add (Line_of_cols const&l);
-    String str() const;
+  Col_stats(); 
+  void add (Line_of_cols const&l);
+  String str() const;
 };
 
 /** Class representation of an algorithm which decides where to put
@@ -36,45 +36,43 @@ struct Col_stats
 class Break_algorithm {
 protected:
 
-    Paper_score *pscore_l_;
-    Real linelength;
+  Paper_score *pscore_l_;
+  Real linelength;
 
-    /// search all pcols which are breakable.
-    Line_of_cols find_breaks() const;
+  /// search all pcols which are breakable.
+  Line_of_cols find_breaks() const;
 
-    Line_of_cols all_cols() const;
-    Array<int> find_break_indices() const;
+  Line_of_cols all_cols() const;
+  Array<int> find_break_indices() const;
     
 
-    /// helper: solve for the columns in #curline#.
-    void solve_line (Col_hpositions*) const;
+  /// helper: solve for the columns in #curline#.
+  void solve_line (Col_hpositions*) const;
 
-    /// helper: approximate the energyv
-    void approximate_solve_line (Col_hpositions*) const;
+  /// helper: approximate the energyv
+  void approximate_solve_line (Col_hpositions*) const;
 
-    /// does curline fit on the paper?    
-    bool feasible (Line_of_cols) const;
+  /// does curline fit on the paper?    
+  bool feasible (Line_of_cols) const;
     
 
-    Line_spacer* generate_spacing_problem (Line_of_cols) const;
+  Line_spacer* generate_spacing_problem (Line_of_cols) const;
 
-    virtual Array<Col_hpositions> do_solve() const=0;
-    void print_stats() const;
-
-    virtual void do_set_pscore();
+  virtual Array<Col_hpositions> do_solve() const=0;
+   virtual void do_set_pscore();
 public:
-    Col_stats approx_stats_;
-    Col_stats exact_stats_;
-
-    Line_spacer* (*get_line_spacer)();
+  Col_stats approx_stats_;
+  Col_stats exact_stats_;
+  
+  Line_spacer* (*get_line_spacer)();
     
-    Break_algorithm();
-    void set_pscore (Paper_score*);
+  Break_algorithm();
+  void set_pscore (Paper_score*);
 
-    /// check if the spacing/breaking problem is well-stated
-    void problem_OK() const;
-    void OK() const;
-    Array<Col_hpositions> solve() const;
+  /// check if the spacing/breaking problem is well-stated
+  void problem_OK() const;
+  void OK() const;
+  Array<Col_hpositions> solve() const;
 };
 
 #endif // BREAK_HH
diff --git a/lily/include/change-iterator.hh b/lily/include/change-iterator.hh
new file mode 100644 (file)
index 0000000..bde2628
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+  change-iterator.hh -- declare 
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef CHANGE_ITERATOR_HH
+#define CHANGE_ITERATOR_HH
+
+#include "music-iterator.hh"
+
+
+class Change_iterator : public Music_iterator
+{
+  Change_translator *change_l_;
+  
+public:
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  Change_iterator (Change_translator* prop_l);
+protected:
+  virtual void process_and_next (Moment);
+};
+
+#endif
diff --git a/lily/include/change-translator.hh b/lily/include/change-translator.hh
new file mode 100644 (file)
index 0000000..ade016e
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+  change-translator.hh -- declare Change_translator
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef CHANGE_TRANSLATOR_HH
+#define CHANGE_TRANSLATOR_HH
+
+#include "music.hh"
+
+class Change_translator : public Music
+{
+public:
+  String change_to_type_str_;
+  String change_to_id_str_;
+  DECLARE_MY_RUNTIME_TYPEINFO;
+protected:
+  VIRTUAL_COPY_CONS(Change_translator, Music);
+  void do_print () const;
+};
+
+
+#endif // CHANGE_TRANSLATOR_HH
index 52475d905a6667b6bab809fc2123e9e4a83494bb..ab79afea9c827dfa34c131dd943240c4d182fcb6 100644 (file)
@@ -24,8 +24,8 @@ protected:
   virtual void do_unlink () { Horizontal_vertical_group_element::do_unlink (); }
   SCORE_ELEM_CLONE(Horizontal_vertical_group_item);
 public:
-  virtual void add_element (Score_elem*e) { Horizontal_vertical_group_element::add_element (e); }
-  virtual void remove_element (Score_elem*e) { Horizontal_vertical_group_element::remove_element (e); }
+  virtual void add_element (Graphical_element*e) { Horizontal_vertical_group_element::add_element (e); }
+  virtual void remove_element (Graphical_element*e) { Horizontal_vertical_group_element::remove_element (e); }
 
   DECLARE_MY_RUNTIME_TYPEINFO;
 };
index 0edd067ec21814df8186765bdce7eaada035689b..82ab4cc787517a1883e8bd518cd0d92aea0e4298 100644 (file)
@@ -26,8 +26,8 @@ protected:
 
 public:
     DECLARE_MY_RUNTIME_TYPEINFO;
-    virtual void add_element (Score_elem*);
-    virtual void remove_element (Score_elem*);
+    virtual void add_element (Graphical_element*);
+    virtual void remove_element (Graphical_element*);
 
 };
 /**
@@ -39,8 +39,8 @@ protected:
     virtual void remove_all();
 
 public:
-    virtual void add_element (Score_elem*);
-    virtual void remove_element (Score_elem*);
+    virtual void add_element (Graphical_element*);
+    virtual void remove_element (Graphical_element*);
     DECLARE_MY_RUNTIME_TYPEINFO;
 };
 
@@ -54,8 +54,8 @@ class Horizontal_vertical_group_element : public Vertical_group_element,
 protected:
     virtual void remove_all();
 public:
-    virtual void add_element (Score_elem*);
-    virtual void remove_element (Score_elem*);
+    virtual void add_element (Graphical_element*);
+    virtual void remove_element (Graphical_element*);
     
     DECLARE_MY_RUNTIME_TYPEINFO;    
 };
diff --git a/lily/include/graphical-element.hh b/lily/include/graphical-element.hh
new file mode 100644 (file)
index 0000000..fae4032
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+  graphical-element.hh -- declare Graphical_element
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef GRAPHICAL_ELEMENT_HH
+#define GRAPHICAL_ELEMENT_HH
+
+#include "offset.hh"
+#include "lily-proto.hh"
+#include "interval.hh"
+#include "virtual-methods.hh"
+
+/** The 2d geometric aspects of a score-element.  It was put in a
+  separate class, because Score_elem got quite big.
+
+  */
+class Graphical_element 
+{
+  void init ();
+  /** Is this element dimensionless?.
+    This is private to guarantee correctness of the cache
+   */
+  bool empty_b_;
+  
+public:
+  void set_empty (bool);
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  /**
+    This is  needed, because #output# may still be
+    NULL.
+    */
+  Offset offset_;
+  
+  Axis_group_element * axis_group_l_a_[NO_AXES];
+  Interval cached_dimension_a_[NO_AXES];
+  bool cached_valid_b_a_[NO_AXES];
+  
+  Graphical_element ();
+  Graphical_element (Graphical_element const&);
+  virtual ~Graphical_element ();
+  
+  void invalidate_cache (Axis);
+  Interval extent (Axis) const;
+  Interval width() const;
+  Interval height() const;
+  /**
+    translate the symbol. The symbol does not have to be created yet. 
+    */
+  void translate (Offset);
+  /**
+    translate in one direction
+    */
+    
+  void translate (Real, Axis);
+
+  Real relative_coordinate (Axis_group_element*group, Axis) const;
+  Offset absolute_offset() const;
+  Real absolute_coordinate (Axis) const;
+  /**
+    Find the group-element which has both #this# and #s#
+   */
+  Axis_group_element*common_group (Graphical_element const* s, Axis a) const;
+  void unlink ();
+  void junk_links ();
+  void print () const;
+protected:
+  virtual Interval do_height () const=0;
+  virtual Interval do_width () const=0;
+};
+
+#endif // GRAPHICAL_ELEMENT_HH
+
diff --git a/lily/include/head-column.hh b/lily/include/head-column.hh
new file mode 100644 (file)
index 0000000..e69de29
index 35918c95706313a092d1e2b7b042c4a14a74ae94..10d8106b1d5eb790fe6ede1ef08d765e9b22e30e 100644 (file)
@@ -27,8 +27,8 @@ protected:
   }
   virtual void do_print() const;
 public:
-  virtual void add_element (Score_elem*e) { Horizontal_group_element::add_element (e); }
-  virtual void remove_element (Score_elem*e) { Horizontal_group_element::remove_element (e); }
+  virtual void add_element (Graphical_element*e) { Horizontal_group_element::add_element (e); }
+  virtual void remove_element (Graphical_element*e) { Horizontal_group_element::remove_element (e); }
   DECLARE_MY_RUNTIME_TYPEINFO;
   SCORE_ELEM_CLONE(Horizontal_group_item);
 };
diff --git a/lily/include/input-translator.hh b/lily/include/input-translator.hh
deleted file mode 100644 (file)
index 115a48a..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-  input-translator.hh -- declare Input_translator
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef INPUT_TRANSLATOR_HH
-#define INPUT_TRANSLATOR_HH
-
-#include "plist.hh"
-#include "string.hh"
-#include "lily-proto.hh"
-#include "input.hh"
-#include "string.hh"
-#error 
-#include "varray.hh"
-
-struct Input_translator_list : public Pointer_list<Input_translator*> 
-{
-  Input_translator_list (Input_translator_list const &);
-  Input_translator_list(){}
-  ~Input_translator_list(){}
-};
-
-/** Define a intereter for music. This is an runtime interface to the
- typesystem */
-class Input_translator : public Input { 
-public:
-  Input_translator_list contains_itrans_p_list_;
-  Array<String> consists_str_arr_;
-  Array<String> alias_str_arr_;
-  String base_str_;
-  String type_str_;
-  String default_id_str_;
-
-  void add (Input_translator *);
-  bool is_name_b (String);
-  bool accept_req_b();
-  bool accepts_b (String);
-  void print() const;
-  Translator_group * get_group_translator_p();
-  Input_translator * get_default_itrans_l();
-  Input_translator * recursive_find (String nm);
-  Input_translator * find_itrans_l (String nm);    
-};
-
-#endif // Input_translator_HH
index 575b52afbd493f261075fa4a7169c8d9b6b87f1e..7c735faa272ec351c62055a95ed29ab8e1bd00b7 100644 (file)
@@ -46,7 +46,7 @@ struct Break_align_item;
 struct Bracket_req;
 struct Cadenza_req;
 struct Change_iterator;
-struct Change_reg;
+struct Change_translator;
 struct Chord;
 struct Clef_change_req;
 struct Clef_item;
@@ -73,6 +73,7 @@ struct Dynamic_req;
 struct Element_group;
 struct Element_group_item;
 struct General_script_def;
+struct Graphical_element;
 struct Music_output;
 struct Music_output_def;
 struct Global_translator;
@@ -144,7 +145,7 @@ struct Note_head;
 struct Note_head_engraver;
 struct Notename_table;
 struct Offset;
-struct Output;
+struct Outputter;
 struct Performer;
 struct Paper_column;
 struct Paper_score;
index c9af80091c01cae44ee4bedfcbead1a4cc29d224..638e8c3bdffce990e67562dee83c55844869a4f3 100644 (file)
@@ -43,7 +43,7 @@ struct Lookup {
     Symbol rule_symbol (Real height, Real width) const;
     Symbol accidental (int) const;
     Symbol ball (int) const;
-    Symbol flag (int) const;
+    Symbol flag (int, Direction) const;
     Symbol rest (int, bool outside) const;
     Symbol clef (String) const;
     Symbol bar (String, Real height) const;
index d1a4b779144ee78e2d1adb3c6c5f5593981bf87d..b0666e160ade4a26948cad5e9cb0f85e0a4d58fb 100644 (file)
@@ -33,14 +33,12 @@ class My_lily_parser {
 
   void set_last_duration (Duration const *);
   void set_default_duration (Duration const *);
-  void set_last_abbrev (int type_i);
   void set_abbrev_beam (int type_i);
   void set_duration_mode (String s);
   friend int yyparse (void*);
 
 public:
   int abbrev_beam_type_i_;
-  int default_abbrev_type_i_;
   int default_octave_i_;
   Duration default_duration_;
   Plet plet_;
index ea22500fd7b68fe5ba706be21dfe4ff1b98968ac..9407570463bf8d809d3d110afd88cdc122af469d 100644 (file)
@@ -26,6 +26,7 @@ struct Offset {
   Real operator[](Axis i) const{
     return coordinate_a_[i];
   }
+  String str () const;
     
   Offset operator+=(Offset o) {
     x()+=o.x ();
diff --git a/lily/include/outputter.hh b/lily/include/outputter.hh
new file mode 100644 (file)
index 0000000..4b80892
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+  outputter.hh -- declare Outputter
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef OUTPUTTER_HH
+#define OUTPUTTER_HH
+
+#include "lily-proto.hh"
+
+/**
+  Abstract interface for a Score_elem to output itself.
+ */
+struct Outputter
+{
+  virtual ~Outputter(){}
+  virtual void start_line ()=0;
+  virtual void output_molecule (Molecule const *, Offset)=0;
+  virtual void stop_line ()=0;
+};
+
+/**
+  Output a line of score using  TeX strings
+ */
+struct Tex_outputter : Outputter
+{
+  Tex_outputter (Tex_stream *);
+  Tex_stream * outstream_l_;
+  virtual void output_molecule (Molecule const*, Offset);
+  virtual void start_line ();
+  virtual void stop_line ();
+};
+
+#endif // OUTPUTTER_HH
index 1ca1f30ac8971b7ffcc71fb5af1a4b927f7d275f..0bce434619111e54c0dad3942a37899349baa28e 100644 (file)
@@ -22,6 +22,7 @@
     */
 
 class Paper_score : public Music_output {
+  void tex_output ();
 public:
   Paper_def *paper_l_;
 
@@ -33,7 +34,8 @@ public:
 
   /// other elements
   Pointer_list<Score_elem*> elem_p_list_;
-    
+  
+  Outputter *outputter_l_;  
   Super_elem *super_elem_l_;
     
   Paper_score ();
@@ -55,7 +57,6 @@ public:
     
     
   /* STANDARD ROUTINES */
-  void OK() const;
   void print() const;
   
   void typeset_element (Score_elem*);
diff --git a/lily/include/rest-column-grav.hh b/lily/include/rest-column-grav.hh
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/lily/include/rest-column.hh b/lily/include/rest-column.hh
new file mode 100644 (file)
index 0000000..e69de29
index c67510040a249734fbff950c30693712acedbf83..64ec7fcbe19899d8cf40257ef6fcd22b6b0024fe 100644 (file)
@@ -8,14 +8,14 @@
 #define STAFFELEM_HH
 
 #include "parray.hh"
-#include "lily-proto.hh"
-#include "offset.hh"
 #include "virtual-methods.hh"
 #include "directed-graph.hh"
+#include "graphical-element.hh"
 
 #define SCORE_ELEM_CLONE(T) VIRTUAL_COPY_CONS(T, Score_elem)
 
 
+typedef void (Score_elem::*Score_elem_method_pointer)(void);
 
 /** Both Spanner and Item are Score_elem's. Most Score_elem's depend
   on other Score_elem's, eg, Beam needs to know and set direction of
   form an acyclic graph.
 
   (elem) */
-class Score_elem : private Directed_graph_node {
-
-  /// member: the symbols
-  Molecule *output;            // should scrap, and use temp var?
-
-
-
-  /**
-    for administration of what was done already
-    */
-  enum Status {
-    ORPHAN,                    // not yet added to pstaff
-    VIRGIN,                    // added to pstaff
-    PREBREAKING,
-    PREBROKEN,
-    PRECALCING,
-    PRECALCED,         // calcs before spacing done
-    BREAKING,
-    BROKEN,
-    POSTCALCING,               // busy calculating. This is used to trap cyclic deps.
-    POSTCALCED,                // after spacing calcs done
-    BREWED,
-    TEXOUTPUT,                 // molecule has been output
-    DELETED,           // to catch malloc mistakes.
-  };
-    
-  Status status_;
-
-  Score_elem* dependency (int) const;
-  Score_elem* dependent (int) const;
-  int dependent_size() const;
-  int dependency_size() const;
+class Score_elem : private Directed_graph_node, public Graphical_element {
 public:
-  /**
-    This is  needed, because #output# may still be
-    NULL.
-    */
-  Offset offset_;
-
-
-
-
   Paper_score *pscore_l_;    
-  Axis_group_element * axis_group_l_a_[NO_AXES];
 
+  Score_elem();
   Score_elem (Score_elem const&);
-  virtual String TeX_output_str () const ;
-    virtual void print() const;
+  virtual void print() const;
     
   Paper_def *paper() const;
 
   virtual ~Score_elem();
-  Score_elem();
   DECLARE_MY_RUNTIME_TYPEINFO;    
-    
-  Interval extent (Axis) const;
-  Interval width() const;
-  Interval height() const;
-  Status status() const;
-    
-  /**
-    translate the symbol. The symbol does not have to be created yet. 
-    */
-  void translate (Offset);
-  /**
-    translate in one direction
-    */
-    
-  void translate (Real, Axis);
-  Real relative_coordinate (Axis_group_element*, Axis) const;
-  Offset absolute_offset() const;
-  Real absolute_coordinate (Axis) const;
-  Axis_group_element*common_group (Score_elem const* s, Axis a) const;
 
   void add_processing();
-  void OK() const;
-  void pre_processing();
-  void breakable_col_processing();
-  void break_processing();
-    
-  void post_processing();
-  void molecule_processing();
 
   /**
     Remove all  links (dependencies, dependents, Axis_group_elements.
     */
   void unlink();
-  void unlink_all();
   void substitute_dependency (Score_elem*,Score_elem*);
   void remove_dependency (Score_elem*);
   /**
@@ -130,12 +61,30 @@ public:
   virtual bool linked_b() const;
   SCORE_ELEM_CLONE(Score_elem);
  
-  /// no dimension, translation is noop
-  bool empty_b_;
   /// do not print anything black
   bool transparent_b_;
+  
+  // ugh: no protection. Denk na, Vrij Veilig
+  void calcalute_dependencies (int final, int busy, Score_elem_method_pointer funcptr);
+
 protected:
+  /**
+    Administration: Where are we?. This is mainly used by Super_elem and
+    Score_elem::calcalute_dependencies ()
+
+    0 means ORPHAN,
+    -1 means deleted
+    
+   */
+  int status_i_;
 
+  Score_elem* dependency (int) const;
+  Score_elem* dependent (int) const;
+  int dependent_size() const;
+  int dependency_size() const;
+  
+  virtual void do_brew_molecule ();
+  void junk_links();
   virtual Interval do_height() const;
   virtual Interval do_width() const;
     
@@ -151,7 +100,6 @@ protected:
   virtual void do_breakable_col_processing();
   /// do calculations after determining horizontal spacing
   virtual void do_post_processing();
-  virtual String do_TeX_output_str () const;
     
   virtual void do_substitute_dependency (Score_elem * , Score_elem *);
   virtual void do_substitute_dependent (Score_elem *, Score_elem *);
@@ -161,7 +109,6 @@ protected:
   virtual Link_array<Score_elem> get_extra_dependencies() const;
   virtual void do_unlink();
   virtual void do_junk_links();
-  String make_TeX_string (Offset) const;
 };
 
 
index fcdae480fa508e6a2caaa6157e667047c568f561..6348cdadf073552b8d1204ea009267ba450cf58b 100644 (file)
@@ -54,7 +54,7 @@ protected:
   virtual void do_announces();
   virtual void typeset_element (Score_elem*elem_p);
   virtual void do_pre_move_processing();
-  virtual void add_processing ();
+  virtual void do_add_processing ();
 };
 
 #endif // SCORE_GRAV_HH
index ef2385ad46d4a84066ebcd0982006ff20ae857ca..b093ae090ead388c118db9dd003e75f0ff6d2ca2 100644 (file)
@@ -29,7 +29,7 @@ protected:
   virtual void prepare (Moment mom);
   virtual void process();
   virtual void start();
-  virtual void add_processing ();
+  virtual void do_add_processing ();
   virtual int get_tempo_i() const;
   virtual void play (Audio_element* p);
   virtual Music_output *get_output_p ();
index fc1cac844e563988edcf04bec2b116a402190867..cb089cdb056ab8a043f16d6ec33ef7afd3d4fd64 100644 (file)
@@ -16,8 +16,7 @@ class Line_of_score : public Spanner
 public:
   Link_array<Paper_column> cols;
   bool error_mark_b_;
-  virtual String TeX_output_str () const;    
-    
+
   DECLARE_MY_RUNTIME_TYPEINFO;
   Line_of_score();
     
@@ -30,7 +29,10 @@ public:
   void set_breaking (Array<Col_hpositions> const&);
 
 protected:
-  virtual void do_breakable_col_processing ();
+  virtual Link_array<Score_elem> get_extra_dependencies () const;
+
+  virtual void do_unlink ();
+  virtual void do_junk_links ();
   virtual void break_into_pieces (bool);
   virtual Interval do_width() const;
   virtual void do_print() const;
index 44529faaf0fb1c86334120ba09172ee69696a28a..ad205fcbf01b122590c68ed87ca9152be857d89f 100644 (file)
@@ -56,7 +56,7 @@ protected:
 
   virtual void do_unlink();
   virtual void do_junk_links();
-  virtual String do_TeX_output_str () const;
+  virtual void do_brew_molecule ();
   virtual void do_break_processing();
   virtual Interval do_width() const;
   virtual void do_print() const;
index 136e6e5095a543d230ed30a2f8344a2369ab93e0..b5a77589ec8519f0d6c55cc74f85c1aa48631a86 100644 (file)
 class Stem_engraver : public Engraver
 {
   Direction dir_;
+  int default_abbrev_i_;
   Stem *stem_p_;
   Rhythmic_req *rhythmic_req_l_;
   Abbreviation_req* abbrev_req_l_;
 protected:
+  virtual void do_creation_processing ();
   virtual void acknowledge_element (Score_elem_info);
   virtual void do_pre_move_processing ();
   virtual bool do_try_request (Request*);
index 97873233506e9bceceada537254ce53a55639857..f7240397b302fdfaf1b868bc0cf29b465e393b77 100644 (file)
@@ -57,7 +57,7 @@ public:
   /// how many abbrev beam don't reach stem?
   int beam_gap_i_;
 
-  /// flagtype? 4 none, 8 8th flag, 0 = beam.
+  /// log of the duration. Eg. 4 -> 16th note -> 2 flags
   int flag_i_;
 
   /** 
index 1b5a994037c3ec7eba81255bc31d9f2508270483..74bfda66916466a5981474197e776f0cc7ad3093 100644 (file)
   */
 class Super_elem : public Score_elem {
 public:
-    Link_array<Line_of_score> lines_arr_;
-    Line_of_score * line_of_score_l_;
+  Link_array<Line_of_score> lines_arr_;
+  Line_of_score * line_of_score_l_;
     void add_broken_line (Line_of_score*);
-    Super_elem();
-    virtual String TeX_output_str() const;
+  Super_elem();
+
+  void pre_processing();
+  void breakable_col_processing();
+  void break_processing();
+  void post_processing();
+  void output_all ();
+  void unlink_all ();
+
 protected:
-    virtual void do_substitute_dependency (Score_elem*,Score_elem*);
-    virtual void handle_broken_dependencies();
+  virtual void do_substitute_dependency (Score_elem*,Score_elem*);
+  virtual void handle_broken_dependencies();
 
-    virtual void do_add_processing();
-    DECLARE_MY_RUNTIME_TYPEINFO;
+  virtual void do_add_processing();
+  DECLARE_MY_RUNTIME_TYPEINFO;
 };
 
 #endif // SUPER_ELEM_HH
index b967e42c197e33f271ea425742888fcbac9365b1..dc118c96e073fef0706212c786b5878e2f273618 100644 (file)
@@ -23,7 +23,7 @@ class Tie_engraver : public Engraver {
     Melodic_req  * melodic_req_l_;
     
 protected:
-    virtual ~Tie_engraver();
+    virtual void do_removal_processing ();
     virtual void acknowledge_element (Score_elem_info);
     virtual bool do_try_request (Request*);
     virtual bool acceptable_request_b (Request*);
index 13b8ca3d1e9d632cf22d41c280c2806572742d74..dc2e8365eb98a3e7712b6d594b8c589862cb26c1 100644 (file)
@@ -62,7 +62,7 @@ protected:
   virtual Translator_group * group_l () { return this; }
   virtual void do_print () const;
   virtual void do_process_requests ();
-  virtual void add_processing ();
+  virtual void do_add_processing ();
   virtual bool do_try_request (Request* req_l);       
   virtual void do_pre_move_processing();
   virtual void do_post_move_processing();   
index e9fc506a46b86e96537aa3346e09a54b93cd53b2..baa07183665f12426bd6959ecb71b57b023866f6 100644 (file)
@@ -40,7 +40,6 @@ public:
   
   Translator_group * daddy_trans_l_ ;
  
-  virtual void add_processing ();
   void print () const;
   
   /**
@@ -54,6 +53,7 @@ public:
     */
   bool try_request (Request*);
   void pre_move_processing();
+  void add_processing ();
   void creation_processing ();
   void process_requests();
   void post_move_processing();
@@ -86,6 +86,7 @@ protected:
        @see{try_request}
        Default: always return false
        */
+  virtual void do_add_processing ();
   virtual bool do_try_request (Request *req_l);
   virtual void do_print () const;
   virtual void do_pre_move_processing(){}
index 720b2989324e212a870d25778305d09d7dd670b8..3c9ef948bce9628af57447bedf1494ca75f49c50 100644 (file)
@@ -24,8 +24,8 @@ protected:
   virtual void do_unlink () { Axis_group_spanner::do_unlink (); }
 public:
   DECLARE_MY_RUNTIME_TYPEINFO;
-  virtual void add_element (Score_elem*e) { Vertical_group_element::add_element (e); }
-  virtual void remove_element (Score_elem*e) { Vertical_group_element::remove_element (e); }  
+  virtual void add_element (Graphical_element*e) { Vertical_group_element::add_element (e); }
+  virtual void remove_element (Graphical_element*e) { Vertical_group_element::remove_element (e); }  
 };
 
 #endif // SPAN_VERTICAL_GROUP_HH
index 6d72b4c5b81d0c013435b14375333672386e4a34..40df46783f43af907e52f245f34fc1a635b7dcd0 100644 (file)
@@ -26,8 +26,8 @@ void
 Item::do_print() const
 {
 #ifndef NPRINT
-  DOUT << "breakable_b_: " << breakable_b_;
-  DOUT << "break_status_i_: " <<break_status_i_;
+  DOUT << "breakable_b_: " << breakable_b_ << 
+    " break_status_i_: " <<break_status_i_;
 #endif
 }
 
index d328f44ac9746b0122d99e90c55abd433a342197..f3b57d20a1f1738a48690f16ddf7277fdfe65612 100644 (file)
@@ -94,6 +94,7 @@ Key_item::do_pre_processing()
 {
   if (default_b_) 
     {
-       empty_b_ = transparent_b_ = (break_status_i() != 1);
+       transparent_b_ = (break_status_i() != 1);
+       set_empty (transparent_b_);
     }
 }
index 480abb5f9a06212c7f62abbccfaf2f2360ce2794..119c52e449e0a805f6c0b86e0800cb2c45b36af5 100644 (file)
@@ -143,9 +143,10 @@ Lookup::dots (int j) const
 }
 
 Symbol
-Lookup::flag (int j) const
+Lookup::flag (int j, Direction d) const
 {
-  return (*symtables_)("flags")->lookup (j);
+  char c = (d == UP) ? 'u' : 'd';
+  return (*symtables_)("flags")->lookup (c + String (j));
 }
 
 Symbol
index d05b752df097ee42fe7a80e8ed3bc8ff2488336b..9c1f2c733e1ad815c58c228432fcc40665eac182 100644 (file)
@@ -14,6 +14,8 @@
 #include "request-iterator.hh"
 #include "translator-group.hh"
 #include "translation-property.hh"
+#include "change-iterator.hh"
+#include "change-translator.hh"
 
 IMPLEMENT_IS_TYPE_B(Music_iterator);
 
@@ -130,7 +132,9 @@ Music_iterator::static_get_iterator_p (Music *m,
     p =  new Voice_iterator ((Voice*) m);
   else if (m->is_type_b (Translation_property::static_name ()))
     p = new Property_iterator((Translation_property *) m);
-      
+  else if (m->is_type_b (Change_translator::static_name ()))
+    p = new Change_iterator((Change_translator*) m);
+  
   if (m -> translator_type_str_)
     {
       Translator_group* a =report_l->
@@ -138,7 +142,6 @@ Music_iterator::static_get_iterator_p (Music *m,
       p->set_translator (a);
     }
 
-
   if (! p->report_to_l())
     p ->set_translator (report_l);
   
index 7cbcd86bc309d0ec8fe5f21cadb2a8663c3156a1..bfa78512da7370199f6d8b9bfe8b4cdbce171402 100644 (file)
@@ -23,7 +23,6 @@ My_lily_parser::My_lily_parser (Sources * source_l)
   source_l_ = source_l;
   lexer_p_ = 0;
   abbrev_beam_type_i_ = 0;
-  default_abbrev_type_i_ = 0;
   default_duration_.durlog_i_ = 2;
   default_octave_i_ = 0;
   textstyle_str_="roman";              // in lexer?
@@ -145,18 +144,11 @@ My_lily_parser::set_abbrev_beam (int type_i)
   abbrev_beam_type_i_ = type_i;
 }
 
-void
-My_lily_parser::set_last_abbrev (int type_i)
-{
-  default_abbrev_type_i_ = type_i;
-}
-
 void
 My_lily_parser::set_default_duration (Duration const *d)
 {
   last_duration_mode_b_ = false;
   default_duration_ = *d;
-  set_last_abbrev (0);
 }
 
 
@@ -165,7 +157,6 @@ My_lily_parser::set_last_duration (Duration const *d)
 {
   if (last_duration_mode_b_)
     default_duration_ = *d;
-  set_last_abbrev (0);
 }
 
 
@@ -193,11 +184,11 @@ My_lily_parser::get_rest_element (String s,  Duration * duration_p)
 
   if (s=="s")
     { /* Space */
-    Skip_req * skip_p = new Skip_req;
-    skip_p->duration_ = *duration_p;
+      Skip_req * skip_p = new Skip_req;
+      skip_p->duration_ = *duration_p;
 
-    skip_p->set_spot (here_input());
-    velt_p->add (skip_p);
+      skip_p->set_spot (here_input());
+      velt_p->add (skip_p);
     }
   else 
     {
@@ -227,12 +218,6 @@ My_lily_parser::get_note_element (Note_req *rq, Duration * duration_p)
       assert (!duration_p->plet_b ());
       duration_p->set_plet (1, 2);
     }
-  if (default_abbrev_type_i_)
-    {
-      Abbreviation_req* a = new Abbreviation_req;
-      a->type_i_ = default_abbrev_type_i_;
-      v->add (a);
-    }
   rq->set_duration (*duration_p);
   rq->set_spot (here_input ());
   delete duration_p ;
index fb70c3e7a65dada41e3dfa344692064b031da6c4..540922d4f0cc65dbe41eab052b1f179aeaa658f3 100644 (file)
@@ -68,12 +68,10 @@ Note_column::set (Stem * stem_l)
   stem_l_ = stem_l;
   /* 
      don't add stem to support; mostly invisible for rest-columns (and possibly taken . .)
-    
    */
   Score_elem::add_dependency (stem_l);
   for (int i=0; i < script_l_arr_.size(); i++)
     script_l_arr_[i]->set_stem (stem_l);
-
 }
 
 void
@@ -125,6 +123,7 @@ Note_column::add (Rhythmic_head *h)
 void
 Note_column::translate_rests (int dy_i)
 {
+  invalidate_cache (Y_AXIS);
   for (int i=0; i < rest_l_arr_.size(); i++)
     rest_l_arr_[i]->position_i_ += dy_i;
 }
diff --git a/lily/offset.cc b/lily/offset.cc
new file mode 100644 (file)
index 0000000..105e7fb
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+  offset.cc -- implement Offset
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "string.hh"
+#include "offset.hh"
+
+String
+Offset::str () const
+{
+  String s;
+  s = String("(") + coordinate_a_[X_AXIS] + ", " + coordinate_a_[Y_AXIS] + ")";
+  return s;
+}
diff --git a/lily/outputter.cc b/lily/outputter.cc
new file mode 100644 (file)
index 0000000..a533ea8
--- /dev/null
@@ -0,0 +1,57 @@
+
+/*
+  outputter.cc -- implement Tex_outputter
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "outputter.hh"
+#include "tex-stream.hh"
+#include "molecule.hh"
+#include "varray.hh"
+#include "dimen.hh"
+#include "tex.hh"
+
+Tex_outputter::Tex_outputter (Tex_stream *s)
+{
+  outstream_l_ = s;
+}
+
+void
+Tex_outputter::output_molecule (Molecule const*m, Offset o)
+{
+  String t = m->TeX_string();
+  if (!t)
+    return ;
+
+  String s ("\\placebox{%}{%}{%}");
+  Array<String> a;
+  a.push (print_dimen (o.y()));
+  a.push (print_dimen (o.x()));
+  a.push (t);
+  String r;
+  /*
+  if (check_debug)
+    r = String ("\n%start: ") + name() + "\n";
+    */
+  
+  r += substitute_args (s, a);
+  
+  *outstream_l_ << r;
+}
+
+
+void
+Tex_outputter::start_line ()
+{
+  *outstream_l_ << "\\hbox{%<- line of score\n";
+}
+
+void
+Tex_outputter::stop_line ()
+{
+  *outstream_l_ << "}";
+  *outstream_l_ << "\\interscoreline";
+}
index 715adecd83122c555615721e43cfce11ad90658c..06fae0d37fb468d15f2e512400f58f651a62f024 100644 (file)
@@ -47,7 +47,7 @@ Paper_column::do_print() const
       DOUT <<'\n' << ((break_status_i_ == -1)? "prebreak" : "postbreak");
       DOUT << '\n';
     }
-  DOUT << "extent: " << width().str () << "\n";
+  // DOUT << "extent: " << width().str () << "\n";
 #endif 
 }
 
index 986d3665ba82a9609103f3da9ddef92ff5dc7374..0591e5cc1e2000ce999d4605680f309908e89439 100644 (file)
 #include "header.hh"
 #include "word-wrap.hh"
 #include "gourlay-breaking.hh"
+#include "outputter.hh"
 
 Paper_score::Paper_score ()
 {
+  outputter_l_ =0;
   super_elem_l_   = new Super_elem;
   typeset_element (super_elem_l_);
 }
@@ -54,7 +56,6 @@ Paper_score::typeset_unbroken_spanner (Spanner*span_p)
   span_p_list_.bottom ().add (span_p);
   span_p->pscore_l_=this;
 
-  
   // do not init start/stop fields. These are for broken spans only.
   span_p->add_processing ();
 }
@@ -80,15 +81,6 @@ Paper_score::add_column (Paper_column *p)
 
 
 
-void
-Paper_score::OK () const
-{
-#ifndef NDEBUG
-  for (PCursor<Score_elem*> i (elem_p_list_.top ()); i.ok  (); i++) 
-    i->OK ();
-#endif
-}
-
 void
 Paper_score::print () const
 {    
@@ -107,20 +99,6 @@ Paper_score::print () const
 #endif 
 }
 
-void
-Paper_score::preprocess ()
-{
-  super_elem_l_->breakable_col_processing ();
-  super_elem_l_->pre_processing ();
-}
-
-void
-Paper_score::postprocess ()
-{
-  super_elem_l_->post_processing ();
-  super_elem_l_->molecule_processing ();
-}
-
 PCursor<Paper_column *>
 Paper_score::find_col (Paper_column const *c) const
 {
@@ -197,12 +175,19 @@ Paper_score::process ()
   clean_cols ();
   print ();
   *mlog << "Preprocessing elements... " <<flush;
-  preprocess ();
+  super_elem_l_->breakable_col_processing ();
+  super_elem_l_->pre_processing ();
   *mlog << "\nCalculating column positions ... " <<flush;
   calc_breaking ();
   *mlog << "\nPostprocessing elements..." << endl;
-  postprocess ();
+  super_elem_l_->post_processing ();
+  tex_output ();
+}
+
 
+void
+Paper_score::tex_output ()
+{
   // output
   String outname = paper_l_->outfile_str_ ;
   if (!outname)
@@ -210,17 +195,21 @@ Paper_score::process ()
   
   *mlog << "TeX output to " <<  outname << " ...\n";
   
-  Tex_stream the_output (outname);
+  Tex_stream tex_out (outname);
+  Tex_outputter interfees (&tex_out);
+
+  outputter_l_ = &interfees;
   
-  the_output << "% outputting Score, defined at: " << origin_str_ << "\n";
+  tex_out << "% outputting Score, defined at: " << origin_str_ << "\n";
   if (header_l_) 
     {
-      the_output << header_l_->TeX_string();
+      tex_out << header_l_->TeX_string();
     }
   
-  the_output << "\n "<<  paper_l_->lookup_l ()->texsetting << "%(Tex id)\n";
-  the_output<< super_elem_l_->TeX_output_str ();
-  the_output << "\n\\EndLilyPondOutput";
+  tex_out << "\n "<<  paper_l_->lookup_l ()->texsetting << "%(Tex id)\n";
+  super_elem_l_->output_all ();
+  tex_out << "\n\\EndLilyPondOutput";
+  outputter_l_ = 0;
 }
 
 /** Get all breakable columns between l and r, (not counting l and r).  */
index ed9a28aceb332d36258f1c3119ef58dd8fdcaab3..d7b2a0d4faada19162d32d4068241e164c38920f 100644 (file)
@@ -12,7 +12,7 @@
 #include <iostream.h>
 
 // mmm
-#define MUDELA_VERSION "0.1.5"
+#define MUDELA_VERSION "0.1.6"
 
 #include "scalar.hh"
 #include "translation-property.hh"
@@ -38,6 +38,7 @@
 #include "music-list.hh"
 #include "header.hh"
 #include "duration-convert.hh"
+#include "change-translator.hh"
 
 #ifndef NDEBUG
 #define YYDEBUG 1
@@ -210,7 +211,7 @@ yylex (YYSTYPE *s,  void * v_l)
 
 %type <scalar>  scalar
 %type <music>  Music transposed_music
-%type <music>  propertydef
+%type <music>  property_def translator_change
 %type <musiclist> Voice Voice_body
 %type <chord>  Chord Chord_body
 %type <paper>  paper_block paper_body
@@ -472,7 +473,7 @@ paper_block:
 
 paper_body:
        /* empty */                     {
-               $$ = THIS->default_paper (); // paper / video / engrave
+               $$ = THIS->default_paper ();
        }
        | PAPER_IDENTIFIER      {
                $$ = $1->paperdef ();
@@ -581,20 +582,24 @@ Music:
                { THIS->lexer_p_->push_lyric_state (); }
        Music
                { $$ = $3; THIS->lexer_p_->pop_state (); }
-       | propertydef
+       | property_def
+       | translator_change
        ;
 
-propertydef:
+translator_change:
        TRANSLATOR STRING '=' STRING  {
-               /* kluge.  Could use Music just as well */
-               Translation_property * t = new Translation_property;
-               t-> translator_type_str_ = *$2;
-               t-> translator_id_str_ = *$4;
+               Change_translator * t = new Change_translator;
+               t-> change_to_type_str_ = *$2;
+               t-> change_to_id_str_ = *$4;
+
                $$ = t;
                delete $2;
                delete $4;
        }
-       | PROPERTY STRING '.' STRING '=' scalar {
+       ;
+
+property_def:
+       PROPERTY STRING '.' STRING '=' scalar   {
                Translation_property *t = new Translation_property;
                t-> translator_type_str_ = *$2;
                t-> var_str_ = *$4;
@@ -614,6 +619,10 @@ scalar:
 
 Chord:
        '<' Chord_body '>'      { $$  = $2; }
+       | MULTI INT Chord {
+               $$ = $3;
+               $$->multi_level_i_=$2;
+       }
        ;
 
 Chord_body:
@@ -621,9 +630,6 @@ Chord_body:
                $$ = new Chord;
                $$-> multi_level_i_ = 1;
        }
-       | Chord_body MULTI INT ';' {
-               $$->multi_level_i_=$3;
-       }
        | Chord_body Music {
                $$->add ($2);
        }
@@ -978,7 +984,7 @@ voice_command:
 
                        c' -> default_octave_i_ == 1
                */
-               /* why can't we have \oct{0} iso \oct{c'}*/
+               /* why can't we have \oct 0 iso \oct{c'}*/
                THIS->default_octave_i_ = 1; }
 /* cont */
        steno_melodic_req {
@@ -1052,15 +1058,17 @@ explicit_steno_duration:
 
 
 abbrev_type: 
-       ':' int {
+       ':'     {
+               $$ =0;
+       }
+       | ':' int {
                if (!Duration::duration_type_b ($2))
                        THIS->parser_error ("Not a duration");
                else if ($2 < 8)
                        THIS->parser_error ("Can't abbreviate");
-               else
-                       THIS->set_last_abbrev ($2);
-               $$ = THIS->default_abbrev_type_i_;
+               $$ = $2;
        }
+
        ;
 
 music_elt:
index cf4a898831266aab08c218155c6f8b1f3b0d281d..6c5068272214d829d8a6259495a284de313d61c9 100644 (file)
@@ -151,5 +151,5 @@ Rest_collision::do_substitute_dependency (Score_elem*o,Score_elem*n)
 Rest_collision::Rest_collision()
 {
   transparent_b_ = true;
-  empty_b_ = true;
+  set_empty (true);
 }
index 9995896a02d19f81f5a8480f754755611b66f1e3..c06ebd0d2cc014801dee5e1124dac3067078e072 100644 (file)
@@ -5,9 +5,7 @@
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
-/*
-  too big. Should split.
- */
+#include "outputter.hh"
 #include "p-score.hh"
 #include "paper-def.hh"
 #include "lookup.hh"
 
 Score_elem::Score_elem()
 {
-  transparent_b_ = empty_b_ = false;
-  axis_group_l_a_[0] = axis_group_l_a_[1] =0;
+  transparent_b_ = false;
   pscore_l_=0;
-  offset_ = Offset (0,0);
-  output = 0;
-  status_ = ORPHAN;
+  status_i_ = 0;
 }
 
 Score_elem::Score_elem (Score_elem const&s)
+  : Graphical_element (s)
 {
   /* called from derived ctor, so most info points to the same deps
      as (Directed_graph_node&)s. Nobody points to us, so don't copy
@@ -39,22 +35,14 @@ Score_elem::Score_elem (Score_elem const&s)
    */
   copy_edges_out (s);
   transparent_b_ = s.transparent_b_;
-  empty_b_ = s.empty_b_;
-  axis_group_l_a_[0] = axis_group_l_a_[1] =0;
-  status_ = s.status_;
-  assert (!s.output);
-  output = 0;
+  status_i_ = s.status_i_;
   pscore_l_ = s.pscore_l_;
-  offset_ = Offset (0,0);
 }
 
 Score_elem::~Score_elem()
 {
-  // some paranoia to prevent weird segv's
-  assert (status_ < DELETED);
-  delete output;
-  status_ = DELETED;
-  output = 0;
+  assert (status_i_ >=0);
+  status_i_ = -1;
 }
 
 Score_elem*
@@ -81,130 +69,17 @@ Score_elem::dependent_size() const
   return get_in_edge_arr().size ();
 }
 
-String
-Score_elem::make_TeX_string (Offset o)const
-{
-  String s ("\\placebox{%}{%}{%}");
-  Array<String> a;
-  a.push (print_dimen (o.y()));
-  a.push (print_dimen (o.x()));
-  String t = output->TeX_string();
-  if (!t)
-    return t;
-
-  a.push (t);
-  String r;
-  if (check_debug)
-    r = String ("\n%start: ") + name() + "\n";
-  r += substitute_args (s, a);
-  return r;
-}
-String
-Score_elem::do_TeX_output_str () const
-{
-  return make_TeX_string(absolute_offset());
-}
-
-/*
-  GEOMETRY
- */
-Real
-Score_elem::absolute_coordinate (Axis a) const
-{
-  Real r = offset_[a];
-  for (Axis_group_element * axis_group_l = axis_group_l_a_[a];
-       axis_group_l; axis_group_l = axis_group_l->axis_group_l_a_[a])
-       
-    r += axis_group_l->offset_[a];
-  return r;
-}
 
-Offset
-Score_elem::absolute_offset() const
-{
-  return Offset (absolute_coordinate (X_AXIS), absolute_coordinate (Y_AXIS));
-}
-
-void
-Score_elem::translate (Real y, Axis a)
-{
-  offset_[a] += y;
-}
-
-Real
-Score_elem::relative_coordinate (Axis_group_element*e, Axis a) const
-{
-  Real r =0.0;
-  for (Axis_group_element * axis_group_l = axis_group_l_a_[a];
-       axis_group_l != e;
-       axis_group_l = axis_group_l->axis_group_l_a_[a])
-    r +=  axis_group_l->offset_[a];
-
-  return r;
-}
-
-Axis_group_element* 
-Score_elem::common_group (Score_elem const* s, Axis a) const
-{
-  Link_array<Axis_group_element> my_groups;
-  for (Axis_group_element * axis_group_l = axis_group_l_a_[a];
-       axis_group_l;
-       axis_group_l = axis_group_l->axis_group_l_a_[a])
-    my_groups.push (axis_group_l);
-
-  Axis_group_element* common_l=0;
-  for (Axis_group_element * axis_group_l = s->axis_group_l_a_[a];
-       !common_l && axis_group_l;
-       axis_group_l = axis_group_l->axis_group_l_a_[a])
-    common_l = my_groups.find_l (axis_group_l);
-
-  return common_l;
-}
-
-
-
-void
-Score_elem::translate (Offset O)
-{
-  offset_ += O;
-}
 
 Interval
 Score_elem::do_width() const 
 {
   Interval r;
 
-  if (!output)
-    {
-      Molecule*m = brew_molecule_p();
-      r = m->extent().x ();
-      delete m;
-    }
-  else
-    r = output->extent().x ();
-  return r;
-}
-
-Interval
-Score_elem::width() const
-{
-  return extent (X_AXIS);
-}
-
-Interval
-Score_elem::extent (Axis a) const
-{
-  Interval r;
-  if (!empty_b_) 
-    {
-       
-      r = (a == X_AXIS)? do_width(): do_height ();
-    }
+  Molecule*m = brew_molecule_p();
+  r = m->extent().x ();
+  delete m;
   
-  if (!r.empty_b()) // float exception on DEC Alpha
-    r+=offset_[a];
-
   return r;
 }
 
@@ -212,22 +87,12 @@ Interval
 Score_elem::do_height() const 
 {
   Interval r;
-  if (!output)
-    {
-      Molecule*m = brew_molecule_p();
-      r = m->extent().y ();
-      delete m;
-    }
-  else
-    r = output->extent().y ();
+  Molecule*m = brew_molecule_p();
+  r = m->extent().y ();
+  delete m;
   return r;
 }
 
-Interval
-Score_elem::height() const
-{
-  return extent (Y_AXIS);
-}
 
 /*
   STANDARD METHS
@@ -239,13 +104,9 @@ Score_elem::print() const
   DOUT << name() << "{\n";
   DOUT << "dets: " << dependent_size() << "dependencies: " << 
     dependency_size();
-  if (offset_.x() || offset_.y ())
-    DOUT << "offset (" << offset_.x() << ", " << offset_.y () <<")";
-  DOUT << "\n";
-
+  Graphical_element::print ();
   do_print();
-  if (output)
-    output->print();
   
   DOUT <<  "}\n";
 #endif
@@ -259,86 +120,54 @@ Score_elem::paper()  const
   return pscore_l_->paper_l_;
 }
 
+
 void
 Score_elem::add_processing()
 {
-  if (status_ >= VIRGIN)
+  if (status_i_)
     return;
-  status_ = VIRGIN;
+  status_i_ ++;
   do_add_processing();
 }
 
-void
-Score_elem::pre_processing()
-{
-  if (status_ >= PRECALCED)
-    return;
-
-  assert (status_ != PRECALCING); // cyclic dependency
-  status_ = PRECALCING;
-
-  for (int i=0; i < dependency_size(); i++)
-    dependency (i)->pre_processing();
-
-  Link_array<Score_elem> extra (get_extra_dependencies());
-  for (int i=0; i < extra.size(); i++)
-    extra[i]->pre_processing();
-  
-  do_pre_processing();
-  status_ = PRECALCED;
-}
 
 void
-Score_elem::breakable_col_processing()
+Score_elem::calcalute_dependencies (int final, int busy,
+                                   Score_elem_method_pointer funcptr)
 {
-  if (status_ >= PREBROKEN)
+   if (status_i_ >= final)
     return;
 
-  if (status_== PREBREAKING) 
-    {
-      status_ = PREBROKEN;
-      return ;
-    }
-  status_ = PREBREAKING;
+   assert (status_i_!= busy);
+   status_i_= busy;
 
   for (int i=0; i < dependency_size(); i++)
-    dependency (i)->breakable_col_processing();
+    dependency (i)->calcalute_dependencies (final, busy, funcptr);
 
   Link_array<Score_elem> extra (get_extra_dependencies());
   for (int i=0; i < extra.size(); i++)
-    extra[i]->breakable_col_processing();
+    extra[i]->calcalute_dependencies (final, busy, funcptr);
   
-  
-  do_breakable_col_processing();
-  status_ = PREBROKEN;
+  invalidate_cache (X_AXIS);
+  invalidate_cache (Y_AXIS);
+  (this->*funcptr)();
+  status_i_= final;
 }
 
 void
-Score_elem::break_processing()
+Score_elem::do_brew_molecule () 
 {
-  if (status_ >= BROKEN)
-    return;
-
-  if (status_ == BREAKING) 
-    {
-      status_ = BROKEN;
-      return;
-    }
-  status_ = BREAKING;
-
-  for (int i=0; i < dependency_size(); i++)
-    dependency (i)->break_processing();
-
-  Link_array<Score_elem> extra (get_extra_dependencies());
-  for (int i=0; i < extra.size(); i++)
-    extra[i]->break_processing();
-  
+   if (transparent_b_)
+    return ;
+   Molecule *output= brew_molecule_p ();
+   pscore_l_->outputter_l_->output_molecule (output, absolute_offset ());
+}
 
+/*
   
-  do_break_processing();
-  status_ = BROKEN;
+  VIRTUAL STUBS
 
-}
+ */
 
 void
 Score_elem::do_break_processing()
@@ -346,81 +175,6 @@ Score_elem::do_break_processing()
   handle_broken_dependencies();
 }
 
-
-void
-Score_elem::post_processing()
-{
-  if (status_ >= POSTCALCED)
-    return;
-  assert (status_ != POSTCALCING);// cyclic dependency
-  status_=POSTCALCING; 
-
-  
-  for (int i=0; i < dependency_size(); i++)
-    dependency (i)->post_processing();
-
-  Link_array<Score_elem> extra (get_extra_dependencies());
-  for (int i=0; i < extra.size(); i++)
-    extra[i]->post_processing();
-  
-
-  do_post_processing();
-  status_=POSTCALCED;
-}
-
-Score_elem::Status
-Score_elem::status() const
-{
-  return status_;
-}
-
-void 
-Score_elem::molecule_processing()
-{
-  if (status_ >= BREWED)
-    return;
-  status_ = BREWED;            // do it only once.
-  
-  for (int i=0; i < dependency_size(); i++)
-    dependency (i)->molecule_processing();
-
-  Link_array<Score_elem> extra (get_extra_dependencies());
-  for (int i=0; i < extra.size(); i++)
-    extra[i]->molecule_processing();
-  
-
-  if (transparent_b_)
-    return ;
-  output= brew_molecule_p();
-}
-
-String
-Score_elem::TeX_output_str() const
-{
-  String s;
-  if (status_ >= TEXOUTPUT)
-    return "";
-
-  ((Score_elem*)this)->status_ = TEXOUTPUT;
-
-  for (int i=0; i < dependency_size(); i++)
-    s += dependency (i)->TeX_output_str();
-
-  Link_array<Score_elem> extra (get_extra_dependencies());
-  for (int i=0; i < extra.size(); i++)
-    s += extra[i]->TeX_output_str ();
-  
-  if (!transparent_b_)
-    s+= do_TeX_output_str();
-
-  return s;
-}
-
-/*
-  
-  VIRTUAL STUBS
-
- */
 void
 Score_elem::do_post_processing()
 {
@@ -461,7 +215,7 @@ Score_elem::do_junk_links()
 {
 }
 
-IMPLEMENT_IS_TYPE_B(Score_elem);
+IMPLEMENT_IS_TYPE_B1(Score_elem, Graphical_element);
 
 Molecule*
 Score_elem::brew_molecule_p() const
@@ -540,7 +294,7 @@ Score_elem::handle_broken_dependencies()
   for (int i=0;  i <remove_us_arr.size(); i++)
     remove_dependency (remove_us_arr[i]);
 
-  status_ = BROKEN;
+  //  status_i_= BROKEN;
 }
 
 /*
@@ -589,23 +343,16 @@ Score_elem::handle_prebroken_dependencies()
       substitute_dependency (old_arr[i], new_arr[i]);
        
        
-  status_ = PREBROKEN;
+  //  status_i_= PREBROKEN;
 }
 
 
-
 void
-Score_elem::unlink_all()
+Score_elem::junk_links ()
 {
-  for (int i=0; i < dependency_size(); i++) 
-    dependency (i)->unlink_all();
-  Link_array<Score_elem> extra (get_extra_dependencies());
-  for (int i=0; i < extra.size(); i++)
-    extra[i]->unlink_all();
-  
-  junk_links();
-  axis_group_l_a_[X_AXIS] = axis_group_l_a_[Y_AXIS] =0;
-  do_unlink();
+  Directed_graph_node::junk_links();
+  Graphical_element::junk_links ();
+  do_junk_links();
 }
 
 void
@@ -624,19 +371,8 @@ Score_elem::unlink()
   for (int j=0; j < 2; j++)
     if (axis_group_l_a_[j])
       axis_group_l_a_[j]->remove_element (this);
-
 }
 
-void
-Score_elem::OK() const
-{
-#ifndef NDEBUG
-  for (int i=0; i < dependency_size(); i++) 
-    {
-      dependency (i)->OK();
-    }
-#endif
-}
 
 Link_array<Score_elem>
 Score_elem::get_extra_dependencies() const
@@ -651,3 +387,5 @@ Score_elem::linked_b() const
   return get_extra_dependencies().size() || 
     dependency_size();
 }
+
+
index bad0498dcc71704eda9db19a3a7f9a7d2dd5be7d..c08afae18eab65a34f5fec7cf88d2914fe06856b 100644 (file)
@@ -232,9 +232,9 @@ IMPLEMENT_IS_TYPE_B1(Score_engraver,Engraver_group_engraver);
 ADD_THIS_TRANSLATOR(Score_engraver);
 
 void
-Score_engraver::add_processing ()
+Score_engraver::do_add_processing ()
 {
-  Translator_group::add_processing ();
+  Translator_group::do_add_processing ();
   assert (output_def_l_->is_type_b (Paper_def::static_name ()));
   assert (!daddy_trans_l_);
   pscore_p_ = new Paper_score;
index 75e9fc2200c020a7469489602fd0c0bc220168d0..9db18a916f64dbff68816488bb1159eaaca0b78d 100644 (file)
@@ -92,9 +92,9 @@ Score_performer::get_output_p ()
 }
 
 void
-Score_performer::add_processing ()
+Score_performer::do_add_processing ()
 {
-  Translator_group::add_processing ();
+  Translator_group::do_add_processing ();
   assert (output_def_l_->is_type_b (Midi_def::static_name ()));
   performance_p_ = new Performance;
   performance_p_->midi_l_ = (Midi_def*) output_def_l_;  
index f1adcc0def2f553762c2bc1d5fad3ecdcdab0a68..5e8fa7e7f12247dc077c5605fc8ac961cb42ff2b 100644 (file)
@@ -16,6 +16,7 @@
 #include "music.hh"
 #include "global-translator.hh"
 #include "header.hh"
+#include "cpu-timer.hh"
 
 extern String default_out_fn;
 
@@ -45,6 +46,7 @@ Score::~Score()
 void
 Score::run_translator (Music_output_def *odef_l)
 {
+  Cpu_timer timer;
   Global_translator * trans_p = odef_l->get_global_translator_p();
   if (!trans_p)
     return ;
@@ -94,7 +96,9 @@ Score::run_translator (Music_output_def *odef_l)
     
   Music_output * output = trans_p->get_output_p();
   delete trans_p;
+  *mlog << " (time: " << String(timer.read (), "%.2f") << " seconds)";
 
+  
   output->header_l_ = header_p_;
   output->default_out_str_ = default_out_fn;
   output->origin_str_ =  location_str();
index f3324091527ee8bc34753d749d4050003068de87..2bd4f870b48b6996d98f8835eca86401680f8662 100644 (file)
 #include "p-score.hh"
 
 
-/* To do:
-
-   take out hard coded TeX stuff.
-   */
-String
-Line_of_score::TeX_output_str () const
-{
-  String s ("\\hbox{%<- line of score\n");
-  if (error_mark_b_)
-    s+= "\\scorelineerrormark";
-  
-  s+= Score_elem::TeX_output_str();
-  s += "}";
-  return s;
-}
-
-
 Line_of_score::Line_of_score()
 {
   error_mark_b_ = 0;
@@ -131,10 +114,26 @@ Line_of_score::do_width() const
   return Spanner::do_width();
 }
 
+Link_array<Score_elem>
+Line_of_score::get_extra_dependencies () const
+{
+  Link_array<Score_elem> r;
+  for (int i=0; i < cols.size (); i++)
+    r.push (cols[i]);
+  return r;
+}
+
 void
-Line_of_score::do_breakable_col_processing() 
+Line_of_score::do_unlink () 
 {
   for (int i=0; i < cols.size (); i++)
-    cols[i]->breakable_col_processing();
-  Spanner::do_breakable_col_processing();
+    cols[i]->line_l_ =0;
+  cols.set_size (0);
+}
+
+
+void
+Line_of_score::do_junk_links () 
+{
+  cols.set_size (0);
 }
index d49c447fb5b1335e03e4a01eed3db02ce359749f..1fed7f0299d834cb864b93e92e3f0ab7d4cc5ad1 100644 (file)
@@ -25,7 +25,6 @@ Script_engraver::do_try_request (Request *r_l)
     {
       if (r_l->equal_b (script_req_l_arr_[i]))
        return true;
-       
     }
   script_req_l_arr_.push (r_l->script());
   
@@ -35,6 +34,9 @@ Script_engraver::do_try_request (Request *r_l)
 void
 Script_engraver::do_process_requests()
 {
+  if (script_p_arr_.size ())
+    return ;
+  
   for (int i=0; i < script_req_l_arr_.size(); i++)
     {
       Script_req* l=script_req_l_arr_[i];
index ea3bfbef204031221eb9a3a073292a3f24a17651..073fc7cd93f996ad40719bba68b8a6110bd77e6c 100644 (file)
@@ -80,7 +80,8 @@ Script::do_pre_processing()
 {
   if  (breakable_b_ && break_status_i() != 1) 
     {
-      transparent_b_ = empty_b_ = true;
+      transparent_b_ = true;
+      set_empty (true);
     }
   
   if (!dir_)
index a4349ab750a06095055957dd57408138b2813f7a..aadb9d44b9f393fe25944df636ad854be537e7bd 100644 (file)
@@ -89,7 +89,6 @@ Slur::do_post_processing()
   Direction d=LEFT;
   Real nw_f = paper()->note_width ();
  
-  while ((d *= -1) != LEFT);
   do 
     {
       if  (extrema[d] != spanned_drul_[d]) 
index ba2c3739f28d512719edeb61a06b73af8eb479cb..e23b3226781ca2d4eb15b55cd4ce9bea8fb8d369 100644 (file)
@@ -63,7 +63,7 @@ Span_bar::do_pre_processing()
   if (spanning_l_arr_.size() < 1) 
     {
       transparent_b_ = true;
-      empty_b_ =true;
+      set_empty (true);   
     }
   else 
     {
@@ -72,7 +72,7 @@ Span_bar::do_pre_processing()
       if (!type_str_) 
        {
          transparent_b_=true;
-         empty_b_ = true;
+         set_empty (true);
        }
       else if (type_str_ == "|:") 
        {
index 96c73a9d1dfa553d8eabc90e854e295287dac5f6..97b195ef1ea13a39cb98089c22e9c77045fa5d8a 100644 (file)
@@ -23,7 +23,8 @@ Span_score_bar::do_pre_processing()
   
   if (break_status_i() != 1) 
     {
-       empty_b_ = transparent_b_ = true;
+      set_empty (true);
+      transparent_b_ = true;
     }
 }
 
index 07eb278b84cde5bbf4f84d33855bea833d24b1d8..3685865b8f97efc94f69f15386ef00275788290d 100644 (file)
@@ -10,7 +10,7 @@
 #include "spanner.hh"
 #include "p-col.hh"
 #include "p-score.hh"
-
+#include "outputter.hh"
 
 IMPLEMENT_IS_TYPE_B1(Spanner,Score_elem);
 
@@ -113,11 +113,15 @@ Spanner::Spanner()
   spanned_drul_[RIGHT]=0;
 }
 
-String
-Spanner::do_TeX_output_str () const
+void
+Spanner::do_brew_molecule () 
 {
+  if (transparent_b_)
+    return ;
+  Molecule *output= brew_molecule_p ();
   Offset left_off (spanned_drul_[LEFT]->absolute_coordinate(X_AXIS), 0);
-  return make_TeX_string (absolute_offset() + left_off);
+  Offset o = absolute_offset() + left_off;
+  pscore_l_->outputter_l_->output_molecule (output, o);
 }
 
 Interval
index 2d81cc58f25eaa3e6c7ff5fcce9e6301fbe2af97..c2114bf972dd6df31291a4e14783a44429d1b220 100644 (file)
@@ -17,9 +17,20 @@ Stem_engraver::Stem_engraver()
 {
   abbrev_req_l_ = 0;
   stem_p_ = 0;
+  default_abbrev_i_ = 16;
   dir_ = CENTER;
 }
 
+void
+Stem_engraver::do_creation_processing ()
+{
+  Scalar prop = get_property ("abbrev");
+  if (prop && prop.isnum ()) 
+    {
+      default_abbrev_i_  = prop;
+    }
+}
+
 void
 Stem_engraver::acknowledge_element(Score_elem_info i)
 {
@@ -31,10 +42,18 @@ Stem_engraver::acknowledge_element(Score_elem_info i)
          Rhythmic_req * r = i.req_l_->musical()->rhythmic();
          stem_p_ = new Stem;
          int durlog_i = r->duration_.durlog_i_;
-         stem_p_->flag_i_ = Duration_convert::type2_i(durlog_i);
+         stem_p_->flag_i_ = durlog_i;
+
+         
          if (abbrev_req_l_)
-           stem_p_->abbrev_flag_i_ = intlog2 (abbrev_req_l_->type_i_) 
-             - (durlog_i>? 2);
+           {
+             int t = abbrev_req_l_->type_i_;
+             if (!t)
+               t = default_abbrev_i_;
+             else
+               default_abbrev_i_ = t;
+             stem_p_->abbrev_flag_i_ = intlog2 (t) - (durlog_i>? 2);
+           }
          announce_element (Score_elem_info (stem_p_, r));
        }
       stem_p_->add (h);
index 875db2140533f4186f950f3b97faa85dbe4420cb..60f7b1bad336edfdce8a3d64213fa2667e925665 100644 (file)
@@ -4,6 +4,8 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+
+  TODO: This is way too hairy
 */
 
 #include "stem.hh"
@@ -33,8 +35,8 @@ Stem::Stem ()
   beams_right_i_ = 0;
 
   stem_bottom_f_ = stem_top_f_ = 0;
-  flag_i_ = 4;
-  dir_ =CENTER;
+  flag_i_ = 2;
+  dir_ = CENTER;
   staff_size_i_ = 8;
 
   stem_xoffset_f_ =0;
@@ -64,7 +66,9 @@ void
 Stem::do_print () const
 {
 #ifndef NPRINT
-  DOUT << "flag "<< flag_i_ << " print_flag? " << !(bool)beam_l_ << "abbrev_flag_i_" << abbrev_flag_i_;
+  DOUT << "flag "<< flag_i_ << "abbrev_flag_i_" << abbrev_flag_i_;
+  if (beam_l_)
+    DOUT << "beamed";
 #endif
 }
 
@@ -109,7 +113,7 @@ void
 Stem::add (Note_head *n)
 {
   n->add_dependency (this);
-      head_l_arr_.push (n);
+  head_l_arr_.push (n);
 }
  
 void
@@ -123,13 +127,12 @@ bool
 Stem::invisible_b () const
 {
   
-  return !head_l_arr_.size () || 
-    head_l_arr_[0]->balltype_i_ <= 0;
+  return (!head_l_arr_.size () || 
+    head_l_arr_[0]->balltype_i_ <= 0);
 
 }
 
 // if dir_ is set we return fake values.
-
 int
 Stem::get_center_distance_from_top ()
 {
@@ -159,7 +162,7 @@ Stem::get_default_dir ()
   if (dir_)
     return dir_;
   return (get_center_distance_from_top () >=
-    get_center_distance_from_bottom ()) ? 
+         get_center_distance_from_bottom ()) ? 
     (Direction)-1 : (Direction)1;
 }
 
@@ -178,8 +181,8 @@ Stem::set_default_stemlen ()
 
   // ugh... how about non 5-line staffs?
   bool on_ledger_line_b = ((max_head_i () < -2 && dir_ == 1)
-//    || (min_head_i () > staff_size_i_ && dir_ == -1));
-    || (min_head_i () > staff_size_i_ + 3 && dir_ == -1));
+                          //    || (min_head_i () > staff_size_i_ && dir_ == -1));
+                          || (min_head_i () > staff_size_i_ + 3 && dir_ == -1));
   if (on_ledger_line_b)
     {
       set_stemend (staff_size_i_ / 2 - 1);
@@ -254,10 +257,9 @@ Stem::do_pre_processing ()
   if (stem_bottom_f_== stem_top_f_)
     set_default_extents ();
   set_noteheads ();
-  flag_i_ = dir_ * abs (flag_i_);
+  flag_i_ = flag_i_;
   transparent_b_ = invisible_b ();
-  empty_b_ = invisible_b ();
-
+  set_empty (invisible_b ());
 }
 
 
@@ -269,68 +271,68 @@ Stem::do_width () const
     {
       r = abbrev_mol ().extent ().x ();
     }
-  else if (beam_l_ || abs (flag_i_) <= 4)
+  else if (beam_l_ || abs (flag_i_) <= 2)
     ;  // TODO!
   else
     {
       Paper_def*p= paper ();
-      r = p->lookup_l ()->flag (flag_i_).dim.x ();
+      r = p->lookup_l ()->flag (flag_i_, dir_).dim.x ();
       r+= stem_xoffset_f_;
     }
   return r;
 }
 
 
+  
 Molecule
-Stem::abbrev_mol () const
+ Stem::abbrev_mol () const
 {
   Real dy = paper ()->interbeam_f ();
   Real w = 1.5 * paper ()->lookup_l ()->ball (2).dim.x ().length ();
   Real beamdy = paper ()->interline_f () / 2;
-
   int beams_i = 0;
   Real slope = paper ()->internote_f () / 4;
-
   if (beam_l_) {
     // huh?
-    slope = 2 * beam_l_->slope;
+      slope = 2 * beam_l_->slope;
     // ugh, rather calc from Abbreviation_req
-    beams_i = beams_right_i_ >? beams_left_i_; 
+      beams_i = beams_right_i_ >? beams_left_i_; 
   }
   paper ()->lookup_l ()->beam (slope, 20 PT);
-
+  
   Molecule beams;
   Atom a (paper ()->lookup_l ()->beam (slope, w));
   a.translate (Offset(- w / 2, stem_end_f () - (w / 2 * slope)));
   // ugh
-  if (!beams_i)
-    a.translate (dy + beamdy - dir_ * dy, Y_AXIS);
-  else
-    a.translate (2 * beamdy - dir_ * (beamdy - dy), Y_AXIS);
-       
+    if (!beams_i)
+      a.translate (dy + beamdy - dir_ * dy, Y_AXIS);
+    else
+      a.translate (2 * beamdy - dir_ * (beamdy - dy), Y_AXIS);
+  
   for (int i = 0; i < abbrev_flag_i_; i++) 
     {
       Atom b (a);
       b.translate (-dir_ * dy * (beams_i + i), Y_AXIS);
       beams.add (b);
     }
-
+  
   return beams;
 }
 
 Molecule*
-Stem::brew_molecule_p () const 
+ Stem::brew_molecule_p () const 
 {
   Molecule *mol_p =new Molecule;
-      
+  
   Real bot  = stem_bottom_f_;
   Real top = stem_top_f_;
   
   assert (bot!=top);
+  
   Paper_def *p =paper ();
-
+  
   Real dy = p->internote_f ();
   if (!invisible_b ())
     {
@@ -338,23 +340,13 @@ Stem::brew_molecule_p () const
       mol_p->add (Atom (ss));
     }
   
-  if (!beam_l_ &&abs (flag_i_) > 4)
+  if (!beam_l_ &&abs (flag_i_) > 2)
     {
-      Symbol fl = p->lookup_l ()->flag (flag_i_);
-      Molecule m (fl);
-      if (flag_i_ < -4)
-       {
-         mol_p->add_at_edge (Y_AXIS, DOWN, m);
-       }
-      else if (flag_i_ > 4) 
-       {
-         mol_p->add_at_edge (Y_AXIS, UP, m);
-       }
-      else
-       assert (false); 
-         assert (!abbrev_flag_i_);
- }
-
+      Symbol fl = p->lookup_l ()->flag (flag_i_, dir_);
+      mol_p->add_at_edge (Y_AXIS, dir_, Molecule (Atom (fl)));
+      assert (!abbrev_flag_i_);
+    }
+  
   if (abbrev_flag_i_)
     mol_p->add (abbrev_mol ());
   
@@ -363,14 +355,14 @@ Stem::brew_molecule_p () const
 }
 
 Real
-Stem::hpos_f () const
+ Stem::hpos_f () const
 {
   return Item::hpos_f () + stem_xoffset_f_;
 }
 
 
 void
-Stem::do_substitute_dependency (Score_elem*o,Score_elem*n)
+ Stem::do_substitute_dependency (Score_elem*o,Score_elem*n)
 {
   Item * o_l = o->item ();
   Item * n_l = n? n->item () : 0;
index ef162d0a0b78b333392fe061e930ce5a2df54034..0cc425198ca0726dc7e30bb582c8391d6cb7cd86 100644 (file)
 #include "scoreline.hh"
 #include "p-score.hh"
 #include "string.hh"
-
-String
-Super_elem::TeX_output_str() const
-{
-  String s;
-  for (int i=0; i < lines_arr_.size(); i++)
-    {
-      s += lines_arr_[i]->TeX_output_str();
-      if (i + 1<lines_arr_.size())
-       s += "\\interscoreline"; // TODO
-    }
-  return s;
-}
+#include "outputter.hh"
 
 void
 Super_elem::handle_broken_dependencies()
@@ -53,3 +41,69 @@ Super_elem::do_add_processing()
 }
 
 IMPLEMENT_IS_TYPE_B1(Super_elem,Score_elem);
+
+
+/**
+    for administration of what was done already
+    */
+enum Score_elem_status {
+  ORPHAN=0,                    // not yet added to pstaff
+  VIRGIN,                      // added to pstaff
+  PREBROKEN,
+  PRECALCING,
+  PRECALCED,           // calcs before spacing done
+  BROKEN,
+  POSTCALCING,         // busy calculating. This is used to trap cyclic deps.
+  POSTCALCED,          // after spacing calcs done
+  BREWING,
+  BREWED,
+  UNLINKING,
+  UNLINKED,
+};
+
+void
+Super_elem::pre_processing ()
+{
+  calcalute_dependencies (PRECALCING, PRECALCED, &Score_elem::do_pre_processing);
+}
+
+/* for break processing, use only one status, because copies have to
+  have correct status. (Previously,
+  Score_elem::handle_[pre]broken_dependencies assigned to status_i_
+  */
+void
+Super_elem::breakable_col_processing ()
+{
+  calcalute_dependencies (PREBROKEN, PREBROKEN, &Score_elem::do_breakable_col_processing);
+}
+
+void
+Super_elem::break_processing ()
+{
+  calcalute_dependencies (BROKEN, BROKEN, &Score_elem::do_break_processing);
+}
+void
+Super_elem::post_processing ()
+{
+  calcalute_dependencies (POSTCALCING, POSTCALCED, &Score_elem::do_post_processing);
+}
+
+void
+Super_elem::output_all () 
+{
+  for (int i=0; i < lines_arr_.size(); i++)
+    {
+      pscore_l_->outputter_l_->start_line ();
+      lines_arr_[i]->calcalute_dependencies (BREWING, BREWED, &Score_elem::do_brew_molecule);
+      pscore_l_->outputter_l_->stop_line ();
+    }
+}
+
+
+
+void
+Super_elem::unlink_all ()
+{
+  calcalute_dependencies (UNLINKING, UNLINKED, &Score_elem::junk_links);
+}
+
index c7201bde2ead3dbb1ea175036788a15d886c7099..385de4ab05533934aed1df4bdef0e03ae8ff7913 100644 (file)
@@ -104,11 +104,14 @@ Tie_engraver::do_pre_move_processing()
     }
 }
 
-Tie_engraver::~Tie_engraver()
+void
+Tie_engraver::do_removal_processing ()
 {
+  do_pre_move_processing ();
   if (tie_p_) 
     {
       req_l_->warning ("unended Tie");
+      tie_p_->unlink ();
       delete tie_p_;
     }
 }
index cd7b6e62e9479ec963144b5f3711c119f8189373..c824164d5053eeae495f8ce68d4e377d7b97f5e7 100644 (file)
@@ -115,12 +115,17 @@ Translator_group::find_create_translator_l (String n, String id)
     return existing;
   
   Link_array<Translator_group> path = path_to_acceptable_translator (n);
-
-  if (path.size ())
+      
+  /* 
+        if path.size () == 1, then 
+        type_str_ == n, but not id == id_str_
+        */
+  if (path.size () > 1)
     {
+      assert (path.size () > 1);
       Translator_group * current = this;
 
-      // start at 1.  The first one will be us.
+      // start at 1.  The first one (index 0) will be us.
       for (int i=1; i < path.size (); i++) 
        {
          Translator_group * new_group = path[i]->clone ()->group_l ();
@@ -130,9 +135,8 @@ Translator_group::find_create_translator_l (String n, String id)
       current->id_str_ = id;
       return current;
     }
-
   
-  Translator_group *  ret =0;
+  Translator_group *ret = 0;
   if (daddy_trans_l_)
     ret = daddy_trans_l_->find_create_translator_l (n,id);
   else 
@@ -208,7 +212,14 @@ Translator *
 Translator_group::remove_translator_p (Translator*trans_l)
 {
   PCursor<Translator*> trans_cur (trans_p_list_.find (trans_l));
-  return trans_cur.remove_p();
+  Translator * t =  trans_cur.remove_p();
+  /*
+    For elegant design, we would do this too.  Alas, it does not work yet..
+    
+    t-> removal_processing ();
+  */
+  t-> daddy_trans_l_ = 0;
+  return t;
 }
 
 
@@ -314,9 +325,8 @@ Translator_group::do_removal_processing ()
 }
 
 void
-Translator_group::add_processing ()
+Translator_group::do_add_processing ()
 {
-  Translator::add_processing ();
    for (int i=0; i < consists_str_arr_.size(); i++) 
     {
       Translator * t = output_def_l ()->find_translator_l (consists_str_arr_[i]);
index 636123a950d32420ad9d1c51a29863303663cc28..58b4c589178f09a50610562213b83339187d61fa 100644 (file)
@@ -24,6 +24,7 @@ Translator::Translator ()
 }
 
 Translator::Translator (Translator const &s)
+  : Input (s)
 {
   status = ORPHAN;
   daddy_trans_l_ =0;
@@ -55,8 +56,16 @@ Translator::now_moment () const
 void
 Translator::add_processing ()
 {
-  if (status == ORPHAN)
-    status = VIRGIN;
+  if (status > ORPHAN)
+    return;
+  
+  do_add_processing ();
+  status = VIRGIN;
+}
+
+void
+Translator::do_add_processing ()
+{
 }
 
 void
@@ -65,7 +74,7 @@ Translator::print () const
 #ifndef NPRINT
   DOUT << name () << " {";
   if (name () != type_str_)
-    DOUT << "type= " << type_str_;
+    DOUT << "type = " << type_str_;
   for (Dictionary_iter<Scalar> i (properties_dict_); i.ok (); i++)
     {
       DOUT << i.key () << "=" << i.val () <<"\n";
@@ -107,8 +116,12 @@ Translator::post_move_processing()
 void
 Translator::removal_processing()
 {
+  if (status == ORPHAN)
+    return;
   creation_processing();
   do_removal_processing();
+  // elegancy ...
+  // status = ORPHAN;
 }
 
 
index 02d1823b25b71621aa14732001f151472ac670cc..4f83ba1b7b8539e75683339f9b01651f1453ee7f 100644 (file)
@@ -64,7 +64,7 @@ Vertical_align_element::contains_b (Score_elem const *e) const
 Vertical_align_element::Vertical_align_element()
 {
   transparent_b_ = true;
-  empty_b_ =true;
+  set_empty (true);
 }
 
 
index 5814012ca0b7f1de924335e30571e52b93f7568f..5f61be35d3364aaf82ae03708d84f48bffded8c0 100644 (file)
@@ -101,7 +101,6 @@ Word_wrap::do_solve() const
       *mlog << "[" <<break_idx_i<<"]"<<flush;
       breaking.push (minimum);
     }
-  print_stats();
   return breaking;
 }
 
index 55823d2e0a020f189a175c16c749fa83a5d9825a..d554febe9e215477b0716b18ff83935779c6b6c2 100644 (file)
@@ -1,7 +1,7 @@
 Begin3
 Title: LilyPond
-Version: 0.1.13
-Entered-date: 11SEP97
+Version: 0.1.14
+Entered-date: 14SEP97
 Description:   LilyPond is the GNU Project music typesetter. This
                program converts music definition files into
                visual or auditive output: it can typeset formatted
@@ -14,8 +14,8 @@ Author: hanwen@stack.nl (Han-Wen Nienhuys)
        jan@digicash.com (Jan Nieuwenhuizen)
 Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
 Primary-site: sunsite.unc.edu /pub/Linux/apps
-       395k lilypond-0.1.13.tar.gz 
+       395k lilypond-0.1.14.tar.gz 
 Original-site: pcnov095.win.tue.nl /pub/lilypond/
-       395k lilypond-0.1.13.tar.gz 
+       395k lilypond-0.1.14.tar.gz 
 Copying-policy: GPL
 End
index dbee70b290d5cc872710f93d956075d1e4969dbd..4717e5d4443fa31734cd2319f9127d95988933e7 100644 (file)
@@ -1,9 +1,9 @@
 Name: lilypond
-Version: 0.1.13
+Version: 0.1.14
 Release: 1
 Copyright: GPL
 Group: Applications/Publishing
-Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.1.13.tar.gz
+Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.1.14.tar.gz
 Summary: A preprocessor to make TeX typeset music.
 URL: http://www.stack.nl/~hanwen/lilypond
 Packager: Han-Wen Nienhuys <hanwen@stack.nl>
index 1b38526a5ca1018da5e757c4bdad6c0a3c5c335b..9134edf382bc8e0b94e7386c79a3efee3aac9917 100644 (file)
@@ -2,7 +2,7 @@
 % A tex file to help determine dims.
 %
 
-\font\musicfont=musix16
+\font\musicfont=opus20 %musix16
 \font\slurfont=xslu16
 \font\specfont=musixspx
 \def\thefont{\musicfont}
         \repeat%
 }
 \def\twhrul{\hbox to 0pt{\hbox{\hruler{20}%
-       \vrule width0.1pt height 2pt depth 2pt}}}
+        \vrule width0.1pt height 2pt depth 2pt}}}
 \def\twvrul{\vbox to0pt{\vss\hbox to0pt{\hss\vruler{12}}\vss}%
-       \kern-1pt\vrule width4pt height 0.1pt}%
-       
+        \kern-1pt\vrule width4pt height 0.1pt}%
+        
  
 \def\doitem#1{
         #1%
         \vbox to12pt{\vfill\hbox to0pt{\qquad\kern-1pt\twvrul\hss}}%
         \hbox to50pt{\qquad\twhrul\mb{#1}\hss}%
-       \setbox0=\hbox{\mb{#1}} width \the\wd0\ depth \the\dp0 \ height \the\ht0}
+        \setbox0=\hbox{\mb{#1}} width \the\wd0\ depth \the\dp0 \ height \the\ht0}
 
 \newcount\n
 \def\charn{\n=-1
diff --git a/mudela-mode.el b/mudela-mode.el
new file mode 100644 (file)
index 0000000..1707a46
--- /dev/null
@@ -0,0 +1,205 @@
+;;; mudela-mode.el --- Major mode for editing Mudela programs
+
+
+;; Copyright (C) 1992,1993,1994  Tim Peters
+
+;; Author: 1997: Han-Wen Nienhuys
+;; Author: 1995-1996 Barry A. Warsaw
+;;         1992-1994 Tim Peters
+;; Created:       Feb 1992
+;; Version:       0.0
+;; Last Modified: 12SEP97
+;; Keywords: mudela languages music
+
+;; This software is provided as-is, without express or implied
+;; warranty.  Permission to use, copy, modify, distribute or sell this
+;; software, without fee, for any purpose and by any individual or
+;; organization, is hereby granted, provided that the above copyright
+;; notice and this paragraph appear in all copies.
+
+
+
+;; Kyrie Eleison; it is my first real Elisp file
+;; This is a cannabalised version of python-mode.el (HWN)
+;;
+;; TODO: 
+;; * should handle block comments too.
+;; * handle lexer modes (\header, \melodic, \lyric) etc.
+;; * indentation
+;; * notenames?
+;; * fontlock: \melodic \melodic 
+
+(defconst mudela-font-lock-keywords
+  (let* ((keywords '(
+                  "accepts" "bar" "cadenza" "clear" "clef" "cm" "consists" "contains"
+                  "duration" "absdynamic" "in" "translator" "type" "lyric" "key"
+                  "melodic" "melodic_request" "meter" "midi" "mm" "multi" "header"
+                  "notenames" "octave" "output" "partial" "paper" "plet" "property" "pt"
+                  "include"
+                  "score" "script" "skip" "staff" "table" "spandynamic" "symboltables"
+                  "tempo" "texid" "textstyle" "transpose" "version" "grouping"
+                  ))
+       (kwregex (mapconcat (lambda (x) (concat "\\\\" x))  keywords "\\|")))
+
+    (list 
+     (cons (concat ".\\(" kwregex "\\)[^a-zA-Z]") 1)
+     (cons (concat "^\\(" kwregex "\\)[^a-zA-Z]") 1)
+     '(".\\(\\\\[a-zA-Z][a-zA-Z]*\\)" 1 font-lock-variable-name-face)
+     '("^[\t ]*\\([a-zA-Z][_a-zA-Z]*\\) *=" 1 font-lock-variable-name-face)     
+    ))
+  "Additional expressions to highlight in Mudela mode.")
+
+;; define a mode-specific abbrev table for those who use such things
+(defvar mudela-mode-abbrev-table nil
+  "Abbrev table in use in `mudela-mode' buffers.")
+
+(define-abbrev-table 'mudela-mode-abbrev-table nil)
+
+(defvar mudela-mode-hook nil
+  "*Hook called by `mudela-mode'.")
+
+(defvar mu-mode-map ()
+  "Keymap used in `mudela-mode' buffers.")
+
+(defun mu-newline-and-indent ()
+  (interactive)
+  (newline)
+  (indent-relative-maybe)
+  "Newline and copy previous indentation")
+
+(if mu-mode-map
+    ()
+  (setq mu-mode-map (make-sparse-keymap))
+
+  (mapcar (function (lambda (key)
+                     (define-key
+                       mu-mode-map key 'mu-newline-and-indent)))
+   (where-is-internal 'newline-and-indent))
+
+  (mapcar (function
+          (lambda (x)
+            (define-key mu-mode-map (car x) (cdr x))))
+         '(("\C-c\C-c"  . mu-foo-bar)
+           ))
+  ;; should do all keybindings this way
+  (define-key mu-mode-map [RET] 'mu-newline-and-indent)
+  ) 
+
+(defvar mu-mode-syntax-table nil
+  "Syntax table used in `mudela-mode' buffers.")
+
+;;
+(if mu-mode-syntax-table
+    ()
+  (setq mu-mode-syntax-table (make-syntax-table))
+  (mapcar (function
+          (lambda (x) (modify-syntax-entry
+                       (car x) (cdr x) mu-mode-syntax-table)))
+         '(( ?\( . "()" ) ( ?\) . ")(" )
+           ( ?\[ . "(]" ) ( ?\] . ")[" )
+           ( ?\{ . "(}" ) ( ?\} . "){" )
+           ( ?\< . "(>" )( ?\> . ")>") 
+           ( ?\$ . "." ) ( ?\% . "." ) ( ?\& . "." )
+           ( ?\* . "." ) ( ?\+ . "." ) ( ?\- . "." )
+           ( ?\/ . "." )  ( ?\= . "." )
+           ( ?\| . "." ) (?\\ . "\\" )
+           ( ?\_ . "." )       
+           ( ?\' . "w")        
+           ( ?\" . "\"" )
+           ( ?\% . "<")        
+           ( ?\n . ">")
+           
+           ))) 
+
+(defconst mu-stringlit-re
+   "\"\\([^\"\n\\]\\|\\\\.\\)*\""      ; double-quoted
+  "Regexp matching a Mudela string literal.")
+
+
+(defconst mu-blank-or-comment-re "[ \t]*\\($\\|%\\)"
+  "Regexp matching blank or comment lines.")
+
+(defconst mu-imenu-generic-re "^\\([a-zA-Z_][a-zA-Z0-9_]*\\) *="
+  "Regexp matching Identifier definitions.")
+
+;; Sadly we need this for a macro in Emacs 19.
+(eval-when-compile
+  ;; Imenu isn't used in XEmacs, so just ignore load errors.
+  (condition-case ()
+      (require 'imenu)
+    (error nil)))
+
+(defvar mu-imenu-generic-expression
+  (list (list nil mu-imenu-generic-re 1))
+  "Expression for imenu")
+
+(defun mudela-mode ()
+  "Major mode for editing Mudela files."
+
+  (interactive)
+  ;; set up local variables
+  (kill-all-local-variables)
+  (make-local-variable 'font-lock-defaults)
+  (make-local-variable 'paragraph-separate)
+  (make-local-variable 'paragraph-start)
+  (make-local-variable 'require-final-newline)
+  (make-local-variable 'comment-start)
+  (setq comment-start "% ")
+  (setq comment-end "")
+  (make-local-variable 'comment-end)
+  (make-local-variable 'comment-start-skip)
+  (setf comment-start-skip "%{")
+  (make-local-variable 'comment-column)
+  (make-local-variable 'imenu-generic-expression)
+  (setq imenu-generic-expression mu-imenu-generic-expression)
+  (make-local-variable 'indent-line-function)
+  ;;
+  (set-syntax-table mu-mode-syntax-table)
+  (setq major-mode             'mudela-mode
+       mode-name              "Mudela"
+       local-abbrev-table     mudela-mode-abbrev-table
+       font-lock-defaults     '(mudela-font-lock-keywords)
+       paragraph-separate     "^[ \t]*$"
+       paragraph-start        "^[ \t]*$"
+       require-final-newline  t
+       comment-start          "% "
+       comment-start-skip     "% *"
+       comment-column         40
+       indent-line-function    'indent-relative-maybe
+       )
+  (use-local-map mu-mode-map)
+
+  ;; run the mode hook. mu-mode-hook use is deprecated
+  (if mudela-mode-hook
+      (run-hooks 'mudela-mode-hook)
+    (run-hooks 'mu-mode-hook)))
+
+(defun mu-keep-region-active ()
+  ;; do whatever is necessary to keep the region active in XEmacs.
+  ;; Ignore byte-compiler warnings you might see.  Also note that
+  ;; FSF's Emacs 19 does it differently and doesn't its policy doesn't
+  ;; require us to take explicit action.
+  (and (boundp 'zmacs-region-stays)
+       (setq zmacs-region-stays t)))
+
+
+(defun mu-comment-region (beg end &optional arg)
+  "Like `comment-region' but uses double hash (`#') comment starter."
+  (interactive "r\nP")
+  (let ((comment-start mu-block-comment-prefix))
+    (comment-region beg end arg)))
+\f
+(defconst mu-version "0.0"
+  "`mudela-mode' version number.")
+(defconst mu-help-address "hanwen@stack.nl"
+  "Address accepting submission of bug reports.")
+
+(defun mu-version ()
+  "Echo the current version of `mudela-mode' in the minibuffer."
+  (interactive)
+  (message "Using `mudela-mode' version %s" mu-version)
+  (mu-keep-region-active))
+
+(provide 'mu-mode)
+;;; mudela-mode.el ends here
index 630cf8e824f10a34a40765a9470dbac59f39757a..b31a2303e98976de50c1705d2d0254a1bc4fd54a 100644 (file)
 \def\kdynf{\dynnf}
 \def\kdynp{\dynp\kern-.1ex}
 
-\def\dynf{\dynaf}
-\def\dynpp{\kdynp\dynp}
-\def\dynppp{\kdynp\kdynp\dynp}
-\def\dynmp{\dynm\kern -.2ex\dynp}
-\def\dynmf{\dynfont\raise.08ex\hbox{\dynm}\kern-.3ex\dynnf}
-\def\dynff{\kdynf\dynnf}
-\def\dynfff{\kdynf\kdynf\dynnf}
+\def\dynf{{\dynaf}}
+\def\dynpp{{\kdynp\dynp}}
+\def\dynppp{{\kdynp\kdynp\dynp}}
+\def\dynmp{{\dynm\kern -.2ex\dynp}}
+\def\dynmf{{\dynfont\raise.08ex\hbox{\dynm}\kern-.3ex\dynnf}}
+\def\dynff{{\kdynf\dynnf}}
+\def\dynfff{{\kdynf\kdynf\dynnf}}
 
-\def\dynfp{\kdynf\dynp}
-\def\dynsf{\dyns\kern-.3ex\dynnf}
-\def\dynsfz{\dynsf\dynz}
+\def\dynfp{{\kdynf\dynp}}
+\def\dynsf{{\dyns\kern-.3ex\dynnf}}
+\def\dynsfz{{\dynsf\dynz}}
 
index 670a25a644d29e43b643a467e6c9902f038579e0..feff7b983e3b089a8a1c2dc18b74d8b5a0a695d3 100644 (file)
@@ -81,8 +81,8 @@
 }
 
 \def\textsharp{\raise.4ex\hbox{\textmusic\char"5D}}
-\def\textflat{\raise.4ex\hbox{\textmusic\char"5B}}
-\def\flt{\raise.2ex\hbox{\mus\char"5B}}
+\def\textflat{\raise.2ex\hbox{\mus\char"5B}}
+
 
 
 
index 2aef5e5e877b2d61e73b11c482abb28ceaa6f77b..037b7a943dfcaa0047d79b4fc80d424fe748b393 100644 (file)
@@ -12,7 +12,7 @@
         \font\musicfnt=musix20
         \font\musicdraw=musixsps
         \font\italicfont=cmti10
-        \font\dynfont=dyn10% scaled \magstep2
+        \font\dynfont=dyn10 scaled \magstep2
         \font\musicmathfont=cmsy10
 }
 
@@ -29,7 +29,7 @@
         \font\hslurdfont=xslhd16
         \font\hslurhfont=xslhz20
         \font\musicfnt=musix16
-        \font\dynfont=dyn10% scaled \magstep1
+        \font\dynfont=dyn10 scaled \magstep1
         \font\musicdraw=musixsps
         \font\musicmathfont=cmsy8
 }