]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 0.0.56 release/0.0.56
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 24 Apr 1997 13:32:05 +0000 (15:32 +0200)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 24 Apr 1997 13:32:05 +0000 (15:32 +0200)
60 files changed:
.version
ANNOUNCE
AUTHORS.text
Documentation/CodingStyle.pod
Documentation/faq.pod
Documentation/language.pod
INSTALL.text
NEWS
README
TODO
bin/convert-mudela
bin/release
input/martien.ly
input/mlvio2.ly
input/scsii-menuetto.ly
input/standchen.ly
input/twinkle.ly
lily/beam.cc
lily/collision.cc
lily/head-reg.cc
lily/include/collision.hh
lily/include/lily-proto.hh
lily/include/note-column-reg.hh
lily/include/note-column.hh
lily/include/notehead.hh
lily/include/rest-collision-reg.hh [new file with mode: 0644]
lily/include/rest-collision.hh [new file with mode: 0644]
lily/include/rest-column.hh [new file with mode: 0644]
lily/include/script-column.hh [new file with mode: 0644]
lily/include/staff-elem.hh
lily/include/stem.hh
lily/include/voice-element.hh
lily/input-register.cc
lily/midi-item.cc
lily/midi-walker.cc
lily/my-lily-parser.cc
lily/note-column-reg.cc
lily/note-column.cc
lily/notehead.cc
lily/parser.y
lily/pulk-voice.cc
lily/register.cc
lily/rest-collision-reg.cc [new file with mode: 0644]
lily/rest-collision.cc [new file with mode: 0644]
lily/rest-column.cc [new file with mode: 0644]
lily/script-column.cc [new file with mode: 0644]
lily/script-reg.cc
lily/slur.cc
lily/staff-elem.cc
lily/staff-regs.cc
lily/staff-side.cc
lily/stem-beam-reg.cc
lily/stem.cc
lily/symbol.cc
lily/voice-element.cc
lily/walk-regs.cc
make/Rules.make
make/Targets.make
make/lilypond.lsm
make/lilypond.spec

index aa37e9bbac3f271a915efd0c07c8127c96a3114f..632e299ef8875080f14d33d0388d84bce2466c79 100644 (file)
--- a/.version
+++ b/.version
@@ -1,7 +1,7 @@
 TOPLEVEL_MAJOR_VERSION = 0
 TOPLEVEL_MINOR_VERSION = 0
-TOPLEVEL_PATCH_LEVEL = 55
+TOPLEVEL_PATCH_LEVEL = 56
 # use to send patches, always empty for released version:
 # include separator: ".postfix", "-pl" makes rpm barf
 
-TOPLEVEL_MY_PATCH_LEVEL =
+TOPLEVEL_MY_PATCH_LEVEL = 
index 5e446d8f0ff517f41d83514a4c355ddc77e06b26..42e9686124d1204fb631a6ca4b1f9e0829389b32 100644 (file)
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -74,7 +74,7 @@ dynamics (both absolute and hairpin style) clef changes, meter
 changes, cadenza-mode, key changes, repeat bars
 
 
-[Kudos to FSF, all linux hackers, and --of course-- especially
+[Kudos to the FSF, all linux hackers, and --of course-- especially
 GrandMaster Linus T, for the OS and The Announce :-]
 
        Han-Wen Nienhuys <hanwen@stack.nl>
index fd9add63fcf8ed37495c7261354d658b5028b452..76413dec6fbc2d3ea8d523a80daff3ae75a22808 100644 (file)
@@ -61,6 +61,6 @@ D\bD\bD\bDE\bE\bE\bES\bS\bS\bSC\bC\bC\bCR\bR\bR\bRI\bI\bI\bIP\bP\bP\bPT\bT\bT\bTI\bI\bI\bIO\bO\bO\bON\bN\bN\bN
 
 
 
-19/Apr/97                LilyPond 0.0.53                        1
+19/Apr/97                LilyPond 0.0.55                        1
 
 
index 9f13c7bbd3d1d7294e1c533adfc6b411be62cbb3..1a4b1263d451181dfad6809235da3e89f3958f51 100644 (file)
@@ -59,7 +59,13 @@ in emacs:
                  '(lambda() (c-set-style "Stroustrup")
                     )
                  )
+If you like using font-lock, you can also add this to your F<.emacs>:
 
+       (setq font-lock-maximum-decoration t)
+       (setq c++-font-lock-keywords-3 
+             (cons
+              '("\\b\\([a-zA-Z_]+_\\)\\b" 1 font-lock-variable-name-face)
+              c++-font-lock-keywords-3))
 
 =head2 CLASSES and TYPES:
 
index 70162a6095692b6057f5223572f9f8cd38e1ada9..3b33cf79b52b21b2cca8d3512dca54b927a30de4 100644 (file)
@@ -100,25 +100,28 @@ saves us a I<lot> of trouble. GNU LilyPond and FlowerLib use:
 =over 4
 
 =item *
+
 builtin bool
 
 =item *
+
 64 bit integral type long long
 
 =item *
+
 typeof
 
 =item *
+
 operator <?, operator >?
 
 =item *
+
 the new for-scope
 
 =item   *
-class Rational (libg++)
 
-=item *
-named return values
+class Rational (libg++)
 
 =back
 
index 0961c0aeaa391ac52e0aeb1d4b4b63dc679a0a4a..31394293029fd0cea06e83bdf406c269c1307fd6 100644 (file)
@@ -92,8 +92,6 @@ abbrev: c4=16 (heu, =?),
 
 plet === midi-note: c4*2/3; c4*385/384,
 
-=back
-
 =item *
 
 drop \music,
index 17819376c67594aa9871278465230a03160d644f..11cb0cd4739ab597b43c291d67f86bda99495641 100644 (file)
@@ -61,7 +61,7 @@ C\bC\bC\bCO\bO\bO\bON\bN\bN\bNF\bF\bF\bFI\bI\bI\bIG\bG\bG\bGU\bU\bU\bUR\bR\bR\bRI\bI\bI\bIN\bN\bN\bNG\bG\bG\bG a\b
 
 
 
-22/Apr/97                LilyPond 0.0.54                        1
+22/Apr/97                LilyPond 0.0.56                        1
 
 
 
@@ -127,7 +127,7 @@ INSTALL(1)            LilyPond documentation           INSTALL(1)
 
 
 
-22/Apr/97                LilyPond 0.0.54                        2
+22/Apr/97                LilyPond 0.0.56                        2
 
 
 
@@ -193,7 +193,7 @@ R\bR\bR\bRE\bE\bE\bED\bD\bD\bDH\bH\bH\bHA\bA\bA\bAT\bT\bT\bT L\bL\bL\bLI\bI\bI\bIN\bN\bN\bNU\bU\bU\bUX\bX\bX\bX
 
 
 
-22/Apr/97                LilyPond 0.0.54                        3
+22/Apr/97                LilyPond 0.0.56                        3
 
 
 
@@ -259,6 +259,6 @@ A\bA\bA\bAU\bU\bU\bUT\bT\bT\bTH\bH\bH\bHO\bO\bO\bOR\bR\bR\bRS\bS\bS\bS
 
 
 
-22/Apr/97                LilyPond 0.0.54                        4
+22/Apr/97                LilyPond 0.0.56                        4
 
 
diff --git a/NEWS b/NEWS
index 8497bd8fe399e072fc5a9dda75668b01432b064a..dc064446d502b7ac41ac91e34e47960c3c875b9b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,14 @@
+pl 56
+       - Massive Rest/Stem/Collision/Note_column rewrite: resolve
+notehead/rest ambiguities and bugs. eg, [c8 r8 c8] 
+
+pl 54.jnc1
+       - standchen.ly: repeats; lyricii to end
+       - convert-mudela: help + usage
+       - fixed midi key/meter-change (triggered by martien.ly) bug
+
+******
+April 23
 pl 55
        - staff-side robustification
        - script-on-rest bug
diff --git a/README b/README
index 9042e4f255c1553dae9372a182751a9c5775ab3c..416108902bb94b8645b179d1ce660c673019fd87 100644 (file)
--- a/README
+++ b/README
@@ -33,5 +33,3 @@ me,
 
 Have fun!
 
-======================
-
diff --git a/TODO b/TODO
index a08cea7fb21690a5e340d9a5734d4a647ac6884d..d34d6b91c4747873f70687acfc601a729d7ee01d 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,12 +1,6 @@
 IMPORTANT
-       * resolve notehead/rest ambiguities and bugs. [HWN]
-       eg, [c8 r8 c8] 
-
-
        * mi2mu man page
 
-       * use Real for y positions.
-
        * update 20 pt table
 
        * rename mf fonts to avoid conflicts with musixtex
@@ -67,6 +61,8 @@ FURTHER FOR ORCHESTRAL SCORE:
 
        * abbreviations c4=16
 
+       * doublebar "||", finishbar "|||" (or "||." ?)
+
 INPUTLANGUAGE
 
        * relative mode for pitch entering
@@ -85,7 +81,9 @@ INPUTLANGUAGE
 
 SMALLISH PROJECTS
 
-       * use rest size in Collision
+       * write Rest_collision
+
+       * use Real for y positions.
 
        * bugreport to doc++ devel: struct not in class hier; public
        virtual baseclasses
@@ -108,6 +106,8 @@ SMALLISH PROJECTS
        
        * caching breakpoints / saving them. 
 
+       * hack ElectricFence to use with LD_PRELOAD
+
        * use dstream feature in mi2mu
 
         * qtor, btor, mtor-> tor( QUIET_ver ), tor( DEBUG_ver ), etc.
@@ -259,3 +259,10 @@ IDEAS
        * breath marks 
 
        * used fixedpoint arithmetic for min. energy.
+
+       * default convert mudela-file.ly -> mudela-file.tex
+         - move test.tex: '\include lilyponddefs' -> 
+           mudela-file.ly: '\texinclude "lilyponddefs";'
+           (junking test.tex and latex.test)
+         - rename {standchen,scsii-menuetto,...}.tex
+
index e4a8af3013bf26f808af6a0934f6c0365488156b..d879a5c1b00ef843c78a3a8081bdf9440ea4662d 100755 (executable)
@@ -1,12 +1,16 @@
 #!/usr/bin/perl -w
 
+#
+# version of "supporting" engine, not mudela conversions.
+# 
+
+$convert_mudela_version = "0.1";
 
 use Getopt::Long;
 
 
 
-sub 
-    version_string_conv
+sub version_string_conv
 {
     my ($from_version, $to_version) = @_;
     s/\version \"0.0.$from_version\"/\version \"0.0.$to_version\"/g;
@@ -14,41 +18,58 @@ sub
 
 ################################################################
 
-sub
-    conv_pl0_0_50_pl0_0_52
+sub no_conv
 {
 }
-
-sub conv_pl52_pl53
+sub convert_0_0_52_to_0_0_53
 {
 
     s/include \"/$1\\include \"/g;
 }
 
-sub conv_pl53_pl54
+  
+sub convert_0_0_53_to_0_0_54
 {
     print STDERR "Not smart enough to convert \\transpose\n"    if (/\\transpose/) ;
 }
 
 ###############################################################
 
-
-
-
-
-sub usage
+sub    last_conversion
 {
-    print STDERR "Usage: convert-mudela\n";
-    print STDERR "other options: --edit --output=FILE --show-rules\n";
-    exit 2;
+    my @v = &versions;
+    return pop @v;
 }
+sub identify
+{
     
+    print STDERR "This is convert-mudela " . $convert_mudela_version . 
+       " (up to mudela version 0.0.", last_conversion, ")\n";
+}
+  
+  
+ sub usage
+  {
+     print STDERR "Usage: convert-mudela [options] [mudela-file]...\n"
+     . "Convert old mudela source from mudela-file or stdin\n\n"
+     . "Options:\n"
+     . "  -e, --edit             perform in-place conversion\n"
+     . "  -f, --from=PATHLEVEL   use source version 0.0.PATCHLEVEL\n"
+     . "  -h, --help             print this help\n"
+     . "  -o, --output=FILE      name output file\n"
+     . "  -s, --show-rules       print all known conversion rules\n"
+     . "  -t, --to=PATCHLEVEL    convert to version 0.0.PATCHLEVEL\n"
+  }
+      
+# beware of the year 2000
 my %minor_conversions = (50 => \&no_conv,
-                        52 => \&conv_pl0_0_50_pl0_0_52,
-                        53 => \&conv_pl52_pl53,
-                        54 => \&conv_pl53_pl54
-                        );
+                        52 => \&convert_0_0_50_to_0_0_52,
+                        53 => \&convert_0_0_52_to_0_0_53,
+                        54 => \&convert_0_0_53_to_0_0_54
+                        );
+
 sub versions 
 {
     return  (sort keys %minor_conversions);
@@ -133,7 +154,7 @@ sub  set_files
        $outfile = "$infile.NEW";
        $infile = "$infile";
     }
-    print STDERR "Input $infile.. ";
+    print STDERR "Input ", (($infile eq "-") ?"STDIN" : $infile), " .. ";
 
 }
 
@@ -148,8 +169,7 @@ sub do_one_arg
     ($from_version = get_auto_from $infile) unless defined($opt_from);
     return if (!defined($from_version));
     
-    my @v = versions;
-    ($to_version =  pop @v) unless (defined($opt_to));
+    ($to_version =  last_conversion) unless (defined($opt_to));
 
 
     die "can't open \`$infile\'" unless open INLY,$infile ;
@@ -165,7 +185,17 @@ sub do_one_arg
     }
 }
 
-GetOptions ("output=s", "from=i", "to=i", "minor=i", "edit", "show-rules");
+## "main"
+
+identify;
+
+GetOptions ("help", "output=s", "from=i", "to=i", "minor=i", "edit", "show-rules");
+
+if ($opt_help) {
+    usage();
+    $opt_help = 0;     # to extinguish typo check.
+    exit 0;
+}
 
 if ($opt_show_rules) { 
     show_rules ;
index a9a70bbe73d7cea745bc3bde95a7d0eea23dae2f..4f38a8883e6c23b7053966143c41dc1944f651ea 100755 (executable)
@@ -32,12 +32,16 @@ heredir=`pwd`
 make dist; 
 setversion
 LILYVER=$NEWVER
-mv lilypond-$LILYVER.tar.gz ../releases
+
+tarball=lilypond-$LILYVER.tar.gz
+patch=patch-$LILYVER.gz
+    
+mv  $tarball ../releases
 
 cd ../test
 $heredir/bin/make_patch $LASTVER $NEWVER lilypond
 gzip -f9 patch-$NEWVER
-mv patch-$NEWVER.gz ../patches/
+mv $patch ../patches/
 
 RPMS=`find ~/rpms/ -name lilypond-$NEWVER'*'rpm`
 rm *.rpm {lilypond,patch}-*.gz
@@ -45,10 +49,14 @@ rm *.rpm {lilypond,patch}-*.gz
 if [ ! -z $RPMS ]; then
     ln $RPMS . 
 fi
-ln ../releases/lilypond-$NEWVER.tar.gz .
-ln ../patches/patch-$NEWVER.gz .    
+    
+ln ../releases/$tarball .
+ln ../patches/$patch .    
+
 
-RPMS=`echo *.rpm`
-tar cf updeet {lily,patch-}*.gz $RPMS
+if [ ! -z $RPMS ]; then
+    RPMS=lilypond-$LILYVER-1.i386.rpm lilypond-$LILYVER-1.src.rpm 
+fi    
+tar cf updeet $tarball $patch $RPMS
 tar tfv updeet
 
index 8f117dc2d3a2aa340358763889e833da298d59ce..cdc617cebb047c6d9dee9d31dbf444ddfc6d7094 100644 (file)
@@ -1,4 +1,3 @@
-%% BUG in MIDI!
 %
 % Viola Quartet
 % Martien Lohman (194x-????) 
 % \barnumbering5
 % \barnumberstyle\boxed
 
-globalmusic= \melodic{
-               \meter 2/4;
-%              \key fis
-               \skip 2*56;
-%              \key bes es as
-               \skip 2*8;
-               \meter 6/8;
-               \skip 8*48;
-               \meter 2/4;
-               \skip 2*16;
-%              \key fis
+commands = \melodic{
+       \meter 2/4;
+%      \key fis
+       \skip 2*56;
+%      \key bes es as
+       \skip 2*8;
+       \meter 6/8;
+       \skip 8*48;
+       \meter 2/4;
+       \skip 2*16;
+%      \key fis
 }
 
 \include "mlalt.ly"
@@ -32,10 +31,10 @@ globalmusic= \melodic{
 \include "mlcello.ly"
 
 \score{
-       \staff{ melodicregs globalmusic alto }
-       \staff{melodicregs  globalmusic violinI }
-       \staff{ melodicregs globalmusic violinII }
-       \staff{ melodicregs globalmusic cello }
+       \staff{ melodicregs commands alto }
+       \staff{ melodicregs commands violinI }
+       \staff{ melodicregs commands violinII }
+       \staff{ melodicregs commands cello }
        \paper{
                \unitspace 24\mm
                \width 195\mm
index 8a0ada446a7760c4a565b4800a3957612b4f1b77..71a6ca9d9a2d18dd0f0ade680271e0d1d44233f6 100644 (file)
@@ -208,7 +208,7 @@ violinII = \melodic  {
 %86
        ges |
 %87
-%      = g |
+       g! |
 %88
        \textstyle "italic";
        fis_"dacapo" \key fis;|
index cc3f3636fb2c009a03468b210a869493b47fadc7..b665c77a7cc9fad78614381f105c88b5baf57d42 100644 (file)
@@ -83,7 +83,10 @@ ii_menuetto = \melodic{
 %%20
        < { [ c'( bes a )bes g( )bes ] } { [ d ] } { [ g ] } > |
 %%21
-       < \multivoice  {\stem 1;  d'4(\stem 1; ) cis'4 d'4 }  { \stem -1; g2 f4 } > |
+       < \multivoice  
+               {\stem 1;  d'4(\stem 1; ) cis'4 d'4 }  
+               { \stem -1; g2 f4 } 
+       > |
 %%22
        < { [ g( )f g e ] } { [ cis ] } > < f4 d4 > |
 %%23
index e545dd011c1c81127449caa8165986fb993384b5..7d9d9c7378343c23e2148d828cd72bb4f22630ff 100644 (file)
 %
 \version "0.0.54";
 
-melodie = \melodic{  
-       \meter  3/4 ;
+commands = \melodic{
+       \skip 2.*4;
+       \bar ":|";
+       \skip 2.*24;
+%      volta1
+       \skip 2.*8;
+%      volta2
+       \bar ":|";
+       \skip 2.*22;
+       \bar "||"; 
+       }
+
+melodie = \melodic{ 
+       \meter 3/4;
        \clef\violin;
-       \key  bes ;
-       \octave  c' ;
-       \duration  8 ;
+       \key bes;
+       \octave c';
+       \duration 8;
        r \pp < [ d 'a-| > f-| < d 'a-| > f-| < d 'a-| ] > |
 %%2
        r < [ d 'bes-| > f-| < d 'bes-| > f-| < d 'bes-| ] > |
 %%3
        \textstyle "italic";
        r_"simile" < [ d 'bes > e < d 'bes > e < d 'bes ] >|
-       \textstyle "roman" ;
+       \textstyle "roman";
        
 %%4
        r < [ 'a cis > e < 'a cis > e < 'a cis ] > |
 %%5
-       [ a()bes a ]2/3  d'4. a |
+       [ a()bes a ]2/3 d'4. a |
 %%6
-       [ g()a g ]2/3  d'4 g r |
+       [ g()a g ]2/3 d'4 g r |
 
 %%7
-       a4.^> g  [ g()f e ]2/3  |
+       a4.^> g [ g()f e ]2/3 |
 %%8
        f2 r4 |
 %%9
 
-       < { a'4.( )g'  [ g'( f' )e' ]2/3  }
-       { cis'4. e'_"dolce"  \plet  2/3 ; e' \plet  1/1 ; } > |
+       < { a'4.( )g' [ g'( f' )e' ]2/3 }
+       { cis'4. e'_"dolce" \plet 2/3; e' \plet 1/1; } > |
 %%10
        < f'2. d'2. > |
 %%11
-       [ a (\pp )bes a ]2/3  f'4. a |
+       [ a (\pp )bes a ]2/3 f'4. a |
 %%12
-       [ g( ) a g ]2/3  e'4. d' |
+       [ g( ) a g ]2/3 e'4. d' |
 %%13
-       c'4. bes  [ bes( ) a g ]2/3  |
+       c'4. bes [ bes( ) a g ]2/3 |
 %%14
        a2 r 
-       < { d'( | )c'4. g  [ bes a g ]2/3  }
-       { f \p ( | )e4._"dolce" bes  
-               \plet  2/3 ; g
-               \plet  1/1 ;  
+       < { d'( | )c'4. g [ bes a g ]2/3 }
+       { f \p ( | )e4._"dolce" bes 
+               \plet 2/3; g
+               \plet 1/1; 
        } > |
 %%16
        < a2. f2. > |
 %%17
        \textstyle "italic";
        [ a8._"cresc." cis'16 ] f'4. e'
-       \textstyle "roman" ;|
+       \textstyle "roman";|
 %%18
        [ d'8. a16 ] f4. d |
 %%19
 %#%    c'\grace\stemup
-       [ bes (\pp ) a bes ]2/3  d'4. bes |
+       [ bes (\pp ) a bes ]2/3 d'4. bes |
 %%20
        a2. |
 %%21
 %#%    a\grace
-       [ g( )fis g ]2/3  bes4.^> g |
+       [ g( )fis g ]2/3 bes4.^> g |
 %%22
        f!2. |
 %%23
@@ -87,12 +99,12 @@ melodie = \melodic{
        < d'2. fis2. > |
 %#%\volta1
 %%29
-       <  { bes2( [ d'8.( ))g16 ] }
+       < { bes2( [ d'8.( ))g16 ] }
        { g2 \mf [ bes8. bes16 ] } > |
 %%30
        < { a4. [ a-. a-. a-. ] }
        { fis4. [ fis-.( fis-. )fis-. ] } > |
-%%31  
+%%31 
        < { a4. [ a-. a-. a-. ] }
        { g4. [ cis-.( e-. )g-. ] } > |
 %%32
@@ -119,7 +131,7 @@ melodie = \melodic{
 %%40
        cis'2 r4 |
 %%41
-       < fis'4. \> cis'4. \f > e'  [ e'( )d' \! cis' ]2/3  |
+       < fis'4. \> cis'4. \f > e' [ e'( )d' \! cis' ]2/3 |
 %%42
        [ b8. cis'16 ] d'4^> b r |
 %%43
@@ -128,16 +140,16 @@ melodie = \melodic{
 %%44
        [ b8. \> cis'16 ] d'4^> b \! r |
 %%45
-       [ b \p ( )ais b ]2/3  d'4. b |
+       [ b \p ( )ais b ]2/3 d'4. b |
 %%46
        <a!2. fis2. > |
 %%47
-       [ e' \f( )dis' e' ]2/3  g'4.^> cis' |
+       [ e' \f( )dis' e' ]2/3 g'4.^> cis' |
 %%48
        \textstyle "italic";
        < 
        { fis2.( \group "+1"; \stem -1; )f2. }
-       { d'2. (  \stem  1 ; )d'4 r4_"decresc." d'4 } 
+       { d'2. ( \stem 1; )d'4 r4_"decresc." d'4 } 
        >
        \textstyle "roman"; |
 %%50
@@ -170,7 +182,7 @@ begeleiding = \melodic{
        \meter 3/4;
        \clef\bass;
        \key bes;
-       \octave  c' ;
+       \octave c';
        \duration 2;
        'd r4 |
 %%2
@@ -182,8 +194,8 @@ begeleiding = \melodic{
 %%4
        ''a r4 |
 %%5
-\duration  8 ;
-       < \multivoice { \stem  1 ;      
+\duration 8;
+       < \multivoice { \stem 1;        
                [ 'f 'a d 'a d 'a ] 
                [ 'd 'e 'g 'e 'g 'e ] 
                [ 'cis 'e 'g 'e 'g e ]
@@ -201,7 +213,7 @@ begeleiding = \melodic{
        [ 'd 'a d 'a d 'a ] |
 %%11
        < \multivoice   
-       { \stem  1 ;
+       { \stem 1;
                [ 'f 'a d 'a d 'a ]
                [ 'd 'e 'g 'e 'g 'e ] 
                [ 'e 'g 'bes 'g 'bes 'g ] 
@@ -219,7 +231,7 @@ begeleiding = \melodic{
        < \multivoice
        { \stem 1; 
                [ ''a 'e 'g 'e 'g 'e ][ 'd 'a d 'a d 'a ]
-               [ ''bes 'f 'bes 'f 'bes 'f ][ ''f 'c 'f 'c 'f 'c ]  }
+               [ ''bes 'f 'bes 'f 'bes 'f ][ ''f 'c 'f 'c 'f 'c ] }
        { \stem -1; 
                ''a2 r4
                'd2 r4 
@@ -268,11 +280,11 @@ begeleiding = \melodic{
 %%37
        [ ''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 ] |
 %%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 'fis 'e 'fis 'e ] |
 %%42
@@ -319,7 +331,7 @@ begeleiding = \melodic{
 
 
 tekstI = \lyric{
-       \meter  3/4 ;
+       \meter 3/4;
        \duration 4;
        _ _ _
        _ _ _
@@ -329,7 +341,7 @@ tekstI = \lyric{
        [ Lei- se8 ]2/3 fleh-4. en8 
        [ mei- ne8 ]2/3 Lie- der8 _8
        Durch4. die8 [ Nacht zu8 ]2/3 
-       dir;2 _        
+       dir;2 _    
        _ _ _ 
        _ _ _
 % 11
@@ -367,7 +379,7 @@ tekstI = \lyric{
 % 37
        La\ss8. auch16 dir8. die16 Brust8. be-16
        we- gen, _
-       Lieb-4. chen,8  h\"o-8. re16 
+       Lieb-4. chen,8 h\"o-8. re16 
        mich!2 _
        Be-8. bend16 harr' ich8 _8
        dir8. ent-16 ge- gen!8 _8
@@ -386,7 +398,7 @@ tekstI = \lyric{
 }
 
 tekstII = \lyric{
-        \meter 3/4;
+    \meter 3/4;
        \duration 4;
        _ _ _
        _ _ _
@@ -423,7 +435,6 @@ tekstII = \lyric{
        Herz.2.
        _ _ _ 
        _ _ _
-         
 % volta 1
 % 29
        _ _ _ _ _ _
@@ -433,19 +444,19 @@ tekstII = \lyric{
 
 % volta 2
 % 37
-%      _ _ _ _ _ _
-%      _ _ _ _ _ _
-%      _ _ _ _ _ _
-%      _ _ _ _ _ _ 
-%      _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _ 
+       _ _ _ _ _ _
 % 47
-%      _ _ _ _ _ _
-%      _ _ _ _ _ _
-%      _ _ _ _ _ _
-%      _ _ _ _ _ _
-%      _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
 % 57
-%      _ _ _ _ _ _ 
+       _ _ _ _ _ _ 
        
 }
 
@@ -453,8 +464,8 @@ tekstII = \lyric{
        \staff{ lyricregs tekstI }
        \staff{ lyricregs tekstII }
 
-       \staff{ melodicregs melodie }
-       \staff{ melodicregs begeleiding }
+       \staff{ melodicregs melodie commands}
+       \staff{ melodicregs begeleiding commands }
        \paper{
                \width 195\mm
 
index 5d29a8ca9887dfef7c28f6821da80082f8d5b327..3bbbaf2d924564b29f96d88e2b9fb6fe71b8b5a3 100644 (file)
@@ -6,6 +6,7 @@
 
 melody = \melodic{
        \clef\violin;
+       \octave c';
        c4 c | g g | a a | g g |
        f f | e e | d d8.( e16 | )c2 | % :|
 
index 389226fa7158a8e09e97923ad3e4f9918c16b1d5..ccf37114db9edc2044c9aa9caab178e35ad3a10b 100644 (file)
@@ -29,12 +29,11 @@ struct Stem_info {
 
 Stem_info::Stem_info(Stem const *s)
 {
-    x = s->hindex();
+    x = s->hpos_f();
     int dir = s->dir_i_;
-    idealy  = max(dir*s->top, dir*s->bot);
-    miny = max(dir*s->minnote, dir*s-> maxnote);
+    idealy  = dir * s->stem_end_f();
+    miny = dir * s->stem_start_f();
     assert(miny <= idealy);
-
 }
 
 /* *************** */
@@ -60,7 +59,7 @@ Beam::add(Stem*s)
 {
     stems.bottom().add(s);
     s->add_dependency(this);
-    s->print_flag = false;
+    s->print_flag_b_ = false;
 }
 
 void
@@ -87,6 +86,9 @@ Beam::solve_slope()
     Array<Stem_info> sinfo;
     for (iter_top(stems,i); i.ok(); i++) {
        i->set_default_extents();
+       if (i->invisible_b())
+           continue;
+       
        Stem_info info(i);
        sinfo.push(info);
     }
@@ -120,9 +122,9 @@ void
 Beam::set_stemlens()
 {
     iter_top(stems,s);
-    Real x0 = s->hindex();    
+    Real x0 = s->hpos_f();    
     for (; s.ok() ; s++) {
-       Real x =  s->hindex()-x0;
+       Real x =  s->hpos_f()-x0;
        s->set_stemend(left_pos + slope * x);   
     }
 }
@@ -149,7 +151,7 @@ Beam::set_grouping(Rhythmic_grouping def, Rhythmic_grouping cur)
        iter_top(stems,s);
        Array<int> flags;
        for (; s.ok(); s++) {
-           int f = intlog2(abs(s->flag))-2;
+           int f = intlog2(abs(s->flag_i_))-2;
            assert(f>0);
            flags.push(f);
        }
@@ -162,8 +164,8 @@ Beam::set_grouping(Rhythmic_grouping def, Rhythmic_grouping cur)
 
     iter_top(stems,s);
     for (int i=0; i < b.size() && s.ok(); i+=2, s++) {
-       s->beams_left = b[i];
-       s->beams_right = b[i+1];
+       s->beams_left_i_ = b[i];
+       s->beams_right_i_ = b[i+1];
     }
 }
 
@@ -193,8 +195,8 @@ Interval
 Beam::do_width() const
 {
     Beam * me = (Beam*) this;  // ugh
-    return Interval( (*me->stems.top()) ->hindex(),
-                    (*me->stems.bottom()) ->hindex() );
+    return Interval( (*me->stems.top()) ->hpos_f(),
+                    (*me->stems.bottom()) ->hpos_f() );
 }
 
 /*
@@ -203,8 +205,8 @@ Beam::do_width() const
 Molecule
 Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
 {
-    assert( !next || next->hindex() > here->hindex()  );
-    assert( !prev || prev->hindex() < here->hindex()  );
+    assert( !next || next->hpos_f() > here->hpos_f()  );
+    assert( !prev || prev->hpos_f() < here->hpos_f()  );
     Real dy=paper()->internote()*2;
     Real stemdx = paper()->rule_thickness();
     Real sl = slope*paper()->internote();
@@ -215,9 +217,9 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
 
     /* half beams extending to the left. */
     if (prev) {
-       int lhalfs= lhalfs = here->beams_left - prev->beams_right ;
-       int lwholebeams= here->beams_left <? prev->beams_right ;
-       Real w = (here->hindex() - prev->hindex())/4;
+       int lhalfs= lhalfs = here->beams_left_i_ - prev->beams_right_i_ ;
+       int lwholebeams= here->beams_left_i_ <? prev->beams_right_i_ ;
+       Real w = (here->hpos_f() - prev->hpos_f())/4;
        Symbol dummy;
        Atom a(dummy);
        if (lhalfs)             // generates warnings if not
@@ -231,10 +233,10 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
     }
        
     if (next){
-       int rhalfs = here->beams_right - next->beams_left;
-       int rwholebeams = here->beams_right <? next->beams_left
+       int rhalfs = here->beams_right_i_ - next->beams_left_i_;
+       int rwholebeams = here->beams_right_i_ <? next->beams_left_i_
 
-       Real w = next->hindex() - here->hindex();
+       Real w = next->hpos_f() - here->hpos_f();
        Atom a = paper()->lookup_l()->beam(sl, w + stemdx);
        
        int j = 0;
@@ -261,11 +263,12 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
 
 
 Molecule*
-Beam::brew_molecule_p() const return out;
+Beam::brew_molecule_p() const 
 {
+    Molecule *out=0;
     Real inter=paper()->internote();
     out = new Molecule;
-    Real x0 = stems.top()->hindex();
+    Real x0 = stems.top()->hpos_f();
     
     for (iter_top(stems,i); i.ok(); i++) {
        PCursor<Stem*> p(i-1);
@@ -274,11 +277,12 @@ Beam::brew_molecule_p() const return out;
        Stem * next = n.ok() ? n.ptr() : 0;
 
        Molecule sb = stem_beams(i, next, prev);
-       Real  x = i->hindex()-x0;
+       Real  x = i->hpos_f()-x0;
        sb.translate(Offset(x, (x * slope  + left_pos)* inter));
        out->add(sb);
     }
     out->translate(Offset(x0 - left_col_l_->hpos,0));
+    return out;
 }
 
 IMPLEMENT_STATIC_NAME(Beam);
index 2fbb0d80187447ffaa0b6d89722abac13a45ae76..53c64fed95e50568ce17fdf1d9630bf81668eb28 100644 (file)
@@ -76,7 +76,6 @@ Collision::do_pre_processing()
     Note_column * col_l_a[4];
     Real x_off [4];
     int y_off[4];
-    bool rest_b_a[4];
     
     for (int j =0 ; j < 4; j++) {
        if (clash_group_arr_a[j].size()) 
@@ -88,7 +87,7 @@ Collision::do_pre_processing()
            y_extent[j] = col_l_a[j]->head_positions_interval();
        }
 
-       rest_b_a[j] = (col_l_a[j]) ? col_l_a[j]->rest_b_ : false;       
+
        x_off [j] = 0.0;
        y_off[j] = 0;
     }
@@ -97,28 +96,8 @@ Collision::do_pre_processing()
        x_off[idx(d, true)] = d*0.5;
     } while ((d *= -1) != 1);
 
-   do {
-       int i1 = idx(d, false);
-       int i2 = idx(d,true);
-       if (!intersection(y_extent[i1] , 
-                         y_extent[i2]).empty_b()) {
-           if (rest_b_a[i1]) {
-               y_off[i1] = -y_extent[i1][-d] + y_extent[1][d] + d*4; // ugh
-               y_extent[i1] += y_off[i1];
-           }
-       }
-    } while ((d *= -1) != 1);
+  
 
-    do {
-       int i1 = idx(d, false);
-       int i2 = idx(-d,false);
-       
-       if (d*(y_extent[i1][-d] - y_extent[i2][d] )< 0&& rest_b_a[i1]) {
-           y_off[i1] = -y_extent[i1][-d] + y_extent[i2][d] +d* 4; // ugh
-           y_extent[i1] += y_off[i1];
-       }
-    } while ((d *= -1) != 1);
-    
     Interval_t<int> middle( y_extent[0].min(), y_extent[3].max());
     Interval_t<int> open_middle( y_extent[3].max()+1, y_extent[0].min()-1);
     do{
@@ -127,12 +106,10 @@ Collision::do_pre_processing()
     } while ((d *= -1) != 1);
    
     if (!middle.empty_b() && 
-       middle.length() <= 1 && col_l_a[idx(1,0)] && col_l_a[idx(-1,0)]
-       && !rest_b_a[idx(1,0)] && !rest_b_a[idx(-1,0)]) {
-       
+       middle.length() <= 1 && col_l_a[idx(1,0)] && col_l_a[idx(-1,0)]) {      
        Notehead * nu_l= col_l_a[idx(1,0)]->head_l_arr_[idx(1,0)];
        Notehead * nd_l = col_l_a[idx(-1,0)]->head_l_arr_[idx(1,0)];
-       if (! (nu_l->balltype == nd_l->balltype && nu_l->dots == nd_l->dots)) {
+       if (! (nu_l->balltype_i_ == nd_l->balltype_i_ && nu_l->dots_i_ == nd_l->dots_i_)) {
            x_off[idx(1,0)] -= 0.5;
            x_off[1] -= 0.5;
            x_off[2] += 0.5;
index a0a5676a74b92267bae846a5e0da77aa8728b48a..5b1557ea78d5aff746f100306ea740fe73df6c8f 100644 (file)
@@ -38,7 +38,7 @@ Notehead_register::process_requests()
     n_p->set_rhythmic(note_req_l_->rhythmic());
 
     if (note_req_l_->note()) {
-       n_p->position = note_req_l_->note()->height() +
+       n_p->position_i_ = note_req_l_->note()->height() +
            *get_staff_info().c0_position_i_l_;
     } else if (note_req_l_->rest()) {
        n_p->rest_b_ = true;
index 844496a855546467bb8db9f9fbb21a6860da6fd8..4d25f93c058c60bf3161ca680328af097b2bdbf8 100644 (file)
 #include "item.hh"
 
 class Collision : public Item {
-    Array<Note_column*> clash_l_arr_;
 protected:
     virtual void do_pre_processing();
 public:
+    Array<Note_column*> clash_l_arr_;
     NAME_MEMBERS(Collision);
     void add (Note_column*ncol_l);
     Collision();
index 7db99e41cae9a43bf926a0983528f4241490b596..8239946370299e5c13a00fb1170200a9c69cc8e3 100644 (file)
@@ -62,5 +62,8 @@ struct Note_column_register;
 struct Note_column;
 struct Staff_side;
 struct Staff_symbol;
-
+struct Script_column;
+struct Rest_column;
+struct Rest_collision_register;
+struct Rest_collision;
 #endif // LILY_PROTO_HH
index ddcbdae2f5d803529c9f1cd6068cc08ea3f51b0d..d052d04983ca66a708c60237a7503c06fefd165e 100644 (file)
 #include "register.hh"
 
 class Note_column_register :public Request_register {
+    Rest_column * rest_col_l();
+    Note_column * note_col_l();
+    
+    Array< Script * >  script_l_arr_;
+    Stem * stem_l_;
     Note_column *ncol_p_;
+    Rest_column *restcol_p_;
     bool h_shift_b_;
     int dir_i_;
+    
     /* *************** */
     bool acceptable_elem_b(Staff_elem const*)const;
 protected:
     virtual void set_feature(Feature);
     virtual void acknowledge_element(Staff_elem_info);
     virtual void pre_move_processing();
-
+    virtual void post_move_processing();
 public:
     Note_column_register();
     NAME_MEMBERS(Note_column_register);
index b6562ed83b6bdf3ec8159a24f9376e0d24c8dae8..e96ef116058c5512ea77b764a3713965b3509321 100644 (file)
 #ifndef NOTE_COLUMN_HH
 #define NOTE_COLUMN_HH
 #include "item.hh"
-#include "interval.hh"
+#include "script-column.hh"
 
 /** a struct for treating a group of noteheads (noteheads, stem
   (chord) and scripts ) as a single entity.  */
-class Note_column : public Item {
-    virtual  Interval do_height()const;
-    virtual void do_print() const ;
-    virtual void do_pre_processing();
-    virtual Interval do_width()const;
+class Note_column : public Script_column {
 public:
     bool h_shift_b_;
-    Stem * stem_l_;
-    Array<Script *> script_l_arr_;
-    bool rest_b_;
-    Array<Notehead*> head_l_arr_;
     
+    Array<Notehead*> head_l_arr_;
+    Interval_t<int> head_positions_interval()const;
+
     /** The relative position of the "voice" containing this
       chord. Normally this would be the same as the stem direction,
       but rests do not have stems.  */
     int dir_i_;
    
-    Interval_t<int> head_positions_interval()const;
-    
+        
     NAME_MEMBERS(Note_column);
     Note_column();
     void add(Notehead *);
     void add(Stem *);
-    virtual void translate(Offset);
     void sort();
-    void add(Script *);
+    void add(Script* s) { Script_column::add(s);}
 };
+
 #endif // NOTE_COLUMN_HH
index a0e9f65615303e60f1581014010375b69aa65882..e28c387a284944fb17d992338b6ddc85730b2216 100644 (file)
@@ -23,15 +23,16 @@ public:
     NAME_MEMBERS(Notehead);
 
     bool rest_b_;
-    int position;
+    int position_i_;
+    
     /// -1 = lowest, 0 = inside, 1 = top
-    int extremal;
+    int extremal_i_;
     
     /// needed for the help-lines
-    int staff_size;
-    int dots;
-    int balltype;
-    int x_dir;
+    int staff_size_i_;
+    int dots_i_;
+    int balltype_i_;
+    int x_dir_i_;
     
     /* *************** */
     
diff --git a/lily/include/rest-collision-reg.hh b/lily/include/rest-collision-reg.hh
new file mode 100644 (file)
index 0000000..da2992b
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+  rest-collision-reg.hh -- declare Rest_collision_register
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef REST_COLLISION_REG_HH
+#define REST_COLLISION_REG_HH
+
+#include "varray.hh"
+#include "register.hh"
+
+class Rest_collision_register : public Request_register {
+    Rest_collision* rest_collision_p_;
+    Array< Collision *> collision_l_arr_;
+protected:
+    virtual void acknowledge_element(Staff_elem_info);
+    virtual void pre_move_processing();
+public:
+    Rest_collision_register();
+    NAME_MEMBERS(Rest_collision_register);
+};
+#endif // REST_COLLISION_REG_HH
diff --git a/lily/include/rest-collision.hh b/lily/include/rest-collision.hh
new file mode 100644 (file)
index 0000000..31a1c85
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+  rest-collision.hh -- declare Rest_collision
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef REST_COLLISION_HH
+#define REST_COLLISION_HH
+
+#include "lily-proto.hh"
+#include "item.hh"
+
+class Rest_collision : public Item {
+    Array<Rest_column *> rest_l_arr_;
+    Array<Note_column *> ncol_l_arr_;
+public:
+    void add(Rest_column*);
+    void add(Collision*);
+    NAME_MEMBERS(Rest_collision);
+protected:
+    virtual void do_post_processing();
+};
+#endif // REST_COLLISION_HH
diff --git a/lily/include/rest-column.hh b/lily/include/rest-column.hh
new file mode 100644 (file)
index 0000000..04e86e5
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+  rest-column.hh -- declare Rest_column
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef REST_COLUMN_HH
+#define REST_COLUMN_HH
+
+#include "script-column.hh"
+
+/** 
+  struct to treat a set of rests as union (one voicegroup should
+  only produce one rest.
+  */
+class Rest_column : public Script_column {
+    Array<Notehead*> head_l_arr_;
+public:
+    int dir_i_;
+    void add(Notehead *);
+    NAME_MEMBERS(Rest_column);
+    void translate_y(Real dy);
+};
+
+#endif // REST_COLUMN_HH
diff --git a/lily/include/script-column.hh b/lily/include/script-column.hh
new file mode 100644 (file)
index 0000000..f6adf9f
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+  script-column.hh -- declare Script_column
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef SCRIPT_COLUMN_HH
+#define SCRIPT_COLUMN_HH
+
+#include "item.hh"
+
+/** a struct for treating a group of noteheads (noteheads, stem
+  (chord) and scripts ) as a single entity.  */
+class Script_column : public Item {
+protected:
+    virtual Interval do_height()const;
+    virtual Interval do_width()const;
+    virtual void do_print() const ;
+    virtual void do_pre_processing();
+public:
+    Array<Script *> script_l_arr_;
+    Array<Item *> support_l_arr_;
+    
+    NAME_MEMBERS(Script_column);
+    virtual void translate(Offset);
+    void add(Script *);
+    void add_support(Item*);
+};
+
+#endif // SCRIPT_COLUMN_HH
index edb770d41eb652ea534852b106ee977f2471770a..a1524a1bd6de50bed8aabed22e782ff9a0ea1c35 100644 (file)
@@ -41,6 +41,7 @@ public:
        POSTCALCING,            // busy calculating. This is used to trap cyclic deps.
        POSTCALCED,             // after spacing calcs done
        OUTPUT,                 // molecule has been output
+       DELETED,                // to catch malloc mistakes.
     } status;
     
     ///  the pstaff it is in
index e64aafdd6958cd6ca5e4f0c6b9626732ae478f95..9cabdcd2a0e087f248c7e28ac5a7e034398b1e98 100644 (file)
   \item the flag
   \item up/down position.
   \end{itemize}
-  */
-
-struct Stem : Item {
-    /// heads that the stem encompasses (positions)
-    int minnote, maxnote;
 
-    /// false if in beam
-    bool print_flag;
+  should move beam_{left, right} into Beam
+  */
+class Stem : public Item {
+    
+    Real stem_bottom_f_, stem_top_f_;
     
-    int beams_left;
-    int beams_right;
     
     /// needed for determining direction/length
-    int staff_center;
-
+    int staff_size_i_;
 
     /**extent of the stem (positions).
       fractional, since Beam has to adapt them.
       */
 
-    Real bot, top;
-    Real stemlen;
-    
-    /// flagtype? 4 none, 8 8th flag, 0 = beam.
-    int flag;
-
 
     /**
       geen gedonder, jij gaat onder.
-       -1 stem points down, +1: stem points up
-       */
+      -1 stem points down, +1: stem points up
+      */
+    Real stem_xoffset_f_;
+    /**
+      store the wholes (for vapourware tremolo)
+     */
+    Array<Notehead*> whole_l_arr_;
+    Array<Notehead*> head_l_arr_;
+    Array<Notehead*> rest_l_arr_;
+    
+public:
+    /// flagtype? 4 none, 8 8th flag, 0 = beam.
+    int flag_i_;
 
-    int dir_i_;
-    Real stem_xoffset;
+    int beams_left_i_;
+    int beams_right_i_;
+
+    /// false if in beam
+    bool print_flag_b_;
     
-    Array<Notehead*> heads;
+    int dir_i_;
 
+    
     /* *************** */
-    Stem(int center); //, Moment duration);
+    Stem(int staff_size_i);
     
     /// ensure that this Stem also encompasses the Notehead #n#
     void add(Notehead*n);
 
     NAME_MEMBERS(Stem);
 
-    Real hindex()const;
+    Real hpos_f()const;
+    
     void do_print() const;
     void set_stemend(Real);
     int get_default_dir();
@@ -72,10 +77,19 @@ struct Stem : Item {
     void set_default_stemlen();
     void set_default_extents();
     void set_noteheads();
-    void do_pre_processing();
 
-    virtual Interval do_width() const;
+    Real stem_length_f()const;
+    Real stem_end_f()const;
+    Real stem_start_f() const;
 
+    bool invisible_b()const;
+    
+    /// heads that the stem encompasses (positions)
+    int max_head_i() const;
+    int min_head_i() const;
+protected:
+    void do_pre_processing();
+    virtual Interval do_width() const;
     Molecule* brew_molecule_p() const;
 };
 #endif
index b1087e41b748559b07ee5848a63672b932115654..cd02239f5ed966176f3c91b409280d44af87fdac 100644 (file)
@@ -25,6 +25,7 @@ public:
     Moment duration_;
     Voice const *voice_C_;
     IPointerList<Request*> req_p_list_;
+    Request * principal_req_l_;
 
     /* *************** */
     void transpose(Melodic_req const &)const;
index e038b18dd27604e9120985820c55f738d91e470e..711b89bd6d57c8800d14d92259eb374c084fac28 100644 (file)
@@ -42,11 +42,13 @@ Input_register::get_ireg_l(String nm)const
     return 0;
 }
 Array<Request_register*>
-Input_register::get_nongroup_p_arr() const return a;
+Input_register::get_nongroup_p_arr() const 
 {
+    Array <Request_register*>a;
     Array<String> sa(get_nongroups_str_arr());
     for (int i=0; i < sa.size(); i++)
        a.push(get_nongroup_register_p(sa[i]));
+    return a;
 }
 
 void
index 04e1286197df176309c04ec81b864255bbe20305..af7ec3cc199729adff3581b0aa9dc3acaf25b0ae 100644 (file)
@@ -236,6 +236,10 @@ Midi_track::Midi_track( int number_i )
 void 
 Midi_track::add( int delta_time_i, String event_str )
 {
+    if ( delta_time_i < 0 ) {
+       cout << String_convert::bin2hex_str( i2varint_str( delta_time_i ) ) << endl;
+       cout << String_convert::bin2hex_str( event_str ) << endl;
+    }
     assert(delta_time_i >= 0);
     Midi_chunk::add( i2varint_str( delta_time_i ) + event_str );
 }
index 3f24638236cb262999c9db8b93ea5838190c1090..f230b1df98ea1bc70060f05acdc76b1e49e11bca 100644 (file)
@@ -88,14 +88,14 @@ Midi_walker::process_requests()
        Command_req *c_l = ptr()->commandreq_l_arr_[i]->command();
        Meter_change_req* meter_l = c_l->meterchange();
        if ( meter_l )
-           output_event( Midi_time( meter_l->beats_i_, meter_l->one_beat_i_, 18 ),  0 );
+           output_event( Midi_time( meter_l->beats_i_, meter_l->one_beat_i_, 18 ),  ptr()->when() );
        Key_change_req* key_l = c_l->keychange();
        if ( key_l ) {
            int sharps_i = key_l->sharps_i();
            int flats_i = key_l->flats_i();
            // midi cannot handle non-conventional keys
            if ( !( flats_i && sharps_i ) )
-               output_event( Midi_key( sharps_i - flats_i, key_l->minor_b() ), 0 );
+               output_event( Midi_key( sharps_i - flats_i, key_l->minor_b() ), ptr()->when() );
        }
     }
 
index 73761360f9cd025f2ed8a70e3a621f13df2530a5..21645d93bc6dd4838a06b5668012485bd07065ba 100644 (file)
@@ -140,6 +140,11 @@ My_lily_parser::get_rest_element(String,  Duration * duration_p )
     rest_req_p->set_spot( here_input());
 
     velt_p->add(rest_req_p);
+    
+    Stem_req * stem_p = new Stem_req;
+    stem_p->duration_ = *duration_p;
+    stem_p->set_spot ( here_input ());
+    velt_p->add(stem_p);
     delete duration_p;
     return velt_p;
 }
@@ -149,6 +154,8 @@ My_lily_parser::get_note_element(Note_req *rq, Duration * duration_p )
 {
     Voice_element*v = new Voice_element;
     v->set_spot( here_input());
+
+    v->add(rq);
     
     if (duration_p->type_i_ >= 2) {
        Stem_req * stem_req_p = new Stem_req();
@@ -160,9 +167,6 @@ My_lily_parser::get_note_element(Note_req *rq, Duration * duration_p )
 
     rq->set_duration(*duration_p);
     rq->set_spot( here_input());
-
-
-    v->add(rq);
     delete duration_p ;
     return v;
 }
index e5e839fc28e197aab672cee6b0dc359a362d984b..cb8129d5bc14d8325290964be93b75e0a0f207aa 100644 (file)
@@ -11,6 +11,7 @@
 #include "stem.hh"
 #include "note-column.hh"
 #include "script.hh"
+#include "rest-column.hh"
 
 bool
 Note_column_register::acceptable_elem_b(Staff_elem const*elem_C)const
@@ -19,6 +20,25 @@ Note_column_register::acceptable_elem_b(Staff_elem const*elem_C)const
     return (nC == Script::static_name() || nC == Notehead::static_name() 
            || nC == Stem::static_name());
 }
+Note_column*
+Note_column_register::note_col_l()
+{
+    if (!ncol_p_){
+       ncol_p_ = new Note_column;
+       announce_element(Staff_elem_info(ncol_p_, 0));
+    }
+    return ncol_p_;
+}
+
+Rest_column *
+Note_column_register::rest_col_l()
+{
+    if (!restcol_p_) {
+       restcol_p_  = new Rest_column;
+       announce_element(Staff_elem_info(restcol_p_,0));
+    }
+    return restcol_p_;
+}
 
 void
 Note_column_register::acknowledge_element(Staff_elem_info i)
@@ -26,23 +46,41 @@ Note_column_register::acknowledge_element(Staff_elem_info i)
     if (!acceptable_elem_b(i.elem_l_))
        return;
 
-    if (!ncol_p_){
-       ncol_p_ = new Note_column;
-       announce_element(Staff_elem_info(ncol_p_, 0));
-    }
+
     char const*nC = i.elem_l_->name();
 
-    if (nC == Script::static_name())
-       ncol_p_->add((Script*)i.elem_l_);
-    else if (nC == Notehead::static_name())
-       ncol_p_->add((Notehead*)i.elem_l_);
-    else if (nC == Stem::static_name())
-       ncol_p_->add((Stem*)i.elem_l_);
+    if (nC == Script::static_name()) {
+       script_l_arr_.push((Script*)i.elem_l_);
+    } else if (nC == Notehead::static_name()) {
+       Notehead * h_l = (Notehead*)i.elem_l_;
+       if (h_l->rest_b_)
+           rest_col_l()->add(h_l);
+       else
+           note_col_l()->add(h_l);
+    }
+    else if (nC == Stem::static_name()){ 
+       stem_l_ = (Stem*)i.elem_l_;
+    }
 }
 
 void
 Note_column_register::pre_move_processing()
 {
+    Script_column *col_l = ( ncol_p_ ) ? ncol_p_ : restcol_p_;
+    if (!col_l)
+       return;
+    
+    for (int i=0; i < script_l_arr_.size(); i++)
+       col_l->add(script_l_arr_[i]);
+    
+    if (ncol_p_&&stem_l_)
+       ncol_p_->add(stem_l_);
+    if (restcol_p_) {
+       if (! restcol_p_ -> dir_i_)
+           restcol_p_->dir_i_ = dir_i_;
+       typeset_element(restcol_p_);
+       restcol_p_ =0;
+    }
     if (ncol_p_) {
        if (!   ncol_p_->dir_i_ )
            ncol_p_->dir_i_ = dir_i_;
@@ -53,6 +91,13 @@ Note_column_register::pre_move_processing()
     }
 }
 
+void
+Note_column_register::post_move_processing()
+{
+    script_l_arr_.set_size(0);
+    stem_l_ =0;
+}
+
 void
 Note_column_register::set_feature(Feature i)
 {
@@ -66,7 +111,10 @@ Note_column_register::Note_column_register()
 {
     dir_i_ =0;
     h_shift_b_ = false;
+    
     ncol_p_=0;
+    restcol_p_ =0;
+    post_move_processing();
 }
 IMPLEMENT_STATIC_NAME(Note_column_register);
 ADD_THIS_REGISTER(Note_column_register);
index 9dbc4f93ddd454294c9929d5bf0e82cc3d60e290..d3daf57a2c0e3f6afbca716965f39af363ab3390 100644 (file)
@@ -18,134 +18,23 @@ IMPLEMENT_STATIC_NAME(Note_column);
 void
 Note_column::add(Stem*stem_l)
 {
-    assert(!stem_l_);
-    stem_l_ = stem_l;
-    add_dependency(stem_l);
+    add_support(stem_l);
 }
 
 void
 Note_column::add(Notehead* n_l)
 {
-    if (head_l_arr_.size()){
-       if (n_l->rest_b_ != rest_b_) return; // ugly fix. Should think about integrating rests into colunms.
-    } else
-       rest_b_ = n_l->rest_b_;
-    
+    assert(!n_l->rest_b_);
     head_l_arr_.push(n_l);
-    add_dependency(n_l);
-}
-
-void
-Note_column::add(Script*s_l)
-{
-    script_l_arr_.push(s_l);
-    add_dependency(s_l);
-}
-
-void
-Note_column::translate(Offset o)
-{
-    for (int i=0; i < head_l_arr_.size(); i++)
-       head_l_arr_[i]->translate(o);
-    for (int i=0; i < script_l_arr_.size(); i++) 
-       script_l_arr_[i]->translate(o);
-    if (stem_l_)
-       stem_l_->translate(o);
-}
-
-
-void
-Note_column::do_print()const
-{
-    mtor << "heads: " << head_l_arr_.size() << '\n'; 
-    mtor << "scripts: " << script_l_arr_.size() << '\n'; 
-}
-
-Interval
-Note_column::do_height()const return r
-{
-    if (stem_l_)
-        r.unite(stem_l_->height());
-    for (int i=0; i < head_l_arr_.size(); i++)
-       r.unite(head_l_arr_[i]->height());
-    for (int i=0; i < script_l_arr_.size(); i++) 
-       r.unite(script_l_arr_[i]->height());
-}
-
-Interval
-Note_column::do_width()const return r;
-{
-    if (stem_l_)
-        r.unite(stem_l_->width());
-    for (int i=0; i < head_l_arr_.size(); i++)
-       r.unite(head_l_arr_[i]->width());
-    for (int i=0; i < script_l_arr_.size(); i++) 
-       r.unite(script_l_arr_[i]->width());
-}
-
-void
-Note_column::do_pre_processing()
-{
-    if (stem_l_ && !dir_i_)
-       dir_i_ = stem_l_->dir_i_;
-    
-    if (!script_l_arr_.size()) 
-       return;
-
-    Array<Script*> placed_l_arr_a[4];
-    for (int i=0; i < script_l_arr_.size(); i++) {
-       Script*s_l = script_l_arr_[i];
-       int j = (s_l->dir_i_ >0) ? 0 : 2;
-       if (!s_l->inside_staff_b_) 
-           j ++;
-       
-       placed_l_arr_a[j].push(s_l);
-    }
-    for (int j =0; j <4; j++) {
-       placed_l_arr_a[j].sort( Script::compare);
-    }
-    
-    Notehead *top_head_l=0;
-    Notehead *bot_head_l=0;
-    for (int i=0; i< head_l_arr_.size(); i++) {
-       if (head_l_arr_[i]->extremal == -1)
-           bot_head_l = head_l_arr_[i];
-       else if (head_l_arr_[i]->extremal == 1)
-           top_head_l = head_l_arr_[i];
-    }
-    /* argh. This sux. */
-    if (!top_head_l) 
-       top_head_l = bot_head_l;
-    if (!bot_head_l) 
-       bot_head_l = top_head_l;
-    //assert(bot_head_l && top_head_l);
-    Item *support_l=top_head_l;
-    int j;
-    for (j = 0; j < 2; j++ ) {
-       for (int i=0; i < placed_l_arr_a[j].size(); i++) {
-           if (support_l)
-               placed_l_arr_a[j][i]->add_support(support_l);
-           support_l = placed_l_arr_a[j][i];
-       }
-    }
-    
-    support_l=bot_head_l;
-    for (; j < 4; j++ ) {
-       for (int i=0; i < placed_l_arr_a[j].size(); i++) {
-           if (support_l)
-               placed_l_arr_a[j][i]->add_support(support_l);
-           support_l = placed_l_arr_a[j][i];
-       }
-    }
+    add_support(n_l);
 }
 
 Note_column::Note_column()
 {
     h_shift_b_ =false;
-    stem_l_ =0;
-    rest_b_ = false;
     dir_i_ =0;
 }
+
 void
 Note_column::sort()
 {
@@ -156,7 +45,7 @@ Interval_t<int>
 Note_column::head_positions_interval()const
 {
     (    (Note_column*)this)->sort();
-    return Interval_t<int> ( head_l_arr_[0]->position, 
-                            head_l_arr_.top()->position);
+    return Interval_t<int> ( head_l_arr_[0]->position_i_
+                            head_l_arr_.top()->position_i_);
 
 }
index df2becf109836459c85de012b77f3afd5cfbf3e7..6e6ca348d9371b087881699302e01337a744788f 100644 (file)
 
 Notehead::Notehead(int ss)
 {
-    x_dir = 0;
-    staff_size=ss;
-    position = 0;
-    balltype = 0;
-    dots = 0;
-    extremal = 0;
+    x_dir_i_ = 0;
+    staff_size_i_=ss;
+    position_i_ = 0;
+    balltype_i_ = 0;
+    dots_i_ = 0;
+    extremal_i_ = 0;
     rest_b_ = false;
 }
 
 void
 Notehead::set_rhythmic(Rhythmic_req*r_req_l)
 {
-    balltype = r_req_l->duration_.type_i_;
-    dots = r_req_l->duration_.dots_i_;
+    balltype_i_ = r_req_l->duration_.type_i_;
+    dots_i_ = r_req_l->duration_.dots_i_;
 }
     
 IMPLEMENT_STATIC_NAME(Notehead);
@@ -35,8 +35,8 @@ Notehead::do_print()const
 #ifndef NPRINT
     if (rest_b_)
        mtor << "REST! ";
-    mtor << "balltype "<< balltype << ", position = "<< position
-        << "dots " << dots;
+    mtor << "balltype_i_ "<< balltype_i_ << ", position_i_ = "<< position_i_
+        << "dots_i_ " << dots_i_;
 #endif
 }
 
@@ -44,47 +44,49 @@ Notehead::do_print()const
 int
 Notehead::compare(Notehead *const  &a, Notehead * const &b)
 {
-    return a->position - b->position;
+    return a->position_i_ - b->position_i_;
 }
 
 Molecule*
-Notehead::brew_molecule_p() const return out;
+Notehead::brew_molecule_p() const 
 {
+    Molecule*out = 0;
     Paper_def *p = paper();
 
     Real dy = p->internote();
     Symbol s;
     if (!rest_b_)
-       s = p->lookup_l()->ball(balltype);
+       s = p->lookup_l()->ball(balltype_i_);
     else 
-       s = p->lookup_l()->rest(balltype);
+       s = p->lookup_l()->rest(balltype_i_);
     
     out = new Molecule(Atom(s));
-    if (dots) {
-       Symbol d = p->lookup_l()->dots(dots);
+    if (dots_i_) {
+       Symbol d = p->lookup_l()->dots(dots_i_);
        Molecule dm;
        dm.add(Atom(d));
-       if (!(position %2))
+       if (!(position_i_ %2))
            dm.translate(Offset(0,dy));
        out->add_right(dm);
     }
-    out->translate(Offset(x_dir * p->note_width(),0));
-    bool streepjes = (position<-1)||(position > staff_size+1);
+    out->translate(Offset(x_dir_i_ * p->note_width(),0));
+    bool streepjes = (position_i_<-1)||(position_i_ > staff_size_i_+1);
     
-    if (rest_b_ && balltype > 2)
+    if (rest_b_ && balltype_i_ > 2)
        streepjes = false;
     
     if (streepjes) {
-       int dir = sign(position);
-       int s =(position<-1) ? -((-position)/2): (position-staff_size)/2;
+       int dir = sign(position_i_);
+       int s =(position_i_<-1) ? -((-position_i_)/2): (position_i_-staff_size_i_)/2;
        Symbol str = p->lookup_l()->streepjes(s);
        Molecule sm;
        sm.add(Atom(str));
-       if (position % 2)
+       if (position_i_ % 2)
            sm.translate(Offset(0,-dy* dir));
        out->add(sm);       
     }
     
-    out->translate(Offset(0,dy*position));
+    out->translate(Offset(0,dy*position_i_));
+    return out;
 }
 
index ec5646b8d41676ef5fb2fa190937e1c5ea068966..f0e6481f34ab64b21950e12df73ffe22c94f6b77 100644 (file)
@@ -985,6 +985,7 @@ voice_elt:
        steno_note_req notemode_duration                {
                if (!THIS->lexer_p_->note_state_b())
                        THIS->parser_error("have to be in Note mode for notes");
+               $1->set_duration (*$2);
                $$ = THIS->get_note_element($1, $2);
        }
        | RESTNAME notemode_duration            {
index 31e931a9f384c22641b867366fa302d3b3f2437d..58cdd538964131f50a8c96750649b24cd07067dc 100644 (file)
@@ -19,8 +19,9 @@ Pulk_voice::Pulk_voice(Voice*voice_l, int idx)
 }
 
 Array<Request*>
-Pulk_voice::get_req_l_arr() return req_l_arr;
+Pulk_voice::get_req_l_arr() 
 {
+    Array<Request*> req_l_arr;
     Moment w = when();
     do {
        Moment sub = subtle_moment_priorities_[subtle_idx_];
@@ -36,6 +37,7 @@ Pulk_voice::get_req_l_arr() return req_l_arr;
        }
        next();
     } while ( ok() && when () == w);
+    return req_l_arr;
 }
 
 void
index ed84c42c9b91a99daa8f162d29c8f456bd821a5c..57a030d956a550d5b2bc150641f7a8a9bcc9e933 100644 (file)
@@ -66,9 +66,9 @@ Request_register::contains_b(Request_register *reg_l)const
 }
 
 Staff_info
-Request_register::get_staff_info() return inf;
+Request_register::get_staff_info() 
 {
-    inf = daddy_reg_l_->get_staff_info();
+    return daddy_reg_l_->get_staff_info();
 }
 
 void
diff --git a/lily/rest-collision-reg.cc b/lily/rest-collision-reg.cc
new file mode 100644 (file)
index 0000000..b5a286f
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+  rest-collision-reg.cc -- implement Rest_collision_register
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "rest-collision.hh"
+#include "rest-collision-reg.hh"
+#include "collision.hh"
+#include "rest-column.hh"
+#include "note-column.hh"
+
+void
+Rest_collision_register::acknowledge_element(Staff_elem_info i)
+{
+    char const * nC = i.elem_l_->name();
+    if (nC == Collision::static_name()) {
+       collision_l_arr_.push((Collision*)i.elem_l_);
+    } 
+    else if (nC == Rest_column ::static_name()) {
+       if (!rest_collision_p_)
+           rest_collision_p_ = new Rest_collision;
+       rest_collision_p_->add((Rest_column*)i.elem_l_);
+    }
+}
+
+void
+Rest_collision_register::pre_move_processing()
+{
+    if (rest_collision_p_) {
+       typeset_element(rest_collision_p_);
+       rest_collision_p_ = 0;
+    }
+}
+
+Rest_collision_register::Rest_collision_register()
+{
+    rest_collision_p_ =0;
+}
+
+IMPLEMENT_STATIC_NAME(Rest_collision_register);
+ADD_THIS_REGISTER(Rest_collision_register);
diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc
new file mode 100644 (file)
index 0000000..2a6e1e7
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+  rest-collision.cc -- implement Rest_collision
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "rest-collision.hh"
+#include "rest-column.hh"
+#include "collision.hh"
+
+void
+Rest_collision::add(Rest_column *rc_l)
+{
+    rest_l_arr_.push(rc_l);
+    add_dependency(rc_l);
+}
+void
+Rest_collision::add(Collision * c_l)
+{
+    add_dependency(c_l);
+    for (int i=0; i < c_l->clash_l_arr_.size(); i ++)
+       ncol_l_arr_.push(c_l->clash_l_arr_[i]);
+}
+
+
+void
+Rest_collision::do_post_processing()
+{
+    #if 0
+        bool rest_b_a[4];
+       rest_b_a[j] = (col_l_a[j]) ? col_l_a[j]->rest_b_ : false;       
+    do {
+       int i1 = idx(d, false);
+       int i2 = idx(d,true);
+       if (!intersection(y_extent[i1] , 
+                         y_extent[i2]).empty_b()) {
+           if (rest_b_a[i1]) {
+               y_off[i1] = -y_extent[i1][-d] + y_extent[1][d] + d*4; // ugh
+               y_extent[i1] += y_off[i1];
+           }
+       }
+    } while ((d *= -1) != 1);
+
+    do {
+       int i1 = idx(d, false);
+       int i2 = idx(-d,false);
+       
+       if (d*(y_extent[i1][-d] - y_extent[i2][d] )< 0&& rest_b_a[i1]) {
+           y_off[i1] = -y_extent[i1][-d] + y_extent[i2][d] +d* 4; // ugh
+           y_extent[i1] += y_off[i1];
+       }
+    } while ((d *= -1) != 1);
+    
+#endif
+}
+IMPLEMENT_STATIC_NAME(Rest_collision);
diff --git a/lily/rest-column.cc b/lily/rest-column.cc
new file mode 100644 (file)
index 0000000..5ab8b16
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+  rest-column.cc -- implement Rest_column
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "rest-column.hh"
+#include "notehead.hh"
+#include "rest-column.hh"
+
+void
+Rest_column::add(Notehead *n_l)
+{
+    add_support(n_l);
+    head_l_arr_.push(n_l);
+}
+
+void
+Rest_column::translate_y(Real dy_f)
+{
+    for (int i=0; i < head_l_arr_.size(); i++)
+       head_l_arr_[i]->translate(Offset(0,dy_f));
+}
+
+IMPLEMENT_STATIC_NAME(Rest_column);
diff --git a/lily/script-column.cc b/lily/script-column.cc
new file mode 100644 (file)
index 0000000..bc309b1
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+  script-column.cc -- implement Script_column
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "script-column.hh"
+#include "debug.hh"
+#include "script.hh"
+#include "notehead.hh"
+#include "stem.hh"
+
+IMPLEMENT_STATIC_NAME(Script_column);
+
+
+void
+Script_column::add(Script*s_l)
+{
+    script_l_arr_.push(s_l);
+    add_dependency(s_l);
+}
+
+void
+Script_column::translate(Offset o)
+{
+    for (int i=0; i < script_l_arr_.size(); i++) 
+       script_l_arr_[i]->translate(o);
+}
+
+
+void
+Script_column::do_print()const
+{
+    mtor << "scripts: " << script_l_arr_.size() << '\n'; 
+}
+
+Interval
+Script_column::do_height()const return r
+{
+    for (int i=0; i < script_l_arr_.size(); i++) 
+       r.unite(script_l_arr_[i]->height());
+}
+
+Interval
+Script_column::do_width()const 
+{
+    Interval r;
+    for (int i=0; i < script_l_arr_.size(); i++) 
+       r.unite(script_l_arr_[i]->width());
+    return r;
+}
+
+void
+Script_column::do_pre_processing()
+{
+    if (!script_l_arr_.size()) 
+       return;
+    /* up+outside, up+inside, down+outside, down+inside */
+    Array<Script*> placed_l_arr_a[4];
+    for (int i=0; i < script_l_arr_.size(); i++) {
+       Script*s_l = script_l_arr_[i];
+       int j = (s_l->dir_i_ >0) ? 0 : 2;
+       if (!s_l->inside_staff_b_) 
+           j ++;
+       
+       placed_l_arr_a[j].push(s_l);
+    }
+    
+    for (int j =0; j <4; j++) {
+       placed_l_arr_a[j].sort( Script::compare);
+    }
+
+
+    for (int j =0; j < 4; j++) {
+       if (placed_l_arr_a[j].size())
+           for (int i=0; i  < support_l_arr_.size(); i++)
+               placed_l_arr_a[j][0]->add_support( support_l_arr_[i]);
+    }
+    Item * support_l=0;
+    int j = 0;
+    for (; j < 2; j++ ) {
+       for (int i=1; i < placed_l_arr_a[j].size(); i++) {
+           if (support_l)
+               placed_l_arr_a[j][i]->add_support(support_l);
+           support_l = placed_l_arr_a[j][i];
+       }
+    }
+    support_l = 0;
+    for (; j < 4; j++ ) {
+       for (int i=1; i < placed_l_arr_a[j].size(); i++) {
+           if (support_l)
+               placed_l_arr_a[j][i]->add_support(support_l);
+           support_l = placed_l_arr_a[j][i];
+       }
+    }
+}
+
+
+void
+Script_column::add_support(Item*i_l)
+{
+    support_l_arr_.push(i_l);
+    add_dependency(i_l);
+}
index 67ab628183c2b95ae1c0af8e80022e65f5ffc660..b68298d5dead3d3274f22aa155c96daaf3fd522f 100644 (file)
@@ -75,6 +75,7 @@ Script_register::pre_move_processing()
     }
     script_p_arr_.set_size(0);
 }
+
 void
 Script_register::post_move_processing()
 {
index 6e8e9e5f69495ce23884e49762c6e2d27e46c80f..4ecc63ec6d100df87966c68ca6a3e2a26b4a46af 100644 (file)
@@ -23,8 +23,8 @@ Slur::Slur()
 Offset
 Slur::center() const
 {
-    int pos1 = encompass.top()->position;
-    int pos2 = encompass[0]->position;
+    int pos1 = encompass.top()->position_i_;
+    int pos2 = encompass[0]->position_i_;
 
     int dy =  pos1-pos2;
 
@@ -45,7 +45,7 @@ Slur::set_default_dir()
 {
     int sumpos=0;
     for (int i=0; i < encompass.size(); i ++) {
-       sumpos += encompass[i]->position;
+       sumpos += encompass[i]->position_i_;
     }
 
     /* should consult stems */
@@ -97,20 +97,20 @@ Slur::brew_molecule_p() const
 
     int minp=1000, maxp=-1000; // todo    
     for (int i=0; i<encompass.size(); i++) {
-       minp = encompass[i]->position <? minp;
-       maxp = encompass[i]->position >? maxp;
+       minp = encompass[i]->position_i_ <? minp;
+       maxp = encompass[i]->position_i_ >? maxp;
     }
     assert(encompass.size()>0);        // todo
     
     Notehead *lnote_p =encompass[0];
     Notehead *rnote_p =encompass.top();
-    int lpos_i = lnote_p->position;
-    int rpos_i = rnote_p->position;
-    Offset  left_off(lnote_p->x_dir, lpos_i + 2*dir_i_);
-    Offset right_off(lnote_p->x_dir, rpos_i + 2*dir_i_);
-    if (!lnote_p->extremal)
+    int lpos_i = lnote_p->position_i_;
+    int rpos_i = rnote_p->position_i_;
+    Offset  left_off(lnote_p->x_dir_i_, lpos_i + 2*dir_i_);
+    Offset right_off(lnote_p->x_dir_i_, rpos_i + 2*dir_i_);
+    if (!lnote_p->extremal_i_)
        left_off += Offset(0.5, -dir_i_);
-    if (!rnote_p->extremal)
+    if (!rnote_p->extremal_i_)
        right_off+= Offset(-0.5, -dir_i_);
     
     int dy = int(right_off.y - left_off.y);
index 191f072de227b0bba4840f630ea9ed4fd4773e35..331ffbe92fddffe064bfc54a65111c8ff13b4850 100644 (file)
@@ -40,7 +40,10 @@ Staff_elem::Staff_elem(Staff_elem const&s)
   */
 Staff_elem::~Staff_elem()
 {
-   delete output;
+    assert(status < DELETED);
+    delete output;
+    status = DELETED;
+    output = 0;
 }
 
 void
@@ -50,8 +53,9 @@ Staff_elem::translate(Offset O)
 }
 
 Interval
-Staff_elem::do_width() const return r;
+Staff_elem::do_width() const 
 {
+    Interval r;
     
     if (!output){
        Molecule*m = brew_molecule_p();
@@ -59,7 +63,9 @@ Staff_elem::do_width() const return r;
        delete m;
     } else
        r = output->extent().x;
+    return r;
 }
+
 Interval
 Staff_elem::width() const
 {
@@ -71,14 +77,16 @@ Staff_elem::width() const
     return r;
 }
 Interval
-Staff_elem::do_height() const return r
+Staff_elem::do_height() const 
 {
+    Interval r;
     if (!output){
        Molecule*m      = brew_molecule_p();
        r = m->extent().y;
        delete m;
     } else
        r = output->extent().y;
+    return r;
 }
 
 Interval
index 983c6a6d2e8a2ce1357bede9081f54e29d0115fa..9f5cc9cd81daf4788f40327c47c31d1e8e65f3f2 100644 (file)
 #include "input-register.hh"
 
 Staff_info
-Staff_registers::get_staff_info() return inf;
+Staff_registers::get_staff_info() 
 {
+    Staff_info inf;
     inf = Request_register::get_staff_info();
     inf.staff_sym_l_=staff_sym_l_;
     inf.c0_position_i_l_ = &c0_position_i_;
+    return inf;
 }
 
 Staff_registers::Staff_registers(Input_register const*ireg_C)
index b9974b5b5ac44802a7eef8c3ce24882086791fca..34aab2833296981aaa1f2f382ebe794949a64825 100644 (file)
@@ -38,14 +38,16 @@ Staff_side::read_staff_sym()
 
 
 Interval
-Staff_side::support_height() const return r;
+Staff_side::support_height() const
 {
+    Interval r;
     
     for (int i=0; i < support_l_arr_.size(); i++)
        r.unite(support_l_arr_[i]->height());
     if (r.empty_b()) {
        r = Interval(0,0);
     }
+    return r;
 }
 
 void
index 51e4a42ebe4df586714f5e70b1c8bc3d40102562..dae02480b91f9ba0391019be48e8c03b35f757fb 100644 (file)
@@ -85,17 +85,16 @@ Stem_beam_register::process_requests()
                get_staff_info().time_C_->whole_in_measure_,
                stem_req_l_->duration());
 
-       stem_p_->flag = stem_req_l_->duration_.type_i_;
+       stem_p_->flag_i_ = stem_req_l_->duration_.type_i_;
 
        if (beam_p_) {
            if (stem_req_l_->duration_.type_i_<= 4)
-               
-                        stem_req_l_->warning( "stem doesn't fit in Beam");
+               stem_req_l_->warning( "stem doesn't fit in Beam");
            else
                beam_p_->add(stem_p_);
-           stem_p_->print_flag = false;
+           stem_p_->print_flag_b_ = false;
        } else {
-           stem_p_->print_flag = true;
+           stem_p_->print_flag_b_ = true;
        }
        
        announce_element(Staff_elem_info(stem_p_, stem_req_l_));
@@ -111,8 +110,7 @@ Stem_beam_register::acknowledge_element(Staff_elem_info info)
     if (info.elem_l_->name() == Notehead::static_name() &&
        stem_req_l_->duration() == info.req_l_->rhythmic()->duration()){
        Notehead * n_l= (Notehead*)info.elem_l_;
-       if (!n_l->rest_b_)
-           stem_p_->add((Notehead*)info.elem_l_);
+       stem_p_->add(n_l);
     }
 }
 void
index 5e26f0561870ecd2d5f8183a77c353610e1e47ea..ee3bc643018ec8f2e582307e6071d904f40a5ba7 100644 (file)
 
 const int STEMLEN=7;
 
+int
+Stem::min_head_i()const
+{
+    int m = 1000;
+    for (int i =0; i < head_l_arr_.size(); i++)
+       m = m <? head_l_arr_[i]->position_i_;
+    return m;
+}
 
-Stem::Stem(int c) //, Moment len)
+int
+Stem::max_head_i() const
 {
-    beams_left = 0;
-    beams_right = 0;
-    minnote = 1000;            // invalid values
-    maxnote = -1000;
-    bot = top = 0;
-    flag = 4;
+    int m = -1000;
+    for (int i =0; i < head_l_arr_.size(); i++)
+       m = m >? head_l_arr_[i]->position_i_;
+    return m;
+    
+}
+
+Stem::Stem(int c) 
+{
+    beams_left_i_ = 0;
+    beams_right_i_ = 0;
+
+    stem_bottom_f_ = stem_top_f_ = 0;
+    flag_i_ = 4;
     dir_i_ =0;
-    staff_center=c;
-    stemlen=0;
-    print_flag=true;
-    stem_xoffset=0;
+    staff_size_i_ = c;
+
+    print_flag_b_=true;
+    stem_xoffset_f_ =0;
+
 }
 
 IMPLEMENT_STATIC_NAME(Stem);
@@ -32,46 +50,68 @@ void
 Stem::do_print() const
 {
 #ifndef NPRINT
-    mtor << "flag "<< flag << " print_flag " << print_flag
-        << "min,max [" << minnote << ", " << maxnote << "]";
+    mtor << "flag "<< flag_i_ << " print_flag_b_ " << print_flag_b_;
+
 #endif
 }
+
+Real 
+Stem::stem_length_f()const
+{
+    return stem_top_f_-stem_bottom_f_ ;
+}
+
+Real
+Stem::stem_start_f()const
+{
+    return (dir_i_ < 0)? stem_top_f_ : stem_bottom_f_;
+}
+
+Real
+Stem::stem_end_f() const
+{
+    return (dir_i_ < 0)? stem_bottom_f_ : stem_top_f_;
+}
+
 void
 Stem::set_stemend(Real se)
 {
-
     // todo: margins
-    if (!  ((dir_i_ > 0 && se >= maxnote) || (se <= minnote && dir_i_ <0))  )  
+    if (!  ((dir_i_ > 0 && se >= max_head_i()) || 
+           (se <= min_head_i() && dir_i_ <0))  )       
        warning("Weird stem size; check for narrow beams");
-    
-    top = (dir_i_ < 0) ? maxnote           : se;
-    bot = (dir_i_ < 0) ? se  : minnote;
-    flag = dir_i_*abs(flag);
+
+    stem_top_f_  = (dir_i_ < 0) ? max_head_i()           : se;
+    stem_bottom_f_  = (dir_i_ < 0) ? se  : min_head_i();
 }
 
 void
 Stem::add(Notehead *n)
 {
-    assert(status < PRECALCED);
-    
-    if (n->balltype == 1)
-       return;
-    int p = n->position;
-    if (p < minnote)
-       minnote = p;
-    if (p > maxnote)
-       maxnote = p;
-    heads.push(n);
     n->add_dependency(this);
+    if (n->rest_b_) {
+       rest_l_arr_.push(n);
+    } else if (n->balltype_i_ == 1) {
+       whole_l_arr_.push(n);
+       return;
+    } else{
+       head_l_arr_.push(n);
+    }
 }
 
+bool
+Stem::invisible_b()const
+{
+    return !head_l_arr_.size();
+}
 
 int
 Stem::get_default_dir()
 {
+    int staff_center = staff_size_i_ /2;
     if (dir_i_)
        return dir_i_;
-    Real mean = (minnote+maxnote)/2;
+    Real mean = (min_head_i() + max_head_i())/2;
     return (mean > staff_center) ? -1: 1;
 }
 
@@ -87,90 +127,94 @@ Stem::set_default_stemlen()
     if (!dir_i_)
        set_default_dir();
 
-    int stafftop = 2*staff_center;
-    stemlen = STEMLEN  + (maxnote - minnote);
     
     // uhh... how about non 5-line staffs?
-    if (maxnote < -2 && dir_i_ == 1){
-       int t = staff_center - staff_center/2; 
-       stemlen = t - minnote +2;
-    } else if (minnote > stafftop + 2 && dir_i_ == -1) {
-       int t = staff_center + staff_center/2;
-       stemlen = maxnote -t +2;
-    }
+    if ((max_head_i() < -2 && dir_i_ == 1 )
+       ||(min_head_i() > staff_size_i_ + 2 && dir_i_ == -1) ){
+       set_stemend(    staff_size_i_ /2 );
+    } else {
+       set_stemend( (dir_i_ > 0) ? max_head_i() + STEMLEN : 
+                                    min_head_i() - STEMLEN);
 
-    assert(stemlen);
+    }
 }
 
 
 void
 Stem::set_default_extents()
 {
-    if (minnote > maxnote) {
-       warning("Empty stem. Ugh!");
-       minnote = -10;
-       maxnote = 20;
-    }
-
-    if (!stemlen)
+    if (!stem_length_f())
        set_default_stemlen();
 
-    set_stemend((dir_i_< 0) ? maxnote-stemlen: minnote +stemlen);
+    set_stemend((dir_i_< 0) ? 
+               max_head_i()-stem_length_f(): min_head_i() +stem_length_f());
     if (dir_i_ > 0){   
-       stem_xoffset = paper()->note_width()-paper()->rule_thickness();
+       stem_xoffset_f_ = paper()->note_width()-paper()->rule_thickness();
     } else
-       stem_xoffset = 0;
+       stem_xoffset_f_ = 0;
 }
 
 void
 Stem::set_noteheads()
 {
-    if(!heads.size())
+    if(!head_l_arr_.size())
        return;
-    heads.sort(Notehead::compare);
-    heads[0]->extremal = -1;
-    heads.top()->extremal = 1;
+    head_l_arr_.sort(Notehead::compare);
+    head_l_arr_[0]->extremal_i_ = -1;
+    head_l_arr_.top()->extremal_i_ = 1;
     int parity=1;
-    int lastpos = heads[0]->position;
-    for (int i=1; i < heads.size(); i ++) {
-       int dy =abs(lastpos- heads[i]->position);
+    int lastpos = head_l_arr_[0]->position_i_;
+    for (int i=1; i < head_l_arr_.size(); i ++) {
+       int dy =abs(lastpos- head_l_arr_[i]->position_i_);
        
        if (dy <= 1) {
            if (parity)
-               heads[i]->x_dir = (stem_xoffset>0) ? 1:-1;
+               head_l_arr_[i]->x_dir_i_ = (stem_xoffset_f_>0) ? 1:-1;
            parity = !parity;
        } else
            parity = 0;
-       lastpos = heads[i]->position;
+       lastpos = head_l_arr_[i]->position_i_;
     }
 }
 
 void
 Stem::do_pre_processing()
 {
-    if (bot == top)
+    if (stem_bottom_f_== stem_top_f_)
        set_default_extents();
     set_noteheads();
+    flag_i_ = dir_i_*abs(flag_i_);
 }
 
 
 Interval
 Stem::do_width()const
 {
-    if (!print_flag || abs(flag) <= 4)
+    if (!print_flag_b_ || abs(flag_i_) <= 4)
        return Interval(0,0);   // TODO!
     Paper_def*p= paper();
-    Interval r(p->lookup_l()->flag(flag).dim.x);
-    r+= stem_xoffset;
+    Interval r(p->lookup_l()->flag(flag_i_).dim.x);
+    r+= stem_xoffset_f_;
     return r;
 }
 
 Molecule*
-Stem::brew_molecule_p()const return out;
+Stem::brew_molecule_p()const 
 {
+    Molecule *out =0;
+    if ( invisible_b() )
+       return Staff_elem::brew_molecule_p();
+    
+    Real bot  = stem_bottom_f_;
+    Real top = stem_top_f_;
+    if (min_head_i() > max_head_i()) {
+       warning("Empty stem. Ugh!");
+       bot = -10;
+       top = 20;
+    }
+
     assert(bot!=top);
  
-    
     Paper_def *p =paper();
 
     Real dy = p->internote();
@@ -178,24 +222,25 @@ Stem::brew_molecule_p()const return out;
 
     out = new Molecule(Atom(ss));
 
-    if (print_flag&&abs(flag) > 4){
-       Symbol fl = p->lookup_l()->flag(flag);
+    if (print_flag_b_&&abs(flag_i_) > 4){
+       Symbol fl = p->lookup_l()->flag(flag_i_);
        Molecule m(fl);
-       if (flag < -4){         
+       if (flag_i_ < -4){              
            out->add_bottom(m);
-       } else if (flag > 4) {
+       } else if (flag_i_ > 4) {
            out->add_top(m);
        } else
            assert(false); 
     }
 
-    out->translate(Offset(stem_xoffset,0));
+    out->translate(Offset(stem_xoffset_f_,0));
+    return out;
 }
 
 Real
-Stem::hindex()const
+Stem::hpos_f()const
 {
-    return hpos_f() + stem_xoffset;
+    return Item::hpos_f() + stem_xoffset_f_;
 }
 
 
index becdf1e29f63862f2f73a7a6daf7c79b16ccf921..29674b58d4909909756f4fa2a724babfe50827ff 100644 (file)
@@ -15,7 +15,7 @@ Symbol::Symbol(String s, Box b)
 
 
 String
-Symbol::str()const return s;
+Symbol::str()const 
 {
-    s = "symbol(\'"+tex+"\', (" + dim.x.str() + ", " + dim.y.str() + "))";
+    return  "symbol(\'"+tex+"\', (" + dim.x.str() + ", " + dim.y.str() + "))";
 }
index 03811ff063d72db1bfa7674203ee3f823d54c94e..fd9a9b6dafcf3986cad0dfaf9dedeaffce355e6f 100644 (file)
@@ -28,9 +28,11 @@ Voice_element::print() const
 {
 #ifndef NPRINT
     mtor << "voice_element { dur :"<< duration_ <<"\n";
+    mtor << "principal: " << principal_req_l_->name() << "\n";
     for (iter_top(req_p_list_,rc); rc.ok(); rc++) {
        rc->print();
     }
+    
     mtor << "}\n";
 #endif
 }
@@ -38,6 +40,9 @@ Voice_element::print() const
 void
 Voice_element::add(Request*r)
 {
+    if (! principal_req_l_ ) 
+       principal_req_l_ = r;
+
     if (r->duration()) {
        assert (!duration_  || duration_ == r->duration());
        duration_ = r->duration();
@@ -50,6 +55,7 @@ Voice_element::add(Request*r)
 
 Voice_element::Voice_element()
 {
+    principal_req_l_ = 0;
     voice_C_ = 0;
     duration_ = 0;
 }
@@ -57,7 +63,6 @@ Voice_element::Voice_element()
 Voice_element::Voice_element(Voice_element const&src)
     : Input(src)
 {
-  
     voice_C_=0;
     for (iter_top(src.req_p_list_, i); i.ok(); i++)
        add(i->clone());
index 17e63918fe19bcd0c83fcf89ed104252b0b11728..da852c79ac685223075a4b9b8f10ad7330e8913a 100644 (file)
@@ -98,13 +98,15 @@ Walker_registers::post_move_processing()
 
 
 Staff_info
-Walker_registers::get_staff_info() return inf;
+Walker_registers::get_staff_info()
 {
+    Staff_info inf;
     if (walk_l_->score_walk_l_)        // we get called ctors
        inf.break_allowed_b_ = walk_l_->score_walk_l_->break_allowed_b();
     inf.walk_l_ = walk_l_;
     inf.time_C_ = &walk_l_->time_;
     inf.rhythmic_C_ = walk_l_->default_grouping;
+    return inf;
 }
 
 Paper_def*
index 2e0b686e66f3a716524182279c4269d9b16b6702..f9ba7640d70cebddb7eb4e29ce885aa12835ef50 100644 (file)
@@ -70,7 +70,7 @@ $(outdir)/%.1: %.pod
        echo 0 > $@
 
 
-%.text: check-doc-deps
+$(depth)/%.text: check-doc-deps
        rm -f $@
        ln `find ${depth}/Documentation -name $@|head -1` .
 
index bd04277f73ab6623d5a9bde878ca1eafb377efed..8037be5e85d7c2c7b2622c368a42ecbb4f24f9f5 100644 (file)
@@ -63,9 +63,14 @@ $(SHAREDLIBRARY):  $(build) $(OFILES) $(MODULE_LIBDEPS)
 #
 lib: $(LIBRARY)
 #
-
+TOCLEAN= $(allobs) $(alldeps)
 clean: localclean
-       rm -f $(allobs) $(alldeps)
+ifdef allobs
+       rm -f $(allobs)
+endif
+ifdef alldeps
+       rm -f $(alldeps)
+endif
 ifdef SUBDIRS
        set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
 endif
index 6989f8034abb74afe811f1390445bad25a106e61..2b234dba7ca230a2c2cf729a40abdcaead15c439 100644 (file)
@@ -2,7 +2,7 @@
 
 Begin3
 Title: LilyPond
-Version: 0.0.55
+Version: 0.0.56
 Entered-date: 04/23/97
 Description: LilyPond is a program which converts a music-script (mudela) into
 TeX output, or MIDI to produce multi-staff scores. Features include multiple
@@ -13,7 +13,7 @@ Author: hanwen@stack.nl (Han-Wen Nienhuys)
        jan@digicash.com (Jan Nieuwenhuizen)
 Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
 Primary-site: pcnov095.win.tue.nl /pub/lilypond/  
-       300k lilypond-0.0.55.tar.gz
+       300k lilypond-0.0.56.tar.gz
 Alternate-site: 
 Original-site: 
 Platform: unix/win32, GNU C++
index 980a4e3a4cd67e138d2f866dc58d5fe4c4989bd1..24760c7cb49dffa5da7cac31d8086c06d6306510 100644 (file)
@@ -1,9 +1,9 @@
 Name: lilypond
-Version: 0.0.55
+Version: 0.0.56
 Release: 1
 Copyright: GPL
 Group: Applications/Publishing
-Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.55.tar.gz
+Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.56.tar.gz
 Summary: A preprocessor to make TeX typeset music.
 URL: http://www.stack.nl/~hanwen/lilypond
 Packager: Han-Wen Nienhuys <hanwen@stack.nl>