]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 0.0.26 release/0.0.26
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 31 Jan 1997 17:34:06 +0000 (18:34 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 31 Jan 1997 17:34:06 +0000 (18:34 +0100)
127 files changed:
.dstreamrc
Documentation/Makefile
Documentation/faq.pod
Documentation/lelie_logo.png [new file with mode: 0644]
Documentation/lilygut.pod
Initial.make
Makefile
NEWS
Sources.make
TODO
Variables.make
configure
deps/Makefile
flower/Makefile
flower/Variables.make
flower/assoc.hh
flower/path.hh
flower/smat.cc
flower/sstack.hh
flower/textdb.cc
flower/varray.hh
hdr/accidental.hh
hdr/bar.hh
hdr/beam.hh
hdr/clefitem.hh
hdr/complexstaff.hh [new file with mode: 0644]
hdr/complexwalker.hh [new file with mode: 0644]
hdr/debug.hh
hdr/grouping.hh
hdr/item.hh
hdr/keyitem.hh
hdr/localkeyitem.hh
hdr/lyriccolumn.hh
hdr/lyricwalker.hh
hdr/melodicstaff.hh
hdr/meter.hh
hdr/notehead.hh
hdr/parseconstruct.hh
hdr/proto.hh
hdr/register.hh [new file with mode: 0644]
hdr/request.hh
hdr/rest.hh
hdr/rhythmstaff.hh
hdr/script.hh
hdr/simplestaff.hh
hdr/simplewalker.hh
hdr/slur.hh
hdr/spanner.hh
hdr/staff.hh
hdr/staffelem.hh
hdr/staffwalker.hh
hdr/stcol.hh
hdr/stem.hh
hdr/textitem.hh
hdr/textspanner.hh
hdr/voice.hh
input/Makefile
input/maartje.ly
input/pavane.ly
input/scales.ly
input/standchen.lily [deleted file]
input/standchen.ly [new file with mode: 0644]
input/twinkle.ly
ltest.tex [new file with mode: 0644]
src/bar.cc
src/beam.cc
src/break.cc
src/clefitem.cc
src/complexmelodicstaff.cc [new file with mode: 0644]
src/complexprint.cc [new file with mode: 0644]
src/complexstaff.cc [new file with mode: 0644]
src/complexwalker.cc [new file with mode: 0644]
src/getcommands.cc
src/grouping.cc
src/groupregs.cc [new file with mode: 0644]
src/inputcommand.cc
src/inputscore.cc
src/inputstaff.cc
src/item.cc
src/key.cc
src/keyitem.cc
src/lexer.l
src/lexerinit.cc
src/linespace.cc
src/localkeyitem.cc
src/lookup.cc
src/lyriccolumn.cc
src/lyricstaff.cc
src/lyricwalker.cc
src/main.cc
src/melodicstaff.cc
src/meter.cc
src/molecule.cc
src/mylexer.cc
src/note.cc
src/notehead.cc
src/parser.y
src/pscore.cc
src/qlp.cc
src/qlpsolve.cc
src/register.cc [new file with mode: 0644]
src/request.cc
src/rest.cc
src/rhythmstaff.cc
src/sccol.cc
src/scores.cc
src/script.cc
src/simplestaff.cc
src/simplewalker.cc
src/slur.cc
src/spanner.cc
src/staff.cc
src/staffcommands.cc
src/staffelem.cc
src/staffwalker.cc
src/stcol.cc
src/stem.cc
src/template6.cc [new file with mode: 0644]
src/tex.cc
src/texbeam.cc
src/textitem.cc
src/textspanner.cc
src/voice.cc
src/voicegroup.cc [new file with mode: 0644]
src/voiceregs.cc [new file with mode: 0644]
src/warn.cc
src/wordwrap.cc

index da11eb77dba573ec96332ad905383090b6ef2946..5ca2fa850cd1aac38ca3dae767ed93c67456c1d6 100644 (file)
@@ -13,10 +13,10 @@ Idealspacing                1
 
 # yydebug
 InitParser             1
 
 # yydebug
 InitParser             1
-Parser                 0
-
+Parser                 1
 
 # FlexLexer debug
 
 # FlexLexer debug
+InitLexer              1
 Lexer                  1
 
 parse_duration         1
 Lexer                  1
 
 parse_duration         1
index ab7466ffe5b9f72bf5a70f0defdaebd68439d4f8..f8b08366bcc6c702523c7b54bbc459fe5b974186 100644 (file)
@@ -3,7 +3,7 @@ PODS=README.pod CodingStyle.pod lilygut.pod lilyinput.pod error.pod\
 TXTS=$(PODS:.pod=.txt)
 MANS=$(PODS:.pod=.1)
 HTMLS=$(PODS:.pod=.html)
 TXTS=$(PODS:.pod=.txt)
 MANS=$(PODS:.pod=.1)
 HTMLS=$(PODS:.pod=.html)
-DISTFILES=$(PODS) Makefile
+DISTFILES=$(PODS) Makefile lelie_logo.png #lelieblond.gif 
 
 
 default:
 
 
 default:
index 0b841b97052e69ba86ec384facabeb6343802424..2544a71338a39f95f9ac71fb03492019721b0f54 100644 (file)
@@ -5,17 +5,6 @@ FAQ - LilyPond FAQs
 =head1 DESCRIPTION
 
 
 =head1 DESCRIPTION
 
 
-
-Q: I want to enter meterchanges inside the music.
-
-A: You can't; a meterchange is scorewide (well, staffwide in some
-modern music). If allowed inside the music, we get complicated and
-conflicting situations if two voices asked for (possibly different)
-meterchanges.
-
-You can mark certain spots, though: please check out F<cadenza.ly>
-
-
 Q: Why are [] around the notes, and () inbetween?
 
 A: [] designate beams, a note can only be in one beam at the same
 Q: Why are [] around the notes, and () inbetween?
 
 A: [] designate beams, a note can only be in one beam at the same
@@ -24,3 +13,11 @@ time. () is a slur, which connects notes. You need to be able to specify
        a()a()a
 
 
        a()a()a
 
 
+Q: I want a DOS/NT/W95 port.
+
+A: I haven't had time to find a GCC crosscompiler to DOS/win (in rpm,
+please :).  No, I'm not considering compilation in W95, but feel free to give it a try.
+
+Q: Why GPL?
+
+A: Yes.
diff --git a/Documentation/lelie_logo.png b/Documentation/lelie_logo.png
new file mode 100644 (file)
index 0000000..deaaa9d
Binary files /dev/null and b/Documentation/lelie_logo.png differ
index 20d5f0364bc8a4db4678cc4d8b41fa21460c2755..eae32d2e01354722be4435d8a628749c7b38dbd7 100644 (file)
@@ -69,9 +69,7 @@ which is put into a percussion-Staff, will be typeset as the rythm of
 that voice.
 
 After C<Staff> made up her mind, the resultant items and
 that voice.
 
 After C<Staff> made up her mind, the resultant items and
-spanners are put on the PScore, and pointers to these items are
-stored in the C<Voice_element>. This construction enables the
-beams/stems to look up the balls it has to connect to. 
+spanners are put on the PScore.
 
 =over 5
 
 
 =over 5
 
@@ -191,10 +189,10 @@ commands (like INTERPRET) may follow this sequence.
 
 =head1 SPACING
 
 
 =head1 SPACING
 
-I think my way is the most elegant algorithm i've seen so far.  Some
-terminology: I call a vertical group of symbols (notes) which start at
-the same time a "column".  Each line of a score has notes in it,
-grouped in columns. The difference in starting time between those
+I think my method is the most elegant algorithm i've seen so far.
+Some terminology: I call a vertical group of symbols (notes) which
+start at the same time a "column".  Each line of a score has notes in
+it, grouped in columns. The difference in starting time between those
 columns makes it possible to determine ideal distances between those
 columns.
 
 columns makes it possible to determine ideal distances between those
 columns.
 
index 1c2d8abb10e98f5af1f43e2fcbff698a03d7d1c5..416a7fcb6e6968497bd014a74d2fc0560e459563 100644 (file)
@@ -7,6 +7,6 @@ include Generate.make
 alldeps: #$(ALLDEPS)
        touch $(DEPDIR)/dummy.dep
 
 alldeps: #$(ALLDEPS)
        touch $(DEPDIR)/dummy.dep
 
-$(DEPDIR)/%.dep:  $(CCDIR)/%.cc
-       $(DODEP) $(CXX) -E  $(CXXFLAGS) $^ > /dev/null
+#$(DEPDIR)/%.dep:  $(CCDIR)/%.cc
+#      $(DODEP) $(CXX) -E  $(CXXFLAGS) $^ > /dev/null
 
 
index c2b59dc66ae50e9e333eb50419dab3227dd7d12c..75f56e1ccd07d141c854b868cb6463bdf9ca77ea 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@ clean:
        done
 
 distclean: clean
        done
 
 distclean: clean
-       rm -f  version.hh $(gencc) .GENERATE *~ deps/*.dep
+       rm -f  version.hh $(gencc) .GENERATE *~ $(ALLDEPS)
 
 all: kompijl doc
 
 
 all: kompijl doc
 
@@ -34,7 +34,7 @@ $(OBJECTDIR)/%.o: $(CCDIR)/%.cc
 
 include $(DEPDIR)/*.dep
 
 
 include $(DEPDIR)/*.dep
 
-version.o: $(obs) version.hh
+$(OBJECTDIR)/version.o: $(obs) $(HEADERDIR)/version.hh
 
 include Generate.make
 
 
 include Generate.make
 
diff --git a/NEWS b/NEWS
index fd677144a694f73072355661f4d14b6634d7d803..1ed9d91e5f4a41eaa783dc3238f2d1477cdfd42b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,15 @@
+pl 26
+       - Documentation/lelie_logo.png
+       - 8-bit chars for input (see ltest.tex) (MB)
+       - quotes around string now optional
+Bugfixes:
+       - unmatched ] (MB)
+Internal:
+       - print/name methods of Staff_elem
+       - added Request_register
+       - Voice_group_registers, Voice_registers, *_register
+       - Complex_staff
+
 pl 25
        - other clefs added, keys typeset properly (MB)
 
 pl 25
        - other clefs added, keys typeset properly (MB)
 
index 573861e9b72e42fe8902cf32e186faad13a272c2..e4e9834da69a37c0959abe48cb3299e0f5d998c3 100644 (file)
@@ -2,7 +2,8 @@
 # sourcefiles to be shipped. Also for dependencies
 
 hdr=   accidental.hh bar.hh beam.hh boxes.hh break.hh clef.hh clefitem.hh\
 # sourcefiles to be shipped. Also for dependencies
 
 hdr=   accidental.hh bar.hh beam.hh boxes.hh break.hh clef.hh clefitem.hh\
-       command.hh const.hh debug.hh dimen.hh directionalspanner.hh\
+       command.hh complexwalker.hh complexstaff.hh\
+       const.hh debug.hh dimen.hh directionalspanner.hh\
        getcommand.hh glob.hh globvars.hh grouping.hh idealspacing.hh\
        identifier.hh identparent.hh inputcommand.hh inputcommands.hh\
        inputmusic.hh inputscore.hh inputstaff.hh item.hh key.hh keyitem.hh\
        getcommand.hh glob.hh globvars.hh grouping.hh idealspacing.hh\
        identifier.hh identparent.hh inputcommand.hh inputcommands.hh\
        inputmusic.hh inputscore.hh inputstaff.hh item.hh key.hh keyitem.hh\
@@ -12,15 +13,19 @@ hdr=   accidental.hh bar.hh beam.hh boxes.hh break.hh clef.hh clefitem.hh\
        main.hh melodicstaff.hh meter.hh misc.hh\
        molecule.hh moment.hh notehead.hh notename.hh offset.hh paper.hh\
        parseconstruct.hh pcol.hh proto.hh pscore.hh pstaff.hh qlp.hh\
        main.hh melodicstaff.hh meter.hh misc.hh\
        molecule.hh moment.hh notehead.hh notename.hh offset.hh paper.hh\
        parseconstruct.hh pcol.hh proto.hh pscore.hh pstaff.hh qlp.hh\
-       qlpsolve.hh request.hh rest.hh rhythmstaff.hh sccol.hh score.hh\
+       qlpsolve.hh register.hh request.hh rest.hh rhythmstaff.hh\
+       sccol.hh score.hh\
        scoreline.hh script.hh scriptdef.hh simplestaff.hh simplewalker.hh\
        slur.hh spanner.hh staff.hh staffcommands.hh staffelem.hh staffline.hh\
        scoreline.hh script.hh scriptdef.hh simplestaff.hh simplewalker.hh\
        slur.hh spanner.hh staff.hh staffcommands.hh staffelem.hh staffline.hh\
-       stcol.hh stem.hh staffwalker.hh symbol.hh symtable.hh tex.hh textdef.hh\
+       stcol.hh stem.hh staffwalker.hh symbol.hh symtable.hh\
+       tex.hh textdef.hh\
        textitem.hh textspanner.hh timedescription.hh tstream.hh voice.hh
 
 mycc=bar.cc beam.cc boxes.cc break.cc calcideal.cc clef.cc\
        textitem.hh textspanner.hh timedescription.hh tstream.hh voice.hh
 
 mycc=bar.cc beam.cc boxes.cc break.cc calcideal.cc clef.cc\
-       clefitem.cc command.cc debug.cc dimen.cc directionalspanner.cc\
-       getcommands.cc grouping.cc idealspacing.cc identifier.cc\
+       clefitem.cc command.cc complexstaff.cc complexwalker.cc \
+       complexmelodicstaff.cc complexprint.cc debug.cc dimen.cc\
+       directionalspanner.cc\
+       getcommands.cc grouping.cc groupregs.cc idealspacing.cc identifier.cc\
        inputcommand.cc inputcommands.cc inputmusic.cc inputscore.cc\
        inputstaff.cc item.cc key.cc keyitem.cc keyword.cc\
        leastsquares.cc lexerinit.cc linespace.cc linepstaff.cc\
        inputcommand.cc inputcommands.cc inputmusic.cc inputscore.cc\
        inputstaff.cc item.cc key.cc keyitem.cc keyword.cc\
        leastsquares.cc lexerinit.cc linespace.cc linepstaff.cc\
@@ -29,12 +34,13 @@ mycc=bar.cc beam.cc boxes.cc break.cc calcideal.cc clef.cc\
        main.cc melodicstaff.cc meter.cc\
        misc.cc molecule.cc mylexer.cc note.cc notehead.cc notename.cc\
        paper.cc pcol.cc pscore.cc pstaff.cc qlp.cc qlpsolve.cc\
        main.cc melodicstaff.cc meter.cc\
        misc.cc molecule.cc mylexer.cc note.cc notehead.cc notename.cc\
        paper.cc pcol.cc pscore.cc pstaff.cc qlp.cc qlpsolve.cc\
-       request.cc rest.cc rhythmstaff.cc sccol.cc score.cc\
+       register.cc request.cc rest.cc rhythmstaff.cc sccol.cc score.cc\
        scoreline.cc scores.cc script.cc scriptdef.cc simpleprint.cc\
        simplestaff.cc simplewalker.cc slur.cc spanner.cc staff.cc\
        staffcommands.cc staffelem.cc staffline.cc stcol.cc stem.cc\
        staffwalker.cc symbol.cc symtable.cc table.cc tex.cc texbeam.cc\
        texslur.cc textdef.cc textitem.cc textspanner.cc\
        scoreline.cc scores.cc script.cc scriptdef.cc simpleprint.cc\
        simplestaff.cc simplewalker.cc slur.cc spanner.cc staff.cc\
        staffcommands.cc staffelem.cc staffline.cc stcol.cc stem.cc\
        staffwalker.cc symbol.cc symtable.cc table.cc tex.cc texbeam.cc\
        texslur.cc textdef.cc textitem.cc textspanner.cc\
-       timedescription.cc tstream.cc voice.cc warn.cc wordwrap.cc\
+       timedescription.cc tstream.cc voice.cc voiceregs.cc voicegroup.cc\
+       warn.cc wordwrap.cc\
        template1.cc template2.cc template3.cc template4.cc\
        template1.cc template2.cc template3.cc template4.cc\
-       template5.cc version.cc
\ No newline at end of file
+       template5.cc template6.cc version.cc
\ No newline at end of file
diff --git a/TODO b/TODO
index 01f9c087c515a19fd7d8a5e0ad5dbd2c8a01fb13..9f422946dc6101707b386b645b6c908051bd5d19 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,5 +1,5 @@
 BUGS
 BUGS
-       * first clef
+       * first clef isn't printed
 
 SEVERELY LACKING:
 
 
 SEVERELY LACKING:
 
@@ -7,9 +7,7 @@ SEVERELY LACKING:
 
 INPUTLANGUAGE
 
 
 INPUTLANGUAGE
 
-       * lexer condition stack
-
-       * lose the $ and @?
+       * lose the $ and @ ?
 
        * figured bass?
 
 
        * figured bass?
 
@@ -23,7 +21,7 @@ SMALLISH PROJECTS
 
        * make spanner for staffsym
        
 
        * make spanner for staffsym
        
-       * Lyric_req : Text_req, Rhythmic_req
+       * Lyric_req: Text_req, Rhythmic_req
        
        * Lookup::tex_glissando, Lookup::tex_bracket,
        Lookup::tex_cresc, Lookup::tex_decresc (use texbeam.cc as an
        
        * Lookup::tex_glissando, Lookup::tex_bracket,
        Lookup::tex_cresc, Lookup::tex_decresc (use texbeam.cc as an
@@ -35,7 +33,7 @@ SMALLISH PROJECTS
        
        * C meter iso 4/4
 
        
        * C meter iso 4/4
 
-       * textspanner: dir of beam.
+       * textspanner: center position
 
        * script-spacing
 
 
        * script-spacing
 
@@ -43,13 +41,19 @@ SMALLISH PROJECTS
 
        * space rest.
 
 
        * space rest.
 
-       * use (char *) iso. String for communication between lexer and parser.
+       * use (char *) iso. String for communication between lexer and
+       parser.
 
        * As vs. as  notename.
 
        * configure idealspacing: arithmetic spacing
 
 
        * As vs. as  notename.
 
        * configure idealspacing: arithmetic spacing
 
-       * fix symbols in parser.o: `Warning: size of symbol'
+       * fix linking: `Warning: size of symbol'
+
+BIGGISH PROJECT
+
+       * merge musical & non-musical column. Scrap Commands in favour
+       of Requests, and do multiparralel meters
 
 DOC
 
 
 DOC
 
@@ -58,11 +62,10 @@ DOC
        * all errors
 
 FUTURE
        * all errors
 
 FUTURE
-       * Command_req
-       
-       * scrap stem_request?
 
 
-       * put requests on barcommands 
+       * syntax: grouping 2*4 3*8.
+
+       * put scripts on barcommands 
 
        * glissando
 
 
        * glissando
 
@@ -80,14 +83,18 @@ FUTURE
 
        * QLP for beams?
 
 
        * QLP for beams?
 
-       * stacked slurs.
-
        * revise calcideal
 
        * eentje/tweetje
 
 IDEAS
 
        * revise calcideal
 
        * eentje/tweetje
 
 IDEAS
 
+       * voice terminate req.
+
+       * keep input in mem, store char* to define spots
+
+       * enter Requests directly
+
        * itemcolumns
 
        * check out PMX
        * itemcolumns
 
        * check out PMX
index 50263912220af3a1dfbdfd40317b5d8a6aabea05..e71edf9753f44b990b40ca56bb2e4532da2dae29 100644 (file)
@@ -37,13 +37,10 @@ endif
 # version info
 MAJVER=0
 MINVER=0
 # version info
 MAJVER=0
 MINVER=0
-PATCHLEVEL=25
+PATCHLEVEL=26
 VERSION=$(MAJVER).$(MINVER).$(PATCHLEVEL)
 CXXVER=`$(CXX) --version`
 
 VERSION=$(MAJVER).$(MINVER).$(PATCHLEVEL)
 CXXVER=`$(CXX) --version`
 
-#flower version
-NEEDEFLOWERVER=1.0.20
-
 # directories
 TOPDIR  := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
 OBJECTDIR=objects
 # directories
 TOPDIR  := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
 OBJECTDIR=objects
@@ -84,7 +81,8 @@ SCRIPTS=make_version make_patch genheader clearlily
 MAKFILES=Makefile Variables.make Sources.make Initial.make Generate.make \
        configure
 OFILES=COPYING README NEWS TODO
 MAKFILES=Makefile Variables.make Sources.make Initial.make Generate.make \
        configure
 OFILES=COPYING README NEWS TODO
-IFILES= standchen.tex titledefs.tex pavane.tex lilyponddefs.tex test.tex .dstreamrc dimen.tex 
+IFILES= standchen.tex titledefs.tex pavane.tex lilyponddefs.tex \
+       ltest.tex test.tex .dstreamrc dimen.tex 
 DFILES=$(MAKFILES) $(OFILES) $(IFILES) $(SCRIPTS)
 
 #compiling
 DFILES=$(MAKFILES) $(OFILES) $(IFILES) $(SCRIPTS)
 
 #compiling
index 1f7f7b52381068e462427f8ac69e1d904547c5ac..b10d46123512b12913a13e21accfc82331039a18 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,15 +1,18 @@
 #!/bin/sh
 
 #!/bin/sh
 
+PREFIX=${PREFIX:-.}
+echo using PREFIX=$PREFIX
 
 
-NEEDFLOWERVER=1.0.21
+NEEDFLOWERVER=1.0.22
 flowertar=flower-$NEEDFLOWERVER
 here=`pwd`
 flowertar=flower-$NEEDFLOWERVER
 here=`pwd`
-if [ -x ../flower ]
+cd ..
+if [ -x flower ]
 then
     echo Found flowerdir
 else
 then
     echo Found flowerdir
 else
-    cd ../
-    if [ ! -f $flowertar ]
+
+    if [ ! -d $flowertar ]
     then
        echo "can't find $flowertar"
        exit 1;
     then
        echo "can't find $flowertar"
        exit 1;
@@ -19,11 +22,10 @@ else
 
 fi
 echo Compiling Library
 
 fi
 echo Compiling Library
-cd flower; make
+(cd flower;make)
+
 cd $here
 
 cd $here
 
-PREFIX="."
 echo '#define LIBDIR "'$PREFIX'/"'> hdr/config.hh
 
 echo '#define LIBDIR "'$PREFIX'/"'> hdr/config.hh
 
-touch depend
 make -f Initial.make
 make -f Initial.make
index 00140e7826b79639dc4af1cc1f3d7ac494b6a1d5..790d7b06f2e2c091d918b99384013a4b85cfbbac 100644 (file)
@@ -1,6 +1,10 @@
 DISTFILES=Makefile
 DISTFILES=Makefile
+
+default:
+
+
 dist:
        ln $(DISTFILES) $(DDIR)/$(SUBDIR)
 
 clean:
 dist:
        ln $(DISTFILES) $(DDIR)/$(SUBDIR)
 
 clean:
-       rm *.dep
+       rm -f *.dep
index ed618974ebd208cbc380dad5ea194b731b630640..1b8b0013f8ecfc61b0056b987662007c0075cfee 100644 (file)
@@ -9,7 +9,7 @@ depend: Sources.make
        $(CXX) -MM $(cc) > depend
 
 clean:
        $(CXX) -MM $(cc) > depend
 
 clean:
-       rm -f $(obs) $(staticlib)
+       rm -f $(obs) $(staticlib) fversion.hh
 
 realclean: clean
        rm -f depend
 
 realclean: clean
        rm -f depend
index 0c389c10eff7db9c48bf217c1785bb12e37b579c..c417e74140268f210e0c882a8357a55aa36d6660 100644 (file)
@@ -1,6 +1,6 @@
 MAJVER=1
 MINVER=0
 MAJVER=1
 MINVER=0
-PATCHLEVEL=21
+PATCHLEVEL=22
 PACKAGENAME=flower
 
 #PROFILEFLAG=-pg
 PACKAGENAME=flower
 
 #PROFILEFLAG=-pg
@@ -33,5 +33,5 @@ obs=$(cc:.cc=.o)
 staticlib=libflower.a
 ALLSOURCES=$(hh) $(cc) $(inl) $(templatecc) 
 DFILES=$(ALLSOURCES) Makefile Variables.make make_version\
 staticlib=libflower.a
 ALLSOURCES=$(hh) $(cc) $(inl) $(templatecc) 
 DFILES=$(ALLSOURCES) Makefile Variables.make make_version\
-       Sources.make TODO README
+       Sources.make TODO README NEWS
 DDIR=$(DNAME)
 DDIR=$(DNAME)
index c21c4fc6bc370a2b19b8e8e7bca9028c4a3d6878..4e0594519f631c5b4c59b528f010623194ca34ba 100644 (file)
@@ -43,7 +43,7 @@ struct Assoc {
        Assoc_ent_<K,V> ae;
        ae.free = false;
        ae.key = key;
        Assoc_ent_<K,V> ae;
        ae.free = false;
        ae.key = key;
-       arr.add(ae);
+       arr.push(ae);
        return arr.size() -1;
     }
 public:
        return arr.size() -1;
     }
 public:
index fceaeed6477aa155432c85fef32455f7269fe02c..3ff83d3b72fe3022f31b96a316974e715363dd9e 100644 (file)
@@ -15,7 +15,7 @@ public:
     File_path(String);
 
     /// add to end of path.
     File_path(String);
 
     /// add to end of path.
-    Array<String>:: add;
+    Array<String>:: push;
 };
 /**
 
 };
 /**
 
index 9c3b8e2a979eb8a9b76b0d8764ac7262cd81d7fc..f2143507b654766ecdd99557c6079237f0c8dc98 100644 (file)
@@ -157,7 +157,7 @@ Full_storage::row(int n) const
 {
     Array<Real> r;
     for (int j = 0; j < w; j++)
 {
     Array<Real> r;
     for (int j = 0; j < w; j++)
-       r.add(els[n][j]);
+       r.push(els[n][j]);
     return r;
 }
 
     return r;
 }
 
@@ -167,7 +167,7 @@ Full_storage::column(int n) const
     
     Array<Real> r;
     for (int i = 0; i<h; i++)
     
     Array<Real> r;
     for (int i = 0; i<h; i++)
-       r.add(els[i][n]);
+       r.push(els[i][n]);
     return r;
 }
 
     return r;
 }
 
index 11c39a0f41fb891372f621310f8b18b149ae2701..adbc66b4e570c80b98bd7f1015723fac6419311e 100644 (file)
@@ -19,7 +19,6 @@ struct sstack : Array<T> {
         Array<T>::pop();
        return l;
     }
         Array<T>::pop();
        return l;
     }
-    void push(T l) { add(l); }
 };
 /**
   Same as for #Array# goes here.
 };
 /**
   Same as for #Array# goes here.
index d94b64ab7980eaef3423123d831d26c1632efd56..eefea162405ca9849553805c7f53f6b2c371d12f 100644 (file)
@@ -32,7 +32,7 @@ Text_db::get_record()
        
        while ((s = get_word()) != "")
            {
        
        while ((s = get_word()) != "")
            {
-           fields.add(s);      
+           fields.push(s);     
            gobble_white();
            }
             
            gobble_white();
            }
             
index bfc6b984fa7be4836ef746f3f69d8e75711b5861..40e76a3dc72bc220420864d40837dd850302d1e0 100644 (file)
@@ -91,7 +91,7 @@ public:
     }
 
     /// add to the end of array
     }
 
     /// add to the end of array
-    void add(T x) {
+    void push(T x) {
        if (size_ == max)
            remax(2*max + 1);
 
        if (size_ == max)
            remax(2*max + 1);
 
index a1c5d80d30bb19267acbee01e7afdb410c12b550..d388a3f09797fba3189d6b940b31d34bbde40d1e 100644 (file)
@@ -9,11 +9,12 @@
 #include "item.hh"
 
 struct Accidental : Item {
 #include "item.hh"
 
 struct Accidental : Item {
+const char * name() const;
     int type,pos; 
 
     void preprocess();
     Accidental(int type, int position);
     int type,pos; 
 
     void preprocess();
     Accidental(int type, int position);
-    void print()const;
+    void do_print()constt;
 private:
     void brew_molecule();
 };
 private:
     void brew_molecule();
 };
index 2df42d65030c88ca3f6b9613ba0336a8d498aba4..a6cd8d4d048e7a799ee329cc40e553dd5b376ac2 100644 (file)
@@ -9,6 +9,7 @@
 #include "item.hh"
 
 struct Bar: Item {
 #include "item.hh"
 
 struct Bar: Item {
+    const char * name() const;
     String type;
     
     Bar(String type);
     String type;
     
     Bar(String type);
index 548641aecb5b82e0744a69c1dfbf8a3b3b604850..68a9f49cff95f8badba13ea4c52a772615613657 100644 (file)
@@ -18,6 +18,7 @@ struct Beam:  public Directional_spanner {
     /// dir: -1 below heads, +1 above heads.
 
     /****************/
     /// dir: -1 below heads, +1 above heads.
 
     /****************/
+    const char * name() const;
     
     virtual Interval width()const;    
     Offset center() const;
     
     virtual Interval width()const;    
     Offset center() const;
@@ -30,7 +31,7 @@ struct Beam:  public Directional_spanner {
     void do_pre_processing();
     void do_post_processing();
 
     void do_pre_processing();
     void do_post_processing();
 
-    void print() const;
+    void do_print() const;
     void set_grouping(Rhythmic_grouping def, Rhythmic_grouping current);
     void set_stemlens();
     ~Beam();
     void set_grouping(Rhythmic_grouping def, Rhythmic_grouping current);
     void set_stemlens();
     ~Beam();
index 9dbfffe5cd36249d3ff75bce34563e705a62cc5e..c07087e0734e59f029ccd7f3b24a1e0a942035e9 100644 (file)
@@ -11,6 +11,7 @@
 
 
 struct Clef_item : Item {
 
 
 struct Clef_item : Item {
+    const char * name() const;
     String type;
     int y_off;
     bool change;
     String type;
     int y_off;
     bool change;
diff --git a/hdr/complexstaff.hh b/hdr/complexstaff.hh
new file mode 100644 (file)
index 0000000..4413add
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+  complexstaff.hh -- part of LilyPond
+
+  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#ifndef COMPLEXSTAF_HH
+#define COMPLEXSTAF_HH
+
+
+#include "key.hh"
+#include "stcol.hh"
+#include "staff.hh"
+#include "staffwalker.hh"
+
+/// column of Complex_staff: store one request
+struct Complex_column : Staff_column {
+
+    Array<Request*> todo_l_arr_;
+    Complex_staff* staff_l_;
+    
+    /****************/
+
+    Slur_req *find_slur(Voice *);
+
+    void typeset_item(Item *, int=1);
+    void typeset_item_directional(Item *, int dir, int=1);
+    Molecule *create_command_mol(Command *com);
+
+    void take_request(Request *rq);   
+    virtual void setup_requests();
+
+    Complex_column(Score_column*s,Complex_staff*rs);
+};
+
+
+/// Complex  staff: one voicegroup  at a time
+struct Complex_staff : Staff {
+    /// indirection to the PStaff.
+    PStaff *theline_l_;
+
+    /****************/
+    Staff_column*create_col(Score_column*);    
+    virtual Item *get_TYPESET_item(Command*);
+    virtual void set_output(PScore *);
+    void process_commands( PCursor<Command*> &where);
+    virtual void walk();
+
+    Complex_staff();
+};
+
+#endif // COMPLEXSTAF_HH
+
diff --git a/hdr/complexwalker.hh b/hdr/complexwalker.hh
new file mode 100644 (file)
index 0000000..111945c
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+  complexwalker.hh -- part of LilyPond
+
+  (c) 1996,97 Han-Wen Nienhuys
+*/
+
+#ifndef COMPLEXWALKER_HH
+#define COMPLEXWALKER_HH
+
+#include "proto.hh"
+#include "grouping.hh"
+#include "voicegroup.hh"
+#include "assoc.hh"
+#include "staffwalker.hh"
+#include "key.hh"
+#include "clef.hh"
+
+struct Complex_walker: Staff_walker {
+    Local_key local_key_;
+    Key key_;
+    Array<int> *oldkey_undo;
+    Array<int> typesetkey;
+
+    int processed_bar_priority;
+    bool processed_key;
+    bool processed_clef;
+    Clef clef_;
+    Rhythmic_grouping default_grouping;
+    
+
+    IPointerList<Voice_registers *> voice_reg_list_;
+//    Assoc<Voice*, Voice_registers*> voice_reg_map_;    
+    //IPointerList<Voice_group_registers *> voice_reg_list_;
+    //Assoc<int, Voice_group_registers*> group_reg_map_;
+    Voice_group_registers group_regs_;
+    Local_key_register local_key_reg_;
+    Array<Staff_elem_info> announce_info_arr_;
+    
+    /****************/
+    Voice_registers *find_voice_reg(Voice*v_l);
+    
+    void regs_process_requests();
+    void do_announces();
+    void try_request(Request*req);
+    void typeset_element(Staff_elem *elem_p);
+    void announce_element(Staff_elem_info);
+    virtual void do_TYPESET_command(Command*);
+    virtual void do_INTERPRET_command(Command*);
+    virtual void process_requests();
+    virtual void do_post_move();
+    virtual void do_pre_move();
+    
+    void do_note(CNote_info);
+    Complex_walker(Complex_staff*);
+    Complex_column *col();
+    Complex_staff *staff();
+
+    void do_local_key(Note_req*, Notehead*);
+
+};
+
+
+#endif // SIMPLEWALKER_HH
+
+
index 0e35476b39d73b586fe448182990398f38cc8b0b..a5a7d8d3787f5bdf0abd96c792313f3d10de9ab6 100644 (file)
@@ -11,7 +11,7 @@ void error(String s);         // errors
 void error_t(const String& s, Time_description const &  t_tdes);
 void error_t(String const &s, const Moment &when);
 // warnings
 void error_t(const String& s, Time_description const &  t_tdes);
 void error_t(String const &s, const Moment &when);
 // warnings
-void warning(String s);
+//void warning(String s);
 #define WARN warnout << "warning: "<<__FUNCTION__ << "(): "
 extern ostream &warnout ;
 
 #define WARN warnout << "warning: "<<__FUNCTION__ << "(): "
 extern ostream &warnout ;
 
index 6f89456d8bd5db90d6b93ab027179d9191c95ee3..aea2fd393f5f48bedd115e6292d4449cff649992 100644 (file)
@@ -14,8 +14,7 @@
 typedef Interval_t<Moment> MInterval;
 
 /// data structure which represents rhythmic units 
 typedef Interval_t<Moment> MInterval;
 
 /// data structure which represents rhythmic units 
-struct Rhythmic_grouping {    
-    
+struct Rhythmic_grouping {
     Array<Rhythmic_grouping*> children;
     MInterval *interval_;
     
     Array<Rhythmic_grouping*> children;
     MInterval *interval_;
     
@@ -34,7 +33,7 @@ struct Rhythmic_grouping {
     ~Rhythmic_grouping();
 
     void add_child(Moment start, Moment len);
     ~Rhythmic_grouping();
 
     void add_child(Moment start, Moment len);
-
+    bool child_fit_query(Moment start);
     void split(Rhythmic_grouping r);
     void split(Array<MInterval>);
     void split(int n);
     void split(Rhythmic_grouping r);
     void split(Array<MInterval>);
     void split(int n);
index 9b234819ec44e9ebe9d83e6bc2d23a6b06969563..68f1402c5b84d62191d60278299ecfad3c601e1a 100644 (file)
@@ -6,16 +6,16 @@
 #include "string.hh"
 #include "staffelem.hh"
 
 #include "string.hh"
 #include "staffelem.hh"
 
-
 /// a horizontally fixed size element of the score
 struct Item : Staff_elem {
     /// indirection to the column it is in
     PCol * pcol_l_;
 
     /****************/
 /// a horizontally fixed size element of the score
 struct Item : Staff_elem {
     /// indirection to the column it is in
     PCol * pcol_l_;
 
     /****************/
-    
+    virtual Item *item() { return this; }
     Item();
     Item();
-    void print()const;
+    void do_print()const;
+    const char*name()const;
 };
 /** Item is the datastructure for printables whose width is known
   before the spacing is calculated
 };
 /** Item is the datastructure for printables whose width is known
   before the spacing is calculated
index dca7d7213567e79a48f6605ec2bd23676ae8a0e0..71a7dba2b1faa830e03d04e9d5514bdb426245b2 100644 (file)
@@ -14,6 +14,7 @@ struct Clef;
 
 /// 
 struct Keyitem : Item {
 
 /// 
 struct Keyitem : Item {
+    const char * name() const;
     Array<int> pitch;
     Array<int> acc;
     int c_position;
     Array<int> pitch;
     Array<int> acc;
     int c_position;
index b4cf832c3e268df697091e4e863438c9add08abc..0da7e06858f368724f683872d82c1c17165b36a6 100644 (file)
@@ -15,15 +15,17 @@ struct Local_acc {
 };
 
 struct Local_key_item : Item {
 };
 
 struct Local_key_item : Item {
+    const char * name() const;
     Array<Local_acc> accs;
     Array<Local_acc> accs;
-    Array<Notehead*> group;
+    Array<Item*> group;
     int c0_position;           // move into walker
 
     /****************/
     
     Local_key_item(int c0position);
     int c0_position;           // move into walker
 
     /****************/
     
     Local_key_item(int c0position);
-    void add(int oct, int pitch, int acc, Notehead*);
-
+    void add(Item*);
+    void add(int oct, int pitch, int acc);
+    void add(Melodic_req*);
     void do_pre_processing();    
     Molecule* brew_molecule_p()const;
 };
     void do_pre_processing();    
     Molecule* brew_molecule_p()const;
 };
index 368dadf1bc0bc5b45307a36f68695d7f4487b840..145ff7fc08a2dc69ac2e9be209adf02fe1cae758 100644 (file)
@@ -10,7 +10,6 @@
 #include "key.hh"
 #include "stcol.hh"
 #include "staff.hh"
 #include "key.hh"
 #include "stcol.hh"
 #include "staff.hh"
-#include "staffwalker.hh"
 
 struct Lyric_staff;
 
 
 struct Lyric_staff;
 
@@ -28,12 +27,7 @@ struct Lyric_column : Staff_column {
     Lyric_staff* lstaff_l_;
     
     void typeset_item(Item *, int=1);
     Lyric_staff* lstaff_l_;
     
     void typeset_item(Item *, int=1);
-//    void typeset_item_directional(Item *, int dir, int=1);
-
-//    Molecule *create_command_mol(Command *com);
-
-//    void take_request(Request *rq);   
-    virtual void process_requests();
+    virtual void setup_requests();
 
     Lyric_column(Score_column*s,Lyric_staff*rs);
 };
 
     Lyric_column(Score_column*s,Lyric_staff*rs);
 };
index 846b9a578c0ac1c180d79bd27f43e76e57a8ea7f..870efbb040e2dcc96fb913217421f6a538d094e4 100644 (file)
@@ -17,7 +17,7 @@ struct Lyric_walker: Staff_walker {
     Array<Lyric_item*> litem_l_array_;
 
     /****************/
     Array<Lyric_item*> litem_l_array_;
 
     /****************/
-
+    
     virtual void do_TYPESET_command(Command*);
     virtual void do_INTERPRET_command(Command*);
     virtual void process_requests();
     virtual void do_TYPESET_command(Command*);
     virtual void do_INTERPRET_command(Command*);
     virtual void process_requests();
index e3a5ff1f6184a3bfcaac76d4d638b00b486ce0a3..cec73517d72bdcfa4b9f5d32279c62fa60ff21b4 100644 (file)
@@ -19,7 +19,7 @@ struct Melodic_staff : public Simple_staff
     virtual void set_output(PScore *);
 
     virtual Item* get_TYPESET_item(Command*);
     virtual void set_output(PScore *);
 
     virtual Item* get_TYPESET_item(Command*);
-    virtual Stem * get_stem(Stem_req *rq,Moment);
+    virtual Stem * get_stem(Stem_req *rq);
     virtual Notehead * get_notehead(Note_req *rq, int bot);
     virtual Local_key_item* get_local_key_item();
 };
     virtual Notehead * get_notehead(Note_req *rq, int bot);
     virtual Local_key_item* get_local_key_item();
 };
index 1557ce4709464f189f4a6d9708a6db563a7ad401..835b661bae2eb29c963d51668c773f50a0963505 100644 (file)
@@ -10,6 +10,7 @@
 #include "varray.hh"
 
 struct Meter: Item {
 #include "varray.hh"
 
 struct Meter: Item {
+    const char * name() const;
     Array<Scalar> args;
     /****************/
     
     Array<Scalar> args;
     /****************/
     
index a032ca1273087bc163b72ed3060ee413a198c328..5f4c47d2d97ad56730ea3c3a048351017955472a 100644 (file)
@@ -9,8 +9,8 @@
 #include "item.hh"
 
 /// ball at the end of the stem
 #include "item.hh"
 
 /// ball at the end of the stem
-struct Notehead : public Item
-{
+struct Notehead : Item {
+    const char * name() const;
     int position;
     /// -1 = lowest, 0 = inside, 1 = top
     int extremal;
     int position;
     /// -1 = lowest, 0 = inside, 1 = top
     int extremal;
@@ -22,13 +22,13 @@ struct Notehead : public Item
     
     /****************/
     
     
     /****************/
     
-
+    void set_rhythmic(Rhythmic_req *);
     Notehead(int staff_size);
     /**
       position of top line (5 linestaff: 8)
       */
 
     Notehead(int staff_size);
     /**
       position of top line (5 linestaff: 8)
       */
 
-    void print()const;
+    void do_print()const;
     static int compare(Notehead*&a, Notehead*&b) ;
     Molecule* brew_molecule_p()const;
 };
     static int compare(Notehead*&a, Notehead*&b) ;
     Molecule* brew_molecule_p()const;
 };
index 9bc9434ffc6f4c18cbb430fc6c13f55e1163a567..7b0545b78440ffc598cdb5f9b4509c0f8c010255 100644 (file)
@@ -14,12 +14,9 @@ void set_default_duration(int *);
 void get_default_duration(int *);
 void set_default_octave(String);
 void set_plet(int,int);
 void get_default_duration(int *);
 void set_default_octave(String);
 void set_plet(int,int);
-Staff * get_new_rhythmstaff();
 Voice_element * get_note_element(String,int * ,int *);
 Voice_element* get_rest_element(String,int *);
 Voice_element* get_word_element(Text_def*, int*);
 Voice_element * get_note_element(String,int * ,int *);
 Voice_element* get_rest_element(String,int *);
 Voice_element* get_word_element(Text_def*, int*);
-Staff * get_new_melodicstaff();
-Staff * get_new_lyricstaff();
 void add_requests( Voice_element*v, Array<Request*>&req);
 Request* get_request(char);
 void set_text_style(String);
 void add_requests( Voice_element*v, Array<Request*>&req);
 Request* get_request(char);
 void set_text_style(String);
index 0d32486ed4c085718506897123e3b90aa769c885..94304768da9d9f9596cff93f7a2b92f1e3d95d5d 100644 (file)
@@ -19,21 +19,34 @@ struct Beam;
 struct Beam_req;
 struct Box;
 struct Bracket_req;
 struct Beam_req;
 struct Box;
 struct Bracket_req;
+struct CNote_info;
 struct Chord;
 struct Clef;
 struct Clef_item;
 struct Chord;
 struct Clef;
 struct Clef_item;
+struct Col_configuration;
 struct Colinfo;
 struct Command;
 struct Colinfo;
 struct Command;
+struct Commands_at ;
+struct Complex_column;
+struct Complex_music;
+struct Complex_staff;
+struct Complex_walker;
 struct Cresc_req;
 struct Decresc_req;
 struct Dynamic;
 struct Idealspacing;
 struct Identifier;
 struct Cresc_req;
 struct Decresc_req;
 struct Dynamic;
 struct Idealspacing;
 struct Identifier;
+struct Input_command;
 struct Input_commands;
 struct Input_commands;
+struct Input_file;
+struct Input_music;
+struct Input_score;
+struct Input_staff;
 struct Item;
 struct Key;
 struct Keyitem;
 struct Keyword;
 struct Item;
 struct Key;
 struct Keyitem;
 struct Keyword;
+struct Keyword_table;
 struct Line_of_score;
 struct Line_of_staff;
 struct Linestaff;
 struct Line_of_score;
 struct Line_of_staff;
 struct Linestaff;
@@ -41,13 +54,16 @@ struct Local_key;
 struct Local_key_item;
 struct Lookup;
 struct Lyric_req;
 struct Local_key_item;
 struct Lookup;
 struct Lyric_req;
+struct Lyric_req;
 struct Mark_req;
 struct Mark_req;
+struct Melodic_req;
 struct Mixed_qp;
 struct Molecule;
 struct Mixed_qp;
 struct Molecule;
-struct Rational;
-typedef Rational Moment;
+struct Music_general_chord;
+struct Music_voice;
 struct Note_req;
 struct Notehead;
 struct Note_req;
 struct Notehead;
+struct Notename_tab;
 struct Offset;
 struct Output;
 struct PCol;
 struct Offset;
 struct Output;
 struct PCol;
@@ -55,22 +71,30 @@ struct PScore;
 struct PStaff;
 struct Paperdef;
 struct Parametric_symbol;
 struct PStaff;
 struct Paperdef;
 struct Parametric_symbol;
+struct Rational;
 struct Request;
 struct Request;
+struct Request_register;
 struct Rest;
 struct Rest_req;
 struct Rest;
 struct Rest_req;
+struct Rhythmic_grouping;
 struct Rhythmic_req;
 struct Score;
 struct Score_column;
 struct Rhythmic_req;
 struct Score;
 struct Score_column;
-struct Staff_commands;
+struct Script_def;
 struct Script_req;
 struct Script_req;
+struct Simple_music;
 struct Slur;
 struct Slur_req;
 struct Span_req;
 struct Spanner;
 struct Staff;
 struct Slur;
 struct Slur_req;
 struct Span_req;
 struct Spanner;
 struct Staff;
-struct Staff_command_req;
-struct Col_configuration;
 struct Staff_column;
 struct Staff_column;
+struct Staff_command_req;
+struct Staff_commands;
+struct Staff_commands_at ;
+struct Staff_elem;
+struct Staff_elem_info;
+struct Staff_walker;
 struct Stem;
 struct Stem_req;
 struct String;
 struct Stem;
 struct Stem_req;
 struct String;
@@ -78,31 +102,15 @@ struct Symbol;
 struct Symtable;
 struct Symtables;
 struct Tex_stream;
 struct Symtable;
 struct Symtables;
 struct Tex_stream;
+struct Text_def;
 struct Text_gob;
 struct Text_gob;
+struct Text_req;
+struct Time_description;
 struct Voice;
 struct Voice_element;
 struct Voice;
 struct Voice_element;
-struct Voicegroup;
-
+struct Voice_group_registers;
 struct Voice_list;
 struct Voice_list;
-struct Input_music;
-struct Simple_music;
-struct Complex_music;
-struct Music_voice;
-struct Music_general_chord;
-
-struct Input_score;
-struct Input_staff;
-struct Input_command;
-struct Notename_tab;
-struct Input_file;
-struct Keyword_table;
-struct Rhythmic_grouping;
-struct Staff_commands_at ;
-struct Commands_at ;
-struct Time_description;
-struct Script_def;
-struct Text_def;
-struct Text_req;
-struct Lyric_req;
-struct Melodic_req;
+struct Voice_registers;
+struct Voicegroup;
+typedef Rational Moment;
 #endif // PROTO_HH
 #endif // PROTO_HH
diff --git a/hdr/register.hh b/hdr/register.hh
new file mode 100644 (file)
index 0000000..e94faca
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+  register.hh -- part of LilyPond
+
+  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#ifndef REGISTER_HH
+#define REGISTER_HH
+#include "proto.hh"
+#include "sstack.hh"
+
+/// data container.
+struct Staff_elem_info {
+    Staff_elem * elem_p_;
+//    Array<const Request*> requestor_l_arr_;
+    Request*req_l_;
+    const Voice * voice_l_;
+    Voice_group_registers * group_regs_l_;
+    int group;
+    Request_register * origin_reg_l_;
+
+    /****/
+    Staff_elem_info(Staff_elem*, Request*, Request_register*);
+    Staff_elem_info();
+};
+
+/// Hungarian postfix: reg
+struct Request_register {
+    Complex_walker * walk_l_;
+    Array<Request*> accepted_req_arr_;
+    
+    /****************/
+
+    Request_register(Complex_walker*);
+    Request_register();
+    virtual ~Request_register(){}
+
+    /// take note of item/spaanner
+    virtual void acknowledge_element(Staff_elem_info){}
+    /**
+      put item in spanner. Adjust local key; etc.
+      */
+    
+    ///
+    virtual bool try_request(Request *req_l) =0;
+    /**
+      try to fit the request in this register
+
+      RETURN
+      false: request noted, but not taken.
+
+      true: request swallowed, now owned by this
+
+      (may be we could use C++ exceptions.. :-)
+      */
+
+    /// make items/spanners with the requests you got
+    virtual void process_request()=0;
+
+    /// typeset any spanners. Empty accepted_req_arr_
+    void pre_move_processing();
+    void post_move_processing();
+    
+protected:
+    /// virtual, called by pre_move_process()
+    virtual void do_pre_move_process(){}
+    virtual void do_post_move_process(){}
+};
+/**
+  a struct which processes requests, and creates the Staff_elems  
+  */
+
+struct Notehead_register : Request_register {
+    Item* note_l_;
+    /****************/
+    Notehead_register(Complex_walker*);
+    virtual bool try_request(Request *req_l) ;
+    virtual void process_request();
+    virtual void do_pre_move_process();
+};
+
+struct Slur_register : Request_register {
+    sstack<Slur *> slur_l_stack_;
+    Array<Slur*> end_slur_l_arr_;
+
+
+    /****************/
+    ~Slur_register();
+    Slur_register(Complex_walker*);
+    virtual bool try_request(Request*);
+    virtual void process_request();
+    virtual void acknowledge_element(Staff_elem_info);
+    virtual void do_pre_move_process();
+};
+
+struct Stem_beam_register : Request_register {
+    Stem * stem_p_;
+    Beam * beam_p_;
+    Beam_req * beam_req_l_;
+    Stem_req * stem_req_l_;
+    bool end_beam_b_;
+    Rhythmic_grouping *current_grouping;
+
+    /****************/
+    Stem_beam_register(Complex_walker*);
+    ~Stem_beam_register();
+    virtual bool try_request(Request*);
+    virtual void process_request();
+    virtual void acknowledge_element(Staff_elem_info);
+    virtual void do_pre_move_process();
+    virtual void do_post_move_process();
+};
+
+#if 0
+struct   Script_register : Request_register {
+    Script * script_p_;
+    /****************/
+    Script_register(Complex_walker*);
+    virtual bool try_request(Request*);
+    virtual void process_request();
+    virtual void acknowledge_element(Staff_elem_info);
+    virtual void do_pre_move_process();
+};
+
+struct Text_register:Request_register{
+    Text_item * text_p_;
+
+    /****************/
+    Text_register(Complex_walker*);
+    virtual bool try_request(Request*);
+    virtual void process_request();
+    virtual void acknowledge_element(Staff_elem_info);
+    virtual void do_pre_move_process();
+};
+#endif
+
+struct Local_key_register : Request_register {
+    Local_key_item* key_item_p_;
+
+    /****************/
+    
+    virtual bool try_request(Request*);
+    virtual void process_request();
+    virtual void acknowledge_element(Staff_elem_info);
+    virtual void do_pre_move_process();
+    Local_key_register(Complex_walker*);
+};
+
+#endif // REGISTER_HH
+
index c401fcdd9d7ba709950f6641e298ae9c002b7297..2cc9decef1716d965683563a6186c162b6e53c32 100644 (file)
@@ -11,14 +11,15 @@ struct Request {
     Voice_element*elt_l_;
     
     /****************/
     Voice_element*elt_l_;
     
     /****************/
-
     Request();
     Request(Request const&);
     virtual ~Request(){}
 
     Request();
     Request(Request const&);
     virtual ~Request(){}
 
-    virtual void print()const ;
-    virtual Moment duration() const { return 0.0; }
+    virtual const char * name() const { return "Request";}
     virtual Request* clone() const =0;
     virtual Request* clone() const =0;
+    void print()const ;
+
+    virtual Moment duration() const { return 0; }
 
     /*  accessors for children */
     virtual Barcheck_req *barcheck() { return 0; }
 
     /*  accessors for children */
     virtual Barcheck_req *barcheck() { return 0; }
@@ -35,17 +36,23 @@ struct Request {
     virtual Melodic_req *melodic() { return 0; }
     virtual Mark_req * mark() { return 0; }
     virtual Staff_command_req* command() { return 0;}
     virtual Melodic_req *melodic() { return 0; }
     virtual Mark_req * mark() { return 0; }
     virtual Staff_command_req* command() { return 0;}
+protected:
+    virtual void do_print()const ;
 };
 };
-
 /**
  a voice element wants something printed.
 see lilygut page
  */
 /**
  a voice element wants something printed.
 see lilygut page
  */
+
+
+#define REQUESTMETHODS(T,accessor)     \
+virtual T * accessor() { return this;}\
+virtual const char* name()const { return #T; }\
+virtual Request *clone() const { return  new T(*this); } \
+virtual void do_print() const
        
 struct Barcheck_req : Request {
        
 struct Barcheck_req : Request {
-    virtual Barcheck_req *barcheck() { return this; }
-    void print ()const;
-    Request*clone() const;
+    REQUESTMETHODS(Barcheck_req,barcheck);
 };
 
 /// a request with a duration
 };
 
 /// a request with a duration
@@ -54,12 +61,11 @@ struct Rhythmic_req : virtual Request {
     int dots;
     Moment plet_factor;
     /****************/
     int dots;
     Moment plet_factor;
     /****************/
-
+    static int compare(const Rhythmic_req &, const Rhythmic_req &);
     Moment duration() const;
     Rhythmic_req();
     Moment duration() const;
     Rhythmic_req();
-    Rhythmic_req*rhythmic() { return this;}
-    void print ()const;
-    Request*clone() const;
+        Rhythmic_req(int,int);
+    REQUESTMETHODS(Rhythmic_req, rhythmic);
 };
 
 
 };
 
 
@@ -68,29 +74,24 @@ struct Text_req : virtual Request {
     int dir_i_;
     Text_def *tdef_p_;
     /****************/
     int dir_i_;
     Text_def *tdef_p_;
     /****************/
-    Text_req* text() { return this; }
-    virtual void print() const;
-    Request *clone()const;
-
     Text_req(int d, Text_def*);
     ~Text_req();
     Text_req(Text_req const&);
     Text_req(int d, Text_def*);
     ~Text_req();
     Text_req(Text_req const&);
+    REQUESTMETHODS(Text_req,text);
 };
 
 
 struct Lyric_req : public Rhythmic_req, Text_req {
 
     Lyric_req(Text_def* t_p);
 };
 
 
 struct Lyric_req : public Rhythmic_req, Text_req {
 
     Lyric_req(Text_def* t_p);
-    void print() const;
-    Lyric_req* lreq_l() { return this; }
-    Request* clone() const;
+    REQUESTMETHODS(Lyric_req, lreq_l);
 };
 
 
 struct Melodic_req :virtual  Request
 {
     /// 0 is c
 };
 
 
 struct Melodic_req :virtual  Request
 {
     /// 0 is c
-    int name;
+    int notename;
     int octave;
     int accidental;
     bool forceacc;
     int octave;
     int accidental;
     bool forceacc;
@@ -98,19 +99,17 @@ struct Melodic_req :virtual  Request
     // return height from central c (in halflines)
     int height()const; 
     Melodic_req();
     // return height from central c (in halflines)
     int height()const; 
     Melodic_req();
-    Melodic_req*melodic() { return this;}
-    virtual void print() const;
-    Request*clone() const;
+   
+    REQUESTMETHODS(Melodic_req,melodic);
 };
 
 /// Put a note of specified type, height, and with accidental on the staff.
 struct Note_req : Rhythmic_req, virtual Melodic_req {
 };
 
 /// Put a note of specified type, height, and with accidental on the staff.
 struct Note_req : Rhythmic_req, virtual Melodic_req {
-    Rhythmic_req* rhythmic() { return Rhythmic_req::rhythmic(); }
     
     
-    Note_req*note() { return this;}
-    virtual void print() const;
-    Request*clone() const;
-};
+
+    Rhythmic_req* rhythmic() { return Rhythmic_req::rhythmic(); }
+    REQUESTMETHODS(Note_req, note);
+ };
 /**
 */
 
 /**
 */
 
@@ -118,25 +117,20 @@ struct Note_req : Rhythmic_req, virtual Melodic_req {
 ///Put a rest on the staff.
 struct Rest_req : Rhythmic_req {
 
 ///Put a rest on the staff.
 struct Rest_req : Rhythmic_req {
 
-    void print()const;
-
-    Rest_req * rest() { return this;}
-    Request*clone() const ;
+ REQUESTMETHODS(Rest_req,rest);
 };
 /**
 Why a request? It might be a good idea to not typeset the rest, if the paper is too crowded.
 */
 
 /// attach a stem to the noteball
 };
 /**
 Why a request? It might be a good idea to not typeset the rest, if the paper is too crowded.
 */
 
 /// attach a stem to the noteball
-struct Stem_req : Request {
-    /// 4,8,16, ..
-    int stem_number;
-
-    virtual Stem_req *stem() {return this;}
-    Stem_req(int s) { stem_number = s; }
-    Request*clone() const;
-    virtual void print() const;
+struct Stem_req : Rhythmic_req {
+    Stem_req(int s, int dots);
+    REQUESTMETHODS(Stem_req,stem);
 };
 };
+/**
+  Rhythmic_req parent needed to  determine if it will fit inside a beam.
+  */
 
 /// requests to start or stop something.
 struct Span_req : Request {
 
 /// requests to start or stop something.
 struct Span_req : Request {
@@ -144,11 +138,11 @@ struct Span_req : Request {
     enum {
        NOSPAN, START, STOP
     } spantype ;
     enum {
        NOSPAN, START, STOP
     } spantype ;
+    static int compare(const Span_req &r1, const Span_req &r2);
+    REQUESTMETHODS(Span_req,span);
 
 
-    virtual void print() const;
-    Span_req*span() { return this; }
     Span_req();
     Span_req();
-    virtual Request*clone()const;
+  
 };
 /**
  This type of request typically results in the creation of a #Spanner#
 };
 /**
  This type of request typically results in the creation of a #Spanner#
@@ -160,20 +154,19 @@ struct Beam_req : Span_req {
     int nplet;
 
     /****************/
     int nplet;
 
     /****************/
-    
+     REQUESTMETHODS(Beam_req,beam);
+
     Beam_req();
     Beam_req();
-    virtual Beam_req * beam() { return this; }
-    virtual Request*clone()const;
 };
 };
+
 /**   if #nplet# is set, the staff will try to put an
 appropriate number over the beam
     */
 
 /// a slur
 struct Slur_req : Span_req {
 /**   if #nplet# is set, the staff will try to put an
 appropriate number over the beam
     */
 
 /// a slur
 struct Slur_req : Span_req {
+ REQUESTMETHODS(Slur_req,slur);
 
 
-    virtual Request*clone()const;
-    virtual Slur_req*slur() { return this; }
 };
 
 
 };
 
 
@@ -183,10 +176,8 @@ struct Script_req : Request {
     Script_def *scriptdef;
 
     /****************/
     Script_def *scriptdef;
 
     /****************/
-    Script_req*script() { return this; }
-    virtual void print() const;
-    Request *clone()const;
     Script_req(int d, Script_def*);
     Script_req(int d, Script_def*);
+    REQUESTMETHODS(Script_req,script);
     ~Script_req();
     Script_req(Script_req const&);
 };
     ~Script_req();
     Script_req(Script_req const&);
 };
@@ -199,19 +190,16 @@ struct Mark_req : Request {
     String mark_str_;
     /****************/
     Mark_req(String);
     String mark_str_;
     /****************/
     Mark_req(String);
-    Mark_req* mark() { return this; }
-    virtual void print() const;
-    Request *clone() const;
+    REQUESTMETHODS(Mark_req,mark);
 };
 
 struct Staff_command_req : Request {
     Input_command * com_p_;
 };
 
 struct Staff_command_req : Request {
     Input_command * com_p_;
-    Staff_command_req* command() { return this;}
+    /****************/
     Staff_command_req(Staff_command_req const&);
     ~Staff_command_req();
     Staff_command_req(Input_command*);
     Staff_command_req(Staff_command_req const&);
     ~Staff_command_req();
     Staff_command_req(Input_command*);
-    Request*clone()const;
-    void print()const;
+    REQUESTMETHODS(Staff_command_req,command);
 };
 
 #if 0
 };
 
 #if 0
@@ -243,7 +231,6 @@ enum Loudness {
 struct Bracket_req : Span_req {
     int nplet;                 // print a number over the beam.
 };
 struct Bracket_req : Span_req {
     int nplet;                 // print a number over the beam.
 };
-
 /**
 Start/stop a bracket at this note. if #nplet# is set, the staff will
 try to put an appropriate number over the bracket
 /**
 Start/stop a bracket at this note. if #nplet# is set, the staff will
 try to put an appropriate number over the bracket
index d3f944f57ec86c99463068788527d4577b4ecf4c..02c6e0bff63f450899bfe898a70caf4291c104f3 100644 (file)
@@ -9,8 +9,8 @@
 #include "item.hh"
 
 /// ball at the end of the stem
 #include "item.hh"
 
 /// ball at the end of the stem
-struct Rest : public Item
-{
+struct Rest : Item {
+
     int dots;
     int balltype;
 
     int dots;
     int balltype;
 
@@ -18,8 +18,8 @@ struct Rest : public Item
 
 
     Rest(int dur,int dots);
 
 
     Rest(int dur,int dots);
-    void print()const;
-
+    void do_print()const;
+    const char * name() const;
     Molecule* brew_molecule_p()const;
 };
 /**
     Molecule* brew_molecule_p()const;
 };
 /**
index 741be45e787c3e55fe0354e6262616b6925d849e..0508224a3a6f71f1ed6e0ec305d990de43345fbb 100644 (file)
@@ -16,7 +16,7 @@ struct Rhythmic_staff : public Simple_staff
     /****************/
     
     virtual Item *get_TYPESET_item(Command*);    
     /****************/
     
     virtual Item *get_TYPESET_item(Command*);    
-    virtual Stem *get_stem(Stem_req *rq,Moment);
+    virtual Stem *get_stem(Stem_req *rq);
     virtual Notehead * get_notehead(Note_req *rq, int b);   
     virtual void set_output(PScore *);
 };
     virtual Notehead * get_notehead(Note_req *rq, int b);   
     virtual void set_output(PScore *);
 };
index be21a60829cf08353e1fec6a92b5eadafa03cb70..27fddc589481cb016852e75807fb6d8647b166c2 100644 (file)
 #include "scriptdef.hh"
 #include "item.hh"
   
 #include "scriptdef.hh"
 #include "item.hh"
   
-struct Script : Item{
+struct Script : Item {
     int dir;
     int symdir;
     int pos;
     int staffsize;
     int dir;
     int symdir;
     int pos;
     int staffsize;
-    Script_def*specs_l_;
-    Stem * stem_l_;
-    Item * support;
+    Script_def *specs_l_;
+    Stem *stem_l_;
+    Array<Item *> support;
 
     /****************/
 
     /****************/
-    
+    const char * name() const;    
     void       set_symdir();
     void       set_default_dir();
     void       set_default_pos();
     void       set_symdir();
     void       set_default_dir();
     void       set_default_pos();
@@ -28,7 +28,10 @@ struct Script : Item{
     Molecule*  brew_molecule_p()const;
     virtual void do_post_processing();
     virtual void do_pre_processing();
     Molecule*  brew_molecule_p()const;
     virtual void do_post_processing();
     virtual void do_pre_processing();
-    Script(Script_req*, Item*,int,Stem*p=0);
+    Script(Script_req*, int);
+    void set_support(Item*);
+    void set_stem(Stem*);
+    Interval support_height()const;
     virtual Interval width() const;    
 };
 
     virtual Interval width() const;    
 };
 
index 531f994d6e8594ca0b84a0ae111b2a45e1d085b8..f0ff1679e2571133a300c9e409ed7737db1f7fdd 100644 (file)
@@ -34,7 +34,6 @@ struct Simple_column : Staff_column {
     Beam_req *beam_;
     Simple_staff* staff_l_;
     Text_req *text_;
     Beam_req *beam_;
     Simple_staff* staff_l_;
     Text_req *text_;
-    Lyric_req* lreq_p_;
     
     /****************/
     Slur_req  * find_slur(Voice *);
     
     /****************/
     Slur_req  * find_slur(Voice *);
@@ -44,7 +43,7 @@ struct Simple_column : Staff_column {
     Molecule *create_command_mol(Command *com);
 
     void take_request(Request *rq);   
     Molecule *create_command_mol(Command *com);
 
     void take_request(Request *rq);   
-    virtual void process_requests();
+    virtual void setup_requests();
 
     Simple_column(Score_column*s,Simple_staff*rs);
 };
 
     Simple_column(Score_column*s,Simple_staff*rs);
 };
@@ -59,7 +58,7 @@ struct Simple_staff : Staff {
     Staff_column*create_col(Score_column*);
     
     virtual Item *get_TYPESET_item(Command*);
     Staff_column*create_col(Score_column*);
     
     virtual Item *get_TYPESET_item(Command*);
-    virtual Stem *get_stem(Stem_req *rq, Moment)=0;
+    virtual Stem *get_stem(Stem_req *rq)=0;
     virtual Notehead *get_notehead(Note_req *rq, int b)=0;
     virtual Rest *get_rest(Rest_req *rq);
     virtual void set_output(PScore *);
     virtual Notehead *get_notehead(Note_req *rq, int b)=0;
     virtual Rest *get_rest(Rest_req *rq);
     virtual void set_output(PScore *);
index 192419ef2ee842d73813b6290ec762f1126db41a..a43844622b6b7218a16fa43cb7947eeba27def51 100644 (file)
@@ -10,6 +10,7 @@
 #include "proto.hh"
 #include "grouping.hh"
 
 #include "proto.hh"
 #include "grouping.hh"
 
+
 struct Simple_walker: Staff_walker {
     Stem *stem_;
     Array<Notehead *>noteheads;
 struct Simple_walker: Staff_walker {
     Stem *stem_;
     Array<Notehead *>noteheads;
@@ -34,8 +35,9 @@ struct Simple_walker: Staff_walker {
     virtual void do_TYPESET_command(Command*);
     virtual void do_INTERPRET_command(Command*);
     virtual void process_requests();
     virtual void do_TYPESET_command(Command*);
     virtual void do_INTERPRET_command(Command*);
     virtual void process_requests();
-    virtual void reset();
-    
+    virtual void do_post_move();
+    ~Simple_walker();
+    Simple_walker(Simple_walker const& c);
     void do_note(Note_info);
     Simple_walker(Simple_staff*);
     Simple_column *col();
     void do_note(Note_info);
     Simple_walker(Simple_staff*);
     Simple_column *col();
index 26bb2ff36e33ca0711b204d2733402d7fc7778d0..c9524ba6f5311a7071a74ff57ca8e563e27a2eb5 100644 (file)
@@ -21,7 +21,6 @@ struct Slur : Directional_spanner {
     /****************/
     Offset center() const;
     Slur();
     /****************/
     Offset center() const;
     Slur();
-    void print() const;    
     void do_post_processing();
     void do_pre_processing();
     void add(Notehead*);
     void do_post_processing();
     void do_pre_processing();
     void add(Notehead*);
@@ -30,7 +29,8 @@ struct Slur : Directional_spanner {
     Spanner* do_break_at( PCol*, PCol*) const;
     void process();
 private:
     Spanner* do_break_at( PCol*, PCol*) const;
     void process();
 private:
-Molecule*brew_molecule_p()const;
+    Molecule*brew_molecule_p()const;
+    const char * name() const;
 };
 
 #endif // SLUR_HH
 };
 
 #endif // SLUR_HH
index d04f0736a6252a95d2abd7314f61e18b8aae5cbf..144b110e29df0b5e64bb4362d5d56f7b2c24d948 100644 (file)
@@ -19,9 +19,10 @@ struct Spanner:Staff_elem {
     
     Spanner();
     virtual Interval width()const;
     
     Spanner();
     virtual Interval width()const;
-    void print()const;
-
+    void do_print()const;
+    const char* name()const;
     Spanner *broken_at(PCol *c1,  PCol *c2) const;
     Spanner *broken_at(PCol *c1,  PCol *c2) const;
+    virtual Spanner* spanner() { return this; }
 protected:
     /// clone a piece of  this spanner.
     virtual Spanner *do_break_at( PCol *c1,  PCol *c2) const=0; 
 protected:
     /// clone a piece of  this spanner.
     virtual Spanner *do_break_at( PCol *c1,  PCol *c2) const=0; 
@@ -31,9 +32,9 @@ protected:
     c1 >= start, c2  <= stop
     */
 };
     c1 >= start, c2  <= stop
     */
 };
-/**
-  A spanner is a symbol whose final appearance can only be calculated
-  after the breaking problem is solved.
+/** A spanner is a symbol which spans across several columns, so its
+  final appearance can only be calculated after the breaking problem
+  is solved.
 
   Examples
 
 
   Examples
 
index d02f94437337423bdb9e399d0d48caad7cc1ac93..cee6d27a19a15db3d7ac2049e42edd713f6c2f47 100644 (file)
@@ -15,7 +15,9 @@ struct Staff {
     Score *score_l_;
     PScore *pscore_l_;
     String define_spot_str_;
     Score *score_l_;
     PScore *pscore_l_;
     String define_spot_str_;
+
     /****************************************************************/
     /****************************************************************/
+
     void add(PointerList<Voice*> &s);
     void do_commands(PointerList<Input_command*> score_wide,
                     PointerList<Input_command*> staff_wide);
     void add(PointerList<Voice*> &s);
     void do_commands(PointerList<Input_command*> score_wide,
                     PointerList<Input_command*> staff_wide);
index 3eed7dfba7e0a5775a48b2d8a15efb1ea5083d53..c7751b6ecc9a7652fffa948c15add5c05abf521d 100644 (file)
@@ -40,8 +40,13 @@ struct Staff_elem {
     void pre_processing();
     void post_processing();
     void molecule_processing();
     void pre_processing();
     void post_processing();
     void molecule_processing();
-    
+    virtual const char *name() const;          // to find out derived classes.
+    virtual Spanner* spanner()  { return 0; }
+    virtual Item * item() { return 0; }
 protected:
 protected:
+    
+    /// do printing of derived info.
+    virtual void do_print() const=0;
     /// generate the molecule    
     virtual Molecule* brew_molecule_p()const=0;
     ///executed directly after the item is added to the PScore
     /// generate the molecule    
     virtual Molecule* brew_molecule_p()const=0;
     ///executed directly after the item is added to the PScore
@@ -69,5 +74,7 @@ private:
   accomplished with the dependencies field of struct Staff_elem.
 
   */
   accomplished with the dependencies field of struct Staff_elem.
 
   */
+
+#define NAME_METHOD(c) const char *c::name()const{ return #c; } struct c
 #endif // STAFFELEM_HH
 
 #endif // STAFFELEM_HH
 
index d9945229f236bc47de31ce6481ccfb32a38aee11..efac63e7b030681d507398383fe4942fceed7a63 100644 (file)
@@ -11,8 +11,8 @@
 #include "staff.hh"
 
 struct Staff_walker : public PCursor<Staff_column*> {
 #include "staff.hh"
 
 struct Staff_walker : public PCursor<Staff_column*> {
-    Staff * staff_;
-    PScore * pscore_;
+    Staff * staff_l_;
+    PScore * pscore_l_;
 
     int break_status;
     
 
     int break_status;
     
@@ -31,7 +31,8 @@ struct Staff_walker : public PCursor<Staff_column*> {
      ****************/
 
     /// every time ++ is called
      ****************/
 
     /// every time ++ is called
-    virtual void reset(){}
+    virtual void do_pre_move(){}
+    virtual void do_post_move(){}
     virtual void process_requests()=0;
     virtual void do_TYPESET_command(Command*)=0;
     virtual void do_INTERPRET_command(Command*)=0 ;
     virtual void process_requests()=0;
     virtual void do_TYPESET_command(Command*)=0;
     virtual void do_INTERPRET_command(Command*)=0 ;
index b9e3a9bba8f0ab11aab231143160bca01d3e99c0..0984f88022b2cfc64ca244f0ac0ce60c0f1211ab 100644 (file)
@@ -34,7 +34,7 @@ struct Staff_column {
       VIRTUAL
     ****************************************************************/
 
       VIRTUAL
     ****************************************************************/
 
-    virtual void process_requests()=0;
+    virtual void setup_requests()=0;
 
     virtual ~Staff_column();
 private:
 
     virtual ~Staff_column();
 private:
index 8788d5a53dc1331d4337e6ffa457121b649b03bf..046538ae16d055c9058b63a1f18198363d329877 100644 (file)
 #include "moment.hh"
 
 /// the rule attached to the ball
 #include "moment.hh"
 
 /// the rule attached to the ball
-struct Stem : public Item {
+struct Stem : Item {
+/*
     /// rhythmical length
     Moment note_length;
     /// rhythmical length
     Moment note_length;
-    
+    */  
     // heads the stem encompasses (positions)
     int minnote, maxnote;
 
     // heads the stem encompasses (positions)
     int minnote, maxnote;
 
@@ -49,20 +50,19 @@ struct Stem : public Item {
     Array<Notehead*> heads;
 
     /****************/
     Array<Notehead*> heads;
 
     /****************/
-    Stem(int center, Moment duration);
+    Stem(int center); //, Moment duration);
     
     /// ensure that this Stem also encompasses the Notehead #n#
     void add(Notehead*n);
     
     /// ensure that this Stem also encompasses the Notehead #n#
     void add(Notehead*n);
+    const char * name() const;
 
     Real hpos()const;
 
     Real hpos()const;
-    void print() const;
+    void do_print() const;
     void set_stemend(Real);
     void set_default_dir();
     void set_default_stemlen();
     void set_default_extents();
     void set_noteheads();
     void set_stemend(Real);
     void set_default_dir();
     void set_default_stemlen();
     void set_default_extents();
     void set_noteheads();
-    
-
     void do_pre_processing();
 
     Interval width() const;
     void do_pre_processing();
 
     Interval width() const;
index bd4ea924d23134f2460f458eab556ee25e269ffe..ebf7656276a8233fa890436f05f6ac87697066a1 100644 (file)
@@ -11,6 +11,7 @@
 #include "item.hh"
   
 struct Text_item : Item {
 #include "item.hh"
   
 struct Text_item : Item {
+    const char * name() const;
     int pos_i_;
     int staffsize_i_;
     int dir_i_;
     int pos_i_;
     int staffsize_i_;
     int dir_i_;
index 81c8b87c328e35767d4222843d50b38c9b29b300..8bfb9aab6b63ad7a483048bdb654b01880a478df 100644 (file)
@@ -16,14 +16,18 @@ struct Text_spanner : Spanner {
     Text_def spec;
     Offset tpos;
     Directional_spanner*support;
     Text_def spec;
     Offset tpos;
     Directional_spanner*support;
+
     /****************/
     /****************/
+
+    const char * name() const;
     virtual    void do_pre_processing();
     virtual    void do_post_processing();
     Molecule* brew_molecule_p()const;
     virtual    Interval height() const ;
     virtual    void do_pre_processing();
     virtual    void do_post_processing();
     Molecule* brew_molecule_p()const;
     virtual    Interval height() const ;
-    void print() const;
+    void do_print() const;
     virtual Spanner* do_break_at(PCol*,PCol*)const;
     virtual Spanner* do_break_at(PCol*,PCol*)const;
-    Text_spanner(Directional_spanner*);
+    Text_spanner();
+    void set_support(Directional_spanner*);
 };
 /**
   Use for triplets, eentweetjes, ottava, etc.
 };
 /**
   Use for triplets, eentweetjes, ottava, etc.
index f63f905a0d68ae2977f4698411d6945f2d179c03..867827f0295f27ae3d4ee43e10a723a3e8d11e53 100644 (file)
@@ -25,15 +25,10 @@ struct Voice {
 
     */
 
 
     */
 
-struct Voicegroup {
-    /// don't know how to identify these.
-};
-
 /// one horizontal bit. 
 struct Voice_element {
     Moment duration;
 /// one horizontal bit. 
 struct Voice_element {
     Moment duration;
-    const Voicegroup *group;
-    const Voice *voice_;
+    const Voice *voice_l_;
     IPointerList<Request*> reqs;
 
     /****************/
     IPointerList<Request*> reqs;
 
     /****************/
@@ -43,8 +38,6 @@ struct Voice_element {
     Voice_element(Voice_element const & src );
     void print ()const;
 };
     Voice_element(Voice_element const & src );
     void print ()const;
 };
-/** Apart from being a container for the requests, Voice_element is
-    glue between related items and spanners, between requests and
-    (voice)groups
+/** Apart from being a container for the requests, Voice_element is nothing
     */
 #endif
     */
 #endif
index cf9a3c5d6a5d039005fb004ac5d62e412d9b6a5a..eaae8fd3ef9fb0423dceffb3b42d49c3010f80f8 100644 (file)
@@ -1,7 +1,7 @@
 default: ;
 
 DISTFILES=Makefile  kortjakje.ly pavane.ly  maartje.ly\
 default: ;
 
 DISTFILES=Makefile  kortjakje.ly pavane.ly  maartje.ly\
-       cadenza.ly scales.ly standchen.lily twinkle.ly
+       cadenza.ly scales.ly standchen.ly twinkle.ly
 
 dist:
        ln $(DISTFILES) $(DDIR)/$(SUBDIR)
 
 dist:
        ln $(DISTFILES) $(DDIR)/$(SUBDIR)
index 7755894effe3ce9094a7365cf286a6fd957398ce..1a7925955f2a8d860673e9e83164025c04250bb6 100644 (file)
@@ -4,9 +4,8 @@
 %
 %
 
 %
 %
 
-
-
-ritme = staff {rhythmic
+ritme = staff {
+       rhythmic
        music {$
        c8
        |[a8() a8. a8 a16 a16 a16] c4.
        music {$
        c8
        |[a8() a8. a8 a16 a16 a16] c4.
@@ -25,6 +24,7 @@ ritme = staff {rhythmic
 
 melody=
 staff { melodic
 
 melody=
 staff { melodic
+%      complex
        music{$
        c8
        |r4 r4 r4 r4
        music{$
        c8
        |r4 r4 r4 r4
@@ -56,7 +56,7 @@ staff { melodic
                skip 2:0
                key 
                skip 5:0
                skip 2:0
                key 
                skip 5:0
-               clef "bass"
+               clef bass
        }
 }
 
        }
 }
 
index 6bd02b32e1082dd263a01fb6576c27e377218286..01d6545e64a787888c1a78d3b5cdf97e85072fae 100644 (file)
 
 horn =
 staff {
 
 horn =
 staff {
-       melodic
+%      melodic
+       complex
        music{  $
        \octave { ' }
        \duration { 8}
 
 % 1
        music{  $
        \octave { ' }
        \duration { 8}
 
 % 1
-       d2( [)d e cis `b]               |       
-       `a4 [`b cis] [cis `b] `b4       |
-       fis2( [)fis g e d]              |
+       d2(( [)d e cis `b]              |       
+       `a4 [`b cis] [cis `b] )`b4      |
+       fis2(( [)fis g e d]             |
        cis4 [d e(] [)e fis d cis]      |
        `b4 [cis d(] [)d e cis `b]      |
        cis4 [d e(] [)e fis d cis]      |
        `b4 [cis d(] [)d e cis `b]      |
-       cis2 r2^"c\'edez"               |
+       )cis2 r2^"c\'edez"              |
        r4 fis2 fis4                    |
        r4 fis2 fis4                    |
-       fis2^"en mesure" ()[fis e a fis]|
-       fis4-- e4-- d4-- e4--           |
+       fis2^"en mesure" (()[fis e a fis]|
+       fis4-- e4-- d4-- )e4--          |
        `b2()[`b^"un peu retenu" `a( d cis]|
 % 11
        )`b [`fis^"en \'elargissant"-- `a-- `b--] cis4-- `b4--|
        `fis2 r2                        |
        `b2()[`b^"un peu retenu" `a( d cis]|
 % 11
        )`b [`fis^"en \'elargissant"-- `a-- `b--] cis4-- `b4--|
        `fis2 r2                        |
-       cis4^"1er mouvement" d4^"tr\`es lontain" ()[d cis d e]
+       cis4^"1er mouvement"( d4^"tr\`es lontain" ()[d cis d e]
        \octave {  }
        \octave {  }
-       |       a4 gis2.        |
-       a4 b4()[b a b 'cis]     |
-       fis4 e4 cis2            |
-       e4 fis4 () [fis e fis gis]      |
-       cis4 `b4()`b8 r8 r4^"tr\`es soutenu"    |
+       |       a4 )gis2.       |
+       a4 (b4()[b a b 'cis]    |
+       fis4 e4 )cis2           |
+       e4( fis4 () [fis e fis gis]     |
+       cis4 `b4())`b8 r8 r4^"tr\`es soutenu"   |
 
        \command { \meter 2 *4 } r4 r4  |
        \command { \meter 4 *4 }
 
        \command { \meter 2 *4 } r4 r4  |
        \command { \meter 4 *4 }
-       'cis4_"\dyn ppp" 'd4 () ['d 'cis 'd 'e] |
-       a4 gis2.        |
-       a4 b4()[b a b 'cis]     |
-       fis4 e4 cis2    |
-       e4_"\dyn pp" fis4()[fis e fis gis]      |
-       cis4_"\dyn mf" `b4()`b8 r8 r4^"un peu plus lent"        |
+       'cis4_"\dyn ppp"( 'd4 () ['d 'cis 'd 'e] |
+       a4 )gis2.       |
+       a4 (b4()[b a b 'cis]    |
+       fis4 e4 )cis2   |
+       e4_"\dyn pp"( fis4()[fis e fis gis]     |
+       cis4_"\dyn mf" `b4())`b8 r8 r4^"un peu plus lent"       |
        r1      |
        r2 r4 r4 %^\fermata
 %% cut 'n paste.
        \octave { ' }
        r1      |
        r2 r4 r4 %^\fermata
 %% cut 'n paste.
        \octave { ' }
-       | d2^"Reprenez le mouvement"( [)d e cis `b]     |
-       `a4 [`b cis] [cis `b] `b4       |
-       fis2( [)fis g e d]      |
+       | d2^"Reprenez le mouvement"( ([)d e cis `b]    |
+       `a4 [`b cis] [cis `b] )`b4      |
+       fis2(( [)fis g e d]     |
        cis4 [d e(] [)e fis d cis]      |
        `b4 [cis d(] [)d e cis `b]      |
        cis4 [d e(] [)e fis d cis]      |
        `b4 [cis d(] [)d e cis `b]      |
-       cis2 r2^"c\'edez"       |
+       )cis2 r2^"c\'edez"      |
        r4 fis2 fis4    |
        r4 fis2 fis4    |
-       fis2^"en mesure"()[fis e a fis] |
+       fis2(^"en mesure"()[fis e a fis]        |
        fis4-- e4-- d4-- e4--   |
        `b2() [`b `a-. d-. cis-.]       |
        fis4-- e4-- d4-- e4--   |
        `b2() [`b `a-. d-. cis-.]       |
-       `b-. [`fis^"large" `a `b] cis4 `b4      `fis2 r2        |
+       )`b-. [`fis^"large" `a `b] cis4 `b4     `fis2 r2        |
 
        %% mark B
        r1^"1er mouvement"      
 
        %% mark B
        r1^"1er mouvement"      
@@ -80,18 +81,18 @@ staff {
        \command { \meter 4 *4 }
 
        \octave { ' }
        \command { \meter 4 *4 }
 
        \octave { ' }
-       |d2( [)d e cis `b]      |
-       `a4 [`b cis] [cis `b] `b4       |
-       fis2( [)fis g e d]      |
+       |d2(( [)d e cis `b]     |
+       `a4 [`b cis] [cis `b] )`b4      |
+       fis2( ([)fis g e d]     |
        cis4 [d e(] [)e fis d cis]      |
        `b4 [cis d(] [)d e cis `b]      |
        cis4 [d e(] [)e fis d cis]      |
        `b4 [cis d(] [)d e cis `b]      |
-       cis2 r2^"c\'edez"       |
+       )cis2 r2^"c\'edez"      |
        r4 fis2 fis4    |
        r4 fis2 fis4    |
-       fis2()[fis e a fis]     |
+       fis2(()[fis e a fis]    |
        fis4-- e4-- d4-- e4--   
        \octave{ }      
        | b2()[b a 'd 'cis]     |
        fis4-- e4-- d4-- e4--   
        \octave{ }      
        | b2()[b a 'd 'cis]     |
-       b [fis a b ] 'cis4 b4   |
+       )b [fis a b ] 'cis4 b4  |
        fis2 r2 |
        r1-\fermata     
                $}
        fis2 r2 |
        r1-\fermata     
                $}
index 92229d02e2061cf1a24064a889b1fb7775bd45c1..63742f53c92d0ca74509d18e3e7930244794bd3a 100644 (file)
@@ -54,9 +54,9 @@ score {
                geometric 1.4
        }
        commands  {
                geometric 1.4
        }
        commands  {
-                meter 6 8
+                meter 6* 8
                 skip 6:0
                 skip 6:0
-               meter 4 4
+               meter 4* 4
                skip 2:0
                skip 11:0
 
                skip 2:0
                skip 11:0
 
diff --git a/input/standchen.lily b/input/standchen.lily
deleted file mode 100644 (file)
index 81ef61d..0000000
+++ /dev/null
@@ -1,515 +0,0 @@
-% st\"andchen.lily
-% Franz Schubert (? - ?)
-%
-% comments with # note missing stuff
-% heu, make that %#%
-%
-%% Still looks fairly on the "ugh" side the beauty scale, mainly because of
-%% LilyPond's naive idealspacing calc.
-%%
-
-%
-%#%%
-%#%\title{St\"andchen}
-%#%\subtitle{Serenade}
-%#%%
-%#%\composer{`franz Schubert}
-%#%\tempo{M\"a\ss ig}
-%#%%
-%#%\meter{3/4}
-%#%\key\`f
-%#%\clef\treble
-%#%%
-%#%\barnumbering5
-%#%%\staffnumbers
-%#%\barnumberstyle\boxed
-%#%%
-%#%\staffseparation{12}
-%#%%
-%#%\duration8
-%%1
-melodie = music { $ 
-       \duration{ 8 }
-       r_"pp" { [ d `a-| } f-| { d `a-| } f-| { d `a-| ] }
-%%2
-       r { [ d `bes-| } f-| { d `bes-| } f-| { d `bes-| ] }
-%%3
-       r_"simile" { [ d `bes } e { d `bes } e { d `bes ] }
-%%4
-       r { [ `a cis } e { `a cis } e { `a cis ] }
-%#%:|
-%%5
-       \plet{ 2/3 } [ a()bes a ] \plet{ 1/1 } 'd4. a
-%%6
-       \plet{ 2/3 } [ g()a g ] \plet{ 1/1 } 'd4 a r
-%#%\tighten
-%#%\newline
-%%7
-       a4.^> g \plet{ 2/3 } [ g( f )e ] \plet{ 1/1 }
-%%8
-       f2 r4
-%%9
-%#%    { 'a4.( 'cis4.\stemdown_p } { ) 'g 'e_{dolce} }
-%#%    { 'g( 'e } 'f ) 'e
-       'a4.( )g \plet{ 2/3 } { 'g 'e } { 'f } { 'e } \plet{ 1/1 }
-%%10
-       { 'f2. 'd2. }
-%%11
-       \plet { 2/3 } [ a_"pp"( )bes a ] \plet { 1/1 } 'f4. a
-%%12
-       \plet { 2/3 } [ g( ) a g ] \plet { 1/1 } 'e4. 'd
-%%13
-       'c4. bes \plet { 2/3 } [ bes( ) a g ] \plet { 1/1 }
-%%14
-%#%    a2 r { 'd(^ f_p(v }
-       a2 r { 'd f_"p" }
-%%15
-%#%    { ) e4. ) 'c4.\stemup_{dolce} } { bes g }
-       { e4. 'c4._"dolce" } { bes g }
-       \plet { 2/3 } { [ bes g } a g ] \plet { 1/1 }
-%%16
-       { a2. f2. }
-%%17
-       [ a8._"cresc." 'cis16 ] 'f4. 'e
-%%18
-       [ 'd8. a16 ] f4. d
-%%19
-%#%    'c\grace\stemup
-       \plet { 2/3 } [ bes_"pp"( ) a bes ] \plet { 1/1 } 'd4. bes
-%%20
-       a2.
-%%21
-%#%    a\grace
-       \plet { 2/3 } [ g( )fis g ] \plet { 1/1 } bes4.^> g
-%%22
-%#%    =f2.
-       f2.
-%%23
-       [ a8._"mf" 'cis16 ] 'f4. 'e
-%%24
-       [ 'd8. a16 ] fis4. d
-%%25
-%#%    'cis\grace\stemup
-       \plet { 2/3 } [ b_"mf"( ) ais b ] \plet { 1/1 } 'd4. b
-%%26
-       { a2. fis2. }
-%#%\tighten\newline
-%%27
-       \plet { 2/3 } [ 'e_"f"( )'dis 'e ] \plet { 1/1 } 'g4. 'cis
-%%28
-       { 'd2. fis2. }
-%#%\volta1
-%%29
-%#%    { bes2(^++++ g2_{mf} } 
-       { bes2 g2_"mf" } 
-%#%    [v { 'd8.( bes8. } { bes16 ) )++ g16 } ]
-       { [ 'd8. bes8. } { bes16 g16 ] }
-%%30
-       { a4. fis4. } 
-%#%    [ { [ a_. f_.( } { a_. f_. } { a_. ) f_. } ]
-       { [ a_. f_. } { a_. f_. } { a_. f_. ] }
-%%31  
-       { a4. g4. }
-%#%    [ { a cis_.( } { a e_. } { a )- g_. } ]
-       { [ a cis_. } { a e_. } { a g_. ] }
-%%32
-       { a2 fis2_"pp" } { a4 fis4 }
-%%33
-%#%    { b2(^ g2 } [v { 'd8.( b8. } { b16 ) ) g16 } ]
-       { b2( g2 } { [ 'd8. b8. } { b16 g16 ] }
-%%34
-%#%    { a4. fis4. } [ { a_. fis_.( } { a_. fis_. } { a_. ) fis_. } ]
-       { a4. fis4. } { [ a_. fis_. } { a_. fis_. } { a_. fis_. ] }
-%%35
-%#%    { a4. g4. } [ { a cis_.( } { a e_. } { a )- g_. } ]
-       { a4. g4. } { [ a cis_. } { a e_. } { a g_. ] }
-%%36
-       { a2. fis2. }
-%#%\volta2
-%#%:|
-%%37
-       [ a8. a16 ] [ 'cis8. 'cis16 ] [ 'e8. 'e16 ]
-%%38
-       'd4( )'cis4 r4
-%%39
-%#%    > a4. [ 'cis 'e8. >! 'd16 ]
-       a4. [ 'cis 'e8. 'd16 ]
-%%40
-       'cis2 r4
-%%41
-%#%    { > 'fis4. 'cis4._f } 'e [ 'e( ) 'd >! 'cis ] \plet { 1/1 }
-       { 'fis4. 'cis4._"f" } 'e \plet { 2/3 } [ 'e( )'d 'cis ] \plet { 1/1 }
-%%42
-       [ b8. 'cis16 ] 'd4^> b r
-%%43
-%#%    [^ { b8._{ }_{ }_{ }_{ }_{ }_f g2. } 'cis16 ] 'd4^> b r
-       [ b8._"f" 'cis16 ] 'd4^> b r
-%%44
-%#%    [^ { > b8. fis2 } 'cis16 ] 'd4^> b >! r
-% typo?
-       [ b8. 'cis16 ] 'd4^> b r
-%%45
-%#%    'cis\grace\stemup
-       \plet { 2/3 } [ b_"p"( )ais b ] \plet { 1/1 } 'd4. b
-%%46
-%#%    { =a2. fis2. }
-       { a2. fis2. }
-%%47
-       \plet { 2/3 } [ 'e_"f"( )'dis 'e ] \plet { 1/1 } 'g4.^> 'cis
-%%48
-%#%    { fis2.(v ='d2.\stemup(^ }
-       { fis2. 'd2. }
-%%49
-%#%    { ) 'd4 ) =f2._> } { r4 s4_{decr} } 'd4\stemup
-       'd4 r4_"decresc." 'd4
-%%50
-       { bes2. e2. }
-%%51
-       { a2. cis2. }
-%%52
-       { fis2 d2 } { a4 f4_"pp" }
-%%53
-%#%    { bes2 g2 } [ { 'd8.^>( bes8. } { ) bes16 g16 } ]
-       { bes2 g2 } { [ 'd8.^> bes8. } { bes16 g16 ] }
-%%54
-%#%    { a4. fis4. } [ { a_. fis_.( } { a_. fis_. } { a_. ) fis_. } ]
-       { a4. fis4. } { [ a_. fis_. } { a_. fis_. } { a_. fis_. ] }
-%%55
-%#%    { a4. g4. } [ { a cis_.( } { a e_. } { a )- g_. } ] 
-       { a4. g4. } { [ a cis_. } { a e_. } { a g_. ] }
-%%56
-       { a2. fis2._"dim." }
-%%57
-       { a2. fis2. }
-%%58
-       { a2.^\fermata fis2. }
-%#%\tighten
-$ }
-
-begeleiding = music { $
-       \duration{2}
-       `d r4
-%%2
-       ``bes r4
-
-%%3
-       ``g r4
-
-%%4
-       ``a r4
-%#%:|
-%%5
-%#%\stemlength2
-\duration{ 8 }
-%#%    { =`f `d2 } `a d `a { d r4 } `a
-% i-d rather type:
-%      { \music{ [ `f `a d `a d `a ] } \music{ `d2 r4 } }
-% output little better...
-%      { `d2 \music{ [ `f `a d `a } } { \music{ d `a ] } r4 }
-       [ `f `a d `a d `a ]
-%%6
-%#%    { `d ``bes2 } `e `g `e { `g r4 } `e
-       [ `d `e `g `e `g `e ]
-%%7
-%#%    { `cis ``a2 } `e `g `e { `g r4 } `e
-       [ `cis `e `g `e `g `e ]
-%%8
-%#%    { `d `d2 } `a d `a { d r4 } `a
-       [ `d `a d `a d `a ]
-%%9
-%#%    `a e f e f e
-       [ `a e f e f e ]
-%%10
-%#%    `d `a d `a d `a
-       [ `d `a d `a d `a ]
-%%11
-%#%    [^ { `f `d2 } `a d `a { d r4 } `a ]
-       [ `f `a d `a d `a ]
-
-%%12 == 6
-%#%    { `d ``bes2 } `e `g `e { `g r4 } `e
-       [ `d `e `g `e `g `e ]
-%13
-%#%    { `e ``bes2 } `e `g `e { `g r4 } `e
-       [ `e `e `g `e `g `e ]
-%%14
-%#%    { `a `f2 } c f c { f r4 } c
-       [ `a c f c f c ]
-%%15
-       [ `c `g `bes `g `bes `g ]
-%%16
-       [ ``f `c `f `c `f `c ]
-%%17
-%#%    [^ { ``a ``a2 } `e `g `e { `g r4 } `e ]
-       [ ``a `e `g `e `g `e ]
-%%18
-%#%    [^ { `d `d2 } `a d `a { d r4 } `a ]
-       [ `d `a d `a d `a ]
-%%19
-%#%    s8               % skip space of `grace note
-%#%    [^ { ``bes ``bes2 } `f `bes `f { `bes r4 } `f ]
-       [ ``bes `f `bes `f `bes `f ]
-%%20
-%#%    [^ { ``f ``f2 } `c `f `c { `f r4 } `c ]
-       [ ``f `c `f `c `f `c ]
-%%21
-%#%    s8               % skip space of `grace note
-%#%    [ { `e `c } `g c `g c `g ]
-       { [ `e `c } `g c `g c `g ]
-%%22
-       [ `f `a c `a `f `c ]
-%%23
-%#%    [^ { ``a ``a2 } `e `g `e { `g r4 } `e ]
-       [ ``a `e `g `e `g `e ]
-%%24
-%#%    [^ { `d `d2 } `fis `a `fis { `a r4 } `fis]
-       [ `d `fis `a `fis `a `fis ]
-%%25
-%#%    s8               % skip space of `grace note
-%#%    [^ { ``g ``g2 } `d `b `d { `b r4 } `d]
-       [ ``g `d `b `d `b `d ]
-%%26
-%#%    [^ { `d `d2 } `a d `a { d r4 } `a]
-       [ `d `a d `a d `a ]
-%%27
-       { [ `cis ``a } `e `a `e `a `e ]
-%%28
-       [ `d `a d `a d `a ]
-%%29
-%#%    [ `d `g @ `bes `g `bes `g       ]
-       [ `d `g `bes `g `bes `g ]
-%#%\volta1
-%%30 
-       [ `d `fis `a `fis `a `fis ]
-%%31
-       [ `a `e `a `e `a `e ]
-%%32
-       [ `d `fis `a `fis `a `fis ]
-%%33
-       [ `d `g `b `g `b `g ]
-%%34
-       [ `d `fis `a `fis `a `fis ]
-%%35
-       [ `a `e `a `e `a `e ]
-%%36
-       [ `d `fis `a `fis `a `fis ]
-%#%\volta2
-%#%:|
-%%37
-       [ `a `e `g `e ``bes^> `e ]
-%%38
-       [ `a { e cis `a } { e cis `a } { e cis `a } { e cis `a } { e cis `a ] } 
-%%39
-       [ `a `e `g `e ``bes^> `e ]
-%%40
-       [ `a { e cis `a } { e cis `a } { e cis `a } { e cis `a } { e cis `a ] } 
-%%41
-       [ `ais `e `gis `e `gis `e ]
-%%42
-       { [ `d ``b } `fis `b `fis `b `fis ]
-%%43
-       { [ `e ``b } `g `b `g `b `g ]
-%%44
-       { [ `d ``b } `fis `b `fis `b `fis ]
-%%45
-%#%    s8               % skip space of `grace note
-%#%    [^{ ``g ``g2 } `d `b `d { `b r4 } `d]
-       [ ``g `d `b `d `b `d ]
-%%46
-%#%    [^ { `d `d2 } `a d `a { d r4 } `a ]
-       [ `d `a d `a d `a ]
-%%47
-       { [ `cis ``a } `e `a `e `a `e ]
-%%48
-       [ `d `fis `a `fis `a `fis ]
-%%49
-       [ `d `a d `a d `a ]
-%%50
-       [ ``g `e `g `e `g `e ]
-%%51
-       [ `a `e `g `e `g `e ]
-%%52
-       [ ``d `d `fis `d `fis `d ]
-%%53
-       [ `d `g `bes `g `bes `g ]
-%%54
-       [ `d `fis `a `fis `a `fis ]
-%%55
-       [ `a `e `g `e `g `e ]
-%%56
-       [ ``d ``a `d ``a `d ``a ]
-%%57
-       [ ``d ``a `d ``a `d ``a ]
-%%58
-       { `d2.^\fermata ``d2. }
-$ }
-
-tekst1 = music {
-       @
-       \duration{4}
-       _ _ _
-       _ _ _
-       _ _ _
-       _ _ _
- % 5
-       \plet{ 2/3 } Lei- se8 \plet{ 1/1 } fleh-4. en8 
-       \plet{ 2/3 } mei- ne8 \plet{ 1/1 } Lie- der8 _8
-       Durch4. die8 \plet{ 2/3 } Nacht zu8 \plet{ 1/1 } 
-       dir;2 _        
-       _ _ _ 
-       _ _ _
- % 11
-       \plet{ 2/3 } In den8 \plet{ 1/1 } stil-4. len8 
-       \plet{ 2/3 } Hain her-8 \plet{ 1/1 } nie-4. der,8
-       Lieb4. chen,8 \plet{ 2/3 } komm zu8 \plet{ 1/1 } 
-       mir!2 _
-       _ _ _ 
-       _ _ _
- % 17
-       Fl\"us-8. ternd16 schlan-4. ke8 
-       Wip-8. fel16 rau-4. schen8
-       \plet{ 2/3 } In des8 \plet{ 1/1 } Mon-4. des8 
-       Licht;2.
-       _ _ _ 
-       _ _ _
- % 23
-       Des8. Ver-16 r\"a-4. ters8 
-       feind-8. lich16 Lau-4. schen8
-       \plet{ 2/3 } F\"urch- te,8 \plet{ 1/1 } Hol-4. de,8 
-       nicht.2.
-       _ _ _ 
-       _ _ _
- % volta 1
- % 29
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
- % volta 2
- % 37
-       La\ss8. auch16 dir8. die16 Brust8. be-16
-       we- gen, _
-       Lieb-4. chen,8  h\"o-8. re16 
-       mich!2 _
-       _ _ _ 
-       _ _ _
-       Be-8. bend16 harr' ich8 _8
-       dir8. ent-16 ge- gen!8 _8
-       \plet{ 2/3 } Komm, be-8 \plet{ 1/1 } gl\"u4. cke8 
-       mich!2.
- % 47
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
- % 57
-       _ _ _ _ _ _ 
-       @
- }
- tekst2 = music {
-         @
-       \duration{4}
-       _ _ _
-       _ _ _
-       _ _ _
-       _ _ _
- % 5
-       \plet{ 2/3 } H\"orst die8 \plet{ 1/1 } Nach-4. ti-8 
-       \plet{ 2/3 } gal- len8 \plet{ 1/1 } schla- gen?8 _8
-       Ach!4. sie8 \plet{ 2/3 } fleh- en8 \plet{ 1/1 } 
-       dich,2 _
-       _ _ _ 
-       _ _ _
- % 11
-       \plet{ 2/3 } Mit der8 \plet{ 1/1 } T\"o-4. ne8
-       \plet{ 2/3 } s\"u\ss- en8 \plet{ 1/1 } Kla-4. gen8
-       Fleh-4. en8 \plet{ 2/3 } sie f\"ur8 \plet{ 1/1 }
-       mich.2 _
-       _ _ _ 
-       _ _ _
- % 17 ok tot hier
-       Sie-8. ver-16 stehn4. des8
-       Bus-8. ens16 Seh-4. nen,8
-       \plet{ 2/3 } Ken- nen8 \plet{ 1/1 } Lieb-4. es-8 
-       schmerz,2.
-       _ _ _ 
-       _ _ _
- % 23
-       R\"uh-8. ren16 mit4. den8 
-       Sil-8. ber-16 t\"o-4. nen8
-       \plet{ 2/3 } Jed- es8 \plet{ 1/1 } wei-4. che8 
-       Herz.2.
-       _ _ _ 
-       _ _ _
-         
- % volta 1
- % 29
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
-       _ _ _ _ _ _
- % volta 2
- % 37
- %     _ _ _ _ _ _
- %     _ _ _ _ _ _
- %     _ _ _ _ _ _
- %     _ _ _ _ _ _ 
- %     _ _ _ _ _ _
- % 47
- %     _ _ _ _ _ _
- %     _ _ _ _ _ _
- %     _ _ _ _ _ _
- %     _ _ _ _ _ _
- %     _ _ _ _ _ _
- % 57
- %     _ _ _ _ _ _ 
-       @
- }
-  
-score {
-       paper {
-               symboltables { table_sixteen }
-               output "standchen.uit"
-               unitspace 2.4 cm
- %             unitspace 4.0 cm % leaves all text stand free
-geometric 1.4
-       }
-       staff { 
-               melodic music { melodie }
-               commands {
-                       key $bes$
-                       clef "violin"
-               }
-       }
-       staff { 
-               lyric 
-               music { tekst1 }
-               music { tekst2 }
-       }
-       staff { 
-               melodic music { begeleiding }
-               commands {
-                       key $bes$
-                       clef "bass" 
-               }
-       }
-       commands { 
-               meter 3*4 
-               skip 4:0
-               bar ":|"
-               skip 32:0
-               bar ":|"
-               skip 22:0
-               bar "||"
-       }
-}
diff --git a/input/standchen.ly b/input/standchen.ly
new file mode 100644 (file)
index 0000000..81ef61d
--- /dev/null
@@ -0,0 +1,515 @@
+% st\"andchen.lily
+% Franz Schubert (? - ?)
+%
+% comments with # note missing stuff
+% heu, make that %#%
+%
+%% Still looks fairly on the "ugh" side the beauty scale, mainly because of
+%% LilyPond's naive idealspacing calc.
+%%
+
+%
+%#%%
+%#%\title{St\"andchen}
+%#%\subtitle{Serenade}
+%#%%
+%#%\composer{`franz Schubert}
+%#%\tempo{M\"a\ss ig}
+%#%%
+%#%\meter{3/4}
+%#%\key\`f
+%#%\clef\treble
+%#%%
+%#%\barnumbering5
+%#%%\staffnumbers
+%#%\barnumberstyle\boxed
+%#%%
+%#%\staffseparation{12}
+%#%%
+%#%\duration8
+%%1
+melodie = music { $ 
+       \duration{ 8 }
+       r_"pp" { [ d `a-| } f-| { d `a-| } f-| { d `a-| ] }
+%%2
+       r { [ d `bes-| } f-| { d `bes-| } f-| { d `bes-| ] }
+%%3
+       r_"simile" { [ d `bes } e { d `bes } e { d `bes ] }
+%%4
+       r { [ `a cis } e { `a cis } e { `a cis ] }
+%#%:|
+%%5
+       \plet{ 2/3 } [ a()bes a ] \plet{ 1/1 } 'd4. a
+%%6
+       \plet{ 2/3 } [ g()a g ] \plet{ 1/1 } 'd4 a r
+%#%\tighten
+%#%\newline
+%%7
+       a4.^> g \plet{ 2/3 } [ g( f )e ] \plet{ 1/1 }
+%%8
+       f2 r4
+%%9
+%#%    { 'a4.( 'cis4.\stemdown_p } { ) 'g 'e_{dolce} }
+%#%    { 'g( 'e } 'f ) 'e
+       'a4.( )g \plet{ 2/3 } { 'g 'e } { 'f } { 'e } \plet{ 1/1 }
+%%10
+       { 'f2. 'd2. }
+%%11
+       \plet { 2/3 } [ a_"pp"( )bes a ] \plet { 1/1 } 'f4. a
+%%12
+       \plet { 2/3 } [ g( ) a g ] \plet { 1/1 } 'e4. 'd
+%%13
+       'c4. bes \plet { 2/3 } [ bes( ) a g ] \plet { 1/1 }
+%%14
+%#%    a2 r { 'd(^ f_p(v }
+       a2 r { 'd f_"p" }
+%%15
+%#%    { ) e4. ) 'c4.\stemup_{dolce} } { bes g }
+       { e4. 'c4._"dolce" } { bes g }
+       \plet { 2/3 } { [ bes g } a g ] \plet { 1/1 }
+%%16
+       { a2. f2. }
+%%17
+       [ a8._"cresc." 'cis16 ] 'f4. 'e
+%%18
+       [ 'd8. a16 ] f4. d
+%%19
+%#%    'c\grace\stemup
+       \plet { 2/3 } [ bes_"pp"( ) a bes ] \plet { 1/1 } 'd4. bes
+%%20
+       a2.
+%%21
+%#%    a\grace
+       \plet { 2/3 } [ g( )fis g ] \plet { 1/1 } bes4.^> g
+%%22
+%#%    =f2.
+       f2.
+%%23
+       [ a8._"mf" 'cis16 ] 'f4. 'e
+%%24
+       [ 'd8. a16 ] fis4. d
+%%25
+%#%    'cis\grace\stemup
+       \plet { 2/3 } [ b_"mf"( ) ais b ] \plet { 1/1 } 'd4. b
+%%26
+       { a2. fis2. }
+%#%\tighten\newline
+%%27
+       \plet { 2/3 } [ 'e_"f"( )'dis 'e ] \plet { 1/1 } 'g4. 'cis
+%%28
+       { 'd2. fis2. }
+%#%\volta1
+%%29
+%#%    { bes2(^++++ g2_{mf} } 
+       { bes2 g2_"mf" } 
+%#%    [v { 'd8.( bes8. } { bes16 ) )++ g16 } ]
+       { [ 'd8. bes8. } { bes16 g16 ] }
+%%30
+       { a4. fis4. } 
+%#%    [ { [ a_. f_.( } { a_. f_. } { a_. ) f_. } ]
+       { [ a_. f_. } { a_. f_. } { a_. f_. ] }
+%%31  
+       { a4. g4. }
+%#%    [ { a cis_.( } { a e_. } { a )- g_. } ]
+       { [ a cis_. } { a e_. } { a g_. ] }
+%%32
+       { a2 fis2_"pp" } { a4 fis4 }
+%%33
+%#%    { b2(^ g2 } [v { 'd8.( b8. } { b16 ) ) g16 } ]
+       { b2( g2 } { [ 'd8. b8. } { b16 g16 ] }
+%%34
+%#%    { a4. fis4. } [ { a_. fis_.( } { a_. fis_. } { a_. ) fis_. } ]
+       { a4. fis4. } { [ a_. fis_. } { a_. fis_. } { a_. fis_. ] }
+%%35
+%#%    { a4. g4. } [ { a cis_.( } { a e_. } { a )- g_. } ]
+       { a4. g4. } { [ a cis_. } { a e_. } { a g_. ] }
+%%36
+       { a2. fis2. }
+%#%\volta2
+%#%:|
+%%37
+       [ a8. a16 ] [ 'cis8. 'cis16 ] [ 'e8. 'e16 ]
+%%38
+       'd4( )'cis4 r4
+%%39
+%#%    > a4. [ 'cis 'e8. >! 'd16 ]
+       a4. [ 'cis 'e8. 'd16 ]
+%%40
+       'cis2 r4
+%%41
+%#%    { > 'fis4. 'cis4._f } 'e [ 'e( ) 'd >! 'cis ] \plet { 1/1 }
+       { 'fis4. 'cis4._"f" } 'e \plet { 2/3 } [ 'e( )'d 'cis ] \plet { 1/1 }
+%%42
+       [ b8. 'cis16 ] 'd4^> b r
+%%43
+%#%    [^ { b8._{ }_{ }_{ }_{ }_{ }_f g2. } 'cis16 ] 'd4^> b r
+       [ b8._"f" 'cis16 ] 'd4^> b r
+%%44
+%#%    [^ { > b8. fis2 } 'cis16 ] 'd4^> b >! r
+% typo?
+       [ b8. 'cis16 ] 'd4^> b r
+%%45
+%#%    'cis\grace\stemup
+       \plet { 2/3 } [ b_"p"( )ais b ] \plet { 1/1 } 'd4. b
+%%46
+%#%    { =a2. fis2. }
+       { a2. fis2. }
+%%47
+       \plet { 2/3 } [ 'e_"f"( )'dis 'e ] \plet { 1/1 } 'g4.^> 'cis
+%%48
+%#%    { fis2.(v ='d2.\stemup(^ }
+       { fis2. 'd2. }
+%%49
+%#%    { ) 'd4 ) =f2._> } { r4 s4_{decr} } 'd4\stemup
+       'd4 r4_"decresc." 'd4
+%%50
+       { bes2. e2. }
+%%51
+       { a2. cis2. }
+%%52
+       { fis2 d2 } { a4 f4_"pp" }
+%%53
+%#%    { bes2 g2 } [ { 'd8.^>( bes8. } { ) bes16 g16 } ]
+       { bes2 g2 } { [ 'd8.^> bes8. } { bes16 g16 ] }
+%%54
+%#%    { a4. fis4. } [ { a_. fis_.( } { a_. fis_. } { a_. ) fis_. } ]
+       { a4. fis4. } { [ a_. fis_. } { a_. fis_. } { a_. fis_. ] }
+%%55
+%#%    { a4. g4. } [ { a cis_.( } { a e_. } { a )- g_. } ] 
+       { a4. g4. } { [ a cis_. } { a e_. } { a g_. ] }
+%%56
+       { a2. fis2._"dim." }
+%%57
+       { a2. fis2. }
+%%58
+       { a2.^\fermata fis2. }
+%#%\tighten
+$ }
+
+begeleiding = music { $
+       \duration{2}
+       `d r4
+%%2
+       ``bes r4
+
+%%3
+       ``g r4
+
+%%4
+       ``a r4
+%#%:|
+%%5
+%#%\stemlength2
+\duration{ 8 }
+%#%    { =`f `d2 } `a d `a { d r4 } `a
+% i-d rather type:
+%      { \music{ [ `f `a d `a d `a ] } \music{ `d2 r4 } }
+% output little better...
+%      { `d2 \music{ [ `f `a d `a } } { \music{ d `a ] } r4 }
+       [ `f `a d `a d `a ]
+%%6
+%#%    { `d ``bes2 } `e `g `e { `g r4 } `e
+       [ `d `e `g `e `g `e ]
+%%7
+%#%    { `cis ``a2 } `e `g `e { `g r4 } `e
+       [ `cis `e `g `e `g `e ]
+%%8
+%#%    { `d `d2 } `a d `a { d r4 } `a
+       [ `d `a d `a d `a ]
+%%9
+%#%    `a e f e f e
+       [ `a e f e f e ]
+%%10
+%#%    `d `a d `a d `a
+       [ `d `a d `a d `a ]
+%%11
+%#%    [^ { `f `d2 } `a d `a { d r4 } `a ]
+       [ `f `a d `a d `a ]
+
+%%12 == 6
+%#%    { `d ``bes2 } `e `g `e { `g r4 } `e
+       [ `d `e `g `e `g `e ]
+%13
+%#%    { `e ``bes2 } `e `g `e { `g r4 } `e
+       [ `e `e `g `e `g `e ]
+%%14
+%#%    { `a `f2 } c f c { f r4 } c
+       [ `a c f c f c ]
+%%15
+       [ `c `g `bes `g `bes `g ]
+%%16
+       [ ``f `c `f `c `f `c ]
+%%17
+%#%    [^ { ``a ``a2 } `e `g `e { `g r4 } `e ]
+       [ ``a `e `g `e `g `e ]
+%%18
+%#%    [^ { `d `d2 } `a d `a { d r4 } `a ]
+       [ `d `a d `a d `a ]
+%%19
+%#%    s8               % skip space of `grace note
+%#%    [^ { ``bes ``bes2 } `f `bes `f { `bes r4 } `f ]
+       [ ``bes `f `bes `f `bes `f ]
+%%20
+%#%    [^ { ``f ``f2 } `c `f `c { `f r4 } `c ]
+       [ ``f `c `f `c `f `c ]
+%%21
+%#%    s8               % skip space of `grace note
+%#%    [ { `e `c } `g c `g c `g ]
+       { [ `e `c } `g c `g c `g ]
+%%22
+       [ `f `a c `a `f `c ]
+%%23
+%#%    [^ { ``a ``a2 } `e `g `e { `g r4 } `e ]
+       [ ``a `e `g `e `g `e ]
+%%24
+%#%    [^ { `d `d2 } `fis `a `fis { `a r4 } `fis]
+       [ `d `fis `a `fis `a `fis ]
+%%25
+%#%    s8               % skip space of `grace note
+%#%    [^ { ``g ``g2 } `d `b `d { `b r4 } `d]
+       [ ``g `d `b `d `b `d ]
+%%26
+%#%    [^ { `d `d2 } `a d `a { d r4 } `a]
+       [ `d `a d `a d `a ]
+%%27
+       { [ `cis ``a } `e `a `e `a `e ]
+%%28
+       [ `d `a d `a d `a ]
+%%29
+%#%    [ `d `g @ `bes `g `bes `g       ]
+       [ `d `g `bes `g `bes `g ]
+%#%\volta1
+%%30 
+       [ `d `fis `a `fis `a `fis ]
+%%31
+       [ `a `e `a `e `a `e ]
+%%32
+       [ `d `fis `a `fis `a `fis ]
+%%33
+       [ `d `g `b `g `b `g ]
+%%34
+       [ `d `fis `a `fis `a `fis ]
+%%35
+       [ `a `e `a `e `a `e ]
+%%36
+       [ `d `fis `a `fis `a `fis ]
+%#%\volta2
+%#%:|
+%%37
+       [ `a `e `g `e ``bes^> `e ]
+%%38
+       [ `a { e cis `a } { e cis `a } { e cis `a } { e cis `a } { e cis `a ] } 
+%%39
+       [ `a `e `g `e ``bes^> `e ]
+%%40
+       [ `a { e cis `a } { e cis `a } { e cis `a } { e cis `a } { e cis `a ] } 
+%%41
+       [ `ais `e `gis `e `gis `e ]
+%%42
+       { [ `d ``b } `fis `b `fis `b `fis ]
+%%43
+       { [ `e ``b } `g `b `g `b `g ]
+%%44
+       { [ `d ``b } `fis `b `fis `b `fis ]
+%%45
+%#%    s8               % skip space of `grace note
+%#%    [^{ ``g ``g2 } `d `b `d { `b r4 } `d]
+       [ ``g `d `b `d `b `d ]
+%%46
+%#%    [^ { `d `d2 } `a d `a { d r4 } `a ]
+       [ `d `a d `a d `a ]
+%%47
+       { [ `cis ``a } `e `a `e `a `e ]
+%%48
+       [ `d `fis `a `fis `a `fis ]
+%%49
+       [ `d `a d `a d `a ]
+%%50
+       [ ``g `e `g `e `g `e ]
+%%51
+       [ `a `e `g `e `g `e ]
+%%52
+       [ ``d `d `fis `d `fis `d ]
+%%53
+       [ `d `g `bes `g `bes `g ]
+%%54
+       [ `d `fis `a `fis `a `fis ]
+%%55
+       [ `a `e `g `e `g `e ]
+%%56
+       [ ``d ``a `d ``a `d ``a ]
+%%57
+       [ ``d ``a `d ``a `d ``a ]
+%%58
+       { `d2.^\fermata ``d2. }
+$ }
+
+tekst1 = music {
+       @
+       \duration{4}
+       _ _ _
+       _ _ _
+       _ _ _
+       _ _ _
+ % 5
+       \plet{ 2/3 } Lei- se8 \plet{ 1/1 } fleh-4. en8 
+       \plet{ 2/3 } mei- ne8 \plet{ 1/1 } Lie- der8 _8
+       Durch4. die8 \plet{ 2/3 } Nacht zu8 \plet{ 1/1 } 
+       dir;2 _        
+       _ _ _ 
+       _ _ _
+ % 11
+       \plet{ 2/3 } In den8 \plet{ 1/1 } stil-4. len8 
+       \plet{ 2/3 } Hain her-8 \plet{ 1/1 } nie-4. der,8
+       Lieb4. chen,8 \plet{ 2/3 } komm zu8 \plet{ 1/1 } 
+       mir!2 _
+       _ _ _ 
+       _ _ _
+ % 17
+       Fl\"us-8. ternd16 schlan-4. ke8 
+       Wip-8. fel16 rau-4. schen8
+       \plet{ 2/3 } In des8 \plet{ 1/1 } Mon-4. des8 
+       Licht;2.
+       _ _ _ 
+       _ _ _
+ % 23
+       Des8. Ver-16 r\"a-4. ters8 
+       feind-8. lich16 Lau-4. schen8
+       \plet{ 2/3 } F\"urch- te,8 \plet{ 1/1 } Hol-4. de,8 
+       nicht.2.
+       _ _ _ 
+       _ _ _
+ % volta 1
+ % 29
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+ % volta 2
+ % 37
+       La\ss8. auch16 dir8. die16 Brust8. be-16
+       we- gen, _
+       Lieb-4. chen,8  h\"o-8. re16 
+       mich!2 _
+       _ _ _ 
+       _ _ _
+       Be-8. bend16 harr' ich8 _8
+       dir8. ent-16 ge- gen!8 _8
+       \plet{ 2/3 } Komm, be-8 \plet{ 1/1 } gl\"u4. cke8 
+       mich!2.
+ % 47
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+ % 57
+       _ _ _ _ _ _ 
+       @
+ }
+ tekst2 = music {
+         @
+       \duration{4}
+       _ _ _
+       _ _ _
+       _ _ _
+       _ _ _
+ % 5
+       \plet{ 2/3 } H\"orst die8 \plet{ 1/1 } Nach-4. ti-8 
+       \plet{ 2/3 } gal- len8 \plet{ 1/1 } schla- gen?8 _8
+       Ach!4. sie8 \plet{ 2/3 } fleh- en8 \plet{ 1/1 } 
+       dich,2 _
+       _ _ _ 
+       _ _ _
+ % 11
+       \plet{ 2/3 } Mit der8 \plet{ 1/1 } T\"o-4. ne8
+       \plet{ 2/3 } s\"u\ss- en8 \plet{ 1/1 } Kla-4. gen8
+       Fleh-4. en8 \plet{ 2/3 } sie f\"ur8 \plet{ 1/1 }
+       mich.2 _
+       _ _ _ 
+       _ _ _
+ % 17 ok tot hier
+       Sie-8. ver-16 stehn4. des8
+       Bus-8. ens16 Seh-4. nen,8
+       \plet{ 2/3 } Ken- nen8 \plet{ 1/1 } Lieb-4. es-8 
+       schmerz,2.
+       _ _ _ 
+       _ _ _
+ % 23
+       R\"uh-8. ren16 mit4. den8 
+       Sil-8. ber-16 t\"o-4. nen8
+       \plet{ 2/3 } Jed- es8 \plet{ 1/1 } wei-4. che8 
+       Herz.2.
+       _ _ _ 
+       _ _ _
+         
+ % volta 1
+ % 29
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+       _ _ _ _ _ _
+ % volta 2
+ % 37
+ %     _ _ _ _ _ _
+ %     _ _ _ _ _ _
+ %     _ _ _ _ _ _
+ %     _ _ _ _ _ _ 
+ %     _ _ _ _ _ _
+ % 47
+ %     _ _ _ _ _ _
+ %     _ _ _ _ _ _
+ %     _ _ _ _ _ _
+ %     _ _ _ _ _ _
+ %     _ _ _ _ _ _
+ % 57
+ %     _ _ _ _ _ _ 
+       @
+ }
+  
+score {
+       paper {
+               symboltables { table_sixteen }
+               output "standchen.uit"
+               unitspace 2.4 cm
+ %             unitspace 4.0 cm % leaves all text stand free
+geometric 1.4
+       }
+       staff { 
+               melodic music { melodie }
+               commands {
+                       key $bes$
+                       clef "violin"
+               }
+       }
+       staff { 
+               lyric 
+               music { tekst1 }
+               music { tekst2 }
+       }
+       staff { 
+               melodic music { begeleiding }
+               commands {
+                       key $bes$
+                       clef "bass" 
+               }
+       }
+       commands { 
+               meter 3*4 
+               skip 4:0
+               bar ":|"
+               skip 32:0
+               bar ":|"
+               skip 22:0
+               bar "||"
+       }
+}
index f866678bc825d26a4bf484692945e20ebb57d755..8664faed17c2b3723e423091f3dcda2efd05450f 100644 (file)
@@ -104,13 +104,15 @@ text3 = music {
 }
 
 mstaf = staff {
 }
 
 mstaf = staff {
-       melodic
+%      melodic
+       complex
        music { melodie }
        commands { clef "violin" }
 }
 
 bass_staf = staff {
        music { melodie }
        commands { clef "violin" }
 }
 
 bass_staf = staff {
-       melodic
+%      melodic
+       complex
        music { begeleiding }
        commands { clef "bass" }
 }
        music { begeleiding }
        commands { clef "bass" }
 }
@@ -148,7 +150,7 @@ score {
        staff { english_staf }
        staff { bass_staf }
        paper {
        staff { english_staf }
        staff { bass_staf }
        paper {
-               unitspace 2.5cm % a whole note takes 2.5 cm ideally.
+               unitspace 2.5cm
        }
        commands {
                meter 2 * 4
        }
        commands {
                meter 2 * 4
diff --git a/ltest.tex b/ltest.tex
new file mode 100644 (file)
index 0000000..ce39b7c
--- /dev/null
+++ b/ltest.tex
@@ -0,0 +1,15 @@
+% Mats Bengtsson
+\documentclass[a4paper, 10pt]{article}
+
+% Allow for 8-bit characters:
+\usepackage[latin1]{inputenc}
+\usepackage[T1]{fontenc}
+
+\begin{document}
+\input lilyponddefs
+\input titledefs
+
+\def\settext#1{\normalfont #1} % Allow for 8-bit characters
+
+\input lelie.out
+\end{document}
index b18c500e62d8504a2b0d8a2cc872dd5e4d6d23f7..4b3a0716eb37f8b9689223212def5791c22ed2b6 100644 (file)
@@ -4,17 +4,18 @@
 #include "paper.hh"
 #include "lookup.hh"
 
 #include "paper.hh"
 #include "lookup.hh"
 
+NAME_METHOD(Bar);
 
 Bar::Bar( String t)
 {
     type = t;
 }
 
 Bar::Bar( String t)
 {
     type = t;
 }
+
 Molecule*
 Bar::brew_molecule_p()const
 {    
     Symbol s = paper()->lookup_p_->bar(type);
 Molecule*
 Bar::brew_molecule_p()const
 {    
     Symbol s = paper()->lookup_p_->bar(type);
-Molecule*    output = new Molecule(Atom(s));
-return output;
-    
+    Molecule*    output = new Molecule(Atom(s));
+    return output;
 }
     
 }
     
index c36ca67436933b5083eefdf98907dd6fbed6fa0a..abf94d157b284e8acc8e62fae4e74209fb1e4320 100644 (file)
@@ -11,6 +11,8 @@
 #include "lookup.hh"
 #include "grouping.hh"
 
 #include "lookup.hh"
 #include "grouping.hh"
 
+NAME_METHOD(Beam);
+
 struct Stem_info {
     Real x;
     Real idealy;
 struct Stem_info {
     Real x;
     Real idealy;
@@ -60,7 +62,7 @@ void
 Beam::add(Stem*s)
 {
     stems.bottom().add(s);
 Beam::add(Stem*s)
 {
     stems.bottom().add(s);
-    s->dependencies.add(this);
+    s->dependencies.push(this);
     s->print_flag = false;
 }
 
     s->print_flag = false;
 }
 
@@ -89,13 +91,13 @@ Beam::solve_slope()
     for (iter_top(stems,i); i.ok(); i++) {
        i->set_default_extents();
        Stem_info info(i);
     for (iter_top(stems,i); i.ok(); i++) {
        i->set_default_extents();
        Stem_info info(i);
-       sinfo.add(info);
+       sinfo.push(info);
     }
     Real leftx = sinfo[0].x;
     Least_squares l;
     for (int i=0; i < sinfo.size(); i++) {
        sinfo[i].x -= leftx;
     }
     Real leftx = sinfo[0].x;
     Least_squares l;
     for (int i=0; i < sinfo.size(); i++) {
        sinfo[i].x -= leftx;
-       l.input.add(Offset(sinfo[i].x, sinfo[i].idealy));
+       l.input.push(Offset(sinfo[i].x, sinfo[i].idealy));
     }
 
     l.minimise(slope, left_pos);
     }
 
     l.minimise(slope, left_pos);
@@ -152,12 +154,12 @@ Beam::set_grouping(Rhythmic_grouping def, Rhythmic_grouping cur)
        for (; s.ok(); s++) {
            int f = intlog2(abs(s->flag))-2;
            assert(f>0);
        for (; s.ok(); s++) {
            int f = intlog2(abs(s->flag))-2;
            assert(f>0);
-           flags.add(f);
+           flags.push(f);
        }
        int fi =0;
        b= cur.generate_beams(flags, fi);
        b.insert(0,0);
        }
        int fi =0;
        b= cur.generate_beams(flags, fi);
        b.insert(0,0);
-       b.add(0);
+       b.push(0);
        assert(stems.size() == b.size()/2);
     }
 
        assert(stems.size() == b.size()/2);
     }
 
@@ -276,12 +278,11 @@ Beam::brew_molecule_p() const return out;
 }
 
 void
 }
 
 void
-Beam::print()const
+Beam::do_print()const
 {
 #ifndef NPRINT
 {
 #ifndef NPRINT
-    mtor << "slope " <<slope << "left ypos " << left_pos;
+    mtor << "slope " <<slope << "left ypos " << left_pos;
     Spanner::print();
     Spanner::print();
-    mtor << "}\n";
 #endif
 }
 
 #endif
 }
 
index 2a0586edff2b0e0775029ba4dcf5074b787c1b04..f3832cf0f608fb3848d1c2a1ad0e66cc27307103 100644 (file)
@@ -19,7 +19,7 @@ Break_algorithm::find_breaks() const
     Array<PCol *> retval;
     for (iter_top(pscore_.cols,c); c.ok(); c++)
        if (c->breakable())
     Array<PCol *> retval;
     for (iter_top(pscore_.cols,c); c.ok(); c++)
        if (c->breakable())
-           retval.add(c);
+           retval.push(c);
 
     return retval;
 }
 
     return retval;
 }
@@ -82,7 +82,7 @@ Col_configuration::Col_configuration()
 void
 Col_configuration::add( PCol*c)
 {
 void
 Col_configuration::add( PCol*c)
 {
-    cols.add(c);
+    cols.push(c);
 }
 
 void
 }
 
 void
index 8b10b60107b1d50a6ecb71901c64aa8b0e6e780e..2b451a804d9f16b484b97200aee8675fdb36b3bb 100644 (file)
@@ -5,11 +5,14 @@
 #include "lookup.hh"
 #include "clef.hh"
 
 #include "lookup.hh"
 #include "clef.hh"
 
+NAME_METHOD(Clef_item);
+
 Clef_item::Clef_item()
 {
     change = true;
     read("violin");
 }
 Clef_item::Clef_item()
 {
     change = true;
     read("violin");
 }
+
 void
 Clef_item::read(String t)
 {
 void
 Clef_item::read(String t)
 {
diff --git a/src/complexmelodicstaff.cc b/src/complexmelodicstaff.cc
new file mode 100644 (file)
index 0000000..66aa63e
--- /dev/null
@@ -0,0 +1,31 @@
+#include "keyitem.hh"
+#include "stem.hh"
+#include "rest.hh"
+#include "notehead.hh"
+#include "paper.hh"
+#include "molecule.hh"
+#include "linepstaff.hh"
+#include "complexmelodicstaff.hh"
+#include "sccol.hh" 
+#include "localkeyitem.hh"
+#include "request.hh"
+
+const int NO_LINES=5;
+
+
+void
+Complex_melodic_staff::set_output(PScore*ps)
+{
+    theline_l_ = new Linestaff(NO_LINES,ps); // theline_l_ is added to pscore later.
+    Complex_staff::set_output(ps);
+}
+
+Item *
+Complex_melodic_staff::get_TYPESET_item(Command*com)
+{
+    if (com->args[0] == "KEY") {
+       return new Keyitem(NO_LINES);   // urgh. depends on clef.
+    } else
+       return Complex_staff::get_TYPESET_item(com);
+}
+
diff --git a/src/complexprint.cc b/src/complexprint.cc
new file mode 100644 (file)
index 0000000..f266f7b
--- /dev/null
@@ -0,0 +1,98 @@
+#include "request.hh"
+#include "pscore.hh"
+#include "paper.hh"
+#include "complexstaff.hh"
+#include "sccol.hh"
+#include "debug.hh"
+
+#include "clefitem.hh"
+#include "bar.hh"
+#include "meter.hh"
+
+Item *
+Complex_staff::get_TYPESET_item(Command *com)
+{
+    Item *s=0;
+    Array<Scalar> arg( com->args);
+    String type =arg[0];
+    arg.del(0);
+    if (type ==  "BAR" ) {
+       s = new Bar(com->args[1]);      
+    } else if (type == "METER") {
+       s = new Meter(arg);
+    } else if (type == "CLEF" || type == "CURRENTCLEF") {
+       Clef_item * c = new Clef_item;
+       s = c;
+       c->change = (type == "CLEF");   
+    }else{
+       WARN << "ignoring TYPESET command for " << type << '\n';
+    }
+    return s;
+}
+
+
+Interval
+citemlist_width(const Array<Item*> &its)
+{
+    Interval iv ;
+    iv.set_empty();
+     
+    for (int j =0; j < its.size(); j++){
+       iv.unite (its[j]->width());
+
+    }
+    return iv;
+}
+
+void
+Complex_column::typeset_item(Item *i, int breakst)
+{
+    assert(i);
+    
+    staff_l_->pscore_l_->typeset_item(i, score_column_l_->pcol_l_,
+                                 staff_l_->theline_l_,breakst);
+    
+    if (breakst == BREAK_PRE - BREAK_PRE) {
+       
+        Array<Item*> to_move(
+           staff_l_->pscore_l_->select_items(staff_l_->theline_l_,
+                                         score_column_l_->pcol_l_->prebreak_p_));
+       Interval column_wid = citemlist_width(to_move);
+       assert(!column_wid.empty());
+
+       for (int j=0; j < to_move.size(); j++) {
+           to_move[j]->translate(Offset(-column_wid.right, 0));
+       }
+    }
+}    
+/*
+  UGGGG
+  */
+void
+Complex_column::typeset_item_directional(Item *i, int dir, int breakst) // UGH!
+{
+    assert(i);
+    PCol * c=score_column_l_->pcol_l_;
+    if (breakst == 0)
+       c = c->prebreak_p_;
+    else if (breakst == 2)
+       c = c->postbreak_p_;
+    
+    Array<Item*> to_move(staff_l_->pscore_l_->select_items(staff_l_->theline_l_,
+                                                     c));    
+    typeset_item(i, breakst);
+
+    Interval column_wid = citemlist_width(to_move);
+    if (column_wid.empty())
+       column_wid = Interval(0,0);
+    i->translate(Offset(column_wid[dir] - i->width()[-dir], 0));
+}
+
+void
+Complex_staff::set_output(PScore* ps )
+{
+    pscore_l_ = ps;
+    pscore_l_->add(theline_l_);
+}
+
+
diff --git a/src/complexstaff.cc b/src/complexstaff.cc
new file mode 100644 (file)
index 0000000..ffa667e
--- /dev/null
@@ -0,0 +1,58 @@
+#include "request.hh"
+#include "voice.hh"
+#include "staffwalker.hh"
+#include "debug.hh"
+#include "clef.hh"
+#include "staff.hh"
+#include "command.hh"
+#include "complexstaff.hh"
+#include "sccol.hh" 
+#include "complexwalker.hh"
+
+
+
+Complex_column::Complex_column(Score_column*s, Complex_staff *rs)
+    : Staff_column(s)
+{
+    staff_l_ = rs;
+}
+
+Complex_staff::Complex_staff()
+{
+    theline_l_ = 0;
+}
+
+void
+Complex_column::setup_requests()
+{
+    for (int i = 0 ; i < v_elts.size(); i ++)
+       for (iter_top(v_elts[i]->reqs,j); j.ok(); j++) {            
+
+           if (j->barcheck()) {
+               if (tdescription_->whole_in_measure) {
+                   error("Barcheck failed, " + tdescription_->str());
+               }
+               continue;
+           }
+           if (j->mark())
+               continue;
+           if (j->command())
+               continue;
+           todo_l_arr_.push(j);
+       }
+}
+
+Staff_column*
+Complex_staff::create_col(Score_column*s)
+{
+    return new Complex_column(s,this);
+}
+
+void
+Complex_staff::walk()
+{
+    for (Complex_walker sc(this); sc.ok(); sc++) {
+       sc.col()->setup_requests();// TODO
+       sc.process();
+    }
+}
diff --git a/src/complexwalker.cc b/src/complexwalker.cc
new file mode 100644 (file)
index 0000000..5cc1b5b
--- /dev/null
@@ -0,0 +1,241 @@
+#include "associter.hh"
+#include "script.hh"
+#include "request.hh"
+#include "voice.hh"
+#include "clef.hh"
+#include "pscore.hh"
+#include "complexstaff.hh"
+#include "complexwalker.hh"
+#include "sccol.hh"
+#include "debug.hh"
+#include "keyitem.hh"
+#include "clefitem.hh"
+#include "voicegroup.hh"
+#include "register.hh"
+
+Rhythmic_grouping
+cparse_grouping(Array<Scalar> a, Moment one_beat)
+{
+    Array<int> r;
+    for (int i= 0 ; i < a.size(); i++)
+       r.push(a[i]);
+    Moment here =0.0;
+
+    Array<Rhythmic_grouping*> children;
+    for (int i=0; i < r.size(); i++) {
+       
+       Moment last = here;
+       here += one_beat * r[i];
+       children.push(
+           new Rhythmic_grouping(MInterval(last, here), r[i] )
+           );
+    }
+    return Rhythmic_grouping(children);
+}
+
+void
+Complex_walker::do_INTERPRET_command(Command*com)
+{
+    Array<Scalar> args(com->args);
+    args.del(0);
+    if (com->args[0] == "GROUPING") {  
+       default_grouping = cparse_grouping(args,
+                                         col()->tdescription_->one_beat);
+    }else if (com->args[0] == "NEWMEASURE") {
+       local_key_.reset(key_);
+
+    } else if (com->args[0] == "KEY") {
+       
+       if (col()->when() > Moment(0)) {
+           assert(!oldkey_undo);
+           oldkey_undo = new Array<int>( key_.oldkey_undo(args));
+       }
+       
+       typesetkey = key_.read(args);
+       local_key_.reset(key_); 
+    } else if (com->args[0] == "CLEF") {
+       clef_.read(args);
+    } else {
+       WARN << " ignoring INTERPRET command: " << com->args[0]<< "\n";
+    }
+}
+
+void
+Complex_walker::do_TYPESET_command(Command*com)
+{
+    /* ignore these commands if non-default versions have been
+      processed.  */
+    if (com->args[0] == "CURRENTKEY") 
+       if (processed_key) 
+           return;
+       else
+           com->args[0] = "KEY"; // urgh
+    
+    if (com->args[0] == "CURRENTCLEF") {
+       if (processed_clef) 
+           return;
+    }
+    if (com->args[0] == "BAR") {
+       
+       if (processed_bar_priority > com->priority)
+           return;
+       else
+           processed_bar_priority = com->priority;
+    }
+
+    Item* i = staff()->get_TYPESET_item(com);
+    if (!i)
+       return;
+
+    if (com->args[0] == "KEY") {
+       ((Keyitem*) i)->read(clef_);
+       if (oldkey_undo) {
+           ((Keyitem*) i)->read(*oldkey_undo);
+           delete oldkey_undo;
+           oldkey_undo = 0;
+       }
+       processed_key = true;
+       
+       ((Keyitem*) i)->read(typesetkey); // ugh        
+    }
+
+    if (com->args[0] == "CLEF"||com->args[0] == "CURRENTCLEF") {
+       processed_clef =true;
+       Clef_item*c=(Clef_item*)i;
+       c->read(clef_);
+       c->change = (break_status != BREAK_POST - BREAK_PRE);
+    }
+    col()->typeset_item_directional(i, 1, break_status);
+}
+
+void
+Complex_walker::announce_element(Staff_elem_info info)
+{
+    announce_info_arr_.push(info);
+}
+
+void
+Complex_walker::do_announces()
+{
+
+    for (int i = 0; i < announce_info_arr_.size(); i++){
+       Staff_elem_info info = announce_info_arr_[i];
+       for (iter_top(voice_reg_list_,j); j.ok(); j++) {
+           j->announce_element(info);
+       }
+       group_regs_.announce_element(info);
+       local_key_reg_.acknowledge_element(info);
+    }
+}
+
+Voice_registers *
+Complex_walker::find_voice_reg(Voice*v_l)
+{
+    for (iter_top(voice_reg_list_, i); i.ok(); i++) {
+       if (i->voice_l_ == v_l)
+           return i;
+    }
+    
+    Voice_registers *regs_p=new Voice_registers(this,v_l);
+    voice_reg_list_.bottom().add (regs_p);
+    //voice_reg_map_[v_l] = regs_p;
+    return regs_p;
+}
+
+void
+Complex_walker::try_request(Request*req)
+{
+    bool b;
+    if (req->note() || req->rest()|| req->slur()) {
+       Voice *v_l = req->elt_l_->voice_l_;
+       Voice_registers *vregs_l = find_voice_reg(v_l);
+       
+       b = vregs_l->try_request(req);
+           
+    } else {
+       b = group_regs_.try_request(req);
+       if (!b)
+           b = local_key_reg_.try_request(req);
+    }
+    if (!b)
+       WARN<< "junking request: " <<req->name() <<"\n";
+}
+
+void
+Complex_walker::process_requests()
+{
+    Complex_column*c = col();
+//    Complex_staff *s = staff();
+
+    for (int i=0; i < c->todo_l_arr_.size(); i++) {
+       try_request(c->todo_l_arr_[i]);
+    }
+
+    regs_process_requests();
+    do_announces();
+}
+
+void
+Complex_walker::regs_process_requests()
+{
+    for (iter_top(voice_reg_list_,j); j.ok(); j++) {
+       j->process_requests();
+    }
+    group_regs_.process_requests();
+    local_key_reg_.process_request();
+}
+
+void
+Complex_walker::typeset_element(Staff_elem *elem_p)
+{
+    if (elem_p->spanner())
+       pscore_l_->typeset_spanner(elem_p->spanner(), staff()->theline_l_);
+    else
+       col()->typeset_item(elem_p->item()); 
+}
+
+Complex_walker::Complex_walker(Complex_staff*s)
+    : Staff_walker(s, s->theline_l_->pscore_l_),
+      group_regs_(this),
+      local_key_reg_(this)      
+{
+    oldkey_undo = 0;
+    do_post_move();
+}
+
+Complex_staff*
+Complex_walker::staff()
+{
+    return (Complex_staff*) staff_l_;
+}
+
+Complex_column*
+Complex_walker::col()
+{
+    return (Complex_column*) *(*this);
+}
+
+void
+Complex_walker::do_pre_move()
+{
+    for (iter_top(voice_reg_list_,i); i.ok(); i++) {
+       i->pre_move_processing();   
+    }
+    group_regs_.pre_move_processing();
+    local_key_reg_.pre_move_processing();
+}
+
+void
+Complex_walker::do_post_move()
+{
+    processed_clef =false;    
+    processed_key = false;
+    processed_bar_priority = 0;
+    
+    for (iter_top(voice_reg_list_,i); i.ok(); i++) {
+       i->post_move_processing();   
+    }
+    announce_info_arr_.set_size(0);
+    group_regs_.post_move_processing();
+    local_key_reg_.post_move_processing();
+}
index a11e2c0fe32b42be73231a44f93b0b4f9f83ffcc..61a3f59f6297fad552063d63be25cb65fef5d026 100644 (file)
@@ -21,9 +21,9 @@ get_meter_command(int n, int m)
     Command*c = new Command;
     
     c->code = TYPESET;
     Command*c = new Command;
     
     c->code = TYPESET;
-    c->args.add( "METER");
-    c->args.add( n );
-    c->args.add( m );
+    c->args.push( "METER");
+    c->args.push( n );
+    c->args.push( m );
     c->priority = 40;
     return c;
 }
     c->priority = 40;
     return c;
 }
@@ -33,8 +33,8 @@ get_defaultbar_command()
 {
     Command c;
     c.code = TYPESET;
 {
     Command c;
     c.code = TYPESET;
-    c.args.add("BAR");
-    c.args.add("default");
+    c.args.push("BAR");
+    c.args.push("default");
     return c;
 }
 
     return c;
 }
 
@@ -45,21 +45,21 @@ split_bar_command(Command &pre_com, Command &no_break_com, Command &post_com,
     Command c;
     c.code = TYPESET;
     c.priority = (s=="default") ? 100: 110;
     Command c;
     c.code = TYPESET;
     c.priority = (s=="default") ? 100: 110;
-    c.args.add("BAR");
+    c.args.push("BAR");
     if(s=="default")
        s = "|";
     
     if (s == ":|:") {
        no_break_com=post_com=pre_com = c;
        
     if(s=="default")
        s = "|";
     
     if (s == ":|:") {
        no_break_com=post_com=pre_com = c;
        
-       pre_com.args.add( ":|");
-       no_break_com.args.add( s);
-       post_com.args.add( "|:");
+       pre_com.args.push( ":|");
+       no_break_com.args.push( s);
+       post_com.args.push( "|:");
     }else if (s=="|:") {
     }else if (s=="|:") {
-       c.args.add(s);
+       c.args.push(s);
        no_break_com=post_com=c;
     } else {
        no_break_com=post_com=c;
     } else {
-       c.args.add(s);
+       c.args.push(s);
        pre_com= no_break_com= c;       
     } 
 }
        pre_com= no_break_com= c;       
     } 
 }
index 4f02b75378edd735a06133f298c8dd08003a86e7..06f906ff9144a064168e1bf2762a6d340b50aa11 100644 (file)
@@ -67,10 +67,10 @@ Rhythmic_grouping::intervals()
        MInterval i(interval());
        MInterval r1(i), r2(i);
        r1.right = r2.left = i.center();
        MInterval i(interval());
        MInterval r1(i), r2(i);
        r1.right = r2.left = i.center();
-       r.add(r1); r.add(r2);
+       r.push(r1); r.push(r2);
     } else {
        for (int i=0; i < children.size(); i++)
     } else {
        for (int i=0; i < children.size(); i++)
-           r.add(children[i]->interval());
+           r.push(children[i]->interval());
     }
     return r;
 }
     }
     return r;
 }
@@ -124,12 +124,12 @@ Rhythmic_grouping::split(Array<MInterval> splitpoints)
        } else {
 
            if (i == starti) {
        } else {
 
            if (i == starti) {
-               ch.add(children[i]);
+               ch.push(children[i]);
            } else {
                Rhythmic_grouping *newchild=new Rhythmic_grouping(
                    children.subvec(starti, i+1));
 
            } else {
                Rhythmic_grouping *newchild=new Rhythmic_grouping(
                    children.subvec(starti, i+1));
 
-               ch.add(newchild);
+               ch.push(newchild);
            }
            i ++;
            j++;
            }
            i ++;
            j++;
@@ -154,7 +154,7 @@ Rhythmic_grouping::Rhythmic_grouping(MInterval t, int n)
     Moment dt = t.length()/n;
     MInterval basic = MInterval(t.left, t.left+dt);
     for (int i= 0; i < n; i++)
     Moment dt = t.length()/n;
     MInterval basic = MInterval(t.left, t.left+dt);
     for (int i= 0; i < n; i++)
-       children.add(new Rhythmic_grouping( dt*i + basic ));
+       children.push(new Rhythmic_grouping( dt*i + basic ));
 }
 
 
 }
 
 
@@ -174,7 +174,7 @@ Rhythmic_grouping::copy(Rhythmic_grouping const&s)
 {
     interval_ =  (s.interval_)? new MInterval(*s.interval_) : 0;
     for (int i=0; i < s.children.size(); i++)
 {
     interval_ =  (s.interval_)? new MInterval(*s.interval_) : 0;
     for (int i=0; i < s.children.size(); i++)
-       children.add(new Rhythmic_grouping(*s.children[i]));
+       children.push(new Rhythmic_grouping(*s.children[i]));
 }
 
 void
 }
 
 void
@@ -213,21 +213,22 @@ Rhythmic_grouping::print()const
 #endif
 }
 
 #endif
 }
 
+bool
+Rhythmic_grouping::child_fit_query(Moment start)
+{
+    if (children.size())
+       return ( children.last()->interval().right== start);
+
+    return true;
+}  
+
 void
 Rhythmic_grouping::add_child(Moment start, Moment len)
 {
     Moment stop = start+len;
 void
 Rhythmic_grouping::add_child(Moment start, Moment len)
 {
     Moment stop = start+len;
-    for (int i=0; i < children.size(); i ++) {
-       MInterval j=children[i]->interval();
-       if (j.left == start && j.right==stop) {
-           return;
-       }
-    }
-    
-    if (children.size())
-       assert ( children.last()->interval().right== start);
 
 
-    children.add(new Rhythmic_grouping(MInterval(start, stop)));
+    assert(child_fit_query(start));
+    children.push(new Rhythmic_grouping(MInterval(start, stop)));
 }
 
 Rhythmic_grouping::Rhythmic_grouping()
 }
 
 Rhythmic_grouping::Rhythmic_grouping()
@@ -255,12 +256,12 @@ Rhythmic_grouping::generate_beams(Array<int> flags, int &flagidx)
        Array<int> child_beams;
        if (children[i]->interval_) {
            int f = flags[flagidx++];
        Array<int> child_beams;
        if (children[i]->interval_) {
            int f = flags[flagidx++];
-           child_beams.add(f);
+           child_beams.push(f);
        } else {
            child_beams = children[i]->
                generate_beams(flags, flagidx);
        }
        } else {
            child_beams = children[i]->
                generate_beams(flags, flagidx);
        }
-       children_beams.add(child_beams);
+       children_beams.push(child_beams);
     }
     Array<int> beams;
     int lastm, m, nextm;
     }
     Array<int> beams;
     int lastm, m, nextm;
@@ -275,15 +276,15 @@ Rhythmic_grouping::generate_beams(Array<int> flags, int &flagidx)
        
        if (children_beams[i].size() == 1) {
            if (add_right)
        
        if (children_beams[i].size() == 1) {
            if (add_right)
-               beams.add(m);
+               beams.push(m);
            if (add_left)
            if (add_left)
-               beams.add(m);
+               beams.push(m);
        } else {
            if (add_left) 
        } else {
            if (add_left) 
-               beams.add(lastm <? m);
+               beams.push(lastm <? m);
            beams.concat(children_beams[i]);
            if (add_right)
            beams.concat(children_beams[i]);
            if (add_right)
-               beams.add(m <? nextm);
+               beams.push(m <? nextm);
        }
        lastm = m;
        m = nextm;      
        }
        lastm = m;
        m = nextm;      
diff --git a/src/groupregs.cc b/src/groupregs.cc
new file mode 100644 (file)
index 0000000..6498762
--- /dev/null
@@ -0,0 +1,131 @@
+#include "request.hh"
+#include "beam.hh"
+#include "stem.hh"
+#include "register.hh"
+#include "grouping.hh"
+#include "complexwalker.hh"
+#include "debug.hh"
+#include "complexstaff.hh"
+#include "textspanner.hh"
+
+Stem_beam_register::Stem_beam_register(Complex_walker*w)
+    :Request_register(w)
+{
+    do_post_move_process();
+    current_grouping = 0;
+    beam_p_ = 0;
+}
+
+bool
+Stem_beam_register::try_request(Request*req_l)
+{
+    if ( req_l->beam() ) {
+       if (bool(beam_p_ ) == bool(req_l->beam()->spantype == Span_req::START))
+           return false;
+       
+       if (beam_req_l_ && Beam_req::compare(*beam_req_l_ , *req_l->beam()))
+           return false;
+       
+       beam_req_l_ = req_l->beam();
+       return true;
+    }
+    
+    if ( req_l->stem() ) {
+       if (current_grouping && !current_grouping->child_fit_query(
+           walk_l_->col()->tdescription_->whole_in_measure))
+           return false;
+
+       if (stem_req_l_ && Stem_req::compare(*stem_req_l_, *req_l->stem()))
+           return false;
+
+       stem_req_l_ = req_l->stem();
+       return true;
+    }
+    return false;
+}
+
+void
+Stem_beam_register::process_request()
+{
+    if (beam_req_l_) {
+       if (beam_req_l_->spantype == Span_req::STOP)
+           end_beam_b_ = true;
+       else {
+           beam_p_ = new Beam;
+//         walk_l_->announce_element(Staff_elem_info(beam_p_, ))
+           current_grouping = new Rhythmic_grouping;
+           if (beam_req_l_->nplet) {
+               Text_spanner* t = new Text_spanner();
+               t->set_support(beam_p_);
+               t->spec.align_i_ = 0;
+               t->spec.text_str_ = beam_req_l_->nplet;
+               walk_l_->typeset_element(t);
+           }
+            
+       }
+    }
+
+    if (stem_req_l_) {
+       stem_p_ = new Stem(4);
+       if (current_grouping)
+           current_grouping->add_child(
+               walk_l_->col()->tdescription_->whole_in_measure,
+               stem_req_l_->duration());
+
+       stem_p_->flag = stem_req_l_->balltype;
+
+       if (beam_p_) {
+           beam_p_->add(stem_p_);
+           stem_p_->print_flag = false;
+       } else {
+           stem_p_->print_flag = true;
+       }
+       
+       walk_l_->announce_element(Staff_elem_info(stem_p_,
+                                                 stem_req_l_,  this));
+    }
+}
+
+void
+Stem_beam_register::acknowledge_element(Staff_elem_info info)
+{
+    if (!stem_p_)
+       return;
+
+    if (info.elem_p_->name() == String("Notehead") &&
+       stem_req_l_->duration() == info.req_l_->rhythmic()->duration())
+       
+       stem_p_->add((Notehead*)info.elem_p_);
+}
+
+void
+Stem_beam_register::do_pre_move_process()
+{
+    if (stem_p_) {
+       walk_l_->typeset_element(stem_p_);
+       stem_p_ = 0;
+    }
+    if (beam_p_ && end_beam_b_) {
+       walk_l_->default_grouping.extend(current_grouping->interval());
+       beam_p_->set_grouping(walk_l_->default_grouping, *current_grouping);
+       walk_l_->typeset_element(beam_p_);
+       delete current_grouping;
+       current_grouping = 0;
+       beam_p_ = 0;
+    }
+    end_beam_b_ = false;
+}
+void
+Stem_beam_register::do_post_move_process()
+{
+    stem_p_ = 0;
+    beam_req_l_ = 0;
+    stem_req_l_ = 0;
+    end_beam_b_ = false;
+}
+
+Stem_beam_register::~Stem_beam_register()
+{
+    if (beam_p_)
+       error("unterminated beam");
+}
index 02e7e7281308b15d25ddecbcd31effcf3c9946d1..251adedc8586840569705802f516fb54124a7ff1 100644 (file)
@@ -39,8 +39,8 @@ Input_command*
 get_partial_command(Moment u)
 {
     Input_command*c = new Input_command;
 get_partial_command(Moment u)
 {
     Input_command*c = new Input_command;
-    c->args.add("PARTIAL");
-    c->args.add(u);
+    c->args.push("PARTIAL");
+    c->args.push(u);
     return c;
 }
 
     return c;
 }
 
@@ -48,8 +48,8 @@ Input_command*
 get_goto_command(String s)
 {
     Input_command*c = new Input_command;
 get_goto_command(String s)
 {
     Input_command*c = new Input_command;
-    c->args.add("GOTO");
-    c->args.add(s);
+    c->args.push("GOTO");
+    c->args.push(s);
     return c;
 }
 
     return c;
 }
 
@@ -58,17 +58,17 @@ get_cadenza_toggle(int i)
 {
     
     Input_command*c = new Input_command;
 {
     
     Input_command*c = new Input_command;
-    c->args.add("CADENZA");
-    c->args.add(i);
+    c->args.push("CADENZA");
+    c->args.push(i);
     return c;
 }
 Input_command*
 get_grouping_command(Array<int>a ) 
 {
     Input_command*c = new Input_command;
     return c;
 }
 Input_command*
 get_grouping_command(Array<int>a ) 
 {
     Input_command*c = new Input_command;
-    c->args.add("GROUPING");    
+    c->args.push("GROUPING");    
     for (int i=0; i < a.size(); i ++)
     for (int i=0; i < a.size(); i ++)
-       c->args.add(a[i]);
+       c->args.push(a[i]);
 
     return c;
 }
 
     return c;
 }
@@ -77,9 +77,9 @@ Input_command*
 get_key_interpret_command(Array<int >a ) 
 {
     Input_command*c = new Input_command;
 get_key_interpret_command(Array<int >a ) 
 {
     Input_command*c = new Input_command;
-    c->args.add("KEY");
+    c->args.push("KEY");
     for (int i=0; i < a.size(); i ++) {
     for (int i=0; i < a.size(); i ++) {
-       c->args.add(a[i]);
+       c->args.push(a[i]);
     }
     return c;
 }
     }
     return c;
 }
@@ -88,7 +88,7 @@ Input_command*
 get_reset_command()
 {
     Input_command*c = new Input_command;
 get_reset_command()
 {
     Input_command*c = new Input_command;
-    c->args.add("RESET");
+    c->args.push("RESET");
     return c;
 }
 
     return c;
 }
 
@@ -97,9 +97,9 @@ get_meterchange_command(int n, int m)
 {
     Input_command*c = new Input_command;
 
 {
     Input_command*c = new Input_command;
 
-    c->args.add( "METER");
-    c->args.add( n );
-    c->args.add( m );
+    c->args.push( "METER");
+    c->args.push( n );
+    c->args.push( m );
 
     return c;
 }
 
     return c;
 }
@@ -108,7 +108,7 @@ Input_command *
 get_newmeasure_command()
 {
     Input_command*c = new Input_command;
 get_newmeasure_command()
 {
     Input_command*c = new Input_command;
-    c->args.add( "NEWMEASURE");
+    c->args.push( "NEWMEASURE");
     return c;
 }
 
     return c;
 }
 
@@ -117,9 +117,9 @@ get_skip_command(int n, Moment m)
 {
     Input_command*c = new Input_command;
     
 {
     Input_command*c = new Input_command;
     
-    c->args.add( "SKIP");
-    c->args.add( n );
-    c->args.add( m );
+    c->args.push( "SKIP");
+    c->args.push( n );
+    c->args.push( m );
 
     return c;
 }
 
     return c;
 }
@@ -143,8 +143,8 @@ Input_command*
 get_clef_interpret_command(String w)
 {
     Input_command*c = new Input_command;
 get_clef_interpret_command(String w)
 {
     Input_command*c = new Input_command;
-    c->args.add("CLEF");
-    c->args.add(w);
+    c->args.push("CLEF");
+    c->args.push(w);
     return c;
 }
 
     return c;
 }
 
@@ -152,8 +152,8 @@ Input_command*
 get_bar_command(String w)
 {
     Input_command*c = new Input_command;
 get_bar_command(String w)
 {
     Input_command*c = new Input_command;
-    c->args.add("BAR");
-    c->args.add(w);
+    c->args.push("BAR");
+    c->args.push(w);
     return c;
 }
 
     return c;
 }
 
@@ -163,12 +163,12 @@ get_default_grouping(int count)
     Array<int> s;
     if (!(count % 3 )) {
        for (int i=0; i < count/3; i++)
     Array<int> s;
     if (!(count % 3 )) {
        for (int i=0; i < count/3; i++)
-           s.add(3);
+           s.push(3);
     } else if (!(count %2)) {
        for (int i=0; i < count/2; i++)
     } else if (!(count %2)) {
        for (int i=0; i < count/2; i++)
-           s.add(2);
+           s.push(2);
     }else {
     }else {
-       s.add(2);
+       s.push(2);
        s.concat(get_default_grouping(count-2));
     }
     return s;
        s.concat(get_default_grouping(count-2));
     }
     return s;
index 28e1f71599ad8d8be71f50640ca1566e3c6cd517..6ea13d9b5d78a91ee323fe7913ec6ab1ea77c101 100644 (file)
@@ -40,7 +40,7 @@ Input_score::parse()
     Array<Staff*> parsed_staffs;
     for (iter_top(staffs_,i); i.ok(); i++) {
        Staff* staf_p=i->parse(s_p);
     Array<Staff*> parsed_staffs;
     for (iter_top(staffs_,i); i.ok(); i++) {
        Staff* staf_p=i->parse(s_p);
-       parsed_staffs.add(staf_p);
+       parsed_staffs.push(staf_p);
        s_p->add(staf_p);
     }
     int j = 0;
        s_p->add(staf_p);
     }
     int j = 0;
index 70d91c669f8ce9d4d5f01f899b1cf6a23c6aff6f..3c3909468ddfca3faf79f27fd301087874acdc97 100644 (file)
@@ -8,6 +8,7 @@
 #include "melodicstaff.hh"
 #include "rhythmstaff.hh"
 #include "lyricstaff.hh"
 #include "melodicstaff.hh"
 #include "rhythmstaff.hh"
 #include "lyricstaff.hh"
+#include "complexmelodicstaff.hh"
 #include "staff.hh"
 
 void
 #include "staff.hh"
 
 void
@@ -34,13 +35,18 @@ Staff*
 Input_staff::parse(Score*score_l)
 {
     Staff *p=0;
 Input_staff::parse(Score*score_l)
 {
     Staff *p=0;
-    
-    if (type == "melodic")
+
+    if (type == "complex")
+       p = new Complex_melodic_staff;
+    else if (type == "melodic")
        p = new Melodic_staff;
     else if (type == "rhythmic")
        p = new Rhythmic_staff;
     else if (type == "lyric")
        p = new Lyric_staff;
        p = new Melodic_staff;
     else if (type == "rhythmic")
        p = new Rhythmic_staff;
     else if (type == "lyric")
        p = new Lyric_staff;
+    else
+       error("Unknown staff-type `" + type +"\'");
+    
     p->score_l_ = score_l;
     p->define_spot_str_ = define_spot_str_;
     
     p->score_l_ = score_l;
     p->define_spot_str_ = define_spot_str_;
     
index 11096c95c006e305042076c207ed8999517b95b7..3ea6c0445ec85d5017bbb6d1f697dfb28a041ee1 100644 (file)
@@ -1,18 +1,18 @@
 #include "debug.hh"
 #include "item.hh"
 
 #include "debug.hh"
 #include "item.hh"
 
+NAME_METHOD(Item);
+
 Item::Item()
 {
     pcol_l_ = 0;
 }
 
 void
 Item::Item()
 {
     pcol_l_ = 0;
 }
 
 void
-Item::print() const
+Item::do_print() const
 {
 #ifndef NPRINT
 {
 #ifndef NPRINT
-    mtor << "item " ;
-    Staff_elem::print();
+    mtor << "(unknown)";
 #endif
 #endif
-
 }
 
 }
 
index cd7f400737c4a56464ed4d599ca1c016e3e23cbe..232ce9a94fb19afead5e75d4fe25609fe82b8610 100644 (file)
@@ -48,8 +48,8 @@ Key::read(Array<Scalar> s)
        int small = s[i++];
        accidentals[large]=small;
 
        int small = s[i++];
        accidentals[large]=small;
 
-       newkey.add(large);
-       newkey.add(small);
+       newkey.push(large);
+       newkey.push(small);
     }
     return newkey;
 }
     }
     return newkey;
 }
@@ -70,8 +70,8 @@ Key::oldkey_undo(Array<Scalar>s)
     }
     for (int i=0; i < newkey.size(); i++)
        if (accidentals[i] && accidentals[i] != newkey[i]) {
     }
     for (int i=0; i < newkey.size(); i++)
        if (accidentals[i] && accidentals[i] != newkey[i]) {
-           oldkey.add(i);
-           oldkey.add(0);
+           oldkey.push(i);
+           oldkey.push(0);
        }
     
 
        }
     
 
index 9ae9c22289b4f333321375cd0d6ece8c17f78bca..017570d749fa01be41e17a91920cd6f20a352507 100644 (file)
@@ -8,7 +8,7 @@
 
 const int FLAT_TOP_PITCH=2; /* fes,ges,as and bes typeset in lower octave */
 const int SHARP_TOP_PITCH=4; /*  ais and bis typeset in lower octave */
 
 const int FLAT_TOP_PITCH=2; /* fes,ges,as and bes typeset in lower octave */
 const int SHARP_TOP_PITCH=4; /*  ais and bis typeset in lower octave */
-
+NAME_METHOD(Keyitem);
 Keyitem::Keyitem(int c)
 {
     c_position = c;
 Keyitem::Keyitem(int c)
 {
     c_position = c;
@@ -39,8 +39,8 @@ Keyitem::add(int p, int a)
         (a>0 && p>SHARP_TOP_PITCH)) {
       p=p-7; /* Typeset below c_position */
     }
         (a>0 && p>SHARP_TOP_PITCH)) {
       p=p-7; /* Typeset below c_position */
     }
-    pitch.add(p);
-    acc.add(a);
+    pitch.push(p);
+    acc.push(a);
 }
 
 
 }
 
 
index dbe775560144c3e9df01111311d7dfc2132ab5ff..4446661d8ef426de46d9b525b50f34c33050038a 100644 (file)
@@ -17,6 +17,8 @@
 %option yylineno
 %option debug
 %option yyclass="My_flex_lexer"
 %option yylineno
 %option debug
 %option yyclass="My_flex_lexer"
+%option stack
+
 %x notes
 %x incl
 %x quote
 %x notes
 %x incl
 %x quote
@@ -30,7 +32,8 @@ N             [0-9]
 AN             {AA}|{N}
 PUNCT          [?!,.:;]
 ACCENT         [\\'"^]
 AN             {AA}|{N}
 PUNCT          [?!,.:;]
 ACCENT         [\\'"^]
-TEX            {AA}|-|{PUNCT}|{ACCENT}
+NATIONAL       [\241-\377]
+TEX            {AA}|-|{PUNCT}|{ACCENT}|{NATIONAL}
 
 WORD           {A}{AN}*
 ALPHAWORD      {A}+
 
 WORD           {A}{AN}*
 ALPHAWORD      {A}+
@@ -49,11 +52,11 @@ COMMENT             [%#].*\n
 %%
 
 \$             {
 %%
 
 \$             {
-       BEGIN(notes); 
+       yy_push_state(notes); 
 }
 
 \@             {
 }
 
 \@             {
-       BEGIN(lyrics); 
+       yy_push_state(lyrics); 
 }
 
 <notes>{RESTNAME}      {
 }
 
 <notes>{RESTNAME}      {
@@ -86,9 +89,8 @@ COMMENT               [%#].*\n
                return IDENTIFIER;
        }
        String *sp = new String( c);
                return IDENTIFIER;
        }
        String *sp = new String( c);
-
        yylval.string=sp;
        yylval.string=sp;
-       return NEWIDENTIFIER;
+       return STRING;
 }
 
 <notes>{PITCHMOD}      {
 }
 
 <notes>{PITCHMOD}      {
@@ -111,13 +113,9 @@ COMMENT            [%#].*\n
 
 }
 <notes>\$      {
 
 }
 <notes>\$      {
-       BEGIN(INITIAL); 
+       yy_pop_state();
 }
 }
-<notes>[{}]    {
-       return YYText()[0];
-       
-}
-<notes>\"[^\"]*\" {
+<notes>\"[^"]*\" {
        String s (YYText()+1);
        s = s.left(s.len()-1);
        yylval.string = new String(s);
        String s (YYText()+1);
        s = s.left(s.len()-1);
        yylval.string = new String(s);
@@ -128,14 +126,14 @@ COMMENT           [%#].*\n
 }
 
 \"             {
 }
 
 \"             {
-       BEGIN(quote);
+       yy_push_state(quote);
 }
 }
-<quote>[^\"]*  {
+<quote>[^"]*   {
        yylval.string = new String (YYText());
 }
 <quote>\"      {
        mtor << "quoted string\n";
        yylval.string = new String (YYText());
 }
 <quote>\"      {
        mtor << "quoted string\n";
-       BEGIN(INITIAL);
+       yy_pop_state();
        return STRING;
 }
 
        return STRING;
 }
 
@@ -155,7 +153,7 @@ COMMENT             [%#].*\n
                return l;
 
 /* let's try passing tex's typesetting macros like \ss \alpha \c */
                return l;
 
 /* let's try passing tex's typesetting macros like \ss \alpha \c */
-       String* str_p = new String(YYText());
+       String* str_p = new String(YYText());//huh?
        return STRING;  
 
 /* and skip identifiers...
        return STRING;  
 
 /* and skip identifiers...
@@ -167,10 +165,10 @@ COMMENT           [%#].*\n
        String *sp = new String( c);
 
        yylval.string=sp;
        String *sp = new String( c);
 
        yylval.string=sp;
-       return NEWIDENTIFIER;
+       return STRING;
 */
 }
 */
 }
-<lyrics>\"[^\"]*\" {
+<lyrics>\"[^"]*\" {
        String s (YYText()+1);
        s = s.left(s.len()-1);
        yylval.string = new String(s);
        String s (YYText()+1);
        s = s.left(s.len()-1);
        yylval.string = new String(s);
@@ -204,7 +202,7 @@ COMMENT             [%#].*\n
 <lyrics>[ \t\n]+               {
 }
 <lyrics>@      {
 <lyrics>[ \t\n]+               {
 }
 <lyrics>@      {
-       BEGIN(INITIAL); 
+       yy_pop_state();
 }
 
 <<EOF>> {
 }
 
 <<EOF>> {
@@ -215,13 +213,15 @@ COMMENT           [%#].*\n
 }
 
 
 }
 
 
-include           { BEGIN(incl); }
+include           {
+       yy_push_state(incl);
+}
 <incl>[ \t]*      { /* eat the whitespace */ }
 <incl>\"[^"]*\"+   { /* got the include file name */
    String s (YYText()+1);
        s = s.left(s.len()-1);
    new_input(s);
 <incl>[ \t]*      { /* eat the whitespace */ }
 <incl>\"[^"]*\"+   { /* got the include file name */
    String s (YYText()+1);
        s = s.left(s.len()-1);
    new_input(s);
-   BEGIN(INITIAL);
+   yy_pop_state();
 }
 
 
 }
 
 
@@ -239,7 +239,7 @@ include           { BEGIN(incl); }
        String *sp = new String( c);
        mtor << "new id: " << *sp << eol;
        yylval.string=sp;
        String *sp = new String( c);
        mtor << "new id: " << *sp << eol;
        yylval.string=sp;
-       return NEWIDENTIFIER;
+       return STRING;
 }
 
 {REAL}         {
 }
 
 {REAL}         {
index cd2dc79719a50d36e138947933fde267b83538a9..cc69a4a6bbf484f539593db84c41efbe3322f6b4 100644 (file)
@@ -22,22 +22,6 @@ busy_parsing()
     return lexer;      
 }
 
     return lexer;      
 }
 
-void
-kill_lexer()
-{
-       delete lexer;
-       lexer = 0;
-}
-
-void
-set_lexer()
-{
-    if (!lexer) {
-       lexer = new My_flex_lexer;
-       lexer->set_debug( !monitor.silence("Lexer") && check_debug);
-   }           
-}
-
 Input_file::Input_file(String s)
 {
     name = s;
 Input_file::Input_file(String s)
 {
     name = s;
index 8ce517a7a276f17b696f22cb5c89dcf65420c49a..b70e2a26f5683472f03878c6f12dda46d2d4cef2 100644 (file)
@@ -42,7 +42,7 @@ Spacing_problem::OK() const
     }
     for (int i = 0; i < cols.size(); i++)
        if (cols[i].fixed())
     }
     for (int i = 0; i < cols.size(); i++)
        if (cols[i].fixed())
-           fixed.add(i);
+           fixed.push(i);
     for (int i = 0; i < cols.size(); i++) {
        bool c=false;
        for (int j =0; j<fixed.size(); j++)
     for (int i = 0; i < cols.size(); i++) {
        bool c=false;
        for (int j =0; j<fixed.size(); j++)
@@ -186,7 +186,7 @@ Spacing_problem::solve() const
        
 
     Array<Real> posns(sol);
        
 
     Array<Real> posns(sol);
-    posns.add(lp.eval(sol));
+    posns.push(lp.eval(sol));
     return posns;
 }
 
     return posns;
 }
 
@@ -197,7 +197,7 @@ void
 Spacing_problem::add_column(const PCol *col, bool fixed, Real fixpos)
 {
     Colinfo c(col,(fixed)? &fixpos :  0);
 Spacing_problem::add_column(const PCol *col, bool fixed, Real fixpos)
 {
     Colinfo c(col,(fixed)? &fixpos :  0);
-    cols.add(c);
+    cols.push(c);
 }
 
 void
 }
 
 void
@@ -209,7 +209,7 @@ Spacing_problem::add_ideal(const Idealspacing *i)
     if (!contains(l) || !contains(r)) {
        return;
     }
     if (!contains(l) || !contains(r)) {
        return;
     }
-    ideals.add(i);
+    ideals.push(i);
 }
 
 void
 }
 
 void
index b210dbdac3ee2c5a0762fca35151c8f51fa516dc..383f875d42b8e3657427541253d1948c446334d6 100644 (file)
@@ -3,22 +3,33 @@
 #include "scalar.hh"
 #include "lookup.hh"
 #include "paper.hh"
 #include "scalar.hh"
 #include "lookup.hh"
 #include "paper.hh"
+#include "request.hh"
 #include "notehead.hh"
 #include "notehead.hh"
+
+NAME_METHOD(Local_key_item);
 Local_key_item::Local_key_item(int i)
 {
     c0_position  = i;
 }
 Local_key_item::Local_key_item(int i)
 {
     c0_position  = i;
 }
-
 void
 void
-Local_key_item::add (int o, int p , int a,Notehead*head_p)
+Local_key_item::add(Item*head_l)
+{
+    group.push(head_l);
+    dependencies.push(head_l);
+}
+void
+Local_key_item::add(Melodic_req*m_l)
+{
+    add(m_l->octave, m_l->notename, m_l->accidental);
+}
+void
+Local_key_item::add (int o, int p , int a)
 {
     Local_acc l;
     l.octave = o;
     l.name = p;
     l.acc = a;
 {
     Local_acc l;
     l.octave = o;
     l.name = p;
     l.acc = a;
-    accs.add(l);
-    group.add(head_p);
-    dependencies.add(head_p);
+    accs.push(l);
 }
 
 void
 }
 
 void
@@ -26,11 +37,11 @@ Local_key_item::do_pre_processing()
 {
     accs.sort(Local_acc::compare);
 }
 {
     accs.sort(Local_acc::compare);
 }
+
 Molecule*
 Local_key_item::brew_molecule_p()const
 {
 Molecule*
 Local_key_item::brew_molecule_p()const
 {
-
-    Molecule*    output = new Molecule;
+    Molecule* output = new Molecule;
     Molecule*octmol = 0;
     int lastoct = -100;
     for  (int i = 0; i <  accs.size(); i++) {
     Molecule*octmol = 0;
     int lastoct = -100;
     for  (int i = 0; i <  accs.size(); i++) {
@@ -58,6 +69,13 @@ Local_key_item::brew_molecule_p()const
        output->add(*octmol);
        delete octmol;
     }
        output->add(*octmol);
        delete octmol;
     }
+
+    Interval head_width;
+    for (int i = 0; i  < group.size(); i++) {
+       head_width.unite(group[i]->width());
+    }
+    output->translate(Offset(-output->extent().x.right + head_width.left ,0));
+    
     return output;
 }
 
     return output;
 }
 
index befa5427065022d9ffd23d54e30de8549578a33e..a9c5d187310aca130b5faea6174b8aa8e1cc39f5 100644 (file)
@@ -33,7 +33,7 @@ Lookup::text(String style, String text, int dir)
 {
     Array<String> a;
  
 {
     Array<String> a;
  
-    a.add(text);
+    a.push(text);
     Symbol tsym =  (*symtables_)("style")->lookup(style);
     a[0] = substitute_args(tsym.tex,a);
 
     Symbol tsym =  (*symtables_)("style")->lookup(style);
     a[0] = substitute_args(tsym.tex,a);
 
@@ -132,7 +132,7 @@ Lookup::streepjes(int i)
     Symbol ret = (*symtables_)("streepjes")->lookup(idx);
     
     Array<String> a;
     Symbol ret = (*symtables_)("streepjes")->lookup(idx);
     
     Array<String> a;
-    a.add(arg);
+    a.push(arg);
     ret.tex = substitute_args(ret.tex, a);
 
     return ret;
     ret.tex = substitute_args(ret.tex, a);
 
     return ret;
@@ -149,8 +149,8 @@ Lookup::linestaff(int lines, Real wid)
     s.dim.y = Interval(0,dy);
 
     Array<String> a;
     s.dim.y = Interval(0,dy);
 
     Array<String> a;
-    a.add(lines);
-    a.add(print_dimen(wid));
+    a.push(lines);
+    a.push(print_dimen(wid));
 
     s.tex = (*symtables_)("param")->lookup("linestaf").tex;
     s.tex = substitute_args(s.tex, a);
 
     s.tex = (*symtables_)("param")->lookup("linestaf").tex;
     s.tex = substitute_args(s.tex, a);
@@ -182,8 +182,8 @@ Lookup::stem(Real y1,Real y2)
     s.dim.y = Interval(y1,y2);
     
     Array<String> a;
     s.dim.y = Interval(y1,y2);
     
     Array<String> a;
-    a.add(print_dimen(y1));
-    a.add(print_dimen(y2));
+    a.push(print_dimen(y1));
+    a.push(print_dimen(y2));
        
     String src = (*symtables_)("param")->lookup("stem").tex;
     s.tex = substitute_args(src,a);
        
     String src = (*symtables_)("param")->lookup("stem").tex;
     s.tex = substitute_args(src,a);
index 6420c4b3d9554d8426ca67b7d9572875a8245e58..45f30836ed301c05f45b5fc59a03dbddd5f45cfd 100644 (file)
@@ -3,14 +3,12 @@
 #include "staffwalker.hh"
 #include "debug.hh"
 #include "staff.hh"
 #include "staffwalker.hh"
 #include "debug.hh"
 #include "staff.hh"
-#include "command.hh"
-//#include "simplestaff.hh"
+//#include "command.hh"
 #include "lyricstaff.hh"
 #include "lyriccolumn.hh"
 #include "sccol.hh" 
 #include "lyricstaff.hh"
 #include "lyriccolumn.hh"
 #include "sccol.hh" 
-//#include "simplewalker.hh"
 #include "pscore.hh"
 #include "pscore.hh"
-#include "paper.hh"
+//#include "paper.hh"
 
 
 Lyric_column::Lyric_column(Score_column*s, Lyric_staff* lstaff_l)
 
 
 Lyric_column::Lyric_column(Score_column*s, Lyric_staff* lstaff_l)
@@ -20,7 +18,7 @@ Lyric_column::Lyric_column(Score_column*s, Lyric_staff* lstaff_l)
 }
 
 void
 }
 
 void
-Lyric_column::process_requests()
+Lyric_column::setup_requests()
 {
     for (int i = 0 ; i < v_elts.size(); i ++) {
        for (iter_top(v_elts[i]->reqs,j); j.ok(); j++) {
 {
     for (int i = 0 ; i < v_elts.size(); i ++) {
        for (iter_top(v_elts[i]->reqs,j); j.ok(); j++) {
@@ -30,13 +28,8 @@ Lyric_column::process_requests()
                    error("Barcheck failed, " + tdescription_->str());
                }
            }
                    error("Barcheck failed, " + tdescription_->str());
                }
            }
-#if 0
-           if (req_l->rhythmic()){
-               notes.add(rq->rhythmic());
-           }
-#endif
            if (req_l->lreq_l()) {
            if (req_l->lreq_l()) {
-               winfo_array_.add(req_l->lreq_l());
+               winfo_array_.push(req_l->lreq_l());
            }
        }
     }
            }
        }
     }
index 51b802e077d98e17f38e7be93211768aa6621651..3afea78a8fbb1018a5c3874fca8bc8ab1341ec22 100644 (file)
@@ -36,12 +36,7 @@ void
 Lyric_staff::walk()
 {
     for (Lyric_walker lcols(this); lcols.ok(); lcols++) {
 Lyric_staff::walk()
 {
     for (Lyric_walker lcols(this); lcols.ok(); lcols++) {
-       lcols.lcol_l()->process_requests();// TODO
+       lcols.lcol_l()->setup_requests();// TODO
        lcols.process();
     }
 }
        lcols.process();
     }
 }
-Staff *
-get_new_lyricstaff()
-{
-    return new Lyric_staff;
-}
index bd8ac0e40da56f1d39ab3c91e7615d830ae13e95..d28c488b7273081afc32e945b665672d7b6195af 100644 (file)
@@ -6,8 +6,6 @@
 //  or should we first devide lily/src up ?
 // HWN: huh?
 
 //  or should we first devide lily/src up ?
 // HWN: huh?
 
-#include "textspanner.hh"
-#include "script.hh"
 #include "request.hh"
 #include "voice.hh"
 #include "pscore.hh"
 #include "request.hh"
 #include "voice.hh"
 #include "pscore.hh"
@@ -56,7 +54,7 @@ Lyric_walker::Lyric_walker(Lyric_staff* lstaff_l)
 Lyric_staff*
 Lyric_walker::lstaff_l()
 {
 Lyric_staff*
 Lyric_walker::lstaff_l()
 {
-    return (Lyric_staff*)staff_;
+    return (Lyric_staff*)staff_l_;
 }
 
 Lyric_column*
 }
 
 Lyric_column*
index 67ccf5dfeb24f8250e5b7bfef26573a9ad030eb5..8ac50296eefed0697451d3067b30ade549430faa 100644 (file)
@@ -41,7 +41,9 @@ void notice()
        "LilyPond, a music typesetter.\n"
        "Copyright (C) 1996,97 by\n"
        "  Han-Wen Nienhuys <hanwen@stack.nl>\n"
        "LilyPond, a music typesetter.\n"
        "Copyright (C) 1996,97 by\n"
        "  Han-Wen Nienhuys <hanwen@stack.nl>\n"
+       "Contributors\n"
        "  Jan-Nieuwenhuizen <jan@digicash.com>\n"
        "  Jan-Nieuwenhuizen <jan@digicash.com>\n"
+       "  Mats Bengtsson <matsb@s3.kth.se>\n"
        "\n"
        "    This program is free software; you can redistribute it and/or\n"
        "modify it under the terms of the GNU General Public License version 2\n"
        "\n"
        "    This program is free software; you can redistribute it and/or\n"
        "modify it under the terms of the GNU General Public License version 2\n"
@@ -62,7 +64,7 @@ static File_path * path =0;
 struct Main_init {
     Main_init() {
        path = new File_path(LIBDIR);
 struct Main_init {
     Main_init() {
        path = new File_path(LIBDIR);
-       path->add(String(LIBDIR)+"init/");
+       path->push(String(LIBDIR)+"init/");
        debug_init();
     }
     ~Main_init() {
        debug_init();
     }
     ~Main_init() {
@@ -86,7 +88,7 @@ main (int argc, char **argv)
            exit(0);
            break;
        case 'I':
            exit(0);
            break;
        case 'I':
-           path->add(oparser.optarg);
+           path->push(oparser.optarg);
            break;
        case 'h':
            help();
            break;
        case 'h':
            help();
index e533fd3143b2b4431092f87bfb37f4d57374668a..849a64b2094bbaa43441f0fdd4dcd4990afb3716 100644 (file)
@@ -6,7 +6,7 @@
 #include "paper.hh"
 #include "molecule.hh"
 #include "linepstaff.hh"
 #include "paper.hh"
 #include "molecule.hh"
 #include "linepstaff.hh"
-#include "rhythmstaff.hh"
+//#include "rhythmstaff.hh"
 #include "sccol.hh" 
 #include "localkeyitem.hh"
 #include "request.hh"
 #include "sccol.hh" 
 #include "localkeyitem.hh"
 #include "request.hh"
@@ -25,12 +25,8 @@ Melodic_staff::set_output(PScore*ps)
 Notehead*
 Melodic_staff::get_notehead(Note_req *rq, int bottom)
 {        
 Notehead*
 Melodic_staff::get_notehead(Note_req *rq, int bottom)
 {        
-    int b  = rq->rhythmic()->balltype;
-    int d  = rq->rhythmic()->dots;
-    
     Notehead *n =new Notehead((NO_LINES-1)*2);
     Notehead *n =new Notehead((NO_LINES-1)*2);
-    n->balltype =b;
-    n->dots = d;
+    n->set_rhythmic(rq->rhythmic());
     n->position = rq->note()->height() + bottom;
     return n;
 }
     n->position = rq->note()->height() + bottom;
     return n;
 }
@@ -45,22 +41,13 @@ Melodic_staff::get_TYPESET_item(Command*com)
 }
 
 Stem *
 }
 
 Stem *
-Melodic_staff::get_stem(Stem_req*rq, Moment dur)
+Melodic_staff::get_stem(Stem_req*rq)
 {
 {
-    Stem * s = new Stem(NO_LINES-1, dur);
-    s->flag = rq->stem_number;
+    Stem * s = new Stem(NO_LINES-1);
+    s->flag = rq->balltype;
     return s;
 }
 
     return s;
 }
 
-/*
-  creation
-  */
-Staff *
-get_new_melodicstaff()
-{
-    return new Melodic_staff;
-}
-
 Rest*
 Melodic_staff::get_rest(Rest_req*rq)
 {
 Rest*
 Melodic_staff::get_rest(Rest_req*rq)
 {
index ba653dae2a4bb6b33db313a1b8c7e6b778089895..bd3f763c006274861add735a6476d8f91432948d 100644 (file)
@@ -3,7 +3,7 @@
 #include "meter.hh"
 #include "paper.hh"
 #include "lookup.hh"
 #include "meter.hh"
 #include "paper.hh"
 #include "lookup.hh"
-
+NAME_METHOD(Meter);
 Meter::Meter(Array<Scalar>a)
     :args(a)
 {
 Meter::Meter(Array<Scalar>a)
     :args(a)
 {
index 682204880d11d95291426140c9037c7c9fd53737..1e09658fee90d91b4632870ea0f31aef385a8383 100644 (file)
@@ -33,9 +33,9 @@ Atom::TeXstring() const
     // whugh.. Hard coded...
     String s("\\placebox{%}{%}{%}");
     Array<String> a;
     // whugh.. Hard coded...
     String s("\\placebox{%}{%}{%}");
     Array<String> a;
-    a.add(print_dimen(off.y));
-    a.add(print_dimen(off.x));
-    a.add(sym.tex);
+    a.push(print_dimen(off.y));
+    a.push(print_dimen(off.x));
+    a.push(sym.tex);
     return substitute_args(s, a);
 }
 
     return substitute_args(s, a);
 }
 
index d2e4b18ff8959e58154d0a10e0fee8d18d99ac37..acda945d3fe55e7a46d4734820ccdddbc7f53e44 100644 (file)
@@ -22,9 +22,7 @@ static Keyword_ent the_key_tab[]={
     "goto", GOTO,
     "in", IN,
     "key", KEY,
     "goto", GOTO,
     "in", IN,
     "key", KEY,
-    "lyric", LYRIC,
     "mark", MARK,
     "mark", MARK,
-    "melodic", MELODIC,
     "meter", METER,
     "mm", MM,
     "octave", OCTAVECOMMAND,
     "meter", METER,
     "mm", MM,
     "octave", OCTAVECOMMAND,
@@ -33,7 +31,6 @@ static Keyword_ent the_key_tab[]={
     "paper", PAPER,
     "plet", PLET,
     "pt", PT,
     "paper", PAPER,
     "plet", PLET,
     "pt", PT,
-    "rhythmic", RHYTHMIC,
     "score", SCORE,
     "script", SCRIPT,
     "skip", SKIP,
     "score", SCORE,
     "script", SCRIPT,
     "skip", SKIP,
index 0cd2c478a60980d1367d5744988fe717a5b723bc..f53b002d864b29ddb9673ffea998917ed8765597 100644 (file)
@@ -82,18 +82,19 @@ get_note_element(String pitch, int * notename, int * duration )
     
     int dur = duration[0];
     int dots=duration[1];
     
     int dur = duration[0];
     int dots=duration[1];
-    
-    Note_req * rq = new Note_req;
 
     if (dur >= 2) {
 
     if (dur >= 2) {
-       Stem_req * st = new Stem_req(dur);
+       Stem_req * st = new Stem_req(dur,dots);
+       st->plet_factor = Moment(default_plet_dur, default_plet_type);
        v->add(st);
     }
     
        v->add(st);
     }
     
+    Note_req * rq = new Note_req;
+    
     int oct;
     bool forceacc;
     parse_pitchmod(pitch, i, oct, forceacc);
     int oct;
     bool forceacc;
     parse_pitchmod(pitch, i, oct, forceacc);
-    rq->name =notename[0];
+    rq->notename =notename[0];
     rq->accidental = notename[1];
     rq->octave = oct;
     rq->forceacc = forceacc;
     rq->accidental = notename[1];
     rq->octave = oct;
     rq->forceacc = forceacc;
@@ -174,6 +175,7 @@ get_request(char c)
     case '|':
        ret = new Barcheck_req;
        break;
     case '|':
        ret = new Barcheck_req;
        break;
+
     case '[':
     case ']':
     {
     case '[':
     case ']':
     {
@@ -184,6 +186,7 @@ get_request(char c)
     }
        break;
 
     }
        break;
 
+
     case ')':
     case '(':
        ret = new Slur_req;
     case ')':
     case '(':
        ret = new Slur_req;
@@ -204,7 +207,6 @@ get_request(char c)
        break;
        
     default:
        break;
        
     default:
-
        break;
     }
 
        break;
     }
 
index 859e41fad9fa76b1e1f1942dc11ffbd6741d50c6..fb4e80719b85fb854c5d55d1058d609c6187798a 100644 (file)
@@ -5,7 +5,9 @@
 #include "paper.hh"
 #include "lookup.hh"
 #include "molecule.hh"
 #include "paper.hh"
 #include "lookup.hh"
 #include "molecule.hh"
+#include "request.hh"
 
 
+NAME_METHOD(Notehead);
 
 Notehead::Notehead(int ss)
 {
 
 Notehead::Notehead(int ss)
 {
@@ -16,14 +18,19 @@ Notehead::Notehead(int ss)
     dots = 0;
     extremal = 0;
 }
     dots = 0;
     extremal = 0;
 }
-
 void
 void
-Notehead::print()const
+Notehead::set_rhythmic(Rhythmic_req*r_req_l)
+{
+    balltype = r_req_l->balltype;
+    dots = r_req_l->dots;
+}
+    
+void
+Notehead::do_print()const
 {
 #ifndef NPRINT
 {
 #ifndef NPRINT
-    mtor << "Head "<< balltype << ", position = "<< position
+    mtor << "balltype "<< balltype << ", position = "<< position
         << "dots " << dots;
         << "dots " << dots;
-    Item::print();
 #endif
 }
 
 #endif
 }
 
@@ -64,7 +71,6 @@ Notehead::brew_molecule_p() const return out;
        out->add(sm);       
     }
     
        out->add(sm);       
     }
     
-
     out->translate(Offset(0,dy*position));
 }
 
     out->translate(Offset(0,dy*position));
 }
 
index aa3b4f2f3792cbd560a1ed1d302f779972845955..f36d153113cfa3272f815382ab9c3c3fe1f34dc2 100644 (file)
@@ -20,8 +20,9 @@
 
 Array<Request*> pre_reqs, post_reqs;
 sstack<String> define_spots;
 
 Array<Request*> pre_reqs, post_reqs;
 sstack<String> define_spots;
-
+extern bool want_beam;
 Paperdef*default_paper();
 Paperdef*default_paper();
+
 %}
 
 
 %}
 
 
@@ -63,13 +64,12 @@ Paperdef*default_paper();
 %token VOICE STAFF SCORE TITLE  BAR NOTENAME OUTPUT
 %token CM IN PT MM PAPER WIDTH METER UNITSPACE SKIP COMMANDS COMMAND
 %token GEOMETRIC START_T DURATIONCOMMAND OCTAVECOMMAND
 %token VOICE STAFF SCORE TITLE  BAR NOTENAME OUTPUT
 %token CM IN PT MM PAPER WIDTH METER UNITSPACE SKIP COMMANDS COMMAND
 %token GEOMETRIC START_T DURATIONCOMMAND OCTAVECOMMAND
-o%token KEY CLEF MULTI TABLE CHORD VOICES
-%token PARTIAL RHYTHMIC MELODIC MUSIC LYRIC GROUPING CADENZA
+%token KEY CLEF MULTI TABLE CHORD VOICES
+%token PARTIAL MUSIC GROUPING CADENZA
 %token END SYMBOLTABLES TEXID TABLE NOTENAMES SCRIPT TEXTSTYLE PLET
 %token MARK GOTO
 
 %token <id>  IDENTIFIER
 %token END SYMBOLTABLES TEXID TABLE NOTENAMES SCRIPT TEXTSTYLE PLET
 %token MARK GOTO
 
 %token <id>  IDENTIFIER
-%token <string> NEWIDENTIFIER 
 %token <string> PITCHMOD DURATION RESTNAME
 %token <ii> NOTENAME 
 %token <real> REAL
 %token <string> PITCHMOD DURATION RESTNAME
 %token <ii> NOTENAME 
 %token <real> REAL
@@ -135,7 +135,7 @@ add_declaration: declaration        {
        ;
 
 declarable_identifier:
        ;
 
 declarable_identifier:
-       NEWIDENTIFIER { $$ = $1; }
+       STRING { $$ = $1; }
        | IDENTIFIER { $$ = new String($1->name); }
        ;
 
        | IDENTIFIER { $$ = new String($1->name); }
        ;
 
@@ -212,10 +212,10 @@ score_commands_block:
 
 score_commands_body:                   { $$ = new Array<Input_command*>; }
        | score_commands_body score_command             {
 
 score_commands_body:                   { $$ = new Array<Input_command*>; }
        | score_commands_body score_command             {
-               $$->add($2);
+               $$->push($2);
        }
        | score_commands_body position_command          {
        }
        | score_commands_body position_command          {
-               $$->add($2);
+               $$->push($2);
        }
        ;
 
        }
        ;
 
@@ -226,10 +226,10 @@ staff_commands_block: COMMANDS '{' staff_commands_body '}'        {
 staff_commands_body:
        /* empty */                     { $$ = new Array<Input_command*>; }
        | staff_commands_body staff_command     {
 staff_commands_body:
        /* empty */                     { $$ = new Array<Input_command*>; }
        | staff_commands_body staff_command     {
-               $$->add($2);
+               $$->push($2);
        }
        | staff_commands_body position_command  {
        }
        | staff_commands_body position_command  {
-               $$->add($2);
+               $$->push($2);
        }
        ;
 
        }
        ;
 
@@ -324,14 +324,9 @@ staff_block:
 
 staff_init:
        IDENTIFIER              { $$ = $1->staff(true); }
 
 staff_init:
        IDENTIFIER              { $$ = $1->staff(true); }
-       | RHYTHMIC              {
-               $$ = new Input_staff("rhythmic");
-       }
-       | MELODIC               {
-               $$ = new Input_staff( "melodic");
-       }
-       | LYRIC                 {
-               $$ = new Input_staff( "lyric");
+       | STRING                {
+               $$ = new Input_staff(*$1);
+               delete $1;
        }
        ;
 
        }
        ;
 
@@ -415,7 +410,7 @@ post_requests:
                assert(post_reqs.empty());
        }
        | post_requests post_request {
                assert(post_reqs.empty());
        }
        | post_requests post_request {
-               post_reqs.add($2);
+               post_reqs.push($2);
        }
        ;
 
        }
        ;
 
@@ -424,14 +419,15 @@ post_request:
        | script_req
        | textscript_req
        ;
        | script_req
        | textscript_req
        ;
+
 close_request_parens:
        '('     { $$='('; }
 close_request_parens:
        '('     { $$='('; }
-       |']'    { $$ = ']' }
+       |']'    { $$=']'; }
        ;
 
 open_request_parens:
        ;
 
 open_request_parens:
-       ')'     {$$=')'}
-       |'['    {$$='['}
+       ')'     { $$=')'; }
+       |'['    { $$='['; }
        ;
 
 script_definition:
        ;
 
 script_definition:
@@ -481,7 +477,7 @@ script_dir:
 
 pre_requests:
        | pre_requests pre_request {
 
 pre_requests:
        | pre_requests pre_request {
-               pre_reqs.add($2);
+               pre_reqs.push($2);
        }
        ;
 
        }
        ;
 
@@ -554,8 +550,8 @@ pitch_list:                 {
                $$ = new Array<int>;
        }
        | pitch_list NOTENAME   {
                $$ = new Array<int>;
        }
        | pitch_list NOTENAME   {
-               $$->add($2[0]);
-               $$->add($2[1]);         
+               $$->push($2[0]);
+               $$->push($2[1]);                
        }
        ;
 
        }
        ;
 
@@ -573,7 +569,7 @@ int_list:
                $$ = new Array<int>;
        }
        | int_list int          {
                $$ = new Array<int>;
        }
        | int_list int          {
-               $$->add($2);
+               $$->push($2);
        }
        ;
 
        }
        ;
 
@@ -657,22 +653,26 @@ void
 parse_file(String s)
 {
    *mlog << "Parsing ... ";
 parse_file(String s)
 {
    *mlog << "Parsing ... ";
+   lexer = new My_flex_lexer;
 
 #ifdef YYDEBUG
    yydebug = !monitor.silence("InitParser") && check_debug;
 
 #ifdef YYDEBUG
    yydebug = !monitor.silence("InitParser") && check_debug;
+   lexer->set_debug( !monitor.silence("InitLexer") && check_debug);
 #endif
 
 #endif
 
-   set_lexer();
    lexer->new_input("symbol.ini");
    yyparse();
 
 #ifdef YYDEBUG
    yydebug = !monitor.silence("Parser") && check_debug;
    lexer->new_input("symbol.ini");
    yyparse();
 
 #ifdef YYDEBUG
    yydebug = !monitor.silence("Parser") && check_debug;
+   lexer->set_debug( !monitor.silence("Lexer") && check_debug);
 #endif
 
    lexer->new_input(s);
    yyparse();
 #endif
 
    lexer->new_input(s);
    yyparse();
-   kill_lexer();
+   delete lexer;
+   lexer = 0;
+
    assert(define_spots.empty());
 }
 
    assert(define_spots.empty());
 }
 
index 8251135cdee72571a50900beb286b47a1b1d8f30..83f71f440cb4f434871691d519cb0396cf6231e7 100644 (file)
@@ -143,7 +143,7 @@ PScore::select_items(PStaff*ps, PCol*pc)
     assert(ps && pc);
     for (iter_top(pc->its,i); i.ok(); i++){
        if (i->pstaff_l_ == ps)
     assert(ps && pc);
     for (iter_top(pc->its,i); i.ok(); i++){
        if (i->pstaff_l_ == ps)
-           ret.add((Item*)(const Item*)i);
+           ret.push((Item*)(const Item*)i);
     }
     return ret;
 }
     }
     return ret;
 }
index 5aa8e9f45e7592f21fb9ab8c0a252886e4e9700e..280f0db4ccde40d992b57b9880e770dfe101cdd9 100644 (file)
@@ -12,15 +12,15 @@ Mixed_qp::add_equality_cons(Vector , double )
 void
 Mixed_qp::add_fixed_var(int i, Real r)
 {
 void
 Mixed_qp::add_fixed_var(int i, Real r)
 {
-    eq_cons.add(i);
-    eq_consrhs.add(r);
+    eq_cons.push(i);
+    eq_consrhs.push(r);
 }
 
 void
 Ineq_constrained_qp::add_inequality_cons(Vector c, double r)
 {
 }
 
 void
 Ineq_constrained_qp::add_inequality_cons(Vector c, double r)
 {
-    cons.add(c);
-    consrhs.add(r);
+    cons.push(c);
+    consrhs.push(r);
 }
 
 Ineq_constrained_qp::Ineq_constrained_qp(int novars):
 }
 
 Ineq_constrained_qp::Ineq_constrained_qp(int novars):
@@ -96,7 +96,7 @@ Ineq_constrained_qp::assert_solution(Vector sol) const
        Real R=cons[i] * sol- consrhs[i];
        assert(R> -EPS);
        if (R < EPS)
        Real R=cons[i] * sol- consrhs[i];
        assert(R> -EPS);
        if (R < EPS)
-           binding.add(i);
+           binding.push(i);
     }
     // KKT check...
     // todo
     }
     // KKT check...
     // todo
index 8482bfd8752616df03c35f855569e6de5a623620..dd9c4043a2983b89c5b89a587623e6d7ad123308 100644 (file)
@@ -34,7 +34,7 @@ Active_constraints::OK()
     Array<int> allcons;
 
     for (int i=0; i < opt->cons.size(); i++)
     Array<int> allcons;
 
     for (int i=0; i < opt->cons.size(); i++)
-       allcons.add(0);
+       allcons.push(0);
     for (int i=0; i < active.size(); i++) {
        int j = active[i];
        allcons[j]++;
     for (int i=0; i < active.size(); i++) {
        int j = active[i];
        allcons[j]++;
@@ -61,7 +61,7 @@ Active_constraints::add(int k)
 {
     // add indices
     int cidx=inactive[k];
 {
     // add indices
     int cidx=inactive[k];
-    active.add(cidx);
+    active.push(cidx);
 
     inactive.swap(k,inactive.size()-1);
     inactive.pop();
 
     inactive.swap(k,inactive.size()-1);
     inactive.pop();
@@ -98,7 +98,7 @@ Active_constraints::drop(int k)
     int q=active.size()-1;
 
         // drop indices
     int q=active.size()-1;
 
         // drop indices
-    inactive.add(active[k]);
+    inactive.push(active[k]);
     active.swap(k,q);
     A.swap_rows(k,q);
     active.pop();
     active.swap(k,q);
     A.swap_rows(k,q);
     active.pop();
@@ -128,7 +128,7 @@ Active_constraints::Active_constraints(Ineq_constrained_qp const *op)
            opt(op)
 {
     for (int i=0; i < op->cons.size(); i++)
            opt(op)
 {
     for (int i=0; i < op->cons.size(); i++)
-       inactive.add(i);
+       inactive.push(i);
     Choleski_decomposition chol(op->quad);
     H=chol.inverse();
 }
     Choleski_decomposition chol(op->quad);
     H=chol.inverse();
 }
diff --git a/src/register.cc b/src/register.cc
new file mode 100644 (file)
index 0000000..4391855
--- /dev/null
@@ -0,0 +1,99 @@
+#include "voice.hh"
+#include "request.hh"
+#include "register.hh"
+#include "notehead.hh"
+#include "complexwalker.hh"
+#include "localkeyitem.hh"
+
+Staff_elem_info::Staff_elem_info(Staff_elem*s_l, Request*r_l,
+                                Request_register *reg_l)
+{
+    elem_p_ = s_l;
+    voice_l_ = r_l->elt_l_->voice_l_;
+    req_l_ = r_l;
+    group = 0;
+    origin_reg_l_ = reg_l;
+}
+Staff_elem_info::Staff_elem_info()
+{
+    elem_p_ = 0;
+    voice_l_ = 0;
+    group = 0;
+    origin_reg_l_ = 0;
+    req_l_ = 0;
+}
+/****************/
+
+Request_register::Request_register()
+{
+    walk_l_=0;
+}
+
+Request_register::Request_register(Complex_walker*w_l)
+{
+    walk_l_=w_l;    
+}
+
+void
+Request_register::pre_move_processing()
+{    
+    do_pre_move_process();
+    accepted_req_arr_.set_size(0);
+}
+void
+Request_register::post_move_processing()
+{    
+    do_post_move_process();
+}
+
+
+/****************/
+
+Local_key_register::Local_key_register(Complex_walker*w)
+    : Request_register(w)
+{
+    key_item_p_ = 0;    
+}
+bool
+Local_key_register::try_request(Request*)
+
+{
+    return false;
+}
+
+void
+Local_key_register::process_request()
+{
+}
+void
+Local_key_register::do_pre_move_process()
+{
+    if (key_item_p_) {
+       walk_l_->typeset_element(key_item_p_);
+       key_item_p_ = 0;
+    }
+}
+void
+Local_key_register::acknowledge_element(Staff_elem_info info)
+{    
+    if (info.req_l_->melodic()) {
+       Melodic_req * melodic_l_ = info.req_l_->melodic();
+
+       if( melodic_l_->forceacc ||
+           walk_l_->local_key_.oct(melodic_l_->octave).acc(melodic_l_->notename)
+           != melodic_l_->accidental) {
+           Item * support_l_ = info.elem_p_->item();
+       
+
+           if (!key_item_p_) {
+               key_item_p_ = new Local_key_item(-2);
+               key_item_p_->c0_position = walk_l_->clef_.c0_pos;
+           }
+           
+           key_item_p_->add(melodic_l_);
+           key_item_p_->add(support_l_);
+           walk_l_->local_key_.oct(melodic_l_->octave)
+               .set(melodic_l_->notename, melodic_l_->accidental);
+       }
+    }
+}
index c6ff787c668fd172a72e925c39e89b59d2cf1436..323932a6a9f9a9cc00b5c800c068fdba86916e31 100644 (file)
@@ -6,51 +6,50 @@
 
 #include "inputcommand.hh"
 
 
 #include "inputcommand.hh"
 
-#define VIRTUALCONS(T,R) R *T::clone() const { return  new T(*this); } struct T
-#define RCONS(T) VIRTUALCONS(T, Request)
-
-RCONS(Rest_req);
-RCONS(Barcheck_req);
-RCONS(Text_req);
-RCONS(Rhythmic_req);
-RCONS(Lyric_req);
-RCONS(Mark_req);
-RCONS(Stem_req);
-RCONS(Script_req);
-RCONS(Note_req);
-RCONS(Melodic_req);
-RCONS(Span_req);
-RCONS(Slur_req);
-RCONS(Beam_req);
-RCONS(Staff_command_req);
-
 void
 void
-Stem_req::print() const
+Stem_req::do_print() const
+{
+    Rhythmic_req::do_print();    
+}
+
+Stem_req::Stem_req(int s, int d)
+    : Rhythmic_req(s,d)
 {
 {
-    mtor << "Stem\n";
 }
 }
+
 /****************/
 void
 /****************/
 void
-Barcheck_req::print() const    
+Barcheck_req::do_print() const    
 {
 #ifndef NPRINT
 {
 #ifndef NPRINT
-    mtor << "Barcheck\n";
+
 #endif
 }
 #endif
 }
+
 /****************/
 /****************/
+
 void
 void
-Request::print() const    
+Request::print() const
+
+{
+    mtor << name() << " {";
+    do_print();
+    mtor << "}\n";
+}
+     
+
+void
+Request::do_print() const    
 {
 #ifndef NPRINT
 {
 #ifndef NPRINT
-    mtor << "Req{ unknown }\n";
 #endif
 }
 
 void
 #endif
 }
 
 void
-Span_req::print() const    
+Span_req::do_print() const    
 {
 #ifndef NPRINT
 {
 #ifndef NPRINT
-    mtor << "Span_req {" << spantype << "}\n";
+    mtor  << spantype ;
 #endif
 }
 
 #endif
 }
 
@@ -65,25 +64,37 @@ Request::Request(Request const&)
 /****************/
 Melodic_req::Melodic_req()
 {
 /****************/
 Melodic_req::Melodic_req()
 {
-    name = 0;
+    notename = 0;
     octave = 0;
     accidental = 0;
     forceacc = false;
 }
 
 void
     octave = 0;
     accidental = 0;
     forceacc = false;
 }
 
 void
-Melodic_req::print() const
+Melodic_req::do_print() const
 {
 {
-    mtor << "note: " << name << " oct: "<< octave;
+    mtor << "notename: " << notename << " oct: "<< octave;
 }
 
 int
 Melodic_req::height() const
 {
 }
 
 int
 Melodic_req::height() const
 {
-    return  name + octave*7;
+    return  notename + octave*7;
 }
 
 /****************/
 }
 
 /****************/
+int
+Rhythmic_req::compare(const Rhythmic_req &r1, const Rhythmic_req &r2)
+{
+    return r1.duration() - r2.duration();
+}
+Rhythmic_req::Rhythmic_req(int b, int d)
+{
+    plet_factor = 1;
+    balltype = b;
+    dots = d;
+}
+
 Rhythmic_req::Rhythmic_req()
 {
     plet_factor = 1;
 Rhythmic_req::Rhythmic_req()
 {
     plet_factor = 1;
@@ -92,9 +103,9 @@ Rhythmic_req::Rhythmic_req()
 }
 
 void
 }
 
 void
-Rhythmic_req::print() const
+Rhythmic_req::do_print() const
 {
 {
-    mtor << "rhythmic: " << balltype ;
+    mtor << "ball: " << balltype ;
     int d =dots;
     while (d--)
        mtor << '.';
     int d =dots;
     while (d--)
        mtor << '.';
@@ -117,32 +128,41 @@ Lyric_req::Lyric_req(Text_def* def_p)
 }
 
 void
 }
 
 void
-Lyric_req::print() const
-{
-    mtor << "lyric: ";
-    Rhythmic_req::print();
-    Text_req::print();
+Lyric_req::do_print() const
+{    
+    Rhythmic_req::do_print();
+    Text_req::do_print();
 }
 /****************/
 void
 }
 /****************/
 void
-Note_req::print() const
+Note_req::do_print() const
 {
 {
-    Melodic_req::print();
-    Rhythmic_req::print();
+    Melodic_req::do_print();
+    Rhythmic_req::do_print();
 }
 /****************/
 void
 }
 /****************/
 void
-Rest_req::print() const
+Rest_req::do_print() const
 {
 {
-    mtor << "rest, " ;
-    Rhythmic_req::print();
+        Rhythmic_req::do_print();
 }
 }
+
 /****************/
 Beam_req::Beam_req()
 {
     nplet = 0;
 }
 /****************/
 Beam_req::Beam_req()
 {
     nplet = 0;
 }
+
+void Beam_req::do_print()const{}
 /****************/
 /****************/
+void Slur_req::do_print()const{}
+/****************/
+int
+Span_req:: compare(const Span_req &r1, const Span_req &r2)
+{
+     return r1.spantype - r2.spantype;
+}
+
 Span_req::Span_req()
 {
     spantype = NOSPAN;
 Span_req::Span_req()
 {
     spantype = NOSPAN;
@@ -161,7 +181,7 @@ Script_req::Script_req(Script_req const &s)
 }
 
 void
 }
 
 void
-Script_req::print() const
+Script_req::do_print() const
 {
     mtor << " dir " << dir ;
     scriptdef->print();
 {
     mtor << " dir " << dir ;
     scriptdef->print();
@@ -193,7 +213,7 @@ Text_req::Text_req(int dir_i, Text_def* tdef_p)
 }
 
 void
 }
 
 void
-Text_req::print() const
+Text_req::do_print() const
 {
     mtor << " dir " << dir_i_ ;
     tdef_p_->print();
 {
     mtor << " dir " << dir_i_ ;
     tdef_p_->print();
@@ -209,10 +229,10 @@ Mark_req::Mark_req(String s)
 }
 
 void
 }
 
 void
-Mark_req::print()const
+Mark_req::do_print()const
 {
 #ifndef NDEBUG
 {
 #ifndef NDEBUG
-    mtor<< "Mark `" << mark_str_ << "\'\n";
+    mtor<< " `" << mark_str_ << "\'\n";
 #endif
 }
 /****************/
 #endif
 }
 /****************/
@@ -229,9 +249,8 @@ Staff_command_req::Staff_command_req(Staff_command_req const&src)
     com_p_ = new Input_command(*src.com_p_);
 }
 void
     com_p_ = new Input_command(*src.com_p_);
 }
 void
-Staff_command_req::print()const
+Staff_command_req::do_print()const
 {
 {
-    mtor << "Command request: " ;
     com_p_->print();
 }
 
     com_p_->print();
 }
 
index 215b102fed21a3cb4ec93601f9799b40032122dd..b8d30654154f1f876b06a61f571e8f75ed31fe16 100644 (file)
@@ -11,12 +11,15 @@ Rest::Rest(int t, int d)
     balltype = t;
     dots = d;
 }
     balltype = t;
     dots = d;
 }
+NAME_METHOD(Rest);
 
 void
 
 void
-Rest::print()const
+Rest::do_print()const
 {
 {
+#ifndef NPRINT
     mtor << "Rest "<<balltype<< "dots " << dots;
     Item::print();
     mtor << "Rest "<<balltype<< "dots " << dots;
     Item::print();
+#endif
 }
 
 Molecule*
 }
 
 Molecule*
index 5f5df7e361751a11f0008210da99dec3f4058c0b..519ea18cfa5fa7591c1f9c1390d3b5e62df790a0 100644 (file)
@@ -32,30 +32,16 @@ Rhythmic_staff::get_TYPESET_item(Command *com)
 Notehead*
 Rhythmic_staff::get_notehead(Note_req *rq, int)
 {
 Notehead*
 Rhythmic_staff::get_notehead(Note_req *rq, int)
 {
-    int b = rq->rhythmic()->balltype;
-    int d = rq->rhythmic()->dots;
-
     Notehead *n =new Notehead(1);
     Notehead *n =new Notehead(1);
-    n->balltype = b;
-    n->dots =d;
+    n->set_rhythmic(rq->rhythmic());
     n->position = 0;
     return n;
 }
 
 Stem *
     n->position = 0;
     return n;
 }
 
 Stem *
-Rhythmic_staff::get_stem(Stem_req*rq, Moment l)
+Rhythmic_staff::get_stem(Stem_req*rq)
 {
 {
-    Stem * s = new Stem(0,l);
-    s->flag = rq->stem_number;
+    Stem * s = new Stem(0);
+    s->flag = rq->balltype;
     return s;    
 }
     return s;    
 }
-
-/*
-  creation
-  */
-Staff *
-get_new_rhythmstaff()
-{
-    return new Rhythmic_staff;
-}
-
index bbd0dba1aeda4e56d77c8596591d7d34c106ec7a..14c52796de10c48ae0a58c453c99c41d4be7e6e1 100644 (file)
@@ -58,5 +58,5 @@ Score_column::add_duration(Moment d)
        if (d == durations[i])
            return ;
     }
        if (d == durations[i])
            return ;
     }
-    durations.add(d);
+    durations.push(d);
 }
 }
index bdd53716456a8c5097b30af051a06b7a9684d018..6ebbf18a171e986804d9b06ff8d33c6e103c49fe 100644 (file)
@@ -25,7 +25,7 @@ do_scores()
 void
 add_score(Input_score * s)
 {
 void
 add_score(Input_score * s)
 {
-    score_array_global.add(s);
+    score_array_global.push(s);
 }
 
 
 }
 
 
index eab30f9cbbf636557513da5968b727eb940abbf4..a6c3ee8039fa5b3d3678cbd89c512e8711a70afd 100644 (file)
@@ -5,15 +5,27 @@
 #include "molecule.hh"
 #include "lookup.hh"
 
 #include "molecule.hh"
 #include "lookup.hh"
 
-Script::Script(Script_req* rq, Item*i , int staflen, Stem*st_l)
+NAME_METHOD(Script);
+
+void
+Script::set_stem(Stem*st_l)
 {
 {
-    dependencies.add(st_l);
-    dependencies.add(i);
-    
+    stem_l_ = st_l;
+    dependencies.push(st_l);
+}
+
+void
+Script::set_support(Item*i)
+{
+    support.push(i);
+    dependencies.push(i);
+}
+
+Script::Script(Script_req* rq, int staflen)
+{    
     staffsize =staflen;
     specs_l_ = rq->scriptdef;
     staffsize =staflen;
     specs_l_ = rq->scriptdef;
-    support= i;
-    stem_l_ = st_l;
+    stem_l_ = 0;
     pos = 0;
     symdir=1;
     dir =rq->dir;
     pos = 0;
     symdir=1;
     dir =rq->dir;
@@ -37,6 +49,13 @@ Script::set_default_dir()
     }
 }
 
     }
 }
 
+Interval
+Script::support_height() const return r;
+{
+    for (int i=0; i < support.size(); i++)
+       r.unite(support[i]->height());
+}
+
 void
 Script::set_default_pos()
 {
 void
 Script::set_default_pos()
 {
@@ -46,12 +65,12 @@ Script::set_default_pos()
     int d = specs_l_->staffdir;
     Real y  ;
     if (!d) {
     int d = specs_l_->staffdir;
     Real y  ;
     if (!d) {
-       Interval v= support->height();
+       Interval v= support_height();
        y = v[dir]  -dy[-dir] + 2*dir*inter_f;
     } else {
        Real y  = (d > 0) ? staffsize + 2: -2; // ug
        y *=inter_f;
        y = v[dir]  -dy[-dir] + 2*dir*inter_f;
     } else {
        Real y  = (d > 0) ? staffsize + 2: -2; // ug
        y *=inter_f;
-       Interval v= support->height();
+       Interval v= support_height();
 
        if (d > 0) {
            y = y >? v.max();
 
        if (d > 0) {
            y = y >? v.max();
index e4e4986ef1ecd5dd8f970a2c7d35fdf96c3d0879..20f291fa8aac52956675a8e81d2a89f0209276cb 100644 (file)
@@ -19,7 +19,7 @@ Simple_column::Simple_column(Score_column*s, Simple_staff *rs)
     staff_l_ = rs;
     beam_ = 0;
     text_=0;
     staff_l_ = rs;
     beam_ = 0;
     text_=0;
-    lreq_p_ = 0;
+
 }
 
 Simple_staff::Simple_staff()
 }
 
 Simple_staff::Simple_staff()
@@ -27,18 +27,10 @@ Simple_staff::Simple_staff()
     theline_l_ = 0;
 }
 
     theline_l_ = 0;
 }
 
-/**
- accept:
-
-    BREAK: all
-    TYPESET: bar, meter,
-Scalar
-    */
-
 
 
 void
 
 
 void
-Simple_column::process_requests()
+Simple_column::setup_requests()
 {
     for (int i = 0 ; i < v_elts.size(); i ++)
        for (iter_top(v_elts[i]->reqs,j); j.ok(); j++) {
 {
     for (int i = 0 ; i < v_elts.size(); i ++)
        for (iter_top(v_elts[i]->reqs,j); j.ok(); j++) {
@@ -49,10 +41,10 @@ Simple_column::process_requests()
                }
            }
            if (rq->rhythmic()){
                }
            }
            if (rq->rhythmic()){
-               notes.add(rq->rhythmic());
+               notes.push(rq->rhythmic());
            }
            if (rq->script()) {
            }
            if (rq->script()) {
-               notes.last().scripts.add(rq->script());
+               notes.last().scripts.push(rq->script());
            }
            if (rq->stem()) {
                stem_ = rq->stem();
            }
            if (rq->stem()) {
                stem_ = rq->stem();
@@ -61,16 +53,11 @@ Simple_column::process_requests()
            if (rq->text()) {
                text_ = rq->text();
            }
            if (rq->text()) {
                text_ = rq->text();
            }
-#if 0
-           if (rq->lreq_l()) {
-               lreq_p_ = rq->lreq_l();
-           }
-#endif
            if (rq->beam()) {
                beam_ = rq->beam();
            }
            if (rq->slur()) {
            if (rq->beam()) {
                beam_ = rq->beam();
            }
            if (rq->slur()) {
-               slurs.add(rq->slur());
+               slurs.push(rq->slur());
            }
        }
 }
            }
        }
 }
@@ -85,7 +72,7 @@ void
 Simple_staff::walk()
 {
     for (Simple_walker sc(this); sc.ok(); sc++) {
 Simple_staff::walk()
 {
     for (Simple_walker sc(this); sc.ok(); sc++) {
-       sc.col()->process_requests();// TODO
+       sc.col()->setup_requests();// TODO
        sc.process();
     }
 }
        sc.process();
     }
 }
index 8ac89bd2d0bc7e5e87f33f743a0abdd398e790a9..05bc76c9b6d6534b75cee1170efc5b7772bfa368 100644 (file)
 #include "slur.hh"
 #include "localkeyitem.hh"
 #include "textitem.hh"
 #include "slur.hh"
 #include "localkeyitem.hh"
 #include "textitem.hh"
-#include "lyricitem.hh"
+
 
 Rhythmic_grouping
 parse_grouping(Array<Scalar> a, Moment one_beat)
 {
     Array<int> r;
     for (int i= 0 ; i < a.size(); i++)
 
 Rhythmic_grouping
 parse_grouping(Array<Scalar> a, Moment one_beat)
 {
     Array<int> r;
     for (int i= 0 ; i < a.size(); i++)
-       r.add(a[i]);
+       r.push(a[i]);
     Moment here =0.0;
 
     Array<Rhythmic_grouping*> children;
     Moment here =0.0;
 
     Array<Rhythmic_grouping*> children;
@@ -35,7 +35,7 @@ parse_grouping(Array<Scalar> a, Moment one_beat)
        
        Moment last = here;
        here += one_beat * r[i];
        
        Moment last = here;
        here += one_beat * r[i];
-       children.add(
+       children.push(
            new Rhythmic_grouping(MInterval(last, here), r[i] )
            );
     }
            new Rhythmic_grouping(MInterval(last, here), r[i] )
            );
     }
@@ -120,14 +120,14 @@ Simple_walker::do_TYPESET_command(Command*com)
 void
 Simple_walker::do_local_key(Note_req*n,Notehead* head_p)
 {
 void
 Simple_walker::do_local_key(Note_req*n,Notehead* head_p)
 {
-    if ( local_key_.oct(n->octave).acc(n->name) != n->accidental) {
+    if ( local_key_.oct(n->octave).acc(n->notename) != n->accidental) {
        if (!local_key_item_) {
            local_key_item_ = staff()->get_local_key_item();
            local_key_item_->c0_position = clef_.c0_pos;
        }
        if (!local_key_item_) {
            local_key_item_ = staff()->get_local_key_item();
            local_key_item_->c0_position = clef_.c0_pos;
        }
-       
-       local_key_item_->add(n->octave, n->name, n->accidental, head_p);
-       local_key_.oct(n->octave).set(n->name, n->accidental);
+       local_key_item_->add(head_p);
+       local_key_item_->add(n->octave, n->notename, n->accidental);
+       local_key_.oct(n->octave).set(n->notename, n->accidental);
     }
 }
 
     }
 }
 
@@ -136,10 +136,10 @@ Simple_walker::do_note(Note_info n)
 {
     Simple_column*c = col();
     Simple_staff *s = staff();
 {
     Simple_column*c = col();
     Simple_staff *s = staff();
-       Item*rhythmic=0;
+    Item*rhythmic=0;
     if (n.rq->note()) {
        Note_req * req = n.rq->note() ;
     if (n.rq->note()) {
        Note_req * req = n.rq->note() ;
-       const Voice *v = req->elt_l_->voice_;
+       const Voice *v = req->elt_l_->voice_l_;
 
        Notehead*n = s->get_notehead(req, clef_.c0_pos);
        rhythmic=n;
 
        Notehead*n = s->get_notehead(req, clef_.c0_pos);
        rhythmic=n;
@@ -150,7 +150,7 @@ Simple_walker::do_note(Note_info n)
            current_grouping->add_child(
                c->tdescription_->whole_in_measure, req->duration());
        }
            current_grouping->add_child(
                c->tdescription_->whole_in_measure, req->duration());
        }
-       noteheads.add(n);
+       noteheads.push(n);
        int sidx =find_slur(v);
        if (sidx >= 0) {
            pending_slurs[sidx]->add(n);
        int sidx =find_slur(v);
        if (sidx >= 0) {
            pending_slurs[sidx]->add(n);
@@ -158,12 +158,16 @@ Simple_walker::do_note(Note_info n)
 
        if (wantkey)
            do_local_key(req,n);
 
        if (wantkey)
            do_local_key(req,n);
-    }else if (n.rq->rest()) {
+    } else if (n.rq->rest()) {
        rhythmic = s->get_rest(n.rq->rest());
        c->typeset_item(rhythmic);
     }
        rhythmic = s->get_rest(n.rq->rest());
        c->typeset_item(rhythmic);
     }
-    for (int i= 0; i < n.scripts.size(); i ++)
-       c->typeset_item(new Script(n.scripts[i], rhythmic, 10, stem_)); // UGR
+    for (int i= 0; i < n.scripts.size(); i ++) {
+       Script * s_p =new Script(n.scripts[i], 10);
+       s_p->set_support(rhythmic);
+       s_p->set_stem(stem_);
+       c->typeset_item(s_p);   // UGR
+    }
 }
 
 void
 }
 
 void
@@ -172,7 +176,7 @@ Simple_walker::process_requests()
     Simple_column*c = col();
     Simple_staff *s = staff();
 
     Simple_column*c = col();
     Simple_staff *s = staff();
 
-    if (c->beam_&& c->beam_->spantype == Span_req::START) {
+    if (c->beam_ && c->beam_->spantype == Span_req::START) {
        if (beam_)
            error("Too many beams (t = "
                          +String(c->when())+")");
        if (beam_)
            error("Too many beams (t = "
                          +String(c->when())+")");
@@ -185,10 +189,10 @@ Simple_walker::process_requests()
        Slur_req*sl = c->slurs[i];
 
        if (sl->spantype == Span_req::START) {
        Slur_req*sl = c->slurs[i];
 
        if (sl->spantype == Span_req::START) {
-           if  (find_slur(sl->elt_l_->voice_ )>=0)
+           if  (find_slur(sl->elt_l_->voice_l_)>=0)
                error_t("Too many slurs in voice", *col()->tdescription_);
                error_t("Too many slurs in voice", *col()->tdescription_);
-           pending_slur_reqs.add(sl);
-           pending_slurs.add(new Slur);
+           pending_slur_reqs.push(sl);
+           pending_slurs.push(new Slur);
        }
     }
     
        }
     }
     
@@ -196,12 +200,8 @@ Simple_walker::process_requests()
        c->typeset_item(new Text_item(c->text_, 10)); // UGR
     }
 
        c->typeset_item(new Text_item(c->text_, 10)); // UGR
     }
 
-//    if (c->lreq_p_) {
-//     c->typeset_item(new Lyric_item(c->lreq_p_, 10)); // UGR
-//    }
-
     if (c->stem_) {
     if (c->stem_) {
-       stem_ = s->get_stem(c->stem_->stem(), c->stem_requester_len);
+       stem_ = s->get_stem(c->stem_->stem());
     }
     
     for (int i = 0; i <  c->notes.size(); i ++)  {
     }
     
     for (int i = 0; i <  c->notes.size(); i ++)  {
@@ -224,15 +224,19 @@ Simple_walker::process_requests()
     }
 
     if (c->beam_&& c->beam_->spantype == Span_req::STOP) {
     }
 
     if (c->beam_&& c->beam_->spantype == Span_req::STOP) {
+       if (!beam_) {
+           error_t("No beam to end", *col()->tdescription_);
+       }
        default_grouping.extend(current_grouping->interval());
        beam_->set_grouping(default_grouping, *current_grouping);
        default_grouping.extend(current_grouping->interval());
        beam_->set_grouping(default_grouping, *current_grouping);
-       pscore_->typeset_spanner(beam_, s->theline_l_);
+       pscore_l_->typeset_spanner(beam_, s->theline_l_);
 
        if (c->beam_->nplet) {
 
        if (c->beam_->nplet) {
-           Text_spanner* t = new Text_spanner(beam_);
+           Text_spanner* t = new Text_spanner;
+           t->set_support(beam_);
            t->spec.align_i_ = 0;
            t->spec.text_str_ = c->beam_->nplet;
            t->spec.align_i_ = 0;
            t->spec.text_str_ = c->beam_->nplet;
-           pscore_->typeset_spanner(t, s->theline_l_);
+           pscore_l_->typeset_spanner(t, s->theline_l_);
        }
 
        beam_ = 0;
        }
 
        beam_ = 0;
@@ -245,7 +249,7 @@ Simple_walker::process_requests()
     noteheads.set_size(0);
  
     if (local_key_item_) {
     noteheads.set_size(0);
  
     if (local_key_item_) {
-       c->typeset_item_directional(local_key_item_, -1);
+       c->typeset_item(local_key_item_);
        local_key_item_ = 0;    
     }
     if (stem_) {
        local_key_item_ = 0;    
     }
     if (stem_) {
@@ -255,11 +259,11 @@ Simple_walker::process_requests()
        Slur_req *sl = c->slurs[i];
 
        if (sl->spantype == Span_req::STOP) {
        Slur_req *sl = c->slurs[i];
 
        if (sl->spantype == Span_req::STOP) {
-           int idx = find_slur(sl->elt_l_->voice_);
+           int idx = find_slur(sl->elt_l_->voice_l_);
            if (idx < 0)
                error_t("can't find slur to end; ", *c->tdescription_);
            
            if (idx < 0)
                error_t("can't find slur to end; ", *c->tdescription_);
            
-           pscore_->typeset_spanner(pending_slurs[idx],
+           pscore_l_->typeset_spanner(pending_slurs[idx],
                                     s->theline_l_);
            pending_slurs.del(idx);
            pending_slur_reqs.del(idx);
                                     s->theline_l_);
            pending_slurs.del(idx);
            pending_slur_reqs.del(idx);
@@ -267,7 +271,28 @@ Simple_walker::process_requests()
     }
     
 }
     }
     
 }
+Simple_walker::Simple_walker(Simple_walker const&)
+    : Staff_walker(0, 0)
+{
+    assert(false);
+}
 
 
+Simple_walker::~Simple_walker()
+{
+    if (pending_slurs.size())
+       WARN << "destructing " << pending_slurs.size() << " Pending slurs ";
+    if (beam_)
+       WARN << "destructing Beam\n";
+    if (local_key_item_)
+       WARN<<"destructing Local_key_item\n";
+    if (stem_)
+       WARN<< "destructing Stem\n";
+    delete local_key_item_;
+    delete stem_;
+    delete beam_;    
+    
+}
+    
 Simple_walker::Simple_walker(Simple_staff*s)
     : Staff_walker(s, s->theline_l_->pscore_l_)
 {
 Simple_walker::Simple_walker(Simple_staff*s)
     : Staff_walker(s, s->theline_l_->pscore_l_)
 {
@@ -279,7 +304,7 @@ Simple_walker::Simple_walker(Simple_staff*s)
     wantkey  =i;
     delete i;
     local_key_item_ = 0;
     wantkey  =i;
     delete i;
     local_key_item_ = 0;
-    reset();
+    do_post_move();
 }
 
 
 }
 
 
@@ -287,7 +312,7 @@ Simple_walker::Simple_walker(Simple_staff*s)
 Simple_staff*
 Simple_walker::staff()
 {
 Simple_staff*
 Simple_walker::staff()
 {
-    return (Simple_staff*) staff_;
+    return (Simple_staff*) staff_l_;
 }
 
 Simple_column*
 }
 
 Simple_column*
@@ -297,7 +322,7 @@ Simple_walker::col()
 }
 
 void
 }
 
 void
-Simple_walker::reset()
+Simple_walker::do_post_move()
 {
     processed_clef =false;    
     processed_key = false;
 {
     processed_clef =false;    
     processed_key = false;
@@ -308,7 +333,7 @@ int
 Simple_walker::find_slur(const Voice *v)
 {
     for (int i=0; i < pending_slur_reqs.size(); i++) {
 Simple_walker::find_slur(const Voice *v)
 {
     for (int i=0; i < pending_slur_reqs.size(); i++) {
-       if (pending_slur_reqs[i]->elt_l_->voice_ == v)
+       if (pending_slur_reqs[i]->elt_l_->voice_l_== v)
            return i;
     }
     return -1;
            return i;
     }
     return -1;
index d4a3d0d96df3b54a566b093bf175a31705e2eb7f..2cdddfec47b9071fb5b2a05bcb0c962d20ba71ad 100644 (file)
@@ -7,7 +7,7 @@
 #include "molecule.hh"
 #include "debug.hh"
 #include "boxes.hh"
 #include "molecule.hh"
 #include "debug.hh"
 #include "boxes.hh"
-
+NAME_METHOD(Slur);
 Slur::Slur()
 {
     dir = 0;
 Slur::Slur()
 {
     dir = 0;
@@ -30,8 +30,8 @@ Slur::center() const
 void
 Slur::add(Notehead*n)
 {
 void
 Slur::add(Notehead*n)
 {
-    encompass.add(n);
-    dependencies.add(n);
+    encompass.push(n);
+    dependencies.push(n);
 }
 
 void
 }
 
 void
@@ -50,12 +50,6 @@ Slur::set_default_dir()
        dir = 1;    
 }
 
        dir = 1;    
 }
 
-void
-Slur::print()const
-{
-    mtor << "Slur.\n";   
-}
-
 void
 Slur::do_pre_processing()
 {
 void
 Slur::do_pre_processing()
 {
@@ -72,7 +66,7 @@ Slur::do_break_at(PCol*l, PCol*r) const
     ret->encompass.set_size(0);
     for (int i =0; i < encompass.size(); i++) {
        if (encompass[i]->pcol_l_->line_l_==l->line_l_)
     ret->encompass.set_size(0);
     for (int i =0; i < encompass.size(); i++) {
        if (encompass[i]->pcol_l_->line_l_==l->line_l_)
-           ret->encompass.add(encompass[i]);
+           ret->encompass.push(encompass[i]);
     }
     if (right != r)
        ret->open_right = true;
     }
     if (right != r)
        ret->open_right = true;
index f6b4f92e80679aeaeebfd7ae06e11aeea6d78012..ce3cb4916250fb1c4bf5865686a96f80385cd76b 100644 (file)
@@ -2,6 +2,12 @@
 #include "spanner.hh"
 #include "pcol.hh"
 
 #include "spanner.hh"
 #include "pcol.hh"
 
+NAME_METHOD(Spanner);
+void
+Spanner::do_print()const
+{
+    mtor << " (unknown) ";
+}
 Spanner*
 Spanner::broken_at(PCol*c1, PCol *c2)const
 {
 Spanner*
 Spanner::broken_at(PCol*c1, PCol *c2)const
 {
@@ -9,7 +15,7 @@ Spanner::broken_at(PCol*c1, PCol *c2)const
     Spanner *span_p = do_break_at(c1,c2);
 
     me_p->calc_children = true;
     Spanner *span_p = do_break_at(c1,c2);
 
     me_p->calc_children = true;
-    me_p->dependencies.add(span_p);
+    me_p->dependencies.push(span_p);
 
     span_p->calc_children = false; // should handle in ctor
 
 
     span_p->calc_children = false; // should handle in ctor
 
@@ -28,20 +34,10 @@ Spanner::Spanner()
 Interval
 Spanner::width()const
 {
 Interval
 Spanner::width()const
 {
-    Real r =right->hpos,
-       l= left->hpos;
+    Real r = right->hpos;
+    Real l = left->hpos;
+    assert(*left < *right);
     assert(r>=l);
        
     return Interval(0, r-l);
 }
     assert(r>=l);
        
     return Interval(0, r-l);
 }
-
-void
-Spanner::print() const
-{
-#ifndef NPRINT
-    mtor << "Spanner { ";
-    Staff_elem::print();
-    mtor << "}\n";
-#endif
-}
-
index 69fc3123b8864edf418afbd947215667ea6f60d1..df46046c1458228e5bc89e5ab010c70b5dded317 100644 (file)
@@ -77,19 +77,19 @@ Staff::clean_cols()
 Staff_column *
 Staff::get_col(Moment w, bool mus)
 {
 Staff_column *
 Staff::get_col(Moment w, bool mus)
 {
-    Score_column* sc = score_l_->find_col(w,mus);
+    Score_column* sccol_l = score_l_->find_col(w,mus);
     
     iter_top(cols,i);
     for (; i.ok(); i++) {
 
     
     iter_top(cols,i);
     for (; i.ok(); i++) {
 
-       if (*i->score_column_l_ > *sc) // too far
+       if (*i->score_column_l_ > *sccol_l) // too far
            break;
            break;
-       if (sc == i->score_column_l_)
+       if (sccol_l == i->score_column_l_)
            return i;
     }
 
     /* post: *sc > *->score_column_l_ || !i.ok() */
            return i;
     }
 
     /* post: *sc > *->score_column_l_ || !i.ok() */
-    Staff_column* newst = create_col(sc);
+    Staff_column* newst = create_col(sccol_l);
 
     if (!i.ok()) {
        cols.bottom().add(newst);
 
     if (!i.ok()) {
        cols.bottom().add(newst);
@@ -121,8 +121,8 @@ Staff::get_marks(Array<String>&s_arr, Array<Moment>&m_arr)
        for (iter_top(i->elts,j); j.ok(); j++) {
            for (iter_top(j->reqs, k); k.ok(); k++) {
                if (k->mark()) { // ugh. 4 levels
        for (iter_top(i->elts,j); j.ok(); j++) {
            for (iter_top(j->reqs, k); k.ok(); k++) {
                if (k->mark()) { // ugh. 4 levels
-                   s_arr.add(k->mark()->mark_str_);
-                   m_arr.add(now);
+                   s_arr.push(k->mark()->mark_str_);
+                   m_arr.push(now);
                }
            }
            now += j->duration;     
                }
            }
            now += j->duration;     
@@ -176,6 +176,15 @@ Staff::OK() const
 #ifndef NDEBUG
     cols.OK();
     voices.OK();
 #ifndef NDEBUG
     cols.OK();
     voices.OK();
+    iter_top(cols, i);
+    iter_top(cols, j);
+    i++;
+    for (; i.ok(); j++,i++) {
+       if ( j->when() == i->when())
+           assert(!j->mus() && i->mus());
+       else
+           assert(j->when () < i->when() );
+    }
     assert(score_l_);
 #endif    
 }
     assert(score_l_);
 #endif    
 }
index 82286bd7d64b4d6ab3da21f1f82fb700fbd638a2..d1bbc45c42812a7d87feb283cb7afd1aa1c09220 100644 (file)
@@ -156,14 +156,14 @@ Staff_commands_at::add(Command c)
            { /* every line a currentkey. */
                Command kc;
                kc.code =TYPESET;
            { /* every line a currentkey. */
                Command kc;
                kc.code =TYPESET;
-               kc.args.add( "CURRENTKEY");
+               kc.args.push( "CURRENTKEY");
                kc.priority = 60;
                add(kc);
            }
            { /* every line a currentclef. */
                Command kc;
                kc.code =TYPESET;
                kc.priority = 60;
                add(kc);
            }
            { /* every line a currentclef. */
                Command kc;
                kc.code =TYPESET;
-               kc.args.add( "CURRENTCLEF");
+               kc.args.push( "CURRENTCLEF");
                kc.priority = 80;
                add(kc);
            }
                kc.priority = 80;
                add(kc);
            }
index 4be3cee0bf16f40e6a788db459f1febefdd7c64b..0ef190020378e26a362c0083c7ca4482c13676fc 100644 (file)
@@ -3,6 +3,7 @@
 #include "pstaff.hh"
 #include "molecule.hh"
 #include "staffelem.hh"
 #include "pstaff.hh"
 #include "molecule.hh"
 #include "staffelem.hh"
+#include "debug.hh"
 
 String
 Staff_elem::TeXstring() const
 
 String
 Staff_elem::TeXstring() const
@@ -73,11 +74,17 @@ void
 Staff_elem::print()const
 {
 #ifndef NPRINT
 Staff_elem::print()const
 {
 #ifndef NPRINT
+    mtor << name() << "{\n";
+    do_print();
     if (output)
        output->print();
     if (output)
        output->print();
+    
+    mtor <<  "}\n";
 #endif
 }
 
 #endif
 }
 
+NAME_METHOD(Staff_elem);
+
 Staff_elem::Staff_elem()
 {
     calc_children = false;
 Staff_elem::Staff_elem()
 {
     calc_children = false;
index 5967242dbb41ccda95b549ced8e1bc4aa662fa27..3bf94ceabaebfc63b8a2a97dd749244f51c8b640 100644 (file)
@@ -13,8 +13,8 @@ Staff_walker::Staff_walker(Staff_walker const &s)
 Staff_walker::Staff_walker(Staff * s, PScore*ps )
     : PCursor<Staff_column*> (s->cols)
 {
 Staff_walker::Staff_walker(Staff * s, PScore*ps )
     : PCursor<Staff_column*> (s->cols)
 {
-    staff_ = s;
-    pscore_ = ps;
+    staff_l_ = s;
+    pscore_l_ = ps;
     break_status = BREAK_END - BREAK_PRE;
 }
 
     break_status = BREAK_END - BREAK_PRE;
 }
 
@@ -28,12 +28,13 @@ void
 Staff_walker::process()
 {
     break_status = BREAK_END - BREAK_PRE;
 Staff_walker::process()
 {
     break_status = BREAK_END - BREAK_PRE;
-    if (ptr()->staff_commands_p_)
+
+    if (ptr()->mus()) {
+       process_requests();
+    } else if (ptr()->staff_commands_p_)
        for (iter_top(*ptr()->staff_commands_p_,i); i.ok(); i++) {
            process_command(i);
     }
        for (iter_top(*ptr()->staff_commands_p_,i); i.ok(); i++) {
            process_command(i);
     }
-
-    process_requests();
 }
 
 
 }
 
 
@@ -64,6 +65,7 @@ Staff_walker::process_command(Command*com)
 void
 Staff_walker::operator++(int i)
 {
 void
 Staff_walker::operator++(int i)
 {
+    do_pre_move();
     PCursor<Staff_column*>::operator++(i);
     PCursor<Staff_column*>::operator++(i);
-    reset();
+    do_post_move();
 }
 }
index 9d070aa4cca57d21a414e06672b96f706ac55299..89a572408a621779b6b7be9eaeb80e2956238c3d 100644 (file)
@@ -35,7 +35,7 @@ Staff_column::add(Voice_element*ve)
        score_column_l_->add_duration(d);
     }
        
        score_column_l_->add_duration(d);
     }
        
-    v_elts.add(ve);
+    v_elts.push(ve);
 }
 
 Staff_column::Staff_column(Score_column *s_l)
 }
 
 Staff_column::Staff_column(Score_column *s_l)
index 85c4c15e2bd5511791a5c0012bf00db84b82cf24..2e602c1cae78974d0352ddfa5daba5c9fc6c9e76 100644 (file)
@@ -9,10 +9,10 @@
 #include "misc.hh"
 
 const int STEMLEN=7;
 #include "misc.hh"
 
 const int STEMLEN=7;
-
-Stem::Stem(int c, Moment len)
+NAME_METHOD(Stem);
+Stem::Stem(int c) //, Moment len)
 {
 {
-    note_length = len;
+//    note_length = len;
     beams_left = 0;
     beams_right = 0;
     minnote = 1000;            // invalid values
     beams_left = 0;
     beams_right = 0;
     minnote = 1000;            // invalid values
@@ -27,16 +27,11 @@ Stem::Stem(int c, Moment len)
 }
 
 void
 }
 
 void
-Stem::print() const
+Stem::do_print() const
 {
 #ifndef NPRINT
 {
 #ifndef NPRINT
-    mtor << "{\n";
     mtor << "flag "<< flag << " print_flag " << print_flag
         << "min,max [" << minnote << ", " << maxnote << "]";
     mtor << "flag "<< flag << " print_flag " << print_flag
         << "min,max [" << minnote << ", " << maxnote << "]";
-       
-
-    Item::print();
-    mtor << "}\n";
 #endif
 }
 void
 #endif
 }
 void
@@ -63,8 +58,8 @@ Stem::add(Notehead *n)
        minnote = p;
     if ( p> maxnote)
        maxnote = p;
        minnote = p;
     if ( p> maxnote)
        maxnote = p;
-    heads.add(n);
-    n->dependencies.add(this);
+    heads.push(n);
+    n->dependencies.push(this);
 }
 
 
 }
 
 
diff --git a/src/template6.cc b/src/template6.cc
new file mode 100644 (file)
index 0000000..c3867ae
--- /dev/null
@@ -0,0 +1,7 @@
+#include "register.hh"
+#include "voicegroup.hh"
+
+#include "pcursor.tcc"
+#include "plist.tcc"
+
+IPL_instantiate(Voice_registers);
index 9a10c993ea023da5ff030dfd3dd93d6882e84cc3..1a5c4a08c57d7b815e327edc08216129834e7942 100644 (file)
@@ -36,7 +36,7 @@ substitute_args(String source, Array<Scalar> args)
 {
     Array<String> sv;
     for (int i = 0 ; i < args.size(); i++)
 {
     Array<String> sv;
     for (int i = 0 ; i < args.size(); i++)
-       sv.add(args[i]);
+       sv.push(args[i]);
     
     return substitute_args(source, sv);
 }
     
     return substitute_args(source, sv);
 }
index bded0d7751661cce243332489b5783aeda5659b7..4c59ce3263aaa906373b9739449ffd91c8af18d3 100644 (file)
@@ -19,8 +19,8 @@ Lookup::beam_element(int sidx, int widx, Real slope)
     Symbol bs=(*symtables_)("beamslopes")->lookup("slope");
     
     Array<String> args;
     Symbol bs=(*symtables_)("beamslopes")->lookup("slope");
     
     Array<String> args;
-    args.add(sidx);
-    args.add(widx);
+    args.push(sidx);
+    args.push(widx);
     bs.tex = substitute_args(bs.tex,args);
     int w = 2 << widx;
     Real width = convert_dimen(w,"pt");
     bs.tex = substitute_args(bs.tex,args);
     int w = 2 << widx;
     Real width = convert_dimen(w,"pt");
@@ -52,8 +52,8 @@ Lookup::rule_symbol(Real height, Real width)
 {
     Symbol bs=(*symtables_)("beamslopes")->lookup("horizontal");    
     Array<String> args;
 {
     Symbol bs=(*symtables_)("beamslopes")->lookup("horizontal");    
     Array<String> args;
-    args.add(print_dimen(height));
-    args.add(print_dimen(width));
+    args.push(print_dimen(height));
+    args.push(print_dimen(width));
     bs.tex = substitute_args(bs.tex,args);
     bs.dim.x = Interval(0,width);
     bs.dim.y = Interval(0,height);
     bs.tex = substitute_args(bs.tex,args);
     bs.dim.x = Interval(0,width);
     bs.dim.y = Interval(0,height);
index 8be0d378cce2144fc1bac569b2a8367922bdc2ed..13790d740e51eed555e9ae60e613d607afa1ea08 100644 (file)
@@ -5,6 +5,8 @@
 #include "molecule.hh"
 #include "lookup.hh"
 
 #include "molecule.hh"
 #include "lookup.hh"
 
+NAME_METHOD(Text_item);
+
 Text_item::Text_item(Text_req* treq_l, int staffsize_i)
 {
     staffsize_i_ = staffsize_i;
 Text_item::Text_item(Text_req* treq_l, int staffsize_i)
 {
     staffsize_i_ = staffsize_i;
index 86eac612cb08660b3c811d622d48385b0c15f47b..d4de8fb824465722b5c672a71952a54926ccfa57 100644 (file)
@@ -4,10 +4,23 @@
 #include "textdef.hh"
 #include "debug.hh"
 
 #include "textdef.hh"
 #include "debug.hh"
 
-Text_spanner::Text_spanner(Directional_spanner*d)
+NAME_METHOD(Text_spanner);
+
+void
+Text_spanner::set_support(Directional_spanner*d)
 {
     support = d;
 {
     support = d;
-    dependencies.add(d);
+    dependencies.push(d);
+}    
+Text_spanner::Text_spanner()
+{
+    support = 0;
+}
+
+void
+Text_spanner::do_print() const
+{
+    spec.print();
 }
 
 void
 }
 
 void
@@ -35,14 +48,6 @@ Text_spanner::brew_molecule_p() const
     return output;
 }
 
     return output;
 }
 
-void
-Text_spanner::print() const    // todo
-{
-#ifndef NDEBUG
-    mtor << "Text_spanner\n";
-#endif
-}
-
 void
 Text_spanner::do_pre_processing()
 {
 void
 Text_spanner::do_pre_processing()
 {
@@ -60,5 +65,5 @@ Text_spanner::height()const
 Spanner*
 Text_spanner::do_break_at(PCol*c1, PCol*c2)const
 {
 Spanner*
 Text_spanner::do_break_at(PCol*c1, PCol*c2)const
 {
-    return new Text_spanner(*this);    
+    return new Text_spanner(*this); // todo
 }
 }
index 334d1b4a5f6b5c2bce0adc89ac4a11eca5a71258..818e723b42972b35a11c5a42c588c7dacfbc25d3 100644 (file)
@@ -18,7 +18,7 @@ Voice::Voice()
 void
 Voice::add(Voice_element*v)
 {
 void
 Voice::add(Voice_element*v)
 {
-    v->voice_ = this;
+    v->voice_l_ = this;
     elts.bottom().add(v);
 }
 
     elts.bottom().add(v);
 }
 
@@ -59,9 +59,10 @@ void
 Voice_element::add(Request*r)
 {
     if (r->rhythmic()) {
 Voice_element::add(Request*r)
 {
     if (r->rhythmic()) {
-       assert (!duration);         
+       assert (!duration  || duration == r->duration());           
        duration = r->duration();
     }
        duration = r->duration();
     }
+    
     r->elt_l_ = this;
     reqs.bottom().add(r);
 }
     r->elt_l_ = this;
     reqs.bottom().add(r);
 }
@@ -69,15 +70,15 @@ Voice_element::add(Request*r)
 
 Voice_element::Voice_element()
 {
 
 Voice_element::Voice_element()
 {
-    voice_ = 0;
-    group = 0;
+    voice_l_ = 0;
+//    group = 0;
     duration = 0.0;
 }
 
 Voice_element::Voice_element(Voice_element const&src)
 {
     duration = 0.0;
 }
 
 Voice_element::Voice_element(Voice_element const&src)
 {
-    voice_=src.voice_;
+    voice_l_=0;
     for (iter_top(src.reqs, i); i.ok(); i++)
        add(i->clone());
     for (iter_top(src.reqs, i); i.ok(); i++)
        add(i->clone());
-    group=src.group;
+//    group=src.group;
 }
 }
diff --git a/src/voicegroup.cc b/src/voicegroup.cc
new file mode 100644 (file)
index 0000000..5dfe5a8
--- /dev/null
@@ -0,0 +1,60 @@
+#include "request.hh"
+#include "complexwalker.hh"
+#include "complexstaff.hh"
+#include "voicegroup.hh"
+#include "register.hh"
+
+Voice_group_registers::Voice_group_registers(Complex_walker*w_l)
+    : //text_reg_(w_l),
+      stem_beam_reg_(w_l)
+//,      script_reg_(w_l),
+      //    stem_reg_(w_l)
+{
+    walk_l_ = w_l;
+}
+
+void
+Voice_group_registers::pre_move_processing()
+{
+    stem_beam_reg_.pre_move_processing();
+//    script_reg_.pre_move_processing();
+//    text_reg_.pre_move_processing();  
+}
+void
+Voice_group_registers::post_move_processing()
+{
+    stem_beam_reg_.post_move_processing();
+}
+bool
+Voice_group_registers::try_request(Request*r_l)
+{
+    bool b = stem_beam_reg_.try_request(r_l);
+/*    if (!b)
+       b|= beam_reg_.try_request(r_l);
+    if (!b)
+       b|= script_reg_.try_request(r_l);
+    if (!b)
+       b|=  text_reg_.try_request(r_l);
+       */
+    return b;
+}
+    
+void
+Voice_group_registers::announce_element(Staff_elem_info i)
+{
+/*
+  if (i.group_regs_l_!= this)
+       return;
+       */
+    stem_beam_reg_.acknowledge_element(i);
+//    text_reg_.announce_element(i);
+    //  script_reg_.announce_element(i);
+}
+
+
+void
+Voice_group_registers::process_requests()
+{
+    stem_beam_reg_.process_request();
+}
+
diff --git a/src/voiceregs.cc b/src/voiceregs.cc
new file mode 100644 (file)
index 0000000..b13fd01
--- /dev/null
@@ -0,0 +1,169 @@
+#include "rest.hh"
+#include "notehead.hh"
+#include "paper.hh"
+#include "debug.hh"
+#include "slur.hh"
+#include "request.hh"
+#include "complexwalker.hh"
+#include "complexstaff.hh"
+#include "voicegroup.hh"
+#include "register.hh"
+
+Voice_registers::Voice_registers(Complex_walker*c_l, Voice *v_p)
+    : head_reg_(c_l), slur_reg_(c_l)
+{
+    voice_l_ = v_p;
+}
+
+bool
+Voice_registers::try_request(Request * r_l)
+{
+    bool b = head_reg_.try_request(r_l);
+    if (!b)
+       b = slur_reg_.try_request(r_l);
+    return b;
+}
+
+void
+Voice_registers::announce_element(Staff_elem_info i)
+{
+    if (i.voice_l_ != voice_l_)
+       return;
+    if (i.origin_reg_l_ != &slur_reg_)
+       slur_reg_.acknowledge_element(i);
+}
+
+void
+Voice_registers::pre_move_processing()
+{
+    head_reg_.pre_move_processing();
+    slur_reg_.pre_move_processing();
+}
+void
+Voice_registers::post_move_processing()
+{
+    head_reg_.post_move_processing();
+    slur_reg_.post_move_processing();
+}
+
+void
+Voice_registers::process_requests()
+{
+    head_reg_.process_request();
+    slur_reg_.process_request();
+}
+
+/****************/
+
+Notehead_register::Notehead_register(Complex_walker*w_l)
+    :Request_register(w_l)
+{
+    note_l_ = 0;
+}
+
+bool
+Notehead_register::try_request(Request *req_l) 
+{
+    if (req_l->note() || req_l->rest())
+       accepted_req_arr_.push(req_l);
+    else
+       return false;
+
+    return true;
+}
+
+void
+Notehead_register::process_request()
+{
+    Request* req_l = accepted_req_arr_.last();
+    if (req_l->note()) {
+       Notehead*n_p = new Notehead(8); // ugh
+       note_l_ = n_p;
+       n_p->set_rhythmic(req_l->rhythmic());
+       n_p->position = req_l->note()->height() + -2;
+    } else {
+       note_l_ = new Rest ( req_l->rhythmic()->balltype,
+                            req_l->rhythmic()->dots);
+       if (req_l->rhythmic()->balltype <= 2)
+           note_l_->translate(
+               Offset(0,
+                      5 * walk_l_->staff()->paper()->internote()));
+    }
+    Staff_elem_info itinf(note_l_,req_l,this);
+    walk_l_->announce_element(itinf);
+}
+
+void
+Notehead_register::do_pre_move_process()
+{
+    if (note_l_) {
+       walk_l_->typeset_element(note_l_);
+       note_l_ = 0;
+    }
+}
+
+/****************/
+/****************/
+
+Slur_register::Slur_register(Complex_walker* w)
+    : Request_register(w)
+{
+}
+
+bool
+Slur_register::try_request(Request *req_l)
+{
+    if(!req_l->slur())
+       return false;
+
+    accepted_req_arr_.push(req_l);
+    return true;
+}
+
+void
+Slur_register::acknowledge_element(Staff_elem_info info)
+{
+    if (info.elem_p_->name() == String("Notehead")) { 
+       Notehead *head_p =(Notehead*) info.elem_p_ ;// ugh
+       for (int i = 0; i < slur_l_stack_.size(); i++)
+           slur_l_stack_[i]->add(head_p );
+       for (int i = 0; i < end_slur_l_arr_.size(); i++)
+           end_slur_l_arr_[i]->add(head_p);
+    }
+}
+
+void
+Slur_register::process_request()
+{
+    Array<Slur*> start_slur_l_arr_;
+    for (int i=0; i< accepted_req_arr_.size(); i++) {
+       Slur_req* slur_req_l = accepted_req_arr_[i]->slur();
+       if (slur_req_l->spantype == Span_req::STOP) {
+           if (slur_l_stack_.empty())
+               error_t("can't find slur to end; ", 
+                       *walk_l_->col()->tdescription_);
+           end_slur_l_arr_.push(slur_l_stack_.pop());
+           
+       } else  if (slur_req_l->spantype == Span_req::START) {
+           Slur * s_p =new Slur;
+           start_slur_l_arr_.push(s_p);
+           walk_l_->announce_element(Staff_elem_info(s_p, slur_req_l, this));
+       }
+    }
+    for (int i=0; i < start_slur_l_arr_.size(); i++)
+       slur_l_stack_.push(start_slur_l_arr_[i]);
+}
+
+void
+Slur_register::do_pre_move_process()
+{
+    for (int i = 0; i < end_slur_l_arr_.size(); i++)
+       walk_l_->typeset_element(end_slur_l_arr_[i]);
+    end_slur_l_arr_.set_size(0);
+}
+
+Slur_register::~Slur_register()
+{
+    if (slur_l_stack_.size())
+       error("unterminated slur");
+}
index 87f7152e41f9b72543e31663c7a1d3ad66b3b3af..b44471201b59f757618200024b29f20be94e6d59 100644 (file)
@@ -5,13 +5,13 @@
 
 ostream &warnout (cerr);
 ostream *mlog(&cerr);
 
 ostream &warnout (cerr);
 ostream *mlog(&cerr);
-
+/*
 void
 warning(String s)
 {
     WARN << s;
 }
 void
 warning(String s)
 {
     WARN << s;
 }
-
+*/
 
 void
 error(String s)
 
 void
 error(String s)
index d0bfd5b74fd907c336105e179b1bc2fe32840fc6..e390500d82ee80eb6a795b9faa745740d34bcbb0 100644 (file)
@@ -59,7 +59,7 @@ Word_wrap::solve()
            i++;
        }
        mtor << "Adding cols~, next breakpoint " << i << '\n';
            i++;
        }
        mtor << "Adding cols~, next breakpoint " << i << '\n';
-       breaking.add(minimum);
+       breaking.push(minimum);
     }
     
     return breaking;
     }
     
     return breaking;