]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 0.0.40 release/0.0.40
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 10 Mar 1997 18:01:32 +0000 (19:01 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 10 Mar 1997 18:01:32 +0000 (19:01 +0100)
122 files changed:
.dstreamrc [new file with mode: 0644]
.version
ANNOUNCE
Documentation/README.pod
Documentation/faq.pod
Documentation/index.pod
INSTALL
Makefile
NEWS
README
TODO
bin/Makefile
bin/configure [deleted file]
bin/genheader
bin/make_patch
bin/make_website
configure [changed from symlink to file mode: 0755]
flower/.version
flower/Makefile
flower/NEWS
flower/TODO
flower/Variables.make
flower/fproto.hh
flower/lib/Makefile
flower/lib/dstream.cc
flower/lib/include/flower-config.hh [deleted file]
flower/lib/include/fproto.hh
flower/lib/include/pqueue.hh
flower/lib/include/string-convert.hh
flower/lib/string-convert.cc
flower/libc-extension.cc
flower/libc-extension.hh
flower/string.cc
flower/test/Makefile [new file with mode: 0644]
flower/test/stringtest.cc [new file with mode: 0644]
init/dynamic.ini [new file with mode: 0644]
init/symbol.ini
init/table_sixteen.ini
input/cadenza.ly
input/scsii-menuetto.ly
input/standchen.ly
lib/Makefile
lib/include/config.hh [deleted file]
lib/include/proto.hh
lily/Makefile
lily/bar.cc
lily/beam.cc
lily/clef-item.cc
lily/dynamic-reg.cc [new file with mode: 0644]
lily/identifier.cc
lily/include/config.hh [deleted file]
lily/include/dynamic-reg.hh [new file with mode: 0644]
lily/include/identifier.hh
lily/include/identparent.hh
lily/include/lookup.hh
lily/include/midi-walker.hh
lily/include/musicalrequest.hh
lily/include/paper-def.hh
lily/include/parser.hh [deleted file]
lily/include/score-walker.hh
lily/include/staff-column.hh
lily/include/staff-elem-info.hh
lily/include/symtable.hh
lily/include/text-def.hh
lily/include/text-item.hh
lily/key-item.cc
lily/lexer.l
lily/local-key-item.cc
lily/lookup.cc
lily/lyric-item.cc
lily/meter.cc
lily/midi-item.cc
lily/midi-output.cc
lily/midi-walker.cc
lily/mylexer.cc
lily/notehead.cc
lily/paper-def.cc
lily/parser.y
lily/pscore.cc
lily/request.cc
lily/rest.cc
lily/score-walker.cc
lily/script.cc
lily/slur.cc
lily/staff-column.cc
lily/staff.cc
lily/staffsym.cc
lily/stem.cc
lily/symtable.cc
lily/tex-beam.cc
lily/tex-slur.cc
lily/text-def.cc
lily/text-item.cc
lily/voice-elt.cc
lily/voice-group-regs.cc
lily/walk-regs.cc
m2m/.version [deleted file]
m2m/Makefile [deleted file]
m2m/include/Makefile [deleted file]
m2m/include/midi-main.hh [deleted file]
m2m/midi-lexer.l [deleted file]
m2m/midi-parser.y [deleted file]
make/ACVariables.make.in [new file with mode: 0644]
make/Builtin-rules.make [new file with mode: 0644]
make/Include.make
make/Initial.make
make/Makefile
make/Rules.make
make/Site.make [deleted file]
make/Sources.make
make/Targets.make
make/Template.make
make/User.make
make/Variables.make
make/configure.in [new file with mode: 0644]
make/lilypond.spec [new file with mode: 0644]
mi2mu/.version [new file with mode: 0644]
mi2mu/Makefile [new file with mode: 0644]
mi2mu/include/Makefile [new file with mode: 0644]
mi2mu/midi-lexer.l [new file with mode: 0644]
mi2mu/midi-parser.y [new file with mode: 0644]
tex/lilyponddefs.tex

diff --git a/.dstreamrc b/.dstreamrc
new file mode 100644 (file)
index 0000000..2b36f41
--- /dev/null
@@ -0,0 +1,54 @@
+# class name           silence?
+
+My_flex_lexer          1
+yyFlexLexer            1
+PCol                   1
+Score_column           1
+Ineq_constrained_qp    1
+Spacing_problem        1
+Colinfo                        1
+Mixed_qp               1
+PScore                 1
+Idealspacing           1
+
+# yydebug
+InitParser             1
+Parser                 1
+InitDeclarations       1
+
+# FlexLexer debug
+InitLexer              1
+Lexer                  1
+
+parse_duration         1
+parse_pitchmod         1
+Col_configuration      1
+Request                        1
+Note_req               1
+Rhythmic_req           1
+Rest_req               1
+delete_identifiers     1
+Command                        1
+Staff_commands         1
+Stem                   1
+Staff                  1
+Score                  1
+Voice                  1
+Voice_element          1
+Input_cursor           1
+Commands_at            1
+Input_command          1
+Time_description       1
+Melodic_req            1
+Midi_walker            1
+Stem_req               1
+Group_change_req       1
+Script_req             1
+Colinfo                        1
+Word_wrap              1
+Text_req               1
+Script_def             1
+Text_def               1
+Paperdef               1
+Symtable               1
+Symtables              1
index 22587f334ff7267de1ef6969277ca63d1cd46ea4..60504f184743373c9328d58862468aa059bf815f 100644 (file)
--- a/.version
+++ b/.version
@@ -1,6 +1,8 @@
 TOPLEVEL_MAJOR_VERSION = 0
 TOPLEVEL_MINOR_VERSION = 0
-TOPLEVEL_PATCH_LEVEL = 39
+TOPLEVEL_PATCH_LEVEL = 40
 # use to send patches, always empty for released version:
-TOPLEVEL_MY_PATCH_LEVEL = -1# include separator: "-1" or ".a"
+# include separator: ".postfix", "-pl" makes rpm barf
+
+TOPLEVEL_MY_PATCH_LEVEL = 
 #
index 48bbdd0cbd898c4cb5980785d642f1d1d773a856..df31a15ba0eb004dd2a269af60180847d21d084a 100644 (file)
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,3 +1,5 @@
+[Draft version]
+[Draft version]
 
 CALL FOR HACKERS: LilyPond, the Music Typesetter
 
index 96c5ea4dd5a641570cb3c6f26cc78840b9845622..90376b754a2ee99791703559aa3e9b9099c8e046 100644 (file)
@@ -139,11 +139,11 @@ Show the warranty with which LilyPond comes. (It comes with B<NO WARRANTY>!)
 
 Set the default output file to F<FILE>.
 
-=item  B<-h,--help>,
+=item B<-h,--help>,
 
 Show a summary of usage
 
-=item  B<-i,--init=>F<FILE>
+=item B<-i,--init=>F<FILE>
 
 set init file to F<FILE> (default: F<symbol.ini>)
 
@@ -177,18 +177,17 @@ GNU C++ v2.7 or better, with libg++ installed.  Version 2.7.2
 or better recommended. I doubt if it will compile with AT&T CC.
 
 =item *
-GNU make.
+Bash. Most scripts will continue to work with a stock sh, but they
+will generate (harmless) syntax errors
 
 =item *
-Flex (2.5.1 or better)
+GNU make.
 
 =item *
-Bison.
+Flex (2.5.1 or better). 
 
 =item *
-The "Flower" library, which should be available from the same
-source you got this from. The version of flower lib should match the
-one which is found in the F<configure> script.
+Bison.
 
 =item *
 Perl.  The Makefile uses Perl for trivial operations, and you
index 79e511498ef3dcb34e2fb516c35e78ff76518348..2c5ceb2cb97673829fa6bbb792e9bb841cb18bab 100644 (file)
@@ -23,11 +23,11 @@ A1: Currently (patchlevel 27), LilyPond (and flowerLib) compiles, links
 and runs on windhoos-nt, using the cygnus gnu port (release b17.1). 
 I (JCN) only had to make a minor workaround for missing library calls.  
 Have a look at http://www.cygnus.com/gnu-win32.  To make LilyPond type
-make $OS. (I am not promising to maintain this platform, it is just that
-when having to use doze, i-m sometimes too lazy to reboot.)
+C<make $OSTYPE>. (I am not promising to maintain this platform, it is just 
+that when having to use doze, i-m sometimes too lazy to reboot.)
 
-A2: I haven't had time to find a GCC crosscompiler (*with* g++, mind you) to
-DOS/win (in rpm, please :).
+A2: I haven't had time to find a GCC crosscompiler (I<with> g++ and
+libg++, mind you) to DOS/win (in rpm, please :).
 
 
 Q: Why GPL?
@@ -54,7 +54,7 @@ Q: Why do I need g++ >= 2.7?
 
 A: By using g++ LilyPond is portable to all platforms which support
 g++ (there are quite a few). Not having to support other compilers
-saves us a *lot* of trouble. LilyPond & FlowerLib uses:
+saves us a I<lot> of trouble. LilyPond & FlowerLib uses:
 
 =over 6
 
index f473d9c456146d7aba85e41272557fe14ab2b765..4e12783de1d0fd5861749721e0525af8df86ca2a 100644 (file)
@@ -86,4 +86,15 @@ MIDI output
 >
 The DOC++ documentation of the C++ sources.
 </a
->
\ No newline at end of file
+>
+
+=item *
+<a href=ftp://pcnov095.win.tue.nl/pub/lilypond
+>
+Get it!
+</a
+>
+
+=head1 AUTHOR
+
+Han-Wen Nienhuys <hanwen@stack.nl>, for this page
diff --git a/INSTALL b/INSTALL
index 29161e6fc4fa84431ad4e786bc1feed6c4972c59..e6fe95267ad2255177f2894cc5412cdc7b760215 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -29,7 +29,7 @@ INSTALL:
 
     to make LilyPond under, brr, aargh, well, simply type:
 
-           bash bin/configure
+           bash configure
            make win32
     \end{masochist}
 
index b8abfd8b66b5abf1b84ecdb79660b05bd80292ce..bbbf5763ce0782af59f53e0f53e6c37b8e5b2a5c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -33,15 +33,16 @@ include ./$(depth)/make/Variables.make
 
 # descent order into subdirectories:
 #
-SUBDIRS = flower lib lily m2m \
-       Documentation bin init input make tex
+SUBDIRS = flower lib lily mi2mu \
+       Documentation bin init input tex make
 #
 
 # list of distribution files:
 #
-SYMLINKS = configure
+# SYMLINKS = # naah, configure
+SCRIPTS = configure
 README_FILES = ANNOUNCE COPYING INSTALL NEWS README TODO
-DISTFILES= Makefile .version $(README_FILES) $(SYMLINKS)
+DISTFILES= Makefile .dstreamrc .version $(README_FILES) $(SCRIPTS) $(SYMLINKS)
 #
 
 # generic targets and rules:
diff --git a/NEWS b/NEWS
index 4441132305c8caec69a5c60fbd6836b65cf9d0e4..999d01b5a61e56f9cb5c8fa15700772c1be7db69 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,46 @@
+pl 40
+       - release
+
+pl 39-5
+       - own versioning for mi2mu
+       - some file renaming mi2mu
+pl 39-4
+       - all of the above
+
+pl 39-hwn2
+       - last bar bugfix
+Internal
+       - simple dynamics
+       - experimental RPM spec.
+       - doco update.
+
+pl 39-3
+       - all of the above
+       - m2m renamed to mi2mu
+       - better line breaking in mi2mu
+       - (somewhat broken) progress indicator for mi2mu 
+       - mi2mu output === lily input (in names and durations,
+         always assuming voices > 1 though)
+
+Bugfix
+       - midi: note on/off only once per pitch per track 
+         (sending all note-on events introduces cool mi2mu feature)
+       - make clean removes deps too
+       - mi2mu notename/accidental/octave, and key fixed
+
+Internal
+       - auto create of out-dirs, config headers, using tag file .GENERATE
+
+Examples
+       - stanchen.ly debugged
+
+pl 39-2
+       - configure script help and in topdir again, duh.
+       - auto configure upon virgin make
+       - configured makefile stuff in make/out/
+
+
+********
 pl 39-1
        - doze target (for 16 bit dos xcompiler: gcc-go32)
 Internal
@@ -34,7 +77,7 @@ Bugfix
 pl 38-5
        - all of the below, e.g. new filenames and new makefile 
          structure patches merged
-
+******
 pl 38
 
 Internal
diff --git a/README b/README
index 5bfa9c21c552a8488a344ddc9d81c28a70423d6c..8a04265c3566b99cfafa90a1b3fe160f157f3c14 100644 (file)
--- a/README
+++ b/README
@@ -9,12 +9,14 @@ version, then this is version is *not* meant for producing nice output
 
 ====================
 
-Please refer to the directory Documentation/, Documentation/README.*
+Please refer to the directory Documentation/, Documentation/README.*
 
 To generate the pretty-printed docs, do this:
 
        make doc
 
+You can also simply read the .pod source. It is ASCII text.
+
 ======================
 
 NOTE:
diff --git a/TODO b/TODO
index 87d3ef806cf8f4ebb9a3d4b23849d3a98421d3c6..b3d03f91ba5704e96dfc1766f2dd24140eb2437a 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,6 +1,6 @@
 before 0.1
 
-       * remove spurious/outdated comments in .ly
+       * remove spurious/outdated comments in .ly, debug .ly
        
        * pushgroup, popgroup.
 
@@ -14,6 +14,8 @@ before 0.1
 
        * caching of Register_group_register hierarchies.
 
+       * midi esp.: use I32 iso int where 32 bits are needed (or assumed...)
+
 This is an assorted collection of stuff that will be done, might be
 done, or is an idea that I want to think about
 
@@ -24,8 +26,12 @@ STUFF
 
        * do platform stuff: configure, header(s), targets, build (out?)
 
+       * make install.
+       
 BUGS
 
+       * barf if no score_wde_music
+
        * plet bugs: scales.ly
 
        * key at clef change.
@@ -96,12 +102,12 @@ SMALLISH PROJECTS
        * use (char *) iso. String for communication between lexer and
        parser.
 
-       * configure idealspacing: arithmetic spacing
-
-       * fix linking: `Warning: size of symbol'
+       * configure idealspacing: arithmetic
 
        * collision Request_register.
 
+       * make install (gnu dir names)
+
        * LilyPond .rpm and .deb
 
 DOC
@@ -144,6 +150,8 @@ FUTURE
 
 IDEAS
 
+       * integrate Register/Midi stuff
+
        * create libmudela,  or liblily_frontend
 
        * Horizontal_align_item, Vertical_align_item.
index 2549e4255f74a2d2fdd5041c13e465789f59e5f0..e9f5521e5eea6c2730c854c6e7c6a593bae6b80e 100644 (file)
@@ -14,7 +14,7 @@ include ./$(depth)/make/Stuff.make
 
 # list of distribution files:
 # 
-SCRIPTS = clearlily configure cpgento genheader make_patch make_fversion make_version make_website
+SCRIPTS = clearlily cpgento genheader make_patch make_fversion make_version make_website
 DISTFILES = Makefile $(SCRIPTS)
 #
 
diff --git a/bin/configure b/bin/configure
deleted file mode 100755 (executable)
index 0c647c2..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/sh
-#
-# project  LilyPond -- the musical typesetter
-# title           (bash/sh/ksh) script to setup library and auto generated files
-# file    bin/configure
-#
-# Copyright (c) 1997 by    
-#      Han-Wen Nienhuys <hanwen@stack.nl>
-#      Jan Nieuwenhuizen <jan@digicash.com>
-# 
-
-MAKE=${MAKE:-make}
-NEEDFLOWERVER=1.1.6
-PREFIX=${PREFIX:-.}
-
-
-#############
-#############
-
-# without "function" ok for ksh, bash
-setversion() {
-       eval `sed -n 's/^\([A-Z_]*\)[   ]*=[     ]*\([^         \#]*\).*$/\1=\2/p' $1`
-#      NEWVER=$TOPLEVEL_MAJOR_VERSION.$TOPLEVEL_MINOR_VERSION.$TOPLEVEL_PATCH_LEVEL$TOPLEVEL_MY_PATCH_LEVEL
-       NEWVER=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL$MY_PATCH_LEVEL
-       echo
-       echo "Current  version ("`pwd`") is:"
-       echo "  $NEWVER"
-       echo
-}
-
-do_outdir() {
-       if [ \! -d $1/out ]
-       then
-               mkdir $1/out
-               echo 0 > $1/.build
-       fi
-}
-
-echo using PREFIX=$PREFIX
-echo I need Flower version $NEEDFLOWERVER
-
-flowertar=flower-$NEEDFLOWERVER
-
-#ugh
-do_outdir flower/lib
-do_outdir Documentation
-do_outdir lib
-do_outdir lily
-do_outdir m2m
-
-# mmm
-if [ -x flower ]
-then
-       echo Found flowerdir
-else
-       if [ -d $flowertar ]
-       then
-               ln -fs $flowertar flower
-       elif [ -d ../$flowertar ]
-       then
-               ln -fs ../$flowertar flower
-       else
-               echo "can't find $flowertar"
-               exit 1;
-       fi
-fi
-
-echo Configuring Flower Library
-setversion ./flower/.version
-if [ $NEWVER != $NEEDFLOWERVER ]; then
-       echo "You seem to be having an incorrect version of the Flower library"
-else
-       echo "You got the correct Flower version."
-fi
-
-#ugh
-echo '#define LIBDIR "'$PREFIX'/"'> lib/out/config.hh
-touch flower/lib/out/flower-config.hh
-touch make/Site.make
-$MAKE -C make -f Initial.make
-
-echo "The sources are ready for compiling. "
-echo "To make sure that you don't have any stale dependencies: do"
-echo "         make clean"
-
index 7c36afe0ae8355ed8644889b7866a9e40e3e7c1c..fba3c1559e881553c2bc1e035b76e13ce0bb50b5 100755 (executable)
@@ -8,10 +8,15 @@ my @pw=(getpwuid($<));
 my $username=$pw[6];
 my $what="implement ";
 $what = "declare " if ($hh_q);
+my ($PROJECT, $cwd);
+$PROJECT = "the LilyPond music typesetter";
+chop($cwd = `pwd`);
+
+$PROJECT= "the Flower Library" if ($cwd =~ /flower/);
 my $headstr ="/*
   $fn -- $what
 
-  source file of the LilyPond music typesetter
+  source file of $PROJECT
 
   (c) 1997 $username <$MAILADRESS>
 */\n";
index 290e2e33da2163e9d97c744d80a8f9ad0b98c880..f74f1ea0cdbee74d2d9c75bb2cd128ccc5f0c2dd 100755 (executable)
@@ -21,7 +21,7 @@ then
        echo cant find $newarc
        exit
   fi
-  tar zfxv $newarc
+  tar zfx $newarc
 fi
 if [ ! -x  $nm$old ]
 then
@@ -29,10 +29,10 @@ then
 
   if [ ! -f $oldarc ]
   then
-       echo cant find oldarc
+       echo cant find $oldarc
        exit
   fi
-   tar zfxv $oldarc
+   tar zfx $oldarc
 fi
 
 #(cd $nm$old; touch depend; make clean)
index 844e60bbd1dc384098d224bc7510edb5e8536745..5b360b94fbdb5bb5113ec6af568cefde61b1b9cb 100755 (executable)
@@ -8,20 +8,25 @@ sub
     }
 }
 
+sub all_refs
+{
+    print "resetting refs.\n";
+
+    foreach $a (<*.html>)
+    {
+       rename $a, "$a~";
+       open HTMLIN, "$a~";
+       open HTMLOUT, ">$a";
+       set_hrefs;
+    }
+}
+
 local $base="lilypond/";
 local @examples=("wohltemperirt");
 
 system  'pod2html';
 
-print "resetting refs.\n";
-
-foreach $a (<*.html>)
-{
-    rename $a, "$a~";
-    open HTMLIN, "$a~";
-    open HTMLOUT, ">$a";
-    set_hrefs;
-}
+print "generating examples";
 
 foreach $a (@examples) {
     $texfile="test";
deleted file mode 120000 (symlink)
index 58b4a5f592b0d8d4e443131f80f556babd438da3..0000000000000000000000000000000000000000
--- a/configure
+++ /dev/null
@@ -1 +0,0 @@
-bin/configure
\ No newline at end of file
new file mode 100755 (executable)
index 0000000000000000000000000000000000000000..2e50a3fbf4eca38774f10f5909562a51a397f981
--- /dev/null
+++ b/configure
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# project  LilyPond -- the musical typesetter
+# title           (bash/sh/ksh) script to setup library and auto generated files
+# file    configure
+#
+# Copyright (c) 1997 by    
+#      Han-Wen Nienhuys <hanwen@stack.nl>
+#      Jan Nieuwenhuizen <jan@digicash.com>
+# 
+
+MAKE=${MAKE:-make}
+PREFIX=${PREFIX:-.}
+
+# this whole script sux, but here we go:
+opt="`echo $1 | cut -c 1-3`"
+if [ "$opt" = "-h" -o "$opt" = "--h" ]
+then
+       echo "Usage:"
+       echo "  [MAKE=make] configure [options]"
+       echo
+       echo "options:"
+       echo "  -h, --help      this text"
+       echo
+       echo "e.g.: MAKE=gmake configure"
+       exit
+fi
+
+#############
+#############
+
+do_outdir() {
+       if [ \! -d $1/out ]
+       then
+               mkdir $1/out
+               echo 0 > $1/.build
+       fi
+}
+
+echo using PREFIX=$PREFIX
+
+#ugh # dist ze dan!, nou stiekem wordt "out" later toch "loes" of "doze"
+# do_outdir flower/lib
+# now all make rules!
+
+echo Configuring Flower Library
+
+#ugh, now all make rules
+# the _real_ config stuff should be generated here, though.
+# echo '#define LIBDIR "'$PREFIX'/"'> lib/out/config.hh
+# touch flower/lib/out/flower-config.hh
+# touch make/out/Site.make
+
+$MAKE -C make -f Initial.make
+
+echo "The sources are ready for compiling. "
+echo "To make sure that you don't have any stale dependencies: do"
+echo "         make clean"
+
index 5a44cc8816f34e5025f3c16b984249e54f7deca8..45d4ace49282eada95c2aff9d7f143aca304f50e 100644 (file)
@@ -1,6 +1,6 @@
 MAJOR_VERSION = 1
 MINOR_VERSION = 1
-PATCH_LEVEL = 6
+PATCH_LEVEL = 7
 # use to send patches, always empty for released version:
-MY_PATCH_LEVEL = -1# include separator: "-1" or ".a"
+MY_PATCH_LEVEL = # include separator: "-1" or ".a"
 #
index 779f1e5b82f04d8cd6b13e07411df3e2f6662f5d..f4ab0e668f304d9016c4a6f89419845afaf6d4e5 100644 (file)
@@ -5,6 +5,9 @@ $(staticlib): $(obs) fversion.hh
 
 include deps/*.dep
 
+flower-config.hh:
+       touch flower-config.hh
+
 deps/*.dep:
        touch deps/dummy.dep
 
index 36c03ddcd46c0f66f4eb975df29a5f4e5c5b24a4..faa08528d73cdced2145437b9e24c32ebd163ff0 100644 (file)
@@ -1,3 +1,6 @@
+pl 1.1.5
+       - memmem interface, conditional compilation
+       - snprintf
 
 pl 1.1.4
        - great file-renaming.
index 2026c95134ea3e870fa444d2b3b1696b0b4e3f26..26061b740c59cf948a24c0a88976a5d4ade9fa1e 100644 (file)
@@ -1,5 +1,7 @@
        * shared lib.
 
+       * LGPL?
+
        * integrate Make mechanisms of flower & lily
 
        * disable this auto conv: const pointer -> bool -> string
index 564acd8c630fe9cbfcd2dc9dddd882ff7ebe7486..23a14e903aeb3b94069583a2b6c78d29e0333cfb 100644 (file)
@@ -1,6 +1,6 @@
 MAJVER=1
 MINVER=1
-PATCHLEVEL=4
+PATCHLEVEL=5
 
 PACKAGENAME=flower
 
index 57469fead57711b5ced16bda6f84a835cbedb08b..8c6fda680ef111acb3db33771fb9e546fcb70f76 100644 (file)
@@ -7,6 +7,8 @@
 #ifndef FPROTO_HH
 #define FPROTO_HH
 
+#include "flower-config.hh"
+
 template<class T> struct Array;
 template<class T> struct sstack;
 template<class T,class K> struct Assoc;
index 0eccc67beb125b400540d83b935123a696f55fef..9bb2cfff69406350b325439601879e6198d74fdf 100644 (file)
 depth = ../..
 #
 
+# generic variables:
+#
+include ./$(depth)/make/Variables.make 
+#
+
 # identify module:
 #
 NAME = flower
@@ -21,14 +26,9 @@ include ./$(depth)/flower/.version
 build = ./$(depth)/flower/lib/.build
 #
 
-# generic variables:
-#
-include ./$(depth)/make/Variables.make 
-#
-
 # descent order into subdirectories:
 #
-SUBDIRS = include
+SUBDIRS = include 
 #
 
 # to be remade each build:
@@ -38,17 +38,17 @@ VERSION_DEPENDENCY =#
 
 # list of c++ header files:
 # 
-HHFILES = # $(shell ls include/*.hh)
+HHFILES = $(shell ls *.hh $(ERROR_LOG))
 #
 
 # list of c++ source files:
 #
-CCFILES = $(shell ls *.cc)
+CCFILES = $(shell ls *.cc $(ERROR_LOG))
 #
 
 # list of other source files:
 #
-EXTRA_SOURCE_FILES =# $(shell ls *.y *.l)
+EXTRA_SOURCE_FILES = $(shell ls *.y *.l $(ERROR_LOG))
 #
 
 # list of distribution files:
@@ -75,9 +75,9 @@ MAINTARGET = $(libdir)/$(LIBRARY)# huh?
 default: $(MAINTARGET)
 #
 
-# sic.
-$(include-flower)/flower-config.hh:
-       touch $@
+# sic.
+$(include-flower)/flower-config.hh:
+#      touch $@
  
 # generic targets and rules:
 #
@@ -85,8 +85,13 @@ include ./$(depth)/make/Targets.make
 include ./$(depth)/make/Rules.make
 #
 
+# list of depend files:
+#
+DEPFILES = $(shell ls $(depdir)/*.dep $(ERROR_LOG))
+#
+
 # auto dependencies:
 #
--include ./$(outdir)/*.dep
+-include $(DEPFILES)
 #
 
index e6fdbc0e4dbf2d9a9a827a569559bd038893040a..1197dd79e71c20e13dd4d24bec14e7f52efc14be 100644 (file)
@@ -1,3 +1,5 @@
+
+
 #include <fstream.h>
 #include "assoc.hh"
 #include "dstream.hh"
@@ -53,7 +55,8 @@ Dstream::identify_as(String name)
     local_silence = (*silent)[idx];
     if (classname != idx && !local_silence) {
        classname=idx;
-//     *os << "[" << classname << ":]"; // messy.
+       if (!(*silent)["Dstream"])
+           *os << "[" << classname << ":]"; // messy.
     }
     return *this;
 }
diff --git a/flower/lib/include/flower-config.hh b/flower/lib/include/flower-config.hh
deleted file mode 100644 (file)
index e69de29..0000000
index 8c6fda680ef111acb3db33771fb9e546fcb70f76..bf8a22211c1c327bdec4d8ce0446b5361fe3a493 100644 (file)
@@ -7,6 +7,13 @@
 #ifndef FPROTO_HH
 #define FPROTO_HH
 
+// what the F*** is "int" ?
+// depreciate int, long, etc., use i32, i64, remember: linux-16/linux-64 ?
+/// (i32)
+typedef int i32;
+/// (i64)
+typedef long long I64;
+
 #include "flower-config.hh"
 
 template<class T> struct Array;
@@ -19,7 +26,9 @@ template<class T> struct Cursor;
 template<class T> struct PCursor;
 template<class T> struct Link;
 template<class T> struct Handle;
-template<class T>struct Interval_t;
+template<class T> struct Interval_t;
+template<class T,class Q> struct PQueue;
+
 #include "real.hh"
 
 typedef Interval_t<Real> Interval;
index 195232317e17f58e268833afe3bbb9db1817e02f..c8dfe1bea6754f8786e8460e9b91231c02733b01 100644 (file)
@@ -15,6 +15,8 @@
 /**
   Stupid Prioq. Should use Lists and STL.
   Smallest is put at the front.
+
+Actually, this sux. Should use a template struct PQuee_ent<V,I>
  */
 
 template<class V, class I>
@@ -22,23 +24,47 @@ struct PQueue
 {
     Array<V> value_arr_;
     Array<I> indices_arr_;
-
+    void OK() const 
+    {
+       
+       assert(value_arr_.size() == indices_arr_.size());
+    }
+    
     void enter(V v, I idx) {
        int j=0;
        for (; j < value_arr_.size(); j++)
            if (indices_arr_[j] > idx) 
                break;
 
-       value_arr_.insert(v, j);
-       indices_arr_.insert(idx, j);
+       insert(j,v,idx);
+       
     }
     int size() { return value_arr_.size(); }
     V front_val() { return value_arr_[0]; }
     I front_idx() { return indices_arr_[0]; }
+    void del(int i) 
+    {
+       value_arr_.del(i);
+       indices_arr_.del(i);
+    }
+    int size() const
+    {
+       OK();
+       return value_arr_.size();
+    }
+    
+
+    void insert(int j, V v, I idx)
+    {
+       value_arr_.insert(v, j);
+       indices_arr_.insert(idx, j);
+    }
+    
+
+
     V get() {
        V retval = front_val();
-       value_arr_.del(0);
-       indices_arr_.del(0);
+       del(0);
        return retval;
     }
     
index bcf461f8f3f6a32c734f49716d6bef0ecbfd0666..f6bcfa7faeea590baf744a7e3256be16f59d8879 100644 (file)
@@ -30,14 +30,16 @@ public:
     static int dec2_i( String dec_str );
     static double dec2_f( String dec_str );
     static String double_str(double f, char const* fmt=0);
-    static int hex2int_i( String str );
+    static int hex2_i( String str );
+    static unsigned hex2_u( String str );
     static String hex2bin_str( String str );
     static String int_str(int i, char const *fmt=0  );
     static String i2hex_str( int i, int length_i, char ch );
+    static String u2hex_str( unsigned u, int length_i, char ch );
     static String i2dec_str( int i, int length_i, char ch );
     static String rational_str(Rational);
     static String pointer_str(const void *);
-    static String longlong_str(long long , char const * fmt = 0);
+    static String i64_str(I64, char const * fmt = 0);
 };
 
 #endif // __STRING_CONVERT_HH //
index 47649dcc8878e672250bc33b47e8cde2e2101c1c..0e2566f087f3938cecd1b1de9ad626830f1ebe7b 100644 (file)
@@ -6,6 +6,7 @@
 
 
 #include <assert.h>
+#include <limits.h>
 #include "libc-extension.hh"
 #include "string.hh"
 #include "string-convert.hh"
@@ -62,11 +63,11 @@ String_convert::dec2_i( String dec_str )
 }
 
 String
-String_convert::longlong_str(long long ll, char const* fmt)
+String_convert::i64_str( I64 i64, char const* fmt)
 {
     char buffer[STRING_BUFFER_LEN];
     snprintf(buffer, STRING_BUFFER_LEN,
-            (fmt ? fmt : "%Ld"), ll );     // assume radix 10
+            (fmt ? fmt : "%Ld"), i64 );     // assume radix 10
     return String(buffer);
 
 }
@@ -143,20 +144,34 @@ String_convert::i2dec_str( int i, int length_i, char ch )
 
 // stupido.  Should use int_str()
 String 
-String_convert::i2hex_str( int i, int length_i, char ch )
+String_convert::u2hex_str( unsigned u, int length_i, char fill_ch )
 {
     String str;
-    if ( !i )
+    if ( !u )
        str = "0";
-    while ( i ) {
-       str = String( ( i % 16 )["0123456789abcdef"] ) + str;
-       i /= 16;
+
+#if 1 // both go...
+    while ( u ) {
+       str = String( (char)( ( u % 16 )["0123456789abcdef"] ) ) + str;
+       u /= 16;
     }
-    if ( str.length_i() < length_i )
-       str = String( ch, length_i - str.length_i() ) + str;
+#else
+    str += int_str( u, "%x" );
+#endif
+
+    str = String( fill_ch, length_i - str.length_i() ) + str;
+    while ( ( str.length_i() > length_i ) &&  ( str[ 0 ] == 'f' ) )
+       str = str.mid_str( 2, INT_MAX );
+
     return str;
 }
 
+String 
+String_convert::i2hex_str( int i, int length_i, char fill_ch )
+{
+    return u2hex_str( (unsigned)i, length_i, fill_ch );
+}
+
 Byte
 String_convert::nibble2hex_byte( Byte byte )
 {
@@ -230,6 +245,6 @@ String_convert::rational_str(Rational r)
 String
 String_convert::pointer_str(const void *l)
 {
-    long long int ill = (long long int )l;
-    return String_convert::longlong_str(ill,  "0x%0Lx");
+    I64 i64 = (I64)l;
+    return String_convert::i64_str(i64,  "0x%0Lx");
 }
index b663088d76d4c50e0b7baf9f6275a864959ec955..f9a255683e717959f378da4001bc49a479cd823d 100644 (file)
@@ -5,7 +5,7 @@
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
-
+#include <stdarg.h>
 #include <string.h>
 #include <ctype.h>
 #include "libc-extension.hh"
@@ -13,7 +13,7 @@
 /*
   compensate for lacking libc functions.
  */
- char* 
+char* 
 strnlwr( char* start_l ,int n)
 {
     char * p = start_l + n;
@@ -23,7 +23,7 @@ strnlwr( char* start_l ,int n)
     return start_l;
 }
 
- char* 
+char* 
 strnupr( char* start_l, int n)
 {
     char * p = start_l + n;
@@ -33,13 +33,15 @@ strnupr( char* start_l, int n)
     return start_l;
 }
 
+#ifndef HAVE_MEMMEM
+
 /** locate a substring. #memmem# finds the first occurrence of
   #needle# in #haystack#
   */
 
-  char *
-memmem(const Byte * haystack, const Byte *needle,
-       int haystack_len, int needle_len)
+char *
+memmem(const Byte * haystack, int haystack_len,
+       const Byte *needle,int needle_len)
 {
     const Byte * end_haystack = haystack + haystack_len - needle_len;
     const Byte * end_needle = needle + needle_len ;
@@ -61,6 +63,7 @@ memmem(const Byte * haystack, const Byte *needle,
     }
     return 0;
 }
+#endif
 
 Byte *
 memrchr(const Byte * p, int n, char c)
@@ -96,3 +99,15 @@ strrev( Byte* byte_l, int length_i )
   }
   return byte_l;
 }
+
+#ifndef HAVE_SNPRINTF
+int snprintf ( char *str, size_t n,
+              const char *format, ... )
+{
+    va_list ap;
+    va_start(ap, format);
+    int i = vsprintf(str, format, ap);
+    va_end(ap);
+    return i;
+}
+#endif
index e06feb5af447bd7190eea59bfcd85e11b9e80844..e71037c41ee817c95f2f108bb143284a2947f58a 100644 (file)
 
 char* strnlwr( char* start_l ,int n);
 char* strnupr( char* start_l, int n);
-/*
-  should use void* like in libc
- */
-char *memmem(const Byte * haystack, const Byte *needle,
-              int haystack_len, int needle_len);
+
+#ifndef HAVE_MEMMEM            // GNU extension.
+char *memmem(const Byte * haystack, int haystack_len,
+            const Byte *needle, int needle_len);
+#endif HAVE_MEMMEM
+
+#ifndef HAVE_SNPRINTF          // GNU extension.
+int snprintf (char *str, size_t n,
+             const char *format, ... );
+#endif
+
+
 Byte *memrchr(const Byte * p, int n, char c);
-Byte*strrev( Byte* byte_l, int length_i );
+Byte *strrev( Byte* byte_l, int length_i );
 
 
 #endif // LIBC_EXTENSION_HH
index b4687c0b7f8bf3cb113fdd8326e65814b24a3883..60038f6a557b04683e7f24846b44e02cafdff91d 100644 (file)
@@ -152,9 +152,8 @@ String::compare_i(String const& s1, String const& s2 )
 
     int i1 = s1.length_i();
     int i2 = s2.length_i();
-    int i = i1 <? i2;
 
-    int result=  memcmp( p1, p2, i );
+    int result=  memcmp( p1, p2, i1 <? i2 );
     return result ? result : i1-i2;
 }
 
@@ -220,8 +219,8 @@ int
 String::index_i( String searchfor ) const
 {
     char const* me = strh_.ch_c_l();
-    char const* p = (char const *) memmem(me, length_i(), searchfor.ch_c_l(), 
-                                         searchfor.length_i());
+    char const* p = (char const *) memmem(
+       me, length_i(), searchfor.ch_c_l(), searchfor.length_i());
     
     if ( p )
        return p - me;
@@ -300,6 +299,11 @@ String::nomid_str( int index_i, int n ) const
 String
 String::mid_str( int index_i, int n ) const
 {
+    if (index_i <0) {
+       n += index_i;
+       index_i=0;
+    }
+    
     if ( !length_i() || ( index_i < 0 ) || ( index_i >= length_i() ) || ( n < 1 ) )
        return String();
 
diff --git a/flower/test/Makefile b/flower/test/Makefile
new file mode 100644 (file)
index 0000000..0ec8716
--- /dev/null
@@ -0,0 +1,106 @@
+#
+# project  LilyPond -- the musical typesetter
+# title           makefile for flowertest
+# file    test/Makefile 
+#
+# Copyright (c) 1997 by
+#      Jan Nieuwenhuizen <jan@digicash.com>
+#      Han-Wen Nienhuys <hanwen@stack.nl>
+#
+
+# subdir level:
+#
+depth = ../..
+#
+
+# identify module:
+#
+NAME =stringtest
+# include ./$(depth)/$(NAME)/.version
+MODULE_NAME = flower
+include ./$(depth)/flower/.version
+build = ./$(depth)/flower/lib/.build
+#
+
+# generic variables:
+#
+include ./$(depth)/make/Variables.make 
+#
+
+# descent order into subdirectories:
+#
+SUBDIRS =
+#
+
+# to be remade each build:
+#
+VERSION_DEPENDENCY = #
+#
+
+# module compile settings: (not generally needed!
+#
+EXTRA_CFLAGS = -DSTRING_TEST
+EXTRA_CXXFLAGS =
+EXTRA_LDFLAGS =
+#
+
+# list of c++ header files:
+# 
+# HHFILES = $(shell ls *.hh $(ERROR_LOG))
+#
+
+# list of c++ source files:
+#
+CCFILES = $(shell ls *.cc $(ERROR_LOG))
+#
+
+# list of other source files:
+#
+EXTRA_SOURCE_FILES = $(shell ls *.y *.l $(ERROR_LOG))
+#
+
+# list of distribution files:
+#
+DISTFILES = Makefile $(HHFILES) $(CCFILES) $(EXTRA_SOURCE_FILES)
+#
+
+# list of custom libraries:
+#
+CUSTOMLIBES = $(LIBFLOWER)\
+
+LOADLIBES +=
+#
+
+
+# main target of this module:
+#
+# MAINTARGET = $(EXECUTABLE)
+# MAINTARGET = $(LIBRARY)
+MAINTARGET = $(bindir)/$(EXECUTABLE)# huh?
+# MAINTARGET = $(libdir)/$(LIBRARY)# huh?
+
+#default: $(MAINTARGET)
+BUILDSTRINGTEST=$(MAINTARGET)
+EXECSTRINGTEST=$(EXECUTABLE)
+default:  $(BUILDSTRINGTEST) do-stringtest
+do-stringtest:
+       $(EXECSTRINGTEST)    # should return error value if test fails
+
+dummy:
+
+# generic targets and rules:
+#
+include ./$(depth)/make/Targets.make
+include ./$(depth)/make/Rules.make
+#
+
+# list of depend files:
+#
+DEPFILES = $(shell ls $(depdir)/*.dep $(ERROR_LOG))
+#
+
+# auto dependencies:
+#
+-include $(DEPFILES)
+#
+
diff --git a/flower/test/stringtest.cc b/flower/test/stringtest.cc
new file mode 100644 (file)
index 0000000..5b4ace1
--- /dev/null
@@ -0,0 +1,130 @@
+#ifdef STRING_TEST
+/*
+  stupid test program to verify stringlib
+  stringtest.cc
+  */
+#include <iostream.h>
+#include "string.hh"
+#include "varray.hh"
+#include "string-convert.hh"
+
+void
+ctors()
+{
+    cout << "constructors"<<endl;
+
+    String str( "hai" );
+    String def;
+    String fromi(10);
+    String fromc('c');
+    String fromf(1.32e-2, "%g");
+
+    cout << str << endl;
+    cout << def << endl;
+    cout << fromi<< endl;
+    cout << fromc<< endl;       
+    cout << fromf<< endl;
+}
+
+void
+cmp()
+{
+    Array<String> a;
+    a.push("abcd");
+    a.push("zxy");
+    a.push("abc");
+    a.push("");
+    a.sort(String::compare_i);
+    cout << "compares: "<<endl;
+    for (int i=0; i < a.size(); i++)
+       cout << a[i] << endl;
+}
+
+
+void
+searching()
+{
+    String hay = "foobarbazblub";
+
+    char c =   'b';
+    String cstr =c;
+    String set = "bar";
+    cout << "hay = \"" << hay << "\" len="<< hay.length_i()<<endl;
+    cout << "index_i('"<< c<<"') " << c << "= " << hay.index_i(c) <<endl;
+    cout << "last_index_i('"<< c<<"') " << c << "= " << hay.index_last_i(c) <<endl;    
+//    cout << "last index of cstr " << c << ": " << hay.index_last_i(cstr) <<endl;    
+//    cout << "index_last_i(\""<<set<<"\"): " << hay.index_last_i(set) <<endl;
+    cout << "index_i(\""<<set<<"\"): " << hay.index_i(set) <<endl;    
+    cout << "index_any(\"" << set << "\"): " << cstr << ": " << hay.index_any_i(cstr) <<endl;
+
+    
+    
+}
+
+
+void
+kutenpeer()
+{
+    String str( "hai" );
+    for (int i=-1; i < str.length_i()+2; i++) {
+       cout<<" left_str(" << i<<"): " << str.left_str( i ) << endl;
+       cout<<" right_str( "<<i<<"): " << str.right_str( i ) << endl;
+    }
+    str = "blonde haren";
+    cout << str<<endl;
+    cout << "mid(2,6)="<<str.mid_str(2,3)<<endl;
+    cout << "nomid(2,6)="<<str.nomid_str(2,3)<<endl;
+}
+
+bool
+test_empty_bo( String str )
+{
+    cout << "`" << str << "' is ";
+
+    if ( str == String( "" ) ) {
+        cout << "empty" << endl;
+       return true;
+    }
+
+    cout << "not empty" << endl;
+    return false;
+}
+
+int 
+main()
+{
+    ctors();
+    cmp();
+    searching();
+    kutenpeer();
+    String str( "hai" );
+    cout <<  str << endl;
+    cout << "left" << endl;
+    str += " daar";
+    cout << str << endl;
+
+    str = String( "Hallo" ) + " daaR" + '!';
+    cout << str << endl;
+
+    cout << "up: " << str.upper_str() << " down: " << str.lower_str()<<endl;
+    
+    if ( test_empty_bo( str ) )
+       return 1;
+    
+    String fn = "";
+    if ( !test_empty_bo( fn ) )
+       return 1;
+    
+    fn = "";
+    fn += "";
+    delete fn.copy_byte_p();
+    delete str.copy_byte_p();
+
+    cout << String_convert::bin2hex_str( String( (char)0xff ) ) << endl;
+    cout << "-1:" << String_convert::i2hex_str( -1, 2, '0' );
+    cout << endl;
+    return 0;
+}
+
+#endif STRING_TEST
+
diff --git a/init/dynamic.ini b/init/dynamic.ini
new file mode 100644 (file)
index 0000000..000439d
--- /dev/null
@@ -0,0 +1,10 @@
+
+ppp = dynamic {7 }
+pp = dynamic { 6 }
+p = dynamic { 5 }
+mp = dynamic { 4 }
+mf = dynamic { 3 }
+f = dynamic { 2 }
+ff = dynamic { 1 }
+fff = dynamic { 0 }
+
index 7de1e0f52114984bfd420a9994d570350e3c87dd..cc0f13d39984ddd6b8abeec044fe20369743cc57 100644 (file)
@@ -1,5 +1,5 @@
 
-
+include "dynamic.ini"
 include "dutch.ini" # do not include init/ path
 include "script.ini"
 include "table_sixteen.ini"
index 1b7b379f67270b5c8585c6e78649928aae9aa7cf..240eae0b8b5de3de0f5ed95d62d7717b004ad3de 100644 (file)
@@ -1,11 +1,11 @@
 %
-% spacing info for LilyPond. Do not edit this.
+% spacing info for LilyPond. Do not edit this if you're not a guru.
 % It has a lot of hard-wired stringconstants
 %
 
 table_sixteen=
 symboltables {
-       
+
    texid       "\musixsixteendefs"
 
    % index TeXstring,  xmin xmax ymin ymax
@@ -13,13 +13,13 @@ symboltables {
     "scripts" = table {
            "fermata" "\fermata"                0pt  0pt        0pt 6pt
            "-fermata" "\ifermata"              0pt  0pt        -6pt 0pt
-           "portato" "\portato"                0pt 0pt         0pt 0pt
-           "-portato" "\iportato"              0pt 0pt         0pt 0pt
-           "tenuto" "\tenuto"                  0pt 0pt         0pt 0pt
-           "-tenuto" "\itenuto"                0pt 0pt         0pt 0pt
+           "portato" "\portato"
+           "-portato" "\iportato"
+           "tenuto" "\tenuto"  
+           "-tenuto" "\itenuto"
            "sforzato" "\sforzato"              -0.8pt 4.8pt    -1.92pt 1.92pt
            "marcato" "\marcato"                0pt  4.8pt      0pt 4pt
-           "-marcato" "\imarcato"              0pt  4.8pt      -4pt 0pt 
+           "-marcato" "\imarcato"              0pt  4.8pt      -4pt 0pt
            "staccato" "\staccato"              0pt  0pt         0pt 5pt
            "staccatissimo" "\staccatissimo"    0pt 0pt         0pt 7.5pt
            "-staccatissimo" "\istaccatissimo"  0pt 0pt         -7.5pt 0pt
@@ -30,11 +30,24 @@ symboltables {
      "style" = table {
                "roman" "\settext{%}" 0pt 0pt 0pt 8pt
                "italic"        "\setitalic{%}" 0pt 0pt 0pt 8pt
+               "dynamic"       "\setdynamic{%}" 0pt 0pt 0pt 8pt
      }
+     "dynamics" = table {
+
+       "mf" "\dynmf"
+       "fff" "\dynfff"
+       "ff" "\dynff"
+       "f" "\dynf"
+       "mp" "\dynmp"
+       "p" "\dynp"
+       "pp" "\dynpp"
+       "ppp" "\dynppp"
+
+       }
      "align" = table {
-               "-1"    "\leftalign{%}" 0pt 0pt 0pt 0pt
-               "0"     "\centeralign{%}" 0pt 0pt 0pt 0pt
-               "1"     "\rightalign{%}" 0pt 0pt 0pt 0pt
+               "-1"    "\leftalign{%}"
+               "0"     "\centeralign{%}"
+               "1"     "\rightalign{%}"
        }
 
      "clefs" = table {
@@ -55,8 +68,8 @@ symboltables {
      }
 
      "slur" = table {
-            "whole"    "\slurchar%{%}" 0pt     0pt     0pt     0pt
-            "half"     "\hslurchar%{%}"        0pt     0pt     0pt     0pt
+            "whole"    "\slurchar%{%}"
+            "half"     "\hslurchar%{%}"
      }
      "accidentals" = table {
             "-2"       "\flatflat"     0pt     10.2pt  -2.5pt 7.5pt
@@ -72,7 +85,7 @@ symboltables {
      }
 
      "bars" = table {
-       "empty" "\emptybar"             0pt     0pt     0pt     0pt
+       "empty" "\emptybar"
        "|"     "\maatstreep"           0pt     0.4pt   -8pt    8pt
        "||"    "\finishbar"            0pt     2pt     -8pt    8pt
        ":|"    "\repeatbar"            -4pt    0pt     -8pt    8pt
@@ -99,7 +112,7 @@ symboltables {
      "param" = table {
             "meter"    "\generalmeter{%}{%}"   0pt     10pt    -5pt    5pt
             "linestaf" "\linestafsym{%}{%}"
-            "stem"     "\stem{%}{%}"           
+            "stem"     "\stem{%}{%}"
             "fill"     "\hbox{}"
             "crescendo" "\crescendosym{%}"     0pt     0pt     -3pt    3pt
             "decrescendo" "\decrescendosym{%}" 0pt     0pt     -3pt    3pt
@@ -112,7 +125,7 @@ symboltables {
      }
 
      "flags" = table {
-            "8"        "\eigthflag"            0pt     4pt     0pt     0pt     
+            "8"        "\eigthflag"            0pt     4pt     0pt     0pt
             "16"       "\sixteenthflag"                0pt     4pt     0pt     0pt
             "32"       "\thirtysecondflag"     0pt     4pt     0pt     0pt
             "-8"       "\deigthflag"           0pt     4pt     0pt     0pt
@@ -121,8 +134,8 @@ symboltables {
      }
 
      "beamslopes" = table {
-            "slope"    "\beamslope{%}{%}" 
-            "horizontal"       "\rulesym{%}{%}"        
+            "slope"    "\beamslope{%}{%}"
+            "horizontal"       "\rulesym{%}{%}"
      }
 
 }
index 76095fc06e4e3fe6128313726c4a2fbb293ccfb6..ecfda88354394f7891170add78543ef747ce1207 100644 (file)
@@ -8,7 +8,7 @@ cad = music { $
        \duration { 8}
        \textstyle "italic"
        \clef \violin 
-       'c4._"f" g8
+       'c4.\mf g8
        \textstyle  "roman" 
 
        ['e^"accel" ()'d 'c b]
@@ -55,4 +55,4 @@ score {
        }
        paper {}
        midi { tempo 4:80 }
-}
\ No newline at end of file
+}
index 872615b1b3eb687ed40296992ae665fe0028e332..67288264718568d53d1f828895e4a45f9a1b7e3f 100644 (file)
@@ -117,7 +117,7 @@ ii_menuetto = music {
 %%%24
 %%     { d2.^{fine}  `a2. `d2.\stemup_{ }_{ }_{3 mins.}}       s4 :||
 %%     { \textstyle "italic" d2.^"fine" `a2. \textstyle "roman" `d2._"3 mins."} | % :||
-       { d2.^"fine" `a2. `d2._"3 mins."} \bar ":||"
+       { d2.^"fine" `a2. `d2._"3 mins."} \bar ":|" % \bar ":||"
 %% \tighten            % use one line less
        $
 }
index 650cf456a3b2b1c39e43c534faf2b35b638acb0d..672d747bf5aa552ed32bf9ba006769b5ecce2f85 100644 (file)
@@ -38,7 +38,7 @@
 melodie = music { $ \clef\violin
        \key{bes}
        \duration{ 8 }
-       r_"\pp" { [ d `a-| } f-| { d `a-| } f-| { d `a-| ] } |
+       r\pp { [ d `a-| } f-| { d `a-| } f-| { d `a-| ] } |
 %%2
        r { [ d `bes-| } f-| { d `bes-| } f-| { d `bes-| ] } |
 %%3
@@ -51,11 +51,11 @@ melodie = music { $ \clef\violin
 %%5
        [ a()bes a ]2/3  'd4. a |
 %%6
-       [ g()a g ]2/3  'd4 a r |
+       [ g()a g ]2/3  'd4 g r |
 %#%\tighten
 %#%\newline
 %%7
-       a4.^> g  [ g( f )e ]2/3  |
+       a4.^> g  [ g()f e ]2/3  |
 %%8
        f2 r4 |
 %%9
@@ -64,15 +64,15 @@ melodie = music { $ \clef\violin
 %%10
        { 'f2. 'd2. } |
 %%11
-       [ a_"\pp"( )bes a ]2/3  'f4. a |
+       [ a\pp( )bes a ]2/3  'f4. a |
 %%12
        [ g( ) a g ]2/3  'e4. 'd |
 %%13
        'c4. bes  [ bes( ) a g ]2/3  |
 %%14
        a2 r 
-%      { \music{ 'd( | )'c4. g  [ bes a g ]2/3  } \music{ f_"\p"( | )e4._"dolce" bes  [ g ]2/3  } } |
-       { \music{ 'd( | )'c4. g  [ bes a g ]2/3  } \music{ f_"\p"( | )e4._"dolce" bes  \plet{ 2/3 } g \plet{ 1/1 }  } } |
+%      { \music{ 'd( | )'c4. g  [ bes a g ]2/3  } \music{ f\p( | )e4._"dolce" bes  [ g ]2/3  } } |
+       { \music{ 'd( | )'c4. g  [ bes a g ]2/3  } \music{ f\p( | )e4._"dolce" bes  \plet{ 2/3 } g \plet{ 1/1 }  } } |
 %%16
        { a2. f2. } |
 %%17
@@ -83,7 +83,7 @@ melodie = music { $ \clef\violin
        [ 'd8. a16 ] f4. d |
 %%19
 %#%    'c\grace\stemup
-       [ bes_"\pp"( ) a bes ]2/3  'd4. bes |
+       [ bes\pp( ) a bes ]2/3  'd4. bes |
 %%20
        a2. |
 %%21
@@ -93,28 +93,28 @@ melodie = music { $ \clef\violin
 %#%    =f2. |
        f2. |
 %%23
-       [ a8._"\mf" 'cis16 ] 'f4. 'e |
+       [ a8._\mf 'cis16 ] 'f4. 'e |
 %%24
        [ 'd8. a16 ] fis4. d |
 %%25
 %#%    'cis\grace\stemup
-       [ b_"\mf"( ) ais b ]2/3 'd4. b |
+       [ b_\mf( ) ais b ]2/3 'd4. b |
 %%26
        { a2. fis2. } |
 %#%\tighten\newline
 %%27
-       [ 'e_"\f"( )'dis 'e ]2/3 'g4. 'cis |
+       [ 'e_\f( )'dis 'e ]2/3 'g4. 'cis |
 %%28
        { 'd2. fis2. } |
 %#%\volta1
 %%29
-       { \music { bes2( [ 'd8.( ))g16 ] } \music{ g2_"\mf" [ bes8. bes16 ] } } |
+       { \music { bes2( [ 'd8.( ))g16 ] } \music{ g2_\mf [ bes8. bes16 ] } } |
 %%30
-       { \music{ a4. [ a-. a-. a-. ] } \music{ fis4. [ f-.( f-. )f-. ] } } |
+       { \music{ a4. [ a-. a-. a-. ] } \music{ fis4. [ fis-.( fis-. )fis-. ] } } |
 %%31  
        { \music{ a4. [ a-. a-. a-. ] } \music{ g4. [ cis-.( e-. )g-. ] } } |
 %%32
-       { a2 fis2_"\pp" } { a4 fis4 } |
+       { a2 fis2_\pp } { a4 fis4 } |
 %%33
 %#%    { b2(^ g2 } [v { 'd8.( b8. } { b16 ) ) g16 } ] |
        { \music{ b2( [ 'd8.( ) )g16 ] } \music{ g2 [ b8. b16 ] } } |
@@ -141,23 +141,23 @@ melodie = music { $ \clef\violin
        'cis2 r4 |
 %%41
 %#%    { > 'fis4. 'cis4._f } 'e [ 'e( ) 'd >! 'cis ]  |
-       { 'fis4. 'cis4._"\f" } 'e  [ 'e( )'d 'cis ]2/3  |
+       { 'fis4. 'cis4.\f } 'e  [ 'e( )'d 'cis ]2/3  |
 %%42
        [ b8. 'cis16 ] 'd4^> b r |
 %%43
 %#%    [^ { b8._{ }_{ }_{ }_{ }_{ }_f g2. } 'cis16 ] 'd4^> b r |
-       [ b8._"\f" 'cis16 ] 'd4^> b r |
+       [ b8.\f 'cis16 ] 'd4^> b r |
 %%44
 %#%    [^ { > b8. fis2 } 'cis16 ] 'd4^> b >! r |
        [ b8. 'cis16 ] 'd4^> b r |
 %%45
 %#%    'cis\grace\stemup
-       [ b_"\p"( )ais b ]2/3  'd4. b |
+       [ b\p( )ais b ]2/3  'd4. b |
 %%46
 %#%    { =a2. fis2. } |
        { a2. fis2. } |
 %%47
-       [ 'e_"\f"( )'dis 'e ]2/3  'g4.^> 'cis |
+       [ 'e\f( )'dis 'e ]2/3  'g4.^> 'cis |
 %%48
 %#%    { fis2.(v ='d2.\stemup(^ }
 %      { fis2. 'd2. } |
@@ -171,7 +171,7 @@ melodie = music { $ \clef\violin
 %%51
        { a2. cis2. } |
 %%52
-       { fis2 d2 } { a4 f4_"\pp" } |
+       { fis2 d2 } { a4 fis4_\pp } |
 %%53
 %#%    { bes2 g2 } [ { 'd8.^>( bes8. } { ) bes16 g16 } ] |
        { bes2 g2 } { [ 'd8.^> bes8. } { bes16 g16 ] } |
@@ -220,7 +220,7 @@ begeleiding = music { $
 %%8
        { \multivoice \music{ \stem{ 1 } [ `d `a d `a d `a ] } \music { \stem{ -1 } `d2 r4 } } |
 %%9
-       [ `a e f e f e ] |
+       [ `a e g e g e ] |
 %%10
        [ `d `a d `a d `a ] |
 %%11
@@ -228,7 +228,7 @@ begeleiding = music { $
 %%12 == 6
        { \multivoice \music{ \stem{ 1 } [ `d `e `g `e `g `e ] } \music { \stem{ -1 } ``bes2 r4 } } |
 %13
-       { \multivoice \music{ [ `e `e `g `e `g `e ] } \music { \stem{ -1 } ``bes2 r4 } } |
+       { \multivoice \music{ [ `e `g `bes `g `bes `g ] } \music { \stem{ -1 } `c2 r4 } } |
 %%14
        { \multivoice \music{ \stem{ 1 } [ `a c f c f c ] } \music { \stem{ -1 } `f2 r4 } } |
 %%15
@@ -268,7 +268,7 @@ begeleiding = music { $
 %%30 
        [ `d `fis `a `fis `a `fis ] |
 %%31
-       [ `a `e `a `e `a `e ] |
+       [ ``a `e `a `e `a `e ] |
 %%32
        [ `d `fis `a `fis `a `fis ] |
 %%33
@@ -276,21 +276,21 @@ begeleiding = music { $
 %%34
        [ `d `fis `a `fis `a `fis ] |
 %%35
-       [ `a `e `a `e `a `e ] |
+       [ ``a `e `a `e `a `e ] |
 %%36
        [ `d `fis `a `fis `a `fis ] |
 %#%\volta2
 %#%:|
 %%37
-       [ `a `e `g `e ``bes^> `e ] |
+       [ ``a `e `g `e ``bes^> `e ] |
 %%38
-       [ `a { e cis `a } { e cis `a } { e cis `a } { e cis `a } { e cis `a ] }  |
+       [ ``a { e cis `a } { e cis `a } { e cis `a } { e cis `a } { e cis `a ] }  |
 %%39
-       [ `a `e `g `e ``bes^> `e ] |
+       [ ``a `e `g `e ``bes^> `e ] |
 %%40
-       [ `a { e cis `a } { e cis `a } { e cis `a } { e cis `a } { e cis `a ] }  |
+       [ ``a { e cis `a } { e cis `a } { e cis `a } { e cis `a } { e cis `a ] }  |
 %%41
-       [ `ais `e `gis `e `gis `e ] |
+       [ ``ais `e `fis `e `fis `e ] |
 %%42
        { [ `d ``b } `fis `b `fis `b `fis ] |
 %%43
@@ -311,7 +311,7 @@ begeleiding = music { $
 %%50
        [ ``g `e `g `e `g `e ] |
 %%51
-       [ `a `e `g `e `g `e ] |
+       [ ``a `e `g `e `g `e ] |
 %%52
        [ ``d `d `fis `d `fis `d ] |
 %%53
@@ -319,7 +319,7 @@ begeleiding = music { $
 %%54
        [ `d `fis `a `fis `a `fis ] |
 %%55
-       [ `a `e `g `e `g `e ] |
+       [ ``a `e `g `e `g `e ] |
 %%56
        [ ``d ``a `d ``a `d ``a ] |
 %%57
@@ -487,6 +487,6 @@ score {
                output "standchen.out"
        }
        midi {
-               tempo 4:60
+               tempo 4:54
        }
 }
index 7da9879256ac029c38e12701bc7c39ef9a441e01..7609ecaa8b567f0a9fa439fe2d709b60d003f30d 100644 (file)
 depth = ..
 #
 
+# generic variables:
+#
+include ./$(depth)/make/Variables.make 
+#
+
 # identify module:
 #
 NAME = lily
@@ -21,12 +26,7 @@ MINOR_VERSION = $(TOPLEVEL_MINOR_VERSION)
 PATCH_LEVEL = $(TOPLEVEL_PATCH_LEVEL)
 # use to send patches, always empty for released version:
 MY_PATCH_LEVEL = $(TOPLEVEL_MY_PATCH_LEVEL)
-build = ./$(depth)/lily/.build
-#
-
-# generic variables:
-#
-include ./$(depth)/make/Variables.make 
+build = $(lily-dir)/.build
 #
 
 # descent order into subdirectories:
@@ -36,22 +36,22 @@ SUBDIRS = include
 
 # to be remade each build:
 #
-VERSION_DEPENDENCY = $(lily-version)
+VERSION_DEPENDENCY =#
 #
 
 # list of c++ header files:
 # 
-HHFILES = # $(shell ls include/*.hh)
+HHFILES = $(shell ls *.hh $(ERROR_LOG))
 #
 
 # list of c++ source files:
 #
-CCFILES = $(shell ls *.cc)
+CCFILES = $(shell ls *.cc $(ERROR_LOG))
 #
 
 # list of other source files:
 #
-EXTRA_SOURCE_FILES = # $(shell ls *.y *.l)
+EXTRA_SOURCE_FILES = # $(shell ls *.y *.l $(ERROR_LOG))
 #
 
 # list of distribution files:
@@ -84,8 +84,13 @@ include ./$(depth)/make/Targets.make
 include ./$(depth)/make/Rules.make
 #
 
+# list of depend files:
+#
+DEPFILES = $(shell ls $(depdir)/*.dep $(ERROR_LOG))
+#
+
 # auto dependencies:
 #
--include ./$(outdir)/*.dep
+-include $(DEPFILES)
 #
 
diff --git a/lib/include/config.hh b/lib/include/config.hh
deleted file mode 100644 (file)
index ca44f29..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#define LIBDIR "./"
index e9d3e60d38b7ce3880a02ff374d0b1a373dcf05f..4b3a8f91c5831d2d87558780ace5b44316e2c134 100644 (file)
 #include "fproto.hh"
 #include "real.hh"
 
-/// (i64)
-typedef long long Int64;
-
-struct Absdynamic_req;
+struct Absolute_dynamic_req;
 struct Accidental;
 struct Atom;
 struct Bar;
@@ -22,6 +19,7 @@ struct Barcheck_req;
 struct Bar_req;
 struct Beam;
 struct Beam_req;
+struct Blank_req;
 struct Box;
 struct Bracket_req;
 struct Cadenza_req;
@@ -41,6 +39,7 @@ struct Duration;
 struct Duration_iterator;
 struct Durational_req;
 struct Dynamic;
+struct Dynamic_req;
 struct Group_change_req;
 struct Group_feature_req;
 struct Idealspacing;
@@ -88,11 +87,11 @@ struct Midi_track;
 struct Midi_voice;
 struct Midi_walker;
 struct Mixed_qp;
-class My_midi_lexer;
-class My_midi_parser;
-class Midi_event;
-class Midi_score;
-class Midi_track;
+struct My_midi_lexer;
+struct My_midi_parser;
+struct Midi_event;
+struct Midi_score;
+struct Midi_track;
 struct Molecule;
 struct Musical_req;
 struct Music_general_chord;
@@ -137,7 +136,7 @@ struct Source_file;
 struct Spacing_req ;
 struct Span_req;
 struct Spanner;
-struct Blank_req;
+struct Subtle_req;
 struct Staff;
 struct Staff_column;
 struct Staff_elem;
index f31a93426a0c09f742a4fa3f6b6a72ada0c78479..2302cf627c92c612448253ac98d9818b7f63bef0 100644 (file)
 depth = ..
 #
 
+# generic variables:
+#
+include ./$(depth)/make/Variables.make 
+#
+
 # identify module:
 #
 NAME = lilypond
@@ -21,12 +26,7 @@ MINOR_VERSION = $(TOPLEVEL_MINOR_VERSION)
 PATCH_LEVEL = $(TOPLEVEL_PATCH_LEVEL)
 # use to send patches, always empty for released version:
 MY_PATCH_LEVEL = $(TOPLEVEL_MY_PATCH_LEVEL)
-build = ./$(depth)/lily/.build
-#
-
-# generic variables:
-#
-include ./$(depth)/make/Variables.make 
+build = $(lily-dir)/.build
 #
 
 # descent order into subdirectories:
@@ -41,17 +41,17 @@ VERSION_DEPENDENCY = $(lily-version)
 
 # list of c++ header files:
 # 
-HHFILES = # $(shell ls include/*.hh)
+HHFILES = $(shell ls *.hh $(ERROR_LOG))
 #
 
 # list of c++ source files:
 #
-CCFILES = $(shell ls *.cc)
+CCFILES = $(shell ls *.cc $(ERROR_LOG))
 #
 
 # list of other source files:
 #
-EXTRA_SOURCE_FILES = $(shell ls *.y *.l)
+EXTRA_SOURCE_FILES = $(shell ls *.y *.l $(ERROR_LOG))
 #
 
 # list of distribution files:
@@ -92,8 +92,13 @@ mylexer.cc: $(outdir)/parser.hh # sic
 lexer.l: $(outdir)/parser.hh
 #
 
+# list of depend files:
+#
+DEPFILES = $(shell ls $(depdir)/*.dep $(ERROR_LOG))
+#
+
 # auto dependencies:
 #
--include ./$(outdir)/*.dep
+-include $(DEPFILES)
 #
 
index 32a7cd5fe6aaf32605c1ea2224625e5058a84541..8b831d206abb23b98558f03060a860e95fa06c29 100644 (file)
@@ -21,7 +21,7 @@ Bar::do_print()const
 Molecule*
 Bar::brew_molecule_p()const
 {    
-    Symbol s = paper()->lookup_p_->bar(type);
+    Symbol s = paper()->lookup_l()->bar(type);
     Molecule*output = new Molecule(Atom(s));
     return output;
 }
index 64f3e3cf775aa721316b216328443bcc8b468584..b9fbd0a28c80525f3f20e72172798df5f5d0f8ae 100644 (file)
@@ -111,7 +111,7 @@ Beam::solve_slope()
 
                                // URG
     Real sl = slope*paper()->internote();
-    paper()->lookup_p_->beam(sl, 20 PT);
+    paper()->lookup_l()->beam(sl, 20 PT);
     slope = sl /paper()->internote();
 }
 
@@ -207,7 +207,7 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
     Real dy=paper()->internote()*2;
     Real stemdx = paper()->rule_thickness();
     Real sl = slope*paper()->internote();
-    paper()->lookup_p_->beam(sl, 20 PT);
+    paper()->lookup_l()->beam(sl, 20 PT);
 
     Molecule leftbeams;
     Molecule rightbeams;
@@ -220,7 +220,7 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
        Symbol dummy;
        Atom a(dummy);
        if (lhalfs)             // generates warnings if not
-           a =  paper()->lookup_p_->beam(sl, w);
+           a =  paper()->lookup_l()->beam(sl, w);
        a.translate(Offset (-w, -w * sl));
        for (int j = 0; j  < lhalfs; j++) {
            Atom b(a);
@@ -234,7 +234,7 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
        int rwholebeams = here->beams_right <? next->beams_left; 
 
        Real w = next->hindex() - here->hindex();
-       Atom a = paper()->lookup_p_->beam(sl, w + stemdx);
+       Atom a = paper()->lookup_l()->beam(sl, w + stemdx);
        
        int j = 0;
        for (; j  < rwholebeams; j++) {
@@ -245,7 +245,7 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
 
        w /= 4;
        if (rhalfs)
-           a = paper()->lookup_p_->beam(sl, w);
+           a = paper()->lookup_l()->beam(sl, w);
        
        for (; j  < rwholebeams + rhalfs; j++) {
            Atom b(a);
index 528623eed6820867c59101dfcede25efb8900145..72328b0954e9617b8280bb59899011ede0aed5b1 100644 (file)
@@ -46,7 +46,7 @@ Clef_item::brew_molecule_p()const
     String t = type;
     if  (change)
        t += "_change";
-    Symbol s = paper()->lookup_p_->clef(t);
+    Symbol s = paper()->lookup_l()->clef(t);
     Molecule*output = new Molecule(Atom(s));
     output->translate(Offset(0, paper()->internote() * y_off));
     return output;
diff --git a/lily/dynamic-reg.cc b/lily/dynamic-reg.cc
new file mode 100644 (file)
index 0000000..88f0b50
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+  dynamic-reg.cc -- implement Dynamic_register
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "dynamic-reg.hh"
+#include "musicalrequest.hh"
+#include "text-item.hh"
+#include "lookup.hh"
+#include "paper-def.hh"
+
+Dynamic_register::Dynamic_register()
+{
+    dir_i_ =0;
+    post_move_processing();
+    dynamic_p_ =0;
+}
+
+void
+Dynamic_register::post_move_processing()
+{
+    dynamic_req_l_ = 0;
+}
+
+bool    
+Dynamic_register::try_request(Request * r)
+{
+    Musical_req * m = r->musical();
+    if (!m || !m->dynamic())
+       return false;
+    assert(!dynamic_req_l_);
+    dynamic_req_l_ = m->dynamic();
+    return true;
+}
+void
+Dynamic_register::process_requests()
+{
+    if(dynamic_req_l_){
+       if (dynamic_req_l_->absdynamic()) {
+           Text_def * td_p = new Text_def;
+           td_p->align_i_ = 0;
+           String loud =Dynamic_req::loudness_str(
+               dynamic_req_l_->absdynamic()->loudness_);
+           
+           td_p->text_str_ = paper()->lookup_l()->dynamic(loud).tex;
+           
+
+           td_p->style_str_ = "dynamic";
+           
+           dynamic_p_ = new Text_item(td_p, 10 ); // TODO!
+           announce_element(Staff_elem_info(dynamic_p_, dynamic_req_l_));
+       }
+    }
+}
+
+void
+Dynamic_register::pre_move_processing()
+{
+    if (dynamic_p_) {
+       typeset_element(dynamic_p_);
+       dynamic_p_ = 0;
+    }
+}
+
+bool
+Dynamic_register::acceptable_request_b(Request*r)const
+{
+    Musical_req * m = r->musical();
+    return  (m && m->dynamic());
+}
+
+void
+Dynamic_register::set_feature(Features i)
+{
+    dir_i_ = i.direction_i_;
+}
index 59f1ff5d83c0cfdc288728f995b74d11e3c066d3..fbf806edf7af918cf1e76e0e00eb5e72535a8f7c 100644 (file)
@@ -41,7 +41,7 @@ DEFAULT_PRINT(Symtables_id, Symtables, symtables);
 DEFAULT_PRINT(Staff_id, Input_staff, staff);
 DEFAULT_PRINT(M_chord_id, Music_general_chord, mchord);
 DEFAULT_PRINT(M_voice_id, Music_voice, mvoice);
-
+DEFAULT_PRINT(Request_id, Request, request);
 void
 Real_id::do_print() const
 {
@@ -54,3 +54,4 @@ Notetab_id::do_print() const
 {
     mtor << "unknown" << "\n";
 }
+
diff --git a/lily/include/config.hh b/lily/include/config.hh
deleted file mode 100644 (file)
index ca44f29..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#define LIBDIR "./"
diff --git a/lily/include/dynamic-reg.hh b/lily/include/dynamic-reg.hh
new file mode 100644 (file)
index 0000000..cd500c1
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+  dynamic-reg.hh -- declare Dynamic_register
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef DYNAMIC_REG_HH
+#define DYNAMIC_REG_HH
+
+#include "register.hh"
+
+struct Dynamic_register : Request_register {
+    int dir_i_;
+    Text_item * dynamic_p_;
+    Dynamic_req* dynamic_req_l_;
+    /* ************** */
+    Dynamic_register();
+    virtual bool try_request(Request *req_l);
+    virtual void process_requests();
+    virtual void pre_move_processing();
+    virtual void post_move_processing();
+    virtual bool acceptable_request_b(Request*) const;
+    virtual void set_feature(Features);
+    NAME_MEMBERS(Dynamic_register);
+};
+
+#endif // DYNAMIC_REG_HH
index 1aa7f7d0c4982c12ea3feec1387c78d2532a49ae..aa8d1100127f13bd2892d17c304603ed08febcd8 100644 (file)
@@ -7,6 +7,7 @@
 
 #ifndef IDENTIFIER_HH
 #define IDENTIFIER_HH
+
 #include "identparent.hh"
 #include "symtable.hh"
 #include "input-staff.hh"
 #include "notename.hh"
 #include "lookup.hh"
 #include "script-def.hh"
+#include "request.hh"
 
 #define make_id_class(Idclass, Class, accessor)        \
 struct Idclass : Identifier {\
     virtual const char *classname() { return #Class; }\
-    Idclass(String s, Class*st):Identifier(s) { data = st; }\
+    Idclass(String s, Class*st, int code):Identifier(s,code) { data = st; }\
     virtual Class* accessor(bool copy) {\
        if (copy)\
            return new Class(* (Class*) data);\
@@ -37,6 +39,7 @@ make_id_class(Staff_id, Input_staff, staff);
 make_id_class(M_chord_id, Music_general_chord, mchord);
 make_id_class(M_voice_id, Music_voice, mvoice);
 make_id_class(Notetab_id, Notename_tab, notename_tab);
+make_id_class(Request_id, Request, request);
 
 #endif // IDENTIFIER_HH
 
index 3e6d566ee7c431338ce35f977ca9ebf02065ee39..8071dcd4f549b411f0670778daf51b0fc650d670 100644 (file)
 #define IDACCESSOR( Input_staff, staff)\
     virtual Input_staff * staff(bool) { error(#Input_staff); return 0; }
 
+
 struct Identifier {
     void *data;
     String name;
+    int token_code_i_;
     
-    Identifier(String n) : name(n) { }
+    Identifier(String n, int code) : name(n) { token_code_i_ = code; }
     virtual ~Identifier() {}
 
     void print()const;
@@ -33,6 +35,8 @@ struct Identifier {
     IDACCESSOR(Lookup,lookup)
     IDACCESSOR(Real,real)
     IDACCESSOR(Notename_tab, notename_tab)
+    IDACCESSOR(Request, request)
+       
 protected:
     virtual void do_print()const=0;
 private:
index 524cdf1958da47f06dbb23410a56e97012095af8..e850586626a6aed90f6dd007ceff12baaed4acf6 100644 (file)
@@ -15,40 +15,40 @@ struct Lookup {
     /* *************** */
     void add(String, Symtable*);
     void print()const;
-    Real internote();
+    Real internote()const;
 
-    Symbol linestaff(int n, Real w);
-    Symbol fill(Box b);
-    Symbol beam_element(int,int,Real=0);
+    Symbol linestaff(int n, Real w)const;
+    Symbol fill(Box b)const;
+    Symbol beam_element(int,int,Real=0)const;
 
     /// round slope to closest TeXslope
-    Symbol beam(Real&,Real);
+    Symbol beam(Real&,Real)const;
 
     /**
       pos == 3 : 3 lines above staff (extending below note)
 
       pos == -3: below staff
       */
-    Symbol streepjes(int pos);
-
-    Symbol meter(Array<Scalar>);
-    Symbol stem(Real y1_pos, Real y2_pos);
-    Symbol rule_symbol(Real height, Real width);
-    Symbol accidental(int);
-    Symbol ball(int);
-    Symbol flag(int);
-    Symbol rest(int);
-    Symbol clef(String);
-    Symbol bar(String);
-    Symbol dots(int);
-    Symbol slur(int dy, Real &dx, int dir);
-    Symbol half_slur(int dy, Real &dx, int dir, int xpart);
-    Symbol half_slur_middlepart(Real &dx, int dir);
-    Symbol big_slur(int dy, Real &dx, int dir);
-    Symbol text(String style, String text, int align = 1);
-    Symbol script(String idx);
-    Symbol hairpin(Real & width, bool decresc);
-
+    Symbol streepjes(int pos)const;
+
+    Symbol meter(Array<Scalar>)const;
+    Symbol stem(Real y1_pos, Real y2_pos)const;
+    Symbol rule_symbol(Real height, Real width)const;
+    Symbol accidental(int)const;
+    Symbol ball(int)const;
+    Symbol flag(int)const;
+    Symbol rest(int)const;
+    Symbol clef(String)const;
+    Symbol bar(String)const;
+    Symbol dots(int)const;
+    Symbol slur(int dy, Real &dx, int dir)const;
+    Symbol half_slur(int dy, Real &dx, int dir, int xpart)const;
+    Symbol half_slur_middlepart(Real &dx, int dir)const;
+    Symbol big_slur(int dy, Real &dx, int dir)const;
+    Symbol text(String style, String text, int align = 1)const;
+    Symbol script(String idx)const;
+    Symbol hairpin(Real & width, bool decresc)const;
+    Symbol dynamic(String)const;
     Lookup();
     Lookup(Lookup const &);
     ~Lookup();
index e7c26380f48a33ceb04b973d7351dc6e6415b273..fcfcb0c6e029a0f963da08bb2eb14e24292b8ecd 100644 (file)
   */
 class Midi_walker : public PCursor<Staff_column*> {
     Midi_track *track_l_;
+    
     PQueue<Melodic_req*, Moment> stop_notes;
     Moment last_moment_;
 
     /* *************** */
     void do_stop_notes(Moment);
-    
+    void do_start_note(Note_req *note_l);
     void output_event(Midi_item&, Moment);
 public:
     
index 240b72afd9c7cb96da5ec58a8d3cdc3923d42e61..208e3dc295c336b3e445d440f6a0864e0f4a0df7 100644 (file)
@@ -19,6 +19,9 @@
  */
 struct Musical_req : virtual Request {
     virtual Skip_req* skip() { return 0; }
+    virtual Dynamic_req* dynamic() { return 0; }
+    virtual Absolute_dynamic_req * absdynamic() { return 0; }
+    virtual Subtle_req * subtle() { return 0; }
     REQUESTMETHODS(Musical_req, musical);
 };
 
@@ -177,9 +180,9 @@ struct Slur_req : Span_req {
 };
 
 
-/**Put a script above or below this ``note''. eg upbow, downbow. Why a
-request? These symbols may conflict with slurs and brackets, so this
-also a request */
+/** Put a script above or below this ``note''. eg upbow, downbow. Why
+  a request? These symbols may conflict with slurs and brackets, so
+  this also a request */
 struct Script_req : Musical_req {
     int dir_i_;
     Script_def *scriptdef_p_;
@@ -192,7 +195,31 @@ struct Script_req : Musical_req {
     Script_req(Script_req const&);
 };
 
+/** A helper in the hierarchy. Each dynamic is bound to one note ( a
+    crescendo spanning multiple notes is thought to be made of two
+    "dynamics": a start and a stop).  Dynamic changes can occur in a
+    smaller time than the length of its note, therefore fore each
+    Dynamic request carries a time, measured from the start of its
+    note.
+ */
+struct Subtle_req : virtual Musical_req {
+    Moment subtime_;
+    REQUESTMETHODS(Subtle_req, subtle);
+};
 
+struct Dynamic_req : Subtle_req {
+    /// for absolute dynamics
+    enum Loudness {
+       FFF, FF, F, MF, MP, P, PP, PPP
+    };
+    static String loudness_str(Loudness);
+    REQUESTMETHODS(Dynamic_req, dynamic);
+};
 
+struct Absolute_dynamic_req : Dynamic_req {
+    Loudness loudness_;
+    Absolute_dynamic_req();
+    REQUESTMETHODS(Absolute_dynamic_req, absdynamic);
+};
 
 #endif // MUSICALREQUESTS_HH
index ae557258b082a4eb2ff6a706b08e34a8f2c275bf..fba93580cb53fb30585786bd7979ecc972de60ab 100644 (file)
  constants. Most of them are related to the point-size of the fonts,
  so therefore, the lookup table for symbols is also in here.
 
- see TODO
  */
-struct Paper_def {
+class Paper_def {
     Lookup *lookup_p_;
+public:    
     String outfile;
 
     Real linewidth;
@@ -47,6 +47,7 @@ struct Paper_def {
     Real standard_height()const;
     Real note_width() const;
     void print() const;
+    const Lookup* lookup_l();  // TODO naming
     Real duration_to_dist(Moment);
 };
 
diff --git a/lily/include/parser.hh b/lily/include/parser.hh
deleted file mode 100644 (file)
index 3a3d4de..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-typedef union {
-    Request * request;
-    Real real;
-    Identifier *id;    
-   Voice *voice;    
-    Voice_element *el; 
-    String *string;
-    const char *consstr;
-    Paper_def *paper;
-    Midi_def* midi;
-    Input_music *music;
-    Music_general_chord *chord;
-    Music_voice *mvoice; 
-    int i;
-    char c;
-    int ii[10];
-       Moment *moment;
-
-    Array<String> * strvec;
-    Array<int> *intvec;
-    Array<Melodic_req*> *melreqvec;
-    Input_staff *staff;    
-    Input_score *score;
-    Symtables * symtables;
-    Symtable * symtable;
-    Symbol * symbol;
-    Lookup*lookup;
-    Interval *interval;
-    Box *box;
-    Notename_tab *notename_tab;
-    Script_def * script;
-    Text_def * textdef;
-} YYSTYPE;
-#define        VOICE   258
-#define        STAFF   259
-#define        SCORE   260
-#define        TITLE   261
-#define        BAR     262
-#define        OUTPUT  263
-#define        MULTIVOICE      264
-#define        CM_T    265
-#define        IN_T    266
-#define        PT_T    267
-#define        MM_T    268
-#define        PAPER   269
-#define        WIDTH   270
-#define        METER   271
-#define        UNITSPACE       272
-#define        SKIP    273
-#define        COMMANDS        274
-#define        COMMAND 275
-#define        GEOMETRIC       276
-#define        START_T 277
-#define        DURATIONCOMMAND 278
-#define        OCTAVECOMMAND   279
-#define        KEY     280
-#define        CLEF    281
-#define        TABLE   282
-#define        VOICES  283
-#define        STEM    284
-#define        PARTIAL 285
-#define        MUSIC   286
-#define        GROUPING        287
-#define        CADENZA 288
-#define        END     289
-#define        SYMBOLTABLES    290
-#define        TEXID   291
-#define        NOTENAMES       292
-#define        SCRIPT  293
-#define        TEXTSTYLE       294
-#define        PLET    295
-#define        GOTO    296
-#define        MIDI    297
-#define        TEMPO   298
-#define        IDENTIFIER      299
-#define        PITCHMOD        300
-#define        DURATION        301
-#define        RESTNAME        302
-#define        NOTENAME        303
-#define        REAL    304
-#define        STRING  305
-#define        DOTS    306
-#define        INT     307
-
-
-extern YYSTYPE yylval;
index b3d304256e9bde15b3d1389a170638b29e8b6ea9..5c766150ac2383a4a5d8a4f065b3a2270cf5bb7f 100644 (file)
@@ -26,6 +26,7 @@ class Score_walker : public PCursor<Score_column *>
     int disallow_break_count_;
     void reinit();
 public:
+    bool break_allowed_b();
     void allow_break(Staff_walker*w);
     Score_walker(Score*);
     ~Score_walker();
index dd6303ea8c5be41784eed903904967a4c1995883..2aa4b8166b91494fde4de8cbfa204514212f9785 100644 (file)
@@ -31,15 +31,15 @@ public:
 
     Moment when() const;
     void set_cols(Score_column *c1, Score_column *c2);
-    void add(Voice_element*ve);
+    void add(Voice_element*ve, PQueue<Subtle_req *, Moment> &subtle_req_pq );
     void OK() const;
     ~Staff_column();
     void typeset_breakable_items(Array<Item *> &pre_p_arr,
                                 Array<Item *> &nobreak_p_arr,
                                 Array<Item *> &post_p_arr);
     void typeset_musical_item(Item *i);
+    void setup_one_request(Request*);
 protected:
-     void setup_one_request(Request*);
 };
 
 
index 9c6264a86bd56efe113b2c45e77b17c0a9ee79bc..c07f242e31dae2aa5659ccbb46b74ea265322717 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "proto.hh"
 #include "varray.hh"
+
 /// data container.
 struct Staff_elem_info {
     Staff_elem * elem_p_;
@@ -19,7 +20,6 @@ struct Staff_elem_info {
     const Voice * voice_l_;
     Array<Request_register*> origin_reg_l_arr_;
 
-
     /* *** */
     Staff_elem_info(Staff_elem*, Request*);
     Staff_elem_info();
@@ -30,6 +30,7 @@ struct Staff_info {
     Staff_walker *walk_l_;
     const Time_description *time_c_l_;
     const Rhythmic_grouping *rhythmic_c_l_;
+    bool break_allowed_b_;
 };
 
 
index f96d02c1ec2c18d3e19d63c77a537c6d0222f770..5f902c4913c89118334527592b2c6c7a4533aa63 100644 (file)
@@ -8,6 +8,8 @@
 #include "symbol.hh"
 
 struct  Symtable : public Assoc<String, Symbol> {
+    String id_str;
+    
     Symbol lookup(String)const;
     void print()const;
 };
@@ -19,7 +21,7 @@ struct Symtables : private Assoc<String, Symtable*> {
     ~Symtables();
     Symtables();
     Symtables(Symtables const&);
-    Assoc<String, Symtable*>::add;
+    void add(String, Symtable*);
     void print()const;
 };
 
index cc9c3c95b3e44088c0985dc66e74817ce51009c6..b59df7f532b8ae53c09e8d6db3615249fbc9a8b1 100644 (file)
@@ -17,7 +17,7 @@ struct Text_def  {
     char const* defined_ch_c_l_;
   
 
-    /* ****************/
+    /* *************** */
     virtual ~Text_def() {};
     bool compare(const Text_def&);
     Text_def();
index ae0b55630800943c1f638d8cf14e1b7f066acd5e..d5ff7405e16d5a642ecf7ec52b98e5e0bdd32c7e 100644 (file)
@@ -9,19 +9,26 @@
 
 #include "text-def.hh"
 #include "item.hh"
-  
-struct Text_item : Item {
+
+/**
+  print a fixed width text above or below the staff.
+ */
+class Text_item : public Item {
+    void init(Text_def* tdef_l,int staffsize_i); 
+    Text_def* tdef_p_;
+public:
+    Text_def * tdef_l();
     int pos_i_;
     int staffsize_i_;
     int dir_i_;
-    Text_def* tdef_l_;
-    
+        
     /* ***************/
+
     NAME_MEMBERS(Text_item);
     virtual void set_default_index();
     Molecule* brew_molecule_p() const;
     void do_pre_processing();
-    
+    Text_item(Text_def*,int);
     Text_item(Text_req*,int);
 };
 
index 963b1bc5785f06d7dffb6298ed89d2b8fd1c8ba9..089eab126fc497ebf045b44270debf184d83fd25 100644 (file)
@@ -56,13 +56,13 @@ Key_item::brew_molecule_p()const
     Real inter = paper()->internote();
     
     for (int i =0; i < pitch.size(); i++) {
-       Symbol s= paper()->lookup_p_->accidental(acc[i]);
+       Symbol s= paper()->lookup_l()->accidental(acc[i]);
        Atom a(s);
        a.translate(Offset(0,(c_position + pitch[i]) * inter));
        Molecule m(a);
        output->add_right(m);   
     }
-    Molecule m(paper()->lookup_p_->fill(Box(
+    Molecule m(paper()->lookup_l()->fill(Box(
        Interval(0, paper()->note_width()),
        Interval(0,0))));
     output->add_right(m);
index 6f5945a60544bfaac62a223bbbc1ce7551f78f40..10c5ee6b03c8264f949da3e429f891fb45452380 100644 (file)
@@ -12,6 +12,7 @@
 #include "input-score.hh"
 #include "parseconstruct.hh"
 #include "main.hh"
+#include "identparent.hh"
 
 %}
 
@@ -89,7 +90,7 @@ COMMENT               [%#].*\n
        Identifier * id = lookup_identifier(c);
        if (id) {               
                yylval.id = id;
-               return IDENTIFIER;
+               return id->token_code_i_;
        }
        String *sp = new String( c);
        yylval.string=sp;
index 425982120c0b839ffa42324bb59f2a614cf1361d..a0152c9f3cab4407909421d34785e800de91d6dd 100644 (file)
@@ -60,7 +60,7 @@ Local_key_item::brew_molecule_p()const
            octmol= new Molecule;
        }
        lastoct = accs[i].octave;
-       Symbol s =paper()->lookup_p_->accidental(accs[i].acc);   
+       Symbol s =paper()->lookup_l()->accidental(accs[i].acc);   
        Atom a(s);
        Real dy = (accs[i].name + c0_position) * paper()->internote();
        a.translate(Offset(0,dy));
index ffd668e75d33e72e80f676ebd497bdb35313da24..ede8af08554d3a796b994453e5f96f1b4d70741a 100644 (file)
@@ -44,7 +44,7 @@ Lookup::print()const
 }
 
 Symbol
-Lookup::text(String style, String text, int dir)
+Lookup::text(String style, String text, int dir) const
 {
     Array<String> a;
  
@@ -60,13 +60,13 @@ Lookup::text(String style, String text, int dir)
 
 
 Real
-Lookup::internote()
+Lookup::internote() const
 {
     return ball(4).dim.y.length()/2;
 }
 
 Symbol
-Lookup::ball(int j)
+Lookup::ball(int j) const
 {
     if (j > 4)
        j = 4;
@@ -76,13 +76,13 @@ Lookup::ball(int j)
 }
 
 Symbol
-Lookup::rest(int j)
+Lookup::rest(int j) const
 {
     return (*symtables_)("rests")->lookup(String(j));
 }
 
 Symbol
-Lookup::fill(Box b)
+Lookup::fill(Box b) const
 {
     Symbol s( (*symtables_)("param")->lookup("fill"));
     s.dim = b;
@@ -90,32 +90,38 @@ Lookup::fill(Box b)
 }
 
 Symbol
-Lookup::accidental(int j)
+Lookup::accidental(int j) const
 {
     return (*symtables_)("accidentals")->lookup(String(j));
 }
 
 
 Symbol
-Lookup::bar(String s)
+Lookup::bar(String s) const
 {
     return (*symtables_)("bars")->lookup(s);
 }
 
 Symbol
-Lookup::script(String s)
+Lookup::script(String s) const
 {
     return (*symtables_)("scripts")->lookup(s);
 }
 
 Symbol
-Lookup::clef(String s)
+Lookup::dynamic(String s) const
+{
+    return (*symtables_)("dynamics")->lookup(s);
+}
+
+Symbol
+Lookup::clef(String s) const
 {
     return (*symtables_)("clefs")->lookup(s);
 }
  
 Symbol
-Lookup::dots(int j)
+Lookup::dots(int j) const
 {
     if (j>3)
        error("max 3 dots");    // todo
@@ -123,13 +129,13 @@ Lookup::dots(int j)
 }
 
 Symbol
-Lookup::flag(int j)
+Lookup::flag(int j) const
 {
     return (*symtables_)("flags")->lookup(j);
 }
 
 Symbol
-Lookup::streepjes(int i)
+Lookup::streepjes(int i) const
 {
     assert(i);
     
@@ -153,7 +159,7 @@ Lookup::streepjes(int i)
 }
 
 Symbol
-Lookup::hairpin(Real &wid, bool decresc)
+Lookup::hairpin(Real &wid, bool decresc) const
 {
     int idx = int(rint(wid / 6 PT));
     if(!idx) idx ++;
@@ -169,7 +175,7 @@ Lookup::hairpin(Real &wid, bool decresc)
 }
 
 Symbol
-Lookup::linestaff(int lines, Real wid) 
+Lookup::linestaff(int lines, Real wid) const
 {
     Symbol s;
     s.dim.x = Interval(0,wid);
@@ -188,7 +194,7 @@ Lookup::linestaff(int lines, Real wid)
 
 
 Symbol
-Lookup::meter(Array<Scalar> a)
+Lookup::meter(Array<Scalar> a) const
 {
     Symbol s;
     s.dim.x = Interval( 0 PT, 10 PT);
@@ -200,7 +206,7 @@ Lookup::meter(Array<Scalar> a)
 
 
 Symbol
-Lookup::stem(Real y1,Real y2)
+Lookup::stem(Real y1,Real y2) const
 {
     if (y1 > y2) {
        Real t = y1;
index c0adac7b63d8e7a968f6376f77f9284ca614bae0..cb8c7547e43d9180264935af3892a95c3714a47f 100644 (file)
@@ -22,6 +22,6 @@ Lyric_item::do_pre_processing()
 {
 
     // test context-error
-    if ( tdef_l_->text_str_.index_i( "Gates" ) >=0)// :-)
-       warning( "foul word", tdef_l_->defined_ch_c_l_ );
+    if ( tdef_l()->text_str_.index_i( "Gates" ) >=0)// :-)
+       warning( "foul word", tdef_l()->defined_ch_c_l_ );
 }
index 94f6b6c5e96ed756324998a9873d96b6945a5c09..c16d5d3d3f30c7c5843af322fa96c562e16df70d 100644 (file)
@@ -12,7 +12,7 @@ Meter::Meter(Array<Scalar>a)
 Molecule*
 Meter::brew_molecule_p()const
 {
-    Symbol s = paper()->lookup_p_->meter(args);
+    Symbol s = paper()->lookup_l()->meter(args);
     return new Molecule(Atom(s));
 }
 
index 51ba40d54c7abdb2590156ba667ddd2c664afd9f..9a63d93e5a0e602d8b707bddbaf4358e79f4997b 100644 (file)
@@ -123,10 +123,14 @@ Midi_note::Midi_note( Melodic_req* melreq_l, int channel_i, bool on_bo  )
     assert(melreq_l);
     pitch_i_ = melreq_l->pitch() + c0_pitch_i_c_;   
     channel_i_ = channel_i;
-
-    // poor man-s staff dynamics:
-    dynamic_byte_ =  (melreq_l)? 0x64 - 0x10 * channel_i_:0;
+    
     on_b_ = on_bo;
+
+    dynamic_byte_ = 0x64;
+    if ( on_b_ ) // poor man-s staff dynamics:
+       dynamic_byte_ -= 0x10 * channel_i_;
+    else
+       dynamic_byte_ += 0x32; // 0x64 is supposed to be neutral, but let-s try
 }
 
 String
index 7714a99fa83e8a2157cd2cdf85cbeaadd2f9cbcc..ec3b727400756332bbe3efe5059b3572b413cbcf 100644 (file)
@@ -31,7 +31,10 @@ Midi_output::Midi_output(Score* score_l, Midi_def* midi_l )
     midi_l_ = midi_l;
     score_l_ = score_l;
 
-    Midi_stream midi_stream(midi_l->outfile_str_, score_l_->staffs_.size(), 384 );
+    Midi_stream midi_stream(midi_l->outfile_str_, 
+        // don-t forget: extra track 0 for tempo/copyright stuff...
+       score_l_->staffs_.size() + 1, 
+       384 );
     midi_stream_l_ = &midi_stream;
 
     header();
@@ -44,7 +47,7 @@ Midi_output::do_staff(Staff*st_l,int track_i)
     Midi_track midi_track( track_i );
 
     // set track name
-    Midi_text track_name( Midi_text::TRACK_NAME, "Track " + String_convert::i2dec_str( track_i, 2, 0 ) );
+    Midi_text track_name( Midi_text::TRACK_NAME, "Track " + String_convert::i2dec_str( track_i, 0, '0' ) );
     midi_track.add( Moment( 0.0 ), &track_name );
 
     // set instrument :-)
@@ -55,10 +58,11 @@ Midi_output::do_staff(Staff*st_l,int track_i)
     int accidentals_i = 0;
     int minor_i = 0;
 
-    // sorry, wanna test this...
+    // uph, sorry, wanna test this...
     // menuetto in F
     if ( ( infile_str_g.index_i( "scsii-menuetto" ) >= 0 )
-       || ( infile_str_g.index_i( "standchen" ) >= 0 ) )
+       || ( infile_str_g.index_i( "standchen" ) >= 0 )
+       || ( infile_str_g.left_str( 1 )  == String( "s" ) ) )
        accidentals_i = -1;
     // standchen in d  
     if ( ( infile_str_g.index_i( "standchen" ) >= 0 ) )
index 801ba32e122588a3758ea0d6c44f3fee3f9d4494..4a1674c7f7a043feb802f2e9058b679997bb8865 100644 (file)
@@ -36,6 +36,32 @@ Midi_walker::do_stop_notes(Moment max_moment)
        output_event(note, stop_moment);
     }
 }
+/**
+  Find out if start_note event is needed,  and do it if needed.
+ */
+void 
+Midi_walker::do_start_note(Note_req*note_l)
+{
+    Moment stop=note_l->duration() + ptr()->when();
+    for(int i=0; i < stop_notes.size(); i++)
+       if (stop_notes.value_arr_[i]->melodic()->pitch() ==
+           note_l->pitch()) {
+            if ( stop_notes.indices_arr_[i] < stop){
+                
+                stop_notes.del(i);
+                return ;  // removing this gives a feature ( ${c2 c4}$ output correctly)
+            }
+            else
+                return; // skip the stop note 
+            break;// do the stop note               
+       }
+    
+    stop_notes.enter(note_l,  stop);
+    Midi_note note(note_l, track_l_->number_i_, true);
+    output_event(note, ptr()->when());
+}
+
+
 /** advance the track to #now#, output the item, and adjust current
   "moment".  */
 void
@@ -58,10 +84,8 @@ Midi_walker::process_requests()
        Note_req * note_l = n->note();
        if (!note_l)
            continue;
+       do_start_note(note_l);
        
-       Midi_note note(note_l, track_l_->number_i_, true);
-       stop_notes.enter(note_l, n->duration() + ptr()->when() );
-       output_event(note, ptr()->when());
     }
 }
 
index 7da6dddec843d7413426c724287cb7aea2763ee9..9c9179c856d4237b5aa65df59d402b5a4bc1873f 100644 (file)
@@ -5,7 +5,7 @@
 #include "assoc-iter.hh"
 #include "lexer.hh"
 #include "input-file.hh"
-#include "parser.hh"
+#include "out/parser.hh"
 #include "keyword.hh"
 #include "assoc.hh"
 #include "lexer.hh"
@@ -20,8 +20,9 @@ static Keyword_ent the_key_tab[]={
     "clef", CLEF,
     "cm", CM_T,
     "command", COMMAND,
-    "commands", COMMANDS,
+    "commands", COMMANDS,    
     "duration", DURATIONCOMMAND,
+    "dynamic", DYNAMIC,
     "geometric", GEOMETRIC,
     "goto", GOTO,
     "in", IN_T,
index 722b231e6837fa123c54f2a6383910cfac3401bb..4d0157abe9aa4271b5ee0fcb01c1458cc3517355 100644 (file)
@@ -48,11 +48,11 @@ Notehead::brew_molecule_p() const return out;
     Paper_def *p = paper();
 
     Real dy = p->internote();
-    Symbol s = p->lookup_p_->ball(balltype);
+    Symbol s = p->lookup_l()->ball(balltype);
     
     out = new Molecule(Atom(s));
     if (dots) {
-       Symbol d = p->lookup_p_->dots(dots);
+       Symbol d = p->lookup_l()->dots(dots);
        Molecule dm;
        dm.add(Atom(d));
        if (!(position %2))
@@ -64,7 +64,7 @@ Notehead::brew_molecule_p() const return out;
     if (streepjes) {
        int dir = sign(position);
        int s =(position<-1) ? -((-position)/2): (position-staff_size)/2;
-       Symbol str = p->lookup_p_->streepjes(s);
+       Symbol str = p->lookup_l()->streepjes(s);
        Molecule sm;
        sm.add(Atom(str));
        if (position % 2)
index b49a53fc8e488298454cf5139f0b24016449550b..6063347e88afd08e796bc24cfec6b94dcc59c10d 100644 (file)
@@ -89,3 +89,8 @@ Paper_def::print() const
     mtor << "}\n";
 #endif
 }
+const Lookup*
+Paper_def::lookup_l()
+{
+    return lookup_p_;
+}
index ba9703e4b8be61597d131ea3ff6c3d78c35c427b..ebec63fbefe15feddea069cc597865d552392508 100644 (file)
@@ -65,7 +65,7 @@ int fatal_error_i = 0;
     Text_def * textdef;
 }
 
-%token VOICE STAFF SCORE TITLE  BAR  OUTPUT MULTIVOICE
+%token VOICE STAFF SCORE TITLE  BAR  OUTPUT MULTIVOICE DYNAMIC
 %token CM_T IN_T PT_T MM_T PAPER WIDTH METER UNITSPACE SKIP COMMANDS COMMAND
 %token GEOMETRIC START_T DURATIONCOMMAND OCTAVECOMMAND
 %token KEY CLEF  TABLE  VOICES STEM
@@ -74,7 +74,7 @@ int fatal_error_i = 0;
 %token  GOTO
 %token MIDI TEMPO
 
-%token <id>  IDENTIFIER
+%token <id>  IDENTIFIER REAL_IDENTIFIER REQUEST_IDENTIFIER 
 %token <string> PITCHMOD DURATION RESTNAME
 %token <ii> NOTENAME 
 %token <real> REAL 
@@ -98,7 +98,7 @@ int fatal_error_i = 0;
 %type <staff> staff_block staff_init staff_body
 %type <i> int
 %type <intvec> intastint_list
-%type <request> post_request pre_request command_req
+%type <request> post_request pre_request command_req 
 %type <string> pitchmod
 %type <music> music 
 %type <chord> music_chord music_chord_body
@@ -113,7 +113,7 @@ int fatal_error_i = 0;
 %type <notename_tab> notename_tab notename_tab_body
 %type <i> script_dir
 %type <script> script_definition script_body mudela_script
-%type <request> script_req textscript_req
+%type <request> script_req textscript_req dynamic_req basic_request
 %type <textdef> mudela_text
 
 
@@ -146,35 +146,39 @@ declarable_identifier:
 
 declaration:
        declarable_identifier '=' staff_block  {
-               $$ = new Staff_id(*$1, $3);
+               $$ = new Staff_id(*$1, $3, IDENTIFIER);
                delete $1; 
        }
        | declarable_identifier '=' music_voice {
-               $$ = new M_voice_id(*$1, $3);
+               $$ = new M_voice_id(*$1, $3, IDENTIFIER);
                delete $1;
        }
        | declarable_identifier '=' script_definition {
-               $$ = new Script_id(*$1, $3);
+               $$ = new Script_id(*$1, $3, IDENTIFIER);
                delete $1;
        }
        | declarable_identifier '=' music_chord  {
-               $$ = new M_chord_id(*$1, $3);
+               $$ = new M_chord_id(*$1, $3, IDENTIFIER);
                delete $1;
        }
        | declarable_identifier '=' symtables {
-               $$ = new Lookup_id(*$1, $3);
+               $$ = new Lookup_id(*$1, $3, IDENTIFIER);
                delete $1;
        }
        | declarable_identifier '=' notename_tab {
-               $$ = new Notetab_id(*$1, $3);
+               $$ = new Notetab_id(*$1, $3, IDENTIFIER);
                delete $1;
        }
        | declarable_identifier '=' real        {
-               $$ = new Real_id(*$1, new Real($3));
+               $$ = new Real_id(*$1, new Real($3), REAL_IDENTIFIER);
                delete $1;
        }
        | declarable_identifier error '}' {
 
+       }
+       | declarable_identifier '=' basic_request {
+               $$ = new Request_id(*$1, $3, REQUEST_IDENTIFIER);
+               delete $1;
        }
        ;
 
@@ -328,11 +332,14 @@ music_voice:  MUSIC '{' music_voice_body '}'      { $$ = $3; }
        ;
 
 music_voice_body:
-       /* */   {
+       IDENTIFIER {
+               $$ = $1->mvoice(true);
+       }
+       | /* */         {
                $$ = new Music_voice;
        }
-       | music_voice_body IDENTIFIER {
-               $$->concatenate($2->mvoice(true));
+       | music_voice_body '+' IDENTIFIER {
+               $$->concatenate($3->mvoice(true));
        }
        | music_voice_body full_element {
                $$->add_elt($2);
@@ -350,14 +357,17 @@ music_chord:  '{' music_chord_body '}'    { $$ = $2; }
        ;
 
 music_chord_body:
-       /* */   {
+       IDENTIFIER {
+               $$=$1->mchord(true);
+       }
+       | /* */ {
                $$ = new Voice_group_chord;
        }
        | MULTIVOICE {
                $$ = new Multi_voice_chord;
        }
-       | music_chord_body IDENTIFIER {
-               $$->concatenate($2->mchord(true));
+       | music_chord_body '+' IDENTIFIER {
+               $$->concatenate($3->mchord(true));
        }
        | music_chord_body music {
                $$->add($2);
@@ -369,6 +379,11 @@ music_chord_body:
        }
        ;
 
+basic_request:
+       command_req
+       | pre_request
+       | post_request
+       ;
 
 /*
        VOICE ELEMENTS
@@ -464,6 +479,18 @@ post_request:
        }
        | script_req
        | textscript_req
+       | dynamic_req
+       | REQUEST_IDENTIFIER    {
+               $$ = $1->request(false)->clone();
+       }
+       ;
+
+dynamic_req:
+       DYNAMIC '{' int '}'     {
+               Absolute_dynamic_req *ad_p = new Absolute_dynamic_req;
+               ad_p ->loudness_ = $3;
+               $$ =ad_p;
+       }
        ;
 
 close_plet_parens:
@@ -698,7 +725,7 @@ real:
        | REAL          {
                $$ = $1;
        }
-       | IDENTIFIER            {
+       | REAL_IDENTIFIER               {
                $$ = * $1->real(0);             
        }
        ;
index 1f4a8b68c8334ebda353f65e311c8dd0289f7a9e..989a0f92d7e74b7ac4afd0c256e7b451ac563369 100644 (file)
@@ -120,7 +120,7 @@ PScore::output(Tex_stream &ts)
 {
     int l=1;
 
-    ts << "\n "<<  paper_l_->lookup_p_->texsetting << "%(Tex id)\n";
+    ts << "\n "<<  paper_l_->lookup_l()->texsetting << "%(Tex id)\n";
     for (iter_top(lines,lic); lic.ok(); lic++) {
        ts << "% line of score no. " << l++ <<"\n";
        ts << lic->TeXstring();
index ecfe68c881a3470d4504b08c3cc5f9a15d1b5371..d6bae873b7c047bd1ebc025d8edc0d792e983af4 100644 (file)
@@ -71,7 +71,9 @@ Spacing_req::Spacing_req()
 void
 Spacing_req::do_print()const
 {
+#ifndef NPRINT
     mtor << "next " << next << "dist " << distance << "strength\n";
+#endif
 }
 
 void
@@ -298,3 +300,45 @@ Request::voice_l()
     else
        return (Voice*)elt_l_->voice_l_;
 }
+/* *************** */
+
+void
+Subtle_req::do_print() const
+{
+    mtor << " subtime " <<  subtime_;
+}
+
+void
+Dynamic_req::do_print() const
+{
+    Subtle_req::do_print();
+}
+
+void
+Absolute_dynamic_req::do_print() const
+{
+    Dynamic_req::do_print();
+    mtor << " loudness_" <<loudness_;
+}
+
+String
+Dynamic_req::loudness_str(Loudness l) 
+{
+    switch (l) {
+    case FFF: return "fff";
+    case FF: return "ff";
+    case F: return "f";
+    case MF: return "mf";
+    case MP: return "mp";
+    case P: return "p";
+    case PP: return "pp";
+    case PPP: return "ppp";
+    }
+    assert(false);
+    return "";
+}
+
+Absolute_dynamic_req::Absolute_dynamic_req()
+{
+    loudness_ = MF;
+}
index 0e4394a3c6f5694fb7c5d3218e1cd2dd33e7c45c..39347b1d5bc1f7bf8628d3ab8818a2b0bf3d134d 100644 (file)
@@ -28,11 +28,11 @@ Rest::brew_molecule_p()const
     Paper_def *p =paper();
 
     Symbol s;
-    s = p->lookup_p_->rest(balltype);
+    s = p->lookup_l()->rest(balltype);
     
     Molecule *m = new Molecule(Atom(s));
     if (dots) {
-       Symbol d =p->lookup_p_->dots(dots);
+       Symbol d =p->lookup_l()->dots(dots);
        Molecule dm;
        dm.add(Atom(d));
        m->add_right(dm);
index d011c331ad4f69bb2ee742d9fe357fa4aa293cb9..7221750c02eaa3d81e85a974c540047ac8975468 100644 (file)
@@ -51,11 +51,10 @@ Score_walker::operator ++(int )
     if (ok() && ptr()->when() == last)
        PCursor<Score_column *>::operator++(0);
     reinit();
-    if (!ok())
-       return;
+    bool last_b =  (!ok());    // urgh
     for (int i=0; i< walker_p_arr_.size(); i++) {
        if (walker_p_arr_[i]->ok() &&
-           walker_p_arr_[i]->when() < when()) {
+           (last_b || walker_p_arr_[i]->when() < when())) {
 
            walker_p_arr_[i]->operator++(0);
        }
@@ -82,6 +81,12 @@ Score_walker::allow_break(Staff_walker*w)
     }
 }
 
+bool
+Score_walker::break_allowed_b()
+{
+    return !disallow_break_count_;
+}
+
 Moment
 Score_walker::when()
 {
index 2a31133c331d121f75c33fc3c024eba0e1191ec5..1bcbd518a8eeb899f6b562d1502d3ab285eac778 100644 (file)
@@ -102,7 +102,7 @@ Symbol
 Script::symbol()const
 {
     String preidx_str = (symdir < 0) ?"-" :"";
-    return paper()->lookup_p_->script(preidx_str + specs_l_->symidx);
+    return paper()->lookup_l()->script(preidx_str + specs_l_->symidx);
 }
 
 void
index ba77a6948e710a3ac129879974bcc876c019a240..29623c0d0cade9e7d3b3f19415fa7b53a7d44097 100644 (file)
@@ -122,7 +122,7 @@ Slur::brew_molecule_p() const
     w+= (right_off.x - left_off.x) * nw_f ;
     Real round_w = w;          // slur lookup rounds the slurwidth .
     
-    Symbol sl = paper()->lookup_p_->slur(dy , round_w, dir_i_);
+    Symbol sl = paper()->lookup_l()->slur(dy , round_w, dir_i_);
 
     Real error = w-round_w;
     
index 0dd969ab0a222f0e339b494a2d474e62a229bbcc..87ceab5ebff78c716b66b475f9d33f0296031fb2 100644 (file)
@@ -19,6 +19,7 @@
 #include "item.hh"
 #include "pcol.hh"
 #include "voice-element.hh"
+#include "pqueue.hh"
 
 void
 Staff_column::OK() const
@@ -37,7 +38,8 @@ Staff_column::when() const
 }
 
 void
-Staff_column::add(Voice_element*ve)
+Staff_column::add(Voice_element*ve,
+                 PQueue<Subtle_req *, Moment> &subtle_req_pq )
 {
     for (iter_top(ve->reqs,j); j.ok(); j++) {
        if (j->command()) {
@@ -54,8 +56,17 @@ Staff_column::add(Voice_element*ve)
            if (j->rhythmic()) {
                musical_column_l_->add_duration(j->rhythmic()->duration());
            }
-           if (!j->musical()->skip())
-               setup_one_request(j);
+           if (j->musical()) {
+               Musical_req*m = j->musical();
+               if(m->skip())
+                   continue;
+               Subtle_req * s = m->subtle() ;
+               if (s&& s->subtime_) {
+                   subtle_req_pq.enter(s, s->subtime_ + when());
+                   continue ; 
+               }
+           }
+           setup_one_request(j);
        }
     }
 }
index a3ad17d07665d803d1ef76bb1fe647045f512693..71fa8a813fa873f744b8005c019dfd24151c8ad0 100644 (file)
@@ -1,3 +1,14 @@
+/*
+  staff.cc -- implement Staff
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+
 #include "proto.hh"
 #include "plist.hh"
 #include "staff.hh"
@@ -11,7 +22,7 @@
 #include "musicalrequest.hh"
 #include "commandrequest.hh" // todo
 #include "midi-stream.hh"
-
+#include "pqueue.hh"
 void
 Staff::add(PointerList<Voice*> const &l)
 {
@@ -77,25 +88,46 @@ Staff::get_col(Moment w, PCursor<Staff_column*> *last)
     return i;
 }
 
-/**
-  put all stuff grouped vertically in the Staff_cols.
-  Do the preprarations for walking the cols. not virtual
-    */
+/** put all stuff grouped vertically in the Staff_cols.  Do the
+  preprarations for walking the cols. not virtual */
 void
 Staff::setup_staffcols()
-{    
+{
+    PQueue<Subtle_req *, Moment> subtle_req_pq;
+    
     for (iter_top(voice_list_,i); i.ok(); i++) {
        PCursor<Staff_column*> last(cols_);
        Moment now = i->start;
-       for (iter_top(i->elts,j); j.ok(); j++) {
+       iter_top(i->elts,j);
+       while( j.ok()) {
            
-           Staff_column *s_l= get_col(now, &last);
-           assert(now == s_l->when());
-           s_l->add(j);
-           now += j->duration;     
-       }
+           Moment next = now;
+           if (subtle_req_pq.size())
+               next = next <? subtle_req_pq.front_idx();
 
+           Staff_column *s_l= get_col(next, &last);
+
+           while (subtle_req_pq.size()
+                  && subtle_req_pq.front_idx() == s_l->when()) {
+               s_l->setup_one_request(subtle_req_pq.get()); // ugh!
+           }
+           if(next == now) {
+               s_l->add(j, subtle_req_pq); 
+               now += j->duration;
+               j++;
+           }
+       }
+       
+    }
+    PCursor<Staff_column*> last(cols_);
+    
+    while (subtle_req_pq.size()) {
+       Moment front =subtle_req_pq.front_idx();
+       Staff_column *s_l = get_col(front, &last);
+       while(subtle_req_pq.size() && subtle_req_pq.front_idx() == front)
+           s_l->setup_one_request(subtle_req_pq.get()); // ugh!
     }
+       
     OK();
 }
 
index 631a5f3673e5c004733b6de54541ddde8c23b927..ad639e9c2d87f28a1c965b4b1671b4d003f9a449 100644 (file)
@@ -26,7 +26,7 @@ Staff_symbol::do_print()const
 Molecule*
 Staff_symbol::brew_molecule_p() const
 {
-    Atom a  = paper()->lookup_p_->linestaff(no_lines_i_, width().length());
+    Atom a  = paper()->lookup_l()->linestaff(no_lines_i_, width().length());
     return new Molecule(a);
 }
 
index 74ea4b57fcf0f500e46353139a5b356357bd30c3..0950ada3717f2839e1929c0f4d9c99fcb63a60bd 100644 (file)
@@ -158,7 +158,7 @@ Stem::width()const
     if (!print_flag || abs(flag) <= 4)
        return Interval(0,0);   // TODO!
     Paper_def*p= paper();
-    Interval r(p->lookup_p_->flag(flag).dim.x);
+    Interval r(p->lookup_l()->flag(flag).dim.x);
     r+= stem_xoffset;
     return r;
 }
@@ -172,13 +172,13 @@ Stem::brew_molecule_p()const return out;
     Paper_def *p =paper();
 
     Real dy = p->internote();
-    Symbol ss =p->lookup_p_->stem(bot*dy,top*dy);
+    Symbol ss =p->lookup_l()->stem(bot*dy,top*dy);
 
     
     out = new Molecule(Atom(ss));
 
     if (print_flag&&abs(flag) > 4){
-       Symbol fl = p->lookup_p_->flag(flag);
+       Symbol fl = p->lookup_l()->flag(flag);
        Molecule m(fl);
        if (flag < -4){         
            out->add_bottom(m);
index d55e9ac59bdd977572423dc035259af53d89ddad..d49a1d34b80cf745f07d8a1bbb225f7751da2095 100644 (file)
@@ -31,7 +31,7 @@ Symtable::lookup(String s) const
     if (elt_query(s))
        return (*this)[s];
     else {
-       error( "Unknown symbol `" +s+"'\n");
+       error( "Symtable `" + id_str+ "\': unknown symbol `" +s+"'\n");
     }
     Symbol sy;                 // unreachable
     return sy;
@@ -59,3 +59,9 @@ Symtable::print() const
     }
 }
        
+void
+Symtables::add(String s, Symtable*p)
+{
+    p-> id_str = s;
+    Assoc<String, Symtable*>::add(s,p);
+}
index c9f3c954812171495e0b53087f68f7a62b90a731..194d97384a25cd187a73c49749eed04fdc2b4ac9 100644 (file)
@@ -14,7 +14,7 @@
 #include "lookup.hh"
 
 Symbol
-Lookup::beam_element(int sidx, int widx, Real slope)
+Lookup::beam_element(int sidx, int widx, Real slope) const
 {
     Symbol bs=(*symtables_)("beamslopes")->lookup("slope");
     
@@ -48,7 +48,7 @@ slope_index(Real &s)
 }
 
 Symbol
-Lookup::rule_symbol(Real height, Real width)
+Lookup::rule_symbol(Real height, Real width) const
 {
     Symbol bs=(*symtables_)("beamslopes")->lookup("horizontal");    
     Array<String> args;
@@ -61,7 +61,7 @@ Lookup::rule_symbol(Real height, Real width)
 }
 
 Symbol
-Lookup::beam(Real &slope, Real width)
+Lookup::beam(Real &slope, Real width) const
 {        
     int sidx = slope_index(slope);
     if (!slope)
index 71cded95299cdebe83f02da7c43dadc746320640..2cbe6e7acd2f3e88872e1444d2b3804988cf7dde 100644 (file)
@@ -26,7 +26,7 @@ char direction_char(int y_sign)
 }
 
 Symbol
-Lookup::half_slur_middlepart(Real &dx, int dir)
+Lookup::half_slur_middlepart(Real &dx, int dir) const
 {
     if (dx >= 400 PT) {// todo
        WARN<<"halfslur too large" <<print_dimen(dx)<< "shrinking (ugh)\n";
@@ -61,7 +61,7 @@ Lookup::half_slur_middlepart(Real &dx, int dir)
     return s;
 }
 Symbol
-Lookup::half_slur(int dy, Real &dx, int dir, int xpart)
+Lookup::half_slur(int dy, Real &dx, int dir, int xpart) const
 {
     Real orig_dx = dx;
     if (!xpart)
@@ -111,7 +111,7 @@ Lookup::half_slur(int dy, Real &dx, int dir, int xpart)
 }
 
 Symbol
-Lookup::slur (int dy , Real &dx, int dir)
+Lookup::slur (int dy , Real &dx, int dir) const
 {
     assert(dx >=0 && abs(dir) <= 1);
     int y_sign = sign(dy);
@@ -176,7 +176,7 @@ Lookup::slur (int dy , Real &dx, int dir)
 }
 
 Symbol
-Lookup::big_slur(int dy , Real &dx, int dir)
+Lookup::big_slur(int dy , Real &dx, int dir) const
 {
     assert(dx >= 24 PT);
     Real slur_extra =abs(dy)  /2.0 + 2; 
index d67622e141c871b183e522d15e7366b4beab0cb1..b440003fd2b5044e88fc78f86df919fccd2694f9 100644 (file)
@@ -20,7 +20,7 @@ Text_def::compare(const Text_def&def)
 Atom
 Text_def::create_atom(Paper_def*p) const
 {
-    return p->lookup_p_->text(style_str_, text_str_, -align_i_);
+    return p->lookup_l()->text(style_str_, text_str_, -align_i_);
 }
 
 void
index 7cdab7c71fce06d08604e6f7e2d080327ebe046c..b0f6ab410762ed0ee2d4ed2cce16dbb8885cf2bd 100644 (file)
@@ -7,22 +7,43 @@
 */
 
 
-  #include "musicalrequest.hh"
+#include "musicalrequest.hh"
 #include "paper-def.hh"
 #include "text-item.hh"
 #include "stem.hh"
 #include "molecule.hh"
 #include "lookup.hh"
 
+Text_item::Text_item(Text_def *tdef_l, int staffsize_i)
+{
+    dir_i_ =-1;
+    init(tdef_l, staffsize_i);  
+}
 
+Text_def*
+Text_item::tdef_l()
+{
+    return tdef_p_;
+}
 
-Text_item::Text_item(Text_req* treq_l, int staffsize_i)
+Text_item::~Text_item()
+{
+    delete tdef_p_;
+}
+
+void
+Text_item::init(Text_def *tdef_l, int staffsize_i)
 {
     staffsize_i_ = staffsize_i;
+    tdef_p_ = new Text_def (*tdef_l);
+}
+
+Text_item::Text_item(Text_req* treq_l, int staffsize_i)
+{
+    init(treq_l->tdef_p_, staffsize_i);
     dir_i_ = treq_l->dir_i_;
     if (!dir_i_)
        dir_i_ = -1;
-    tdef_l_ = treq_l->tdef_p_;
 }
 
 void
@@ -41,7 +62,7 @@ Text_item::do_pre_processing()
 Molecule*
 Text_item::brew_molecule_p() const
 {
-    Molecule* mol_p = new Molecule(tdef_l_->create_atom(paper()));
+    Molecule* mol_p = new Molecule(tdef_p_->create_atom(paper()));
     mol_p->translate(Offset(0, pos_i_ * paper()->internote()));
 
     if(dir_i_<0)
index 90060ec43c8feb9f4b062224b053047456fbf699..e932e4d4033fb7863b2e1e77b746089706d579d2 100644 (file)
@@ -61,8 +61,8 @@ Voice_element::find_plet_start_bo(char c, Moment& moment_r)
 {
     assert( c == ']' );
     moment_r += duration;
-    for ( PCursor<Request*> req_l_pcur( reqs.top() ); req_l_pcur.ok(); req_l_pcur++ ) {
-       if (req_l_pcur->beam() && req_l_pcur->beam()->spantype == Span_req::START )
+    for ( PCursor<Request*> i( reqs.top() ); i.ok(); i++ ) {
+       if (i->beam() && i->beam()->spantype == Span_req::START )
            return true;
     }
     return false;
@@ -86,12 +86,12 @@ Voice_element::set_plet_backwards(Moment& now_moment_r,
     now_moment_r += duration;
     if ( now_moment_r > until_moment )
        return;
-    for ( PCursor<Request*> req_l_pcur( reqs.top() ); req_l_pcur.ok(); req_l_pcur++ ) {
-       if (req_l_pcur->beam() && req_l_pcur->beam()->spantype == Span_req::START )
-           req_l_pcur->beam()->nplet = den_i;
-       if (req_l_pcur->rhythmic())
-           req_l_pcur->rhythmic()->plet_factor = Moment(num_i, den_i);
-       if (req_l_pcur->stem())
-           req_l_pcur->stem()->plet_factor = Moment(num_i, den_i);
+    for ( PCursor<Request*> i( reqs.top() ); i.ok(); i++ ) {
+       if (i->beam() && i->beam()->spantype == Span_req::START )
+           i->beam()->nplet = den_i;
+       if (i->rhythmic())
+           i->rhythmic()->plet_factor = Moment(num_i, den_i);
+       if (i->stem())
+           i->stem()->plet_factor = Moment(num_i, den_i);
     }
 }
index 430b0cf33f2ff8746672546aa32d029828282e44..d789fda2b15c92ac20d81d3703bc40d9660d5399 100644 (file)
 #include "complex-walker.hh"
 #include "commandrequest.hh"
 #include "debug.hh"
+#include "dynamic-reg.hh"
 
 static int temp_id_count;
 
 Voice_group_registers::Voice_group_registers(String id)
 {
+    add(new Dynamic_register);
     add(new Text_register);
     add(new Stem_beam_register);
     add(new Script_register);
index 0c408025012b2cf5380369419419e2c30ab4b0af..ab242065d54a45426b32e5ba94ce4ebccb9f48c3 100644 (file)
@@ -21,7 +21,7 @@
 #include "voice-group-regs.hh"
 #include "voice-regs.hh"
 #include "commandrequest.hh"
-
+#include "score-walker.hh"
 
 Walker_registers::Walker_registers(Complex_walker *w)
 {
@@ -162,11 +162,14 @@ Walker_registers::try_request(Request * r)
 Staff_info
 Walker_registers::get_staff_info() return inf;
 {
+    if (walk_l_->score_walk_l_)        // we get called ctors
+       inf.break_allowed_b_ = walk_l_->score_walk_l_->break_allowed_b();
     inf.c0_position_i_ = &walk_l_->c0_position_i_;
     inf.walk_l_ = walk_l_;
     inf.time_c_l_ = &walk_l_->time_;
     inf.rhythmic_c_l_ = walk_l_->default_grouping;
 }
+
 Paper_def*
 Walker_registers::paper()const
 {
diff --git a/m2m/.version b/m2m/.version
deleted file mode 100644 (file)
index d04b0e0..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# not currently used
-MAJOR_VERSION = 0
-MINOR_VERSION = 0
-PATCH_LEVEL = 1
-# use to send patches, always empty for released version:
-MY_PATCH_LEVEL = #
-#
diff --git a/m2m/Makefile b/m2m/Makefile
deleted file mode 100644 (file)
index 789bf17..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-#
-# project  LilyPond -- the musical typesetter
-# title           makefile for m2m
-# file    m2m/Makefile 
-#
-# Copyright (c) 1997 by
-#      Jan Nieuwenhuizen <jan@digicash.com>
-#      Han-Wen Nienhuys <hanwen@stack.nl>
-#
-
-# subdir level:
-#
-depth = ..
-#
-
-# identify module:
-#
-NAME = m2m
-MODULE_NAME = m2m
-MAJOR_VERSION = $(TOPLEVEL_MAJOR_VERSION)
-MINOR_VERSION = $(TOPLEVEL_MINOR_VERSION)
-PATCH_LEVEL = $(TOPLEVEL_PATCH_LEVEL)
-# use to send patches, always empty for released version:
-MY_PATCH_LEVEL = $(TOPLEVEL_MY_PATCH_LEVEL)
-# include ./$(depth)/m2m/.version
-build = ./$(depth)/lily/.build
-#
-
-# generic variables:
-#
-include ./$(depth)/make/Variables.make 
-#
-
-# descent order into subdirectories:
-#
-SUBDIRS = include
-#
-
-# to be remade each build:
-#
-VERSION_DEPENDENCY = $(lily-version)
-#
-
-# list of c++ header files:
-# 
-HHFILES = # $(shell ls include/*.hh)
-#
-
-# list of c++ source files:
-#
-CCFILES = $(shell ls *.cc)
-#
-
-# list of other source files:
-#
-EXTRA_SOURCE_FILES = $(shell ls *.y *.l)
-#
-
-# list of distribution files:
-#
-DISTFILES = Makefile .version $(HHFILES) $(CCFILES) $(EXTRA_SOURCE_FILES)
-#
-
-# list of custom libraries:
-#
-# yes, i know about the -L and -l options,
-# but these libraries get rebuild when needed.
-CUSTOMLIBES = $(LIBLILY) $(LIBFLOWER) 
-
-LOADLIBES +=
-#
-
-# main target of this module:
-#
-# MAINTARGET = $(EXECUTABLE)
-# MAINTARGET = $(LIBRARY)
-MAINTARGET = $(bindir)/$(EXECUTABLE)# huh?
-# MAINTARGET = $(libdir)/$(LIBRARY)# huh?
-
-default: $(MAINTARGET)
-#
-
-# generic targets and rules:
-#
-include ./$(depth)/make/Targets.make
-include ./$(depth)/make/Rules.make
-#
-
-# explicit dependencies: (how to do auto?)
-#
-midi-lexer.l:  $(outdir)/midi-parser.hh
-midi-main.cc:  check-flower-version $(lily-version)
-#
-
-# auto dependencies:
-#
--include ./$(outdir)/*.dep
-#
-
diff --git a/m2m/include/Makefile b/m2m/include/Makefile
deleted file mode 100644 (file)
index cb4f4ea..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# lib/include/Makefile
-
-# subdir level:
-#
-depth = ../..
-#
-
-# identify module:
-#
-MODULE_NAME = lilypond
-MAJOR_VERSION = $(TOPLEVEL_MAJOR_VERSION)
-MINOR_VERSION = $(TOPLEVEL_MINOR_VERSION)
-PATCH_LEVEL = $(TOPLEVEL_PATCH_LEVEL)
-# use to send patches, always empty for released version:
-MY_PATCH_LEVEL = $(TOPLEVEL_MY_PATCH_LEVEL)
-build = ./$(depth)/lily/.build
-#
-
-# generic stuff/Makefile
-#
-include ./$(depth)/make/Include.make
-#
-
diff --git a/m2m/include/midi-main.hh b/m2m/include/midi-main.hh
deleted file mode 100644 (file)
index 7392aec..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-//
-// midi-main.hh -- global (sic) m2m stuff 
-//
-// copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
-
-#ifndef MIDI_MAIN_HH
-#define MIDI_MAIN_HH
-
-#include "midi-global.hh"
-
-#endif // MIDI_MAIN_HH
-
diff --git a/m2m/midi-lexer.l b/m2m/midi-lexer.l
deleted file mode 100644 (file)
index b5ae410..0000000
+++ /dev/null
@@ -1,400 +0,0 @@
-%{
-// midi-lexer.l
-
-
-#include "m2m.hh"
-#include "midi-parser.hh"
-
-%}
-
-%option c++
-%option noyywrap
-%option nodefault
-%option yylineno
-%option debug
-%option yyclass="My_midi_lexer"
-%option stack
-
-%x data
-%x event
-%x int8
-%x int16
-%x int32
-%x meta_event
-%x track
-
-INT8           [\x00-\xff]
-INT16          {INT8}{INT8}
-INT32          {INT16}{INT16}
-INT7_8UNSET    [\x00-\x7f]
-INT7_8SET      [\x80-\xff]
-VARINT         {INT7_8SET}{0,3}{INT7_8UNSET}
-
-HEADER         MThd
-TRACK          MTrk
-
-XRUNNING_STATUS        [\x30-\x4f]
-RUNNING_STATUS [\x00-\x5f]
-DATA_ENTRY     [\x60-\x79]
-ALL_NOTES_OFF  [\x7a-\x7f]
-NOTE_OFF       [\x80-\x8f]
-NOTE_ON                [\x90-\x9f]
-POLYPHONIC_AFTERTOUCH  [\xa0-\xaf]
-CONTROLMODE_CHANGE     [\xb0-\xbf]
-PROGRAM_CHANGE [\xc0-\xcf]
-CHANNEL_AFTERTOUCH     [\xd0-\xdf]
-PITCHWHEEL_RANGE       [\xe0-\xef]
-
-SYSEX_EVENT1   [\xf0]
-SYSEX_EVENT2   [\xf7]
-
-META_EVENT     [\xff]
-
-SEQUENCE       [\x00][\x02]
-YYTEXT         [\x01] 
-YYCOPYRIGHT    [\x02]
-YYTRACK_NAME   [\x03]
-YYINSTRUMENT_NAME      [\x04]
-YYLYRIC                [\x05]
-YYMARKER               [\x06]
-YYCUE_POINT    [\x07]
-
-END_OF_TRACK   [\x2f][\x00]
-TEMPO          [\x51][\x03]
-SMPTE_OFFSET   [\x54][\x05]
-TIME           [\x58][\x04]
-KEY            [\x59][\x02]
-SSME           [\0x7f][\x03]
-
-%%
-
-{HEADER}/{INT32}       { // using /{INT32}; longer match than {INT32}
-       dtor << "lex: header" << endl;
-       yy_push_state( int16 ); 
-       yy_push_state( int16 ); 
-       yy_push_state( int16 ); 
-       yy_push_state( int32 ); 
-       return HEADER;
-}
-
-{TRACK}/{INT32}        { // using /{INT32}; longer match than {INT32}
-       dtor << "lex: track" << endl;
-       yy_push_state( track ); 
-       yy_push_state( int32 ); 
-       return TRACK;
-}
-{INT8} {
-       error( String( "top level: illegal byte: " )
-               + String_convert::bin2hex_str( String( *YYText() ) ) );
-       exit( 1 );
-}
-<int32>{INT32} {
-       dtor << "lex: int32" << endl;
-       assert( YYLeng() == 4 );
-       String str( (Byte const*)YYText(), YYLeng() );
-       yylval.i = String_convert::bin2_i( str );
-       yy_pop_state();
-       return INT32;
-}
-<int16>{INT16} {
-       dtor << "lex: int16" << endl;
-       assert( YYLeng() == 2 );
-       String str( (Byte const*)YYText(), YYLeng() );
-       yylval.i = String_convert::bin2_i( str );
-       yy_pop_state();
-       return INT16;
-}
-<int8>{INT8}   {
-       dtor << "lex: int8" << endl;
-       assert( YYLeng() == 1 );
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state(); 
-       return INT8;
-}
-
-<track>{VARINT} {
-       String str( (Byte const*)YYText(), YYLeng() );
-       yylval.i = My_midi_lexer::varint2_i( str );
-       dtor << String( "lex: track: varint(" ) 
-               + String( yylval.i ) + "): "
-               + String_convert::bin2hex_str( str ) << endl;
-       yy_push_state( event ); 
-       return VARINT;
-}
-<track>{INT8}  {
-       error( String( "track: illegal byte: " ) 
-               + String_convert::bin2hex_str( String( *YYText() ) ) );
-       exit( 1 );
-}
-<event>{RUNNING_STATUS}        {
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       dtor << String ( "lex: running status: " ) + String( yylval.i ) << endl;
-       yy_pop_state(); 
-//     yy_push_state( int8 );
-       yy_push_state( int8 );
-       return RUNNING_STATUS;
-}
-<event>{DATA_ENTRY}    {
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       dtor << String ( "lex: undefined data entry: " ) + String( yylval.i ) << endl;
-       yy_pop_state(); 
-       yy_push_state( int8 );
-       return DATA_ENTRY;
-}
-<event>{ALL_NOTES_OFF} {
-       dtor << "lex: all note off" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       dtor << String ( "lex: all notes off: " ) + String( yylval.i ) << endl;
-       yy_pop_state(); 
-       yy_push_state( int8 );
-       yy_push_state( int8 );
-       return ALL_NOTES_OFF;
-}
-<event>{NOTE_OFF}      {
-       dtor << "lex: note off" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state(); 
-       yy_push_state( int8 );
-       yy_push_state( int8 );
-       return NOTE_OFF;
-}
-<event>{NOTE_ON}       {
-       dtor << "lex: note on" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state(); 
-       yy_push_state( int8 );
-       yy_push_state( int8 );
-       return NOTE_ON;
-}
-<event>{POLYPHONIC_AFTERTOUCH} {
-       dtor << "lex: polyphonic aftertouch" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state(); 
-       yy_push_state( int8 );
-       yy_push_state( int8 );
-       return POLYPHONIC_AFTERTOUCH;
-}
-<event>{CONTROLMODE_CHANGE}    {
-       dtor << "lex: controlmode change" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state(); 
-       yy_push_state( int8 );
-       yy_push_state( int8 );
-       return CONTROLMODE_CHANGE;
-}
-<event>{PROGRAM_CHANGE}        {
-       dtor << "lex: program change" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state(); 
-       yy_push_state( int8 );
-       return PROGRAM_CHANGE;
-}
-<event>{CHANNEL_AFTERTOUCH}    {
-       dtor << "lex: channel aftertouch" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state(); 
-       yy_push_state( int8 );
-       yy_push_state( int8 );
-       return CHANNEL_AFTERTOUCH;
-}
-<event>{PITCHWHEEL_RANGE} {
-       dtor << "lex: pitchwheel range" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state(); 
-       yy_push_state( int8 );
-       yy_push_state( int8 );
-       return PITCHWHEEL_RANGE;
-}
-<event>{SYSEX_EVENT1} {        // len data
-       dtor << "lex: sysex1" << endl;
-       yy_pop_state(); 
-       yy_push_state( data );
-       return SYSEX_EVENT1;
-}
-<event>{SYSEX_EVENT2} {        // len data
-       dtor << "lex: sysex2" << endl;
-       yy_pop_state(); 
-//     yy_push_state( int8 ); //?
-       yy_push_state( data );
-       return SYSEX_EVENT2;
-}
-<event>{META_EVENT}    {
-       dtor << "lex: meta" << endl;
-       yy_push_state( meta_event );
-       return META_EVENT;
-}
-<event>{INT8}  {
-       error( String( "event: illegal byte: " ) 
-               + String_convert::bin2hex_str( String( *YYText() ) ) );
-       exit( 1 );
-}
-<meta_event>{SEQUENCE} {       // ssss sequence number
-       dtor << "lex: sequence" << endl;
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state( int16 );
-       return SEQUENCE;
-}
-<meta_event>{YYTEXT}   {               // len data
-       dtor << "lex: text" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state( data );
-       return YYTEXT;
-}
-<meta_event>{YYCOPYRIGHT}      {
-       dtor << "lex: copyright" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state( data );
-       return YYCOPYRIGHT;
-}
-<meta_event>{YYTRACK_NAME}     {
-       dtor << "lex: track name" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state( data );
-       return YYTRACK_NAME;
-}
-<meta_event>{YYINSTRUMENT_NAME}        {
-       dtor << "lex: instrument name" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state( data );
-       return YYINSTRUMENT_NAME;
-}
-<meta_event>{YYLYRIC}  {
-       dtor << "lex: lyric" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state( data );
-       return YYLYRIC;
-}
-<meta_event>{YYMARKER} {
-       dtor << "lex: marker" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state( data );
-       return YYMARKER;
-}
-<meta_event>{YYCUE_POINT}      {
-       dtor << "lex: cue point" << endl;
-//     yylval.byte = *(Byte*)YYText();
-       yylval.i = *(Byte*)YYText();
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state( data );
-       return YYCUE_POINT;
-}
-<meta_event>{TEMPO}    {       // tttttt usec
-       dtor << "lex: tempo" << endl;
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state( int8 );
-       yy_push_state( int8 );
-       yy_push_state( int8 );
-       return TEMPO;
-}
-<meta_event>{SMPTE_OFFSET}     {               // hr mn se fr ff
-       dtor << "lex: smpte offset" << endl;
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state( int8 );
-       yy_push_state( int8 );
-       yy_push_state( int8 );
-       yy_push_state( int8 );
-       yy_push_state( int8 );
-       return SMPTE_OFFSET;
-}
-<meta_event>{TIME}     {               // nn dd cc bb
-       dtor << "lex: time" << endl;
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state( int8 );
-       yy_push_state( int8 );
-       yy_push_state( int8 );
-       yy_push_state( int8 );
-       return TIME;
-}
-<meta_event>{KEY}      {       // sf mi
-       dtor << "lex: key" << endl;
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state( int8 );
-       yy_push_state( int8 );
-       return KEY;
-}
-<meta_event>{SSME}     {       // len data
-       dtor << "lex: smme" << endl;
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state( data );
-       return SSME;
-}
-<meta_event>{END_OF_TRACK} {
-       dtor << "lex: end of track" << endl;
-       yy_pop_state();
-       yy_pop_state();
-       yy_pop_state();
-       return END_OF_TRACK;
-}
-<meta_event>{INT8} {
-       warning( String( "meta_event: unimplemented event: " )
-               + String_convert::bin2hex_str( String( *YYText() ) ),
-               this->here_ch_c_l() );
-       yy_pop_state();
-       yy_pop_state();
-       yy_push_state( int8 ); 
-       yy_push_state( int8 );
-       return INT8;
-}
-
-<data>{VARINT} {
-       dtor << "lex: data" << endl;
-       String str( (Byte const*)YYText(), YYLeng() );
-       int i = My_midi_lexer::varint2_i( str );
-       String* str_p = new String;
-       while ( i-- )
-               *str_p += (char)yyinput();
-       yylval.str_p = str_p;
-       yy_pop_state();
-       return DATA;
-}
-<data>{INT8}   {
-       error( String( "data: illegal byte: " )
-               + String_convert::bin2hex_str( String( *YYText() ) ) );
-       exit( 1 );
-}
-
-<<EOF>> {
-//     mtor << "<<EOF>>";
-
-       if ( !close_i() )
-         yyterminate(); // can't move this, since it actually rets a YY_NULL
-}
-
-%%
-
diff --git a/m2m/midi-parser.y b/m2m/midi-parser.y
deleted file mode 100644 (file)
index 297b9fa..0000000
+++ /dev/null
@@ -1,296 +0,0 @@
-%{
-
-#include "m2m.hh"
-
-#ifndef NDEBUG
-#define YYDEBUG 1
-#endif
-
-%}
-
-%union {
-    Byte byte;
-    char c;
-    int i;
-    String* str_p;
-    Request* request_p;
-    Midi_event* midi_event_p;  // Voice_element* ?
-    Midi_score* midi_score_p;  // Input_score* ?
-    Midi_track* midi_track_p;  // Input_music* ?
-}
-
-%token HEADER TRACK
-%token SYSEX_EVENT1 SYSEX_EVENT2
-%token META_EVENT
-%token SEQUENCE
-%token END_OF_TRACK TEMPO SMPTE_OFFSET TIME KEY SSME
-
-%token<i> INT8 INT16 INT32 INT7_8UNSET INT7_8SET VARINT
-%token<i> RUNNING_STATUS DATA_ENTRY ALL_NOTES_OFF
-%token<i> NOTE_OFF NOTE_ON 
-%token<i> POLYPHONIC_AFTERTOUCH CONTROLMODE_CHANGE PROGRAM_CHANGE 
-%token<i> CHANNEL_AFTERTOUCH PITCHWHEEL_RANGE
-%token<i> YYTEXT YYCOPYRIGHT YYTRACK_NAME YYINSTRUMENT_NAME YYLYRIC YYMARKER YYCUE_POINT
-%token<str_p> DATA
-
-%type <i> varint
-%type <midi_score_p> header midi_score
-%type <midi_track_p> track
-%type <midi_event_p> event
-%type <midi_event_p> the_event meta_event the_meta_event text_event midi_event sysex_event
-%type <midi_event_p> running_status data_entry all_notes_off
-%type <midi_event_p> note_off note_on
-%type <midi_event_p> polyphonic_aftertouch controlmode_change program_change
-%type <midi_event_p> channel_aftertouch pitchwheel_range
-
-%%
-
-midi:  /* empty */
-       | midi midi_score {
-               midi_parser_l_g->add_score( $2 );               
-       }
-       ;
-
-midi_score:
-       header {
-       }
-       | midi_score track {
-               $$->add_track( $2 );
-               if ( midi_parser_l_g->copyright_str_.length_i() )
-                       $2->copyright_str_ = midi_parser_l_g->copyright_str_;
-               if ( midi_parser_l_g->track_name_str_.length_i() )
-                       $2->name_str_ = midi_parser_l_g->track_name_str_;
-               if ( midi_parser_l_g->instrument_str_.length_i() )
-                       $2->instrument_str_ = midi_parser_l_g->instrument_str_;
-               midi_parser_l_g->reset();
-       }
-       ;
-
-header:        
-       HEADER INT32 INT16 INT16 INT16 {
-               $$ = new Midi_score( $3, $4, $5 );
-               midi_parser_l_g->set_division_4( $5 );
-       }
-       ;
-
-track: 
-       TRACK INT32 {
-               $$ = new Midi_track( midi_parser_l_g->track_i_++,
-                       // silly, cause not set yet!
-                       midi_parser_l_g->copyright_str_,
-                       midi_parser_l_g->track_name_str_,
-                       midi_parser_l_g->instrument_str_ );
-       }
-       | track event {
-               $$->add_event( midi_parser_l_g->mom(), $2 );
-       }
-       ;
-
-event: 
-       varint the_event {
-               $$ = $2;
-               if ( $2 ) {
-                       String str = $2->mudela_str( false );
-                       if ( str.length_i() )
-                               dtor << str << " " << flush;
-               }
-       }
-       ;
-       
-varint:
-       VARINT {
-               midi_parser_l_g->forward( $1 );
-       }
-       ;
-
-the_event: 
-       meta_event { 
-       }
-       | midi_event {
-       }
-       | sysex_event {
-       }
-       ;
-
-meta_event:
-       META_EVENT the_meta_event {
-               $$ = $2;
-       }
-       |
-       META_EVENT INT8 INT8 INT8 {
-               $$ = 0;
-       }
-       ;
-
-the_meta_event:
-       SEQUENCE INT16 {
-       }
-       | text_event DATA {
-               Midi_text::Type type = (Midi_text::Type)$1;
-               $$ = 0;
-               switch ( type )
-                       {
-                       case Midi_text::COPYRIGHT:
-                               midi_parser_l_g->copyright_str_ = *$2;
-                               break;
-                       case Midi_text::TRACK_NAME:
-                               midi_parser_l_g->track_name_str_ = *$2;
-                               while ( midi_parser_l_g->track_name_str_.index_i( ' ' ) != -1 )
-                                       *(midi_parser_l_g->track_name_str_.ch_l() + midi_parser_l_g->track_name_str_.index_i( ' ' ) ) = '_';
-                               break;
-                       case Midi_text::INSTRUMENT_NAME:
-                               midi_parser_l_g->instrument_str_ = *$2;
-                               break;
-                       default:
-                               $$ = new Midi_text( type, *$2 );
-                               break;
-                       }
-               dtor << *$2 << endl;
-               delete $2;
-       }
-       | END_OF_TRACK {
-               $$ = 0;
-       }
-       | TEMPO INT8 INT8 INT8 { 
-               $$ = new Midi_tempo( ( $2 << 16 ) + ( $3 << 8 ) + $4 );
-               dtor << $$->mudela_str( false ) << endl;
-               midi_parser_l_g->set_tempo( ( $2 << 16 ) + ( $3 << 8 ) + $4 );
-       }
-       | SMPTE_OFFSET INT8 INT8 INT8 INT8 INT8 { 
-               $$ = 0;
-       }
-       | TIME INT8 INT8 INT8 INT8 { 
-               $$ = new Midi_time( $2, $3, $4, $5 );
-               dtor << $$->mudela_str( true ) << endl;
-               midi_parser_l_g->set_time( $2, $3, $4, $5 );
-       }
-       | KEY INT8 INT8 { 
-               $$ = new Midi_key( $2, $3 );
-               midi_parser_l_g->set_key( $2, $3  );
-       }
-       | SSME DATA {
-               $$ = new Midi_text( (Midi_text::Type)0, *$2 );
-               delete $2;
-       }
-       ;
-
-text_event: 
-       YYTEXT {
-               dtor << "\n% Text: ";
-       }
-       | YYCOPYRIGHT {
-               dtor << "\n% Copyright: ";
-       }
-       | YYTRACK_NAME {
-               dtor << "\n% Track  name: ";
-       }
-       | YYINSTRUMENT_NAME {
-               dtor << "\n% Instrument  name: ";
-       }
-       | YYLYRIC {
-               dtor << "\n% Lyric: ";
-       }
-       | YYMARKER {
-               dtor << "\n% Marker: ";
-       }
-       | YYCUE_POINT {
-               dtor << "\n% Cue point: ";
-       }
-       ;
-
-midi_event: 
-       running_status {
-       }
-       | data_entry {
-       }
-       | all_notes_off {
-       }
-       | note_off {
-       }
-       | note_on {
-       }
-       | polyphonic_aftertouch {
-       }
-       | controlmode_change {
-       }
-       | program_change {
-       }
-       | channel_aftertouch {
-       }
-       | pitchwheel_range {
-       }
-       ;
-
-running_status:
-       RUNNING_STATUS INT8 { //INT8 {
-               $$ = 0;
-       }
-       ;
-
-data_entry:
-       DATA_ENTRY INT8 {
-               $$ = 0;
-       }
-       ;
-
-all_notes_off:
-       ALL_NOTES_OFF INT8 INT8 {
-               $$ = 0;
-       }
-       ;
-
-note_off:
-       NOTE_OFF INT8 INT8 {
-               int i = $1;
-               i = i & ~0x80;
-               $$ = midi_parser_l_g->note_end_midi_event_p( $1 & ~0x80, $2, $3 );
-       }
-       ;
-
-note_on:
-       NOTE_ON INT8 INT8 {
-               int i = $1;
-               i = i & ~0x90;
-               $$ = 0;
-               midi_parser_l_g->note_begin( $1 & ~0x90, $2, $3 );
-       }
-       ;
-
-polyphonic_aftertouch:
-       POLYPHONIC_AFTERTOUCH INT8 INT8 {
-               $$ = 0;
-       }
-       ;
-
-controlmode_change:
-       CONTROLMODE_CHANGE INT8 INT8 {
-               $$ = 0;
-       }
-       ;
-
-program_change:
-       PROGRAM_CHANGE INT8 {
-               $$ = 0;
-       }
-       ;
-
-channel_aftertouch:
-       CHANNEL_AFTERTOUCH INT8 INT8 {
-               $$ = 0;
-       }
-       ;
-
-pitchwheel_range:
-       PITCHWHEEL_RANGE INT8 INT8 {
-               $$ = 0;
-       }
-       ;
-
-sysex_event:
-       SYSEX_EVENT1 DATA {
-               $$ = 0;
-       }
-       | SYSEX_EVENT2 DATA { // INT8 ?
-               $$ = 0;
-       }
-       ;
diff --git a/make/ACVariables.make.in b/make/ACVariables.make.in
new file mode 100644 (file)
index 0000000..3a07df7
--- /dev/null
@@ -0,0 +1,16 @@
+# -*-Makefile-*-
+
+# @AUTOHEADER@
+
+#CXXFLAGS=@CXXFLAGS@
+#CXX=@CXX@
+bindir=@bindir@
+includedir=@includedir@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+DEFS=@DEFS@
+#SET_MAKE=@SET_MAKE@
+DEFINES=@DEFINES@
+COMPILEINFO=@COMPILEINFO@
+BISON=@BISON@
+FLEX=@FLEX@
diff --git a/make/Builtin-rules.make b/make/Builtin-rules.make
new file mode 100644 (file)
index 0000000..b5fd253
--- /dev/null
@@ -0,0 +1,41 @@
+#
+# project  LilyPond -- the musical typesetter
+# title           cancel all built-in rules
+# file    make/Builtin-rules.make
+#
+# Copyright (c) 1997 by    
+#      Jan Nieuwenhuizen <jan@digicash.com>
+#      Han-Wen Nienhuys <hanwen@stack.nl>
+
+# no assembly sources
+%.o : %.s
+
+# no c sources
+%.o : %.c
+
+# not using RCS
+% :: RCS/%,v
+$(outdir)/% :: $(outdir)/RCS/%,v
+% : RCS/%,v
+$(outdir)/% : $(outdir)/RCS/%,v
+%.c : RCS/%,v
+%.cc : RCS/%,v
+%.hh : RCS/%,v
+%.make : RCS/%,v
+$(outdir)/%.dep : $(outdir)/RCS/%,v
+%.dep : RCS/%.dep,v
+$(outdir)/%.dep : $(outdir)/RCS/%.dep,v
+
+# lily knows better
+%.tab.c %.tab.h : %.y
+
+# fine suffixes:
+Makefile :
+%.cc :
+%.dep :
+$(outdir)/%.dep:
+%.hh :
+%.make :
+%.p :
+
+
index 987b1fa2642e217581aff6ceca6cb703c787d8e5..017694538f72bc292b4176b27781c3ddc3cffa25 100644 (file)
@@ -25,17 +25,17 @@ include ./$(depth)/make/Variables.make
 
 # list of c++ header files:
 # 
-HHFILES = $(shell ls *.hh)
+HHFILES = $(shell ls *.hh $(ERROR_LOG))
 #
 
 # list of c++ inline files:
 # 
-INLFILES = $(shell ls *.inl)
+INLFILES = $(shell ls *.inl $(ERROR_LOG))
 #
 
 # list of c++ template files:
 # 
-TCCFILES = $(shell ls *.tcc)
+TCCFILES = $(shell ls *.tcc $(ERROR_LOG))
 #
 
 # list of distribution files:
index 24c5cecc3a3b8d213674cd51334e7db91419f5ba..444eb661ca62f431974640232542eb7a40913c4d 100644 (file)
@@ -31,19 +31,9 @@ include ./$(depth)/make/Variables.make
 
 # ugh
 # initdefault: $(CCDIR)/parser.cc $(CCDIR)/lexer.cc hdr/version.hh alldeps
-initdefault: check-flower-version $(lily-version) dummydep
+initdefault: check-flower-version $(lily-version) check-mi2mu-version dummydep
 #      $(MAKE) -C ./$(depth)/lily $(outdir)/parser.cc
 
-# ugh!
-dummydep: 
-       touch ./$(depth)/flower/lib/$(depdir)/dummy.dep
-       touch ./$(depth)/lib/$(depdir)/dummy.dep
-       touch ./$(depth)/lily/$(depdir)/dummy.dep
-       touch ./$(depth)/m2m/$(depdir)/dummy.dep
-
-#$(DEPDIR)/%.dep:  $(CCDIR)/%.cc
-#      $(DODEP) $(CXX) -E  $(CXXFLAGS) $^ > /dev/null
-
 # generic targets and rules:
 #
 include ./$(depth)/make/Targets.make
index 2699f6140e150cb6b4c26d8594ba5565310368c9..eef8cbf3bde4d894cbb22329b7449b2d32e089a3 100644 (file)
@@ -31,7 +31,7 @@ MAKEFILES = $(shell ls *.make)
 
 # list of distribution files:
 #
-DISTFILES = Makefile $(MAKEFILES)
+DISTFILES = configure.in ACVariables.make.in Makefile lilypond.spec $(MAKEFILES)
 #
 
 # generic variables:
index 0c2a5493b281d51c145c0a6f4d449043cb46500a..6cea96f4ebd2468ff167f6963bacc05b676d0b75 100644 (file)
@@ -7,46 +7,84 @@
 #      Jan Nieuwenhuizen <jan@digicash.com>
 #      Han-Wen Nienhuys <hanwen@stack.nl>
 
+# this is supposed to clear all suffixes:
 .SUFFIXES:
+# so why does make still consider xx.y : RCS/xx.y,v ?
+# there is no suffix ,v anymore!
 .SUFFIXES: .cc .o .hh .y .l .pod .txt .1 .dep
 
+# cancel implicit rules:
+#
+# shit, how to get rid of these stupid built-in rules?
+# include ./$(depth)/make/Builtin-rules.make
+#
+
 # compile rules:
 #
-$(outdir)/%.o: %.cc
+$(outdir)/%.o: %.cc $(genout)
        $(DODEP)\
        $(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION) 
 
-$(outdir)/%.cc: %.y
+$(outdir)/%.cc: %.y $(genout)
 #      $(BISON) -d $<
        $(BISON) $<
 #      mv $(shell basename $@ .cc ).tab.h $(include-lib)/$(shell basename $@ .cc).hh
 #      mv $(shell basename $@ .cc ).tab.h $(outdir)/$(shell basename $@ .cc).hh
        mv $(shell basename $@ .cc ).tab.c $@
 
-$(outdir)/%.hh: %.y
+$(outdir)/%.hh: %.y $(genout)
        $(BISON) -d $<
        mv $(shell basename $@ .hh ).tab.h $@
        mv $(shell basename $@ .hh ).tab.c $(outdir)/$(shell basename $@ .hh).cc
 
-$(outdir)/%.cc: %.l
+$(outdir)/%.cc: %.l $(genout)
        $(FLEX)  -t $< > $@
 
 $(outdir)/%.text: $(outdir)/%.1
        groff -man -Tascii $< > $@
 
-$(outdir)/%.1: %.pod
+$(outdir)/%.1: %.pod $(genout)
        pod2man --center="LilyPond documentation" --section="0"\
                --release="LilyPond $(MAJVER).$(MINVER).$(PATCHLEVEL)" $< > $@
 #
 
+# outdirs:
+#
+# ?$(outdir)/%.dep:
+%.dep:
+       touch $@
+$(outdir):
+       mkdir $(outdir)
+       @touch $(genout)
+%/$(outdir):y
+       mkdir $@
+       @touch $(@D)/$(genout)
+$(genout):
+       mkdir $(outdir)
+       @touch $@
+%/$(genout):
+       mkdir $(@D)/$(outdir)
+       @touch $@
+#
+
+# build and config stuff: (could make this generic default rule...)
+#
+%/.build:
+       @echo 0 >$@
+$(flower-config): $(flower-dir)/$(genout)
+       touch $@
+$(lily-config): $(lib-dir)/$(genout)
+       @echo "#define LIBDIR \"./\"" >$@
+%.hh:
+       touch $@
+#
+
 # specific stuff:
 #
 $(LIBFLOWER): check-flower-version
-#      $(MAKE) -C ./$(depth)/flower/lib
        $(MAKE) ./$(outdir)/$(@F) -C $(depth)/flower/lib
 #
-$(LIBLILY): check-flower-version $(lily-version)
-#      $(MAKE) -C ./$(depth)/lib
+$(LIBLILY):
        $(MAKE) ./$(outdir)/$(@F) -C $(depth)/lib
 #
 
diff --git a/make/Site.make b/make/Site.make
deleted file mode 100644 (file)
index e69de29..0000000
index 98eea71710d52d470b8d6fb59d54764e43cb3a14..6411aa2e5a2b50dca50f7f18e5188b7f29b22630 100644 (file)
@@ -87,9 +87,9 @@ stablecc=request.cc bar.cc boxes.cc break.cc  \
        voice.cc wordwrap.cc spanner.cc 
 
 
-# m2m headers
+# mi2mu headers
 #
-mym2mhh=\
+mymi2muhh=\
  duration.hh\
  lily-stream.hh\
  midi-event.hh\
@@ -102,16 +102,16 @@ mym2mhh=\
 
 #
 
-# m2m shared headers
+# mi2mu shared headers
 #
-mym2msharedhh=\
+mymi2musharedhh=\
  binary-source-file.hh\
 
 #
 
-# m2m source
+# mi2mu source
 #
-mym2mcc=\
+mymi2mucc=\
  duration.cc\
  lily-stream.cc\
  midi-event.cc\
@@ -125,9 +125,9 @@ mym2mcc=\
 
 #
 
-# m2m shared source
+# mi2mu shared source
 #
-mym2msharedcc=\
+mymi2musharedcc=\
  binary-source-file.cc\
  inputfile.cc\
  sourcefile.cc\
index 884eef7846ed1dfd2c5c8089344f142803450c71..1b894002bcef305ed109a1306ad385158b7f12be 100644 (file)
@@ -1,13 +1,13 @@
 #
 # project  LilyPond -- the musical typesetter
-# title           generic make rules
-# file    make/Rules.make
+# title           generic make targets
+# file    make/Targets.make
 #
 # Copyright (c) 1997 by    
 #      Jan Nieuwenhuizen <jan@digicash.com>
 #      Han-Wen Nienhuys <hanwen@stack.nl>
 
-.PHONY : all clean default dist doc doc++ dummy exe help lib tags
+.PHONY : all clean config default dist doc doc++ dummy exe help lib TAGS
 
 # target all:
 #
@@ -15,6 +15,24 @@ all:  default
        for i in $(SUBDIRS); do $(MAKE) -C $$i all; done
 #
 
+# platform specific variables,
+#
+include ./$(depth)/make/out/Site.make
+#
+
+# where to do this ?
+.PRECIOUS:  $(makeout)/Site.make
+
+# ... and configure bootstrap :-)
+#
+$(makeout)/Site.make: $(make-dir)/$(genout) $(flower-config) $(lily-config)
+# this is handy, but runs on second "make distclean" too. ah well...
+#      if [ \! -d $(makeout) ]; then mkdir $(makeout); fi
+       touch $@
+       @echo "oeps, sources were not configured!"
+       (cd $(depth); ./configure)
+#
+
 # dependency list of executable:
 #
 EXECUTABLE = $(bindir)/$(NAME)
@@ -22,7 +40,7 @@ $(EXECUTABLE): $(OFILES) $(CUSTOMLIBES)
 #      $(STRIPDEBUG) $(STABLEOBS)
 #      $(LD_COMMAND) -o $@ $^ $(LOADLIBES)
        $(LD_COMMAND) $(OFILES) $(LOADLIBES)
-       touch $(VERSION_DEPENDENCY)
+       -@touch $(VERSION_DEPENDENCY) $(ERROR_LOG)
        $(INCREASE_BUILD)
        touch $(build) #waai necessary?
 #
@@ -34,7 +52,7 @@ exe: $(EXECUTABLE)
 LIBRARY = $(libdir)/$(LIB_PREFIX)$(NAME)$(LIB_SUFFIX)
 $(LIBRARY): $(OFILES) $(CUSTOMLIBES)
        $(AR_COMMAND) $(OFILES)
-       touch $(VERSION_DEPENDENCY)
+       -@touch $(VERSION_DEPENDENCY) $(ERROR_LOG)
        $(INCREASE_BUILD)
        touch $(build) #waai necessary?
 #
@@ -42,17 +60,22 @@ lib: $(LIBRARY)
 #
 
 clean:
-       rm -f $(allexe) core $(allobs) 
+       rm -f $(allexe) core $(allobs) $(alldeps)
        for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
 
 distclean: clean
-       rm -rf  $(lily-version) $(flower-version) .b $(build) .GENERATE *~ $(allout)
+       rm -rf  $(lily-version) $(flower-version) $(mi2mu-version) .b $(build) *~ $(allout) $(allgen)
 
 
 # configure:
 #
 config:
-       $(bindir)/configure
+       ./$(depth)/configure
+#
+
+# dummydeps:
+#
+dummydep: $(flower-dir)/$(genout) $(lib-dir)/$(genout) $(lily-dir)/$(genout) $(mi2mu-dir)/$(genout) $(DUMMYDEPS)
 #
 
 # value of $(OSTYPE) on windhoos; "make $OSTYPE" if you use bash :-)
@@ -76,7 +99,7 @@ help:
        @echo
        @echo "targets:"
        @echo " all clean config dist distclean doc doc++"
-       @echo " exe help lib moduledist tags"
+       @echo " exe help lib moduledist TAGS"
        @echo " dos:    xcomplile to dos"
        @echo " win32:  native cygnus-win32 compile" 
 #
@@ -110,17 +133,24 @@ localmoduledist:
        for i in $(SUBDIRS); do mkdir $(module-distdir)/$(localdir)/$$i; done
        for i in $(SUBDIRS); do $(MAKE) localdir=$(localdir)/$$i -C $$i localmoduledist; done
 
-all-tags: tags
+all-tags: TAGS
        for i in $(SUBDIRS); do $(MAKE) -C $$i all-tags; done
 
-tags:
+TAGS: $(allcc)
        etags -CT $(allcc) 
 
+# to some outdir?
+autoconf:
+       autoconf -  < configure.in > ac_configure  
+
+
 # version stuff:
 #
 check-flower-version:
        $(MAKE) flower-version -C ./$(depth)/flower
-$(lily-version): ./$(depth)/.version ./$(bindir)/make_version $(build)
+$(lily-version): $(lily-dir)/$(genout) ./$(depth)/.version ./$(bindir)/make_version $(build)
        ./$(bindir)/make_version "$(MAJOR_VERSION)" "$(MINOR_VERSION)" "$(PATCH_LEVEL)" "$(MY_PATCH_LEVEL)" "$(BUILD)" "$(CXX) $(CXXVER)" > $@
+check-mi2mu-version:
+       $(MAKE) mi2mu-version -C ./$(depth)/mi2mu
 #
 
index 016ebf008f8dc4cb1e58024e5925290c2c726c35..d40318e37e72a729b8e013470bafb73265160f88 100644 (file)
@@ -1,6 +1,6 @@
 # THIS IS A TEMPLATE FOR SUB-PROJECT MAKEFILES
 # should we make Include-dir and Stuff-dir templates too?
-
+#
 # project  LilyPond -- the musical typesetter
 # title           makefile for ...
 # file    ../Makefile 
 depth = ..
 #
 
+# generic variables:
+#
+include ./$(depth)/make/Variables.make 
+#
+
 # identify module:
 #
 NAME = ...
+MODULE_NAME = 
 # include ./$(depth)/$(NAME)/.version
 MAJOR_VERSION = 0
 MINOR_VERSION = 0
 PATCH_LEVEL = 0
 # use to send patches, always empty for released version:
 MY_PATCH_LEVEL = # include separator: "-1" or ".a"
-build = ./$(depth)/lily/.build
-#
-
-# generic variables:
-#
-include ./$(depth)/make/Variables.make 
+build = $(lily-dir)/.build
 #
 
 # descent order into subdirectories:
@@ -51,22 +52,22 @@ EXTRA_LDFLAGS =
 
 # list of c++ header files:
 # 
-HHFILES = $(shell ls *.hh)
+HHFILES = $(shell ls *.hh $(ERROR_LOG))
 #
 
 # list of c++ source files:
 #
-CCFILES = $(shell ls *.cc)
+CCFILES = $(shell ls *.cc $(ERROR_LOG))
 #
 
 # list of other source files:
 #
-EXTRA_SOURCE_FILES = $(shell ls *.y *.l)
+EXTRA_SOURCE_FILES = $(shell ls *.y *.l $(ERROR_LOG))
 #
 
 # list of distribution files:
 #
-DISTFILES = $(HHFILES) $(CCFILES) $(EXTRA_SOURCE_FILES)
+DISTFILES = Makefile $(HHFILES) $(CCFILES) $(EXTRA_SOURCE_FILES)
 #
 
 # list of custom libraries:
@@ -90,8 +91,13 @@ include ./$(depth)/make/Targets.make
 include ./$(depth)/make/Rules.make
 #
 
+# list of depend files:
+#
+DEPFILES = $(shell ls $(depdir)/*.dep $(ERROR_LOG))
+#
+
 # auto dependencies:
 #
-include ./$(outdir)/*.dep
+-include $(DEPFILES)
 #
 
index 5a8be8045468e8589d4e631774afc70b0c8bc3c4..383f6d47777d2ba69fc4cc9ce5542725303c1334 100644 (file)
@@ -26,7 +26,7 @@ DEBUGFLAG=-g
 
 # turn off -pipe if linker doesn't support it
 # 
-USER_CXXFLAGS=-pipe -Wall -W   -Wmissing-prototypes -DSTRING_UTILS_INLINED -O
+USER_CXXFLAGS=-pipe -Wall -W   -Wmissing-prototypes -DSTRING_UTILS_INLINED
 #
 
 #
index 824c16db33c80693fcb7de00e94fd8e3ec56ff75..fbfb76cfa4439fccbc86c1ed4c00e40c527ed108 100644 (file)
@@ -20,10 +20,17 @@ bindir = ./$(depth)/bin
 distdir = ./$(depth)/$(DIST_NAME)
 module-distdir = ./$(depth)/$(MODULE_DIST_NAME)
 depdir = $(outdir)
-libdir = $(outdir)
 flowerout = ./$(depth)/flower/lib/$(outdir)
 libout = ./$(depth)/lib/$(outdir)
-# flower-dir = ./$(depth)/flower
+libdir = $(outdir)
+lilyout = ./$(depth)/lily/$(outdir)
+mi2muout = ./$(depth)/mi2mu/$(outdir)
+makeout = ./$(depth)/make/$(outdir)
+flower-dir = ./$(depth)/flower/lib
+lib-dir = ./$(depth)/lib
+lily-dir = ./$(depth)/lily
+mi2mu-dir = ./$(depth)/mi2mu
+make-dir = ./$(depth)/make
 include-lib = ./$(depth)/lib/include
 include-flower = ./$(depth)/flower/lib/include
 #
@@ -80,19 +87,41 @@ OFILEY = $(OFILEL:.y=.o)
 OFILES = $(patsubst %,$(outdir)/%,$(OFILEY))
 #
 
+# dummydeps
+#
+DUMMYDEPS=\
+ $(flowerout)/dummy.dep\
+ $(libout)/dummy.dep\
+ $(lilyout)/dummy.dep\
+ $(mi2muout)/dummy.dep\
+
+#
+
 # clean file lists:
 #
-allexe = $(bindir)/lilypond $(bindir)/m2m
-allobs = $(shell find $(outdir) -name "*.o" )
-allibs = $(shell find $(libdir) -name "*.lib" )
-alldeps = $(shell find $(outdir) -name "*.dep" )
-allout = $(shell find . -name "$(outdir)" )
+ERROR_LOG = 2> /dev/null
+allexe = $(bindir)/lilypond $(bindir)/mi2mu
+allcc = $(shell find -name "*.cc" $(ERROR_LOG))
+allobs = $(shell find $(outdir) -name "*.o" $(ERROR_LOG))
+allibs = $(shell find $(libdir) -name "*.lib" $(ERROR_LOG))
+alldeps = $(shell find $(outdir) -name "*.dep" $(ERROR_LOG))
+allout = $(shell find . -name "$(outdir)" $(ERROR_LOG))
+allgen = $(shell find . -name $(genout) -o -name .build $(ERROR_LOG))
+#
+
+# config stuff:
+#
+# cannot let targets depend upon (out)directory -> will always be out of date!
+genout = .GENERATE
+flower-config = $(flowerout)/flower-config.hh
+lily-config = $(libout)/config.hh
 #
 
 # version stuff:
 #
 flower-version = $(flowerout)/fversion.hh
-lily-version = $(libout)/version.hh
+lily-version = $(lilyout)/version.hh
+mi2mu-version = $(mi2muout)/version.hh
 #
 
 # custom libraries:
diff --git a/make/configure.in b/make/configure.in
new file mode 100644 (file)
index 0000000..49cb023
--- /dev/null
@@ -0,0 +1,70 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(flower/lib/choleski.cc)
+AC_LANG_CPLUSPLUS
+
+AC_ARG_ENABLE(printing,
+       [  --enable-printing    set debug printing],
+       [DEFINES="$DEFINES -DNPRINT"])
+AC_ARG_ENABLE(checking,
+       [  --enable-checking    set debug checks],
+       [DEFINES="$DEFINES -DNDEBUG"])
+AC_ARG_ENABLE(debug,
+       [  --enable-debug       set debug info],
+       [DEFINES="$DEFINES -g"], [DEFINES="$DEFINES -O2"])
+
+dnl COMPILEINFO="$HOST $host $TARGET $target"
+AUTOHEADER="This file was automatically generated by configure"
+CXXFLAGS=""
+AC_PROG_CXX
+
+AC_SUBST(DEFINES)
+AC_SUBST(COMPILEINFO)
+AC_SUBST(AUTOHEADER)
+AC_SUBST(BISON)
+AC_SUBST(FLEX)
+
+AC_CHECK_PROGS(BISON, bison, error)
+AC_CHECK_PROGS(FLEX, flex, error)
+AC_CHECK_PROGS(MAKE, make, error)
+AC_CHECK_PROGS(PODMAN, pod2man, error)
+
+if test $MAKE = "error" 
+then
+       echo Please install GNU make
+else
+       $MAKE -v| grep -q GNU
+       if test "$?" = 1
+       then
+               AC_MSG_ERROR(Please install *GNU* make)
+       fi
+fi
+
+if test $BISON = "error" 
+then
+       AC_MSG_ERROR(can't find bison. Please install Bison (1.24 or better))
+fi
+
+if test $PODMAN = "error" 
+then
+       AC_MSG_WARN(can't find pod. You should install Perl (version 5 or better))
+fi
+
+if test $FLEX = "error" 
+then
+       AC_MSG_ERROR(can't find flex. Please install Flex (2.5 or better))
+fi
+
+if $CXX --version | grep -q '2\.7'
+then
+       true
+else
+       AC_MSG_ERROR(can't find g++ 2.7)
+fi
+
+AC_CHECK_HEADER(FlexLexer.h, true,
+       AC_MSG_ERROR(can't find flex header. Please install Flex headers correctly))
+
+
+
+AC_OUTPUT(make/out/ACVariables.make)
+dnl AC_OUTPUT(config.hh)
diff --git a/make/lilypond.spec b/make/lilypond.spec
new file mode 100644 (file)
index 0000000..f7b5056
--- /dev/null
@@ -0,0 +1,40 @@
+Description: LilyPond is a program which converts a music-script (mudela) into\
+TeX output, or MIDI to produce multi-staff scores. Feature include multiple\
+meters, clefs, keys, lyrics, versatile input-language, cadenzas\
+beams, slurs, triplets\
+multiple voices within one staff.
+Name: lilypond
+Version: 0.0.39.hwn2
+Release: 1
+Copyright: GPL
+Group: Applications/Publishing
+Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.39.hwn2.tar.gz
+Summary: A preprocessor to make TeX typeset music.
+
+%prep
+%setup
+%build
+PREFIX=/usr/lib ./configure
+make all OPTIFLAG="-O2" 
+%install
+make install
+%files
+%doc Documentation/README.txt Documentation/CodingStyle.txt
+%doc Documentation/lilygut.txt Documentation/lilyinput.txt
+%doc Documentation/error.txt Documentation/faq.txt Documentation/index.txt
+%doc Documentation/language.txt Documentation/lelie_logo.png
+/usr/bin/lilypond
+/usr/bin/mi2mu
+/usr/lib/lilypond/init/bare.ini
+/usr/lib/lilypond/init/dutch.ini
+/usr/lib/lilypond/init/english.ini
+/usr/lib/lilypond/init/script.ini
+/usr/lib/lilypond/init/swedish.ini
+/usr/lib/lilypond/init/symbol.ini
+/usr/lib/lilypond/init/table_sixteen.ini
+/usr/lib/lilypond/init/table_twenty.ini
+/usr/lib/lilypond/titledefs.tex
+/usr/lib/lilypond/lilyponddefs.tex
+
+
+
diff --git a/mi2mu/.version b/mi2mu/.version
new file mode 100644 (file)
index 0000000..1726cf2
--- /dev/null
@@ -0,0 +1,6 @@
+MAJOR_VERSION = 0
+MINOR_VERSION = 0
+PATCH_LEVEL = 2
+# use to send patches, always empty for released version:
+MY_PATCH_LEVEL = # include separator: "-1" or ".a"
+#
diff --git a/mi2mu/Makefile b/mi2mu/Makefile
new file mode 100644 (file)
index 0000000..372695f
--- /dev/null
@@ -0,0 +1,106 @@
+#
+# project  LilyPond -- the musical typesetter
+# title           makefile for mi2mu
+# file    mi2mu/Makefile 
+#
+# Copyright (c) 1997 by
+#      Jan Nieuwenhuizen <jan@digicash.com>
+#      Han-Wen Nienhuys <hanwen@stack.nl>
+#
+
+# subdir level:
+#
+depth = ..
+#
+
+# generic variables:
+#
+include ./$(depth)/make/Variables.make 
+#
+
+# identify module:
+#
+NAME = mi2mu
+MODULE_NAME = mi2mu
+include $(mi2mu-dir)/.version
+build = $(mi2mu-dir)/.build
+#
+
+# descent order into subdirectories:
+#
+SUBDIRS = include
+#
+
+# to be remade each build:
+#
+VERSION_DEPENDENCY = $(mi2mu-version)
+#
+
+# list of c++ header files:
+# 
+HHFILES = $(shell ls *.hh $(ERROR_LOG))
+#
+
+# list of c++ source files:
+#
+CCFILES = $(shell ls *.cc $(ERROR_LOG))
+#
+
+# list of other source files:
+#
+EXTRA_SOURCE_FILES = $(shell ls *.y *.l $(ERROR_LOG))
+#
+
+# list of distribution files:
+#
+DISTFILES = Makefile .version $(HHFILES) $(CCFILES) $(EXTRA_SOURCE_FILES)
+#
+
+# list of custom libraries:
+#
+# yes, i know about the -L and -l options,
+# but these libraries get rebuild when needed.
+CUSTOMLIBES = $(LIBLILY) $(LIBFLOWER) 
+
+LOADLIBES +=
+#
+
+# main target of this module:
+#
+# MAINTARGET = $(EXECUTABLE)
+# MAINTARGET = $(LIBRARY)
+MAINTARGET = $(bindir)/$(EXECUTABLE)# huh?
+# MAINTARGET = $(libdir)/$(LIBRARY)# huh?
+
+default: $(MAINTARGET)
+#
+
+# generic targets and rules:
+#
+include ./$(depth)/make/Targets.make
+include ./$(depth)/make/Rules.make
+#
+
+# explicit dependencies: (how to do auto?)
+#
+midi-lexer.l:  $(outdir)/midi-parser.hh
+version.cc:    check-flower-version $(mi2mu-version)
+#
+
+# version:
+#
+mi2mu-version: $(mi2mu-dir)/$(genout) $(mi2mu-version)
+$(mi2mu-version): $(mi2mu-dir)/$(genout) $(mi2mu-dir)/.version ./$(bindir)/make_version $(build)
+       ./$(bindir)/make_version "$(MAJOR_VERSION)" "$(MINOR_VERSION)" "$(PATCH_LEVEL)" "$(MY_PATCH_LEVEL)" "$(BUILD)" "$(CXX) $(CXXVER)" > $@
+#
+
+# list of depend files:
+#
+DEPFILES = $(shell ls $(depdir)/*.dep $(ERROR_LOG))
+#
+
+# auto dependencies:
+#
+-include $(DEPFILES)
+#
+
diff --git a/mi2mu/include/Makefile b/mi2mu/include/Makefile
new file mode 100644 (file)
index 0000000..cb4f4ea
--- /dev/null
@@ -0,0 +1,23 @@
+# lib/include/Makefile
+
+# subdir level:
+#
+depth = ../..
+#
+
+# identify module:
+#
+MODULE_NAME = lilypond
+MAJOR_VERSION = $(TOPLEVEL_MAJOR_VERSION)
+MINOR_VERSION = $(TOPLEVEL_MINOR_VERSION)
+PATCH_LEVEL = $(TOPLEVEL_PATCH_LEVEL)
+# use to send patches, always empty for released version:
+MY_PATCH_LEVEL = $(TOPLEVEL_MY_PATCH_LEVEL)
+build = ./$(depth)/lily/.build
+#
+
+# generic stuff/Makefile
+#
+include ./$(depth)/make/Include.make
+#
+
diff --git a/mi2mu/midi-lexer.l b/mi2mu/midi-lexer.l
new file mode 100644 (file)
index 0000000..f832587
--- /dev/null
@@ -0,0 +1,410 @@
+%{
+// midi-lexer.l
+
+
+#include "mi2mu.hh"
+#include "midi-parser.hh"
+
+%}
+
+%option c++
+%option noyywrap
+%option nodefault
+%option yylineno
+%option debug
+%option yyclass="My_midi_lexer"
+%option stack
+
+%x data
+%x event
+%x i8
+%x u8
+%x int16
+%x int32
+%x meta_event
+%x track
+
+U8             [\x00-\xff]
+I8             {U8}
+INT16          {U8}{U8}
+INT32          {INT16}{INT16}
+INT7_8UNSET    [\x00-\x7f]
+INT7_8SET      [\x80-\xff]
+VARINT         {INT7_8SET}{0,3}{INT7_8UNSET}
+
+HEADER         MThd
+TRACK          MTrk
+
+XRUNNING_STATUS        [\x30-\x4f]
+RUNNING_STATUS [\x00-\x5f]
+DATA_ENTRY     [\x60-\x79]
+ALL_NOTES_OFF  [\x7a-\x7f]
+NOTE_OFF       [\x80-\x8f]
+NOTE_ON                [\x90-\x9f]
+POLYPHONIC_AFTERTOUCH  [\xa0-\xaf]
+CONTROLMODE_CHANGE     [\xb0-\xbf]
+PROGRAM_CHANGE [\xc0-\xcf]
+CHANNEL_AFTERTOUCH     [\xd0-\xdf]
+PITCHWHEEL_RANGE       [\xe0-\xef]
+
+SYSEX_EVENT1   [\xf0]
+SYSEX_EVENT2   [\xf7]
+
+META_EVENT     [\xff]
+
+SEQUENCE       [\x00][\x02]
+YYTEXT         [\x01] 
+YYCOPYRIGHT    [\x02]
+YYTRACK_NAME   [\x03]
+YYINSTRUMENT_NAME      [\x04]
+YYLYRIC                [\x05]
+YYMARKER               [\x06]
+YYCUE_POINT    [\x07]
+
+END_OF_TRACK   [\x2f][\x00]
+TEMPO          [\x51][\x03]
+SMPTE_OFFSET   [\x54][\x05]
+TIME           [\x58][\x04]
+KEY            [\x59][\x02]
+SSME           [\0x7f][\x03]
+
+%%
+
+{HEADER}/{INT32}       { // using /{INT32}; longer match than {INT32}
+       dtor << "lex: header" << endl;
+       yy_push_state( int16 ); 
+       yy_push_state( int16 ); 
+       yy_push_state( int16 ); 
+       yy_push_state( int32 ); 
+       return HEADER;
+}
+
+{TRACK}/{INT32}        { // using /{INT32}; longer match than {INT32}
+       dtor << "lex: track" << endl;
+       yy_push_state( track ); 
+       yy_push_state( int32 ); 
+       return TRACK;
+}
+{U8}   {
+       error( String( "top level: illegal byte: " )
+               + String_convert::bin2hex_str( String( *YYText() ) ) );
+       exit( 1 );
+}
+<int32>{INT32} { // really signed? 
+       dtor << "lex: int32" << endl;
+       assert( YYLeng() == 4 );
+       String str( (Byte const*)YYText(), YYLeng() );
+       yylval.i = String_convert::bin2_i( str );
+       yy_pop_state();
+       return INT32;
+}
+<int16>{INT16} { // really signed?
+       dtor << "lex: int16" << endl;
+       assert( YYLeng() == 2 );
+       String str( (Byte const*)YYText(), YYLeng() );
+       yylval.i = String_convert::bin2_i( str );
+       yy_pop_state();
+       return INT16;
+}
+<i8>{I8}       {
+       dtor << "lex: i8" << endl;
+       assert( YYLeng() == 1 );
+//     yylval.byte = *(signed char*)YYText();
+       yylval.i = *(signed char*)YYText();
+       yy_pop_state(); 
+       return I8;
+}
+<u8>{U8}       {
+       dtor << "lex: u8" << endl;
+       assert( YYLeng() == 1 );
+//     yylval.byte = *(Byte*)YYText();
+       yylval.i = *(Byte*)YYText();
+       yy_pop_state(); 
+       return U8;
+}
+
+<track>{VARINT} {
+       String str( (Byte const*)YYText(), YYLeng() );
+       yylval.i = My_midi_lexer::varint2_i( str );
+       dtor << String( "lex: track: varint(" ) 
+               + String( yylval.i ) + "): "
+               + String_convert::bin2hex_str( str ) << endl;
+       yy_push_state( event ); 
+       return VARINT;
+}
+<track>{U8}    {
+       error( String( "track: illegal byte: " ) 
+               + String_convert::bin2hex_str( String( *YYText() ) ) );
+       exit( 1 );
+}
+<event>{RUNNING_STATUS}        {
+//     yylval.byte = *(Byte*)YYText();
+       yylval.i = *(Byte*)YYText();
+       dtor << String ( "lex: running status: " ) + String( yylval.i ) << endl;
+       yy_pop_state(); 
+//     yy_push_state( u8 );
+       yy_push_state( u8 );
+       return RUNNING_STATUS;
+}
+<event>{DATA_ENTRY}    {
+//     yylval.byte = *(Byte*)YYText();
+       yylval.i = *(Byte*)YYText();
+       dtor << String ( "lex: undefined data entry: " ) + String( yylval.i ) << endl;
+       yy_pop_state(); 
+       yy_push_state( u8 );
+       return DATA_ENTRY;
+}
+<event>{ALL_NOTES_OFF} {
+       dtor << "lex: all note off" << endl;
+//     yylval.byte = *(Byte*)YYText();
+       yylval.i = *(Byte*)YYText();
+       dtor << String ( "lex: all notes off: " ) + String( yylval.i ) << endl;
+       yy_pop_state(); 
+       yy_push_state( u8 );
+       yy_push_state( u8 );
+       return ALL_NOTES_OFF;
+}
+<event>{NOTE_OFF}      {
+       dtor << "lex: note off" << endl;
+//     yylval.byte = *(Byte*)YYText();
+       yylval.i = *(Byte*)YYText();
+       yy_pop_state(); 
+       yy_push_state( u8 );
+       yy_push_state( u8 );
+       return NOTE_OFF;
+}
+<event>{NOTE_ON}       {
+       dtor << "lex: note on" << endl;
+//     yylval.byte = *(Byte*)YYText();
+       yylval.i = *(Byte*)YYText();
+       yy_pop_state(); 
+       yy_push_state( u8 );
+       yy_push_state( u8 );
+       return NOTE_ON;
+}
+<event>{POLYPHONIC_AFTERTOUCH} {
+       dtor << "lex: polyphonic aftertouch" << endl;
+//     yylval.byte = *(Byte*)YYText();
+       yylval.i = *(Byte*)YYText();
+       yy_pop_state(); 
+       yy_push_state( u8 );
+       yy_push_state( u8 );
+       return POLYPHONIC_AFTERTOUCH;
+}
+<event>{CONTROLMODE_CHANGE}    {
+       dtor << "lex: controlmode change" << endl;
+//     yylval.byte = *(Byte*)YYText();
+       yylval.i = *(Byte*)YYText();
+       yy_pop_state(); 
+       yy_push_state( u8 );
+       yy_push_state( u8 );
+       return CONTROLMODE_CHANGE;
+}
+<event>{PROGRAM_CHANGE}        {
+       dtor << "lex: program change" << endl;
+//     yylval.byte = *(Byte*)YYText();
+       yylval.i = *(Byte*)YYText();
+       yy_pop_state(); 
+       yy_push_state( u8 );
+       return PROGRAM_CHANGE;
+}
+<event>{CHANNEL_AFTERTOUCH}    {
+       dtor << "lex: channel aftertouch" << endl;
+//     yylval.byte = *(Byte*)YYText();
+       yylval.i = *(Byte*)YYText();
+       yy_pop_state(); 
+       yy_push_state( u8 );
+       yy_push_state( u8 );
+       return CHANNEL_AFTERTOUCH;
+}
+<event>{PITCHWHEEL_RANGE} {
+       dtor << "lex: pitchwheel range" << endl;
+//     yylval.byte = *(Byte*)YYText();
+       yylval.i = *(Byte*)YYText();
+       yy_pop_state(); 
+       yy_push_state( u8 );
+       yy_push_state( u8 );
+       return PITCHWHEEL_RANGE;
+}
+<event>{SYSEX_EVENT1} {        // len data
+       dtor << "lex: sysex1" << endl;
+       yy_pop_state(); 
+       yy_push_state( data );
+       return SYSEX_EVENT1;
+}
+<event>{SYSEX_EVENT2} {        // len data
+       dtor << "lex: sysex2" << endl;
+       yy_pop_state(); 
+//     yy_push_state( u8 ); //?
+       yy_push_state( data );
+       return SYSEX_EVENT2;
+}
+<event>{META_EVENT}    {
+       dtor << "lex: meta" << endl;
+       yy_push_state( meta_event );
+       return META_EVENT;
+}
+<event>{U8}    {
+       error( String( "event: illegal byte: " ) 
+               + String_convert::bin2hex_str( String( *YYText() ) ) );
+       exit( 1 );
+}
+<meta_event>{SEQUENCE} {       // ssss sequence number
+       dtor << "lex: sequence" << endl;
+       yy_pop_state();
+       yy_pop_state();
+       yy_push_state( int16 );
+       return SEQUENCE;
+}
+<meta_event>{YYTEXT}   {               // len data
+       dtor << "lex: text" << endl;
+//     yylval.byte = *(Byte*)YYText();
+       yylval.i = *(Byte*)YYText();
+       yy_pop_state();
+       yy_pop_state();
+       yy_push_state( data );
+       return YYTEXT;
+}
+<meta_event>{YYCOPYRIGHT}      {
+       dtor << "lex: copyright" << endl;
+//     yylval.byte = *(Byte*)YYText();
+       yylval.i = *(Byte*)YYText();
+       yy_pop_state();
+       yy_pop_state();
+       yy_push_state( data );
+       return YYCOPYRIGHT;
+}
+<meta_event>{YYTRACK_NAME}     {
+       dtor << "lex: track name" << endl;
+//     yylval.byte = *(Byte*)YYText();
+       yylval.i = *(Byte*)YYText();
+       yy_pop_state();
+       yy_pop_state();
+       yy_push_state( data );
+       return YYTRACK_NAME;
+}
+<meta_event>{YYINSTRUMENT_NAME}        {
+       dtor << "lex: instrument name" << endl;
+//     yylval.byte = *(Byte*)YYText();
+       yylval.i = *(Byte*)YYText();
+       yy_pop_state();
+       yy_pop_state();
+       yy_push_state( data );
+       return YYINSTRUMENT_NAME;
+}
+<meta_event>{YYLYRIC}  {
+       dtor << "lex: lyric" << endl;
+//     yylval.byte = *(Byte*)YYText();
+       yylval.i = *(Byte*)YYText();
+       yy_pop_state();
+       yy_pop_state();
+       yy_push_state( data );
+       return YYLYRIC;
+}
+<meta_event>{YYMARKER} {
+       dtor << "lex: marker" << endl;
+//     yylval.byte = *(Byte*)YYText();
+       yylval.i = *(Byte*)YYText();
+       yy_pop_state();
+       yy_pop_state();
+       yy_push_state( data );
+       return YYMARKER;
+}
+<meta_event>{YYCUE_POINT}      {
+       dtor << "lex: cue point" << endl;
+//     yylval.byte = *(Byte*)YYText();
+       yylval.i = *(Byte*)YYText();
+       yy_pop_state();
+       yy_pop_state();
+       yy_push_state( data );
+       return YYCUE_POINT;
+}
+<meta_event>{TEMPO}    {       // tttttt usec
+       dtor << "lex: tempo" << endl;
+       yy_pop_state();
+       yy_pop_state();
+       yy_push_state( u8 );
+       yy_push_state( u8 );
+       yy_push_state( u8 );
+       return TEMPO;
+}
+<meta_event>{SMPTE_OFFSET}     {               // hr mn se fr ff
+       dtor << "lex: smpte offset" << endl;
+       yy_pop_state();
+       yy_pop_state();
+       yy_push_state( u8 );
+       yy_push_state( u8 );
+       yy_push_state( u8 );
+       yy_push_state( u8 );
+       yy_push_state( u8 );
+       return SMPTE_OFFSET;
+}
+<meta_event>{TIME}     {               // nn dd cc bb
+       dtor << "lex: time" << endl;
+       yy_pop_state();
+       yy_pop_state();
+       yy_push_state( u8 );
+       yy_push_state( u8 );
+       yy_push_state( u8 );
+       yy_push_state( u8 );
+       return TIME;
+}
+<meta_event>{KEY}      {       // sf mi
+       dtor << "lex: key" << endl;
+       yy_pop_state();
+       yy_pop_state();
+       yy_push_state( i8 );
+       yy_push_state( i8 );
+       return KEY;
+}
+<meta_event>{SSME}     {       // len data
+       dtor << "lex: smme" << endl;
+       yy_pop_state();
+       yy_pop_state();
+       yy_push_state( data );
+       return SSME;
+}
+<meta_event>{END_OF_TRACK} {
+       dtor << "lex: end of track" << endl;
+       yy_pop_state();
+       yy_pop_state();
+       yy_pop_state();
+       return END_OF_TRACK;
+}
+<meta_event>{U8} {
+       warning( String( "meta_event: unimplemented event: " )
+               + String_convert::bin2hex_str( String( *YYText() ) ),
+               this->here_ch_c_l() );
+       yy_pop_state();
+       yy_pop_state();
+       yy_push_state( u8 ); 
+       yy_push_state( u8 );
+       return U8;
+}
+
+<data>{VARINT} {
+       dtor << "lex: data" << endl;
+       String str( (Byte const*)YYText(), YYLeng() );
+       int i = My_midi_lexer::varint2_i( str );
+       String* str_p = new String;
+       while ( i-- )
+               *str_p += (char)yyinput();
+       yylval.str_p = str_p;
+       yy_pop_state();
+       return DATA;
+}
+<data>{U8}     {
+       error( String( "data: illegal byte: " )
+               + String_convert::bin2hex_str( String( *YYText() ) ) );
+       exit( 1 );
+}
+
+<<EOF>> {
+//     mtor << "<<EOF>>";
+
+       if ( !close_i() )
+         yyterminate(); // can't move this, since it actually rets a YY_NULL
+}
+
+%%
+
diff --git a/mi2mu/midi-parser.y b/mi2mu/midi-parser.y
new file mode 100644 (file)
index 0000000..e8bb5e9
--- /dev/null
@@ -0,0 +1,303 @@
+%{
+
+#include "mi2mu.hh"
+
+#ifndef NDEBUG
+#define YYDEBUG 1
+#endif
+
+%}
+
+%union {
+    Byte byte;
+    char c;
+    int i;
+    String* str_p;
+    Request* request_p;
+    Midi_event* midi_event_p;  // Voice_element* ?
+    Midi_score* midi_score_p;  // Input_score* ?
+    Midi_track* midi_track_p;  // Input_music* ?
+}
+
+%token HEADER TRACK
+%token SYSEX_EVENT1 SYSEX_EVENT2
+%token META_EVENT
+%token SEQUENCE
+%token END_OF_TRACK TEMPO SMPTE_OFFSET TIME KEY SSME
+
+%token<i> I8 U8 INT16 INT32 INT7_8UNSET INT7_8SET VARINT
+%token<i> RUNNING_STATUS DATA_ENTRY ALL_NOTES_OFF
+%token<i> NOTE_OFF NOTE_ON 
+%token<i> POLYPHONIC_AFTERTOUCH CONTROLMODE_CHANGE PROGRAM_CHANGE 
+%token<i> CHANNEL_AFTERTOUCH PITCHWHEEL_RANGE
+%token<i> YYTEXT YYCOPYRIGHT YYTRACK_NAME YYINSTRUMENT_NAME YYLYRIC YYMARKER YYCUE_POINT
+%token<str_p> DATA
+
+%type <i> varint
+%type <midi_score_p> header midi_score
+%type <midi_track_p> track
+%type <midi_event_p> event
+%type <midi_event_p> the_event meta_event the_meta_event text_event midi_event sysex_event
+%type <midi_event_p> running_status data_entry all_notes_off
+%type <midi_event_p> note_off note_on
+%type <midi_event_p> polyphonic_aftertouch controlmode_change program_change
+%type <midi_event_p> channel_aftertouch pitchwheel_range
+
+%%
+
+midi:  /* empty */
+       | midi midi_score {
+               midi_parser_l_g->add_score( $2 );               
+       }
+       ;
+
+midi_score:
+       header {
+       }
+       | midi_score track {
+               $$->add_track( $2 );
+               if ( midi_parser_l_g->copyright_str_.length_i() )
+                       $2->copyright_str_ = midi_parser_l_g->copyright_str_;
+               if ( midi_parser_l_g->track_name_str_.length_i() )
+                       $2->name_str_ = midi_parser_l_g->track_name_str_;
+               if ( midi_parser_l_g->instrument_str_.length_i() )
+                       $2->instrument_str_ = midi_parser_l_g->instrument_str_;
+               midi_parser_l_g->reset();
+       }
+       ;
+
+header:        
+       HEADER INT32 INT16 INT16 INT16 {
+               $$ = new Midi_score( $3, $4, $5 );
+               midi_parser_l_g->set_division_4( $5 );
+       }
+       ;
+
+track: 
+       TRACK INT32 {
+               mtor << "\ntrack " << midi_parser_l_g->track_i_++ << ": " << flush;
+               $$ = new Midi_track( midi_parser_l_g->track_i_++,
+                       // silly, cause not set yet!
+                       midi_parser_l_g->copyright_str_,
+                       midi_parser_l_g->track_name_str_,
+                       midi_parser_l_g->instrument_str_ );
+       }
+       | track event {
+               $$->add_event( midi_parser_l_g->mom(), $2 );
+       }
+       ;
+
+event: 
+       varint the_event {
+               $$ = $2;
+               if ( $2 ) {
+                       String str = $2->mudela_str( false );
+                       if ( str.length_i() )
+                               dtor << str << " " << flush;
+               }
+       }
+       ;
+       
+varint:
+       VARINT {
+               midi_parser_l_g->forward( $1 );
+               if ( $1 ) {
+                       int bars_i = (int)( midi_parser_l_g->mom() / midi_parser_l_g->midi_time_p_->bar_mom() );
+                       if ( bars_i > midi_parser_l_g->bar_i_ )
+                               mtor << '[' << midi_parser_l_g->bar_i_++ 
+                                       << ']' << flush; 
+               }
+       }
+       ;
+
+the_event: 
+       meta_event { 
+       }
+       | midi_event {
+       }
+       | sysex_event {
+       }
+       ;
+
+meta_event:
+       META_EVENT the_meta_event {
+               $$ = $2;
+       }
+       |
+       META_EVENT U8 U8 U8 {
+               $$ = 0;
+       }
+       ;
+
+the_meta_event:
+       SEQUENCE INT16 {
+       }
+       | text_event DATA {
+               Midi_text::Type type = (Midi_text::Type)$1;
+               $$ = 0;
+               switch ( type )
+                       {
+                       case Midi_text::COPYRIGHT:
+                               midi_parser_l_g->copyright_str_ = *$2;
+                               break;
+                       case Midi_text::TRACK_NAME:
+                               midi_parser_l_g->track_name_str_ = *$2;
+                               while ( midi_parser_l_g->track_name_str_.index_i( ' ' ) != -1 )
+                                       *(midi_parser_l_g->track_name_str_.ch_l() + midi_parser_l_g->track_name_str_.index_i( ' ' ) ) = '_';
+                               break;
+                       case Midi_text::INSTRUMENT_NAME:
+                               midi_parser_l_g->instrument_str_ = *$2;
+                               break;
+                       default:
+                               $$ = new Midi_text( type, *$2 );
+                               break;
+                       }
+               dtor << *$2 << endl;
+               delete $2;
+       }
+       | END_OF_TRACK {
+               $$ = 0;
+       }
+       | TEMPO U8 U8 U8 { 
+               $$ = new Midi_tempo( ( $2 << 16 ) + ( $3 << 8 ) + $4 );
+               dtor << $$->mudela_str( false ) << endl;
+               midi_parser_l_g->set_tempo( ( $2 << 16 ) + ( $3 << 8 ) + $4 );
+       }
+       | SMPTE_OFFSET U8 U8 U8 U8 U8 { 
+               $$ = 0;
+       }
+       | TIME U8 U8 U8 U8 { 
+               $$ = new Midi_time( $2, $3, $4, $5 );
+               dtor << $$->mudela_str( true ) << endl;
+               midi_parser_l_g->set_time( $2, $3, $4, $5 );
+       }
+       | KEY I8 I8 { 
+               $$ = new Midi_key( $2, $3 );
+               midi_parser_l_g->set_key( $2, $3  );
+       }
+       | SSME DATA {
+               $$ = new Midi_text( (Midi_text::Type)0, *$2 );
+               delete $2;
+       }
+       ;
+
+text_event: 
+       YYTEXT {
+               dtor << "\n% Text: ";
+       }
+       | YYCOPYRIGHT {
+               dtor << "\n% Copyright: ";
+       }
+       | YYTRACK_NAME {
+               dtor << "\n% Track  name: ";
+       }
+       | YYINSTRUMENT_NAME {
+               dtor << "\n% Instrument  name: ";
+       }
+       | YYLYRIC {
+               dtor << "\n% Lyric: ";
+       }
+       | YYMARKER {
+               dtor << "\n% Marker: ";
+       }
+       | YYCUE_POINT {
+               dtor << "\n% Cue point: ";
+       }
+       ;
+
+midi_event: 
+       running_status {
+       }
+       | data_entry {
+       }
+       | all_notes_off {
+       }
+       | note_off {
+       }
+       | note_on {
+       }
+       | polyphonic_aftertouch {
+       }
+       | controlmode_change {
+       }
+       | program_change {
+       }
+       | channel_aftertouch {
+       }
+       | pitchwheel_range {
+       }
+       ;
+
+running_status:
+       RUNNING_STATUS U8 { //U8 {
+               $$ = 0;
+       }
+       ;
+
+data_entry:
+       DATA_ENTRY U8 {
+               $$ = 0;
+       }
+       ;
+
+all_notes_off:
+       ALL_NOTES_OFF U8 U8 {
+               $$ = 0;
+       }
+       ;
+
+note_off:
+       NOTE_OFF U8 U8 {
+               int i = $1;
+               i = i & ~0x80;
+               $$ = midi_parser_l_g->note_end_midi_event_p( $1 & ~0x80, $2, $3 );
+       }
+       ;
+
+note_on:
+       NOTE_ON U8 U8 {
+               int i = $1;
+               i = i & ~0x90;
+               $$ = 0;
+               midi_parser_l_g->note_begin( $1 & ~0x90, $2, $3 );
+       }
+       ;
+
+polyphonic_aftertouch:
+       POLYPHONIC_AFTERTOUCH U8 U8 {
+               $$ = 0;
+       }
+       ;
+
+controlmode_change:
+       CONTROLMODE_CHANGE U8 U8 {
+               $$ = 0;
+       }
+       ;
+
+program_change:
+       PROGRAM_CHANGE U8 {
+               $$ = 0;
+       }
+       ;
+
+channel_aftertouch:
+       CHANNEL_AFTERTOUCH U8 U8 {
+               $$ = 0;
+       }
+       ;
+
+pitchwheel_range:
+       PITCHWHEEL_RANGE U8 U8 {
+               $$ = 0;
+       }
+       ;
+
+sysex_event:
+       SYSEX_EVENT1 DATA {
+               $$ = 0;
+       }
+       | SYSEX_EVENT2 DATA { // U8 ?
+               $$ = 0;
+       }
+       ;
index 586aabb88d36355106f7e00f754d9f8e0f2227a8..2237f638066816e15026d8f63f64ec630e1f6993 100644 (file)
 \def\dynf{f\kern-.1ex}
 \def\dynm{f\kern-.15ex}
 \def\dynp{p\kern-.15ex}
-\def\ppp{\dynfont\dynp\dynp p}
-\def\pp{\dynfont\dynp p}
-\def\p{\dynfont p}
-\def\mp{\dynfont\dynm p}
-\def\mf{\dynfont\dynm f}
-\def\f{\dynfont f}
-\def\ff{\dynfont\dynf f}
-\def\fff{\dynfont\dynf\dynf f}
+
+\def\dynppp{\dynfont\dynp\dynp p}
+\def\dynpp{\dynfont\dynp p}
+\def\dynp{\dynfont p}
+\def\dynmp{\dynfont\dynm p}
+\def\dynmf{\dynfont\dynm f}
+\def\dynf{\dynfont f}
+\def\dynff{\dynfont\dynf f}
+\def\dynfff{\dynfont\dynf\dynf f}
 
 \def\slurcharh#1{{\slurhfont\char#1}}
 \def\slurcharu#1{{\slurufont\char#1}}
 \def\decrescendosym#1{\count0=116\advance\count0 by #1}
 \def\settext#1{\textfont #1}
 \def\setitalic#1{\italicfont #1}
+\def\setdynamic#1{\dynfont #1}