]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 0.0.65 release/0.0.65
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 26 May 1997 09:57:09 +0000 (11:57 +0200)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 26 May 1997 09:57:09 +0000 (11:57 +0200)
296 files changed:
.version
AUTHORS.text
Documentation/AUTHORS.pod
Documentation/INSTALL.pod
Documentation/faq.pod
Documentation/gnu-music.pod
Documentation/lilygut.pod
Documentation/lilyliterature.pod
Documentation/lilypond.pod
INSTALL.text
NEWS
README
TODO
bin/clearlily
bin/genheader
bin/make_website
configure
configure.in
flower/.version
flower/NEWS
flower/directed-graph.cc [new file with mode: 0644]
flower/include/class-name.hh [deleted file]
flower/include/directed-graph.hh [new file with mode: 0644]
flower/include/fproto.hh
flower/include/interval.hh
flower/include/interval.tcc
flower/include/matrix-storage.hh
flower/include/matrix.hh
flower/include/parray.hh
flower/include/path.hh
flower/include/plist.hh
flower/include/plist.tcc
flower/include/virtual-methods.hh [new file with mode: 0644]
flower/interval.cc
flower/path.cc
flower/string-convert.cc
init/register.ini
init/table_sixteen.ini
input/collisions.ly
input/keys.ly
input/rhythm.ly
input/wohltemperirt.ly
lib/duration-convert.cc
lib/include/proto.hh
lib/include/source.hh
lib/source.cc
lily/.version
lily/Makefile
lily/Stable.make
lily/bar-reg.cc
lily/bar.cc
lily/beam.cc
lily/bow.cc
lily/break.cc
lily/calcideal.cc
lily/clef-item.cc
lily/clef-reg.cc
lily/collision-reg.cc
lily/collision.cc
lily/command-request.cc
lily/complex-staff.cc [deleted file]
lily/complex-walker.cc
lily/crescendo.cc
lily/dimen.cc
lily/dynamic-reg.cc
lily/elem-group.cc [new file with mode: 0644]
lily/global-regs.cc
lily/grouping.cc
lily/head-reg.cc
lily/idealspacing.cc
lily/identifier.cc
lily/include/bar-reg.hh
lily/include/bar.hh
lily/include/beam.hh
lily/include/bow.hh
lily/include/break.hh
lily/include/clef-reg.hh
lily/include/colhpos.hh
lily/include/collision-reg.hh
lily/include/collision.hh
lily/include/command-request.hh
lily/include/complex-staff.hh [deleted file]
lily/include/complex-walker.hh
lily/include/crescendo.hh
lily/include/debug.hh
lily/include/directional-spanner.hh
lily/include/dynamic-reg.hh
lily/include/elem-group.hh [new file with mode: 0644]
lily/include/glob.hh
lily/include/grouping.hh
lily/include/head-reg.hh
lily/include/idealspacing.hh
lily/include/identifier.hh
lily/include/identparent.hh [deleted file]
lily/include/input-music.hh
lily/include/input-register.hh
lily/include/input-score.hh
lily/include/input-staff.hh
lily/include/item.hh
lily/include/key-item.hh
lily/include/key-reg.hh
lily/include/keyword.hh
lily/include/leastsquares.hh
lily/include/lily-proto.hh
lily/include/linespace.hh
lily/include/local-key-item.hh
lily/include/local-key-reg.hh
lily/include/lookup.hh
lily/include/lyric-register.hh
lily/include/main.hh
lily/include/meter-reg.hh
lily/include/midi-def.hh
lily/include/midi-item.hh
lily/include/midi-output.hh
lily/include/midi-stream.hh
lily/include/midi-walker.hh
lily/include/misc.hh
lily/include/molecule.hh
lily/include/musical-request.hh
lily/include/my-lily-lexer.hh
lily/include/my-lily-parser.hh
lily/include/note-column-reg.hh
lily/include/note-column.hh
lily/include/note-head.hh [new file with mode: 0644]
lily/include/notehead.hh [deleted file]
lily/include/notename-table.hh
lily/include/notename.hh
lily/include/offset.hh
lily/include/p-col.hh
lily/include/p-score.hh
lily/include/p-staff.hh [deleted file]
lily/include/paper-def.hh
lily/include/parseconstruct.hh
lily/include/pulk-voice.hh
lily/include/pulk-voices.hh
lily/include/qlp.hh
lily/include/qlpsolve.hh
lily/include/register-group.hh
lily/include/register.hh
lily/include/reqtodo.hh [deleted file]
lily/include/request-column.hh
lily/include/request.hh
lily/include/rest-collision-reg.hh
lily/include/rest-collision.hh
lily/include/rest-column.hh
lily/include/score-column.hh
lily/include/score-elem-info.hh [new file with mode: 0644]
lily/include/score-elem.hh [new file with mode: 0644]
lily/include/score-walker.hh
lily/include/score.hh
lily/include/scoreline.hh
lily/include/script-column.hh
lily/include/script-def.hh
lily/include/script-reg.hh
lily/include/script.hh
lily/include/slur.hh
lily/include/spanner-elem-group.hh [new file with mode: 0644]
lily/include/spanner.hh
lily/include/staff-elem-info.hh [deleted file]
lily/include/staff-elem.hh [deleted file]
lily/include/staff-info.hh
lily/include/staff-regs.hh
lily/include/staff-side.hh
lily/include/staff-sym-reg.hh
lily/include/staff-sym.hh
lily/include/staff-walker.hh
lily/include/staff.hh
lily/include/staffeleminfo.hh
lily/include/staffline.hh
lily/include/stem-beam-reg.hh
lily/include/stem.hh
lily/include/super-elem.hh [new file with mode: 0644]
lily/include/swallow-reg.hh
lily/include/symbol.hh
lily/include/tex.hh
lily/include/text-def.hh
lily/include/text-item.hh
lily/include/text-reg.hh
lily/include/text-spanner.hh
lily/include/tie-reg.hh
lily/include/tie.hh
lily/include/time-description.hh
lily/include/vertical-brace.hh [deleted file]
lily/include/vertical-spanner.hh [deleted file]
lily/include/voice-element.hh
lily/include/voice-group-regs.hh
lily/include/voice-regs.hh
lily/include/voice.hh
lily/include/walk-regs.hh
lily/input-register.cc
lily/input-score.cc
lily/input-staff.cc
lily/item.cc
lily/key-item.cc
lily/key-reg.cc
lily/key.cc
lily/lexer.l
lily/lexerinit.cc
lily/local-key-item.cc
lily/local-key-reg.cc
lily/lookup.cc
lily/lyric-register.cc
lily/main.cc
lily/meter-reg.cc
lily/midi-def.cc
lily/midi-item.cc
lily/midi-output.cc
lily/midi-stream.cc
lily/midi-walker.cc
lily/molecule.cc
lily/musical-request.cc
lily/my-lily-lexer.cc
lily/my-lily-parser.cc
lily/note-column-reg.cc
lily/note-column.cc
lily/notehead.cc
lily/notename-table.cc
lily/p-col.cc
lily/p-score.cc
lily/p-staff.cc [deleted file]
lily/paper-def.cc
lily/parser.y
lily/pulk-voice.cc
lily/pulk-voices.cc
lily/qlpsolve.cc
lily/register-group.cc
lily/register.cc
lily/request-column.cc
lily/rest-collision-reg.cc
lily/rest-collision.cc
lily/rest-column.cc
lily/score-column.cc
lily/score-elem-info.cc [new file with mode: 0644]
lily/score-elem.cc [new file with mode: 0644]
lily/score-walker.cc
lily/score.cc
lily/scoreline.cc
lily/script-column.cc
lily/script.cc
lily/slur.cc
lily/spanner-elem-group.cc [new file with mode: 0644]
lily/spanner.cc
lily/staff-column.cc
lily/staff-elem-info.cc [deleted file]
lily/staff-elem.cc [deleted file]
lily/staff-info.cc
lily/staff-regs.cc
lily/staff-side.cc
lily/staff-sym-reg.cc
lily/staff-sym.cc
lily/staff-walker.cc
lily/staff.cc
lily/staffline.cc
lily/stem-beam-reg.cc
lily/stem.cc
lily/super-elem.cc [new file with mode: 0644]
lily/swallow-reg.cc
lily/symtable.cc
lily/template1.cc
lily/template2.cc
lily/template4.cc
lily/template7.cc
lily/tex-beam.cc
lily/tex-slur.cc
lily/tex-stream.cc
lily/tex.cc
lily/text-item.cc
lily/text-spanner.cc
lily/tie-reg.cc
lily/tie.cc
lily/time-description.cc
lily/vertical-brace.cc [deleted file]
lily/vertical-spanner.cc [deleted file]
lily/voice-element.cc
lily/voice-group-regs.cc
lily/voice-regs.cc
lily/voice.cc
lily/walk-regs.cc
lily/warn.cc
lily/wordwrap.cc
make/Targets.make
make/lilypond.lsm
make/lilypond.spec
make/lilypond.spec.in
mi2mu/.version
mi2mu/Makefile
mi2mu/TODO [new file with mode: 0644]
mi2mu/include/mi2mu-proto.hh [new file with mode: 0644]
mi2mu/include/mi2mu.hh
mi2mu/main.cc
mi2mu/midi-event.cc
mi2mu/midi-lexer.l
mi2mu/midi-parser.y
mi2mu/midi-score.cc
mi2mu/midi-track.cc
mi2mu/template.cc

index 461533285952612b71ef4a470bbfd0606c1e1491..fa58dc3090eb878dd5e554cf271f91e53b5c2303 100644 (file)
--- a/.version
+++ b/.version
@@ -1,7 +1,7 @@
 TOPLEVEL_MAJOR_VERSION = 0
 TOPLEVEL_MINOR_VERSION = 0
-TOPLEVEL_PATCH_LEVEL = 64
+TOPLEVEL_PATCH_LEVEL = 65
 # use to send patches, always empty for released version:
 # include separator: ".postfix", "-pl" makes rpm barf
 
-TOPLEVEL_MY_PATCH_LEVEL = 
+TOPLEVEL_MY_PATCH_LEVEL =
index f1f13beaa932a5232ddaa0b1242a3e3d6f17696b..e516153369b9fc762a4f4f9c78fb943877416978 100644 (file)
@@ -5,11 +5,13 @@ AUTHORS(1)            LilyPond documentation           AUTHORS(1)
 
 
 N\bN\bN\bNA\bA\bA\bAM\bM\bM\bME\bE\bE\bE
-       AUTHORS - who did what on LilyPond?
+       AUTHORS - who did what on GNU LilyPond?
 
 D\bD\bD\bDE\bE\bE\bES\bS\bS\bSC\bC\bC\bCR\bR\bR\bRI\bI\bI\bIP\bP\bP\bPT\bT\bT\bTI\bI\bI\bIO\bO\bO\bON\bN\bN\bN
-       This file lists authors of LilyPond, and what they wrote.
+       This file lists authors of GNU LilyPond, and what they
+       wrote.
 
+A\bA\bA\bAU\bU\bU\bUT\bT\bT\bTH\bH\bH\bHO\bO\bO\bOR\bR\bR\bRS\bS\bS\bS
        +\bo   Han-Wen Nienhuys <hanwen@stack.nl>
 
            Main author, all files files except mentioned below
@@ -17,15 +19,18 @@ D\bD\bD\bDE\bE\bE\bES\bS\bS\bSC\bC\bC\bCR\bR\bR\bRI\bI\bI\bIP\bP\bP\bPT\bT\bT\bTI\bI\bI\bIO\bO\bO\bON\bN\bN\bN
        +\bo   Jan Nieuwenhuizen <jan@digicash.com>
 
            lily/midi-*, mi2mu/*, parts flower/string*.cc,
-           make/*.make, parts of Documentation/mudela.pod,
-           lib/*source-file*, lib/duration.cc, lib/source,
-           flower/*{list,cursor}*,
+           make/*.make, */Makefile parts of
+           Documentation/mudela.pod, lib/*source-file*,
+           lib/duration.cc, lib/source, flower/*{list,cursor}*,
 
            and corresponding header files.
 
+C\bC\bC\bCO\bO\bO\bON\bN\bN\bNT\bT\bT\bTR\bR\bR\bRI\bI\bI\bIB\bB\bB\bBU\bU\bU\bUT\bT\bT\bTO\bO\bO\bOR\bR\bR\bRS\bS\bS\bS
        +\bo   Mats Bengtsson <matsb@s3.kth.se>, parts of clef-
            reg.cc, clef-item.cc testing, general comments.
 
+       +\bo   Werner Lemberg <xlwy01@uxp1.hrz.uni-dortmund.de>, misc
+           bugfixes.
 
 
 
@@ -56,11 +61,6 @@ D\bD\bD\bDE\bE\bE\bES\bS\bS\bSC\bC\bC\bCR\bR\bR\bRI\bI\bI\bIP\bP\bP\bPT\bT\bT\bTI\bI\bI\bIO\bO\bO\bON\bN\bN\bN
 
 
 
-
-
-
-
-
-6/May/97                 LilyPond 0.0.62                        1
+19/May/97                LilyPond 0.0.65                        1
 
 
index c7bc53d52d31b364ca1e0096cf30dca5dcd2aeac..7f343d780efc5794080b04b1e814c25e90a45db5 100644 (file)
@@ -1,10 +1,12 @@
 =head1 NAME
 
-AUTHORS - who did what on LilyPond?
+AUTHORS - who did what on GNU LilyPond?
 
 =head1 DESCRIPTION
 
-This file lists authors of LilyPond, and what they wrote.  
+This file lists authors of GNU LilyPond, and what they wrote.  
+
+=head1 AUTHORS
 
 =over 4
 
@@ -18,15 +20,26 @@ Main author, all files files except mentioned below
 
 Jan Nieuwenhuizen <jan@digicash.com>
 
-lily/midi-*, mi2mu/*, parts flower/string*.cc, make/*.make,
+lily/midi-*, mi2mu/*, parts flower/string*.cc, make/*.make, */Makefile
 parts of Documentation/mudela.pod, lib/*source-file*, lib/duration.cc,
 lib/source, flower/*{list,cursor}*,  
 
 and corresponding header files.
 
+=back
+
+=head1 CONTRIBUTORS
+
+=over 4
+
 =item *
 
 Mats Bengtsson <matsb@s3.kth.se>, parts of clef-reg.cc, clef-item.cc
 testing, general comments.
 
+=item *
+
+Werner Lemberg <xlwy01@uxp1.hrz.uni-dortmund.de>, misc bugfixes.
+
 =back
+
index ef26b32fd367f7903e7ae5519a837dc37974cafd..cd096c78181da68af09436df7cae0abf7dc9c8dd 100644 (file)
@@ -215,6 +215,35 @@ clef symbol has changed position in recent versions of MusixTeX)
 
 =back
 
+At this time, GNU LilyPond output looks nice, but is not of production
+quality. If you're not discouraged; this is what I type in my xterm:
+
+       lilypond someinput.ly
+       tex lelie.tex
+       xdvi test&
+
+This is what the output looks like over here:
+
+       hw:~/musix/spacer$ GNU LilyPond 0.0.60 #8/FlowerLib 1.1.14 #2
+       Parsing ... [./input/kortjakje.ly[lots of stuff]]
+       Setting up requests...Processing requests ...[8][16][24][25]
+       Preprocessing elements... 
+       Calculating column positions ... [3][7][12][16][20][25]
+       Postprocessing elements...
+       TeX output to lelie.tex ...
+
+       hw:~/musix/spacer$ tex lelie
+       This is TeX, Version 3.14159 (C version 6.1)
+       (lelie.tex
+       Hyphenation patterns for english, dutch, german, loaded.
+       (/home/hw/lib/texmf/tex/lilypond/lilyponddefs.tex) [1] )
+       Output written on lelie.dvi (1 page, 8944 bytes).
+       Transcript written on lelie.log.
+
+       hw:~/musix/spacer$ xdvi lelie&
+       [1] 855
+
+Check out the input files, some of them have comments
 Please refer to the man page for more information.
 
 =head1 REDHAT LINUX
index 87a162c9c69d10a3d0a2a7038384765778212925..395a411fa2b50040936d00777c3813dd0cc238cf 100644 (file)
@@ -120,6 +120,21 @@ A: The entry point is in main(). Good luck. :-)
 Seriously, read, reread and reread lilygut and CodingStyle, and
 just start anywhere. 
 
+Anywhere? Well, most of the comment doco are in the header files, so
+your best bet would be C<less lily/include/*.hh>. Some of the most
+important data-structures are to be found in:
+
+       - p-col.hh
+       - *request.hh
+       - register.hh
+       - score-elem.hh
+       - input-music.hh
+       - linespace.hh
+       - item.hh
+       - spanner.hh
+       - voice.hh
+
+
 Q: Why GPL?
 
 A: Yes.
index cdd1ea3b7040067f3fcd4fb38de1b177e43006f0..994dadac54fe2773bee0362da56b703a39dab53d 100644 (file)
@@ -21,37 +21,39 @@ and possibly for
        - arranging
        - performing
 
-Music publishers make lots of money out of selling which sheet music
-essentially free (composed by people long dead).  Publishers have two
-arguments for doing this: high prices are there to guarantee diversity
-(keeping lots of stock is expensive), and to encourage new work being
-composed. 
+Music publishers make lots of money out of selling sheet music which
+is in the public domain (the composers died a long time ago). It is
+usually prohibited to xerox the sheet music.  Publishers have two
+arguments for not allowing this: high prices are there to guarantee
+diversity (keeping lots of stock is expensive), and to encourage new
+work being composed.
 
 LilyPond addresses the first issue: storing mudelas takes up almost no
 space at all.  Other systems should address the other issue:
 encouraging laymen to take up composing, in the same way that GNU
 tools have created a whole new generation of programmers.
 
+The public deserves to get public domain music for free (zero cents). 
 
-The public deserves free non-copyrighted music. 
-
-The public deserves free tools for composing and printing
+The public deserves free tools for composing and printing.
 
 
 =head1 REQUIREMENTS
 
+Emacs and TeX serve as useful examples of what programs by the GMP
+should be.
+
 =over 4
 
 =item * high-quality 
 
-(cf Emacs), from engraving point of view
+(cf TeX), from engraving point of view
 
 =item * high-quality
 
-from software point of view: like all GNU software, it
+(cf Emacs) from software point of view: like all GNU software, it
 should have no limits, be fast, etc.
 
-
 =item * tweakable
 
 Printed music has a lot of styles, and special symbols. It may be
@@ -61,9 +63,9 @@ Emacs and TeX
 
 =item * easy to use. 
 
-That is, for technical users (that can read a
-manual). The learning curve should be as easy as possible but not at
-the expense of comfort of use.
+That is, for technical users (that can read a manual). The learning
+curve should be as easy as possible but not at the expense of comfort
+of use and power.
 
 =back
 
@@ -71,6 +73,13 @@ the expense of comfort of use.
 
 =over 4
 
+=item A set of music fonts
+
+Preferably in Metafont, suited to both screen display and use on paper
+
+The copyright heritage of Musixtex is unclear.
+
+
 =item A typesetting engine. 
 
 A system with rules on how to set properties of items to be printed
@@ -86,7 +95,7 @@ cooperate with the typesetting engine
 
 =item An ASCII language
 
-In development, LilyPond has a language. See over there for goals.
+In development, LilyPond has a language. (See over there for goals)
 Having an ASCII format which enables urtext, and easy sharing (via
 mail and news forums) encourages cooperation and exchange of music.
 
@@ -98,7 +107,8 @@ Maybe to be merged with the display system.
 
 The natural way to enter composed music is singing or playing it. The
 GMP should have module which can take keyboard input or microphone
-input and convert it to computer data. (the second one would be difficult)
+input and convert it to computer data. (microphone input would be
+difficult)
 
 =item sequencing
 
@@ -128,16 +138,20 @@ project: the Free Music Project.
 
 =item *
 
-A noninteractive typesetter, suited for batch jobs, and
-typesetting existing music. This would couple the  ASCII language, the
-printing engine and the typesetting engine
+A noninteractive typesetter, suited for batch jobs, and typesetting
+existing music. This would couple the ASCII language, the printing
+engine and the typesetting engine
 
 LilyPond is currently representing this section.
 
 =item *
 
-A GUI for composing. This would combine the display engine, the
-input system, the typesetting engine
+A GUI for composing. This would combine the display engine, the input
+system and the typesetting engine.
+
+=item *
+
+Libraries for reading, writing various audio/music/notation formats.
 
 =back
 
@@ -151,11 +165,11 @@ recognizing input.
 
 =item * 
 
-gather moderate number of test users and hackers
+Gather a  moderate number of test users and hackers
 
 =item *
 
-a website on GMP
+A website on GMP
 
 =item *
 
index 9bd3013c126428346217054cf333ae643cc45224..3278492c6b49d576ddd1b2abc5e058f2b1f72312 100644 (file)
@@ -62,11 +62,12 @@ natural form for processing music.
 =item Processing:
 
 Requests are processed and used to create elements (like balls, stems,
-slurs etc). This is done by a hierarchy of brokers, which swallow
-requests, broadcast them and couple different elements.
+slurs etc). This is done by a hierarchy of "brokers" (called
+Register), which swallow requests, broadcast them and couple different
+elements.
 
 In this step data-structures for the next steps are created and filled
-with data: PScore, PCol, PStaff
+with data: PScore, PCol.
 
 =item Preprocessing
 
@@ -75,8 +76,15 @@ Some dependencies are resolved, such as the direction of stems, beams,
 =item Calculation:
 
 This step uses structures which have names starting with 'P'.
-linebreaks and horizontal positions of PCols are determined. Line_of_*
-generated.
+linebreaks and horizontal positions of PCols are determined. 
+
+Through some magical interactions with Line_of_score and Super_elem
+(check out the source) the "lines" are produced. 
+
+All other spanners can figure across which lines they are spread. If
+applicable, they break themselves into pieces. After this, each piece
+works (or, if there are no pieces) the spanner throws out any
+dependencies which are in the wrong line.
 
 =item Postprocesing:
 
@@ -321,9 +329,9 @@ In music symbols depend on each other: the stems of a beam should
 point in the same direction as the beam itself, so the stems of a beam
 depend on the beam. In the same way do scripts depend on the direction
 of the stem. To reflect this, LilyPond has the notion of dependency. 
-It works in the same fashion that make uses to build programs: before
+It works in the same fashion that C<make> uses to build programs: before
 a stem is calculated, its dependencies (the beam) should be
-calculated. Before a slur is calculated, its dependencies (stems)
+calculated. Before a slur is calculated, its dependencies (stems, noteheads)
 should be calculated.
 
 =head1 BREAKING
index 5ca92764bb341ed09feff07742f4a6d9d3ecdab7..98f71e631e6940e334deccc9e2952d642df9b690 100644 (file)
@@ -5,6 +5,8 @@ Lily literature -- reading on music engraving
 =head1 DESCRIPTION
 
 A list of resources on music printing/writing and engraving.
+Please note that don't have access to most material (except a library
+copy of Chlapik)
 
 =head2 References
 
@@ -40,6 +42,10 @@ New York.
 [This is as close to the ``standard'' reference work for music notation issues
 as one is likely to get.]
 
+The University of Colorado Music Engraving page.
+http://www.cc.colorado.edu/cgi-bin/mfs/01/Dept/Musicpress/Welcome.html
+
+More on GNU Music: http://www.u-bordeaux.fr/~strandh
 
 =head2  Further reading
 
index dcbaab0d00a8c73189e7b06d7505560c35d11795..46b2fcc581c87ef6080b4c9e2dc37bb9557e24db 100644 (file)
@@ -148,36 +148,6 @@ coding C++
 
 =head1 EXAMPLES
 
-At this time, GNU LilyPond output looks nice, but is not of production
-quality. If you're not discouraged; this is what I type in my xterm:
-
-       lilypond someinput.ly
-       tex lelie.tex
-       xdvi test&
-
-This is what the output looks like over here:
-
-       hw:~/musix/spacer$ GNU LilyPond 0.0.60 #8/FlowerLib 1.1.14 #2
-       Parsing ... [./input/kortjakje.ly[lots of stuff]]
-       Setting up requests...Processing requests ...[8][16][24][25]
-       Preprocessing elements... 
-       Calculating column positions ... [3][7][12][16][20][25]
-       Postprocessing elements...
-       TeX output to lelie.tex ...
-
-       hw:~/musix/spacer$ tex lelie
-       This is TeX, Version 3.14159 (C version 6.1)
-       (lelie.tex
-       Hyphenation patterns for english, dutch, german, loaded.
-       (/home/hw/lib/texmf/tex/lilypond/lilyponddefs.tex) [1] )
-       Output written on lelie.dvi (1 page, 8944 bytes).
-       Transcript written on lelie.log.
-
-       hw:~/musix/spacer$ xdvi lelie&
-       [1] 855
-
-Check out the input files, some of them have comments
-
 
 =head1 PROBLEMS
 
@@ -212,14 +182,14 @@ trace is
          :
 
 Than it would help if you send a dump of the Interval and the Item
-(use: C<print *this> or use GNU LilyPond C<print()> methods).
+(use: C<print *this> or use LilyPond C<print()> methods).
 
 =back
 
-Bug reports should be directed to
+Bug reports should be directed to:
 bug-gnu-music@vuse.vanderbilt.edu. In any case, they should contain a
-description of the problem, an small input file which reproduces it
-(if applicable), lilypond version and a description of the platform.
+description of the problem, a small input file which reproduces it (if
+applicable), the lilypond version and a description of the platform.
 
 
 =head1 FILES
@@ -266,10 +236,9 @@ project. For more information on the GNU Music project,
 
 =item http://www.stack.nl/~hanwen/lilypond/index.html
 
-GNU LilyPond has her own webpage at
-This webpage contains
-the MIDI, GIF and PS files for some standard music files. It also has
-the complete LilyPond documentation
+GNU LilyPond has her own webpage.  This webpage contains the MIDI, GIF
+and PS files for some standard music files. It also has the complete
+LilyPond documentation
 
 
 =back
@@ -308,8 +277,12 @@ For discussions concerning the GNU Music project, to subscribe: send
 mail with subject "subscribe" to
 gnu-music-discuss-request@vuse.vanderbilt.edu,
 
+
 =back
 
+Announces of new versions will be sent to info-gnu-music and
+gnu-music-discuss.
+
 =head1  REMARKS
 
 GNU LilyPond has no connection with the music package Rosegarden, other
index 2db81c4b0ea41938c350c6a095c83d271c9c96c0..8de884cd9934f2d0a6781ada23bf9f54df593c31 100644 (file)
@@ -61,7 +61,7 @@ C\bC\bC\bCO\bO\bO\bON\bN\bN\bNF\bF\bF\bFI\bI\bI\bIG\bG\bG\bGU\bU\bU\bUR\bR\bR\bRI\bI\bI\bIN\bN\bN\bNG\bG\bG\bG a\b
 
 
 
-16/May/97                LilyPond 0.0.64                        1
+26/May/97                LilyPond 0.0.65                        1
 
 
 
@@ -127,7 +127,7 @@ INSTALL(1)            LilyPond documentation           INSTALL(1)
 
 
 
-16/May/97                LilyPond 0.0.64                        2
+26/May/97                LilyPond 0.0.65                        2
 
 
 
@@ -193,7 +193,7 @@ R\bR\bR\bRU\bU\bU\bUN\bN\bN\bNN\bN\bN\bNI\bI\bI\bIN\bN\bN\bNG\bG\bG\bG
 
 
 
-16/May/97                LilyPond 0.0.64                        3
+26/May/97                LilyPond 0.0.65                        3
 
 
 
@@ -215,6 +215,36 @@ INSTALL(1)            LilyPond documentation           INSTALL(1)
             T.59). Beware, the clef symbol has changed position
             in recent versions of MusixTeX)
 
+       At this time, GNU LilyPond output looks nice, but is not
+       of production quality. If you're not discouraged; this is
+       what I type in my xterm:
+
+               lilypond someinput.ly
+               tex lelie.tex
+               xdvi test&
+
+       This is what the output looks like over here:
+
+               hw:~/musix/spacer$ GNU LilyPond 0.0.60 #8/FlowerLib 1.1.14 #2
+               Parsing ... [./input/kortjakje.ly[lots of stuff]]
+               Setting up requests...Processing requests ...[8][16][24][25]
+               Preprocessing elements...
+               Calculating column positions ... [3][7][12][16][20][25]
+               Postprocessing elements...
+               TeX output to lelie.tex ...
+
+               hw:~/musix/spacer$ tex lelie
+               This is TeX, Version 3.14159 (C version 6.1)
+               (lelie.tex
+               Hyphenation patterns for english, dutch, german, loaded.
+               (/home/hw/lib/texmf/tex/lilypond/lilyponddefs.tex) [1] )
+               Output written on lelie.dvi (1 page, 8944 bytes).
+               Transcript written on lelie.log.
+
+               hw:~/musix/spacer$ xdvi lelie&
+               [1] 855
+
+       Check out the input files, some of them have comments
        Please refer to the man page for more information.
 
 R\bR\bR\bRE\bE\bE\bED\bD\bD\bDH\bH\bH\bHA\bA\bA\bAT\bT\bT\bT L\bL\bL\bLI\bI\bI\bIN\bN\bN\bNU\bU\bU\bUX\bX\bX\bX
@@ -226,6 +256,18 @@ R\bR\bR\bRE\bE\bE\bED\bD\bD\bDH\bH\bH\bHA\bA\bA\bAT\bT\bT\bT L\bL\bL\bLI\bI\bI\bIN\bN\bN\bNU\bU\bU\bUX\bX\bX\bX
 W\bW\bW\bWI\bI\bI\bIN\bN\bN\bND\bD\bD\bDO\bO\bO\bOZ\bZ\bZ\bZE\bE\bE\bE
        Windows NT:
 
+
+
+
+26/May/97                LilyPond 0.0.65                        4
+
+
+
+
+
+INSTALL(1)            LilyPond documentation           INSTALL(1)
+
+
        you need the cygnus win32 gnu port development stuff; have
        a look at http://www.cygnus.com/gnu-win32.
 
@@ -259,6 +301,30 @@ A\bA\bA\bAU\bU\bU\bUT\bT\bT\bTH\bH\bH\bHO\bO\bO\bOR\bR\bR\bRS\bS\bS\bS
 
 
 
-16/May/97                LilyPond 0.0.64                        4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+26/May/97                LilyPond 0.0.65                        5
 
 
diff --git a/NEWS b/NEWS
index 5a66e820a8ae1278a0c16576af7282a998521f5e..a77e57c09e4731f042bc365c44930123d4b9dfd2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,16 +1,57 @@
+pl 65
+       - bf pathfind /root/file
+       - massive Score_elem rewrite:
+         * group_element_i_ count
+         * support for removing an individual Score_elem cleanly.
+         * moved dep stuff into class Directed_graph_node
+         * Score_elems can be copied and deleted freely.
+         * junk PStaff
+         * Spanner_elem_group
+         * Line_of_{score,staff} now are Score_elems
+         * clean dep handling upon deletion
+         * delete unbroken spanners
+         * added a break_processing round.
+         * Super_elem
+       - junk Complex_staff, 
+       - clean {lily}?proto.hh
+       - Element_group
+       - Score_elem now as virtual base class everywhere
+       - naming: Staff_elem -> Score_elem
+       - bf: make in toplevel dir
+       - bf: broken tie y-pos
+       - bf: sharing 4th, 8th and 16th noteheads 
+       - bf: overlapping chords. <\multivoice c d >
+
+pl 64.wl
+       - new stem direction code
+       - bfs: wohltemperirt.ly (thanks, Werner)
+       - bf: stem direction
+
+pl 63.jcn2
+       - doze compile
+
+pl 63.jcn1
+       - bf: mi2mu mudela commands
+       - bf: mi2mu tracks
+       - mi2mu quantify tuning
+       - mi2mu TODO
+
+*********
+may 16
 pl 64
        - exe's now built in out/
        - toplevel Makefile dep from make/Toplevel.make.in
-       - make_website: add version fokoter
+       - make_website: add version footer
        - make_website: bf dist *.txt
        - bf: fix loose bars :  \meter 4/4; c1.  
        - Staff_elem -> Score_elem
        - bf <cis cis>
        - vbrace lookup
-       - stop if barchecks failed
        - resync barcheck
 
 *******
+
+may 15
 pl 63
        - bf: segfault during MIDI output  with mi2mu output.
        - kludge: parse error beyond eof
@@ -23,6 +64,7 @@ pl 63
 
 pl 61.jcn4
        - mi2mu -p -s16 fugua2.midi getting better!
+         plus factor 2 mi2mu speedup (fugue2.midi 5.50user)
        - bf: Duration_convert quantify threshold down
        - bf: (on quantify): tcols quantified; no silly voices
 
@@ -39,6 +81,7 @@ pl 61.jcn2
        - mi2mu parsing speedup: backup rules for midi-lexer.l
        - bf: zero denominator
 **********
+may 14 
 pl 62
        - make clean bf: remove lex & yacc files too 
        - added kludge in case measure too long 
@@ -57,7 +100,6 @@ pl 60.jcn1
 
        
 **********
-may 14 
 pl 61
        - scales.ly bugfix: dimensions default to ((0,0), (0,0))
        - naming: PointerList->Pointer_list
diff --git a/README b/README
index 1dc3546a4c51376dc2fa6e4720f92704d3f0f3aa..34e2bac6d2a1d6108c4bf188ee49a28f983763df 100644 (file)
--- a/README
+++ b/README
@@ -30,12 +30,14 @@ criticism, comments, bugreports, patches, etc. Please send e-mail to
 the mailing lists 
 
 
-       info-gnu-music-request@vuse.vanderbilt.edu
-       help-gnu-music-request@vuse.vanderbilt.edu
-       bug-gnu-music-request@vuse.vanderbilt.edu
-       gnu-music-discuss-request@vuse.vanderbilt.edu,
+       info-gnu-music@vuse.vanderbilt.edu
+       help-gnu-music@vuse.vanderbilt.edu
+       bug-gnu-music@vuse.vanderbilt.edu
+       gnu-music-discuss@vuse.vanderbilt.edu,
+
+See the man page on what to use for what.  Or you can send it directly
+to us: hanwen@stack.nl, jan@digicash.com.
 
-(or directly to us: hanwen@stack.nl, jan@digicash.com)
 
        
        
diff --git a/TODO b/TODO
index 9bbc6f491a2ac97d9a6eb978e0fdce3cbbdcf4f8..9e657cd02c113f7a42196d0834a5b5ab7b2fa475 100644 (file)
--- a/TODO
+++ b/TODO
@@ -8,11 +8,16 @@ grep for TODO and ugh/ugr
 
 
 IMPORTANT
+       * add mi2mu example output (.midi.ly and .gif) to website
 
-       * faq about mi2mu midi t1.
+       * piano staff
 
-       * update 20 pt table
+       * decent spacing
+       
+       * implement better breaking algorithm
 
+       * update 20 pt table
+       
        * use Hungarian throughout code
 
        * decent TeX page layout
@@ -24,7 +29,6 @@ IMPORTANT
        * a Hands on tutorial [HKN]
 
 PROJECTS
-
        * Output class, handles : (smallish)
        - help text /(c) notice?
        - version line
@@ -44,6 +48,11 @@ PROJECTS
        - MusixTeX output possible? (would have to be done before break calc.)
        - NIFF ?
        - PostScript output (esp. Beams, Slurs, etc)
+       - Move PScore, Items, Spanners etc. into libmutype.a
+
+
+       * separate Score_elem settings in user-settable (properties
+       .. ) and non-user-settable part.
 
        * TeX spanners , use texbeam.cc as an example (smallish)
        - Glissando
@@ -57,7 +66,8 @@ PROJECTS
        - general shaving
        - use plet grouping
        - abbreviations [c2 c2]1/2
-       - separate visual from rhythmic info
+       - separate visual from rhythmic info even more
+       - beams over bars
 
        * Redo MIDI output to use Registers: (Difficult)
        - remember more horizontal info than melodics:
@@ -66,26 +76,44 @@ PROJECTS
        - slurs
        - dynamics etc.
 
+
        * Redo font support 
+       - use GSharp fonts?
        - rename mf fonts to avoid conflicts with musixtex
        - check (c) issues
        - use own fonts/update musixtex fonts/find older (c)-less fonts
        - hack up mf sources for decent spacing info (and then 
        read AFM/TFM directly, for text too)
 
+
+       * lines:
+       - Ledger lines, should be separate item: Ledger_lines, Ledger_lines_reg
+       - set different line sizes / thicknesses
+       - stem down too far right
+       - beam stem showthrough, inter beam sizes (french vs german style)
+
+       * Collisions
+       - bring Collision::do_pre_processing to haircutter
+       - left/right note balls should be handled by Collision:
+       < \multivoice { \stem 1; <b c> } { <f as b> } >
+
+       * Keys:
+       - merge key{item} & localkey{item}?
+       - do conventional keys (C G A, F B E, a e fis, d as des, etc ), 
+         besides lists of flats/sharps, possibly via declaration
+       - key transposition. 
+       - key undo: \key bes; .. . \key; should print natural   
+       - special key: \key 'b bes bis';
+       - spacing, national styles?
+
 PARSER
        * Duration -> Musical_duration, typedef Rational Duration?
 
 **********************
 HKN buglist:
 
-\bar || ook dunne streepjes? Sluit de balk niet af! (soms met de
-ruimte van een hele maat erachter (bij unmatching staffs)
-
 noten staan vaak te dicht aan de rechterkant van de maatstreep.
 
-optie om nummers/markers boven maatstrepen te zetten
-
 tekst staat erg ver van notenbalken af
 
 waarom geen ; achter dingen in \paper? (\textwidth 180\mm)
@@ -94,30 +122,15 @@ waarom geen ; achter dingen in \paper? (\textwidth 180\mm)
 Onduidelijk wanneer wel en geen \ voor een woord. Maak liever
 verplichte regels
 
-implementeren versieringen door duration *0 ofzo? (geeft nu assertion,
-zie duration0.ly)
-
-Triolen enzo: het zou handig zijn als je het cijfer "3" ook _tussen_
-twee noten kon plaatsen. Dat is bijvoorbeeld nodig in
-c4*2/3 c8*2/3
-
----------------\
-\bar "||" \meter 6/8; op het eind van de regel staat door elkaar
-gedrukt.
 ****************
 
 BUGS
-
-       * mi2mu nonexist.midi
+       * spurious Weird stem size warnings
 
        * staccato dot positions.
 
        * stacked scripts.
 
-       * key transposition.
-
-       * help-lines for rests
-
        * lilypond - -> crash
 
        * chlapik balk ruimte 
@@ -130,6 +143,7 @@ SEVERELY LACKING:
 
        * grace notes
 
+
 FURTHER FOR ORCHESTRAL SCORE:
 
        * multibar rests
@@ -142,14 +156,16 @@ FURTHER FOR ORCHESTRAL SCORE:
 
 INPUTLANGUAGE
 
+       * should have \require{package.ly} to read req'd packages.
+
        * relative mode for pitch entering
 
+       * bracket (bracketplets)
+
        * \duration 8; e*2/3
 
        * configure pitch_byte
 
-       * special key.
-
        * figured bass?
 
        * rest name configurable
@@ -158,9 +174,18 @@ INPUTLANGUAGE
 
        * subtime with Subtle_reqs
 
+PROJECTS
+
+       * Do RTTI i.s.o. static_name(), name() and request-junk.
+
+       * add remove() methods to all items/spanners.
+
 SMALLISH PROJECTS
 
-       * Help_line, Help_line_reg
+       * handle do_substitute_dependency in more derived classes.
+
+       * replace member access by get()/set() methods, to enable
+       future embedded code.
 
        * --fast/--draft: leave out constraints
 
@@ -181,10 +206,8 @@ SMALLISH PROJECTS
 
        * adaptive accidental spacing.
 
-       * score_elem invible_b_ flag
+       * Score_elem invible_b_ flag
        
-       * key undo
-
        * unix style paths for LILYINCLUDE env
 
        * indentable stream as baseclass for TeX stream, lily stream, Dstream.
@@ -193,8 +216,6 @@ SMALLISH PROJECTS
 
        * caching Item/spanner dimensions.
 
-       * key transposition
-       
        * centered whole rest
 
        * caching breakpoints / saving them. 
@@ -202,12 +223,11 @@ SMALLISH PROJECTS
        * use dstream feature in mi2mu
 
         * qtor, btor, mtor-> tor( QUIET_ver ), tor( DEBUG_ver ), etc.
-       * use tors feature in lily
+       - use tors feature in lily (?)
 
-       * declare notenametab?
+       * declare symtab
 
-       * do conventional keys (C G A, F B E, a e fis, d as des, etc ), 
-         besides lists of flats/sharps
+       * declare notenametab?
 
        * midi esp.: use I32 iso int where 32 bits are needed (or assumed...)
 
@@ -222,7 +242,7 @@ SMALLISH PROJECTS
 
        * Decent TeX titledefs (\tempo, \metron, etc. )
 
-       * C meter iso 4/4
+       * C meter iso 4/4, idem for alla breve, etc.
 
        * textspanner: center position
 
@@ -243,6 +263,8 @@ SMALLISH PROJECTS
 
 
 DOC
+       * Score_elem structure.
+
        * all errors
        
        * config of TeX macros
@@ -257,8 +279,6 @@ FUTURE
 
        * Reg_configure_request
 
-       * bring Collision::do_pre_processing to haircutter
-
        * slur parts as a script
        
        * mixed fontsizes
@@ -271,14 +291,10 @@ FUTURE
 
        * better beamslope calculation: QLP for beams?
 
-       * implement better breaking algorithm
-
        * Text_crescendo
 
        * clean solution for staffsize in items.
 
-       * merge key{item} & localkey{item}?
-
        * revise calcideal
 
        * volta
@@ -288,6 +304,7 @@ FUTURE
        * vertical spanner
 
 IDEAS
+       * derive PCol from Score_elem?
 
        * scoping in Lexer: do general id- assignments in mudela.
 
@@ -298,8 +315,8 @@ IDEAS
        * move MIDI stuff (including Quantization) to a ANSI C libmidi library.
 
        * use an embedded language: Python
-       for 
-               - Items/Spanners
+       for: 
+               - Score_elems
                - Registers
                - Complex mudela?
 
@@ -308,6 +325,7 @@ IDEAS
        * merge Atom and Symbol?
 
        * merge common code of Item, Atom/Molecule
+
        * Spacing_request for manually adjusting spacing
 
        * Staff_group, Score_request_register.
@@ -315,6 +333,8 @@ IDEAS
        * Meters/bars should be aligned, which is difficult if
        we get different keychanges in different staffs.
 
+       * Horizontal_align item for meter,bar etc.
+
        * caching breakpoints
 
        * #c <-> cis
index 983454dad3ac2eebac5ac4d17e7471ec5242dda0..22a4ea6df3a220d35f348bc58ec384ac12317911 100755 (executable)
@@ -1,8 +1,10 @@
 #!/bin/sh
 
 # unclobber current dir.
-rm -vf *.aux *.log `grep -li "^% Creator: LilyPond" *.out` *.orig *~
-
+rm -vf *.aux *.log `grep -li "^% Creator: GNU LilyPond" *.out` *.orig *~
+rm -vf `grep -li "Creator: mi2mu" *.midi.ly`
+rm -vf `grep -li "Creator: GNU LilyPond" *.midi`
 # docxx mess
+rm -vf *dvi
 rm -vf *.class  HIER*.html dxxgifs.tex gifs.db icon?.gif logo.gif down.gif \
     aindex.html index.html
index 1f56088f930d30734d600ab34b63e4a83c10c7ff..911b038f6dd194098863db9507bb175a4c9e7f69 100755 (executable)
@@ -24,7 +24,7 @@ sub
     my $what="implement ";
     $what = "declare " if ($hh_b);
     my ($PROJECT, $cwd);
-    $PROJECT = "the LilyPond music typesetter";
+    $PROJECT = "the GNU LilyPond music typesetter";
     chop($cwd = `pwd`);
     
     $PROJECT= "the Flower Library" if ($cwd =~ /flower/);
index 9586d88598c60a9d1e036585586df165bf27fcee..ce8c6bb7936407ecbfd0538dd462eaa2b95a30f3 100755 (executable)
@@ -34,13 +34,13 @@ sub set_html_footer
     my $username=$pw[6];
 
     $footstr = 
-       "\n<hr>
-<font size=-2>
+       "\n<hr>Please take me <a href=index.html>back to the index</a>\n<hr>
+<font size=-1>
 This page was generated by <code>make_website</code> from lilypond-$lily_version by
 <p>
 <address><br>$username <a href=mailto:$MAILADRESS>&lt<!bla>$MAILADRESS</a>&gt</address>
 <p>" . `date` . "
-<p></font>\n";
+<p></font>";
 }
     
 
@@ -57,26 +57,6 @@ sub my_system
     }
 }
 
-sub set_hrefs
-{
-    while (<HTMLIN>) {
-       s#href=([A-Za-z.]+)#href=$base/$1#g;
-       print HTMLOUT $_;
-    }
-}
-
-sub all_refs
-{
-    print "resetting refs.\n";
-
-    foreach $a (<*.html>)
-    {
-       rename $a, "$a~";
-       open HTMLIN, "$a~";
-       open HTMLOUT, ">$a";
-       set_hrefs;
-    }
-}
 
 local $base="lilypond/";
 local @examples=("wohltemperirt" ,"standchen", "scsii-menuetto", "rhythm", "collisions");
@@ -175,9 +155,10 @@ sub edit_html
 
        }
        close H;
-       
-       
-       $file =~ s/$sep/$footstr$sep/g ;
+
+       my $subst =  $footstr;
+       $subst .= $back if (! $a =~ /index.html/ );
+       $file =~ s/$sep/$subst$sep/g ;
        
        open H, ">$a";
        print H $mw_id;
index 73ea61d3231a913ef6877cab1f33e3b57828b850..9db40e5757a0664d541167a1b4db236b0d4e00b5 100755 (executable)
--- a/configure
+++ b/configure
@@ -1649,6 +1649,8 @@ sed 's/TOPLEVEL_//g' <  .version >  lily/.version
 (cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
 )
 
+$MAKE -f make/Toplevel.make.in Makefile
+
 cat << END
 Finished configuring. For making everything, do:
 
@@ -1663,6 +1665,10 @@ assuming that \`make' is GNU make, of course.
 If you want to make site-wide extensions to the makefiles, please use
 
     make/out/Site.make
+
+If you can't find a toplevel makefile, please execute
+
+    make -f make/Toplevel.make.in Makefile              # GNU make, of course
     
 END
 
index 95a848b4767b863d9c0259b223db30fd6d2f7be1..81a99752ddf50a307233c3abec994aa9a2c0a9e6 100644 (file)
@@ -255,6 +255,8 @@ sed 's/TOPLEVEL_//g' <  .version >  lily/.version
 (cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
 )
 
+$MAKE -f make/Toplevel.make.in Makefile
+
 cat << END
 Finished configuring. For making everything, do:
 
@@ -269,6 +271,10 @@ assuming that \`make' is GNU make, of course.
 If you want to make site-wide extensions to the makefiles, please use
 
     make/out/Site.make
+
+If you can't find a toplevel makefile, please execute
+
+    make -f make/Toplevel.make.in Makefile              # GNU make, of course
     
 END
 
index c07a4a1e4ed2bd4efcae38dd45f5334e2dbb1fb1..1234aa46c797fba720c835d2a77c671da9ce0328 100644 (file)
@@ -1,6 +1,6 @@
 MAJOR_VERSION = 1
 MINOR_VERSION = 1
-PATCH_LEVEL = 17
+PATCH_LEVEL = 18
 # use to send patches, always empty for released version:
 MY_PATCH_LEVEL = # include separator: "-1" or ".a"
 #
index 9c330b8005ae558724dc8cce3054321b0a3d896d..23867797db55d4e4a73bf9b3c5611c7621cc354f 100644 (file)
@@ -1,5 +1,11 @@
 version 1.1:
 
+pl 18
+       - Path::find("/usr/..") fix
+       - Directed_graph_node
+       - some Link_array extensions
+       - Pointer_list::junk()
+
 pl 17
        - naming: Pointer->Link, IPointer->Pointer
 pl 16
diff --git a/flower/directed-graph.cc b/flower/directed-graph.cc
new file mode 100644 (file)
index 0000000..c47285c
--- /dev/null
@@ -0,0 +1,152 @@
+/*
+  edge_out.cc -- implement Directed_graph_node
+
+  source file FlowerLib
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "directed-graph.hh"
+
+#ifdef PARANOID                        // these checks eat huge amounts of time.
+#define PARANOID_OK() OK()
+#else
+#define PARANOID_OK()
+#endif
+
+
+Link_array<Directed_graph_node> const &
+Directed_graph_node::get_in_edge_arr() const
+{
+    return edge_in_l_arr_;
+}
+
+Link_array<Directed_graph_node> const &
+Directed_graph_node::get_out_edge_arr()const
+{
+    return edge_out_l_arr_;
+}
+
+/**
+  Should not copy deps automatically
+ */
+Directed_graph_node::Directed_graph_node(Directed_graph_node const&)
+{
+}
+
+void
+Directed_graph_node::copy_edges_out(Directed_graph_node const &s)
+{
+    for(int i=0; i < s.edge_out_l_arr_.size(); i++)
+       add(s.edge_out_l_arr_[i]);
+}
+
+void
+Directed_graph_node::OK() const
+{ 
+#ifndef NDEBUG
+    for (int i=0; i < edge_out_l_arr_.size(); i++) {
+       assert(edge_out_l_arr_[i]->
+              edge_in_l_arr_.find_l(this));
+    }
+    for (int i=0; i < edge_in_l_arr_.size(); i++)
+       assert(edge_in_l_arr_[i]->contains_b( this));
+#endif
+}
+
+bool
+Directed_graph_node::contains_b(const Directed_graph_node *d)const
+{
+    return edge_out_l_arr_.find_l((Directed_graph_node*)d);
+}
+    
+void
+Directed_graph_node::remove_edge_out_idx(int i)
+{
+    PARANOID_OK();
+    Directed_graph_node * d_l = edge_out_l_arr_.get(i);
+
+    int j = d_l->edge_in_l_arr_.find_i(this);
+    assert(j>=0);
+    d_l->edge_in_l_arr_.del(j);
+    PARANOID_OK();
+}
+
+void
+Directed_graph_node::remove_edge_in(Directed_graph_node *d_l)
+{
+    PARANOID_OK();
+    d_l->remove_edge_out(this);
+    PARANOID_OK();
+}
+void
+Directed_graph_node::remove_edge_out (Directed_graph_node *d_l)
+{
+    PARANOID_OK();
+    for (int i=0; i < edge_out_l_arr_.size(); ) {
+       if (edge_out_l_arr_[i]== d_l)
+           remove_edge_out_idx(i);
+       else
+           i++;
+    }
+    PARANOID_OK();
+}
+bool
+Directed_graph_node::linked_b()const
+{
+    return edge_out_l_arr_.size() || edge_in_l_arr_.size();
+}
+
+void
+Directed_graph_node::junk_links()
+{
+    edge_in_l_arr_.set_size(0);
+    edge_out_l_arr_.set_size(0);
+}
+
+
+void
+Directed_graph_node::unlink()
+{
+#ifdef PARANOID
+       PARANOID_OK();
+
+       Link_array<Directed_graph_node> t = edge_out_l_arr_;
+       t.concat(edge_in_l_arr_);
+#endif
+
+       while ( edge_out_l_arr_.size() )
+           remove_edge_out_idx(0);
+       
+       while (edge_in_l_arr_.size() )
+           remove_edge_in(edge_in_l_arr_[0]);
+
+#ifdef PARANOID
+       for (int i =0; i < t.size(); i++)
+           t[i]->OK();
+#endif
+}
+
+Directed_graph_node::~Directed_graph_node()
+{
+    assert(!linked_b());
+}
+
+    
+void
+Directed_graph_node::add(Directed_graph_node* dep_l)
+{
+    PARANOID_OK();
+    if (!dep_l)
+       return ;
+    dep_l->edge_in_l_arr_.push(this);
+    edge_out_l_arr_.push(dep_l);
+    PARANOID_OK();
+}
+    
+
+Directed_graph_node::Directed_graph_node()
+{
+}
+
diff --git a/flower/include/class-name.hh b/flower/include/class-name.hh
deleted file mode 100644 (file)
index 14ebf4c..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-  class-name.hh -- declare 
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef CLASS_NAME_HH
-#define CLASS_NAME_HH
-
-/** a macro to declare the classes name as a static and virtual function.
-  The static_name() can *not* be inlined (this might have the effect that 
-  s->name() != S::static_name(). Overlapping strings need not be merged in C++
- */
-#define NAME_MEMBERS(c)        \
-static char const *static_name();\
-virtual char const *name() const{ return c::static_name(); } \
-int a_stupid_nonexistent_function_to_allow_the_semicolon_come_out()
-
-#define IMPLEMENT_STATIC_NAME(c)\
-    char const *c::static_name() { return #c; } 
-    
-#endif // CLASS-NAME_HH
diff --git a/flower/include/directed-graph.hh b/flower/include/directed-graph.hh
new file mode 100644 (file)
index 0000000..73f8a92
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+  edge_out.hh -- declare Directed_graph_node
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef DEPENDENCY_HH
+#define DEPENDENCY_HH
+
+#include "parray.hh"
+
+/**
+  Class to handle two-sided connections between nodes (the Dependencies)
+ */
+class Directed_graph_node {
+    Link_array<Directed_graph_node>edge_out_l_arr_;
+    /// targets
+    Link_array<Directed_graph_node> edge_in_l_arr_;
+    
+public:
+    
+    /** remove i-th edge_out (and exactly one ref to me in the edge_out)
+      */
+    void remove_edge_out_idx(int i);
+    void copy_edges_out(Directed_graph_node const&);
+    bool linked_b() const;
+    void unlink();
+    void junk_links();
+    void add(Directed_graph_node*);
+    void remove_edge_in(Directed_graph_node *);
+    void remove_edge_out(Directed_graph_node*);
+    bool contains_b(Directed_graph_node const*) const;
+
+    Directed_graph_node(Directed_graph_node const &);
+    void OK()const;
+    Directed_graph_node();
+
+    ~Directed_graph_node();
+    
+    /**
+     ensure that no edge_out exists doubly.
+     */
+    void uniq();
+    Link_array<Directed_graph_node> const& get_out_edge_arr() const;
+    Link_array<Directed_graph_node> const& get_in_edge_arr() const;
+};
+
+#endif // DEPENDENCY_HH
index d5bf68034b0a99580e3df522fd98f1a4c95d3b38..8b7bb35798adfcaa653102452ff975888912d75b 100644 (file)
@@ -37,6 +37,8 @@ typedef Interval_t<Real> Interval;
 struct Choleski_decomposition;
 
 struct Long_option_init;
+struct File_path;
+struct Directed_graph_node;
 struct Getopt_long;
 struct Matrix;
 struct String_data;
index ec39f0d7e26a9993c9c0895e1fc37f2735812b76..bf4e4cc0e74d56758eaa3653dbb59a3671a86297 100644 (file)
@@ -75,7 +75,7 @@ struct Interval_t {
     Interval_t<T> &operator *=(T r) {
        left *= r;
        right *= r;
-       if (r <0) {
+       if (r < T(0)) {
            T t = left;
            left = right;
            right = t;
index 49be7046085ba6bf555a1e184d19f8cf140c665a..ab2eb95ec3b72f53c0c172c89574b303fca92312 100644 (file)
@@ -98,7 +98,7 @@ Interval_t<T>::str() const
        return "[empty]";
     String s("[");
  
-    return s + left + "," + right +"]";
+    return s + String( left ) + String( "," ) + String( right ) + String( "]" );
 }
 
 template<class T>
index 8e34d604f41b2246fc1b663384a785bf25a35e43..933cdbbb6ed4043ac4b5a75769b8d6577a0ef035 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "varray.hh"
 #include "real.hh"
-#include "class-name.hh"
+#include "virtual-methods.hh"
 
 /** 
 
index 18ec1e33e91cf43fc3a2075977c2c9622543cee4..df013e084934698cb837e5b23dcab37a0dcd8451 100644 (file)
@@ -1,7 +1,15 @@
+/*
+  matrix.hh -- declare Matrix
+
+  source file of the Flower Library
+
+  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
 #ifndef MATRIX_HH
 #define MATRIX_HH
 
-
 #include "matrix-storage.hh"
 #include "vector.hh"
 
index e003d462231a1808b6b2327c76aa63ad317449d3..1e7404ee5565edf2c34f9157700712288a677670 100644 (file)
   an array of pointers.
 
   TODO
-  should init to 0.
+  should init to 0. Derive from Array<void*>? 
  */
 template<class T>
-class Link_array : public Array<T>
+class Link_array : public Array<T*>
 {
+    static default_compare(T *const& p1, T  *const&p2) {
+       /* can't do p1 -p2, since T might be an incomplete type */
+       if (p1 < p2)
+           return -1 ;
+       if (p2 < p1)
+           return 1;
+       return 0;
+    }
 public:
-    int find_i (T t) const{
+    void substitute(T *old, T*new_l)
+    {
+       int i;
+       while ((i = find_i(old)) >=0) 
+           if (new_l)
+               elem(i) =new_l;
+           else
+               del(i);
+    }
+    void default_sort() {
+       sort(default_compare);
+    }
+    void uniq() {
+       Link_array<T> l_arr;
+       for (int i=0; i < size(); i++) 
+           if (!i || elem(i-1) != elem(i))
+               l_arr.push(elem(i)); 
+       *this = l_arr;
+    }
+
+    int find_i (T const * t) const {
        for (int i=0; i < size(); i++)
            if (elem(i) == t)
                return i;
        return -1;
     }
-    T find_l(T t)const
+    T *find_l(T const *t)const
     {
        int i = find_i(t);
        if (i >= 0)
index 12f0ce4cb62f91f72e552395c6f7039addeb6b0f..d41dc2ba1cc6bd89f1f2d545529c95f4a878cab9 100644 (file)
@@ -29,9 +29,6 @@ public:
     /// locate a file in the search path
     String find(String nm)const;
 
-    /// construct using prefix. Normally argv[0].
-    File_path(String);
-
     /// add to end of path.
     Array<String>::push;
     void add(String str) { push(str); }
index 469a8d444a4d1b3e45a29dec429b8fea49390758..4c9d71dba539ad389db65475fdfc968fec46bb56 100644 (file)
@@ -33,23 +33,30 @@ class Link_list : public List<void *>
     Link_list() {}
 };
 
-/**   Link_list which deletes pointers given to it. 
+/**   
+  
+  Link_list which deletes pointers given to it. 
+
   NOTE:
   
   The copy constructor doesn't do what you'd want:
   Since T might have a virtual ctor, we don't try to do a
 
-    new T(*cursor)
+    new T(**cursor)
 
   You have to copy this yourself, or use the macro Link_list__copy
   
+  TODO
+  operator =()
   */
 template<class T>
 class Pointer_list : public Link_list<T> {
+    
 public:
+    void junk();
     Pointer_list(Pointer_list const &) { set_empty(); }
     Pointer_list() { }
-    ~Pointer_list();
+    ~Pointer_list() { junk(); }
 };
 
 #define Pointer_list__copy(T, to, from, op)   \
index 2f75d08adfc3a2be8e63e27b645ad9eb722983a6..ba4a0f20b037af367921882b11bb42b784f28fc3 100644 (file)
@@ -6,7 +6,8 @@
        template class Pointer_list<a*>
        
 template<class T>
-Pointer_list<T>::~Pointer_list()
+void
+Pointer_list<T>::junk()
 {
     PCursor<T> c( *this );
     while (c.ok()) {
diff --git a/flower/include/virtual-methods.hh b/flower/include/virtual-methods.hh
new file mode 100644 (file)
index 0000000..e5c807e
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+  class-name.hh -- declare 
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef CLASS_NAME_HH
+#define CLASS_NAME_HH
+
+/** a macro to declare the classes name as a static and virtual function.
+  The static_name() can *not* be inlined (this might have the effect that 
+  s->name() != S::static_name(). Overlapping strings need not be merged in C++
+ */
+#define NAME_MEMBERS(c)        \
+static char const *static_name();\
+virtual char const *name() const{ return c::static_name(); } \
+int a_stupid_nonexistent_function_to_allow_the_semicolon_come_out()
+
+#define IMPLEMENT_STATIC_NAME(c)\
+    char const *c::static_name() { return #c; } 
+
+#define VIRTUAL_COPY_CONS(T, R)\
+  virtual R *clone() const { return  new T(*this); } \
+
+    
+#endif // CLASS-NAME_HH
index 1db78d8dbf06346d9f8ca37574604451a1401a78..12152d6227a9042f43071fa1217c775e9f547b6c 100644 (file)
@@ -15,5 +15,5 @@ Interval__instantiate(Real);
 Real
 Interval_t<Real>::infinity() 
 {
-    return HUGE;
+    return HUGE_VAL;
 }
index 3a2e5dfbc0abf56648f251c70ffe53af1f57c49b..bd6a6660d2c6bce301bffb25ed247365ee4e5d6d 100644 (file)
@@ -49,13 +49,6 @@ split_path(String path,
        }
 }
 
-File_path::File_path(String pref)
-{
-    add(".");
-    add(pref);
-}
-
-
 /** find a file. 
   It will search in the current dir, in the construction-arg, and
   in any other added path, in this order.
@@ -64,13 +57,13 @@ String
 File_path::find(String nm)const
 
 {
-    fdebug << "looking for " << nm ;
+    fdebug << "looking for " << nm << ": ";
     if ( !nm.length_i() || ( nm == "-" ) )
        return nm;
     for (int i=0; i < size(); i++) {
 
         String path  = (*this)[i];
-        path+= "/"+nm;
+        path+= String(path.length_i()? "/":"")+nm;
 
         fdebug << path << "? ";
         FILE *f = fopen(path, "r"); // ugh!
index 4c6069ba519800a818a8e5b0c90aae3f31e12a17..feb793369f7b95e625ac9723348b2eed2f03a8e7 100644 (file)
@@ -246,6 +246,7 @@ String_convert::rational_str(Rational r)
 String
 String_convert::pointer_str(void const *l)
 {
-    I64 i64 = (I64)l;
-    return String_convert::i64_str(i64,  "0x%0Lx");
+    char buffer[STRING_BUFFER_LEN];
+    snprintf(buffer, STRING_BUFFER_LEN, "%p", l );     // assume radix 10
+    return String(buffer);
 }
index 154800fdc7890b0f97d62452b5912176d6a196d9..703b092e658ea772860df62254c5f1eafbd26cad 100644 (file)
@@ -19,7 +19,7 @@ melodicregs = \inputregister {
                \inputregister { Note_column_register }
                \inputregister { Slur_register }
                \inputregister { Voice_registers
-                       \inputregister { Notehead_register }
+                       \inputregister { Note_head_register }
                        \inputregister { Tie_register }
                }
        }
index b9670bb8fd96c674cc008e1b72771befc5a0535a..18cc2b5680ed02bb10ad49c7b5728b816968b71c 100644 (file)
@@ -92,8 +92,8 @@ table_sixteen=
      }
 
      "streepjes" = \table {
-            "toplines" "\toplines{%}"  -3\pt   9\pt 0\pt       0\pt
-            "botlines" "\botlines{%}"  -3\pt   9\pt 0\pt       0\pt
+            "toplines" "\toplines{%}"  -1\pt   7\pt 0\pt       0\pt
+            "botlines" "\botlines{%}"  -1\pt   7\pt 0\pt       0\pt
      }
 
      "bars" = \table {
index d37dab705cfc8c745183a621ab181c645f612e0d..14df3bc58fa0432a43e34859c9c905a8780f22d9 100644 (file)
@@ -13,41 +13,42 @@ EndMudelaHeader
 \version "0.0.57";
 
 
-two_voice_steminvert = \melodic { 
-       < \multivoice 
-         {     \octave c'; \stem 1;
-               c d e f~  g2 g a }
-         { \stem -1;
-               g f e g ~ g2 g2 } 
-
-       >
-}      
 
 two_voice = \melodic { 
        < \multivoice 
-         {     \octave c'; \stem -1;
-               c d e f g2~  g a }
+         {     \octave c'; \stem -1;\duration "last";
+               c4 d e f g2~  g4 a [c8 d e f] c2| }
          { \stem 1;
-               g f e g ~ g2 g2 } 
+               g4 f e g ~ g2 g2  c4 g4 g2 } 
 
        >
 }      
 
+two_voice_steminvert = \melodic { 
+       < \multivoice  
+         {     \octave c'; \stem 1;
+% the f and g on 4th beat are exceptionally ugh.
+               c4 d e f g2 g4 a | }
+         { \stem -1;
+               g4 f e g  g2 g2 } 
+
+       >
+}      
 three_voice = \melodic {
        < \multivoice
        { \stem 1; 
-               g f e f g a g2 }
+               g4 f e f g a g2 }
        { \hshift 1; \stem 1; 
                e2  e2  e2  e2 }
        { \stem -1;
-               c d e d c d es }
+               c4 d e d c d es }
        >
 }
 
 rests = \melodic  {
        < \multivoice
-       { \stem 1;\duration "last";
-               r8 r r r  r r r r 
+       { \stem 1;
+               r8 r r r  r r r r 
                [c' b a g] [f e d c]
        } 
        { \stem -1;
index c215a574af09f0235a532e45a3b35e79ad7c3ac9..f46fc86f3afffc1f78f55c6ad3f6cff821f617b5 100644 (file)
@@ -7,20 +7,27 @@
  entered-by:
  copyright:
 
- Tested Features: local key, key
+ Tested Features: local key, key, forced accidentals
 EndMudelaHeader
 %}
 \version "0.0.57";
 
 
 blah = \melodic{
-       \duration 4;
+       \duration "last";
        \meter 4/4;
        \octave c';
-       cis c cis cis |
+       \key bes es as;
+       [cis8 d e f] [e! a b cis'] |
+       es e f e a a' a  a' |
+ \clef "bass";       \octave c; [es16 c' b a] [g f es d] [c d es d] [c Bes As G] |
+
+\clef "violin";
+       \key ;
+       cis4 c cis cis |
        <cis dis eis fes ges> cis dis2 ~ | 
                \meter 2/4 ;
-       dis dis ~ | c cis~ | c 
+       dis4 dis ~ | c cis~ | c
 }
 
 \score{
index fe236e4dca73eee8f6bcaec422f7f84839086418..042d9cddc0cc7e798f388c203a729b0a9187cb49 100644 (file)
@@ -24,6 +24,7 @@ ritme = \staff {
        melodicregs
        \melodic{ %\octave ;
        \partial 8;
+       \octave c';
        \meter  4/4;
        c8                                      |
        
index 291ef663b473867b943b7d61519f72ad0727b183..6b15eaae4c8727298e9fb889f24ae9b70e975821 100644 (file)
 %{
  title: Das Wohltemperirte Clavier I, Fuga II (c-minor)
- description: 
+ description: following Henle's Urtext
  composer(s): JS Bach
  entered-by: HWN
- copyright:Public Domain 
+ corrected-by: Werner Lemberg (tested with pl 64; 1997-05-17)
+ copyright: Public Domain 
+
+ Tested Features: stem direction, multivoice, forced accidentals.
+
+ Remarks: the stem direction algorithm is severely broken (look at the
+          bass dux) with pl64.
+
 
- Tested Features:stem direction, multivoice.
 %}
 
 \version "0.0.57";
 
-global = \melodic{
-       \meter 4/4 ;
-       \key bes es as; 
-}
+                                    % should add \need{dutch.ini} for
+                                    % correct parsing of note names
+
+global = 
+    \melodic {
+         \meter 4/4;                % should be \meter C
+         \key bes es as; 
+    }
   
-dux = \melodic  {
-       \clef "violin";
-       \octave c' ;
-       \duration  \last ;
-
-       \stem -1;
-        r8     
-       [c'16 b] [c'8 g] [as c'16 b] [c'8 d'] |
-       [g c'16 b] [c'8 d'] [f16 g] as4 [g16 f] |
-       [es c' b a] [ g f es d] [c8 es' d' c'] |
-       [bes a bes c'] [fis g a fis] |
-       g4 r16 [c d es] [f g as8~] [as16 d es f ]|
-       [g a bes8(] [)bes16 es f g ] [as g f es] [d8 c'16 b]|
-       c'4 r4 r8 [f' es' d'] 
-       r8 [as g f] [g f16 es] [f8 d] | 
-       g4 r8 b [c' c'16 b] [c'8 g] |
-%% 10  
-       as4 r8 a [bes bes16 a] [bes8 f] |
-       g4 r8 g [as as g f] | % should jump staff
-       \octave c;
-       r8 [as bes c'] r8 [as16 g] [as8 f8] |
-       [bes8 c bes as ] [bes g f es] |
-       [f des' c' bes ] [c' as g f] |
-       [g8 %jump!
-       \octave c';
-               g16 fis] [g8 c] [es g16 fis] [g8 a] |
-       [d g16 fis] [g8 a] [c16 d] es4 [d16 c] |
-       'bes8 r8 r16 [d e fis ] [g a bes8( ] [)bes16 e f g] |
-       [a bes c'8(] [)c'16 fis16  g a ] [bes8 es16 d] [es8 'g] |
-       ['as f16 e] [f8 'a8] ['bes g16 f] [g8 'b] |
-% 20
-       [c16 f es d] [c Bes As G] [F8 as g f] |
-       [es d es f] [B c d B] |
-       c4 r8 e8 [f f16 e] [f8 c] |
-       d4 r8 d8 [es8 es16 d] [es8 Bes] |
-       c2 ~  [c8 d16 es][ f es f d] |
-       B8 r8 r B c r r es |
-       d r r f~ f r r f |
-       [es as g f] [es d es f] |
-       [B c d B] [B c] r c |
-       [f16 d es c]~ [c8 B] c4 r8 e |
-       f4 r8 <f8 as b> [f es16 d] [es8 <f a] > |
+dux =
+    \melodic {
+        \clef "violin";
+        \octave c';
+        \duration \last;
+        \stem -1;
+        r8 [c'16 b] [c'8 g] [as c'16 b] [c'8 d'] |
+        [g c'16 b] [c'8 d'] [f16 g] as4 [g16 f] |
+        [es c' b a] [g f! es d] [c8 es' d' c'] |
+        [bes a bes c'] [fis g a fis] |
+%% 5
+        g4 r16 [c d es] [f g as8~] [as16 d es f]|
+        [g a bes8~] [bes16 es f g] [as g f es] [d8 c'16 b]|
+        c'4 r4 r8 [f' es' d'] 
+        r8 [as g f] [g f16 es] [f8 d] | 
+        g4 r8 b [c' c'16 b] [c'8 g] |
+%% 10   
+        as4 r8 a [bes bes16 a] [bes8 f] |
+        g4 r8 g [as as g f] |
+        \octave c; r8 [as bes c'] r8 [as16 g] [as8 f8] |
+        [bes8 c' bes as] [bes g f es] |
+        [f des' c' bes] [c' as g f] |
+%% 15
+        g8 \octave c'; [g16 fis] [g8 c] [es g16 fis] [g8 a] |
+%        [d g16 fis] [g8 a] [c16 d] es4 [d16 c] |
+        [d g16 fis] [g8 a] [c16 d] es4 [d16 c] |
+                                    % wouldn't it be better if I can write
+                                    % `a' instead of `a!' here to get really
+                                    % an `a natural'? Processing this melody
+                                    % alone (only having `a') would yield a
+                                    % different result! (WL)
+%% I don't understand the complaint. The ! makes no difference in output. HWN
+
+        'bes8 r8 r16 [d e fis] [g a bes8~] [bes16 e f g] |
+        [a bes c'8~] [c'16 fis16 g a] [bes8 es!16 d] [es8 'g] |
+        ['as f16 es] [f8 'a8] ['bes g16 f] [g8 'b] |
+%% 20
+        [c16 f es d] [c Bes! As G] [F8 as g f] |
+        [es d es f] [B c d B] |
+        c4 r8 e8 [f f16 e] [f8 c] |
+        d4 r8 d8 [es8 es16 d] [es8 Bes] |
+        c2 ~  [c8 d16 es][ f es f d] |
+%% 25
+        B8 r8 r B c r r es |
+        d r r f~ f r r f |
+        [es as g f] [es d es f] |
+        [B c d B] [B c] r c |
+        [f16 d es c]~ [c8 B] c4 r8 e |
+%% 30
+        f4 r8 f [f es16 d] [es8 <f as]> |
+%        f4 r8 <f as b> [f es16 d] [es8 <f as]> |
+                                    % bug! if you say
+                                    %   f4 r8 <f as b> ...
+                                    % the chord overlaps. WL
+%% confirmed. added to TODO. HWN
        <B d> r <B d> r <G2 c> |
-}
+    }
+
 
-comes = \melodic  {
-       \octave c'' ;
-       \stem 1;
-       r1 |
-       r1 |
-       r8 [g16 fis] [g8 c] [es g16 f] [g8 a]|
-       [d8 g16 fis] [g8 a] [c16 d] es4 [d16 c] |
-       ['bes8 es16 d] [es8 'g8] ['as f16 es] [f8 'a] 
-       ['bes8 g16 f] [g8 'b] [c8 d16 es] f4( |
-       [) f8 es16 d] [c16 'bes 'as 'g] ['f8 as g f] 
-       [es d es f] ['b c d 'b] |
-       [c g16 fis] [g8 d] es4 r8 e8 |
+comes =
+    \melodic {
+        \octave c'';
+        \stem 1;
+        r1 |
+        r1 |
+        r8 [g16 fis] [g8 c] [es g16 fis] [g8 a] |
+        [d8 g16 fis] [g8 a] [c16 d] es4 [d16 c] |
+%% 5
+        ['bes8 es16 d] [es8 'g8] ['as f16 es] [f8 'a] 
+        ['bes8 g16 f] [g8 'b] [c8 d16 es] f4~ |
+        [f8 es16 d] [c16 'bes 'as 'g] ['f8 as g f] 
+        [es d es f] ['b c d 'b] |
+        [c g16 fis] [g8 d] es4 r8 e8 |
 %% 10 
-       [f f16 e] [f8 c8] d4 r8 d |
-       [es8 es16 d] [es8 'bes] [c es16 d] [es8 f] |
-       ['bes es16 d] [es8 f] ['as16 'bes] c4 ['bes16 'as] |
-       [G16 Es F G] [As Bes c d] [es d c d] [es f g a] |
-       [bes F G As] [Bes c d e] [f es d es] [ f g a b] |
-       [c'8 b16 a] [g f e d] [c8 es d c] |
-       [Bes A Bes c] [Fis G A Fis] |
-       [G8 d16 c] d8 r8 r8 [e16 d] e8 r8 |
-       r [fis16 e] fis8 r r [G16 F] G8 r8 |
-       r8 [A16 G] A8 r r [B16 A] B8 r |
+        [f f16 e] [f8 c8] d4 r8 d |
+        [es8 es16 d] [es8 'bes] [c es16 d] [es8 f] |
+        ['bes es16 d] [es8 f] ['as16 'bes] c4 ['bes16 'as] |
+        [G16 Es F G] [As Bes c d] [es d c d] [es f g a] |
+        [bes F G As] [Bes c d e] [f es d es] [ f g a b] |
+%% 15
+        [c'8 b16 a] [g f es d] [c8 es d c] |
+        [Bes A Bes c] [Fis! G A Fis] |
+                                    % see comment above about forced acc. 
+        [G8 d16 c] d8 r8 r8 [e16 d] e8 r8 |
+        r [fis16 e] fis8 r r [G16 F] G8 r8 |
+        r8 [A16 G] A8 r r [B16 A] B8 r |
 %% 20
-       r8 [c16 'b] [c8 'g] [As c16 'c] [c8 d] |
-       [G c16 B] [c8 d] [F16 G] As4 [G16 F] |
-       [Es8 c16 B] [c8 G] As4 r8 A |
-       [Bes8 Bes16 A] [Bes8 F8] g4 r8 G(|
-       )[G As16 Bes] [c B c As] F2( |
-       )[F8 d16 c] [d8 F] [Es es16 d] [es8 G] |
-       [F f16 es] [f8 As] [G16 f es d] [c B A G] |
-       [c8 f es d] r [As G f] |
-       [G F16 Es] [F8 D] [As G] r A |
-       [B c] [F16 Es D C] [C8 c16 B] [c8  G]|
-       [As c16 B] [c8 d] [G8 c16 B] [c8 d] |
-       [F16 G] As4 [G16 F] E2 |
-       
-}
+        r8 [c16 'b] [c8 'g] [As c16 'b] [c8 d] |
+        [G c16 B] [c8 d] [F16 G] As4 [G16 F] |
+        [Es8 c16 B] [c8 G] As4 r8 A |
+        [Bes8 Bes16 A] [Bes8 F8] 'g4 r8 G~ |
+        [G As16 Bes] [c B c As] F2~ |
+%% 25
+        [F8 d16 c] [d8 F] [Es es16 d] [es8 G] |
+        [F f16 es] [f8 As] [G16 f es d] [c B A G] |
+        [c8 f es d] r [As G F] |
+        [G F16 Es] [F8 D] [As G] r A |
+        [B c] [F16 Es D C] C8 [c16 B] [c8 G] |
+%% 30
+        [As c16 B] [c8 <d 'b! 'as!]> [G8 c16 B] [c8 d] |
+        [F16 G] As4 [G16 F] E2 |
+    }
+
+bassdux =
+    \melodic {
+        \clef "bass";
+
+        \octave c';
+        r1 |
+        r |
+        r |
+        r |
+%% 5
+        r |
+        r1 |
+        r8 [c16 B] [c8 G] [As c16 B] [c8 d] |
+        [G c16 B] [c8 d] [F16 G] As4 [G16 F] | 
+        \octave c; [es c' b a] [g f es d] [c d es d] [c Bes! As! G] |
+                                    % I think we shouldn't need to force
+                                    % accidents here because they are in
+                                    % another octave range. WL
+
+%% I don't understand the complaint. Accidentals are valid for one octave range
+%% only. Without ! (and printed flat), this still is valid. HWN
 
-bassdux = \melodic  {
-       \clef "bass";
-       \octave c' ;
-       r1 |
-       r |
-       r |
-       r |
-       r |
-       r1 |
-       r8 [c16 B] [c8 G] [As c16 B] [c8 d] |
-       [G c16 B] [c8 d] [F16 G] As4 [G16 F] | 
-       \octave c;
-       [es c' b a] [g f es d] [c d es d] [c Bes As G] |
 %% 10
-       [F bes as g ] [f es d c] [Bes c d c ] [Bes As G F]|
-       [Es as g f] [es des c Bes] [As8 c' bes as] |
-       [g8 f g as] [d es f d] |
-       [es as g f] [g es d c] |
-       [d bes as g] [as f es d] |
-       es8 r8 r4 r8 [c Bes A] |
-       r [es d c] [d c16 Bes] [c8 d] |
-       [G8 bes16 a] [bes8 d] [es c'16 bes] [c'8 e] |
-       [f d'16 c'] [d'8 fis] g4 r16 [G A B] |
-       [c16 d es8]~ [es16 A Bes c] [d es f8]~ [f16 'b c d]|
-%%20   
-       es8 r r e [f F Es D] |
-       r [As G F] [G F16 Es] [F8 G] |
-       [c16 d  es d] [c Bes As G] [F bes as g] [f es d c] |
-       [Bes c d c] [Bes As G F] [Es As g f ] [es d c Bes] |
-       [As Bes c Bes] [As G F Es] [D g f es ] [d c B A] |
-       g4 r4 r16 [G A B] [c d es f] |
-       [g f as g] [f es d c] [B8 c16 B] [c8 G] |
-       [As c16 B] [c8 d] [G c16 B] [c8 d] |
-       [F16 G] As4 [G16 F] Es4 r8 es |
-       [d c g G] 
-       < \multivoice 
-       { \stem 1; c2 ~ |c1~ | c1 }
-       { \stem -1; C2~ |C1~ | C1 }
-       >
+        [F bes as g] [f es d c] [Bes c d c] [Bes As G F] |
+        [Es as g f] [es des c Bes] [As8 c' bes as] |
+        [g8 f g as] [d es f d] |
+        [es as g f] [g es d c] |
+        [d bes as g] [as f es d!] |
+%% 15
+        es8 r8 r4 r8 [c Bes A] |
+        r [es d c] [d c16 Bes] [c8 d] |
+        [G8 bes16 a] [bes8 d] [es c'16 bes] [c'8 e] |
+        [f d'16 c'] [d'8 fis] g4 r16 [G A B] |
+        [c16 d es8~] [es16 A Bes c] [d es f8~] [f16 'b c d] |
+%% 20    
+        es8 r r e [f F Es! D] |     % see comment above about octave range
+        r [As G F] [G F16 Es] [F8 G] |
+        [c16 d  es d] [c Bes As G] [F bes as g] [f es d c] |
+        [Bes c d c] [Bes As G F] [Es as g f] [es d c Bes] |
+        [As Bes c Bes] [As G F Es] [D g f es] [d c B A] |
+%% 25
+        g4 r4 r16 [G A B] [c d es f] |
+        [g f as g] [f es d c] [B8 c16 B] [c8 G] |
+        [As c16 B] [c8 d] [G c16 B] [c8 d] |
+        [F16 G] As4 [G16 F] Es4 r8 es |
+        [d c g G]
+%% 30
+        < \multivoice 
+        { \stem 1; c2~ | c1~ | c1 }
+        { \stem -1; C2~ | C1~ | C1 }
+        >
+    }
 
-}
 
 % every "melody" declared in a staff has its own "voicegroup"
-trebstaf = \staff{ 
-       \inputregister{ melodicregs}
-       global dux comes 
-}
-       
-\score{
-       trebstaf
-       \staff{ \inputregister{ melodicregs}
-               bassdux global 
-       }
-       \paper{}
-       \midi{
-               \tempo 4:84
-       }
+trebstaf =
+    \staff { 
+        \inputregister{melodicregs}
+        global dux comes 
+    }
+
+        
+\score {
+    trebstaf
+    \staff {
+        \inputregister{melodicregs}
+        global bassdux
+    }
+    \paper{}
+    \midi {
+        \tempo 4:84
+    }
 }
 
+% EOF
+
+
index 1b738507af96665162d7cf170b457c6fe3d6bf83..4a46bf9e64b69caacb6abbd9141add9a9e26e828 100644 (file)
@@ -121,18 +121,23 @@ Duration_convert::mom2standardised_dur( Moment mom )
        for ( int i = 0; i < dur_array_s.size() - 1; i++ ) {
                Moment lower_mom = dur2_mom( dur_array_s[ i ] );
                if ( mom <= lower_mom ) {
-                       // all arbitrary, but 1/4 will get rid of the noise...
-//                     if ( i || ( mom / lower_mom > Moment( 3, 4 ) ) )
-//kinda ok             if ( i || ( mom / lower_mom > Moment( 2, 4 ) ) )
-                       if ( i || ( mom / lower_mom > Moment( 2, 6 ) ) )
+                       // all arbitrary, but 3/4 will get rid of the noise...
+                       // kinda ok
+                       if ( i || ( mom / lower_mom > Moment( 3, 4 ) ) )
                                return dur_array_s[ i ];
                        else
                                return Duration( 0 );
                }
                Moment upper_mom = dur2_mom( dur_array_s[ i + 1 ] );
+#if 0  // % deviation of upper/lower from mom, perhaps it's better to use
                if ( ( mom < upper_mom )
                         && ( ( mom - lower_mom ) / mom
                                < ( upper_mom - mom ) / mom ) )
+#else // % deviation of mom from lower/upper?
+               if ( ( mom < upper_mom )
+                        && ( ( mom - lower_mom ) / lower_mom
+                               < ( upper_mom - mom ) / upper_mom ) )
+#endif
                        return dur_array_s[ i ];
        }
 //     return dur_array_s[ dur_array_s.length_i() ];
index ab93a5472ff5f72cfbba9495c7b6abff80390c9d..17a7b341a8dcc408283ae5bbcdc4ddbc3c0ef894 100644 (file)
 
 #include "fproto.hh"
 #include "real.hh"
-
-struct Absolute_dynamic_req;
-struct Accidental;
-struct Atom;
-struct Bar;
-struct Bar_register;
-struct Barcheck_req;
-struct Bar_req;
-struct Beam;
-struct Beam_req;
-struct Blank_req;
-struct Box;
-struct Bracket_req;
-struct Cadenza_req;
-struct Chord;
-struct Clef_change_req;
-struct Clef_register;
-struct Clef_item;
-struct Col_hpositions;
-struct Colinfo;
-struct Complex_music;
-struct Complex_staff;
-struct Complex_walker;
-struct Crescendo ;
-struct Cresc_req;
-struct Directional_spanner;
-struct Decresc_req;
 struct Duration;
 struct Duration_iterator;
-struct Durational_req;
-struct Dynamic;
-struct Dynamic_req;
-struct Group_change_req;
-struct Group_feature_req;
-struct Idealspacing;
-struct Identifier;
-struct Input;
-struct Input_register;
-struct Input_file;
-struct Input_music;
-struct Input_score;
-struct Input_staff;
-struct Item;
-struct Key;
-struct Key_register;
-struct Key_change_req;
-struct Key_item;
-struct Keyword;
-struct Keyword_table;
-struct Lily_stream;
-struct Line_of_score;
-struct Line_of_staff;
-struct Linestaff;
-struct Local_key;
-struct Local_key_register;
-struct Local_key_item;
-struct Lookup;
-struct Lyric_item;
-struct Lyric_req;
-struct Melodic_req;
-struct Measure_grouping_req;
-struct Meter_change_req;
-struct Meter;
-struct Meter_register;
-struct Midi_def;
-struct Midi_duration;
-struct Midi_event;
-struct Midi_header;
-struct Midi_item;
-struct Midi_key;
-struct Midi_note;
-struct Midi_output;
-struct Midi_pitch;
-struct Midi_staff;
-struct Midi_stream;
-struct Midi_tempo;
-struct Midi_time;
-struct Midi_track;
-struct Midi_voice;
-struct Midi_walker;
-struct Mixed_qp;
-struct My_midi_lexer;
-struct My_midi_parser;
-struct Midi_event;
-struct Midi_score;
-struct Midi_track;
-struct Molecule;
-struct Musical_req;
-struct Music_general_chord;
-struct Music_voice;
-struct Command_req;
-struct Note_req;
-struct Notehead;
-struct Notehead_register;
-struct Offset;
-struct Output;
-struct PCol;
-struct Plet_req;
-struct Plet;
-struct PScore;
-struct PStaff;
-struct Paper_def;
-struct Partial_measure_req;
-struct Rational;
-struct Register_group_register;
-struct Request;
-struct Request_register;
-struct Rest;
-struct Rest_req;
-struct Rhythmic_grouping;
-struct Rhythmic_grouping_req;
-struct Rhythmic_req;
-struct Score;
-struct Score_column;
-struct Score_walker;
-struct Script_def;
-struct Script;
-struct Script_register;
-struct Script_req;
-struct Simple_music;
-struct Skip_req;
-struct Slur;
-struct Slur_register;
-struct Slur_req;
-struct Sources;
 struct Source_file;
-struct Spacing_req ;
-struct Span_req;
-struct Span_dynamic_req;
-struct Spanner;
-struct Subtle_req;
-struct Staff;
-struct Staff_column;
-struct Staff_symbol;
-struct Staff_walker;
-struct Stem;
-struct Stem_req;
-struct Stem_beam_register;
-struct String;
-struct Symbol;
-struct Symtable;
-struct Symtables;
-struct Tex_stream;
-struct Terminate_voice_req;
-struct Text_item ;
-struct Text_def;
-struct Text_gob;
-struct Text_register;
-struct Text_req;
-struct Timing_req;
-struct Time_description;
-struct Track_column;
-struct Voice;
-struct Voice_element;
-struct Voice_group_registers;
-struct Voice_list;
-struct Voice_registers;
-struct Voicegroup;
-struct Walker_registers;
-typedef Rational Moment;
+struct Sources;
 #endif // PROTO_HH
index 99e15e56f5a873c69d59afb475d4035dd8f99a72..bc4a859c0a2121869443c65b6cd5e4c433fe3f7c 100644 (file)
@@ -5,21 +5,19 @@
 
 #ifndef SOURCE_HH
 #define SOURCE_HH
-#include "source-file.hh"
 #include "plist.hh"
-#include "path.hh"
 class Sources 
 {
 public:
     Source_file * get_file_l( String &filename );
-    Source_file* sourcefile_l( char const* ch_c_l );
+    Source_file* sourcefile_l( char const* ch_C );
     void set_path(File_path*p_C);
     Sources();
     void set_binary(bool);
 private:
     const File_path * path_C_;
     void add( Source_file* sourcefile_p );
-    Pointer_list<Source_file*> sourcefile_p_iplist_;
+    Pointer_list<Source_file*> sourcefile_p_list_;
     bool binary_b_ ;
 };
 
index 8901c8f7934f123245d0084ac882affcfa1ec574..6be3ca42fc82473dc10dd351542674153a8776f2 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  source.cc -- implement Source
+  source.cc -- implement Sources
 
   source file of the LilyPond music typesetter
 
@@ -15,6 +15,7 @@
 #include "plist.hh"
 #include "source-file.hh"
 #include "source.hh"
+#include "path.hh"
 
 void
 Sources::set_path(File_path *f_C)
@@ -54,7 +55,7 @@ Sources::Sources()
 void
 Sources::add( Source_file* sourcefile_p )
 {
-    sourcefile_p_iplist_.bottom().add( sourcefile_p );
+    sourcefile_p_list_.bottom().add( sourcefile_p );
 }
 
 /**
@@ -65,7 +66,7 @@ Sources::add( Source_file* sourcefile_p )
 Source_file*
 Sources::sourcefile_l( char const* ch_C )
 {
-    PCursor<Source_file*> sourcefile_l_pcur( sourcefile_p_iplist_.top() );
+    PCursor<Source_file*> sourcefile_l_pcur( sourcefile_p_list_.top() );
     for ( ; sourcefile_l_pcur.ok(); sourcefile_l_pcur++ )
        if ( sourcefile_l_pcur->in_b( ch_C ) )  
            return *sourcefile_l_pcur;
index a01151100b75616c464676cca43edca578fbf52a..b7c968121e75269fe617fb017b70adb501d22a0a 100644 (file)
@@ -1,6 +1,6 @@
 MAJOR_VERSION = 0
 MINOR_VERSION = 0
-PATCH_LEVEL = 64
+PATCH_LEVEL = 65
 
 # use to send patches, always empty for released version:
 # include separator: ".postfix", "-pl" makes rpm barf
index 08088271ffa95932e738483c771b8beb82aa3869..23145c0b408ddc1a23c552778c1dffff4c10ab40 100644 (file)
@@ -16,7 +16,6 @@ depth = ..
 #
 include Stable.make
 include ./$(depth)/make/Variables.make
-include ./$(depth)/make/Files.make 
 include .version
 #
 
@@ -48,6 +47,7 @@ MODULE_LIBES= -llily -lflower
 #
 default: $(EXECUTABLE)
 #
+include ./$(depth)/make/Files.make 
 
 # generic targets and rules:
 #
@@ -61,16 +61,6 @@ $(outdir)/lexer.cc: $(outdir)/parser.hh
 
 #
 
-# list of depend files:
-#
-DEPFILES = $(wildcard $(depdir)/*.dep)
-#
-
-# auto dependencies:
-#
--include /dev/null $(DEPFILES)
-#
-
 
 localclean:
        rm -f $(outdir)/parser.* $(outdir)/lexer.cc
index e7eee4cd6b09e8e6f1e86e976787c7bb8af64216..f32586508f3d3d57ff3a1a3e2741d24a170d2276 100644 (file)
@@ -4,8 +4,8 @@
 stablecc=command-request.cc musical-request.cc bar.cc boxes.cc \
        item.cc keyword.cc leastsquares.cc \
        lookup.cc molecule.cc meter.cc\
-       paper-def.cc parser.cc lexer.cc p-staff.cc qlp.cc qlpsolve.cc\
+       paper-def.cc parser.cc lexer.cc qlp.cc qlpsolve.cc\
        template1.cc template2.cc template3.cc template4.cc\
        template5.cc template6.cc version.cc tex-stream.cc  tex.cc\
-       voice.cc spanner.cc \
+       voice.cc \
        voice-element.cc identifier.cc note.cc\
index 4dd6199ce148aa4613d313f5436f535d6beabae5..c66a33bdb4cab77d877adfe4b79dd76083b76d2c 100644 (file)
@@ -1,7 +1,7 @@
 /*
   bar-reg.cc -- implement Bar_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -9,7 +9,6 @@
 #include "bar-reg.hh"
 #include "bar.hh"
 #include "command-request.hh"
-//#include "score-column.hh"
 #include "time-description.hh"
 
 Bar_register::Bar_register()
index 96071ad385b8a7001f9bf75db1ff2b2e72767040..8a6891b330bab5ac50a075e6dc59e588e47d60e8 100644 (file)
@@ -1,7 +1,7 @@
 /*
   bar.cc -- implement Bar
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 7052fae9fb09a64bc59a8a16c312f3d540c79238..e838f90ea03c0c8adff09d26b4cd4ba0fdc8b2fd 100644 (file)
@@ -1,14 +1,14 @@
 /*
   beam.cc -- implement Beam
 
-  source file of the LilyPond music typesetter
+  source file of the GNU GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 
   TODO
 
   Less hairy code. Better slope calculations.
-  knee ([\stem 1; c8 \stem -1; c8]
+  knee: ([\stem 1; c8 \stem -1; c8]
   
 */
 
@@ -50,15 +50,21 @@ Stem_info::Stem_info(Stem const *s)
     assert(miny <= idealy);
 }
 
+
 /* *************** */
+void
+Beam::do_break_at(PCol*l, PCol*r)
+{
+    assert (l->line_l_ == r->line_l_);
+}
+
+
 
 Offset
 Beam::center()const
 {
-    assert(status >= POSTCALCED);
-
     Real w=(paper()->note_width() + width().length())/2.0;
-    return Offset(w, (left_pos + w* slope)*paper()->internote());
+    return Offset(w, (left_pos + w* slope)*paper()->internote_f());
 }
 
 
@@ -71,7 +77,7 @@ Beam::Beam()
 void
 Beam::add(Stem*s)
 {
-    stems.bottom().add(s);
+    stems.push(s);
     s->add_dependency(this);
     s->print_flag_b_ = false;
 }
@@ -79,16 +85,21 @@ Beam::add(Stem*s)
 void
 Beam::set_default_dir()
 {
-    int dirs[2];
-    dirs[0]=0; dirs[1] =0;
-    for (iter_top(stems,i); i.ok(); i++) {
-       int d = i->get_default_dir();
-       dirs[(d+1)/2] ++;
-    }
-    dir_i_ =  (dirs[0] > dirs[1]) ? -1 : 1;
-    for (iter_top(stems,i); i.ok(); i++) {
-       i->dir_i_ = dir_i_;
+    int dirs_single = 0, dirs_chord = 0;
+    for (int i=0; i <stems.size(); i++) {
+       Stem *sl = stems[i];
+       if (sl->chord_b())
+           dirs_chord += sl->get_default_dir();
+       else
+           dirs_single += sl->get_center_distance();
     }
+    dirs_single = -sign(dirs_single);
+    dir_i_ = (dirs_single + dirs_chord > 0) ? 1 : -1;
+
+   for (int i=0; i <stems.size(); i++) {
+       Stem *sl = stems[i];
+       sl->dir_i_ = dir_i_;
+   }
 }
 
 /*
@@ -98,7 +109,9 @@ void
 Beam::solve_slope()
 {
     Array<Stem_info> sinfo;
-    for (iter_top(stems,i); i.ok(); i++) {
+  for (int j=0; j <stems.size(); j++) {
+       Stem *i = stems[j];
+
        i->set_default_extents();
        if (i->invisible_b())
            continue;
@@ -127,17 +140,18 @@ Beam::solve_slope()
     slope *= dir_i_;
 
                                // ugh
-    Real sl = slope*paper()->internote();
+    Real sl = slope*paper()->internote_f();
     paper()->lookup_l()->beam(sl, 20 PT);
-    slope = sl /paper()->internote();
+    slope = sl /paper()->internote_f();
 }
 
 void
 Beam::set_stemlens()
 {
-    iter_top(stems,s);
-    Real x0 = s->hpos_f();    
-    for (; s.ok() ; s++) {
+    Real x0 = stems[0]->hpos_f();    
+    for (int j=0; j <stems.size(); j++) {
+       Stem *s = stems[j];
+
        Real x =  s->hpos_f()-x0;
        s->set_stemend(left_pos + slope * x);   
     }
@@ -162,9 +176,10 @@ Beam::set_grouping(Rhythmic_grouping def, Rhythmic_grouping cur)
 
     Array<int> b;
     {
-       iter_top(stems,s);
        Array<int> flags;
-       for (; s.ok(); s++) {
+       for (int j=0; j <stems.size(); j++) {
+           Stem *s = stems[j];
+
            int f = intlog2(abs(s->flag_i_))-2;
            assert(f>0);
            flags.push(f);
@@ -176,28 +191,18 @@ Beam::set_grouping(Rhythmic_grouping def, Rhythmic_grouping cur)
        assert(stems.size() == b.size()/2);
     }
 
-    iter_top(stems,s);
-    for (int i=0; i < b.size() && s.ok(); i+=2, s++) {
+    for (int j=0, i=0; i < b.size() && j <stems.size(); i+= 2, j++) {
+       Stem *s = stems[j];
        s->beams_left_i_ = b[i];
        s->beams_right_i_ = b[i+1];
     }
 }
 
-
-// todo.
-Spanner *
-Beam::do_break_at( PCol *, PCol *) const
-{
-    Beam *beam_p= new Beam(*this);
-    
-    return beam_p;
-}
-
 void
 Beam::do_pre_processing()
 {
-    left_col_l_ = (*stems.top())   ->pcol_l_;
-    right_col_l_ = (*stems.bottom())->pcol_l_;    
+    left_col_l_ = stems[0]   ->pcol_l_;
+    right_col_l_ = stems.top()->pcol_l_;    
     assert(stems.size()>1);
     if (!dir_i_)
        set_default_dir();
@@ -208,9 +213,8 @@ Beam::do_pre_processing()
 Interval
 Beam::do_width() const
 {
-    Beam * me = (Beam*) this;  // ugh
-    return Interval( (*me->stems.top()) ->hpos_f(),
-                    (*me->stems.bottom()) ->hpos_f() );
+    return Interval( stems[0]->hpos_f(),
+                    stems.top()->hpos_f() );
 }
 
 /*
@@ -221,9 +225,9 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
 {
     assert( !next || next->hpos_f() > here->hpos_f()  );
     assert( !prev || prev->hpos_f() < here->hpos_f()  );
-    Real dy=paper()->internote()*2;
+    Real dy=paper()->internote_f()*2;
     Real stemdx = paper()->rule_thickness();
-    Real sl = slope*paper()->internote();
+    Real sl = slope*paper()->internote_f();
     paper()->lookup_l()->beam(sl, 20 PT);
 
     Molecule leftbeams;
@@ -280,15 +284,13 @@ Molecule*
 Beam::brew_molecule_p() const 
 {
     Molecule *out=0;
-    Real inter=paper()->internote();
+    Real inter=paper()->internote_f();
     out = new Molecule;
-    Real x0 = stems.top()->hpos_f();
-    
-    for (iter_top(stems,i); i.ok(); i++) {
-       PCursor<Stem*> p(i-1);
-       PCursor<Stem*> n(i+1);
-       Stem * prev = p.ok() ? p.ptr() : 0;
-       Stem * next = n.ok() ? n.ptr() : 0;
+    Real x0 = stems[0]->hpos_f();
+    for (int j=0; j <stems.size(); j++) {
+       Stem *i = stems[j];
+       Stem * prev = (j > 0)? stems[j-1] : 0;
+       Stem * next = (j < stems.size()-1) ? stems[j+1] :0;
 
        Molecule sb = stem_beams(i, next, prev);
        Real  x = i->hpos_f()-x0;
@@ -310,7 +312,11 @@ Beam::do_print()const
 #endif
 }
 
-Beam::~Beam()
+void
+Beam::do_substitute_dependency(Score_elem*o,Score_elem*n)
 {
-
+    int i;
+    while ((i=stems.find_i((Stem*)o->item())) >=0) 
+          if (n) stems[i] = (Stem*) n->item();
+          else stems.del(i);
 }
index 5e463408e125c3a8c36a55df147d1ba654700101..2de418ebdf8b2f3672d7e43749a9116befa283c6 100644 (file)
@@ -1,7 +1,7 @@
 /*
   bow.cc -- implement Bow
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -24,9 +24,10 @@ Bow::center() const
 
     Real w = width().length();
 
-    return Offset(w/2,dy * paper()->internote());
+    return Offset(w/2,dy * paper()->internote_f());
 }
 
+
 Molecule*
 Bow::brew_molecule_p() const
 {
@@ -36,7 +37,7 @@ Bow::brew_molecule_p() const
     int dy = right_pos_i_ - left_pos_i_;
     
     Real nw_f = paper()->note_width();
-    Real nh_f = paper()->internote();
+    Real nh_f = paper()->internote_f();
 
     
     w+= (right_dx_f_ - left_dx_f_) * nw_f ;
index 8a9a426657e1b5accc6e0c9038d792fb1f7ad5b8..1513046a9121b1049e541e36ac55efc3a3dc4528 100644 (file)
@@ -1,7 +1,7 @@
 /*
   break.cc -- implement Break_algorithm
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -13,7 +13,7 @@
 #include "debug.hh"
 #include "scoreline.hh"
 #include "p-score.hh"
-
+#include "p-col.hh"
 
 ///  return all breakable columns
 Line_of_cols
index af654d15bd1bfa055d125ca5717181ee9ff51b06..11c1aa2d2cb0b42ed9999c5338614f9f9329f13b 100644 (file)
@@ -1,7 +1,7 @@
 /*
   calcideal.cc -- implement Score::calc_idealspacing()
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 48e63b7f3b57025e3075f7ae5f27fed53c3ff49a..055b282b2ef59806f90a8280abbd44ad2cc8afaf 100644 (file)
@@ -1,7 +1,7 @@
 /*
   clef-item.cc -- implement Clef_item
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -48,7 +48,7 @@ Clef_item::brew_molecule_p()const
        t += "_change";
     Symbol s = paper()->lookup_l()->clef(t);
     Molecule*output = new Molecule(Atom(s));
-    output->translate(Offset(0, paper()->internote() * y_off));
+    output->translate(Offset(0, paper()->internote_f() * y_off));
     return output;
 }
 
index 63e4a505fc45beb7230857e3ff7de307fa3e5fb0..9f1d5fa9c7bed8c2311eda5691119a10ec1031d2 100644 (file)
@@ -1,7 +1,7 @@
 /*
   clef.cc -- implement  Clef_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>,
   Mats Bengtsson <matsb@s3.kth.se>
index 6b9da7706229b435cdf7db2027be110b6c91f469..73582d5d9072f36d44a704d61f985d47d15a7e6c 100644 (file)
@@ -1,7 +1,7 @@
 /*
   collision-reg.cc -- implement Collision_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 7e1f0988d7989671dad1021eb2a5d3c260157061..8f43ee4233b86f180dff743d78c4ca80638420dd 100644 (file)
@@ -1,14 +1,14 @@
 /*
   collision.cc -- implement Collision
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 #include "debug.hh"
 #include "collision.hh"
 #include "note-column.hh"
-#include "notehead.hh"
+#include "note-head.hh"
 #include "paper-def.hh"
 
 Collision::Collision()
@@ -21,7 +21,9 @@ Collision::add(Note_column* ncol_l)
     clash_l_arr_.push(ncol_l);
     add_dependency(ncol_l);
 }
-
+/**
+  should derive of Array.
+ */
 static 
 int idx(int dir, bool h_shift_b)
 {
@@ -105,26 +107,28 @@ Collision::do_pre_processing()
   
     // y_extent: smallest y-pos noteball interval containing all balls
     // 4 (0..3) groups: stem up/down; shift on/off; 
-    Interval_t<int> middle( y_extent[0].min(), y_extent[3].max());
-    Interval_t<int> open_middle( y_extent[3].max()+1, y_extent[0].min()-1);
+    Interval_t<int> middle( y_extent[idx(-1,0)].max(),
+                           y_extent[idx(1,0)].min() );
+    Interval_t<int> open_middle( y_extent[idx(-1,0)].max()+1, y_extent[idx(1,0)].min()-1);
     do{
        if (!open_middle.contains_b(y_extent[idx(d,true)]))
            x_off[idx(d, true)] = d *1.0 ;
     } while ((d *= -1) != 1);
    
-    if (!middle.empty_b() && 
-       middle.length() <= 2 && col_l_a[idx(1,0)] && col_l_a[idx(-1,0)]) {      
+    if (!middle.empty_b() 
+       && middle.length() < 2 && col_l_a[idx(1,0)] && col_l_a[idx(-1,0)]) {    
 // reproduction of bugfix at 3am ?
-       Notehead * nu_l= col_l_a[idx(1,0)]->head_l_arr_[0];
-       Notehead * nd_l = col_l_a[idx(-1,0)]->head_l_arr_.top();
-       if (! (nu_l->balltype_i_ == nd_l->balltype_i_ && nu_l->dots_i_ == nd_l->dots_i_)) {
+       Note_head * nu_l= col_l_a[idx(1,0)]->head_l_arr_[0];
+       Note_head * nd_l = col_l_a[idx(-1,0)]->head_l_arr_.top();
+       if (! (nu_l->balltype_i_ == nd_l->balltype_i_ && nu_l->dots_i_ == nd_l->dots_i_  && middle.length() == 0 )) {
            x_off[idx(1,0)] -= 0.5;
-           x_off[1] -= 0.5;
-           x_off[2] += 0.5;
+           x_off[idx(1,1)] -= 0.5;
+           x_off[idx(-1,1)] += 0.5;
            x_off[idx(-1,0)] += 0.5;
        }
+       
     }    
-    Real inter_f = paper()->internote();
+    Real inter_f = paper()->internote_f();
     Real wid_f = paper()->note_width();
     for (int j=0; j < 4; j++) {
        if (col_l_a[j])
@@ -135,3 +139,10 @@ Collision::do_pre_processing()
 }
 
 IMPLEMENT_STATIC_NAME(Collision);
+
+void
+Collision::do_substitute_dependency(Score_elem*o_l,Score_elem*n_l)
+{
+    clash_l_arr_.substitute((Note_column*)o_l->item(), 
+                           (Note_column*)(n_l?n_l->item():0));
+}
index e4334f1d69a3d03f84740df617544768806d9640..83cb258ffb32dc92972b3edee47ea348fc4afcb3 100644 (file)
@@ -1,7 +1,7 @@
 /*
   commandrequest.cc -- implement Nonmusical reqs
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
diff --git a/lily/complex-staff.cc b/lily/complex-staff.cc
deleted file mode 100644 (file)
index 57d2fc0..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "complex-staff.hh"
-#include "complex-walker.hh"
-#include "p-score.hh"
-
-/** Aside from putting fields right
- */
-void
-Complex_staff::set_output(PScore* pscore_l )
-{
-    pstaff_l_ = new PStaff(pscore_l);
-    pscore_l_ = pscore_l;
-    pscore_l_->add(pstaff_l_);
-}
-
-
-Staff_walker * 
-Complex_staff::get_walker_p()
-{
-    return new Complex_walker(this);
-}
index 1e1ac452d78d07feb5e2cb0c2cd48ec968e41bfc..d32d9db2eb6545040be1d1cc74949a0e62ce64e0 100644 (file)
@@ -1,18 +1,20 @@
 /*
   complex-walker.cc -- implement Complex_walker
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
-
+#include "score.hh" 
 #include "staff-column.hh"
 #include "voice.hh"
 #include "p-score.hh"
-#include "complex-staff.hh"
 #include "debug.hh"
 #include "complex-walker.hh"
 #include "walk-regs.hh"
+#include "score-elem.hh"
+#include "staff.hh"
+#include "staffline.hh"
 
 void
 Complex_walker::do_post_move()
@@ -72,14 +74,15 @@ Complex_walker::typeset_element(Score_elem *elem_p)
 {
     if (!elem_p)
        return;
+    staff_l_->staff_line_l_->add_element(elem_p);
     if (elem_p->spanner())
-       pscore_l_->typeset_spanner(elem_p->spanner(), staff()->pstaff_l_);
+       pscore_l_->typeset_unbroken_spanner(elem_p->spanner());
     else
        ptr()->typeset_musical_item(elem_p->item()); 
 }
 
-Complex_walker::Complex_walker(Complex_staff*s)
-    : Staff_walker(s, s->pstaff_l_->pscore_l_)
+Complex_walker::Complex_walker(Staff*s)
+    : Staff_walker(s, s->score_l_->pscore_p_)
 {
     walk_regs_p_ = new Walker_registers(this);    
     do_post_move();
@@ -88,12 +91,7 @@ Complex_walker::Complex_walker(Complex_staff*s)
 
 Complex_walker::~Complex_walker()
 {
-}
-
-Complex_staff*
-Complex_walker::staff()
-{
-    return (Complex_staff*) staff_l_;
+    delete walk_regs_p_;
 }
 
 
index f520106c19f0e7cc571f7d635ed368740c470f5d..98317f85e2fa3b1f7540ad28c1f1a2370cc94a2e 100644 (file)
@@ -1,10 +1,11 @@
 /*
   crescendo.cc -- implement Crescendo
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
+
 #include "dimen.hh"
 #include "crescendo.hh"
 #include "lookup.hh"
 #include "debug.hh"
 
 Crescendo::Crescendo()
-    : Staff_side(this)
 {
     grow_dir_i_ =0;
     dir_i_ = -1 ;
     left_dyn_b_ = right_dyn_b_ =false;
 }
 
-Spanner*
-Crescendo::do_break_at(PCol*, PCol*)const
-{
-    return new Crescendo(*this);
-}
 
 
 Molecule*
@@ -44,7 +39,7 @@ Crescendo::brew_molecule_p() const
     }
     
     if (w_dim < 0) {
-       error("Crescendo too small");
+       warning("Crescendo too small");
        w_dim = 0;
     }
     Real lookup_wid = w_dim * 0.9; // make it slightly smaller.
@@ -53,7 +48,7 @@ Crescendo::brew_molecule_p() const
     m_p->add(Atom(s));
     int pos = get_position_i(s.dim.y);
     m_p->translate(Offset(x_off_dim + 0.05 * w_dim, 
-                         pos * paper()->internote()));
+                         pos * paper()->internote_f()));
     return m_p;
 }
 
index 9e5fc2cea0abaa8186fc6f80f155ae092e0d9a62..e609836a46cc4ed12342be371d5f5c664db725d1 100644 (file)
@@ -33,7 +33,7 @@ convert_dimen(Real quant, String unit)
 String
 print_dimen(Real r)
 {
-    String s(r);
+    String s(r, "%.3f");
     s += "pt ";
     return s;
 }
index 20ffe5cfe32ad63f5701572613680722f3c5ed88..94b887432a47a6f8c60e0e90c4f578cd136cc2b8 100644 (file)
@@ -1,7 +1,7 @@
 /*
   dynamic-reg.cc -- implement Dynamic_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
diff --git a/lily/elem-group.cc b/lily/elem-group.cc
new file mode 100644 (file)
index 0000000..e4a012d
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+  elem-group.cc -- implement Element_group
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "elem-group.hh"
+#include "interval.hh"
+#include "item.hh"
+#include "debug.hh"
+
+Interval
+Element_group::do_height()const 
+{
+    Interval r;
+    for (int i=0; i < elem_l_arr_.size(); i++) 
+       r.unite(elem_l_arr_[i]->height());
+    return r;
+}
+
+Interval
+Element_group::do_width()const 
+{
+    Interval r;
+    for (int i=0; i < elem_l_arr_.size(); i++) 
+       if (elem_l_arr_[i]->item()) // makes no at preprocessing for spanners. 
+           r.unite(elem_l_arr_[i]->width());
+    return r;
+}
+
+void
+Element_group::add_element(Score_elem*i_l)
+{
+    i_l->group_element_i_ ++;
+    
+    assert(! elem_l_arr_.find_l(i_l));
+    elem_l_arr_.push(i_l);
+    add_dependency(i_l);
+}
+
+void
+Element_group::translate(Offset o)
+{
+    for (int i=0; i < elem_l_arr_.size(); i++) 
+       elem_l_arr_[i]->translate(o);
+}
+
+IMPLEMENT_STATIC_NAME(Element_group);
+
+void
+Element_group::do_print() const
+{
+#ifndef NPRINT
+    for (int i=0; i < elem_l_arr_.size(); i++) 
+       mtor << elem_l_arr_[i]->name() << ' ';
+#endif
+}
+
+void
+Element_group::do_substitute_dependency(Score_elem* old, Score_elem *new_l)
+{
+    int i;
+
+    while ((i=elem_l_arr_.find_i(old))>=0) {
+       
+       old->group_element_i_--;
+       if (new_l){ 
+           new_l->group_element_i_ ++;
+           elem_l_arr_[i] = new_l;
+       }else {     
+           elem_l_arr_.del(i);
+       }
+    }
+
+}
+
+String
+Element_group::TeX_string()const
+{
+    return "";
+}
+
+Element_group::Element_group(Element_group const&s)
+    :elem_l_arr_(s.elem_l_arr_)
+{
+   for (int i=0; i < elem_l_arr_.size(); i++) 
+       elem_l_arr_[i]->group_element_i_ ++;   
+}
+
+Element_group::Element_group()
+{}
index 3451ca5270a231fc51d18c95cb5ee251d2fb1528..f05f98c6aa4a6fba2f2bc6131f0691ef96a4b537 100644 (file)
@@ -1,7 +1,7 @@
 /*
   global-regs.cc -- implement 
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index b44a9d90e4f66d2d9da2287ec141310ec1e393e5..9d466b912f6bb4f5ccaf8e4d8132f742d201a18b 100644 (file)
@@ -1,7 +1,7 @@
 /*
   grouping.cc -- implement Rhythmic_grouping
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 562dbea654e08ff5ca22ea9cde09dd45479a5fd7..b704f1803e4825c02fc69222075c67c76e16c2c4 100644 (file)
@@ -1,23 +1,23 @@
 /*
-  headreg.cc -- part of LilyPond
+  headreg.cc -- part of GNU LilyPond
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
-#include "notehead.hh"
+#include "note-head.hh"
 #include "head-reg.hh"
 #include "paper-def.hh"
 #include "complex-walker.hh"
 #include "musical-request.hh"
 
-Notehead_register::Notehead_register()
+Note_head_register::Note_head_register()
 {
     note_p_ = 0;
     post_move_processing();
 }
 
 bool
-Notehead_register::try_request(Request *req_l) 
+Note_head_register::try_request(Request *req_l) 
 {
     if (req_l->note() || req_l->rest())
        note_req_l_=req_l->rhythmic();
@@ -28,12 +28,12 @@ Notehead_register::try_request(Request *req_l)
 }
 
 void
-Notehead_register::process_requests()
+Note_head_register::process_requests()
 {
     if (!note_req_l_)
        return;
     
-    Notehead*n_p = new Notehead(8);    // ugh
+    Note_head*n_p = new Note_head(8);  // ugh
     note_p_ = n_p;
     n_p->set_rhythmic(note_req_l_->rhythmic());
 
@@ -45,7 +45,7 @@ Notehead_register::process_requests()
        if (note_req_l_->rhythmic()->duration_.type_i_ <= 2)
            note_p_->translate(
                Offset(0,
-                      6 * paper()->internote()));
+                      6 * paper()->internote_f()));
     }
     
     Score_elem_info itinf(note_p_,note_req_l_);
@@ -53,7 +53,7 @@ Notehead_register::process_requests()
 }
 
 void
-Notehead_register::pre_move_processing()
+Note_head_register::pre_move_processing()
 {
     if (note_p_) {
        typeset_element(note_p_);
@@ -61,10 +61,10 @@ Notehead_register::pre_move_processing()
     }
 }
 void
-Notehead_register::post_move_processing()
+Note_head_register::post_move_processing()
 {
     note_req_l_ = 0;
 }
 
-IMPLEMENT_STATIC_NAME(Notehead_register);
-ADD_THIS_REGISTER(Notehead_register);
+IMPLEMENT_STATIC_NAME(Note_head_register);
+ADD_THIS_REGISTER(Note_head_register);
index 8437aabe223eacb46b094b317d9cc43be68f23bb..f1ff3691d567ad25b89509d2284b2e9683f265fc 100644 (file)
@@ -1,7 +1,6 @@
 #include "idealspacing.hh"
 #include "p-col.hh"
 #include "p-score.hh"
-#include "p-staff.hh"
 #include "debug.hh"
 
 void
@@ -10,7 +9,7 @@ Idealspacing::print() const
 #ifndef NPRINT
     mtor << "idealspacing {" ;
     mtor << "distance "<<space<< " strength " << hooke ;
-    mtor << "left " << left->rank() << " right " << right->rank() << "}\n";
+    mtor << "left " << left->rank_i() << " right " << right->rank_i() << "}\n";
 #endif
 }
 
index 72224f92f91c7cfb342767476f22dce220bf9f6b..9829e40a42101ec67d3ab8fd1bdd10ab62631311 100644 (file)
@@ -1,7 +1,7 @@
 /*
   identifier.cc -- implement identifier and derived classes
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index c73e5d1f4f88bc5fa7cda9cb6c0a124443e61763..5879cb948bbbf5f17e297ec0d57bf3cb514c09b6 100644 (file)
@@ -1,7 +1,7 @@
 /*
   bar-reg.hh -- declare Bar_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 733cd26237feb443701e62e4c9068dae7b04ad25..ea23bd07bccfdf5bbc74f537c699f901113e4d3b 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  bar.hh -- part of LilyPond
+  bar.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
index a898628d358663c0d0b2f43ba1bbbab0f273b7f1..d9c7a0a9b0ebd5de824c9ab2544a244aea7c6e47 100644 (file)
@@ -1,20 +1,21 @@
 /*
-  beam.hh -- part of LilyPond
+  beam.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
 
 #ifndef BEAM_HH
 #define BEAM_HH
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "directional-spanner.hh"
 #include "plist.hh"
 
 /** a beam connects multiple stems Beam adjusts the stems its owns to
   make sure that they reach the beam and that point in the correct
   direction */
-struct Beam:  public Directional_spanner {
-    Link_list<Stem*> stems;
+class Beam:  public Directional_spanner {
+public:
+    Link_array<Stem> stems;
     /// the slope of the beam in posns / point (dimension)   
     Real slope;
 
@@ -23,23 +24,24 @@ struct Beam:  public Directional_spanner {
    
 
     /* *************** */
-NAME_MEMBERS(Beam);
-    
-    virtual Interval do_width()const;    
-    Offset center() const;
-    Spanner *do_break_at(PCol *,  PCol *) const;
+    NAME_MEMBERS(Beam);
     Beam();
     void add(Stem*);
     
 
-    void set_default_dir();
-    void do_pre_processing();
-    void do_post_processing();
-
-    void do_print() const;
     void set_grouping(Rhythmic_grouping def, Rhythmic_grouping current);
     void set_stemlens();
-    ~Beam();
+    SPANNER_CLONE(Beam)
+protected:
+    virtual Interval do_width()const;    
+    virtual Offset center() const;
+    virtual void do_break_at(PCol *,  PCol *);
+    virtual void set_default_dir();
+    virtual void do_pre_processing();
+    virtual void do_post_processing();
+    virtual void do_substitute_dependency(Score_elem*, Score_elem*);
+
+    virtual void do_print() const;
 
 private:
     Molecule stem_beams(Stem *here, Stem *next, Stem *prev)const;
index 903bbdb6358a33fdbc87289a46bae0e8ceaaa984..76330c079c44121a0e5005438d63c1a6c8c6bbc5 100644 (file)
@@ -1,7 +1,7 @@
 /*
   bow.hh -- declare Bow
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -12,7 +12,8 @@
 #include "directional-spanner.hh"
 
 /**
-  base class for anything that looks like a slur.
+  Base class for anything that looks like a slur.
+  Anybody with a better name?
   */
 class Bow : public Directional_spanner {
 protected:
index 343903313fd7a0da0d5a39d1849b664911660167..85b5ef01450b3716959de5f22de73a939e71f6c8 100644 (file)
@@ -1,7 +1,7 @@
 /*
   break.hh -- declare  Break_algorithm
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -10,7 +10,7 @@
 #ifndef BREAK_HH
 #define BREAK_HH
 #include "varray.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "colhpos.hh"
 
 /** Class representation of an algorithm which decides where to put
index a9f3426a1225526bb17965e0148601414fceae60..28cbd4643ceab37383926995dceaf0728d265dd6 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  clef.hh -- part of LilyPond
+  clef.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
index c62b70e6546f6ce065a1afbbc50aa251c7e9bfdd..a1407366eaf6833a7dffba62cf3ad57c66f4f336 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  colhpos.hh -- part of LilyPond
+  colhpos.hh -- part of GNU LilyPond
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -7,7 +7,7 @@
 #ifndef COLHPOS_HH
 #define COLHPOS_HH
 #include "varray.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
 
 typedef Array<PCol*>  Line_of_cols;
 
index 0dd8a66fcac515d942ec256cdb12b9327b304b7e..b0b3b6dc8a86a3b6d28f1c5920ec0fd77dc2992f 100644 (file)
@@ -1,7 +1,7 @@
 /*
   collision-reg.hh -- declare Collision_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 9f28738e21b7652208e56e2c55a6da7a1fee57bc..be8d6bd506d05b6e3242f49cde47cf4dffbad917 100644 (file)
@@ -1,7 +1,7 @@
 /*
   collision.hh -- declare Collision
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 */
 class Collision : public Item {
 protected:
+    virtual void do_substitute_dependency(Score_elem*,Score_elem*);
     virtual void do_pre_processing();
 public:
-    Array<Note_column*> clash_l_arr_;
+    Link_array<Note_column> clash_l_arr_;
     NAME_MEMBERS(Collision);
     void add (Note_column*ncol_l);
     Collision();
index 9cf88dcafc3efd980f3bec14ff495564d3f3a610..d1b99f9a6cdc94b45c72fe91581a58d7f503ff1d 100644 (file)
@@ -1,7 +1,7 @@
 /*
   command-request.hh -- declare Non musical requests
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
diff --git a/lily/include/complex-staff.hh b/lily/include/complex-staff.hh
deleted file mode 100644 (file)
index 0a37e3a..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-  complex-staff.hh -- declare Complex_staff
-
-  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#ifndef COMPLEXSTAF_HH
-#define COMPLEXSTAF_HH
-
-
-#include "key.hh"
-#include "staff.hh"
-#include "staff-walker.hh"
-
-/// 
-struct Complex_staff : Staff {
-
-    /* *************** */
-
-    virtual void set_output(PScore *);
-    virtual Staff_walker *get_walker_p();
-};
-
-#endif // COMPLEXSTAF_HH
-
index 44f445f069175d3114ba90de6090e9dc574f92d9..cc16eef1b310c3735e99fc3e29f110b946d74cfe 100644 (file)
@@ -7,9 +7,9 @@
 #ifndef COMPLEXWALKER_HH
 #define COMPLEXWALKER_HH
 
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "staff-walker.hh"
-#include "staff-elem-info.hh"
+#include "score-elem-info.hh"
 
 /**
   A staff walker which uses registers to decide what to print
@@ -33,10 +33,9 @@ public:
     virtual void do_post_move();
     virtual void do_pre_move();
 
-    Complex_walker(Complex_staff*);
+    Complex_walker(Staff*);
     ~Complex_walker();
 
-    Complex_staff *staff();
 private:
 };
 
index 915094e1dc83625f905fb8137e6e72f127e22542..72ff2c1d1be9034755663bf43ee39f121eda1880 100644 (file)
@@ -1,7 +1,7 @@
 /*
   crescendo.hh -- declare Crescendo
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -16,7 +16,6 @@
   The hairpin symbol. (cresc)
  */
 class Crescendo : public Spanner , public Staff_side {
-
 public:
     int grow_dir_i_;
     
@@ -26,10 +25,13 @@ public:
     /// if there is a dynamic at the end, make the sign smaller.
     bool left_dyn_b_;
     Crescendo();
-private:
-    Spanner* do_break_at( PCol*, PCol*) const;
-    Molecule*brew_molecule_p()const;
+protected:
+    SPANNER_CLONE(Crescendo)
+    virtual Molecule*brew_molecule_p()const;
     NAME_MEMBERS(Crescendo);
+    
+private:
+    
 };
 
 #endif // CRESCENDO_HH
index 00f0a38e82ecb7dc79210de5ec38aa83f4e2de56..18055e067f2f247739a59602229fa87f9987079d 100644 (file)
@@ -9,7 +9,7 @@
 #include <iostream.h>
 #include "dstream.hh"
 #include "real.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "warn.hh"
 
 void error_t(const String& s, Time_description const &  t_tdes);
index eb96e87240a7736589362c683ddce32cdab7d35a..abff328b59000f7424925be93a558a595a96c4cd 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  directional-spanner.hh -- part of LilyPond
+  directional-spanner.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
 #include "spanner.hh"
 
 /// a spanner which can be pointing "up" or "down"
-struct Directional_spanner : Spanner{
+class Directional_spanner : public Spanner{
+public:
     
     /// -1 below heads, +1 above heads.
     int dir_i_;
-
+    Directional_spanner();
+    
     /// offset of "center" relative to left-column/0-pos of staff
     virtual Offset center() const=0;
     virtual void set_default_dir();
+protected:
     virtual void do_pre_processing();
-    Directional_spanner();
-    
 };
 
 #endif // DIRECTIONALSPANNER_HH
index cf23d007c3985ea11a6b4abd5b77e785d89570b9..17f769053cd21063638f89d8adeb3940360f2c91 100644 (file)
@@ -1,7 +1,7 @@
 /*
   dynamic-reg.hh -- declare Dynamic_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
diff --git a/lily/include/elem-group.hh b/lily/include/elem-group.hh
new file mode 100644 (file)
index 0000000..0e544ad
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+  elem-group.hh -- declare Element_group
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef ELEM_GROUP_HH
+#define ELEM_GROUP_HH
+#include "score-elem.hh"
+
+/** A class to treat a group of elements as a single entity. The
+  dimensions are the unions of the dimensions of what it contains.
+  Translation means translating the contents.
+  */
+class Element_group : virtual Score_elem{  
+protected:
+    Link_array<Score_elem> elem_l_arr_;
+    virtual void do_substitute_dependency(Score_elem* old, Score_elem* new_l);
+    virtual Interval do_height()const;
+    virtual Interval do_width()const;
+    virtual void do_print() const ;
+    virtual Element_group* elem_group() { return this; }
+    
+    
+public:
+    Element_group();
+    Element_group(Element_group const&);
+    NAME_MEMBERS(Element_group);
+    virtual void translate(Offset);
+    virtual void add_element(Score_elem*);
+    virtual String TeX_string()const;
+};
+
+#endif // ELEM_GROUP_HH
index 7b8bb557d4e2db9555bdf76afadd6f6490ec15c8..3bb2fe7601872729e8196e5a75e33180053775c6 100644 (file)
@@ -4,6 +4,6 @@
 #include <math.h>
 #include "real.hh"
 
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "const.hh"
 #endif
index e4395b1f7aed25416826cabd6078d4c28d1e6d6e..428978249e19b391d52b322d45950218570cbba6 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  grouping.hh -- part of LilyPond
+  grouping.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
index 09941a0554217aefb07629f14f5f8b2d2b9f08a9..5e47743db1b5fbfa0e588e1c589de66fba61eb87 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  headreg.hh -- part of LilyPond
+  headreg.hh -- part of GNU LilyPond
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -9,17 +9,17 @@
 #define HEADREG_HH
 #include "register.hh"
 
-struct Notehead_register : Request_register {
-    Notehead* note_p_;
+struct Note_head_register : Request_register {
+    Note_head* note_p_;
     Rhythmic_req * note_req_l_;
     
     /* *************** */
-    Notehead_register();
+    Note_head_register();
     virtual bool try_request(Request *req_l) ;
     virtual void process_requests();
     virtual void pre_move_processing();
     virtual void post_move_processing();
-    NAME_MEMBERS(Notehead_register);
+    NAME_MEMBERS(Note_head_register);
 };
 
 
index 6b6f40c01a82d526e2443aa819af09a9cf3434cd..72124521c0588f217dbd887a99f52a9ceece3b19 100644 (file)
@@ -1,12 +1,12 @@
 /*
-  idealspacing.hh -- part of LilyPond
+  idealspacing.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
 
 #ifndef IDEALSPACING_HH
 #define IDEALSPACING_HH
-#include "proto.hh"
+#include "lily-proto.hh"
 
 /// ideal spacing between two columns
 struct Idealspacing {
index 49c7b954db0c86b4daedb71492f4fbc03c341a5b..1a413cfef4210faabf630bca0c8e8ad6692e613d 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  identifier.hh -- part of LilyPond
+  identifier.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
@@ -7,7 +7,7 @@
 #ifndef IDENTIFIER_HH
 #define IDENTIFIER_HH
 
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "string.hh"
 #include "input.hh"
 
diff --git a/lily/include/identparent.hh b/lily/include/identparent.hh
deleted file mode 100644 (file)
index 09c7cfa..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#error
index df490367b45d98c0bc22ccbec53b0ab4fbe1c887..52fb65435259015e738c5898944d251a9aa06003 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  input-music.hh -- part of LilyPond
+  input-music.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
@@ -8,7 +8,7 @@
 #define INPUTMUSIC_HH
 
 #include "plist.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "voice.hh"
 #include "moment.hh"
 
index 2ba2c8c2e343c5a2d57cbd97a2aa0ef0b18d97ec..74cfa7acf5c5698541569c44de3270cf76c0b189 100644 (file)
@@ -1,7 +1,7 @@
 /*
   input-register.hh -- declare Input_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -12,7 +12,7 @@
 
 #include "plist.hh"
 #include "string.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "input.hh"
 
 struct Input_register : Input { 
index da3db472080350c07905a20c6edd7439ba1ae55e..436e5e0947c5f722f7c3673310558dab61d7e33e 100644 (file)
@@ -1,7 +1,7 @@
 /*
-  input-score.hh -- declare 
+  input-score.hh -- declare Input_score
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -11,7 +11,7 @@
 #define INPUTSCORE_HH
 
 #include "varray.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "plist.hh"
 #include "string.hh"
 #include "input.hh"
index edc29919246791102dd9facf64ab34baf59364f7..4cf819876fd79b33a6cb74f99b2a8bfd758e3681 100644 (file)
@@ -10,7 +10,7 @@
 #include "string.hh"
 #include "plist.hh"
 #include "varray.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "input.hh"
 
 class Input_staff:public Input {
index f61a2f27650789168a2ea2724acd63ee5fe96d8d..3c030d122c68275e56df7bc134a00283c9c324c3 100644 (file)
@@ -1,7 +1,7 @@
 /*
   item.hh -- declare Item
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -11,7 +11,7 @@
 #include "glob.hh"
 #include "boxes.hh"
 #include "string.hh"
-#include "staff-elem.hh"
+#include "score-elem.hh"
 
 /**
  a horizontally fixed size element of the score
@@ -28,21 +28,16 @@ public:
     /// indirection to the column it is in
     PCol * pcol_l_;
 
-    /* *************** */
     virtual Item *item() { return this; }
     Item();
-    void do_print()const;
     Real hpos_f() const;
     NAME_MEMBERS(Item);
-    /**
-      
-      @return the line where this is in; 
-
-      PRE
-      Breaking calc has  to be finished
-     */
-    Line_of_score * line_l() const;
+    virtual Line_of_score * line_l() const;
+protected:
+    virtual void do_print()const;
+
 };
 
 
+
 #endif
index e56af8e682063f6760478f80499a45da9cd91a63..1e2207beab86ed24fe3ded572eaae9ba01413ab4 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  key-item.hh -- part of LilyPond
+  key-item.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
index c674ca55a28c1fd9e09d07b4a526bcdef2762cda..b6e21224d927ca25a0f3d0e0b0c3165b56d79a43 100644 (file)
@@ -1,7 +1,7 @@
 /*
   key-reg.hh -- declare Key_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 88ab9ffbe0de7ef61c3096286668ce8a6d1c501c..a38935b398fdc260f207a35550cf2e4c42d0e317 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  keyword.hh -- part of LilyPond
+  keyword.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
index 35b1e1d34b912f0c71bcd52fac37e670ea88bcf4..2e5c970fe5399626f79cea20862a1a7061ca6fee 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  leastsquare.hh -- part of LilyPond
+  leastsquare.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
index 7cffaced164fccd7525df3f5de14e9304ac93ada..7df7542482fd9ee7e681ab6b0533e2df99b36ebd 100644 (file)
 /*
   lily-proto.hh -- declare class names.
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
-
 #ifndef LILY_PROTO_HH
 #define LILY_PROTO_HH
 #include "proto.hh"
 
-struct    My_lily_lexer;
-struct My_lily_parser;
-struct Notename_table;
+struct My_lily_lexer;
 struct Absolute_dynamic_req;
-struct Barcheck_req;
+struct Accidental;
+struct Atom;
+struct Bar;
+struct Bar_register;
 struct Bar_req;
+struct Barcheck_req;
+struct Beam;
 struct Beam_req;
 struct Blank_req;
+struct Box;
 struct Bracket_req;
 struct Cadenza_req;
+struct Chord;
 struct Clef_change_req;
+struct Clef_item;
+struct Clef_register;
+struct Col_hpositions;
+struct Colinfo;
+struct Collision;
+struct Collision_register;
+struct Command_req;
+struct Complex_music;
+struct Complex_walker;
 struct Cresc_req;
+struct Crescendo ;
 struct Decresc_req;
+struct Directional_spanner;
 struct Durational_req;
+struct Dynamic;
 struct Dynamic_req;
-struct Group_change_req;
+struct Element_group;
 struct Feature;
+struct Group_change_req;
 struct Group_feature_req;
+struct Idealspacing;
+struct Identifier;
+struct Input;
+struct Input_file;
+struct Input_music;
+struct Input_register;
+struct Input_score;
+struct Input_staff;
+struct Item;
+struct Key;
 struct Key_change_req;
+struct Key_item;
+struct Key_register;
+struct Keyword;
+struct Keyword_table;
+struct Lily_stream;
+struct Line_of_score;
+struct Line_of_staff;
+struct Linestaff;
+struct Local_key;
+struct Local_key_item;
+struct Local_key_register;
+struct Lookup;
+struct Lyric_item;
 struct Lyric_req;
-struct Melodic_req;
 struct Measure_grouping_req;
+struct Melodic_req;
+struct Meter;
 struct Meter_change_req;
+struct Meter_register;
+struct Midi_def;
+struct Midi_duration;
+struct Midi_header;
+struct Midi_item;
+struct Midi_output;
+struct Midi_pitch;
+struct Midi_score;
+struct Midi_staff;
+struct Midi_stream;
+struct Midi_track;
+struct Midi_walker;
+struct Mixed_qp;
+struct Molecule;
+struct Music_general_chord;
+struct Music_voice;
 struct Musical_req;
-struct Command_req;
-struct Collision_register;
-struct Collision;
+struct My_lily_parser;
+struct Note_column;
+struct Note_column_register;
 struct Note_req;
-struct Pulk_voices;
-struct Pulk_voice;
-struct Plet_req;
+struct Note_head;
+struct Note_head_register;
+struct Notename_table;
+struct Offset;
+struct Output;
+struct PCol;
+struct PScore;
+struct Paper_def;
 struct Partial_measure_req;
+struct Plet;
+struct Plet_req;
+struct Pulk_voice;
+struct Pulk_voices;
+struct Rational;
+struct Register_group_register;
+struct Request;
 struct Request_column;
+struct Request_register;
+struct Rest;
+struct Rest_collision;
+struct Rest_collision_register;
+struct Rest_column;
 struct Rest_req;
+struct Rhythmic_grouping;
 struct Rhythmic_grouping_req;
 struct Rhythmic_req;
+struct Score;
+struct Score_column;
 struct Score_elem;
 struct Score_elem_info;
+struct Score_walker;
+struct Script;
+struct Script_column;
+struct Script_def;
+struct Script_register;
 struct Script_req;
+struct Simple_music;
 struct Skip_req;
+struct Slur;
+struct Slur_register;
 struct Slur_req;
 struct Spacing_req ;
-struct Span_req;
 struct Span_dynamic_req;
-struct Subtle_req;
+struct Span_req;
+struct Spanner;
+struct Staff;
+struct Staff_column;
+struct Staff_side;
+struct Staff_symbol;
+struct Staff_walker;
+struct Stem;
+struct Stem_beam_register;
 struct Stem_req;
-struct Tie_req;
-struct Tie;
-struct Tie_register;
+struct String;
+struct Subtle_req;
+struct Symbol;
+struct Symtable;
+struct Symtables;
+struct Super_elem;
 struct Terminate_voice_req;
+struct Tex_stream;
+struct Text_def;
+struct Text_gob;
+struct Text_item ;
+struct Text_register;
 struct Text_req;
+struct Tie;
+struct Tie_register;
+struct Tie_req;
+struct Time_description;
 struct Timing_req;
-struct Note_column_register;
-struct Note_column;
-struct Staff_side;
-struct Staff_symbol;
-struct Script_column;
-struct Rest_column;
-struct Rest_collision_register;
-struct Rest_collision;
-struct Vertical_spanner;
 struct Vertical_brace;
+struct Vertical_spanner;
+struct Voice;
+struct Voice_element;
+struct Voice_group_registers;
+struct Voice_list;
+struct Voice_registers;
+struct Voicegroup;
+struct Walker_registers;
+typedef Rational Moment;
 #endif // LILY_PROTO_HH
index bd8685383aa6aac5361200cb8f194f9c01734951..97e4caf70ce25940ff437571b5468ed1f78c861c 100644 (file)
@@ -1,7 +1,7 @@
 /*
   linespace.hh -- declare Colinfo, Spacing_problem
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 2371277bb0fd9ff3300f6bb546c3f29c890d54f6..24f48e3115ccc3957e9f6646df219f2447d9fc50 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  local-key-item.hh -- part of LilyPond
+  local-key-item.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
@@ -18,11 +18,14 @@ struct Local_acc {
 
 /**
   Accidentals which can be different for each octave.
+
+  TODO:
+  update item if Items are removed
  */
 struct Local_key_item : Item {
     NAME_MEMBERS(Local_key_item);
     Array<Local_acc> accs;
-    Array<Item*> support_items_;
+    Link_array<Item> support_items_;
     int c0_position;
 
     /* *************** */
@@ -31,8 +34,10 @@ struct Local_key_item : Item {
     void add(Item*);
     void add(int oct, int pitch, int acc);
     void add(Melodic_req*);
-    void do_pre_processing();    
-    Molecule* brew_molecule_p()const;
+public:
+    virtual void do_pre_processing();    
+    virtual void do_substitute_dependency(Score_elem*,Score_elem*);
+    virtual Molecule* brew_molecule_p()const;
 };
 #endif // LOCALKEYITEM_HH
 
index b7197d27435bfb303e6d4d1fefcccbac6862bf2a..e1278019170a656920823b1d059b15ac4add8603 100644 (file)
@@ -17,8 +17,8 @@ struct Local_key_register : Request_register {
     Key const *key_C_;
     Array<Note_req* > mel_l_arr_;
     Array<Item* > support_l_arr_;
-    Link_array<Item * > forced_l_arr_;
-    Link_array<Item *> tied_l_arr_;
+    Link_array<Item  > forced_l_arr_;
+    Link_array<Item > tied_l_arr_;
     /* *************** */
     virtual void process_requests();
     virtual void acknowledge_element(Score_elem_info);
index 42a2e03819bd986da0bf5325a9460a34faaf5a8c..0a0921efce7b6eef39a24345ae059512b01c1146 100644 (file)
@@ -1,6 +1,11 @@
 /*
-  lilypond, (c) 1996,97 Han-Wen Nienhuys
+  lookup.hh -- declare Lookup
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
+
 #ifndef LOOKUPSYMS_HH
 #define LOOKUPSYMS_HH
 
@@ -15,7 +20,7 @@ struct Lookup {
     /* *************** */
     void add(String, Symtable*);
     void print()const;
-    Real internote()const;
+    Real internote_f()const;
 
     Symbol linestaff(int n, Real w)const;
     Symbol fill(Box b)const;
index f9f43bea2660b2926eef27dae7dffce710239cdb..304bf5c6cf66d2e7db86250e241e90485f442eec 100644 (file)
@@ -1,7 +1,7 @@
 /*
-  lyric-register.hh -- declare 
+  lyric-register.hh -- declare Lyric_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -12,7 +12,8 @@
 #include "register.hh"
 #include "varray.hh"
 
-#include "proto.hh"
+#include "lily-proto.hh"
+
 class Lyric_register : public Request_register {
     Array<Lyric_req*> lreq_arr_;
     virtual bool acceptable_request_b(Request*);
index 10fc7c3f47251c665de35f8a2ebc7308fcde4bb8..334777183dbe03e23728ff6c8122d549fbe55231 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef MAIN_HH
 #define MAIN_HH
-#include "proto.hh"
+#include "lily-proto.hh"
 
 void debug_init();
 void set_debug(bool);
index 6ebe18c2823ca04b89a2a607b9e4d5e8740b6c70..300c72da9fe617d2ac40a4c8037f1277636bc39c 100644 (file)
@@ -1,7 +1,7 @@
 /*
   meter-reg.hh -- declare  Meter_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 1e04e5df4cbf48f3c4377549839783b04b21fdd6..9673783d25fed2cecd240c36ebd37f197d172e6d 100644 (file)
@@ -1,7 +1,7 @@
 /*
-  midi-def.hh -- declare 
+  midi-def.hh -- declare Midi_def
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
 */
@@ -9,7 +9,7 @@
 
 #ifndef MIDIDEF_HH
 #define MIDIDEF_HH
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "real.hh"
 #include "string.hh"
 #include "moment.hh"
index 1aaf181d279df8028bfbd830f358fe53d8fae0a2..2467318e463a780ab8758b7220bf7b9779293494 100644 (file)
@@ -1,12 +1,12 @@
 //
-//  midiitem.hh -- part of LilyPond
+//  midiitem.hh -- part of GNU LilyPond
 //
 //  copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
 
 #ifndef MIDI_ITEM_HH
 #define MIDI_ITEM_HH
 #include "string.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
 
 struct Midi_item {
     /* *************** */
index 86ffab2a05d27acc92eb392915a0fc838300856a..575842ebbdbeaf10af487c98cac9e6b2ab38865e 100644 (file)
@@ -1,7 +1,7 @@
 /*
   midioutput.hh -- declare Midi_output
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 244438483852035d57397a9bb574deaff8c246c5..c18cb9c4e9761761c110996548c6de57b68f82d5 100644 (file)
@@ -1,5 +1,5 @@
 //
-//  midistream.hh -- part of LilyPond
+//  midistream.hh -- part of GNU LilyPond
 //
 //  copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
 
index 30ad18fe901c8cfcfa55ca06c520cbdf1015d706..2eac3747d600cd35f1a7a291ae5ccee9372f90fd 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef MIDIWALKER_HH
 #define MIDIWALKER_HH
 
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "grouping.hh"
 #include "staff-walker.hh"
 #include "pcursor.hh"
index 00b742076e3cb1c6fab555d5a47f468a27654c10..8ba5e10b78c53e5291b79a79160198105514228a 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef MISC_HH
 #define MISC_HH
 
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "real.hh"
 #include "moment.hh"
 #include "scalar.hh"
index 3904acb4bf121f50a6fa76a20fd4785e7be85b97..0ccb399a03a1de60ad2f8224e6cb0089e3cc6bbf 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef MOLECULE_HH
 #define MOLECULE_HH
 
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "plist.hh"
 #include "boxes.hh"
 #include "symbol.hh"
@@ -23,7 +23,7 @@ struct Atom {
 
     void print() const;
 
-    String TeXstring() const;
+    String TeX_string() const;
 };
 
 
@@ -47,7 +47,7 @@ struct Molecule {
     /// how big is #this#? 
     Box extent() const;
 
-    String TeXstring() const;
+    String TeX_string() const;
 
     Molecule(const Molecule&s);
     void print() const;
index 721b2ff51cfee1a26cd69459f11d9f8dde7c3cec..ae4a9359395c680cff56e74a6209ce0a55677f0d 100644 (file)
@@ -1,7 +1,7 @@
 /*
   musical-request.hh -- declare Musical requests
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index f69b7e0fb4f2feeda5da61730a37e144afca04db..b214366e7e1fbbc996954d4fd8db3ea3cfb5feb9 100644 (file)
@@ -1,7 +1,7 @@
 /*
   lexer.hh -- declare My_lily_lexer
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -12,7 +12,7 @@
 #include <FlexLexer.h>
 
 #include "lily-proto.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "fproto.hh"
 #include "varray.hh"
 #include "string.hh"
index 6fef2311fffad027b840522adff0c668078a3634..feb3301b00f4baed964523c625ef20a2ecc567ec 100644 (file)
@@ -1,7 +1,7 @@
 /*
   my-lily-parser.hh -- declare My_lily_parser
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -9,12 +9,12 @@
 
 #ifndef MY_LILY_PARSER_HH
 #define MY_LILY_PARSER_HH
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "duration.hh"
 #include "string.hh"
 #include "varray.hh"
 #include "lily-proto.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "duration.hh"
 #include "string.hh"
 #include "varray.hh"
index d33dddf96209c49c0ba1803e514f5d074dc79011..7925621e65a3117aa41da5eef21c6599e3729506 100644 (file)
@@ -1,7 +1,7 @@
 /*
   note-column-reg.hh -- declare Note_column_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index b5af0185284e18a6bc6ed14b9d1352443548c155..32b1a18e11ba657e9a7a001a92831d9be9d6b03f 100644 (file)
@@ -1,7 +1,7 @@
 /*
   note-column.hh -- declare Note_column
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 /** a struct for treating a group of noteheads (noteheads, stem
   (chord) and scripts ) as a single entity.  */
 class Note_column : public Script_column {
-    void do_pre_processing();
+protected:
+    virtual void do_pre_processing();
+    virtual void do_substitute_dependency(Score_elem*,Score_elem*);
 public:
         /// link to the stem. For setting default direction
     Stem * stem_l_;
 
     bool h_shift_b_;
     
-    Array<Notehead*> head_l_arr_;
+    Link_array<Note_head> head_l_arr_;
     Interval_t<int> head_positions_interval()const;
 
     /** The relative position of the "voice" containing this
@@ -33,7 +35,7 @@ public:
         
     NAME_MEMBERS(Note_column);
     Note_column();
-    void add(Notehead *);
+    void add(Note_head *);
     void add(Stem *);
     void sort();
     void add(Script* s) { Script_column::add(s);}
diff --git a/lily/include/note-head.hh b/lily/include/note-head.hh
new file mode 100644 (file)
index 0000000..4a1bf34
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+  note-head.hh -- part of GNU LilyPond
+
+  (c) 1996,97 Han-Wen Nienhuys
+*/
+
+#ifndef NOTEHEAD_HH
+#define NOTEHEAD_HH
+
+#include "item.hh"
+
+/** ball at the end of the stem takes care of:
+
+  * help lines  
+  * proper placing of dots 
+
+  It also is the item for a Rest
+  
+  */
+
+class Note_head : public Item {
+public:
+    NAME_MEMBERS(Note_head);
+
+    bool rest_b_;
+    int position_i_;
+    
+    /// -1 = lowest, 0 = inside, 1 = top
+    int extremal_i_;
+    
+    /// needed for the help-lines
+    int staff_size_i_;
+    int dots_i_;
+    int balltype_i_;
+    int x_dir_i_;
+    
+    /* *************** */
+    
+    void set_rhythmic(Rhythmic_req *);
+
+    /**
+      position of top line (5 linestaff: 8)
+      */
+    Note_head(int staff_size);
+    static int compare(Note_head * const &a, Note_head *const &b) ;
+protected:
+    virtual    void do_print()const;
+    virtual    Molecule* brew_molecule_p()const;
+};
+#endif // NOTEHEAD_HH
+
diff --git a/lily/include/notehead.hh b/lily/include/notehead.hh
deleted file mode 100644 (file)
index e28c387..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-  notehead.hh -- part of LilyPond
-
-  (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef NOTEHEAD_HH
-#define NOTEHEAD_HH
-
-#include "item.hh"
-
-/** ball at the end of the stem takes care of:
-
-  * help lines  
-  * proper placing of dots 
-
-  It also is the item for a Rest
-  
-  */
-
-class Notehead : public Item {
-public:
-    NAME_MEMBERS(Notehead);
-
-    bool rest_b_;
-    int position_i_;
-    
-    /// -1 = lowest, 0 = inside, 1 = top
-    int extremal_i_;
-    
-    /// needed for the help-lines
-    int staff_size_i_;
-    int dots_i_;
-    int balltype_i_;
-    int x_dir_i_;
-    
-    /* *************** */
-    
-    void set_rhythmic(Rhythmic_req *);
-
-    /**
-      position of top line (5 linestaff: 8)
-      */
-    Notehead(int staff_size);
-    static int compare(Notehead * const &a, Notehead *const &b) ;
-protected:
-    virtual    void do_print()const;
-    virtual    Molecule* brew_molecule_p()const;
-};
-#endif // NOTEHEAD_HH
-
index 4e357a2593b6ab9e61ba43b8f0616bd6c92becf1..082dda366b42a0721d14ccfcef81aaa4bca3675c 100644 (file)
@@ -1,7 +1,7 @@
 /*
   notename-table.hh -- declare 
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 7aa8397af82c2157e377875525e249f2b14e2ce8..e0125e1a0bcea1e5db97ca67a4414a09040ce943 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  notename.hh -- part of LilyPond
+  notename.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
index e0b62bba7616716e14cf7e21191773387cbb5021..bd5b2695323f497ff318baebd0e5c4befeac1bc4 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  offset.hh -- part of LilyPond
+  offset.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
index 71b5887c98e40d776951ceb6c7cb0b0b42ed9dfb..11d1cc8cc06fea2da2bd1f6fcf43b72e39c3775e 100644 (file)
@@ -22,8 +22,8 @@
 
 class PCol { 
 public:
-    Link_list<Item const *> its;
-    Link_list<Spanner const *> stoppers, starters;
+    Link_list<Item *> its;
+    Link_list<Spanner *> stoppers, starters;
     
     /** prebreak is put before end of line.
     if broken here, then (*this) column is discarded, and prebreak
@@ -39,7 +39,7 @@ public:
     PCol *daddy_l_;
     
     /// if lines are broken then this column is in #line#
-    Line_of_score const *line_l_;
+    Line_of_score *line_l_;
 
     /** if lines are broken then this column x-coord #hpos# if not
       known, then hpos == -1.(ugh?)  */
@@ -52,7 +52,7 @@ public:
 
     /* *************** */
     /// which  one (left =0)
-    int rank() const;
+    int rank_i() const;
 
     /// does this column have items
     bool used_b() const;
index 1e283faf9e4a8b6f59c7f0b8bdf470b6da5e6db5..5490345729eb3d7b42432b8aa675c3be36cef849 100644 (file)
@@ -1,7 +1,7 @@
 /*
   p-score.hh -- declare PScore
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 #define P_SCORE_HH
 
 #include "colhpos.hh"
-#include "varray.hh"
+#include "parray.hh"
 #include "lily-proto.hh"
-#include "p-col.hh"
-#include "p-staff.hh"
+#include "plist.hh"
 
+/** all stuff which goes onto paper. notes, signs, symbols in a score
+     #PScore# contains the items, the columns.
+    
+    */
 
-/** all stuff which goes onto paper. notes, signs, symbols in a score can be grouped in two ways:
-    horizontally (staffwise), and vertically (columns). #PScore#
-    contains the items, the columns and the staffs.
- */
-
-struct PScore {
+class PScore {
+public:
     Paper_def *paper_l_;
-    
+
     /// the columns, ordered left to right
     Pointer_list<PCol *> cols;
 
     /// the idealspacings, no particular order
     Pointer_list<Idealspacing*> suz;
 
-    /// the staffs ordered top to bottom
-    Pointer_list<PStaff*> staffs;
-
-    /// all symbols in score. No particular order.
-    Pointer_list<Item*> its;
-
-    /// if broken, the different lines
-    Pointer_list<Line_of_score*> lines;
-
     /// crescs etc; no particular order
     Pointer_list<Spanner *> spanners;
 
-    /// broken spanners
-    Pointer_list<Spanner*> broken_spans;
+    /// other elements
+    Pointer_list<Score_elem*> elem_p_list_;
+    
+    Super_elem *super_elem_l_;
 
-    Pointer_list<Vertical_spanner*> vspan_p_list_;
     /* *************** */
     /* CONSTRUCTION */
     
@@ -54,30 +45,22 @@ struct PScore {
     /// add a line to the broken stuff. Positions given in #config#
     void set_breaking(Array<Col_hpositions> const &);
 
-    void add(PStaff *);
-    
-
     /** add an item.
        add the item in specified containers. If breakstatus is set
        properly, add it to the {pre,post}break of the pcol.
        */
-    void typeset_item(Item *item_p,  PCol *pcol_l,PStaff*pstaf_l,int breakstatus=1);
+    void typeset_item(Item *item_p,  PCol *pcol_l,int breakstatus=1);
 
-    /// add a Spanner
-    void typeset_spanner(Spanner*, PStaff*);
     ///    add to bottom of pcols
     void add(PCol*);
-    void add_broken(Spanner*);
 
-    /* INSPECTION */
-    Array<Item*> select_items(PStaff*, PCol*);
-
-     /**
-       @return argument as a cursor of the list
-       */
+    /**
+      @return argument as a cursor of the list
+      */
     PCursor<PCol *> find_col(PCol const *)const;
 
+    Link_array<PCol> col_range(PCol *left_l, PCol *right_l) const;
+    
     /* MAIN ROUTINES */
     void process();
 
@@ -98,6 +81,13 @@ struct PScore {
     /* STANDARD ROUTINES */
     void OK()const;
     void print() const;
+    ~PScore();
+    void typeset_element(Score_elem*);
+    void typeset_broken_spanner(Spanner*);
+    /// add a Spanner
+    void typeset_unbroken_spanner(Spanner*);
+    
 private:
     /// before calc_breaking
     void preprocess();
diff --git a/lily/include/p-staff.hh b/lily/include/p-staff.hh
deleted file mode 100644 (file)
index c4236c8..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef PSTAFF_HH
-#define PSTAFF_HH
-
-#include "proto.hh"
-#include "plist.hh"
-#include "item.hh"
-#include "symbol.hh"
-
-/// items grouped horizontally
-struct PStaff {
-    PScore * pscore_l_;
-    
-    
-    Link_list<Spanner const *> spans;
-    Link_list<Item*> its;
-
-    /* *************** */
-    void add(Item*i);
-    PStaff(PScore*);
-
-private:
-    PStaff(PStaff const&);
-};
-
-#endif
index 9eb94245d5d9f915bdbeef5ce278ddb210ce3465..1c067669e94634683a832e6529a91c677d680fbe 100644 (file)
@@ -1,7 +1,7 @@
 /*
 paper-def.hh -- declare Paper_def
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -9,7 +9,7 @@ paper-def.hh -- declare Paper_def
 
 #ifndef PAPER_DEF_HH
 #define PAPER_DEF_HH
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "real.hh"
 #include "string.hh"
 #include "moment.hh"
@@ -51,9 +51,9 @@ public:
     /**
       The distance between lines
      */
-    Real interline()const;
+    Real interline_f()const;
     /// half the distance between lines
-    Real internote()const;
+    Real internote_f()const;
 
     /// thickness of the standard line 
     Real rule_thickness()const;
index 711f555865804e16e47b61855cb5fb26e39badb6..4bab4e9083456c2b1ac83d80920df6c6bda037ab 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  parseconstruct.hh -- part of LilyPond
+  parseconstruct.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
@@ -7,7 +7,7 @@
 #ifndef PARSECONSTRUCT_HH
 #define PARSECONSTRUCT_HH
 
-#include "proto.hh"
+#include "lily-proto.hh"
 
 String * get_scriptdef(char c);
 Request* get_script_req(char);
index 9d26d9798ad5bbd6c5f3e896befc0602c99ae8c6..085a0a3ff6bd166fcb9205198d1c4e9dafcce9ab 100644 (file)
@@ -1,7 +1,7 @@
 /*
   pulk-voice.hh -- declare Pulk_voice
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -10,7 +10,7 @@
 #ifndef PULK_VOICE_HH
 #define PULK_VOICE_HH
 
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "lily-proto.hh"
 #include "moment.hh"
 #include "priorities.hh"
index 9f01f4419e1f39627dcb4937c15b13a40e721c1e..fd388d143e1e16f466ac360506d2434b6d6a6b68 100644 (file)
@@ -1,7 +1,7 @@
 /*
   pulk-voices.hh -- declare Pulk_voices
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 
@@ -16,7 +16,7 @@
 #include "pqueue.hh"
 #include "plist.hh"
 #include "moment.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "lily-proto.hh"
 #include "voice.hh"
 #include "time-description.hh"
index ccfba72bb83c76abf9901a5c20c447b894d89983..3c026581eb4dbc0bae19e9233b639810b1b99777 100644 (file)
@@ -1,7 +1,7 @@
 /*
   qlp.hh -- declare Ineq_constrained_qp, Mixed_qp
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 3423951452a98c570f4aca54a13034be4187e302..c7a54b1eca33d76715c9435fdff8b327811edf89 100644 (file)
@@ -1,7 +1,7 @@
 /*
   qlpsolve.hh -- declare  Active_constraints, Inactive_iter
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 2e13b512483285df00f8cd72df4de912aa5ac535..5e91ae4621137ea659bd9df79a0aee57febc4cca 100644 (file)
@@ -1,7 +1,7 @@
 /*
-  registergroup.hh -- declare 
+  registergroup.hh -- declare Register_group_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -12,7 +12,7 @@
 
 
 #include "plist.hh"
-#include "staff-elem-info.hh"
+#include "score-elem-info.hh"
 #include "register.hh"
 
 /**
index dee7c512c80bb3835dae91edf41f59efb16fc29f..641d0331125ac4fe56a5b2b0466f138fade583c4 100644 (file)
@@ -1,7 +1,7 @@
 /*
   register.hh -- declare Request_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -13,7 +13,7 @@
 #include "lily-proto.hh"
 #include "varray.hh"
 #include "request.hh"
-#include "staff-elem-info.hh"
+#include "score-elem-info.hh"
 #include "staff-info.hh"
 
 /**
diff --git a/lily/include/reqtodo.hh b/lily/include/reqtodo.hh
deleted file mode 100644 (file)
index eaed606..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-#if 0
-
-
-
-/**Draw a (Guitar) chord above or below this ``note''.
-Why a request?
-Because everything else is done in requests.
-*/
-struct Chord : Request {
-       // don't know how this looks.
-};
-
-
-/// for absolute dynamics
-enum Loudness {
-    FFF, FF, F, MF, MP, P, PP, PPP
-} ;
-
-
-/**
-Start/stop a bracket at this note. if #nplet# is set, the staff will
-try to put an appropriate number over the bracket
-*/
-struct Bracket_req : Span_req {
-    int nplet;                 // print a number over the beam.
-};
-
-struct Subtle_req {
-    Moment subtime;
-};
-
-
-/** helper in the hierarchy. Each dynamic is bound to one note ( a
-    crescendo spanning multiple notes is thought to be made of two
-    "dynamics": a start and a stop).  Dynamic changes can occur in a
-    smaller time than the length of its note, therefore fore each
-    Dynamic request carries a time, measured from the start of its
-    note.
-
-    This subfield would come in handy, if mpp96 was adapted for midi
-    support.
-    
-    Dynamic should have been derived from request, but I don't want to
-    fuss with virtual baseclasses.  */
-
-struct Dynamic:Subtle_req {
-
-};
-/// do a crescendo
-struct Cresc_req : Span_req, Dynamic {
-    
-};
-
-/// do a decrescendo
-struct Decresc_req : Span_req, Dynamic {
-    
-};
-
-/// do a dynamic like "fff" or "mp"
-struct Absdynamic_req : Request, Dynamic {
-    Loudness loudness;
-};
-
-struct Grace_req : Subtle_req {
-    
-};
-
-struct Grace_turn_req : Grace_turn {
-    
-};
-
-struct Grace_note : Melodic_req {
-    
-};
-
-struct Grace_notes {
-    
-};
-
-struct Glissando_req : Span_req {
-    
-};
-#endif
index 19876c9e37ff4de27daff83ef726bd50c750b614..82377cf3dffa96dce020e5f77337ed56680a8e06 100644 (file)
@@ -1,7 +1,7 @@
 /*
   request-column.hh -- declare Request_column
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index c3e0deb846e8a5b6c1bf3030bc6dc078bd369535..f045b36204aa810c2d3524ee4a62dd00848ab7d9 100644 (file)
@@ -1,19 +1,19 @@
 /*
   request.hh -- declare Request baseclasses.
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
 #ifndef REQUEST_HH
 #define REQUEST_HH
-// LilyPond's second egg of columbus!
+// GNU LilyPond's second egg of columbus!
 
 #include "glob.hh"
 #include "string.hh"
 #include "moment.hh"
-#include "class-name.hh"
+#include "virtual-methods.hh"
 #include "input.hh"
 
 /**
@@ -65,7 +65,7 @@ protected:
 #define REQUESTMETHODS(T,accessor)     \
 virtual T * accessor() { return this;}\
 NAME_MEMBERS(T);\
-virtual Request *clone() const { return  new T(*this); } \
+VIRTUAL_COPY_CONS(T, Request)\
 virtual void do_print() const
 
 #endif
index a572ee6449ceeb181d8d566d44d2ca8e7dd0eaf8..39b0b2d10e5595c1c9f030241466ad0de58164f6 100644 (file)
@@ -1,7 +1,7 @@
 /*
   rest-collision-reg.hh -- declare Rest_collision_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 31a1c8504ba7401b2ed0d4747571250b997a47d4..d470e4178e265bdbfdbb0c0d7a2d37b933a95732 100644 (file)
@@ -1,7 +1,7 @@
 /*
   rest-collision.hh -- declare Rest_collision
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 #include "item.hh"
 
 class Rest_collision : public Item {
-    Array<Rest_column *> rest_l_arr_;
-    Array<Note_column *> ncol_l_arr_;
+    Link_array<Rest_column> rest_l_arr_;
+    Link_array<Note_column> ncol_l_arr_;
 public:
     void add(Rest_column*);
     void add(Collision*);
     NAME_MEMBERS(Rest_collision);
 protected:
     virtual void do_post_processing();
+    virtual void do_substitute_dependency(Score_elem*,Score_elem*);
 };
 #endif // REST_COLLISION_HH
index a753c61d937315affa61e9b3d4f519b32ff91e5c..803e00a294035a4d3b30b0db72298f47da2c4794 100644 (file)
@@ -1,7 +1,7 @@
 /*
   rest-column.hh -- declare Rest_column
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
   only produce one rest.
   */
 class Rest_column : public Script_column {
-    Array<Notehead*> head_l_arr_;
+    Link_array<Note_head> head_l_arr_;
 public:
     int dir_i_;
-    void add(Notehead *);
+    void add(Note_head *);
     NAME_MEMBERS(Rest_column);
     void translate_y(Real dy);
     Rest_column();
+protected:
+    virtual void do_substitute_dependency(Score_elem*, Score_elem*);
 };
 
 #endif // REST_COLUMN_HH
index 9f2e33c6b51e316ebbf350f2baa22738d14b91a2..4d6fc17af7550c0690c3fdc880046ce2518a8eca 100644 (file)
@@ -1,12 +1,12 @@
 /*
-  sccol.hh -- part of LilyPond
+  sccol.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
 
 #ifndef SCCOL_HH
 #define SCCOL_HH
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "varray.hh"
 #include "moment.hh"
 
diff --git a/lily/include/score-elem-info.hh b/lily/include/score-elem-info.hh
new file mode 100644 (file)
index 0000000..b4d4fb7
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+  score-elem-info.hh -- declare Score_elem_info
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef STAFFELEMINFO_HH
+#define STAFFELEMINFO_HH
+
+#include "scalar.hh"
+#include "lily-proto.hh"
+#include "varray.hh"
+
+/// data container.
+struct Score_elem_info {
+    Score_elem * elem_l_;
+    Request*req_l_;
+    Voice const * voice_l_;
+    Array<Request_register*> origin_reg_l_arr_;
+
+    /* *** */
+    Score_elem_info(Score_elem*, Request*);
+    Score_elem_info();
+};
+
+
+struct Feature {
+    Scalar type_; 
+    Scalar value_;
+};
+#endif // STAFFELEMINFO_HH
diff --git a/lily/include/score-elem.hh b/lily/include/score-elem.hh
new file mode 100644 (file)
index 0000000..463c8e2
--- /dev/null
@@ -0,0 +1,127 @@
+/*
+  score-elem.hh -- part of GNU LilyPond
+
+  (c) 1996,97 Han-Wen Nienhuys
+*/
+
+#ifndef STAFFELEM_HH
+#define STAFFELEM_HH
+
+#include "parray.hh"
+#include "lily-proto.hh"
+#include "offset.hh"
+#include "molecule.hh"
+#include "virtual-methods.hh"
+#include "directed-graph.hh"
+
+
+/** Both Spanner and Item are Score_elem's. Most Score_elem's depend
+  on other Score_elem's, eg, Beam needs to know and set direction of
+  Stem. So the Beam has to be calculated *before* Stem. This is
+  accomplished with the dependencies fields of struct Score_elem,
+  which are implemented in the Directed_graph_node class: all elements
+  form an acyclic graph.
+
+  (elem) */
+class Score_elem : private Directed_graph_node {
+
+    /// member: the symbols
+    Molecule *output;          // should scrap, and use temp var?
+
+
+    /**
+      This is  needed, because #output# may still be
+      NULL.
+      */
+    Offset offset_;
+
+    enum Status {
+       ORPHAN,                 // not yet added to pstaff
+       VIRGIN,                 // added to pstaff
+       PRECALCING,
+       PRECALCED,              // calcs before spacing done
+       BREAKING,
+       BROKEN,
+       POSTCALCING,            // busy calculating. This is used to trap cyclic deps.
+       POSTCALCED,             // after spacing calcs done
+       OUTPUT,                 // molecule has been output
+       DELMARKED,              // mark for 'unclean' deletion
+       DELETED,                // to catch malloc mistakes.
+    } status;
+
+
+    Score_elem* dependency(int) const;
+    Score_elem* dependent(int) const;
+    int dependent_size() const;
+    int dependency_size() const;
+public:
+    PScore *pscore_l_;    
+    int group_element_i_;
+        
+    Score_elem(Score_elem const&);
+    virtual String TeX_string () const ;
+    virtual void print() const;
+    
+    Paper_def *paper() const;
+
+    virtual ~Score_elem();
+    Score_elem();
+    NAME_MEMBERS(Score_elem);    
+    virtual bool is_type_b(const char *);
+    
+    Interval width() const;
+    Interval height() const;
+     /**
+      translate the symbol. The symbol does not have to be created yet. 
+      Overridable, since this score-elem might act as a pseudo-list.
+     */
+    virtual void translate(Offset);
+    Offset offset()const;
+
+    void add_processing();
+    void OK() const;
+    void pre_processing();
+    void break_processing();
+    
+    void post_processing();
+    void molecule_processing();
+
+    void unlink();
+    void unlink_all();
+    void remove_dependency(Score_elem*);
+    /**
+      add a dependency. It may be the 0 pointer, in which case, it is ignored.
+     */
+    void add_dependency(Score_elem* );    
+    
+    
+    virtual Spanner* spanner()  { return 0; }
+    virtual Element_group* elem_group() { return 0; }
+    virtual Item * item() { return 0; }
+    virtual Line_of_score * line_l() const;
+protected:
+
+    virtual  Interval do_height()const;
+    virtual Interval do_width()const;
+    
+    /// do printing of derived info.
+    virtual void do_print() const {}
+    /// generate the molecule    
+    virtual Molecule* brew_molecule_p()const;
+    ///executed directly after the item is added to the PScore
+    virtual void do_add_processing();
+    /// do calculations before determining horizontal spacing
+    virtual void do_pre_processing();
+
+    
+    /// do calculations after determining horizontal spacing
+    virtual void do_post_processing();
+    
+    virtual void do_substitute_dependency(Score_elem * , Score_elem *);
+    virtual void do_break_processing();
+    virtual void handle_broken_dependencies();
+};
+
+
+#endif // STAFFELEM_HH
+
index fc4a554f4524b50a6a487acc6a7a4dc9731847df..ca19c0f9426bf107683193abe6db078519426995 100644 (file)
@@ -1,7 +1,7 @@
 /*
   score-walker.hh -- declare Score_walker
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 
@@ -12,7 +12,7 @@
 #ifndef SCOREWALKER_HH
 #define SCOREWALKER_HH
 #include "pcursor.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "varray.hh"
 
 
index da38be4b410a506e344a27b4a626a8ded8c40be9..364146883750a5042a82e3e6b83cf57f0cc4600b 100644 (file)
@@ -1,7 +1,7 @@
 /*
   score.hh -- declare Score
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -11,7 +11,7 @@
 #define SCORE_HH
 
 #include "varray.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "plist.hh"
 #include "moment.hh"
 #include "assoc.hh"
index 15c10f31cf9278880b15c7b3015ae584137634e0..688d95b5642ee556b873f207f4db4c31e66dfdcf 100644 (file)
@@ -1,33 +1,44 @@
+
 /*
-  scoreline.hh -- part of LilyPond
+  scoreline.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
 
 #ifndef SCORELINE_HH
 #define SCORELINE_HH
-#include "proto.hh"
-#include "plist.hh"
-#include "varray.hh"
 
-/// the columns of a score that form one line.
-struct
-Line_of_score {
-    Link_list<PCol *> cols;
+#include "colhpos.hh"
+#include "spanner-elem-group.hh"
 
+/// the columns of a score that form one line.
+class Line_of_score : public Spanner_elem_group {
+public:
+    Link_array<Spanner_elem_group> line_arr_;
+    Link_array<PCol > cols;
     bool error_mark_b_;
-    // need to store height of each staff.
-    Pointer_list<Line_of_staff*> staffs;
-    PScore * pscore_l_;        // needed to generate staffs
-
+    virtual String TeX_string() const;    
+    
     /* *************** */
-    void process() ;
-    Line_of_score(Array<PCol *> sv,  PScore *);
-
-    String TeXstring() const;
-
-    // is #c# contained in #*this#?
-    bool element(PCol const *c);
+    NAME_MEMBERS(Line_of_score);
+    Line_of_score();
+    
+    void add_line(Spanner_elem_group *);
+
+    /// is #c# contained in #*this#?
+    bool contains_b(PCol const *c)const;
+    
+    Link_array<Line_of_score> get_lines()const;
+    void set_breaking(Array<Col_hpositions> const&);
+    
+protected:
+    virtual void break_into_pieces();
+    virtual void do_substitute_dependency(Score_elem*,Score_elem*);
+    virtual void do_pre_processing();
+    virtual void do_post_processing();
+
+
+    SPANNER_CLONE(Line_of_score)
 };
 
 #endif
index f6adf9ffcbe6c20a6200c129c6688aa516afa3ef..22564d480524dab4153aab693a616d945650f3e3 100644 (file)
@@ -1,7 +1,7 @@
 /*
   script-column.hh -- declare Script_column
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 #ifndef SCRIPT_COLUMN_HH
 #define SCRIPT_COLUMN_HH
 
+#include "elem-group.hh"
 #include "item.hh"
 
 /** a struct for treating a group of noteheads (noteheads, stem
   (chord) and scripts ) as a single entity.  */
-class Script_column : public Item {
+class Script_column : public Item, public Element_group {
+
 protected:
-    virtual Interval do_height()const;
-    virtual Interval do_width()const;
-    virtual void do_print() const ;
-    virtual void do_pre_processing();
+    virtual void do_print() const;
+    virtual void do_substitute_dependency(Score_elem*, Score_elem*);
+    virtual void do_pre_processing() ;
 public:
-    Array<Script *> script_l_arr_;
-    Array<Item *> support_l_arr_;
-    
+    Link_array<Script> script_l_arr_;
+    Link_array<Item> support_l_arr_;
     NAME_MEMBERS(Script_column);
-    virtual void translate(Offset);
+   
     void add(Script *);
     void add_support(Item*);
 };
index 9af312bfa4361ae8bf772ac27f8e5b10547f6809..d45e459d84fe1b3bd619a927ec23bec4ebeaaac1 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  script-def.hh -- part of LilyPond
+  script-def.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
index f7fc05d9eb6e17797abc105c980369d47d43d062..d5a860f378e45139b281c545babfd8e7f3a9ebdf 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  script-reg.hh -- part of LilyPond
+  script-reg.hh -- part of GNU LilyPond
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 5ad74821cc37fb02d4b75dccec844c5f9c5b16ff..e55d252ff1a1b0e62c0f6363ad3262a76db76543 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  script.hh -- part of LilyPond
+  script.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
index 68f073e10f4d32f2ad4c48bc914002c335ef5474..98cf4334f20bd200270cb092b28e654c344e2f15 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  slur.hh -- part of LilyPond
+  slur.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
@@ -9,20 +9,23 @@
 
 #include "directional-spanner.hh"
 #include "lily-proto.hh"
-#include "varray.hh"
+#include "parray.hh"
 #include "bow.hh"
 
+/**
+  A #Bow# which tries to drape itself around the stems too.
+ */
 class Slur : public Bow {
 public:
-    Array<Note_column*> encompass_arr_;
-
-    void do_post_processing();
-    void do_pre_processing();
+    Link_array<Note_column> encompass_arr_;
     void add(Note_column*);
-    void set_default_dir();
-
-    Spanner* do_break_at( PCol*, PCol*) const; 
-private:
+protected:
+    virtual void set_default_dir();
+    virtual void do_break_at( PCol*, PCol*) ; 
+    virtual void do_post_processing();
+    virtual void do_substitute_dependency(Score_elem*, Score_elem*);
+    virtual void do_pre_processing();
+    SPANNER_CLONE(Slur)
     NAME_MEMBERS(Slur);
 };
 
diff --git a/lily/include/spanner-elem-group.hh b/lily/include/spanner-elem-group.hh
new file mode 100644 (file)
index 0000000..a23819a
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+  spanner-elem-group.hh -- declare Spanner_elem_group
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef SPANNER_ELEM_GROUP_HH
+#define SPANNER_ELEM_GROUP_HH
+
+#include "spanner.hh"
+#include "elem-group.hh"
+
+class Spanner_elem_group : public Spanner, public Element_group {
+    
+protected:
+    void do_break_at(PCol*,PCol*);
+    virtual Interval do_width()const;
+    virtual void do_print() const;
+    SPANNER_CLONE(Spanner_elem_group)
+    NAME_MEMBERS(Spanner_elem_group);
+};
+#endif // SPANNER_ELEM_GROUP_HH
index df5e9e58e9c1bab72434d01d6a74f1480e1d5e6a..074a555da2c7ab2e02dab150b57b2a6d1f4f4805 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  spanner.hh -- part of LilyPond
+  spanner.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
@@ -7,10 +7,12 @@
 #ifndef SPANNER_HH
 #define SPANNER_HH
 
-#include "proto.hh"
-#include "staff-elem.hh"
+#include "lily-proto.hh"
+#include "score-elem.hh"
 
 
+#define SPANNER_CLONE(T) VIRTUAL_COPY_CONS(T, Spanner)
+
 /** a symbol which is attached between two columns. A spanner is a
   symbol which spans across several columns, so its final appearance
   can only be calculated after the breaking problem is solved.
   is absolutely necessary for beams, since they have to adjust the
   length of stems of notes they encompass.
 
-    */
+  */
 class Spanner:public virtual Score_elem {
 public:
     PCol *left_col_l_, *right_col_l_;
-
     
     /* *************** */
     NAME_MEMBERS(Spanner);
     virtual Spanner* spanner() { return this; }    
     Spanner();
-    Spanner *broken_at(PCol *c1,  PCol *c2) const;
+    bool broken_b() const;
+    Spanner* find_broken_piece(Line_of_score*)const;
 protected:
+    SPANNER_CLONE(Spanner)
+    virtual void break_into_pieces();
 
+    Link_array<Spanner> broken_into_l_arr_;
+       
+    virtual void do_break_processing();
     virtual Interval do_width()const;
-    void do_print()const;
-
-
-    /**
-      clone a piece of  this spanner.
-      PRE
-      c1 >= start, c2  <= stop
-    */
-    virtual Spanner *do_break_at( PCol *c1,  PCol *c2) const=0;
+    virtual void do_print()const;
+    virtual Line_of_score*line_l()const;
 };
 #endif
diff --git a/lily/include/staff-elem-info.hh b/lily/include/staff-elem-info.hh
deleted file mode 100644 (file)
index 7d5955a..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-  staff-elem-info.hh -- declare Score_elem_info
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef STAFFELEMINFO_HH
-#define STAFFELEMINFO_HH
-
-#include "scalar.hh"
-#include "lily-proto.hh"
-#include "varray.hh"
-
-/// data container.
-struct Score_elem_info {
-    Score_elem * elem_l_;
-    Request*req_l_;
-    Voice const * voice_l_;
-    Array<Request_register*> origin_reg_l_arr_;
-
-    /* *** */
-    Score_elem_info(Score_elem*, Request*);
-    Score_elem_info();
-};
-
-
-struct Feature {
-    Scalar type_; 
-    Scalar value_;
-};
-#endif // STAFFELEMINFO_HH
diff --git a/lily/include/staff-elem.hh b/lily/include/staff-elem.hh
deleted file mode 100644 (file)
index fa459f9..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
-  staff-elem.hh -- part of LilyPond
-
-  (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef STAFFELEM_HH
-#define STAFFELEM_HH
-#include "varray.hh"
-#include "proto.hh"
-#include "offset.hh"
-#include "molecule.hh"
-#include "class-name.hh"
-
-
-/** Both Spanner and Item are Score_elem's. Most Score_elem's depend
-  on other Score_elem's, eg, Beam needs to know and set direction of
-  Stem. So the Beam has to be calculated *before* Stem. This is
-  accomplished with the dependencies field of struct Score_elem.
-
-  (elem)
-  */
-class Score_elem {
-
-    /// member: the symbols
-    Molecule *output;          // should scrap, and use temp var?
-
-
-    /**
-      This is  needed, because #output# may still be
-      NULL.
-      */
-    Offset offset_;
-    Array<Score_elem*> dependancy_l_arr_;
-public:
-    enum Status {
-       ORPHAN,                 // not yet added to pstaff
-       VIRGIN,                 // added to pstaff
-       PRECALCING,
-       PRECALCED,              // calcs before spacing done
-       POSTCALCING,            // busy calculating. This is used to trap cyclic deps.
-       POSTCALCED,             // after spacing calcs done
-       VERTICALCING,           // height determined
-       VERTICALCED,
-       OUTPUT,                 // molecule has been output
-       DELETED,                // to catch malloc mistakes.
-    } status;
-    
-    ///  the pstaff it is in
-    PStaff *pstaff_l_;
-
-    /* *************** */
-    Score_elem(Score_elem const&);
-    String TeXstring () const ;
-    virtual void print() const;
-    virtual Interval width() const;
-    virtual Interval height() const;
-    Paper_def *paper() const;
-    virtual ~Score_elem();
-    Score_elem();
-    NAME_MEMBERS(Score_elem);    
-
-    /**
-      translate the symbol. The symbol does not have to be created yet. 
-      Overridable, since this staff-elem might act as a pseudo-list.
-     */
-    virtual void translate(Offset);
-    Offset offset()const;
-    void add_processing();
-    void pre_processing();
-    void post_processing();
-    void molecule_processing();
-    
-    virtual Spanner* spanner()  { return 0; }
-    virtual Item * item() { return 0; }
-    /**
-      add a dependency. It may be the 0 pointer, in which case, it is ignored.
-     */
-    void add_dependency(Score_elem* );    
-    void substitute_dependency(Score_elem* old, Score_elem * newdep);
-    
-protected:
-    virtual  Interval do_height()const;
-    virtual Interval do_width()const;
-    /// do printing of derived info.
-    virtual void do_print() const {}
-    /// generate the molecule    
-    virtual Molecule* brew_molecule_p()const;
-    ///executed directly after the item is added to the PScore
-    virtual void do_add_processing();
-    /// do calculations before determining horizontal spacing
-    virtual void do_pre_processing();
-
-    /// do calculations after determining horizontal spacing
-    virtual void do_post_processing();
-
-    /// do calculations after height of spanners/items is determined.
-    virtual void do_verticalcing();
-    Array<Score_elem*> dependant_l_arr_;
-
-};
-
-
-#endif // STAFFELEM_HH
-
index 2fc4fd79265696b7a0351d4d0bb2594b0bdc787b..a3aa533d2b77ced6d4630d4e4880cee0a08ab382 100644 (file)
@@ -1,7 +1,7 @@
 /*
   staff-info.hh -- declare Staff_info
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 69f1f5356e7c76d97ab754e509c9cf58b2e6bce0..34138fadf215aa0c79f7b77fc3f0f3155ebb7110 100644 (file)
@@ -1,7 +1,7 @@
 /*
   staff-regs.hh -- declare Staff_registers
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index c81353f0cb769664669583dbbf0d8c02c44db640..d25d109d22ecff81e5b70b102abde7026ee89b74 100644 (file)
@@ -1,7 +1,7 @@
 /*
   staff-side.hh -- declare Staff_side
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 #ifndef STAFF_SIDE_HH
 #define STAFF_SIDE_HH
 
-#include "staff-elem.hh"
+#include "score-elem.hh"
 
 /// A symbol which sits along  the staff
-class Staff_side  {
-    Array<Score_elem*> support_l_arr_;
+class Staff_side : virtual Score_elem {
+    Link_array<Score_elem> support_l_arr_;
     int staff_size_i_;
-    Score_elem * elem_l_;
     Interval support_height()const;
     Staff_symbol* staff_sym_l_;
+
     void read_staff_sym();
 public:
-    Real inter_f_;
+
     /**
       Vertical dir of symbol relative to staff. -1 = below staff?
       */
@@ -30,12 +30,13 @@ public:
     /// follow the support inside the staff?
     bool inside_staff_b_;
 
-    void set_staffsym(Staff_symbol*);
+    void set_staffsym(Staff_symbol *  );
   
-    Staff_side(Score_elem*);
+    Staff_side();
     void add_support(Score_elem*);
     
 protected:
+    virtual void do_substitute_dependency(Score_elem *, Score_elem*);
     int get_position_i()const;
     int get_position_i(Interval)const;
 };
index 7ca370dd616e404c68945951330d23508e85f690..b4c6f6617382ac6ecc846b82b737c8eb7b7f40b7 100644 (file)
@@ -1,7 +1,7 @@
 /*
   staff-sym-reg.hh -- declare 
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 852771b79e17fa9524360e72e085b8f84ba9ffba..c3a49dfc57a6620348efa23cb3c88f040623e7de 100644 (file)
@@ -1,7 +1,7 @@
 /*
   staffsym.hh -- declare Staff_symbol
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -21,14 +21,15 @@ class Staff_symbol : public Spanner
     int no_lines_i_;
 public:
 
+
     void set_extent(PCol* p1, PCol* p2);
     NAME_MEMBERS(Staff_symbol);
     Staff_symbol(int lines);
     Real inter_note_f()const;
     int steps_i()const;
 protected:
+    SPANNER_CLONE(Staff_symbol)
     virtual Molecule* brew_molecule_p() const;
     virtual void do_print()const;
-    virtual Spanner *do_break_at( PCol *c1,  PCol *c2) const;
 };
 #endif // STAFFSYM_HH
index fb0d098e07c4767acced302cc81fe22b622b9cf6..e46f0a8fb02a5b1dfe54f4f517ff9db0f86c5b01 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef STAFFWALKER_HH
 #define STAFFWALKER_HH
 
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "time-description.hh"
 #include "pcursor.hh"
 
index 7811f76c0ecfd79464df5cf7c26f3105fb69df25..f9f24d8150f69bcde487600051a9e9f7d4a411cd 100644 (file)
@@ -1,7 +1,7 @@
 /*
   staff.hh -- declare Staff
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 #define STAFF_HH
 
 #include "plist.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "moment.hh"
 
-/// base class for a collection of voices.
+/// A collection of voices.
 class Staff {
     Staff(const Staff&src);
     
@@ -23,14 +23,14 @@ public:
     Link_list<Voice*> voice_list_;
     /// runtime field
     Link_list<Staff_column*> cols_;
+    Line_of_staff * staff_line_l_;
 
     Score *score_l_;
     PScore *pscore_l_;
-    PStaff *pstaff_l_;
     
     /* *************************************************************** */
 
-    void add(const Link_list<Voice*> &s);
+    void add(Link_list<Voice*> const&s);
 
     void add_voice(Voice *v_p);
     Paper_def*paper()const;
@@ -45,9 +45,9 @@ public:
     void clean_cols() ;
     Staff();
     
-    virtual void set_output(PScore * destination)=0;
-    virtual Staff_walker *get_walker_p()=0;    
-    virtual ~Staff() { }
+    virtual void set_output(PScore * destination);
+    Staff_walker *get_walker_p();
+    virtual ~Staff();
     void add_col(Staff_column*);
 protected:
 
index ef9f3c196f523583b38ae3803592f205ed9f28d7..8eb28bc235cf2efb15cad82809f8eed9f3313208 100644 (file)
@@ -1,7 +1,7 @@
 /*
   staffeleminfo.hh -- declare Score_elem_info
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -10,7 +10,7 @@
 #ifndef STAFFELEMINFO_HH
 #define STAFFELEMINFO_HH
 
-#include "proto.hh"
+#include "lily-proto.hh"
 
 /// data container.
 struct Score_elem_info {
index 107d360c79860b7a3c86001bf7f097230238b6bd..f059a1418fe59f2fbfee5c2c79457f96363188b0 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  staffline.hh --     horizontal structures for broken scores.
+  staffline.hh -- horizontal structures for broken scores.
 
   (c) 1996,97 Han-Wen Nienhuys
 */
@@ -7,25 +7,20 @@
 #ifndef STAFFLINE_HH
 #define STAFFLINE_HH
 
-#include "proto.hh"
-#include "real.hh"
-#include "plist.hh"
-#include "varray.hh"
-#include "glob.hh"
-#include "p-staff.hh"
+#include "spanner-elem-group.hh"
 
 /// one broken line of staff.
-struct Line_of_staff {
+struct Line_of_staff : public Spanner_elem_group{
 
-    Line_of_score  * line_of_score_l_;
-    PStaff *pstaff_l_;
+    SPANNER_CLONE(Line_of_staff)
+public:
+    NAME_MEMBERS(Line_of_staff);
 
     /* *************** */
-    
-    String TeXstring() const;
-    Line_of_staff(Line_of_score*, PStaff *);
-    Interval height() const;
-    void process();
+    /** 
+      Add an element. If it is a Element_group, only the dependency
+      (otherwise, might translate doubly) */
+    void add_element(Score_elem*);
 };
 
 #endif
index f63f1ad6de8f141cfc0352bf06e447d0345e969d..77729ed1ac4dd368fad0e7d9dcc57a3e3ff93bc0 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  stem-beam-reg.hh -- part of LilyPond
+  stem-beam-reg.hh -- part of GNU LilyPond
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 9cabdcd2a0e087f248c7e28ac5a7e034398b1e98..dad7e1660fbf8b2b53cac21f52590f5e002e23f9 100644 (file)
@@ -43,9 +43,9 @@ class Stem : public Item {
     /**
       store the wholes (for vapourware tremolo)
      */
-    Array<Notehead*> whole_l_arr_;
-    Array<Notehead*> head_l_arr_;
-    Array<Notehead*> rest_l_arr_;
+    Link_array<Note_head> whole_l_arr_;
+    Link_array<Note_head> head_l_arr_;
+    Link_array<Note_head> rest_l_arr_;
     
 public:
     /// flagtype? 4 none, 8 8th flag, 0 = beam.
@@ -64,7 +64,7 @@ public:
     Stem(int staff_size_i);
     
     /// ensure that this Stem also encompasses the Notehead #n#
-    void add(Notehead*n);
+    void add(Note_head*n);
 
     NAME_MEMBERS(Stem);
 
@@ -73,6 +73,7 @@ public:
     void do_print() const;
     void set_stemend(Real);
     int get_default_dir();
+    int get_center_distance();
     void set_default_dir();
     void set_default_stemlen();
     void set_default_extents();
@@ -83,12 +84,14 @@ public:
     Real stem_start_f() const;
 
     bool invisible_b()const;
+    bool chord_b()const;
     
     /// heads that the stem encompasses (positions)
     int max_head_i() const;
     int min_head_i() const;
 protected:
-    void do_pre_processing();
+    virtual void do_substitute_dependency(Score_elem*,Score_elem*);
+    virtual void do_pre_processing();
     virtual Interval do_width() const;
     Molecule* brew_molecule_p() const;
 };
diff --git a/lily/include/super-elem.hh b/lily/include/super-elem.hh
new file mode 100644 (file)
index 0000000..db81347
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+  super-elem.hh -- declare Super_elem
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef SUPER_ELEM_HH
+#define SUPER_ELEM_HH
+
+#include "score-elem.hh"
+/** The toplevel element. The PScore contains this element, and any
+  element shoud be a dependency for the super element.
+  */
+class Super_elem : public virtual Score_elem {
+public:
+    Link_array<Line_of_score> lines_arr_;
+    Line_of_score * line_of_score_l_;
+    void add_broken_line(Line_of_score*);
+    Super_elem();
+    virtual String TeX_string()const;
+protected:
+    virtual void do_substitute_dependency(Score_elem*,Score_elem*);
+    virtual void handle_broken_dependencies();
+
+    virtual void do_add_processing();
+    NAME_MEMBERS(Super_elem);
+};
+
+#endif // SUPER_ELEM_HH
index 9785fa29accd662dbfc16b7f0fdd75f7e2a857b9..2f110866eff2c912d706dd11a25ae1ea666ae8ea 100644 (file)
@@ -1,7 +1,7 @@
 /*
   swallow-reg.hh -- declare Swallow_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index c166fa5bcfd67576637f15c6cc8faeae7eef78e4..6e04d049cff068a9ec34244e5ef4af096236494b 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "string.hh"
 #include "boxes.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
 
 struct Symbol {
     String tex;
index af45ba7d27c68d073f778d7375ef8bf50a04f9cb..386c9b29ddc5e2486da5737f4eac276b8c0e40ef 100644 (file)
@@ -1,3 +1,13 @@
+/*
+  tex.hh -- declare various functions for TeX output
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+
 #ifndef TEX_HH
 #define TEX_HH
 
@@ -5,7 +15,7 @@
 #include "boxes.hh"
 #include "scalar.hh"
 
-/** parameter substitution in TeXstrings.
+/** parameter substitution in TeX_strings.
   this function provides a simple macro mechanism:
 
   if source == "tex%bla%", then
@@ -14,7 +24,7 @@
 String
 substitute_args(String source, Array<String> args);
 
-/// parameter substitution in TeXstrings
+/// parameter substitution in TeX_strings
 String
 substitute_args(String source, Array<Scalar> args);
 
index c7b241c23d120ab126ffb3f274f8d919540468f4..0d792590c68f59a8235049d82fa6fc13cb88e9b9 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  text-def.hh -- part of LilyPond
+  text-def.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
@@ -8,7 +8,7 @@
 #define TEXT_DEF_HH
 
 #include "string.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "input.hh"
 
 class Text_def : public Input {
index 13d47e45faf54c21e686e84839d6dee621369f41..041db0f26e2bd751dbdf61e2119b77670f5955d2 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  text-item.hh -- part of LilyPond
+  text-item.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
index 4b251aef97ee665dcf63f7bd73d0e93c2fe0fc5b..3bab1d56393eb3fd575b3e2eaa14d9d81c46d939 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  text-reg.hh -- part of LilyPond
+  text-reg.hh -- part of GNU LilyPond
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index dbdea979ad25a1e277bd12643983806adb9472a2..a91d8d96910d3c49e1afe7cb4400ab4645823360 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  textspanner.hh -- part of LilyPond
+  textspanner.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
 
 /** a spanner which puts texts on top of other spanners.  Use for
   triplets, eentweetjes, ottava, etc.  */
-struct Text_spanner : Spanner {
+class Text_spanner : public Spanner {
+public:
+    Directional_spanner * support;
     Text_def spec;
     Offset text_off_;
-    Directional_spanner*support;
+    NAME_MEMBERS(Text_spanner);
 
-    /* *************** */
+    void set_support(Directional_spanner*);
+    Text_spanner();
+protected:
+    SPANNER_CLONE(Text_spanner)
 
-    NAME_MEMBERS(Text_spanner);
+    virtual void do_substitute_dependency(Score_elem*,Score_elem*);
     virtual void do_pre_processing();
     virtual void do_post_processing();
     virtual Interval height() const ;
     virtual Molecule* brew_molecule_p()const;
     virtual void do_print() const;
-    virtual Spanner* do_break_at(PCol*,PCol*)const;
-    Text_spanner();
-    void set_support(Directional_spanner*);
 };
 #endif // TEXTSPANNER_HH
 
index b0cd22762587df15ba97197fd6da760f9cabdb2a..9ad241ada1fe28a614ac73ceb890cb3af073996f 100644 (file)
@@ -1,7 +1,7 @@
 /*
   tie-reg.hh -- declare Tie_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 7f03564866a36dbfe608015e70e71d77f455b153..81c356dd7fe7346a48e832c7e2e51114c26e20c9 100644 (file)
@@ -1,7 +1,7 @@
 /*
   tie.hh -- declare Tie
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
 #include "bow.hh"
 
+/**
+  Connect two noteheads.
+  */
 class Tie : public Bow {
-    virtual Spanner* do_break_at(PCol*,PCol*)const;
     virtual void do_add_processing();
     virtual void do_post_processing();
     virtual void set_default_dir();
+    virtual void do_substitute_dependency(Score_elem*,Score_elem*);
+    
 public:
     bool same_pitch_b_;
-    Notehead * left_head_l_;
-    Notehead * right_head_l_;
-    void set_head(int, Notehead*head_l);
+    Note_head * left_head_l_;
+    Note_head * right_head_l_;
+    void set_head(int, Note_head*head_l);
+
     Tie();
-    
+    NAME_MEMBERS(Tie);
+    SPANNER_CLONE(Tie)
 };
 #endif // TIE_HH
index c4edb172bf02764670c537ea253f665811141bd6..a7ace609f1452b3032813405fcbff6683d70e794 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  moment.hh -- part of LilyPond
+  moment.hh -- part of GNU LilyPond
 
   (c) 1996,97 Han-Wen Nienhuys
 */
diff --git a/lily/include/vertical-brace.hh b/lily/include/vertical-brace.hh
deleted file mode 100644 (file)
index c0b368e..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
-  vertical-brace.hh -- declare 
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef VERTICAL_BRACE_HH
-#define VERTICAL_BRACE_HH
-
-#include "vertical-spanner.hh"
-
-class Vertical_brace : public Vertical_spanner {
-public:
-    
-};
-
-#endif // VERTICAL_BRACE_HH
diff --git a/lily/include/vertical-spanner.hh b/lily/include/vertical-spanner.hh
deleted file mode 100644 (file)
index be0aee6..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-  vertical-spanner.hh -- declare Vertical_spanner
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef VERTICAL_SPANNER_HH
-#define VERTICAL_SPANNER_HH
-
-#include "staff-elem.hh"
-
-class Vertical_spanner: virtual public Score_elem {
-public:
-    PStaff *lower_pstaff_l_;
-    PStaff *upper_pstaff_l_;
-    NAME_MEMBERS(Vertical_spanner);
-    
-    Vertical_spanner();
-    
-};
-#endif // VERTICAL_SPANNER_HH
index 75210c21d04c2e913abe700d3e1e83f3143315b0..00e72618c14127b66417edfb884f9035e86947b5 100644 (file)
@@ -1,7 +1,7 @@
 /*
   voice-element.hh -- declare Voice_element
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -10,7 +10,7 @@
 #ifndef VOICE_ELEMENT_HH
 #define VOICE_ELEMENT_HH
 
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "plist.hh"
 #include "moment.hh"
 #include "input.hh"
index 8a0837308d11c3cde7b4a5023c73e9916672ddfe..243965a1919996b30d57bf9cbb57b859543fd728 100644 (file)
@@ -1,7 +1,7 @@
 /*
   voice-group-regs.hh -- declare Voice_group_registers
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 4586f40ab2d3b5741107044dc8c07eab0884b170..c6e75b7505273194ca09125a3b1caaf1cecc4867 100644 (file)
@@ -1,7 +1,7 @@
 /*
   voice-regs.hh -- declare Voice_registers
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index a0aeddf796d3ef6fcc93f0c98ecc6372362b6dad..85c41f72f68d55bd4bcc34f4be130732951e9201 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef VOICE_HH
 #define VOICE_HH
 
-#include "proto.hh"
+#include "lily-proto.hh"
 #include "plist.hh"
 #include "moment.hh"
 
index 3326daad80dab97331fbafbc79a6982b97ede63c..e339baa9836447dcbc2a3a5a03f20195bf8f2dbd 100644 (file)
@@ -1,7 +1,7 @@
 /*
   walkregs.hh -- declare Walker_registers
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
 
 #include "register-group.hh"
-
+#include "parray.hh"
 /**
   Top level registers: the interface to Complex_walker.
 
   [sigh. Sometimes I wish C++ could do better late binding.]
- */
-struct Walker_registers : Register_group_register {
+
+  Basically, this distributes and collects elements and elementinfo to
+  children
+  */
+class Walker_registers : public Register_group_register {
+
     Array<Item*> prebreak_item_p_arr_;
     Array<Item*> nobreak_item_p_arr_;
     Array<Item*> postbreak_item_p_arr_;
+    Link_array<Score_elem> musical_item_p_arr_;
+    
     Array<Score_elem_info> announce_info_arr_;
  
     Complex_walker * walk_l_;
-
-    /* *************** */
-  
-    void typeset_musical_item(Score_elem * elem_p);
-    Walker_registers(Complex_walker*);
-    void do_announces();
-   
+protected:   
     virtual Staff_info get_staff_info();
 
     virtual void announce_element(Score_elem_info);
     virtual void acknowledge_element(Score_elem_info);
     virtual void typeset_breakable_item(Item * pre_p , Item * nobreak_p, Item * post_p);
     virtual void typeset_element(Score_elem*elem_p);
+    virtual Paper_def * paper() const;
+public:
     virtual void pre_move_processing();
     virtual void post_move_processing();
-    virtual Paper_def * paper() const;
+
+
+    void do_announces();
+    Walker_registers(Complex_walker*);
 };
 
 #endif // WALKREGS_HH
index 711b89bd6d57c8800d14d92259eb374c084fac28..4d0d24902a602f2c5c7ac692bf5fbc3b3a7bd002 100644 (file)
@@ -1,7 +1,7 @@
 /*
   input-register.cc -- implement Input_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 7c0c92abd9ef5605acd1092ee5b87176bd1f1b7f..5ba571aefcf9b2030ac006cc487310c68926a56f 100644 (file)
@@ -1,7 +1,7 @@
 /*
   input-score.cc -- implement Input_score
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 618d98f012554a60fc0c050c636cdca810c6040f..0b127baacb6a868c2078ff0bc420da2eadaf54c8 100644 (file)
@@ -1,7 +1,7 @@
 /*
   input-staff.cc -- implement Input_staff
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -11,7 +11,6 @@
 #include "input-music.hh"
 #include "input-staff.hh"
 #include "staff.hh"
-#include "complex-staff.hh"
 #include "my-lily-lexer.hh"
 #include "input-register.hh"
 
@@ -29,7 +28,7 @@ Input_staff::add(Input_music*m)
 Staff*
 Input_staff::parse(Score*score_l)
 {
-    Staff *p=new Complex_staff;
+    Staff *p=new Staff;
    
     p->score_l_ = score_l;
     p->ireg_p_ = (ireg_p_)? new Input_register(*ireg_p_):0;
index e586547d8068a3b3eef2abc335d00d676ae260c4..7c3b207eacf4e83a10f6c67843a56c818a9f3c8c 100644 (file)
@@ -1,7 +1,7 @@
 /*
   item.cc -- implement Item
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -32,6 +32,8 @@ Item::hpos_f()const
     return pcol_l_->hpos + offset().x;
 }
 
+
+
 Line_of_score *
 Item::line_l()const
 {
index 5de86a91a02445ae4496cf75efb459d0cf6b6f57..783572b0936f4ea2fd7e9807df553441248bc425 100644 (file)
@@ -54,7 +54,7 @@ Molecule*
 Key_item::brew_molecule_p()const
 {
     Molecule*output = new Molecule;
-    Real inter = paper()->internote();
+    Real inter = paper()->internote_f();
     
     for (int i =0; i < pitch.size(); i++) {
        Symbol s= paper()->lookup_l()->accidental(acc[i]);
index fe2371e349af5be657bfad9267004c3ab8eb5a3e..459ddf4d42766758b0a4442991ce237fc54847db 100644 (file)
@@ -1,7 +1,7 @@
 /*
   key-reg.cc -- implement Key_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 
index 608df47e23a267da5602480d904ed93dd714c51e..827b01c2c3afcc044903d4407a88dbdba673a9af 100644 (file)
@@ -1,7 +1,7 @@
 /*
   key.cc -- implement Key, Octave_key
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 
index 39250c95c4ad22a9aea2c9faa17bbfbaf58477eb..72ab455a2633b1f156f3e5b8f39532f9655e638c 100644 (file)
@@ -110,7 +110,12 @@ LYRICS             ({AA}|{NATIONAL})[^0-9 \t\n\f]*
                yy_pop_state();
        }
 }
-
+<longcomment><<EOF>> {
+       LexerError("EOF found inside a comment");
+       if (! close_input()) { 
+         yyterminate(); // can't move this, since it actually rets a YY_NULL
+       }
+}
 <notes,INITIAL,lyrics>
 \\include           {
        yy_push_state(incl);
index c118bbe22973d0d89c7fc5f29239be1361cc9ec9..698bc8bf7b762b28c0adb2576905295d4a5883ed 100644 (file)
@@ -1,7 +1,7 @@
 /*
   lexerinit.cc -- implement some stuff
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index f6d8b9ba7f6a8101b2aa78288c74b1a93888547f..50aba0bf41c127ff8e21e424283ff0841e10b470 100644 (file)
@@ -1,7 +1,7 @@
 /*
   local-key-item.cc -- implement Local_key_item, Local_acc
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -12,7 +12,7 @@
 #include "lookup.hh"
 #include "paper-def.hh"
 #include "musical-request.hh"
-#include "notehead.hh"
+#include "note-head.hh"
 #include "misc.hh"
 
 
@@ -65,7 +65,7 @@ Local_key_item::brew_molecule_p()const
        // do one octave
        if (accs[i].octave_i_ != lastoct) {
            if (octmol){
-               Real dy =lastoct*7*paper()->internote();
+               Real dy =lastoct*7*paper()->internote_f();
                octmol->translate(Offset(0, dy));
                output->add(*octmol);
                delete octmol;
@@ -75,14 +75,14 @@ Local_key_item::brew_molecule_p()const
        lastoct = accs[i].octave_i_;
        Symbol s =paper()->lookup_l()->accidental(accs[i].accidental_i_);   
        Atom a(s);
-       Real dy = (accs[i].name_i_ + c0_position) * paper()->internote();
+       Real dy = (accs[i].name_i_ + c0_position) * paper()->internote_f();
        a.translate(Offset(0,dy));
 
        octmol->add_right(a);
     }
 
     if (octmol){
-       Real dy =lastoct*7*paper()->internote();
+       Real dy =lastoct*7*paper()->internote_f();
        octmol->translate(Offset(0, dy));
        output->add(*octmol);
        delete octmol;
@@ -105,3 +105,12 @@ Local_acc::compare(Local_acc&a, Local_acc&b)
     return a.accidental_i_ - b.accidental_i_;
 };
 IMPLEMENT_STATIC_NAME(Local_key_item);
+
+void
+Local_key_item::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+    Item* o_l = o->item();
+    Item* n_l = n?n->item():0;
+
+    support_items_.substitute(o_l, n_l);
+}
index 9e014e7c7501d24e3411b024a60c1789791f33af..9569ab10a49d16fd4108fd545ea3366d41c5c0c0 100644 (file)
@@ -13,7 +13,7 @@
 #include "debug.hh"
 #include "key-item.hh"
 #include "tie.hh"
-#include "notehead.hh"
+#include "note-head.hh"
 
 Local_key_register::Local_key_register()
 {
index 12684d539d037dc8af5d518b65894d44303ef551..bc6af68d60112c5fc50df91e5750bd66e9398680 100644 (file)
@@ -1,7 +1,7 @@
 /*
   lookup.cc -- implement simple Lookup methods.
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 
@@ -19,6 +19,7 @@
 #include "tex.hh"
 #include "scalar.hh"
 
+
 Lookup::Lookup()
 {
     texsetting = "\\unknowntexsetting";
@@ -66,7 +67,7 @@ Lookup::text(String style, String text, int dir) const
 
 
 Real
-Lookup::internote() const
+Lookup::internote_f() const
 {
     return ball(4).dim.y.length()/2;
 }
@@ -129,8 +130,10 @@ Lookup::clef(String s) const
 Symbol
 Lookup::dots(int j) const
 {
-    if (j>3)
-       error("max 3 dots");    // todo
+    if (j>3) {
+       j = 3;
+       warning("max 3 dots");  // todo
+    }
     return (*symtables_)("dots")->lookup(j);
 }
 
@@ -185,7 +188,7 @@ Lookup::linestaff(int lines, Real wid) const
 {
     Symbol s;
     s.dim.x = Interval(0,wid);
-    Real dy = (lines >0) ? (lines-1)*internote()*2 : 0;
+    Real dy = (lines >0) ? (lines-1)*internote_f()*2 : 0;
     s.dim.y = Interval(0,dy);
 
     Array<String> a;
index 32712708da01afa702c106b765ebaa87b84e8cf6..e6f4a29256aed5615ba6b98ed71b8eb0738a0d71 100644 (file)
@@ -1,7 +1,7 @@
 /*
   lyric-register.cc -- implement Lyric_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 0b901f54d33c7bdc08b321ebe02d6b57ea9ecc80..19960f03def1b82ab92f04203857b51243a62cb5 100644 (file)
@@ -1,7 +1,7 @@
 /*
   main.cc -- implement main: entrypoints
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -54,7 +54,7 @@ usage()
        "  -M, --midi             produce midi output only\n"
        "  -V, --ignore-version   ignore mudela version\n"
        "\n"
-       "LilyPond was compiled with the following settings:\n"
+       "GNU LilyPond was compiled with the following settings:\n"
 #ifdef NDEBUG
        "NDEBUG "       
 #endif
@@ -75,7 +75,7 @@ notice()
 {
     cout <<
        "\n"
-       "LilyPond, a music typesetter.\n"
+       "GNU LilyPond, a music typesetter.\n"
        "Copyright (C) 1996,97 by\n"
        "  Han-Wen Nienhuys <hanwen@stack.nl>\n"
        "  Jan Nieuwenhuizen <jan@digicash.com>\n"
@@ -119,16 +119,15 @@ main (int argc, char **argv)
 {    
     debug_init();              // should be first
 
-//    File_path path(String(DIR_DATADIR)+"/init/") ;
-    // silly File_path, now has two .:.
-    File_path path( "." );
+
+    File_path path;
     
     // must override (come before) "/usr/local/share/lilypond"!
     char const * env_l=getenv("LILYINCLUDE");
     if (env_l) {
        path.add(env_l);
     }
-    
+    path.add( "" );
     path.add( String( DIR_DATADIR ) + "/init/" );
     
     path_l = & path;
index 338ea7e10f471a6dfeb0ee447f20c7309ab74bde..4c34c187348e76641f72f06911055412e7fee2df 100644 (file)
@@ -1,7 +1,7 @@
 /*
   meter-reg.cc -- implement Meter_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 163105ab3c3906952420337cf2add5198a948056..2f703f01f8f3478bb9bc08f98de562544fd29f20 100644 (file)
@@ -1,7 +1,7 @@
 //
 // midi-def.cc -- implement midi output
 //
-// source file of the LilyPond music typesetter
+// source file of the GNU LilyPond music typesetter
 //
 // (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
 
index af7ec3cc199729adff3581b0aa9dc3acaf25b0ae..5a391323df810fac69f26c0a8aa41cecf0a61e6c 100644 (file)
@@ -1,7 +1,7 @@
 //
 // midiitem.cc
 //
-// source file of the LilyPond music typesetter
+// source file of the GNU LilyPond music typesetter
 //
 // (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
 
index 7703f65a6c5c2cf0d6a9d0d918a9f56394ac3be4..1f34358a9d459d1506ed4304eb7a706adf8930eb 100644 (file)
@@ -1,7 +1,7 @@
 /*
   midioutput.cc -- implement Midi_output
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>, Jan Nieuwenhuizen <jan@digicash.com> 
 */
index e6a2e35b3c83a3eec383e71a73a00dea5d8750e4..51069c4cc6edc480b9983f81d258475ee2d7ab00 100644 (file)
@@ -1,7 +1,7 @@
 //
 // midistream.cc
 //
-// source file of the LilyPond music typesetter
+// source file of the GNU LilyPond music typesetter
 //
 // (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
 
index f00daa9b5eb6c0937939bb8f56a9b0c5d57276d2..f8b3de1738690b7e107c76924ba72c116ab62dbd 100644 (file)
@@ -1,7 +1,7 @@
 /*
   midi-walker.cc -- implement Midi_walker
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>, Jan Nieuwenhuizen <jan@digicash.com>
   
index 94d94cfd138a52357498de72c0e9ba63e5f6d605..ff047f2c771f89a4bbce7469a21b76f3cfc2105a 100644 (file)
@@ -28,7 +28,7 @@ Atom::Atom(Symbol s)
 
 
 String
-Atom::TeXstring() const
+Atom::TeX_string() const
 {
     /* infinity checks. */
     assert( abs(off.x) < 100 CM);
@@ -46,11 +46,11 @@ Atom::TeXstring() const
 /* *************** */
 
 String
-Molecule::TeXstring() const
+Molecule::TeX_string() const
 {
     String s;
     for(iter_top(ats,c); c.ok(); c++)
-       s+=c->TeXstring();
+       s+=c->TeX_string();
     return s;
 }
 
index 9f65d8a88f88d0159ee450bb86bad6e46e12c121..f442db5f9b8cbb833668a5068dac1345cefb405d 100644 (file)
@@ -1,7 +1,7 @@
 /*
   request.cc -- implement all musical requests.
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 8e14e791d25c70780cc38537b7caea5ee496965f..4a44823344aa6ed4804ae6aea0b37f6c2950d60a 100644 (file)
@@ -1,7 +1,7 @@
 /*
   my-lily-lexer.cc -- implement My_lily_lexer
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 5389803e63dff272b66fdfa09607361334fb9656..c742946294bb4078ad02b25b2d6a61fa1e1b976f 100644 (file)
@@ -1,7 +1,7 @@
 /*
   my-lily-parser.cc -- implement My_lily_parser
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index feee0c66b50b1291275920b054d780991955815d..8ea7cc2d6855eaaff54d9948c592d9cb08fa6cc8 100644 (file)
@@ -1,13 +1,13 @@
 /*
   note-column-reg.cc -- implement Note_column_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
 #include "note-column-reg.hh"
-#include "notehead.hh"
+#include "note-head.hh"
 #include "stem.hh"
 #include "note-column.hh"
 #include "script.hh"
@@ -17,7 +17,7 @@ bool
 Note_column_register::acceptable_elem_b(Score_elem const*elem_C)const
 {
     char const*nC = elem_C->name();
-    return (nC == Script::static_name() || nC == Notehead::static_name() 
+    return (nC == Script::static_name() || nC == Note_head::static_name() 
            || nC == Stem::static_name());
 }
 Note_column*
@@ -51,8 +51,8 @@ Note_column_register::acknowledge_element(Score_elem_info i)
 
     if (nC == Script::static_name()) {
        script_l_arr_.push((Script*)i.elem_l_->item());
-    } else if (nC == Notehead::static_name()) {
-       Notehead * h_l = (Notehead*)i.elem_l_->item();
+    } else if (nC == Note_head::static_name()) {
+       Note_head * h_l = (Note_head*)i.elem_l_->item();
        if (h_l->rest_b_)
            rest_col_l()->add(h_l);
        else
@@ -104,7 +104,7 @@ Note_column_register::set_feature(Feature i)
      if (i.type_ == "vdir")    
        dir_i_ = i.value_;
      if (i.type_ == "hshift")
-        h_shift_b_ = i.value_;
+        h_shift_b_ = (bool)(int)i.value_;
 }
 
 Note_column_register::Note_column_register()
index f0c518a5b78fee195de4bcd86296352d3ff77a08..9af2cd3fd430c5d1aaa641907b86f286fdedcb23 100644 (file)
@@ -1,7 +1,7 @@
 /*
   note-column.cc -- implement Note_column
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -9,7 +9,7 @@
 #include "note-column.hh"
 #include "debug.hh"
 #include "script.hh"
-#include "notehead.hh"
+#include "note-head.hh"
 #include "stem.hh"
 
 IMPLEMENT_STATIC_NAME(Note_column);
@@ -22,7 +22,7 @@ Note_column::add(Stem*stem_l)
 }
 
 void
-Note_column::add(Notehead* n_l)
+Note_column::add(Note_head* n_l)
 {
     assert(!n_l->rest_b_);
     head_l_arr_.push(n_l);
@@ -39,7 +39,7 @@ Note_column::Note_column()
 void
 Note_column::sort()
 {
-    head_l_arr_.sort( Notehead::compare);
+    head_l_arr_.sort( Note_head::compare);
 }
     
 Interval_t<int>
@@ -62,3 +62,18 @@ Note_column::do_pre_processing()
            dir_i_ = (head_positions_interval().center() >=  5) ? -1 : 1;
     }
 }
+
+    
+
+void
+Note_column::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+    Script_column::do_substitute_dependency(o,n);
+    if (o->name() == Note_head::static_name()) {
+       head_l_arr_.substitute( (Note_head*)o->item(), 
+                               (n)? (Note_head*)n->item() : 0);
+    }
+    if (stem_l_ == o) {
+       stem_l_ = n ? (Stem*)n->item():0;
+    }
+}
index 6e6ca348d9371b087881699302e01337a744788f..ccfffcc2b5d014e40e8a05cc0d8cc34a10cdd24a 100644 (file)
@@ -1,5 +1,5 @@
 #include "misc.hh"
-#include "notehead.hh"
+#include "note-head.hh"
 #include "dimen.hh" 
 #include "debug.hh"
 #include "paper-def.hh"
@@ -9,7 +9,7 @@
 
 
 
-Notehead::Notehead(int ss)
+Note_head::Note_head(int ss)
 {
     x_dir_i_ = 0;
     staff_size_i_=ss;
@@ -21,16 +21,18 @@ Notehead::Notehead(int ss)
 }
 
 void
-Notehead::set_rhythmic(Rhythmic_req*r_req_l)
+Note_head::set_rhythmic(Rhythmic_req*r_req_l)
 {
     balltype_i_ = r_req_l->duration_.type_i_;
+    if (balltype_i_ > 4)
+       balltype_i_ = 4;
     dots_i_ = r_req_l->duration_.dots_i_;
 }
     
-IMPLEMENT_STATIC_NAME(Notehead);
+IMPLEMENT_STATIC_NAME(Note_head);
 
 void
-Notehead::do_print()const
+Note_head::do_print()const
 {
 #ifndef NPRINT
     if (rest_b_)
@@ -42,18 +44,18 @@ Notehead::do_print()const
 
 
 int
-Notehead::compare(Notehead *const  &a, Notehead * const &b)
+Note_head::compare(Note_head *const  &a, Note_head * const &b)
 {
     return a->position_i_ - b->position_i_;
 }
 
 Molecule*
-Notehead::brew_molecule_p() const 
+Note_head::brew_molecule_p() const 
 {
     Molecule*out = 0;
     Paper_def *p = paper();
 
-    Real dy = p->internote();
+    Real dy = p->internote_f();
     Symbol s;
     if (!rest_b_)
        s = p->lookup_l()->ball(balltype_i_);
index b8753929a9fa91e60b11e2319cef466105356749..46838b96f8b9a6d391d9579cc17a6cb3801b15a7 100644 (file)
@@ -1,7 +1,7 @@
 /*
   notename-table.cc -- implement Notename_table
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index ae39bdda9a4ba9c451678335f45a1a533797bf7b..66701e384082625933be0898ea084dbaee6d1ecd 100644 (file)
@@ -1,14 +1,14 @@
 /*
   p-col.cc -- implement PCol
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
 #include "p-col.hh"
 #include "p-score.hh"
-#include "p-staff.hh"
+
 #include "debug.hh"
 
 Interval
@@ -24,7 +24,7 @@ PCol::width() const
 }
 
 int
-PCol::rank() const
+PCol::rank_i() const
 {
     assert(rank_i_ != -1);
     return rank_i_;
@@ -66,7 +66,7 @@ PCol::print() const
 int
 PCol::compare(PCol const &c1, PCol const &c2)
 {
-    return c1.rank() - c2.rank();
+    return c1.rank_i() - c2.rank_i();
 }
 
 void
index 24421334ab955f99922618156380bfd918ef9368..bf91890d77dee78491daf405623a6000e9e3104c 100644 (file)
@@ -1,3 +1,12 @@
+/*
+  p-score.cc -- implement PScore
+
+  source file of the LilyPond music typesetter
+
+  (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "super-elem.hh"
 #include "idealspacing.hh"
 #include "debug.hh"
 #include "lookup.hh"
 #include "tex-stream.hh"
 #include "item.hh"
 #include "break.hh"
+#include "p-col.hh"
+
+void
+PScore::typeset_element(Score_elem * elem_p)
+{
+    elem_p_list_.bottom().add(elem_p);
+    elem_p->pscore_l_ = this;
+    elem_p->add_processing();
+}
+
+void
+PScore::typeset_item(Item *i, PCol *c, int breakstat)
+{
+    assert(c && i);
+
+    if (breakstat == 0) {
+       typeset_item(i, c->prebreak_p_);
+       return;
+    }
+
+    if (breakstat == 2) {
+       typeset_item(i, c->postbreak_p_);
+       return;
+    }
+
+    c->add(i);
+    typeset_element(i);
+}
+
+void
+PScore::typeset_broken_spanner(Spanner*span_p)
+{
+    span_p->left_col_l_->starters.bottom().add (span_p);
+    span_p->right_col_l_->stoppers.bottom().add(span_p);
+    assert(span_p->left_col_l_->line_l_ == span_p->right_col_l_->line_l_);
+
+    typeset_element(span_p);
+}
+
+
+void
+PScore::typeset_unbroken_spanner(Spanner*span_p)
+{
+    spanners.bottom().add(span_p);
+    span_p->pscore_l_=this;
+    // do not init start/stop fields. These are for broken spans only.
+    span_p->add_processing();
+}
 
 Idealspacing*
 PScore::get_spacing(PCol*l, PCol*r)
@@ -34,18 +91,8 @@ PScore::clean_cols()
            c->set_rank(rank_i++);
            c++;
        }
-    
 }
 
-
-void
-PScore::add(PStaff *s)
-{
-    assert(s->pscore_l_ == this);
-    staffs.bottom().add(s);
-}
-
-
 void
 PScore::do_connect(PCol *c1, PCol *c2, Real d, Real h)
 {
@@ -67,42 +114,6 @@ PScore::connect(PCol* c1, PCol *c2, Real d, Real h)
     do_connect(c1->postbreak_p_, c2->prebreak_p_,d,h);
 }
 
-void
-PScore::typeset_item(Item *i, PCol *c, PStaff *s, int breakstat)
-{
-    assert(c && i && s);
-
-    if (breakstat == 0) {
-       typeset_item(i, c->prebreak_p_, s);
-       return;
-    }
-
-    if (breakstat == 2) {
-       typeset_item(i, c->postbreak_p_, s);
-       return;
-    }
-
-
-    its.bottom().add(i);
-    s->add(i);
-    c->add(i);
-
-    /* first do this, because i->width() may follow the 0-pointer */
-    i->add_processing();    
-}
-
-void
-PScore::typeset_spanner(Spanner*span_p, PStaff*ps)
-{
-    span_p->pstaff_l_ = ps;
-    spanners.bottom().add(span_p);
-    ps->spans.bottom().add(span_p);
-
-    // do not init start/stop fields. These are for broken spans only.
-    span_p->add_processing();
-}
-
-
 void
 PScore::add(PCol *p)
 {
@@ -114,37 +125,25 @@ PScore::add(PCol *p)
     cols.bottom().add(p);
 }
 
-PScore::PScore( Paper_def*p)
+PScore::PScore(Paper_def*p)
 {
     paper_l_ = p;
+    super_elem_l_   = new Super_elem;
+    typeset_element(super_elem_l_);
 }
 
 void
 PScore::output(Tex_stream &ts)
 {
-    int l=1;
-
     ts << "\n "<<  paper_l_->lookup_l()->texsetting << "%(Tex id)\n";
-    for (iter_top(lines,lic); lic.ok(); lic++) {
-       ts << "% line of score no. " << l++ <<"\n";
-       ts << lic->TeXstring();
-       if ((lic+1).ok())
-           ts << "\\interscoreline\n";
-    }  
+    ts<< super_elem_l_->TeX_string();
     ts << "\n\\EndLilyPondOutput";
 }
 
 
-Array<Item*>
-PScore::select_items(PStaff*ps, PCol*pc)
+PScore::~PScore()
 {
-    Array<Item*> ret;
-    assert(ps && pc);
-    for (iter_top(pc->its,i); i.ok(); i++){
-       if (i->pstaff_l_ == ps)
-           ret.push((Item*)(Item const *)i);
-    }
-    return ret;
+    super_elem_l_->unlink_all();
 }
 
 void
@@ -164,8 +163,11 @@ PScore::print() const
 #ifndef NPRINT
     mtor << "PScore { ";
     paper_l_->print();
+    mtor << "\n elements: ";
+    for (iter_top(elem_p_list_,cc); cc.ok(); cc++)     
+       cc->print();
     mtor << "\ncolumns: ";
-    for (iter_top(cols,cc); cc.ok(); cc++)
+     for (iter_top(cols,cc); cc.ok(); cc++)
        cc->print();
     
     mtor << "\nideals: ";
@@ -178,34 +180,14 @@ PScore::print() const
 void
 PScore::preprocess()
 {
-    for (iter_top(spanners,i); i.ok(); i++) {
-       i->pre_processing();
-    }
-    for (iter_top(its,i); i.ok(); i++){
-       i->pre_processing();
-    }
+    super_elem_l_->pre_processing();
 }
 
 void
 PScore::postprocess()
 {
-    for (iter_top(broken_spans,i); i.ok(); i++) { // could chase spans as well.
-       i->post_processing();
-    }
-    for (iter_top(its,i); i.ok(); i++){
-       i->post_processing();
-    }
-    
-    for (iter_top(broken_spans,i); i.ok(); i++) {
-       i->molecule_processing();
-    }
-    for (iter_top(its,i); i.ok(); i++){
-       i->molecule_processing();
-    }
-
-    for (iter_top(lines,i); i.ok(); i++)
-       i->process();
-
+    super_elem_l_->post_processing();
+    super_elem_l_->molecule_processing();
 }
 
 PCursor<PCol *>
@@ -218,31 +200,22 @@ PScore::find_col(PCol const *c)const
     return cols.find((PCol*)what);
 }
 
-void
-PScore::add_broken(Spanner*s)
-{
-    assert(s->left_col_l_->line_l_ == s->right_col_l_->line_l_);
-    broken_spans.bottom().add(s);
-    s->left_col_l_->starters.bottom().add (s);
-    s->right_col_l_->stoppers.bottom().add (s);
-}
 
 void
 PScore::set_breaking(Array<Col_hpositions> const &breaking)
 {
-    for (int j=0; j < breaking.size(); j++) {
-       const Array<PCol*> &curline(breaking[j].cols);
-       const Array<PCol*> &errors(breaking[j].error_col_l_arr_);
-       const Array<Real> &config(breaking[j].config);
-       
-       Line_of_score *s_p = new Line_of_score(curline,this);
-       s_p->error_mark_b_ =  breaking[j].ugh_b_;
-       lines.bottom().add(s_p);        
-       for (int i=0; i < curline.size(); i++){
-           curline[i]->hpos = config[i];
+    super_elem_l_->line_of_score_l_->set_breaking( breaking);
+    super_elem_l_->break_processing();
+
+
+    for (iter_top(spanners,i); i.ok(); ) {
+       Spanner *span_p = i.remove_p();
+       if (span_p->broken_b()) {
+           span_p->unlink();
+           delete span_p;
+       }else{
+           typeset_broken_spanner(span_p);
        }
-       for (int i=0; i < errors.size(); i++)
-           errors[i]->error_mark_b_ = true;
     }
 }
 
@@ -265,3 +238,17 @@ PScore::process()
     *mlog << "\nPostprocessing elements..." << endl;
     postprocess();
 }
+
+Link_array<PCol>
+PScore::col_range(PCol*l,PCol*r)const
+{
+    Link_array<PCol> ret;
+    
+    PCursor<PCol*> start(l ? find_col(l)+1 : cols.top() );
+    PCursor<PCol*> stop(r ? find_col(r) : cols.bottom());
+    ret.push(l);
+    while ( start < stop )
+       ret.push(start++);
+    ret.push(r);
+    return ret;
+}
diff --git a/lily/p-staff.cc b/lily/p-staff.cc
deleted file mode 100644 (file)
index f8ba2bb..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#include "p-staff.hh"
-#include "molecule.hh"
-
-PStaff::PStaff(PScore*ps)
-{
-    pscore_l_=ps;
-}
-
-void
-PStaff::add(Item *i)
-{
-    its.bottom().add(i);
-    i->pstaff_l_ = this;
-}
index 256f3b88050e6a52262b34e49f7145ca7ca05adb..eaabea2fbe71b8f3f274bcbfd0beb8e581e8abc3 100644 (file)
@@ -1,7 +1,7 @@
 /*
   paper-def.cc -- implement Paper_def
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -65,15 +65,15 @@ Paper_def::set(Lookup*l)
 }
 
 Real
-Paper_def::interline() const
+Paper_def::interline_f() const
 {
     return lookup_p_->ball(4).dim.y.length();
 }
 
 Real
-Paper_def::internote() const
+Paper_def::internote_f() const
 {
-    return lookup_p_->internote();
+    return lookup_p_->internote_f();
 }
 Real
 Paper_def::note_width()const
index 0eb8d019688baaf3bc42805162b69fdab502d35b..539148422c187db7f6763b3bba4b635485bc8343 100644 (file)
@@ -792,7 +792,7 @@ dynamic_req:
                ad_p ->loudness_ = (Dynamic_req::Loudness)$3;
                $$ =ad_p;
        }
-       |SPANDYNAMIC '{' int int '}' {
+       | SPANDYNAMIC '{' int int '}' {
                Span_dynamic_req * sp_p = new Span_dynamic_req;
                sp_p->spantype = $4;
                sp_p-> dynamic_dir_i_  = $3;
index 58cdd538964131f50a8c96750649b24cd07067dc..e54c429f422c8568d33c342b44b3d918e93e447d 100644 (file)
@@ -1,7 +1,7 @@
 /*
   pulk-voices.cc -- implement Pulk_voice
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index b4127af90cbb3001d9160e683a709af35a891d46..6a480fab6a339e848ab62c987b46792ea6fcc07c 100644 (file)
@@ -1,7 +1,7 @@
 /*
   pulk-voices.cc -- implement Pulk_voices
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index dc8fbcab7e6ef27168fc9df534858764a60d2de8..5c4d91b6e67f61ceb7839e90555ae65ddd4f86a1 100644 (file)
@@ -1,7 +1,7 @@
 /*
   qlpsolve.cc -- implement Active_constraints, Inactive_iter
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 
index e80afd48e11d155a9fe9365fb96d83436b5ffa1f..f16aeb9e61c3d71551a334e0ed74e3341b98a005 100644 (file)
@@ -1,7 +1,7 @@
 /*
   registergroup.cc -- implement Register_group_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 7710ddf87d7da2a21aa3d10b05dbc5fc4ae33f5c..7a846bd6a586b926f12810ac994360ba1bf7596f 100644 (file)
@@ -1,7 +1,7 @@
 /*
   register.cc -- implement Request_register
 
-  Sourcefile of LilyPond musictypesetter
+  Sourcefile of GNU LilyPond musictypesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -9,10 +9,9 @@
 #include "voice.hh"
 #include "musical-request.hh"
 #include "register.hh"
-#include "notehead.hh"
+#include "note-head.hh"
 #include "complex-walker.hh"
 #include "local-key-item.hh"
-#include "complex-staff.hh"
 #include "register-group.hh"
 #include "debug.hh"
 
index 2913dae13b8166cbde2f2c9f7f87fb32053d2625..24ec7dececb6d7a3986369101bd7a7bac9c55a4d 100644 (file)
@@ -1,7 +1,7 @@
 /*
   request-column.cc -- implement Request_column
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index a9ca851cd44cfc3ec77a9f0730e778b3313bc549..8fba3f418b99cf5dd85a6c4c452dab69ec4355ea 100644 (file)
@@ -1,7 +1,7 @@
 /*
   rest-collision-reg.cc -- implement Rest_collision_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 42f7bbbfe33912f0d8e694c0256a470f221df1d9..0a7807ce3140cdd6465dbe10d8e9ed1f416ecc68 100644 (file)
@@ -1,7 +1,7 @@
 /*
   rest-collision.cc -- implement Rest_collision
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -56,3 +56,12 @@ Rest_collision::do_post_processing()
 #endif
 }
 IMPLEMENT_STATIC_NAME(Rest_collision);
+void
+Rest_collision::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+    Item*o_l = o->item();
+    Item*n_l = n?n->item():0;
+    
+    rest_l_arr_.substitute((Rest_column*)o_l,(Rest_column*)n_l);
+    ncol_l_arr_.substitute((Note_column*)o_l,(Note_column*)n_l);
+}
index f9543a2e013e5976df74e5a155c38a9612dd010c..8d0963482abc49ab7be4d6ccdddd5a5801111a96 100644 (file)
@@ -1,17 +1,17 @@
 /*
   rest-column.cc -- implement Rest_column
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
 #include "rest-column.hh"
-#include "notehead.hh"
+#include "note-head.hh"
 #include "rest-column.hh"
 
 void
-Rest_column::add(Notehead *n_l)
+Rest_column::add(Note_head *n_l)
 {
     add_support(n_l);
     head_l_arr_.push(n_l);
@@ -31,3 +31,13 @@ Rest_column::Rest_column()
     dir_i_ = 0;
 }
     
+
+void
+Rest_column::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+    Script_column::do_substitute_dependency(o,n);
+    if (o->name() == Note_head::static_name()) {
+       head_l_arr_.substitute( (Note_head*)o->item(), 
+                               (n)? (Note_head*)n->item() : 0);
+    }
+}
index 3a699e5dc507b7307a663f8182b3db58be5041ef..d01d78e5c15585602629cdda0c5b6e316899b5d0 100644 (file)
@@ -1,7 +1,7 @@
 /*
   score-column.cc -- implement Score_column
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
diff --git a/lily/score-elem-info.cc b/lily/score-elem-info.cc
new file mode 100644 (file)
index 0000000..9f15b84
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+  score-elem-info.cc -- implement Score_elem_info
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "score-elem-info.hh"
+#include "request.hh"
+
+Score_elem_info::Score_elem_info(Score_elem*s_l, Request*r_l)
+{
+    elem_l_ = s_l;
+    voice_l_ =  (r_l)?r_l->voice_l():0;
+    req_l_ = r_l;
+}
+
+Score_elem_info::Score_elem_info()
+{
+    elem_l_ = 0;
+    voice_l_ = 0;
+
+    req_l_ = 0;
+}
+
+
+
diff --git a/lily/score-elem.cc b/lily/score-elem.cc
new file mode 100644 (file)
index 0000000..218a8a7
--- /dev/null
@@ -0,0 +1,377 @@
+/*
+  score-elem.cc -- implement Score_elem
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "p-score.hh"
+#include "paper-def.hh"
+#include "lookup.hh"
+#include "molecule.hh"
+#include "score-elem.hh"
+#include "debug.hh"
+#include "tex.hh"
+#include "dimen.hh"
+#include "spanner.hh"
+#include "scoreline.hh"
+
+Score_elem*
+Score_elem::dependency(int i)const
+{
+    return (Score_elem*) get_out_edge_arr()[i];
+}
+
+int
+Score_elem::dependency_size() const
+{
+    return get_out_edge_arr().size();
+}
+
+Score_elem*
+Score_elem::dependent(int i) const
+{
+    return (Score_elem*) get_in_edge_arr()[i];
+}
+
+int
+Score_elem::dependent_size() const
+{
+    return get_in_edge_arr().size();
+}
+
+
+String
+Score_elem::TeX_string() const
+{
+    assert( status > POSTCALCED);
+    String s("\\placebox{%}{%}{%}");
+    Array<String> a;
+    a.push(print_dimen(offset_.y));
+    a.push(print_dimen(offset_.x));
+    a.push( output->TeX_string());
+    return substitute_args(s, a);
+}
+
+
+Score_elem::Score_elem(Score_elem const&s)
+{
+    /* called from derived ctor, so most info points to the same deps
+      as (Directed_graph_node&)s. Nobody points to us, so don't copy
+      dependents.      
+     */
+    copy_edges_out(s);
+    group_element_i_ = 0;
+    status = s.status;
+    assert(!s.output);
+    output = 0;
+    pscore_l_ = s.pscore_l_;
+    offset_ = Offset(0,0);
+}
+
+Score_elem::~Score_elem()
+{
+    // some paranoia to prevent weird segv's
+    assert(status < DELETED);
+    delete output;
+    status = DELETED;
+    output = 0;
+    assert(!group_element_i_ );
+}
+
+void
+Score_elem::translate(Offset O)
+{
+    offset_ += O;
+}
+
+Interval
+Score_elem::do_width() const 
+{
+    Interval r;
+    
+    if (!output){
+       Molecule*m = brew_molecule_p();
+       r = m->extent().x;
+       delete m;
+    } else
+       r = output->extent().x;
+    return r;
+}
+
+Interval
+Score_elem::width() const
+{
+    Interval r=do_width();
+
+    if (!r.empty_b()) // float exception on DEC Alpha
+       r+=offset_.x;
+
+    return r;
+}
+
+Interval
+Score_elem::do_height() const 
+{
+    Interval r;
+    if (!output){
+       Molecule*m = brew_molecule_p();
+       r = m->extent().y;
+       delete m;
+    } else
+       r = output->extent().y;
+    return r;
+}
+
+Interval
+Score_elem::height() const
+{
+    Interval r=do_height();
+
+    if (!r.empty_b())
+       r+=offset_.y;
+
+  
+    return r;
+}
+
+void
+Score_elem::print()const
+{
+#ifndef NPRINT
+    mtor << name() << "{\n";
+    mtor << "deps: " << dependent_size() << "depts: \n" << 
+       dependency_size() << "\n";
+    do_print();
+    if (output)
+       output->print();
+    
+    mtor <<  "}\n";
+#endif
+}
+
+
+
+Score_elem::Score_elem()
+{
+    group_element_i_ = 0;
+    pscore_l_=0;
+    offset_ = Offset(0,0);
+    output = 0;
+    status = ORPHAN;
+}
+
+
+Paper_def*
+Score_elem::paper()  const
+{
+    assert(pscore_l_);
+    return pscore_l_->paper_l_;
+}
+
+void
+Score_elem::add_processing()
+{
+    if (status >= VIRGIN)
+       return;
+    status = VIRGIN;
+    do_add_processing();
+}
+
+void
+Score_elem::pre_processing()
+{
+    if (status >= PRECALCED )
+       return;
+
+    assert(status != PRECALCING); // cyclic dependency
+    status = PRECALCING;
+
+    for (int i=0; i < dependency_size(); i++)
+       dependency(i)->pre_processing();
+
+    
+    do_pre_processing();
+    status = PRECALCED;
+}
+
+void
+Score_elem::break_processing()
+{
+    if (status >= BROKEN )
+       return;
+
+    assert(status != BREAKING); // cyclic dependency
+    status = BREAKING;
+
+    for (int i=0; i < dependency_size(); i++)
+       dependency(i)->break_processing();
+
+    
+    do_break_processing();
+    status = BROKEN;
+}
+
+void
+Score_elem::do_break_processing()
+{
+    handle_broken_dependencies();
+}
+
+
+void
+Score_elem::post_processing()
+{
+    if (status >= POSTCALCED)
+       return;
+    assert(status != POSTCALCING);// cyclic dependency
+    status=POSTCALCING;        
+
+  
+    for (int i=0; i < dependency_size(); i++)
+       dependency(i)->post_processing();
+    do_post_processing();
+    status=POSTCALCED;
+}
+
+void 
+Score_elem::molecule_processing()
+{
+    if (status >= OUTPUT)
+       return;
+    status = OUTPUT;           // do it only once.
+  
+    for (int i=0; i < dependency_size(); i++)
+       dependency(i)->molecule_processing();
+
+    output= brew_molecule_p();
+}
+
+void
+Score_elem::do_post_processing()
+{
+}
+
+void
+Score_elem::do_pre_processing()
+{
+}
+
+void
+Score_elem::do_add_processing()
+{
+
+}
+
+void
+Score_elem::do_substitute_dependency(Score_elem*,Score_elem*)
+{
+}
+
+
+IMPLEMENT_STATIC_NAME(Score_elem);
+
+Molecule*
+Score_elem::brew_molecule_p()const
+{
+    Atom a(paper()->lookup_l()->fill(Box(Interval(0,0), Interval(0,0))));
+    return new Molecule (a);
+}
+Offset
+Score_elem::offset() const
+{
+    return offset_; 
+}
+
+Line_of_score *
+Score_elem::line_l()const
+{
+    return 0;
+}
+
+/********************
+  DEPENDENCIES
+ */
+
+void
+Score_elem::remove_dependency(Score_elem*e)
+{
+    remove_edge_out(e);
+    do_substitute_dependency(e, 0);
+}
+
+void
+Score_elem::add_dependency(Score_elem*e)
+{
+    Directed_graph_node::add(e);
+}
+
+bool
+Score_elem::is_type_b(char const *s)
+{
+    return s == static_name();
+}
+
+void
+Score_elem::handle_broken_dependencies()
+{
+    Line_of_score *line  = line_l();
+    if (!line)
+       return;
+
+    Link_array<Score_elem> remove_us_arr;
+    for (int i=0; i < dependency_size(); i++) {
+       Score_elem * elt = dependency(i);
+       if (elt->line_l() != line){ 
+           if (elt->spanner()) {
+               Spanner * sp = elt->spanner();
+               Spanner * broken = sp->find_broken_piece(line);
+               do_substitute_dependency(sp, broken);
+               add_dependency(broken);
+               remove_us_arr.push(sp);
+           }
+           remove_us_arr.push(elt);
+       } 
+       
+    }
+
+    remove_us_arr.default_sort();
+    remove_us_arr.uniq();
+    for (int i=0;  i <remove_us_arr.size(); i++)
+       remove_dependency(remove_us_arr[i]);
+}
+
+
+void
+Score_elem::unlink_all()
+{
+    for (int i=0; i < dependency_size(); i++) 
+       dependency(i)->unlink_all();
+    junk_links();
+    group_element_i_ = 0;
+}
+
+void
+Score_elem::unlink()
+{
+    while ( dependency_size()) {
+       do_substitute_dependency(dependency(0),0);
+       remove_edge_out_idx(0);
+    }
+    while  ( dependent_size() ) {
+       dependent(0)->remove_dependency(this);
+    }
+}
+
+
+
+void
+Score_elem::OK()const
+{
+#ifndef NDEBUG
+    for (int i=0; i < dependency_size(); i++) {
+       dependency(i)->OK();
+    }
+#endif
+}
index 34fc0161e5382a4ba389473344dbd6f1cc2815ba..78041613f02908c924ae3804598bab46cb8389c9 100644 (file)
@@ -1,7 +1,7 @@
 /*
   score-walker.cc -- implement Score_walker
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index e04f20468cedfd84af6d2bfee72cfbd6a9ccc847..92a08351fff910cd150d255eaaf14a4431b9e2fe 100644 (file)
@@ -1,7 +1,7 @@
 /*
   score.cc -- implement Score
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -20,6 +20,7 @@
 #include "midi-def.hh"
 #include "pulk-voices.hh"
 #include "request-column.hh"
+#include "p-col.hh"
 
 extern String default_out_fn;
 
index d1837b4a679eed47d71e36124a7db226d459b2a3..c3edbdcc144ad42a470445aba79ec49bde9a6919 100644 (file)
@@ -1,7 +1,7 @@
 /*
   scoreline.cc -- implement Line_of_score
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 #include "p-score.hh"
 
 
+/* To do:
+   take out hard coded TeX stuff.
+   
+   */
 String
-Line_of_score::TeXstring() const
+Line_of_score::TeX_string() const
 {
-     String s("\\vbox{%<- line of score\n");
+     String s("\\hbox{%<- line of score\n");
      if (error_mark_b_)
         s+= "\\scorelineerrormark";
-     for (iter_top(staffs,sc); sc.ok(); sc++){
-        s += sc->TeXstring();
-        if ((sc+1).ok())
-            s+= "\\interstaffline\n";
+     
+     
+     Real lastpos = cols[0]->hpos;
+     for (int i=0; i < cols.size();  i++){
+        PCol* col_l= cols[i];
+        // all items in the current line & staff.
+        String chunk_str;
+        Real delta  = col_l->hpos - lastpos;
+           
+           
+        if (col_l->error_mark_b_) {
+            chunk_str += String("\\columnerrormark");
+        }
+        // now output the items.
+        for (iter_top(col_l->its,j); j.ok(); j++) {
+            chunk_str += j->TeX_string();
+        }
+        // spanners.
+        for (iter_top(col_l->starters,j); j.ok(); j++) {
+            if (j->name() != name())
+                chunk_str += j->TeX_string();
+        }
+        if (chunk_str!="") {
+            // moveover
+            if (delta)
+                s +=String( "\\kern ") + print_dimen(delta);
+            s += chunk_str;
+            lastpos = col_l->hpos;
+        }
      }
      s += "}";
      return s;
 }
 
 
-Line_of_score::Line_of_score(Array<PCol *> sv,
-                            PScore *ps)
+Line_of_score::Line_of_score()
 {
     error_mark_b_ = 0;
-    pscore_l_ = ps;
-    for (int i=0; i< sv.size(); i++) {
-       PCol *p=(PCol *) sv[i];
-       cols.bottom().add(p);
-       p->line_l_=this;
+}
+
+
+void
+Line_of_score::do_substitute_dependency(Score_elem*o, Score_elem*n)
+{
+    Spanner_elem_group::do_substitute_dependency(o,n);
+    
+    int i;
+    while ((i =line_arr_.find_i((Spanner_elem_group*)o->spanner())) >=0)
+       if (n)
+           line_arr_[i] = (Spanner_elem_group*)n->spanner();
+       else 
+           line_arr_.del(i);
+}
+
+
+void
+Line_of_score::do_post_processing()
+{
+    Real y_pos=0;
+    for (int i=line_arr_.size(); i--; ) {
+       Interval y = line_arr_[i]->height() ;
+       if (y.empty_b())
+           continue;
+       line_arr_[i]->translate(Offset(0, -y[-1] + y_pos));
+       y_pos += y.length();
     }
+    translate(Offset(0, -y_pos));
+}
+
+IMPLEMENT_STATIC_NAME(Line_of_score);
 
-    for (iter_top(pscore_l_->staffs,sc); sc.ok(); sc++)
-       staffs.bottom().add(new Line_of_staff(this, sc));    
+void
+Line_of_score::add_line(Spanner_elem_group*e)
+{
+    add_element(e);
+    line_arr_.push(e);
 }
-/* construct a line with the named columns. Make the line field
-    in each column point to this
-    
-    #sv# isn't really const!!
-    */
 
+bool
+Line_of_score::contains_b(PCol const* c)const
+{
+    return cols.find_l((PCol*)c);
+}
 
 void
-Line_of_score::process()
+Line_of_score::do_pre_processing()
 {
-    for (iter_top(staffs,i); i.ok(); i++)
-       i->process();
+    left_col_l_ = pscore_l_->cols.top();
+    right_col_l_ = pscore_l_->cols.bottom();
+    for (int i=0; i < line_arr_.size(); i++){
+       line_arr_[i]->left_col_l_ = left_col_l_;
+       line_arr_[i]->right_col_l_ = right_col_l_;
+    }
 }
+
+void
+Line_of_score::set_breaking(Array<Col_hpositions> const &breaking)
+{
+    for (int j=0; j < breaking.size(); j++) {
+       const Array<PCol*> &curline(breaking[j].cols);
+       const Array<PCol*> &errors(breaking[j].error_col_l_arr_);
+       const Array<Real> &config(breaking[j].config);
        
+       for (int i=0; i < errors.size(); i++)
+           errors[i]->error_mark_b_ = true;
+
+       Line_of_score *line_p = (Line_of_score*)clone();
+       for (int i=0; i < curline.size(); i++){
+           curline[i]->hpos = config[i];
+           curline[i]->line_l_ = (Line_of_score*)line_p;
+       }
+       ((Array<PCol*> &)line_p->cols) = curline;
+       line_p->left_col_l_ =  curline[0];
+       line_p->right_col_l_= curline.top();
+       pscore_l_->typeset_broken_spanner(line_p);
+       broken_into_l_arr_.push(line_p);
+    }
+}
+
+void
+Line_of_score::break_into_pieces()
+{
+    
+}
+
+Link_array<Line_of_score>
+Line_of_score::get_lines()const
+{
+    Link_array<Line_of_score> ret;
+    assert(broken_into_l_arr_.size());
+    for (int i=0; i < broken_into_l_arr_.size(); i++) {
+       ret.push((Line_of_score*)broken_into_l_arr_[i]);
+    }
+    return ret;
+}
index 637eb42dec6cf1ac5ce27ea4b6149f187788b09f..f2e21bd2fbc2ce43a579b0514ac44f23f43fab05 100644 (file)
@@ -1,7 +1,7 @@
 /*
   script-column.cc -- implement Script_column
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -9,7 +9,7 @@
 #include "script-column.hh"
 #include "debug.hh"
 #include "script.hh"
-#include "notehead.hh"
+#include "note-head.hh"
 #include "stem.hh"
 
 IMPLEMENT_STATIC_NAME(Script_column);
@@ -19,16 +19,7 @@ void
 Script_column::add(Script*s_l)
 {
     script_l_arr_.push(s_l);
-    add_dependency(s_l);
-}
-
-void
-Script_column::translate(Offset o)
-{
-    for (int i=0; i < script_l_arr_.size(); i++) 
-       script_l_arr_[i]->translate(o);
-    for (int i=0; i < support_l_arr_.size(); i++)
-       support_l_arr_[i]->translate(o);
+    add_element(s_l);
 }
 
 
@@ -38,21 +29,6 @@ Script_column::do_print()const
     mtor << "scripts: " << script_l_arr_.size() << '\n'; 
 }
 
-Interval
-Script_column::do_height()const return r
-{
-    for (int i=0; i < script_l_arr_.size(); i++) 
-       r.unite(script_l_arr_[i]->height());
-}
-
-Interval
-Script_column::do_width()const 
-{
-    Interval r;
-    for (int i=0; i < script_l_arr_.size(); i++) 
-       r.unite(script_l_arr_[i]->width());
-    return r;
-}
 
 void
 Script_column::do_pre_processing()
@@ -104,5 +80,15 @@ void
 Script_column::add_support(Item*i_l)
 {
     support_l_arr_.push(i_l);
-    add_dependency(i_l);
+    add_element(i_l);
+}
+
+void
+Script_column::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+    Element_group::do_substitute_dependency(o,n);
+    if (o->item()) {
+       script_l_arr_.substitute((Script*)o->item(),(Script*) (n?n->item():0));
+       support_l_arr_.substitute(o->item(), (n?n->item():0));
+    }
 }
index b350c8e7c91a0ac39946c8901ebc5c9f4de5c471..9ade2eddef3aec40666fda512842fe41928822f7 100644 (file)
@@ -1,7 +1,7 @@
 /*
   script.cc -- implement Script
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -24,7 +24,6 @@ Script::set_stem(Stem*st_l)
 
 
 Script::Script(Script_req* rq)
-    :Staff_side(this)
 {    
     specs_l_ = rq->scriptdef_p_;
     inside_staff_b_ = specs_l_->inside_staff_b_;
@@ -88,7 +87,7 @@ Script::do_post_processing()
 Molecule*
 Script::brew_molecule_p() const
 {
-    Real dy = paper()->internote();
+    Real dy = paper()->internote_f();
     
     Molecule*out = new Molecule(Atom(symbol()));
     out->translate(Offset(0,dy * pos_i_));
index 1fa1ad288531e0ac6f9f703910428a5d9d2780ea..9b6d75caf10793ce464b7998181fc3c82c33fd94 100644 (file)
@@ -1,7 +1,7 @@
 /*
   slur.cc -- implement  Slur
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -53,27 +53,38 @@ Slur::do_pre_processing()
     left_col_l_ = encompass_arr_[0]->pcol_l_;    
 }
 
-Spanner*
-Slur::do_break_at(PCol*l, PCol*r) const
+void
+Slur::do_break_at(PCol*l, PCol*r) 
 {
     assert(l->line_l_ == r->line_l_);
-    Slur*ret = new Slur(*this);
 
-    ret->encompass_arr_.set_size(0);
-    for (int i =0; i < encompass_arr_.size(); i++) {
-       if (encompass_arr_[i]->pcol_l_->line_l_==l->line_l_)
-           ret->encompass_arr_.push(encompass_arr_[i]);
+    Array<Note_column*> old_encompass_arr = encompass_arr_;
+    encompass_arr_.set_size(0);
+    for (int i =0; i < old_encompass_arr.size(); i++) {
+       if (old_encompass_arr[i]->pcol_l_->line_l_==l->line_l_)
+           encompass_arr_.push(old_encompass_arr[i]);
     }
+}
 
-    return ret;
+void
+Slur::do_substitute_dependency(Score_elem*o, Score_elem*n)
+{
+    int i;
+    while((i = encompass_arr_.find_i((Note_column*)o->item())) >=0) {
+       if (n)
+           encompass_arr_[i] = (Note_column*)n->item();
+       else
+           encompass_arr_.del(i);
+    }
 }
 
+
 void
 Slur::do_post_processing()
 {
     if (!dir_i_)
        set_default_dir();
-    Real inter_f = paper()->internote();
+    Real inter_f = paper()->internote_f();
     if (encompass_arr_[0]->stem_l_)
         left_pos_i_ = rint(encompass_arr_[0]->stem_l_->height()[dir_i_]/inter_f);
     else
diff --git a/lily/spanner-elem-group.cc b/lily/spanner-elem-group.cc
new file mode 100644 (file)
index 0000000..1baf0a6
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+  spanner-elem-group.cc -- implement 
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "p-col.hh"
+#include "spanner-elem-group.hh"
+
+void
+Spanner_elem_group::do_break_at(PCol*c1, PCol*c2 )
+{
+    Line_of_score * line_C = c1->line_l_;
+    Array<Score_elem*>  old_elems=elem_l_arr_;
+    elem_l_arr_.set_size(0);
+    for (int i=0; i < old_elems.size(); i++) {
+       if (old_elems[i]->line_l() == line_C) {
+           add_element(old_elems[i]);
+       }
+    }
+}
+
+IMPLEMENT_STATIC_NAME(Spanner_elem_group);
+
+Interval
+Spanner_elem_group::do_width() const
+{
+    return Spanner::do_width();
+}
+
+void
+Spanner_elem_group::do_print() const
+{
+    Element_group::do_print();
+}
+
index 53d7bca6b10290baf00f4ece3748de8f961ffd4d..4c8376ce5a650a303710f8d51ae0823a388cc48b 100644 (file)
@@ -1,34 +1,80 @@
+/*
+  spanner.cc -- implement Spanner
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include "debug.hh"
 #include "spanner.hh"
 #include "p-col.hh"
-
-
+#include "p-score.hh"
 
 IMPLEMENT_STATIC_NAME(Spanner);
 
 void
 Spanner::do_print()const
 {
-    mtor << " (unknown) ";
+    if (broken_into_l_arr_.size())
+       mtor << "Spanner with broken pieces\n";
 }
 
-Spanner*
-Spanner::broken_at(PCol*c1, PCol *c2)const
+void
+Spanner::break_into_pieces()
 {
-    Spanner *span_p = do_break_at(c1,c2);
-
-    for (int i=0; i < dependant_l_arr_.size(); i++) {
-       dependant_l_arr_[i]->
-           substitute_dependency((Score_elem*)this, span_p); 
+    PCol * left = left_col_l_;
+    PCol * right = right_col_l_;
+    if (left->daddy_l_)
+       left = left->daddy_l_;
+    if (right->daddy_l_)
+       right = right->daddy_l_;
+    
+    Link_array<PCol> all_cols = pscore_l_->col_range(left, right);
+    
+    Line_of_score *line = left->line_l_;
+    if (!line) {
+       left  = left->postbreak_p_;
+       line = left->line_l_;
     }
     
-    span_p->left_col_l_ = c1;
-    span_p->right_col_l_ = c2;
-    span_p->pstaff_l_ = pstaff_l_;
+    for (int i=1; i < all_cols.size(); i++) {
+       if (!all_cols[i]->line_l_) {
+
+           Spanner* span_p = clone();
+           right =  all_cols[i]->prebreak_p_;
+           assert(left&&right && left->line_l_ == right->line_l_);
+
+           span_p->left_col_l_  = left;
+           span_p->right_col_l_ = right;
+           left = all_cols[i]->postbreak_p_;
+           line = left->line_l_;
+           
+           pscore_l_->typeset_broken_spanner(span_p);
+           broken_into_l_arr_.push( span_p );
+       }
+    }
+}
+
+void
+Spanner::do_break_processing()
+{
+    if (!left_col_l_->line_l_)
+       left_col_l_ = left_col_l_->postbreak_p_;
+    if (!right_col_l_->line_l_)
+       right_col_l_ = right_col_l_->prebreak_p_;
+     
     
-    return span_p;
+    if (!line_l()) {
+       break_into_pieces();
+       for (int i=0; i < broken_into_l_arr_.size(); i++)
+           broken_into_l_arr_[i]->handle_broken_dependencies();
+    } else { 
+       handle_broken_dependencies();
+    }
 }
 
+
 Spanner::Spanner()
 {
     left_col_l_ = right_col_l_ = 0;
@@ -45,3 +91,28 @@ Spanner::do_width()const
        
     return Interval(0, r-l);
 }
+
+Line_of_score *
+Spanner::line_l()const
+{
+    if ( left_col_l_->line_l_ != right_col_l_->line_l_)
+       return 0;
+    return left_col_l_->line_l_;
+}
+
+
+Spanner*
+Spanner::find_broken_piece(Line_of_score*l)const
+{
+    for (int i=0; i < broken_into_l_arr_.size(); i++)
+       if(broken_into_l_arr_[i]->line_l() == l)
+           return broken_into_l_arr_[i];
+    return 0;                             
+         
+}
+
+bool
+Spanner::broken_b()const
+{
+    return broken_into_l_arr_.size();
+}
index bfff878ea8d512d0c9336a3448b0e4c5ddc0cfa7..750dd9d00d029bfaa7faaa7ac1de64071b27cc2b 100644 (file)
@@ -1,7 +1,7 @@
 /*
   staff-column.cc -- implement Staff_column
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -96,8 +96,7 @@ Staff_column::typeset_musical_item(Item*i)
 {
     assert(i);
     Score_column * scorecolumn_l = req_col_l_->musical_column_l_;
-    scorecolumn_l->pcol_l_->pscore_l_->typeset_item(i, scorecolumn_l->pcol_l_,
-                                                       staff_l_->pstaff_l_);
+    scorecolumn_l->pcol_l_->pscore_l_->typeset_item(i, scorecolumn_l->pcol_l_);
 }
 
 /**
@@ -128,9 +127,10 @@ translate_items(Real x,  Array<Item*> item_l_arr)
     for  (int i =0; i < item_l_arr.size(); i++) 
        item_l_arr[i]->translate(Offset(x, 0));
 }
-/*
-  UGR
-  This still sux
+/**
+  TODO: 
+  Write a "horizontal align" item, which aligns the pres, nobreaks, posts, etc.
+  
   */
 void
 Staff_column::typeset_breakable_items(Array<Item *> &pre_p_arr,
@@ -142,23 +142,27 @@ Staff_column::typeset_breakable_items(Array<Item *> &pre_p_arr,
     PScore *ps_l=scol_l->pcol_l_->pscore_l_;
     
     if (!c->breakable_b()) {     
-       for  (int i =0; i < pre_p_arr.size(); i++)
+       for  (int i =0; i < pre_p_arr.size(); i++) {
+           pre_p_arr[i]->unlink();
            delete pre_p_arr[i];
+       }
        pre_p_arr.set_size(0);
-       for  (int i =0; i < post_p_arr.size(); i++)
+       for  (int i =0; i < post_p_arr.size(); i++) {
+           post_p_arr[i]->unlink();
            delete post_p_arr[i];
+       }
        post_p_arr.set_size(0);
     }
 
       
     for  (int i =0; i < pre_p_arr.size(); i++) {
-       ps_l->typeset_item(pre_p_arr[i], c, staff_l_->pstaff_l_,0);
+       ps_l->typeset_item(pre_p_arr[i], c,0);
     }
     for  (int i =0; i < nobreak_p_arr.size(); i++) {
-       ps_l->typeset_item(nobreak_p_arr[i], c, staff_l_->pstaff_l_,1);
+       ps_l->typeset_item(nobreak_p_arr[i], c, 1);
     }
     for  (int i =0; i < post_p_arr.size(); i++) {
-       ps_l->typeset_item(post_p_arr[i], c, staff_l_->pstaff_l_,2);
+       ps_l->typeset_item(post_p_arr[i], c, 2);
     }
 
     Interval pre_wid= align_items(pre_p_arr);
diff --git a/lily/staff-elem-info.cc b/lily/staff-elem-info.cc
deleted file mode 100644 (file)
index 669c024..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-  staff-elem-info.cc -- implement Score_elem_info
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "staff-elem-info.hh"
-#include "request.hh"
-
-Score_elem_info::Score_elem_info(Score_elem*s_l, Request*r_l)
-{
-    elem_l_ = s_l;
-    voice_l_ =  (r_l)?r_l->voice_l():0;
-    req_l_ = r_l;
-}
-
-Score_elem_info::Score_elem_info()
-{
-    elem_l_ = 0;
-    voice_l_ = 0;
-
-    req_l_ = 0;
-}
-
-
-
diff --git a/lily/staff-elem.cc b/lily/staff-elem.cc
deleted file mode 100644 (file)
index ec4f851..0000000
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
-  staff-elem.cc -- implement Score_elem
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "paper-def.hh"
-#include "lookup.hh"
-#include "p-score.hh"
-#include "symbol.hh"
-#include "p-staff.hh"
-#include "molecule.hh"
-#include "staff-elem.hh"
-#include "debug.hh"
-
-String
-Score_elem::TeXstring() const
-{
-    Molecule m(*output);
-    m.translate(offset_);      // ugh?
-    return m.TeXstring();
-}
-
-Score_elem::Score_elem(Score_elem const&s)
-      :dependancy_l_arr_(s.dependancy_l_arr_),
-        dependant_l_arr_(s.dependant_l_arr_)
-{
-    status = s.status;
-    assert(!s.output);
-    output = 0;
-    pstaff_l_ = s.pstaff_l_;
-    offset_ = Offset(0,0);
-}
-
-/**
-  TODO:
-  If deleted, then remove dependant_l_arr_ depency!
-  */
-Score_elem::~Score_elem()
-{
-    assert(status < DELETED);
-    delete output;
-    status = DELETED;
-    output = 0;
-}
-
-void
-Score_elem::translate(Offset O)
-{
-    offset_ += O;
-}
-
-Interval
-Score_elem::do_width() const 
-{
-    Interval r;
-    
-    if (!output){
-       Molecule*m = brew_molecule_p();
-       r = m->extent().x;
-       delete m;
-    } else
-       r = output->extent().x;
-    return r;
-}
-
-Interval
-Score_elem::width() const
-{
-    Interval r=do_width();
-
-    if (!r.empty_b()) // float exception on DEC Alpha
-       r+=offset_.x;
-
-    return r;
-}
-Interval
-Score_elem::do_height() const 
-{
-    Interval r;
-    if (!output){
-       Molecule*m      = brew_molecule_p();
-       r = m->extent().y;
-       delete m;
-    } else
-       r = output->extent().y;
-    return r;
-}
-
-Interval
-Score_elem::height() const
-{
-    Interval r=do_height();
-
-    if (!r.empty_b())
-       r+=offset_.y;
-
-  
-    return r;
-}
-
-void
-Score_elem::print()const
-{
-#ifndef NPRINT
-    mtor << name() << "{\n";
-    do_print();
-    if (output)
-       output->print();
-    
-    mtor <<  "}\n";
-#endif
-}
-
-
-
-Score_elem::Score_elem()
-{
-    pstaff_l_=0;
-    offset_ = Offset(0,0);
-    output = 0;
-    status = ORPHAN;
-}
-
-
-Paper_def*
-Score_elem::paper()  const
-{
-    assert(pstaff_l_);
-    return pstaff_l_->pscore_l_->paper_l_;
-}
-
-void
-Score_elem::add_processing()
-{
-    if (status >= VIRGIN)
-       return;
-    status = VIRGIN;
-    do_add_processing();
-}
-
-void
-Score_elem::pre_processing()
-{
-    if (status >= PRECALCED )
-       return;
-    assert(status != PRECALCING); // cyclic dependency
-    status = PRECALCING;
-
-    for (int i=0; i < dependancy_l_arr_.size(); i++)
-       if (dependancy_l_arr_[i])
-           dependancy_l_arr_[i]->pre_processing();
-
-    
-    do_pre_processing();
-    status = PRECALCED;
-}
-void
-Score_elem::post_processing()
-{
-    if (status >= POSTCALCED)
-       return;
-    assert(status != POSTCALCING);// cyclic dependency
-    status=POSTCALCING;        
-
-    for (int i=0; i < dependancy_l_arr_.size(); i++)
-       if (dependancy_l_arr_[i])
-           dependancy_l_arr_[i]->post_processing();
-    do_post_processing();
-    status=POSTCALCED;
-}
-
-void 
-Score_elem::molecule_processing()
-{
-    if (status >= OUTPUT)
-       return;
-    status = OUTPUT;           // do it only once.
-    for (int i=0; i < dependancy_l_arr_.size(); i++)
-       if (dependancy_l_arr_[i])
-           dependancy_l_arr_[i]->molecule_processing();
-
-    output= brew_molecule_p();
-}
-
-void
-Score_elem::do_post_processing()
-{
-}
-
-void
-Score_elem::do_pre_processing()
-{
-}
-void
-Score_elem::do_verticalcing()
-{
-}
-
-void
-Score_elem::do_add_processing()
-{
-}
-
-void
-Score_elem::substitute_dependency(Score_elem * old, Score_elem * newdep)
-{
-    bool hebbes_b=false;
-    for (int i=0; i < dependancy_l_arr_.size(); i++) {
-       if (dependancy_l_arr_[i] == old){
-           dependancy_l_arr_[i] = newdep;
-           hebbes_b = true;
-       } else if (dependancy_l_arr_[i] == newdep) {
-           hebbes_b = true;
-       }
-    }
-    if (!hebbes_b)
-       dependancy_l_arr_.push(newdep);
-}
-
-void
-Score_elem::add_dependency(Score_elem * p)
-{
-    for (int i=0; i < dependancy_l_arr_.size(); i ++)
-       if (dependancy_l_arr_[i] == p)
-           return;
-    
-    dependancy_l_arr_.push(p);
-    p->dependant_l_arr_.push(p);
-}
-IMPLEMENT_STATIC_NAME(Score_elem);
-
-Molecule*
-Score_elem::brew_molecule_p()const
-{
-    Atom a(paper()->lookup_l()->fill(Box(Interval(0,0), Interval(0,0))));
-    return new Molecule (a);
-}
-Offset
-Score_elem::offset() const
-{
-    return offset_; 
-}
index e86900bb07ca566ddd7569e0e78fdf16133b925e..5e4ce77c05ecc4af4020d31c0716bcea2b3a3005 100644 (file)
@@ -1,7 +1,7 @@
 /*
   staff-info.cc -- implement Staff_info
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 #include "proto.hh"
index 7a0abadd9622061b3bda04d532febb162ebd1e85..19129a02cab7f252cf6aed61fd890baf435dd7e6 100644 (file)
@@ -1,7 +1,7 @@
 /*
   staff-regs.cc -- implement Staff_registers
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 1435f5daa99e9d1fd7892fbe04c6db57eddf3ba1..562b6c3d277b4adbd8a44fd238a3431e0d02a2d9 100644 (file)
@@ -1,11 +1,12 @@
 /*
   staff-side.cc -- implement Staff_side
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
+#include "paper-def.hh"
 #include "dimen.hh"
 #include "staff-side.hh"
 #include "staff-sym.hh"
@@ -17,12 +18,10 @@ Staff_side::set_staffsym(Staff_symbol* s_l)
     staff_sym_l_ = s_l;
 }
 
-Staff_side::Staff_side(Score_elem * elem_l)
+Staff_side::Staff_side()
 {
-    inter_f_ = 2 PT;
     staff_size_i_ = 0;
     staff_sym_l_=0;
-    elem_l_ = elem_l;
     dir_i_ =0;
     inside_staff_b_ =false;
 }
@@ -32,7 +31,6 @@ Staff_side::read_staff_sym()
 {
     if (! staff_sym_l_)
        return ;
-    inter_f_ = staff_sym_l_->inter_note_f();
     staff_size_i_ = staff_sym_l_->steps_i();
 }
 
@@ -54,13 +52,12 @@ void
 Staff_side::add_support(Score_elem*i)
 {
     support_l_arr_.push(i);
-    elem_l_->add_dependency(i);
+    add_dependency(i);
 }
 
 int
 Staff_side::get_position_i()const
 {
-    ((Staff_side*)this)->read_staff_sym();
     if (!dir_i_) {
        warning("Staff_side::get_position_i(): " 
                "somebody forgot to set my vertical direction, returning -20");
@@ -69,26 +66,42 @@ Staff_side::get_position_i()const
     
 
     Real y=0;
+    Real inter_f = paper()-> internote_f();
     if (!inside_staff_b_) {
-       y  = (dir_i_ > 0) ? staff_size_i_ + 2: -2; 
-       y *=inter_f_;
+       y  = (dir_i_ > 0 && staff_sym_l_) ? staff_sym_l_->steps_i() + 2: -2; 
+       y *=inter_f;
        Interval v= support_height();
 
        if (dir_i_ > 0) {
-           y = y >? (v.max() + 2*inter_f_);
+           y = y >? (v.max() + 2*inter_f);
        } else if (dir_i_ < 0) {
-           y = y <? (v.min() - 2*inter_f_);
+           y = y <? (v.min() - 2*inter_f);
        }
     } else {
        Interval v= support_height();
-       y = v[dir_i_]  + 2*dir_i_*inter_f_;     // ugh
+       y = v[dir_i_]  + 2*dir_i_*inter_f     // ugh
     }
-    return int(rint(Real(y)/inter_f_)); // should ret a float?
+    return int(rint(Real(y)/inter_f)); // should ret a float?
 }
 
 int
 Staff_side::get_position_i(Interval sym_dim) const
 { 
     int i= get_position_i();
-    return i+ int(rint(- sym_dim[-dir_i_] / inter_f_));
+    return i+ int(rint(- sym_dim[-dir_i_] / paper()->internote_f()));
+}
+
+
+void
+Staff_side::do_substitute_dependency(Score_elem*o, Score_elem*n )
+{ 
+    int i;
+    while ((i=support_l_arr_.find_i(o) ) >=0)
+       if (n) 
+           support_l_arr_[i] = n;
+       else
+           support_l_arr_.del(i);
+
+    if (staff_sym_l_ == o)
+       staff_sym_l_ = n ? (Staff_symbol*) n->spanner():0;
 }
index e8863369acf351934c68b8a381e29365d74bc45d..f0683f0d44ae6959c3526b45ec4ae269b3b642bc 100644 (file)
@@ -1,7 +1,7 @@
 /*
   staff-sym-reg.cc -- implement Staff_sym_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 9eb4d6d2ac5d9306875f25d96fda9cd49e41790a..ea17b178f62c49da223f8ea9171747f99bde65a5 100644 (file)
@@ -1,7 +1,7 @@
 /*
   staffsym.cc -- implement Staff_symbol
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -32,13 +32,6 @@ Staff_symbol::brew_molecule_p() const
     return new Molecule(a);
 }
 
-Spanner*
-Staff_symbol::do_break_at(PCol*p1, PCol*p2)const
-{
-    Staff_symbol *span_p=new Staff_symbol(*this);
-    return span_p;
-}
-
 void
 Staff_symbol::set_extent(PCol*p1, PCol*p2)
 {
@@ -50,7 +43,7 @@ Staff_symbol::set_extent(PCol*p1, PCol*p2)
 Real
 Staff_symbol::inter_note_f()const
 {
-    return paper()->internote();
+    return paper()->internote_f();
 }
 
 int
index ca6cbf500f03d03805849707e1d31905fcfc967e..b83c527168a9ed0b511204fb5d71e4274ca18b2f 100644 (file)
@@ -1,7 +1,7 @@
 /*
   staff-walker.cc -- implement Staff_walker
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index c601837147a81e86c0ebd71d8749479333b4dfd6..76e6d995cab21a8a75c907c739bcadd1b3b400b1 100644 (file)
@@ -1,12 +1,14 @@
 /*
   staff.cc -- implement Staff
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
-#include "input-register.hh"
+
 #include "proto.hh"
+#include "plist.hh"
+#include "input-register.hh"
 #include "staff.hh"
 #include "score.hh"
 #include "voice.hh"
 #include "debug.hh"
 #include "musical-request.hh"
 #include "command-request.hh" // todo
-
+#include "staffline.hh"
+#include "complex-walker.hh"
+#include "super-elem.hh"
+#include "p-score.hh"
+#include "scoreline.hh"
 
 void
 Staff::add(Link_list<Voice*> const &l)
@@ -57,9 +63,6 @@ Staff::OK() const
 #ifndef NDEBUG
     cols_.OK();
     voice_list_.OK();
-    iter_top(cols_, i);
-    iter_top(cols_, j);
-    i++;
     assert(score_l_);
 #endif    
 }
@@ -88,12 +91,16 @@ Staff::print() const
 #endif
 }
 
+Staff::~Staff()
+{
+    delete ireg_p_;
+}
+
 Staff::Staff()
 {    
     ireg_p_ =0;
     score_l_ =0;
     pscore_l_ =0;
-    pstaff_l_ =0;
 }
 
 void
@@ -102,3 +109,19 @@ Staff::add_col(Staff_column*c_l)
     cols_.bottom().add(c_l);
     c_l->staff_l_ = this;
 }
+
+void
+Staff::set_output(PScore* pscore_l )
+{
+    pscore_l_ = pscore_l;
+    staff_line_l_ = new Line_of_staff;
+    pscore_l_->typeset_unbroken_spanner(staff_line_l_);
+    pscore_l_->super_elem_l_->line_of_score_l_->add_line(staff_line_l_);
+}
+
+
+Staff_walker * 
+Staff::get_walker_p()
+{
+    return new Complex_walker(this);
+}
index c4d4861b8c29c07d23f3e74b227a90a3c1a052b1..533d51264585dcb7123c33db4969dd0b6b647ac5 100644 (file)
 #include "p-col.hh"
 #include "p-score.hh"
 
-static String
-make_vbox(Interval i)
-{
-    if (i.empty_b()) 
-       i = Interval(0,0);
-    Real r = i.length();
-    String s("\\vbox to ");
-    s += print_dimen(r);
-    s += "{\\vskip "+print_dimen(i.right)+" ";
-    return s;
-}
-
-    
-String
-Line_of_staff::TeXstring() const
-{
-    String s("%line_of_staff\n");
-    
-    s+=make_vbox(height());
-    // the staff itself: eg lines, accolades
-    s += "\\hbox{";
-    {                          
-       iter_top(line_of_score_l_->cols,cc);
-       Real lastpos=cc->hpos;
 
-       
-       // all items in the current line & staff.
-       for (; cc.ok(); cc++) {
-           String chunk_str;
-           
-           Real delta  = cc->hpos - lastpos;
-           
-           
-           if (cc->error_mark_b_) {
-               chunk_str += String("\\columnerrormark");
-           }
-           // now output the items.
-           for (iter_top(cc->its,i); i.ok(); i++) {
-               if (i->pstaff_l_ == pstaff_l_)
-                   chunk_str += i->TeXstring();
-           }
-           // spanners.
-           for (iter_top(cc->starters,i); i.ok(); i++)
-               if (i->pstaff_l_ == pstaff_l_)
-                   chunk_str += i->TeXstring();
-
-           if (chunk_str!="") {
-               // moveover
-               if (delta)
-                   s +=String( "\\kern ") + print_dimen(delta);
-               s += chunk_str;
-               lastpos = cc->hpos;
-           }
-       }
-    }
-    s+="\\hss}\\vss}";
-    return s;
-}
-
-Line_of_staff::Line_of_staff(Line_of_score * sc, PStaff*st)
-{
-    line_of_score_l_=sc;
-    pstaff_l_=st;
-
-    PCol *linestart = sc->cols.top();
-    PCol *linestop = sc->cols.bottom();
-    
-    for (iter_top(pstaff_l_->spans,i); i.ok(); i++) {
-       PCol *brokenstart = &max(*linestart, *i->left_col_l_);
-       PCol *brokenstop = &min(*linestop, *i->right_col_l_);
-       if ( *brokenstart < *brokenstop) {
-           Spanner*span_p =i->broken_at(brokenstart,brokenstop);
-           line_of_score_l_->pscore_l_-> // higghl
-               add_broken(span_p);
-       }
-    }
-}
-
-
-Interval
-Line_of_staff::height() const
-{
-    Interval y(0,0);
-
-    iter_top(line_of_score_l_->cols,cc);
-    
-    // all items in the current line & staff.
-    for (; cc.ok(); cc++) {
-       for (iter_top(cc->its,i); i.ok(); i++) {
-           if (i->pstaff_l_ == pstaff_l_) 
-               y.unite(i->height());
-           
-       }
-       // spanners.
-       for (iter_top(cc->starters,i); i.ok(); i++)
-           if (i->pstaff_l_ == pstaff_l_) {
-               y.unite(i->height());
-           }
-    }
-    
-    return y;
-}
+IMPLEMENT_STATIC_NAME(Line_of_staff);
 
 void
-Line_of_staff::process()
+Line_of_staff::add_element(Score_elem*elem_l)
 {
-#if 0
-    if (!pstaff_l_->stafsym_p_)
-       pstaff_l_->brew_molecule_p(line_of_score_l_->pscore_l_->
-                                paper_l_->linewidth);
-#endif
+    if (!elem_l->group_element_i_)
+       Element_group::add_element(elem_l);
 }
index 63040205007bfe3ce3cae94da855a9f49dafe77d..9fed099da21f9b9644129ce99591380edee52a8a 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  stem-beam-reg.cc -- part of LilyPond
+  stem-beam-reg.cc -- part of GNU LilyPond
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 #include "grouping.hh"
 #include "text-spanner.hh"
 #include "complex-walker.hh"
-#include "complex-staff.hh"
 #include "debug.hh"
 #include "grouping.hh"
-#include "notehead.hh"
+#include "note-head.hh"
 
 Stem_beam_register::Stem_beam_register()
 {
@@ -79,7 +78,7 @@ Stem_beam_register::process_requests()
     }
 
     if (stem_req_l_) {
-       stem_p_ = new Stem(10);
+       stem_p_ = new Stem(8);
        if (current_grouping)
            current_grouping->add_child(
                get_staff_info().time_C_->whole_in_measure_,
@@ -107,9 +106,9 @@ Stem_beam_register::acknowledge_element(Score_elem_info info)
     if (!stem_p_)
        return;
 
-    if (info.elem_l_->name() == Notehead::static_name() &&
+    if (info.elem_l_->name() == Note_head::static_name() &&
        stem_req_l_->duration() == info.req_l_->rhythmic()->duration()){
-       Notehead * n_l= (Notehead*)info.elem_l_->item();
+       Note_head * n_l= (Note_head*)info.elem_l_->item();
        stem_p_->add(n_l);
     }
 }
index 7c57aa80e676fda64572c1ca0812c036fac0e4ae..33e86f657c8fbb50edc0369fab8be9dfe3513d19 100644 (file)
@@ -2,7 +2,7 @@
 #include "dimen.hh" 
 #include "debug.hh"
 #include "paper-def.hh"
-#include "notehead.hh"
+#include "note-head.hh"
 #include "lookup.hh"
 #include "molecule.hh"
 #include "p-col.hh"
@@ -73,6 +73,7 @@ Stem::stem_end_f() const
     return (dir_i_ < 0)? stem_bottom_f_ : stem_top_f_;
 }
 
+
 void
 Stem::set_stemend(Real se)
 {
@@ -86,7 +87,7 @@ Stem::set_stemend(Real se)
 }
 
 void
-Stem::add(Notehead *n)
+Stem::add(Note_head *n)
 {
     n->add_dependency(this);
     if (n->rest_b_) {
@@ -104,17 +105,35 @@ Stem::invisible_b()const
 {
     return !head_l_arr_.size();
 }
+bool
+Stem::chord_b() const
+{
+    return head_l_arr_.size() > 1;
+}
+
+// if dir_i_ is set we return a fake value.
+
+int
+Stem::get_center_distance()
+{
+    if (dir_i_)
+      return -dir_i_;
+
+    int staff_center = staff_size_i_ / 2;
+    int min = min_head_i() - staff_center;
+    int max = max_head_i() - staff_center;
+    return (abs(max) > abs(min)) ? max : min;
+}
 
 int
 Stem::get_default_dir()
 {
-    int staff_center = staff_size_i_ /2;
     if (dir_i_)
-       return dir_i_;
-    Real mean = (min_head_i() + max_head_i())/2;
-    return (mean > staff_center) ? -1: 1;
+        return dir_i_;
+    return -sign(get_center_distance());
 }
 
+
 void
 Stem::set_default_dir()
 {
@@ -159,7 +178,7 @@ Stem::set_noteheads()
 {
     if(!head_l_arr_.size())
        return;
-    head_l_arr_.sort(Notehead::compare);
+    head_l_arr_.sort(Note_head::compare);
     head_l_arr_[0]->extremal_i_ = -1;
     head_l_arr_.top()->extremal_i_ = 1;
     int parity=1;
@@ -212,7 +231,7 @@ Stem::brew_molecule_p()const
  
     Paper_def *p =paper();
 
-    Real dy = p->internote();
+    Real dy = p->internote_f();
     Symbol ss =p->lookup_l()->stem(bot*dy,top*dy);
 
     out = new Molecule(Atom(ss));
@@ -239,3 +258,12 @@ Stem::hpos_f()const
 }
 
 
+void
+Stem::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+    Item * o_l = o->item();
+    Item * n_l = n? n->item():0;
+    whole_l_arr_.substitute((Note_head*)o_l, (Note_head*)n_l);
+    head_l_arr_.substitute((Note_head*)o_l, (Note_head*)n_l);
+    rest_l_arr_.substitute((Note_head*)o_l, (Note_head*)n_l);
+}
diff --git a/lily/super-elem.cc b/lily/super-elem.cc
new file mode 100644 (file)
index 0000000..4db5cff
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+  super-elem.cc -- implement Super_elem
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "super-elem.hh"
+#include "scoreline.hh"
+#include "p-score.hh"
+
+String
+Super_elem::TeX_string()const
+{
+    String s;
+    for (int i=0; i < lines_arr_.size(); i++){
+       s += lines_arr_[i]->TeX_string();
+       if (i + 1<lines_arr_.size() )
+           s += "\\interscoreline"; // TODO
+    }
+    return s;
+}
+
+void
+Super_elem::handle_broken_dependencies()
+{
+    lines_arr_ = line_of_score_l_->get_lines();
+    for (int i =0; i < lines_arr_.size(); i++) 
+       add_dependency(lines_arr_[i]);
+}
+    
+
+void
+Super_elem::do_substitute_dependency(Score_elem*o,Score_elem* n)
+{
+    if (line_of_score_l_ == o->spanner())
+       line_of_score_l_ = n?(Line_of_score*)n->spanner():0;
+}
+
+Super_elem::Super_elem()
+{
+    line_of_score_l_ = new Line_of_score ;
+}
+
+void
+Super_elem::do_add_processing()
+{
+    pscore_l_->typeset_unbroken_spanner( line_of_score_l_ );
+    add_dependency(line_of_score_l_);
+}
+
+
+
+IMPLEMENT_STATIC_NAME(Super_elem);
index 24a20ef7d0cade288da6cb41c7d4a82fbd241474..a84d9054d73398a34ea5cac8294c463ed37767d7 100644 (file)
@@ -1,7 +1,7 @@
 /*
   swallow-reg.cc -- implement Swallow_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 9dc82c0631c32160a43d9c73ccb0e0b5257db186..b77811100575a6f5dd6294c38bdbfedca1f5f711 100644 (file)
@@ -1,7 +1,7 @@
 /*
   symtable.cc -- implement Symbol_table
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -39,10 +39,11 @@ Symtable::lookup(String s) const
     if (elt_b(s))
        return (*this)[s];
     else {
-       error( "Symtable `" + id_str+ "\': unknown symbol `" +s+"'\n");
+       warning( "Symtable `" + id_str+ "\': unknown symbol `" +s+"'\n");
+       Symbol sy;                      // unreachable
+       sy.tex = "";
+       return sy;
     }
-    Symbol sy;                 // unreachable
-    return sy;
 }
 
 Symtable* 
index 0e1b7258b9bb73fc40c6fc97161f775541e4b71a..875c711482dad64f786ed64ecf779b7f427ed191 100644 (file)
@@ -1,3 +1,11 @@
+/*
+  template1.cc -- instantiate some List classes
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include "proto.hh"
 #include "idealspacing.hh"
 #include "plist.hh"
@@ -7,7 +15,6 @@
 #include "spanner.hh"
 #include "scoreline.hh" 
 #include "staffline.hh"
-#include "vertical-spanner.hh"
 
 #include "pcursor.tcc"
 #include "plist.tcc"
 
 IPLC_instantiate(Line_of_score);
 IPLC_instantiate(Line_of_staff);
-IPLC_instantiate(Item);
+IPLC_instantiate(Score_elem);
 IPLC_instantiate(Spanner);
-IPLC_instantiate(Vertical_spanner);
-IPLC_instantiate(PStaff);
 IPLC_instantiate(Idealspacing);
 IPLC_instantiate(PCol);
 
index f29c5b9f56bb9c32eae7137b3da33c974c5e038e..d9d3f99cdafa6ef085d4c301409e37a0029c5cbc 100644 (file)
@@ -1,7 +1,7 @@
 /*
   template2.cc -- instantiate some list templates. 
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 8be96a30f44962498a6b61d17d0fab90ec82e5c9..484729579becf4cc01a027a9c388b855893b6fb8 100644 (file)
@@ -1,7 +1,7 @@
 /*
   template4.cc -- instantiate Link_list baseclass.
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 793280a02429941e707418e75c2cefd3bdae5fd1..ef2969b78483979d2420866586af562e84429235 100644 (file)
@@ -1,7 +1,7 @@
 #/*
   template7.cc -- instantiate Request_column
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 194d97384a25cd187a73c49749eed04fdc2b4ac9..356565c4f7293a8e9a77e86960bcc621dbc4baad 100644 (file)
@@ -96,7 +96,7 @@ Lookup::beam(Real &slope, Real width) const
     m.add(a);
     
     Symbol ret;
-    ret.tex = m.TeXstring();
+    ret.tex = m.TeX_string();
     ret.dim.y = Interval(0,width*slope);
     ret.dim.x = Interval(0,width);
     
index 2cbe6e7acd2f3e88872e1444d2b3804988cf7dde..d44b3469291fef02122f3be2992480a126ff50e9 100644 (file)
@@ -56,7 +56,7 @@ Lookup::half_slur_middlepart(Real &dx, int dir) const
     s.tex = f;
     Atom a(s);
     a.translate(Offset(dx/2,0));
-    s.tex = a.TeXstring();
+    s.tex = a.TeX_string();
 
     return s;
 }
@@ -171,7 +171,7 @@ Lookup::slur (int dy , Real &dx, int dir) const
     Atom a(s);
     a.translate(Offset(dx/2,0));
     s.dim = a.extent();
-    s.tex = a.TeXstring();
+    s.tex = a.TeX_string();
     return s;    
 }
 
@@ -195,12 +195,12 @@ Lookup::big_slur(int dy , Real &dx, int dir) const
     Molecule mol;
     mol.add(l);
     Atom a(m);
-    a.translate(Offset(0,slur_extra * internote()));
+    a.translate(Offset(0,slur_extra * internote_f()));
     mol.add_right(m);
     mol.add_right(r);
-    mol.translate(Offset(0, l_dy * internote()));
+    mol.translate(Offset(0, l_dy * internote_f()));
     Symbol s;
-    s.tex = mol.TeXstring();
+    s.tex = mol.TeX_string();
     s.dim = mol.extent();
     return s;
 }
index dfa56b1b4d955bc069869775e2d7aa37cbbfee0e..2c92ae7438e0d95a92dc5a06e4334e236f1282d6 100644 (file)
@@ -1,9 +1,15 @@
 /*
   tex-stream.cc -- implement Tex_stream
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  
+  TODO
+
+  make an abstract interface to output, operations: 
+
+  move(x,y), put(symbol).
 */
 
 #include <fstream.h>
@@ -29,7 +35,7 @@ Tex_stream::Tex_stream(String filename)
 void
 Tex_stream::header()
 {
-    *os << "% Creator: " << get_version_str();
+    *os << "% Creator: " << get_version_str() << "\n";
     *os << "% Automatically generated, at ";
     time_t t(time(0));
     *os << ctime(&t)<<"\n";
index e8349e63cc290de1f0cc4627c7fc6d20ccc5ee2e..3b8fe8aa20e013eaaeb15728a476f8a571588b96 100644 (file)
@@ -28,8 +28,10 @@ substitute_args(String source, Array<String> args)
     String retval (source);
     for (int i = 0 ; i < args.size(); i++)
         substitute_arg(retval, args[i]);
+    /*
     while (retval.index_i('%') >= 0)
         substitute_arg(retval, "");
+       */
     return retval;
 }
 
index 6d3b67d003e0623bb331d72cd8f8923b75146f3c..cc6f7f9b1313a28a447444df9db12179488cd0e4 100644 (file)
@@ -1,7 +1,7 @@
 /*
   text-item.cc -- implement Text_item
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
@@ -15,7 +15,6 @@
 #include "lookup.hh"
 
 Text_item::Text_item(Text_def *tdef_l, int d)
-    : Staff_side(this)
 {
     dir_i_ = d;
     fat_b_ = false;
@@ -67,7 +66,7 @@ Text_item::brew_molecule_p() const
 
     if(dir_i_<0 )              // should do something better anyway.
        mol_p->translate(Offset(0, -mol_p->extent().y.left ));
-    mol_p->translate(Offset(0, pos_i_ * paper()->internote()));
+    mol_p->translate(Offset(0, pos_i_ * paper()->internote_f()));
     
     return mol_p;
 }
index 2858a28641481b78220eabb4afa57fccdfeeba99..6883dab0b0d4bcd7fb2a74d5f70846eb7ff78a68 100644 (file)
@@ -1,3 +1,11 @@
+/*
+  text-spanner.cc -- implement Text_spanner
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include "molecule.hh"
 #include "boxes.hh"
 #include "text-spanner.hh"
 void
 Text_spanner::set_support(Directional_spanner*d)
 {
-    support = d;
+    if (support)
+       remove_dependency(support);
+    
+    support =d;
     add_dependency(d);
 }
 
@@ -33,7 +44,7 @@ Text_spanner::do_post_processing()
     switch(spec.align_i_) {
     case 0:
        text_off_ = support->center() +
-           Offset(0,support->dir_i_ * paper()->internote() * 4); // todo
+           Offset(0,support->dir_i_ * paper()->internote_f() * 4); // todo
        break;
     default:
        assert(false);
@@ -67,8 +78,11 @@ Text_spanner::height()const
     return brew_molecule_p()->extent().y;
 }
 
-Spanner*
-Text_spanner::do_break_at(PCol*c1, PCol*c2)const
+void
+Text_spanner::do_substitute_dependency(Score_elem* o, Score_elem*n)
 {
-    return new Text_spanner(*this); // todo
+    Directional_spanner * old = (Directional_spanner*)o->spanner();
+    if (support == old)
+       support = (Directional_spanner*) n->spanner();
 }
+
index 3d75818870bfc4f5ab8ed16d1609963302312ccd..2b8fe5d642a5431306bc5fe33c89f7eb8b318fcc 100644 (file)
@@ -1,14 +1,14 @@
 /*
   tie-reg.cc -- implement Tie_register
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
 #include "tie-reg.hh"
 #include "tie.hh"
-#include "notehead.hh"
+#include "note-head.hh"
 #include "musical-request.hh"
 #include "voice-element.hh"
 
@@ -73,14 +73,14 @@ Tie_register::process_requests()
 void
 Tie_register::acknowledge_element(Score_elem_info i)
 {
-    if (i.elem_l_->name() == Notehead::static_name()) {
+    if (i.elem_l_->name() == Note_head::static_name()) {
        if (tie_p_) {
-           tie_p_->set_head(-1, (Notehead*)i.elem_l_->item());
+           tie_p_->set_head(-1, (Note_head*)i.elem_l_->item());
            melodic_req_l_ = i.req_l_->musical()->melodic();
        }
 
        if (end_tie_p_) {
-           end_tie_p_->set_head(1, (Notehead*)i.elem_l_->item());
+           end_tie_p_->set_head(1, (Note_head*)i.elem_l_->item());
            if (!Melodic_req::compare ( *end_melodic_req_l_, *melodic_req_l_))
                end_tie_p_->same_pitch_b_ = true;
            announce_element(Score_elem_info(end_tie_p_,end_req_l_));
index 5c71c9d133bd27028600c0813b9116e2f88f9342..80170cf0b3c27e2af386d6a3f6a8af8c78675eff 100644 (file)
@@ -1,31 +1,19 @@
 /*
   tie.cc -- implement Tie
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
 #include "paper-def.hh"
 #include "tie.hh"
-#include "notehead.hh"
+#include "note-head.hh"
 #include "p-col.hh"
 
-Spanner*
-Tie::do_break_at(PCol*l, PCol*r) const
-{
-    Tie * tie_p = new Tie(*this);
-    Line_of_score const  *line_C=l->line_l_;
-    tie_p->left_head_l_ = (left_head_l_->line_l()== line_C) ?
-       left_head_l_ : 0;
-    tie_p->right_head_l_  = (right_head_l_->line_l() == line_C)?
-       right_head_l_ : 0;
-    
-    return tie_p;
-}
 
 void
-Tie::set_head(int x_pos, Notehead * head_l)
+Tie::set_head(int x_pos, Note_head * head_l)
 {
     if (x_pos >0) {
        assert(!right_head_l_);
@@ -60,6 +48,9 @@ Tie::do_add_processing()
     right_col_l_ = right_head_l_ -> pcol_l_;
 }
 
+/**
+  This is already getting hairy. Should use Note_head *heads[2]
+ */
 void
 Tie::do_post_processing()
 {
@@ -80,6 +71,24 @@ Tie::do_post_processing()
        left_dx_f_ += 0.25;
     } else
        left_dx_f_ += 0.5;
+    
+    if (!right_head_l_)
+       right_pos_i_ = left_pos_i_;
+    if (! left_head_l_)
+       left_pos_i_ = right_pos_i_;
+}
+
+
+
+void
+Tie::do_substitute_dependency(Score_elem*o, Score_elem*n)
+{
+    Note_head *new_l =n?(Note_head*)n->item():0;
+    if (o->item() == left_head_l_)
+       left_head_l_ = new_l;
+    else if (o->item() == right_head_l_)
+       right_head_l_ = new_l;
 }
 
 
+IMPLEMENT_STATIC_NAME(Tie);
index c56a0375d06fcf17ad202aac530f27bd4fe2406a..cd10942a382c0c5c06a23f24624090afbfbaa946 100644 (file)
@@ -1,7 +1,7 @@
 /*
   time-description.cc -- implement Time_description
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
diff --git a/lily/vertical-brace.cc b/lily/vertical-brace.cc
deleted file mode 100644 (file)
index 0bd59e7..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
-  vertical-brace.cc -- implement 
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "vertical-brace.hh"
diff --git a/lily/vertical-spanner.cc b/lily/vertical-spanner.cc
deleted file mode 100644 (file)
index bea6834..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
-  vertical-spanner.cc -- implement Vertical_spanner
-
-  source file of the LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "vertical-spanner.hh"
-
-Vertical_spanner::Vertical_spanner()
-{
-    upper_pstaff_l_ = lower_pstaff_l_ = 0;
-}
-
-IMPLEMENT_STATIC_NAME(Vertical_spanner);
-    
index f4067bc44b1d3264f6bc3648e4ef7442bbbc45c1..cb806831a464855b514a17a35f5d103e413547f9 100644 (file)
@@ -1,7 +1,7 @@
 /*
   voice-elt.cc -- implement Voice_element
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 8bc24916814ac0d1a359cb82f8561a9675e7f3f5..72f3c9426c60122d5d2e028321d6393f6e107165 100644 (file)
@@ -1,7 +1,7 @@
 /*
   voicegroup.cc -- implement Voice_group_registers
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 77fd724552f491807755ba6da44941c995be24f2..43daf7081503f2690998baa5ce62318c935f9f71 100644 (file)
@@ -1,7 +1,7 @@
 /*
   voice-regs.cc -- implement Voice_registers
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 9b10dfcd2533b2c5dbfe723df4e666e75b5bb387..536715d0cb216adcd0c7fd09362ab5a4a31bbfaa 100644 (file)
@@ -1,7 +1,7 @@
 /*
   voice.cc -- implement Voice
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 404500dceecc039bf6fca8a6039b891d05553ec7..328fa177cd7d25421a591034c9543415f0a97892 100644 (file)
@@ -1,20 +1,21 @@
 /*
   walkregs.cc -- implement Walker_registers
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 #include "debug.hh"
 #include "walk-regs.hh"
 #include "staff-regs.hh"
-#include "staff-elem.hh"
+#include "score-elem.hh"
 #include "staff.hh"
 #include "complex-walker.hh"
 #include "staff-column.hh"
 #include "score-walker.hh"
 #include "bar.hh"              // needed for Bar::static_name
 #include "input-register.hh"
+#include "staffline.hh"
 
 Walker_registers::Walker_registers(Complex_walker *w)
 {
@@ -60,25 +61,25 @@ Walker_registers::do_announces()
 void
 Walker_registers::typeset_element(Score_elem *elem_p)
 {
-    typeset_musical_item(elem_p);
-}
-
-void
-Walker_registers::typeset_musical_item(Score_elem * elem_p)
-{
-    walk_l_->typeset_element(elem_p);
+    musical_item_p_arr_.push(elem_p);
 }
 
 void
 Walker_registers::typeset_breakable_item(Item * pre_p , Item * nobreak_p,
                                       Item * post_p)
 {
-    if (pre_p)
+    if (pre_p) {
        prebreak_item_p_arr_.push(pre_p);
-    if (nobreak_p)
+       walk_l_->staff_l_->staff_line_l_->add_element(pre_p);
+    }
+    if (nobreak_p) {
        nobreak_item_p_arr_.push(nobreak_p);
-    if (post_p)
+       walk_l_->staff_l_->staff_line_l_->add_element(nobreak_p);
+    }
+    if (post_p) {
        postbreak_item_p_arr_.push(post_p);
+       walk_l_->staff_l_->staff_line_l_->add_element(post_p);
+    }
 }
 
 void
@@ -89,6 +90,9 @@ Walker_registers::pre_move_processing()
     walk_l_->ptr()->typeset_breakable_items(prebreak_item_p_arr_,
                                            nobreak_item_p_arr_,
                                            postbreak_item_p_arr_);
+    for (int i=0; i < musical_item_p_arr_.size(); i++)
+           walk_l_->typeset_element(musical_item_p_arr_[i]);
+    musical_item_p_arr_.set_size(0);
 }
 void
 Walker_registers::post_move_processing()
index 3e6b98f9f12d917d2dec6a1de41fe52be160a743..c35e6e60158720cf1284f02447023a99f8c0ba69 100644 (file)
@@ -1,7 +1,7 @@
 /*
   warn.cc -- implement warning and error messages. Needs cleanup.
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
index 2fd2fc4e94d3637951c6c4bbbdf23d200dd9bb03..f0ddf035e3aeb981821bb8dd236daade0748b55b 100644 (file)
@@ -1,7 +1,15 @@
+/*
+  wordwrap.cc -- implement Word_wrap
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include "break.hh"
 #include "p-score.hh"
 #include "debug.hh"
-
+#include "p-col.hh"
 /** el stupido. This should be done more accurately:
 
    It would be nice to have a Dynamic Programming type of algorithm
index 0a5a87b61300f7dc8984f64844501a6740879da9..4c29b154a8c55464e92dd53252e3bb217cb54c90 100644 (file)
@@ -233,3 +233,7 @@ installexe:
 
 uninstallexe:
        for a in $(EXECUTABLES); do rm -f $(bindir)/`basename $a`; done
+
+ifneq ($(DEPFILES),)
+include $(DEPFILES)
+endif
index b6fee6afc2e0661084a3a819005f4ee499edc54a..1bb08d53a4d66779ea2ab97c10da94cc0803cc40 100644 (file)
@@ -2,8 +2,8 @@
 
 Begin3
 Title: LilyPond
-Version: 0.0.64
-Entered-date: 05/16/97
+Version: 0.0.65
+Entered-date: 05/23/97
 Description: LilyPond is a program which converts a music-script (mudela) into
 TeX output, or MIDI to produce multi-staff scores. Features include multiple
 meters, clefs, keys, lyrics, versatile input-language, cadenzas
@@ -13,7 +13,7 @@ Author: hanwen@stack.nl (Han-Wen Nienhuys)
        jan@digicash.com (Jan Nieuwenhuizen)
 Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
 Primary-site: pcnov095.win.tue.nl /pub/lilypond/  
-       300k lilypond-0.0.64.tar.gz
+       300k lilypond-0.0.65.tar.gz
 Alternate-site: 
 Original-site: 
 Platform: unix/win32, GNU C++
index 5b6d3b19ce1e34e186eb1f3b3edf5c0c1167f99d..5c296f9cb8d720a265de571144c5bf23e47be78e 100644 (file)
@@ -1,9 +1,9 @@
 Name: lilypond
-Version: 0.0.64
+Version: 0.0.65
 Release: 1
 Copyright: GPL
 Group: Applications/Publishing
-Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.64.tar.gz
+Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.65.tar.gz
 Summary: A preprocessor to make TeX typeset music.
 URL: http://www.stack.nl/~hanwen/lilypond
 Packager: Han-Wen Nienhuys <hanwen@stack.nl>
@@ -24,7 +24,7 @@ configure --enable-checking --disable-debugging --enable-printing --prefix=/usr
 make all
 %install
 rm -rf $RPM_BUILD_ROOT
-strip bin/lilypond bin/mi2mu
+strip lily/out/lilypond mi2mu/out/mi2mu
 make prefix="$RPM_BUILD_ROOT/usr" install
 %files
 %doc Documentation/out/AUTHORS.text Documentation/out/CodingStyle.text Documentation/out/INSTALL.text Documentation/out/MANIFESTO.text Documentation/out/convert-mudela.text Documentation/out/error.text Documentation/out/faq.text Documentation/out/gnu-music.text Documentation/out/index.text Documentation/out/language.text Documentation/out/lilygut.text Documentation/out/lilyliterature.text Documentation/out/lilypond.text Documentation/out/mi2mu.text Documentation/out/mudela.text input/cadenza.ly input/collisions.ly input/coriolan-alto.ly input/error.ly input/header.ly input/keys.ly input/kortjakje.ly input/pedal.ly input/rhythm.ly input/scales.ly input/scripts.ly input/scsii-menuetto.ly input/scsii-menuetto.tex input/slurs.ly input/standchen.ly input/standchen.tex input/toccata-fuga-E.ly input/twinkle.ly input/wohltemperirt.ly Documentation/lelie_logo.gif
@@ -32,6 +32,7 @@ make prefix="$RPM_BUILD_ROOT/usr" install
 /usr/bin/lilypond
 /usr/lib/libflower.so
 /usr/bin/mi2mu
+/usr/man/man1/mi2mu.1
 /usr/man/man1/lilypond.1
 /usr/man/man5/mudela.5
 /usr/man/man1/convert-mudela.1
@@ -40,7 +41,5 @@ make prefix="$RPM_BUILD_ROOT/usr" install
 /usr/share/lilypond/
 
 %post
-texhash
-%post
-texhash
+echo please run texhash to update TeX directory listings
 
index d4445a39063f0250284e5928c1d49aa69a24be18..994215d0f3bdcc1aedbd707503a8203a5860a39d 100644 (file)
@@ -24,7 +24,7 @@ configure --enable-checking --disable-debugging --enable-printing --prefix=/usr
 make all
 %install
 rm -rf $RPM_BUILD_ROOT
-strip bin/lilypond bin/mi2mu
+strip lily/out/lilypond mi2mu/out/mi2mu
 make prefix="$RPM_BUILD_ROOT/usr" install
 %files
 %doc @TEXT_DOCS@ @EXAMPLE_LYS@ Documentation/lelie_logo.gif
@@ -32,6 +32,7 @@ make prefix="$RPM_BUILD_ROOT/usr" install
 /usr/bin/lilypond
 /usr/lib/libflower.so
 /usr/bin/mi2mu
+/usr/man/man1/mi2mu.1
 /usr/man/man1/lilypond.1
 /usr/man/man5/mudela.5
 /usr/man/man1/convert-mudela.1
@@ -40,7 +41,5 @@ make prefix="$RPM_BUILD_ROOT/usr" install
 /usr/share/lilypond/
 
 %post
-texhash
-%post
-texhash
+echo please run texhash to update TeX directory listings
 
index 4e05deeab57cc7fb14d236354a7e42e7d1e73b3a..0bd28567f076f9b64ec55a3b85eb67c726428c3a 100644 (file)
@@ -1,6 +1,6 @@
 MAJOR_VERSION = 0
 MINOR_VERSION = 0
-PATCH_LEVEL = 16
+PATCH_LEVEL = 17
 # use to send patches, always empty for released version:
 MY_PATCH_LEVEL = 
 #
index 1afa1ac1f82649a9186100f9cf8886b21670c37b..abb87bb77562cc7148730a6fff76c237eabbe3ae 100644 (file)
@@ -40,8 +40,7 @@ VERSION_DEPENDENCY = $(mi2mu-version)
 
 # list of distribution files:
 #
-DISTFILES = Makefile .version $(ALL_SOURCES)
-
+EXTRA_DISTFILES = .version TODO
 #
 
 # list of custom libraries:
diff --git a/mi2mu/TODO b/mi2mu/TODO
new file mode 100644 (file)
index 0000000..5fb343a
--- /dev/null
@@ -0,0 +1,160 @@
+# mi2mu/TODO
+
+Most of the items are marked in the code as well, with full explanation. 
+grep for TODO and ugh/ugr
+
+
+IMPORTANT
+
+       * important? lily is important, go work on lily!
+
+       * faq about mi2mu midi t1. ?
+
+PROJECTS
+
+       * write something interesting in mi2mu manual page
+
+       * check/use type 0 / 1 / 2 of midi file
+
+       * create Indentable_stream (see Tex_stream) as base for Lily_stream
+
+       * use dynamic info
+
+       * use aftertouch info (to guess slurs/ties, scripts (staccato?))
+
+       * lyric events
+
+       * parse all midi events
+
+       * handle time based midi files
+
+       * use dstream feature from lily
+
+       * midi esp.: use I32 iso int where 32 bits are needed (or assumed...)
+
+       * read unsigned words as U16 (not as I16)
+
+       * check use of integral and unsigned in lexer
+       
+       * get rid of ugly statics in Duration_convert
+
+       * change option double-dots to max-dots
+
+       * set Key, Meter, ... command line options
+
+BUGS
+
+       * mi2mu nonexist.midi ?
+
+       * output of 0 duration c'0
+
+       * no output on certain midis
+
+       * silly progress indicator upon mudela output
+
+       * check for illegal track names, e.g. "Piano________ = \melodic"
+
+       * array memleaks(?): use Link_array / create Pointer_array? 
+
+       * fix "#undef MEVENT_LIST" source tree: Array<Midi_event*> 
+
+       * split notes that cross bar limit
+
+FUTURE
+
+       * guess plets (i.e.: only use plet-duration *2/3 if there's a 
+         whole plet)
+
+       * merge midi-events with lily's midi-items?
+
+       * guess beams
+
+       * guess / follow tempo changes
+
+       * check out NIFF / analogies?
+
+       * steal good ideas of other gpl midi parsers
+
+       * lily: add mudela info into midi as specials
+         mi2mu: use special info
+
+# mi2mu/TODO
+
+Most of the items are marked in the code as well, with full explanation. 
+grep for TODO and ugh/ugr
+
+
+IMPORTANT
+
+       * important? lily is important, go work on lily!
+
+       * faq about mi2mu midi t1. ?
+
+PROJECTS
+
+       * write something interesting in mi2mu manual page
+
+       * check/use type 0 / 1 / 2 of midi file
+
+       * create Indentable_stream (see Tex_stream) as base for Lily_stream
+
+       * use dynamic info
+
+       * use aftertouch info (to guess slurs/ties, scripts (staccato?))
+
+       * lyric events
+
+       * parse all midi events
+
+       * handle time based midi files
+
+       * use dstream feature from lily
+
+       * midi esp.: use I32 iso int where 32 bits are needed (or assumed...)
+
+       * read unsigned words as U16 (not as I16)
+
+       * check use of integral and unsigned in lexer
+       
+       * get rid of ugly statics in Duration_convert
+
+       * change option double-dots to max-dots
+
+       * set Key, Meter, ... command line options
+
+BUGS
+
+       * mi2mu nonexist.midi ?
+
+       * output of 0 duration c'0
+
+       * no output on certain midis
+
+       * silly progress indicator upon mudela output
+
+       * check for illegal track names, e.g. "Piano________ = \melodic"
+
+       * array memleaks(?): use Link_array / create Pointer_array? 
+
+       * fix "#undef MEVENT_LIST" source tree: Array<Midi_event*> 
+
+       * split notes that cross bar limit
+
+FUTURE
+
+       * guess plets (i.e.: only use plet-duration *2/3 if there's a 
+         whole plet)
+
+       * merge midi-events with lily's midi-items?
+
+       * guess beams
+
+       * guess / follow tempo changes
+
+       * check out NIFF / analogies?
+
+       * steal good ideas of other gpl midi parsers
+
+       * lily: add mudela info into midi as specials
+         mi2mu: use special info
+
diff --git a/mi2mu/include/mi2mu-proto.hh b/mi2mu/include/mi2mu-proto.hh
new file mode 100644 (file)
index 0000000..af0d543
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+  mi2mu-proto.hh -- declare type names in mi2mu
+
+  source file of mi2mu, part of the GNU LilyPond package,
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef MI2MU_PROTO_HH
+#define MI2MU_PROTO_HH
+
+
+struct Lily_stream ;
+class Midi_event ;
+class Midi_key ;
+class Midi_note ;
+class Midi_tempo ;
+class Midi_text ;
+class Midi_time ;
+class Midi_score ;
+class Midi_track ;
+class Midi_voice ;
+class My_midi_lexer ;
+class My_midi_parser ;
+class Track_column ;
+
+#endif // MI2MU_PROTO_HH
index 5d381cedd050ac6d52d0c64af05adb6ced98545a..a7e877f301d41e097257bbfc334ecfd71d804910 100644 (file)
@@ -19,6 +19,7 @@
 #include <ctype.h>
 #include <time.h>
 
+#include "mi2mu-proto.hh"
 #include "proto.hh"
 #include "plist.hh"
 #include "warn.hh"
index 5009b8dd7b220758a3484d3f0256c47249abd4fa..43951e41c28e7d5303582ee3cb9bb5ab6e3f1909 100644 (file)
@@ -5,6 +5,7 @@
 // copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
 
 #include "mi2mu.hh"
+#include "path.hh"
 
 Sources source;
 Sources* source_l_g = &source;
@@ -141,7 +142,7 @@ main( int argc_i, char* argv_sz_a[] )
                        exit( 0 );
                        break;
                case 'x':
-                       Duration_convert::no_double_dots_b_s = false;
+                       Duration_convert::no_double_dots_b_s = true;
                        break;
                default:
                        assert( 0 );
index 028730acacca7410aebd58cd3259a25e9fc5b0f0..e98149d597d96989dd2d424f0f368906549f6341 100644 (file)
@@ -39,8 +39,6 @@ Midi_key::mudela_str( bool command_mode_bo )
                str += String( (char)( ( key_i_ + 2 ) % 7 + 'A'  ) );
        else // heu, -2: should be - 1 1/2: A -> fis
                str += String( (char)( ( key_i_ + 2 - 2 ) % 7 + 'a'  ) );
-//     if ( !command_mode_bo )
-//         str =  String( '\\' ) + str;
        str = String( "%" ) + str + "\n"; // "\key\F" not supported yet...
        return str;
 }
@@ -84,7 +82,7 @@ Midi_key::notename_str( int pitch_i )
  this switch can be used to write simple plets like 
      c4*2/3 
  as  
-     \plet{ 2/3 } c4 \plet{ 1/1 }
+     \plet 2/3; c4 \plet 1/1;
  */
 bool const Midi_note::simple_plet_b_s = true;
 
@@ -99,17 +97,20 @@ String
 Midi_note::mudela_str( bool command_mode_bo )
 {
 //     assert( !command_mode_bo );
+       if ( !dur_.type_i_ )
+               return "";
+
        if ( simple_plet_b_s )
                return name_str_ + Duration_convert::dur2_str( dur_ );
 
        //ugh
        String str;
        if ( dur_.plet_b() )
-               str += String( "\\plet{ " )
+               str += String( "\\plet " )
                        + String_convert::i2dec_str( dur_.plet_.iso_i_, 0, 0 )
                        + "/"
                        + String_convert::i2dec_str( dur_.plet_.type_i_, 0, 0 )
-                       + " } ";
+                       + "; ";
 
        str += name_str_;
 
@@ -118,7 +119,7 @@ Midi_note::mudela_str( bool command_mode_bo )
        str += Duration_convert::dur2_str( dur );
 
        if ( dur_.plet_b() )
-               str += String( " \\plet{ 1/1 }" );
+               str += String( " \\plet 1/1;" );
                
        return str;
 }
@@ -213,11 +214,9 @@ Midi_time::num_i()
 String
 Midi_time::mudela_str( bool command_mode_bo )
 {
-       String str = "\\meter{ "
+       String str = "\\meter "
                + String( num_i_ ) + "/" + String( 1 << den_i_ ) 
-               + " }";
-//     if ( !command_mode_bo )
-//         str =  String( '\\' ) + str;
+               + ";";
        return str;
 }
 
index 1bc41ded0ab0ab92390251fea1342c9f4666261e..a1cb3262a6eb97e495b2fafdff66a61be4505220 100644 (file)
@@ -1,6 +1,15 @@
 %{//-*-Fundamental-*-
 // midi-lexer.l
 
+/* 
+  yes, i know that midi is not really a (n evolving?) language,
+  and that using lex/yacc to parse midi is overkill, as well as
+  a grand example of misuse and asking for performance loss.
+
+  it is, however, quite robust, simple, and very easy to extend
+  incrementally.
+ */
+
 /*
   backup rules
 
index 7fab7a910d3454643e45ce0f341d44829819af39..d87dba3cf0efd10907307dcd77164860ddc4032e 100644 (file)
@@ -13,7 +13,6 @@
     char c;
     int i;
     String* str_p;
-    Request* request_p;
     Midi_event* midi_event_p;  // Voice_element* ?
     Midi_score* midi_score_p;  // Input_score* ?
     Midi_track* midi_track_p;  // Input_music* ?
index 28cb7dae557d1c401ed3f4f14d2577519550eca7..1803cafc4c97503f650fad270cff4a53575957b1 100644 (file)
@@ -43,6 +43,9 @@ Midi_score::output_mudela( String filename_str )
        lily_stream << "\\score{";
        lily_stream.indent();
                for ( PCursor<Midi_track*> i( midi_track_p_list_.top() ); i.ok(); i++ ) {
+                       if ( ( midi_track_p_list_.size() != 1 ) 
+                               && ( i == midi_track_p_list_.top() ) )
+                               continue;
                        lily_stream << "\\staff{ melodicregs ";
                        lily_stream << i->name_str();
                        lily_stream << " }";
index 03ac7fc13080d491cda9dafdf1669cf2e2654174..8d1c7833e41d0700a17f577e35baaad1a644e44c 100644 (file)
@@ -204,9 +204,9 @@ Midi_track::process()
                        tcol_l->midi_event_p_array_.del( 0 );
                }
 #else
-               for ( int i = 0; i < tcol_l->midi_event_p_array_.size(); i++ ) {
-                       get_free_midi_voice_l( tcol_l->mom() )->add_event( tcol_l->midi_event_p_array_[ i ] );
-                       tcol_l->midi_event_p_array_[ i ] = 0;
+               for ( int j = 0; j < tcol_l->midi_event_p_array_.size(); j++ ) {
+                       get_free_midi_voice_l( tcol_l->mom() )->add_event( tcol_l->midi_event_p_array_[ j ] );
+                       tcol_l->midi_event_p_array_[ j ] = 0;
                }
                tcol_l->midi_event_p_array_.clear();
 #endif 
index 24edd32cc4c7206078b35cb3270d2778ca9cc1e2..e7f367a8a1aad5750b60f84acab5a4059b863e21 100644 (file)
@@ -20,6 +20,6 @@ class ostream;
 //IPL_instantiate(Midi_event);
 IPL_instantiate(Midi_track);
 // PL_instantiate(Midi_voice);
-// IPL_instantiate(Midi_voice);
+IPL_instantiate(Midi_voice);
 //IPL_instantiate(Track_column);