]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 0.1.7 release/0.1.7
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 14 Aug 1997 00:41:33 +0000 (02:41 +0200)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 14 Aug 1997 00:41:33 +0000 (02:41 +0200)
303 files changed:
.dstreamrc
ANNOUNCE
AUTHORS.text
BUGS
COPYING
Documentation/AUTHORS.pod
Documentation/INSTALL.pod
Documentation/Makefile
Documentation/Rules.make
Documentation/faq.pod
Documentation/gnu-music.pod
Documentation/index.pod
Documentation/internals.pod [new file with mode: 0644]
Documentation/lilygut.pod [deleted file]
Documentation/lilyliterature.pod [deleted file]
Documentation/lilypond.pod
Documentation/links.pod
Documentation/literature.pod [new file with mode: 0644]
Documentation/mi2mu.pod
Documentation/mudela-course.doc
Documentation/mudela-man.doc
Documentation/mutopia.pod [new file with mode: 0644]
Documentation/other-packages.pod
INSTALL.text
NEWS
README
TODO
VERSION
bin/convert-mudela.in
bin/make-version
bin/make-website.in
bin/mudela-book.in
configure
configure.in
flower/Makefile
flower/NEWS
flower/README
flower/VERSION
flower/aclocal.m4 [new file with mode: 0644]
flower/dstream.cc
flower/include/dstream.hh
flower/include/lgetopt.hh
flower/lgetopt.cc
flower/path.cc
init/dutch.ly
init/engraver.ly
init/german.ly [new file with mode: 0644]
init/midi.ly
init/script.ly
init/swedish.ly
init/symbol.ly
init/table16.ly
input/beams.ly
input/cadenza.ly
input/collisions.ly
input/coriolan-alto.ly
input/gallina.ly [new file with mode: 0644]
input/header.ly
input/keys.ly
input/kortjakje.ly
input/multi.ly
input/pedal.ly
input/rhythm.ly
input/rock.ly [deleted file]
input/scales.ly
input/scripts.ly
input/scsii-menuetto.ly
input/slurs.ly
input/standchen.ly
input/toccata-fuga-E.ly
input/twinkle-pop.ly [new file with mode: 0644]
input/twinkle.ly
input/wohltemperirt.ly
lib/Makefile
lib/binary-source-file.cc
lib/config.hh.in
lib/duration-convert.cc
lib/duration.cc
lib/file-storage.cc [new file with mode: 0644]
lib/include/duration.hh
lib/include/file-storage.hh [new file with mode: 0644]
lib/include/proto.hh
lib/include/source-file.hh
lib/include/source.hh
lib/simple-file-storage.cc [new file with mode: 0644]
lib/source-file.cc
lib/source.cc
lily/Makefile
lily/Stable.make
lily/VERSION
lily/atom.cc
lily/audio-element.cc [new file with mode: 0644]
lily/audio-item.cc
lily/audio-score.cc
lily/axis-group-item.cc [new file with mode: 0644]
lily/axis-group-spanner.cc [new file with mode: 0644]
lily/axis-group.cc [new file with mode: 0644]
lily/axis.cc [new file with mode: 0644]
lily/bar-column-grav.cc [new file with mode: 0644]
lily/bar-column.cc [new file with mode: 0644]
lily/bar-grav.cc
lily/bar-number-grav.cc [new file with mode: 0644]
lily/bar.cc
lily/beam.cc
lily/boxes.cc
lily/break.cc
lily/clef-grav.cc
lily/clef-item.cc
lily/collision-grav.cc
lily/collision.cc
lily/command-request.cc
lily/crescendo.cc
lily/dynamic-grav.cc
lily/elem-group-item.cc
lily/elem-group.cc
lily/engraver-group.cc
lily/engraver.cc
lily/general-script-def.cc
lily/gourlay-breaking.cc
lily/grouping.cc
lily/head-column.cc
lily/head-grav.cc
lily/horizontal-align-item.cc
lily/horizontal-group-item.cc
lily/include/audio-element.hh [new file with mode: 0644]
lily/include/audio-item.hh
lily/include/audio-score.hh
lily/include/axes.hh [new file with mode: 0644]
lily/include/axis-group-item.hh [new file with mode: 0644]
lily/include/axis-group-spanner.hh [new file with mode: 0644]
lily/include/axis-group.hh [new file with mode: 0644]
lily/include/bar-column-grav.hh [new file with mode: 0644]
lily/include/bar-column.hh [new file with mode: 0644]
lily/include/bar-number-grav.hh [new file with mode: 0644]
lily/include/bar.hh
lily/include/boxes.hh
lily/include/break.hh
lily/include/collision.hh
lily/include/command-request.hh
lily/include/elem-group-item.hh
lily/include/elem-group.hh
lily/include/engraver-group.hh
lily/include/engraver.hh
lily/include/general-script-def.hh
lily/include/head-column.hh
lily/include/head-grav.hh
lily/include/horizontal-group-item.hh
lily/include/input-translator.hh
lily/include/item.hh
lily/include/key-grav.hh
lily/include/key-item.hh
lily/include/lily-proto.hh
lily/include/local-key-item.hh
lily/include/main.hh
lily/include/midi-def.hh
lily/include/midi-item.hh
lily/include/midi-output.hh [deleted file]
lily/include/midi-stream.hh
lily/include/midi-walker.hh [new file with mode: 0644]
lily/include/molecule.hh
lily/include/music-iterator.hh
lily/include/music.hh
lily/include/musical-request.hh
lily/include/my-lily-parser.hh
lily/include/note-column-grav.hh
lily/include/note-performer.hh
lily/include/offset.hh
lily/include/p-col.hh
lily/include/p-score.hh
lily/include/paper-def.hh
lily/include/performer-group-performer.hh
lily/include/performer.hh
lily/include/request.hh
lily/include/rest-column.hh
lily/include/score-align-grav.hh
lily/include/score-column.hh
lily/include/score-elem.hh
lily/include/score-grav.hh
lily/include/score-performer.hh
lily/include/score.hh
lily/include/script-column.hh
lily/include/script-def.hh
lily/include/script-grav.hh
lily/include/script.hh
lily/include/span-bar-grav.hh
lily/include/span-bar.hh
lily/include/span-score-bar-grav.hh
lily/include/spanner-elem-group.hh
lily/include/spanner.hh
lily/include/spring-spacer.hh
lily/include/staff-performer.hh
lily/include/staff-side.hh
lily/include/staffline.hh [deleted file]
lily/include/super-elem.hh
lily/include/symbol.hh
lily/include/text-def.hh
lily/include/timing-grav.hh [new file with mode: 0644]
lily/include/vertical-align-elem.hh
lily/include/vertical-group-spanner.hh
lily/item.cc
lily/key-grav.cc
lily/key-item.cc
lily/leastsquares.cc
lily/lexer.l
lily/line-group-grav.cc
lily/local-key-grav.cc
lily/local-key-item.cc
lily/lookup.cc
lily/lyric-grav.cc
lily/main.cc
lily/meter-grav.cc
lily/meter.cc
lily/midi-def.cc
lily/midi-item.cc
lily/midi-stream.cc
lily/midi-walker.cc
lily/molecule.cc
lily/music-iterator.cc
lily/music-list.cc
lily/musical-request.cc
lily/my-lily-lexer.cc
lily/my-lily-parser.cc
lily/note-column-grav.cc
lily/note-performer.cc
lily/notehead.cc
lily/p-score.cc
lily/paper-def.cc
lily/parser.y
lily/performer-group-performer.cc
lily/performer.cc
lily/request.cc
lily/rest-collision-grav.cc
lily/score-align-grav.cc
lily/score-elem.cc
lily/score-grav.cc
lily/score-halign-grav.cc
lily/score-performer.cc
lily/score.cc
lily/scoreline.cc
lily/scores.cc
lily/script-column.cc
lily/script-def.cc
lily/script-grav.cc
lily/script.cc
lily/slur-grav.cc
lily/span-bar-grav.cc
lily/span-bar.cc
lily/span-score-bar-grav.cc
lily/spanner-elem-group.cc
lily/spanner.cc
lily/staff-info.cc
lily/staff-performer.cc
lily/staff-side.cc
lily/staffline.cc [deleted file]
lily/stem-beam-grav.cc
lily/stem.cc
lily/symbol.cc
lily/template8.cc
lily/tex-beam.cc
lily/tex-slur.cc
lily/text-def.cc
lily/text-grav.cc
lily/text-item.cc
lily/text-spanner.cc
lily/timing-grav.cc [new file with mode: 0644]
lily/vertical-align-elem.cc
lily/vertical-align-grav.cc
lily/vertical-group-spanner.cc
make/Makefile
make/Rules.make
make/Targets.make
make/Variables.make
make/debian/Makefile [new file with mode: 0644]
make/debian/README.debian.ex [new file with mode: 0644]
make/debian/changelog [new file with mode: 0644]
make/debian/control [new file with mode: 0644]
make/debian/copyright [new file with mode: 0644]
make/debian/dirs [new file with mode: 0644]
make/debian/diversions.ex [new file with mode: 0644]
make/debian/docs [new file with mode: 0644]
make/debian/examples [new file with mode: 0644]
make/debian/info.ex [new file with mode: 0644]
make/debian/menu.ex [new file with mode: 0644]
make/debian/postinst [new file with mode: 0644]
make/debian/postrm [new file with mode: 0644]
make/debian/rules [new file with mode: 0644]
make/debian/watch [new file with mode: 0644]
make/lilypond.lsm
make/lilypond.spec
mi2mu/Makefile
mi2mu/TODO
mi2mu/VERSION
mi2mu/include/lily-stream.hh
mi2mu/include/midi-track.hh
mi2mu/lily-stream.cc
mi2mu/main.cc
mi2mu/midi-event.cc
mi2mu/midi-parser.y
mi2mu/midi-score.cc
mi2mu/midi-track.cc
mi2mu/my-midi-parser.cc
tex/dimen.tex
tex/taupindefs.tex

index 2ec9f75879edc5b6043a1ffa640869c6fab05926..ae0b1b114315801ea37b2b3ac1fef0606f7087c2 100644 (file)
@@ -14,83 +14,83 @@ Lexer                       1
 Matrix                 1
 
 
+# flower lib
+File_path              0
 
-Atom                   1
-Bar                    1
-Beam                   1
-Change_iterator                1
+Atom                   0
+Bar                    0
+Beam                   0
+Change_iterator                0
 Chord                  0
-Chord_iterator         1
-Clef_item              1
-Col_configuration      1
-Colinfo                        1
-Colinfo                        1
-Collision              1
-Command                        1
+Chord_iterator         0
+Clef_item              0
+Col_configuration      0
+Colinfo                        0
+Colinfo                        0
+Collision              0
 
 # E l b e ment? search/replace typo.
 # Yeah. kind of. Looks cute though
-Elbement_group         1
-Engraver               1
-Engraver_group_engraver 1
-File_path              1
-Group_change_req       1
-Head_column            1
-Idealspacing           1
-Ineq_constrained_qp    1
-Input_translator       1
-Item                   1
-Key_item               1
-Lookup                 1
-Line_spacer            1
+Elbement_group         0
+Engraver               0
+Engraver_group_engraver 0
+Group_change_req       0
+Head_column            0
+Idealspacing           0
+Ineq_constrained_qp    0
+Input_translator       0
+Item                   0
+Key_item               0
+Lookup                 0
+Line_spacer            0
 Melodic_req            0
-Midi_def               1
-Mixed_qp               1
-Music                  1
-Music_iterator         1
+Midi_def               0
+Mixed_qp               0
+Music                  0
+Music_iterator         0
 My_lily_lexer          1
-Note_head              1
-Note_performer         1
+Note_head              0
+Note_performer         0
 Note_req               0
-PCol                   1
-PScore                 1
-Paper_def              1
-Paperdef               1
-Performer              1
-Performer_group_performer      1
-Request                        1
-Request_iterator       1
-Rest_collision         1
-Rest_collision_engraver 1
-Rest_req               1
+PCol                   0
+PScore                 0
+Paper_def              0
+Paperdef               0
+Performer              0
+Performer_group_performer      0
+Request                        0
+Request_iterator       0
+Rest_collision         0
+Rest_collision_engraver 0
+Rest_req               0
 Rhythmic_req           0
-Score                  1
-Score_column           1
-Score_elem             1
-Score_engraver         1
-Score_performer                1
-Script_column          1
-Script_def             1
-Script_req             1
-Slur                   1
-Spacing_problem        1
-Spanner                        1
-Spring_spacer          1
-Staff                  1
-Staff_commands         1
-Stem                   1
-Stem                   1
-Stem_req               1
-Symtable               1
-Symtables              1
-Text_def               1
-Text_req               1
-Time_description       1
-Voice                  1
-Voice_element          1
-Voice_element_iterator  1
-Voice_iterator         1
-Word_wrap              1
+Score                  0
+Score_column           0
+Score_elem             0
+Score_engraver         0
+Score_performer                0
+Script_column          0
+Script_def             0
+Script_req             0
+Slur                   0
+Spacing_problem        0
+Spanner                        0
+Spring_spacer          0
+Staff                  0
+Staff_commands         0
+Stem                   0
+Stem                   0
+Stem_req               0
+Symtable               0
+Symtables              0
+Text_def               0
+Text_req               0
+Time_description       0
+Voice                  0
+Voice_element          0
+Voice_element_iterator  0
+Voice_iterator         0
+Word_wrap              0
 delete_identifiers     1
 parse_duration         1
 parse_pitchmod         1
index 8cabfbcdeff08d9d55ffba3ecbc4ae2bd027fd0b..9f7d6e2e37180202b7390af6079bdac7d69244f8 100644 (file)
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,3 +1,4 @@
+Keywords: midi notation music typesetting gnu
 Subject: LilyPond 0.1 released - The GNU Project music typesetter
 
        BORN
@@ -8,8 +9,7 @@ Subject: LilyPond 0.1 released - The GNU Project music typesetter
 
                (GNU LilyPond 0.1)
 
-       daughter to Jan 'Janneke' Nieuwenhuizen and Han-Wen 'Wendy'
-       Nienhuys
+       daughter to Jan 'Janneke' Nieuwenhuizen and Han-Wen 'Wendy' Nienhuys
 
 Lily is a healthy, bouncing baby weighing 345 kilobytes
 
@@ -126,3 +126,40 @@ THANK YOU,
 
 Thanks go out to Mats Bengtsson, Werner Lemberg and Richard Stallman
 for comments and contributions.
+
+
+****   NOTE
+
+LilyPond might have a minor bug if  you use glibc-2; we will look into it
+If you use glibc-2, please try 0.1.0 to see if it works and, download 0.1.1
+when it's available.  
+
+LilyPond might exhibit a g++ bug on Solaris 1.5 (The stack frame gets corrupted
+by a constructor) if you compile with -O2. We don't know workarounds.  
+
+                             --- * ---
+
+    We would like to dedicate this program to all the friends that we
+                        met through music. 
+
+
+       Those deserving special mention (in no particular order):
+Esther, Marijke, Heike, Inge, Judith, Hannah, Auke, Ilse, Evelyn,
+Maartje, Suzanne, Ilse (gee, again?) and last (but certainly not least)
+Janneke!
+
+       HWN
+
+       That's a nice thought, Wendy.  I've got a few too, to spread
+the credits a bit (Again, no particular order) Michelle, Illushka, 
+Ruth, Eva, Fro/ydis, Monique, Noor, Sascha, Monique, Ilse, Monique, 
+Eva, Roos, Judith, Tim and, of course, Wendy!
+
+       JCN
+
+Of course, our other friends in the `Eindhovens Jongeren Ensemble'
+(http://www.stack.nl/~hanwen/eje.html) cannot go unmentioned either.
+
+
+                              --- * ---
index 4ebcd6982302feec2c2f85471cd00f070173ca47..a035909c097fd336f7175b26ce17225c9c8a3b51 100644 (file)
@@ -31,12 +31,16 @@ A\bA\bA\bAU\bU\bU\bUT\bT\bT\bTH\bH\bH\bHO\bO\bO\bOR\bR\bR\bRS\bS\bS\bS
 
 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.
+           reg.cc, clef-item.cc swedish notenames, testing,
+           general comments.
 
        +\bo   Werner Lemberg <xlwy01@uxp1.hrz.uni-dortmund.de>, misc
            bugfixes, some Beam and Stem code.
 
-       +\bo   Alexandre Oliva <oliva@dcc.unicamp.br>
+       +\bo   Alexandre Oliva <oliva@dcc.unicamp.br>, testing
+
+       +\bo   Anthony Fok <foka@gpu.srv.ualberta.ca>, debian
+           package: make/debian/*
 
        Your name could be here! If you want to help, then take a
        look at the SMALLISH PROJECTS section of in the file _\bT_\bO_\bD_\bO.
@@ -57,10 +61,6 @@ C\bC\bC\bCO\bO\bO\bON\bN\bN\bNT\bT\bT\bTR\bR\bR\bRI\bI\bI\bIB\bB\bB\bBU\bU\bU\bUT\bT\bT\bTO\bO\bO\bOR\bR\bR\bRS\bS
 
 
 
-
-
-
-
-30/Jul/97                 LilyPond 0.1.1                        1
+12/Aug/97                 LilyPond 0.1.7                        1
 
 
diff --git a/BUGS b/BUGS
index 84a3fddf939aa827088350750c70aedb80606c3e..1f811c90c9e07fd58a59c481cc364bec7149fd6f 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -1,22 +1,11 @@
+Document reintroduced deficiencies.
 
-[document reintroduced deficiencies.]
+* placement of bar-numbers
 
-*******************
- '.' -> lilypond: lexer.l:258: int My_lily_lexer::yylex(): Assertion `cnv == 1' failed.
+*
 
-***********************
+hw:~/musix/spacer/Documentation/out$ LILYINCLUDE=../../input lilypond -o wohltemperirt ../../input/wohltemperirt.ly
 
-
-\score { < 
-       \melodic { \id "Staff" ""; c'4 g'4 }
-       \lyric { \id "Lyric" ""; hello4 bye4 < a chord > }
-       \lyric { \id "Lyric" ""; bye4 hello4 }
-       \melodic { \id "Staff" ""; c'4 g'4 }
-       > 
-} 
-
-*******************
-
-Stack frame overwrite in on Solaris 2.5.
-Engraver_group_engraver::Engraver_group_engraver() called from
-Score_engraver::Score_engraver()
+GNU LilyPond 0.1.7 #10/FlowerLib 1.1.26 #1
+Parsing ... [/home/hw/share/lilypond/init//symbol.ly[/home/hw/share/lilypond/init//dynamic.ly][/home/hw/share/lilypond/init//dutch.ly][/home/hw/share/lilypond/init//script.ly][/home/hw/share/lilypond/init//paper16.ly[/home/hw/share/lilypond/init//table16.ly^[[B][/home/hw/share/lilypond/init//engraver.ly]][/home/hw/share/lilypond/init//midi.lySegmentation fault (core dumped)
+hw:~/musix/spacer/Documentation/out$ 
diff --git a/COPYING b/COPYING
index da816022099e25d775851c80c863264f4972e891..34d69e433644380d8d32b06db3cf11b595370aeb 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -1,8 +1,11 @@
-This license applies to all files except:
 
-       - the included input files which explicitly state a different
-copyright policy
 
+*** NOTE
+
+       This license applies to all files except the included input files
+       (which are in the subdirectory input/
+
+*** END NOTE
 
                    GNU GENERAL PUBLIC LICENSE
                       Version 2, June 1991
index cab146ee8062ecaac0ebb98d49ebac86c770363e..f6366d5e00c719463f30f9a0ab807e1601057d8e 100644 (file)
@@ -36,7 +36,7 @@ and corresponding header files.
 =item *
 
 Mats Bengtsson <matsb@s3.kth.se>, parts of clef-reg.cc, clef-item.cc
-testing, general comments.
+swedish notenames, testing, general comments.
 
 =item *
 
@@ -45,12 +45,14 @@ Beam and Stem code.
 
 =item *
 
-Alexandre Oliva <oliva@dcc.unicamp.br>
+Alexandre Oliva <oliva@dcc.unicamp.br>, testing
+
+=item *
+
+Anthony Fok <foka@gpu.srv.ualberta.ca>, debian package: make/debian/*
 
 =back
 
 Your name could be here! If you want to help, then take a look at the
 SMALLISH PROJECTS section of in the file F<TODO>. Some do not involve
 coding C++
-
-
index 82d5e944fd7dafb64b593aa126666fa9b6f18b35..ae5da8da87f01b35b79bf8d5bab540c4871f62a6 100644 (file)
@@ -95,8 +95,8 @@ Although not strictly necessary, these are recommended to have.
 
 =item *
 
-Perl.  Most scripts are written in Perl. Most  documentation was created
-with the perl's Plain Old Documentation.
+Perl-5.  Most scripts are written in Perl. Most  documentation was created
+with the perl's Plain Old Documentation. (I use 5.003)
 
 =item *
 
@@ -311,18 +311,17 @@ permissions will not be set correctly, unfortunately)
 A Debian package is in the works
 
 
-=head1 WINDOZE
+=head1 WINDOWS NT/95
 
-Windows NT:
+So, you're stuck with Windows, eh?  Well, don't worry, you just 
+need (to get) Cygnus' windows32 port of gnu development stuff; 
+have a look at http://www.cygnus.com/gnu-win32.
 
-you need the cygnus windows32 gnu port development stuff; have a look
-at http://www.cygnus.com/gnu-win32.
-
-to make GNU LilyPond under, brr, aargh, shudder.. windows32, well,
+To make GNU LilyPond under, brr, aargh, shudder... windows32, well,
 simply type:
 
        bash configure
-       make windows32
+       make
 
 =head1 AUTHORS
 
index edd922ce57c2aa3f4a388a9f263099c5a5ed57f2..1bc695200ec13e29df01f7d17fd3c01112ce29e2 100644 (file)
@@ -31,7 +31,8 @@ DVIFILES = $(addprefix $(outdir)/, $(DOCFILES:.doc=.dvi))
 #
 # list of distribution files:
 #
-EXTRA_DISTFILES = lelie_icon.gif lelie_logo.gif  $(DOCFILES)
+EXTRA_DISTFILES = lelie_icon.gif lelie_logo.gif  $(DOCFILES) 
+# $(wildcard Vocab*)
 
 default: do-doc
 
index 77248077993806495a8c257a29e491978e075673..bf32a8d067d03adc15fe3ca997ca85061bc39257 100644 (file)
@@ -23,8 +23,13 @@ $(outdir)/%.text: $(outdir)/%.1
 $(depth)/%.text: $(outdir)/%.text
        cp $< $@
 
-$(outdir)/%.html: %.pod
-       $(pod2html)  $<
+do_pod2html=$(pod2html) $<
+
+# do this for perl 5.004
+#       $ make do_pod2html='$(pod2html) --infile $< --outfile=$@' html
+#
+$(outdir)/%.html: %.pod $(depth)/VERSION
+       $(do_pod2html) 
        mv $(notdir $@) $(outdir)/
 
 $(outdir)/%.5: %.pod
@@ -36,16 +41,20 @@ $(outdir)/%.1: %.pod
 $(outdir)/%.gz: $(outdir)/%
        gzip -c9 $< > $@
 
-$(outdir)/%.dvi: $(depth)/input/%.ly $(lilyout)/lilypond
-       (cd $(outdir); lilypond ../$< ;\
+name-stem= $(notdir $(basename $<))
+$(outdir)/%.dvi: $(depth)/input/%.ly 
+       (cd $(outdir); \
+       rm lelie.midi ; \
+       lilypond -o  $(name-stem)  ../$< )
+       (cd $(outdir); \
        if [ -f ../$(basename $< ).tex ]; \
        then \
                latex ../$(basename $< ) ;\
        else \
-               tex '\nonstopmode \input lelie' ;\
-               mv lelie.dvi ../$@ ; \
+               tex $(name-stem) ;\
        fi)
 
+
 # generate the pixmap at twice the size, then rescale (for antialiasing)
 $(outdir)/%.gif: $(outdir)/%.ps
        gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE  $< -c quit |pnmscale 0.5| ppmtogif > $@
index ac6aa0637fbb71423a8a53ec8a581fb03aa1ae33..9d58aaec2f5457c32b251392fac375227a3324b8 100644 (file)
@@ -138,6 +138,22 @@ output PostScript or render to an X window too)
 
 =head2 Miscellaneous
 
+Q: Do you support pop songs (chords, single staff, lyrics)?
+
+A: Yes, see the twinkle-pop example
+
+Q: Do you support guitar chord diagrams?
+
+A: No, not yet. We ourselves don't play guitar, and don't know the
+fine points of this notation.  We would welcome anyone who could give
+this a try.
+
+Q: Do you support TAB notation
+
+A: No. The same as for the previous question goes, but TAB is a lot
+more work than diagrams (TAB needs modification of Parser, Lexer,
+Notehead, Stem, and stem-code. )
+
 Q: How do I change the TeX layout?
 
 A: See lilyponddefs.tex, it has some comments.
@@ -199,21 +215,21 @@ Q: I want a DOS/NT/W95 port.
 
 A.0: Reconsider.  Try Linux.  It's fun!
 
-A.1: Currently (patchlevel 27), GNU LilyPond (and flowerLib) compiles, links
-and runs on windhoos-nt, using the cygnus gnu port (release b17.1). 
+A.1: Currently (patchlevel 27), GNU LilyPond (and flowerLib) compiles, 
+links and runs on Windows-nt, using Cygnus' gnu port (release b17.1). 
 I (JCN) only had to make a minor workaround for missing library calls.  
-Have a look at http://www.cygnus.com/gnu-win32.  To make GNU LilyPond type
-C<make $OSTYPE>. (I am not promising to maintain this platform, it is just 
-that when having to use doze, i-m sometimes too lazy to reboot.)
+Have a look at http://www.cygnus.com/gnu-win32.  To make GNU LilyPond 
+type C<make>. (I am not promising to maintain this platform, it is just
+that when forced into doze, i'm sometimes too lazy to reboot.)
 
 A.2: I haven't had time to find a GCC crosscompiler (I<with> g++ and
-libg++, mind you) to DOS/win (in rpm, please :-)
+libg++, mind you) to DOS/Windows (in rpm, please :-)
 
 
-Q: I-m dozed enough to run the (sometimes bit stale) .exe-s you distribute. 
+Q: I just love to blindly run the (sometimes bit stale) .exe's you distribute. 
 Why do i need cygwin.dll?
 
-A: It-s all in this cut-n-paste:
+A: It's all in this cut-n-paste:
 
 Minimalist GNU-Win32 Readme                   
 version 0.1.3                           
index fbb2d7402f864afa1bf939ec33bf3704cfaee9e0..c209f2a31a78955d94b6b3495a5b749c8c9356f4 100644 (file)
@@ -6,27 +6,61 @@ GNU Music project - manifesto
 
 Random ranting about the GNU Music project. 
 
-=head2 Note
+=head2 History of the GNU Music Project
 
-The GNU Music project was started by a few people (among others Robert Strandh,
-Robert.Strandh@labri.u-bordeaux.fr), who wanted to create free software
-for music printing and composing. After its initiation, its
-development efforts slowed down.
+Please note that this all happened when I wasn't around yet.  If you
+think that I am a biased, unfair, predisposed hypocrite, then don't
+bother flaming me;  I already know that.
 
-Independently, I started LilyPond. When I showed it to
+The GNU Music project is a project which aims to create free software
+for music printing and composing.  It was started in november '92 by a
+core team of four members (Bryan Ford <baford@cs.utah.edu>, David Linn
+<drl@vuse.vanderbilt.edu>, Francois Pinard <pinard@iro.umontreal.ca>,
+Neil Jerram <nj104@cus.cam.ac.uk> and in January '93 Robert Strandh
+<Robert.Strandh@labri.u-bordeaux.fr> joined.
+
+After serious disputes with Robert Strandh
+<Robert.Strandh@labri.u-bordeaux.fr> and the FSF staff in '94, the
+project core team got divided. The development efforts of GMP stopped.
+
+Independently, I (HWN) started LilyPond. When I showed it to
 RMS, he was very enthousiastic about having LilyPond in the GNU
 project. I subsequently learned about the GNU Music project, and
-contacted them.  We (the GNU Music project people and us, LilyPond
-people) agreed that cooperation would be desirable. Although merging
-of both efforts is technically infeasible at this point, we did decide
-that LilyPond should also be part of the GNU Music project (when it is
-really released).
-
-In summary, LilyPond is part of the GNU project, and part of the (yet
-to be created) GNU Music project. LilyPond 's existence does not mean
-that other efforts for free music tools have come to a halt. In
-particular, the following document is entirely mine, and is not meant
-to reflect anyone else's opinion.
+contacted them.  
+
+What was left of the GMP (Robert Strandh) and us, LilyPond people,
+agreed that cooperation would be desirable. Although merging of both
+efforts was and is technically infeasible, we did decide that LilyPond
+should also be part of the GNU Music project.
+
+Only later did I discover the previous quarrels about the GMP-"take
+1". To show that I am aware of the history, and to make sure nobody
+gets me wrong or is angry at me because I stole a project or a
+project's name, I wrote this note.
+
+In summary, LilyPond is now the only substantial embodiment of the GNU Music
+Project, and it is part of the GNU project. 
+
+For completeness' sake, I will mention the other efforts  here:
+
+=over 4
+
+=item G Sharp, http://dept-info.labri.u-bordeaux.fr/~strandh/Gsharp
+
+An alpha version notation editor for X in Scheme. Source available on
+request.
+
+=item GNU music, 
+
+An alpha version of a music editing system with Musictex
+output. Pretest versions of GNU Music (v0.3) can still be obtained from
+Francois Pinard.
+
+=back
+
+This history note is probably biased in some way, because I wrote it.
+The rest of this document is also entirely mine, and is not meant to
+reflect anyone else's opinion.
 
 =head1 GOAL
 
@@ -70,25 +104,12 @@ performing
 
 =back
 
-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 to justify this policy: the 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). 
+These systems should encourage laymen to take up composing, in the
+same way that GNU tools have created a whole new generation of
+programmers.
 
 The public deserves free tools for composing and printing.
 
-In general, the same arguments as for software hold for music. See
-Stallmans articles on free software.
-
 
 =head1 REQUIREMENTS
 
@@ -146,8 +167,7 @@ but it is not (yet) suited to interactive typesetting
 
 which can display clear notewriting in (say) an X-window
 
-G-Sharp is there, but far from finished. Ideally the system should
-cooperate with the typesetting engine
+Ideally the system should cooperate with the typesetting engine
 
 =item An ASCII language
 
@@ -180,11 +200,6 @@ simplifies creating a collection of music
 (difficult) A system to generate accompaniments, figured bass,
 automatic accompaniment, etc.
 
-=item An internet archive of free music
-
-The complete works by Bach, Beethoven, and any other ancient composer
-should be electronically retrievable. This might be a separate
-project: the Free Music Project.
 
 =back
 
index 43f6c2b1e0f517a3beaa37bfd4d4c1e521b2f1ea..992009edc9b88697a7ca321b572f04eee0c38e29 100644 (file)
@@ -8,6 +8,9 @@ GNU LilyPond is a program which converts music definition files into
 visual or auditive output: it can typeset formatted sheet music to a
 TeX file and and (mechanical) performances to MIDI files.
 
+This is not a Fanmail/Hype page. These pages were entirely created from
+the LilyPond package-sources
+
 =head2 Examples
 
 <a href=example_output.html
@@ -106,6 +109,14 @@ The GNU Music project
 </a
 >
 
+=item *
+<a href=mutopia.html
+>
+Mutopia -- Music To the People
+</a
+>
+
+
 =item *
 <a href=ANNOUNCE.txt
 >
@@ -141,7 +152,7 @@ The Change log
 >
 
 =item *
-<a href=lilygut.html
+<a href=internals.html
 >
 internal structures.
 </a
@@ -175,7 +186,7 @@ AUTHORS
 =over 5
 
 =item *
-<a href=lilyliterature.html
+<a href=literature.html
 >
 Papers, books and online-resources on music typesetting
 </a
diff --git a/Documentation/internals.pod b/Documentation/internals.pod
new file mode 100644 (file)
index 0000000..4d174f1
--- /dev/null
@@ -0,0 +1,319 @@
+=head1 NAME
+
+LilyGuts - doco to the internals of GNU LilyPond
+
+=head1 DESCRIPTION
+
+This page documents some aspects of the internals of GNU LilyPond. Some of
+this stuff comes from e-mail I wrote, some from e-mail others wrote,
+some are large comments taken away from the headers. This is why this
+page may be a little incoherent.
+
+You should use doc++ to take a peek at the sources.
+
+This should become a Hacking-HOWTO. If you find any confusing stuff
+here, let me know.  I am a hacker, and don't spend enough time doccing
+what I write. (Most stuff here which refers to the code is slightly outdated)
+
+If you finally have mastered some internal piece of lily, your
+explanation could be added here.
+
+=head1 OVERVIEW
+
+GNU LilyPond is a "multi-pass" system. The different passes have been
+created so that they do not depend on each other. In a later stage
+some parts may be moved into libraries, or seperate programs, or they
+might be integrated in larger systems.
+
+=over 4
+
+=item Parsing:
+
+No difficult algorithms. The .ly file is read, and converted to a list
+of C<Scores>, which each contain C<Music> and paper/midi-definitions.
+
+=item Creating elements
+
+The music is walked column by column. The iterators which do the
+walking report the Request to Translators which use this information
+to create elements, either MIDI or "visual" elements. The translators
+form a hierarchy; the ones for paper output are Engravers, for MIDI
+Performers).
+
+The translators swallow requests, create elements, broadcast them to
+other translators on higher or same level  in the hierarchy:
+
+The stem of a voice A is broadcast to the staff which contains A, but
+not to the noteheads of A, and not to the stems, beams and noteheads
+of a different voice (say B) or a different staff. The stem and
+noteheads of A are coupled, because the the Notehead_engraver
+broadcasts its heads, and the Stem catches these.
+
+The engraver which agrees to handle a request decides whether to to
+honor the request, ignore it, or merge it with other requests. Merging
+of requests is preferably done with other requests done by members of
+the same voicegroups (beams, brackets, stems). In this way you can put
+the voices of 2 instruments in a conductor's score so they make chords
+(the Stem_reqs of both instruments will be merged).
+
+=item Prebreaking
+
+Breakable stuff (eg. clefs and bars) are copied into pre and postbreaks. 
+
+=item Preprocessing
+
+Some dependencies are resolved, such as the direction of stems, beams,
+and "horizontal" placement issues (the order of clefs,  keys etc,
+placement of chords in multi-voice music), 
+
+=item Break calculation:
+
+The lines and horizontal positions of the columns are determined.
+
+=item Breaking
+
+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
+(or, if there are no pieces, the original spanner itself) throws out
+any dependencies which are in the wrong line.
+
+=item Postprocesing:
+
+Some items and all spanners need computation after the PCol positions
+are determined. Examples: slurs, vertical positions of staffs.
+
+=item Output paper
+
+=back
+
+=head1 INTERNALS
+
+This chapter deals with the internals of Mudela. 
+
+=head2 Requests
+
+As you can see, most information is stored in the form of a request. 
+In music typesetting, the user might want to cram a lot more symbols
+on the paper than actually fits. To reflect this idea (the user asks
+more than we can do), the container for this data is called Request.
+
+In a lot of other formats this would be called an 'Event'
+
+=over 4
+
+=item C<Barcheck_req>
+
+Checks during music processing if start of this voice element
+coincides with the start of a measure. Handy to check if you left out
+some voice elts.
+
+=item C<Note_req>
+
+LilyPond has to decide if the ball should be hanging left or
+right. This influences the horizontal dimensions of a column, and this
+is why request processing should be done before horizontal spacing.
+
+Other voices' frivolities may cause the need for accidentals, so this
+is also for the to decide. The engraver can decide on positioning based on
+ottava commands and the appropriate clef.
+
+=item C<Rest_req>
+
+Typeset a rest.
+
+=item C<Span_req>
+
+This type of request typically results in the creation of a C<Spanner>
+
+=item C<Beam_req>
+
+Start/stop a beam.
+
+Engraver has to combine this request with the stem_request, since the
+number of flags that a stem wants to carry will determine the
+number of beams.
+
+=item  C<Dynamic>
+
+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  C<Dynamic> request carries a time, measured
+from the start of its note.
+
+=head2 Voice groups
+
+Voice group is a (time-dependent) collection of voices which share
+some characteristics (slurs, stems) at some time.
+
+=head1 Request_engraver
+
+In the previous section the idea of Request has been explained, but
+this only solves one half of the problem. The other half is
+deciding which requests should be honored, which should merged with
+other requests, and which should be ignored. Consider this (pseudo)input
+
+       < % chord
+               \music { [c() c] }
+               \music { [e() e] }
+       >
+
+Both the c and e are part of a chord (they are in the same
+Voice_group), so they should share the beams, and the two [ ] pairs
+should be merged. The slurs OTOH are specific for each voice, so they
+should not be shared.
+
+The judge in this "allocation" problem a set of broker. It uses the
+C<Request_engraver> to do most of the work.  For each request
+C<Complex_staff> queries so-called C<Request_engraver>s if they want
+to accept a request eg, the C<Notehead_engraver> will accept
+C<Note_req>s, and turn down C<Slur_req>s. If the Music_iterator
+cannot find a engraver that wants the request, it is junked (with a
+warning message).
+
+After all requests have been either assigned, or junked, the Engraver
+will process the requests (which usually means creating an C<Item> or
+C<Spanner>). If a C<Request_engraver> creates something, it tells
+If all requests have been processed, then each Engraver is notified
+of any created Score_element, via a broadcasting system.
+
+=head2 example:
+
+       c4
+
+produces:
+
+       note_request (duration 1/4)
+       stem_request (duration 1/4)
+
+note_request will be taken by a C<Notehead_engraver>, stem_request
+will be taken by a C<Stem_beam_engraver>. C<Notehead_engraver> creates
+a C<Notehead>, C<Stem_beam_engraver> creates a C<Stem>. Both announce
+this to the Staff_engraver. Staff_engraver will tell
+C<Stem_beam_engraver> about the C<Notehead>, which will add the
+C<Notehead> to the C<Stem> it just created.
+
+To decide on merging, several engravers have been grouped. Please
+check F<init/engraver.ly>.
+
+
+=head1 ITEMS and SPANNERS
+
+The symbols that are printed, are generated by items and spanners
+(staff-elements). An item has one horizontal position, whereas a
+spanner spans several columns.
+
+=head1 DEPENDENCIES
+
+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 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, noteheads)
+should be calculated.
+
+=head1 BREAKING
+
+So what is this PREBREAK and POSTBREAK stuff?
+
+Let's take text as an example. In German some compound
+words change their spelling if they are broken: "backen" becomes
+"bak-ken".  TeX has a mechanism to deal with this, you would define
+the spelling of "backen" in TeX in this way
+
+       \discretionary{bak-}{ken}{backen}
+
+These 3 arguments are called "prebreak", "postbreak" and "nobreak"
+text.
+
+The same problem exists when typesetting music. If a line of music is
+broken, the next line usually gets a clef. So in TeX terms, the clef
+is a postbreak. The same thing happens with meter signs: Normally the
+meter follows the bar. If a line is broken at that bar, the bar along
+with the meter stays on the "last" line, but the next line also gets a
+meter sign after the clef. Using the previous notation,
+
+       \discretionary{bar meter}{clef meter}{ bar meter }
+
+In GNU Lilypond, we have the same concepts (and the same
+terminology). Each (nonrhythmic) symbol is typeset in  a nonrhythmic column
+At a breakpoint, multiple symbols are printed; symbols to be printed
+if the line is not broken, symbols to appear on the previous line, and
+on the next line if it is broken.
+
+=head1 SPACING
+
+
+Some terminology: I call a vertical group of symbols (notes) which
+start at the same time a "column".  Each line of a score has notes in
+it, grouped in columns. The difference in starting time between those
+columns makes it possible to determine ideal distances between those
+columns.
+
+Example:
+
+       time ----->
+
+       cols:   col1    col2    col3    col4
+
+
+       voice1  1               1
+
+       voice2  2       2       2       2
+
+
+       (1 is a whole note, 2 a half note.)
+
+       time_difference (col1 , col2) = 0.5 wholes,
+       time_difference (col1 , col3) = 1 wholes,
+       time_difference (col2 , col3) = 0.5 wholes,
+       etc.
+
+these differences are translated into ideal distances 
+
+        distance (col1,col2) = 10 pt
+        distance (col1,col3) = 14.1 pt
+        distance (col2,col3) = 10 pt
+        etc.
+
+as you can see, these distance are conflicting. So instead of
+satisfying all those ideals simultaneously, a compromise is sought.
+
+This is Columbus' egg: GNU LilyPond attaches "springs" to each
+column-pair.  each spring has an equilibrium-position which is equal to
+the above mentioned distance, so
+
+spring (col1, col2) and spring (col2,col3) try to push column 1
+and 3 away (to a distance of 20pt) from each other, whereas the spring
+between col 1 and col 3 tries to pull those two together (to a
+distance of 14.1 pt). The net result of this pushing and pulling is an
+equilibrium situation (the pushing cancels the pulling), which can be
+calculated as the solution of Quadratic program: it is the solution
+with minimum potential energy, for you physicists out there.
+
+This algorithm for doing one line, gives a "badness" parameter for
+each line (the potential energy). Now one can use TeX's algorithm for
+making paragraphs (using this new version of "badness"): one should
+try to minimise the overall badness of a paragraph. GNU LilyPond also
+uses the concept of pre- and post-breaks.
+
+(actually, it is a bit more complicated: each column also has a
+minimum distance to other columns, to prevent symbols from running
+into symbols of other columns.)
+
+
+=head1 SPACING 2
+
+
+This of course does not solve the problem of generating the
+springs. This is an area that needs a lot of work, and the optimal
+solution to find is not of a mathematical nature.
+
+Gourlay's solution is used.
+
+
diff --git a/Documentation/lilygut.pod b/Documentation/lilygut.pod
deleted file mode 100644 (file)
index 4d174f1..0000000
+++ /dev/null
@@ -1,319 +0,0 @@
-=head1 NAME
-
-LilyGuts - doco to the internals of GNU LilyPond
-
-=head1 DESCRIPTION
-
-This page documents some aspects of the internals of GNU LilyPond. Some of
-this stuff comes from e-mail I wrote, some from e-mail others wrote,
-some are large comments taken away from the headers. This is why this
-page may be a little incoherent.
-
-You should use doc++ to take a peek at the sources.
-
-This should become a Hacking-HOWTO. If you find any confusing stuff
-here, let me know.  I am a hacker, and don't spend enough time doccing
-what I write. (Most stuff here which refers to the code is slightly outdated)
-
-If you finally have mastered some internal piece of lily, your
-explanation could be added here.
-
-=head1 OVERVIEW
-
-GNU LilyPond is a "multi-pass" system. The different passes have been
-created so that they do not depend on each other. In a later stage
-some parts may be moved into libraries, or seperate programs, or they
-might be integrated in larger systems.
-
-=over 4
-
-=item Parsing:
-
-No difficult algorithms. The .ly file is read, and converted to a list
-of C<Scores>, which each contain C<Music> and paper/midi-definitions.
-
-=item Creating elements
-
-The music is walked column by column. The iterators which do the
-walking report the Request to Translators which use this information
-to create elements, either MIDI or "visual" elements. The translators
-form a hierarchy; the ones for paper output are Engravers, for MIDI
-Performers).
-
-The translators swallow requests, create elements, broadcast them to
-other translators on higher or same level  in the hierarchy:
-
-The stem of a voice A is broadcast to the staff which contains A, but
-not to the noteheads of A, and not to the stems, beams and noteheads
-of a different voice (say B) or a different staff. The stem and
-noteheads of A are coupled, because the the Notehead_engraver
-broadcasts its heads, and the Stem catches these.
-
-The engraver which agrees to handle a request decides whether to to
-honor the request, ignore it, or merge it with other requests. Merging
-of requests is preferably done with other requests done by members of
-the same voicegroups (beams, brackets, stems). In this way you can put
-the voices of 2 instruments in a conductor's score so they make chords
-(the Stem_reqs of both instruments will be merged).
-
-=item Prebreaking
-
-Breakable stuff (eg. clefs and bars) are copied into pre and postbreaks. 
-
-=item Preprocessing
-
-Some dependencies are resolved, such as the direction of stems, beams,
-and "horizontal" placement issues (the order of clefs,  keys etc,
-placement of chords in multi-voice music), 
-
-=item Break calculation:
-
-The lines and horizontal positions of the columns are determined.
-
-=item Breaking
-
-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
-(or, if there are no pieces, the original spanner itself) throws out
-any dependencies which are in the wrong line.
-
-=item Postprocesing:
-
-Some items and all spanners need computation after the PCol positions
-are determined. Examples: slurs, vertical positions of staffs.
-
-=item Output paper
-
-=back
-
-=head1 INTERNALS
-
-This chapter deals with the internals of Mudela. 
-
-=head2 Requests
-
-As you can see, most information is stored in the form of a request. 
-In music typesetting, the user might want to cram a lot more symbols
-on the paper than actually fits. To reflect this idea (the user asks
-more than we can do), the container for this data is called Request.
-
-In a lot of other formats this would be called an 'Event'
-
-=over 4
-
-=item C<Barcheck_req>
-
-Checks during music processing if start of this voice element
-coincides with the start of a measure. Handy to check if you left out
-some voice elts.
-
-=item C<Note_req>
-
-LilyPond has to decide if the ball should be hanging left or
-right. This influences the horizontal dimensions of a column, and this
-is why request processing should be done before horizontal spacing.
-
-Other voices' frivolities may cause the need for accidentals, so this
-is also for the to decide. The engraver can decide on positioning based on
-ottava commands and the appropriate clef.
-
-=item C<Rest_req>
-
-Typeset a rest.
-
-=item C<Span_req>
-
-This type of request typically results in the creation of a C<Spanner>
-
-=item C<Beam_req>
-
-Start/stop a beam.
-
-Engraver has to combine this request with the stem_request, since the
-number of flags that a stem wants to carry will determine the
-number of beams.
-
-=item  C<Dynamic>
-
-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  C<Dynamic> request carries a time, measured
-from the start of its note.
-
-=head2 Voice groups
-
-Voice group is a (time-dependent) collection of voices which share
-some characteristics (slurs, stems) at some time.
-
-=head1 Request_engraver
-
-In the previous section the idea of Request has been explained, but
-this only solves one half of the problem. The other half is
-deciding which requests should be honored, which should merged with
-other requests, and which should be ignored. Consider this (pseudo)input
-
-       < % chord
-               \music { [c() c] }
-               \music { [e() e] }
-       >
-
-Both the c and e are part of a chord (they are in the same
-Voice_group), so they should share the beams, and the two [ ] pairs
-should be merged. The slurs OTOH are specific for each voice, so they
-should not be shared.
-
-The judge in this "allocation" problem a set of broker. It uses the
-C<Request_engraver> to do most of the work.  For each request
-C<Complex_staff> queries so-called C<Request_engraver>s if they want
-to accept a request eg, the C<Notehead_engraver> will accept
-C<Note_req>s, and turn down C<Slur_req>s. If the Music_iterator
-cannot find a engraver that wants the request, it is junked (with a
-warning message).
-
-After all requests have been either assigned, or junked, the Engraver
-will process the requests (which usually means creating an C<Item> or
-C<Spanner>). If a C<Request_engraver> creates something, it tells
-If all requests have been processed, then each Engraver is notified
-of any created Score_element, via a broadcasting system.
-
-=head2 example:
-
-       c4
-
-produces:
-
-       note_request (duration 1/4)
-       stem_request (duration 1/4)
-
-note_request will be taken by a C<Notehead_engraver>, stem_request
-will be taken by a C<Stem_beam_engraver>. C<Notehead_engraver> creates
-a C<Notehead>, C<Stem_beam_engraver> creates a C<Stem>. Both announce
-this to the Staff_engraver. Staff_engraver will tell
-C<Stem_beam_engraver> about the C<Notehead>, which will add the
-C<Notehead> to the C<Stem> it just created.
-
-To decide on merging, several engravers have been grouped. Please
-check F<init/engraver.ly>.
-
-
-=head1 ITEMS and SPANNERS
-
-The symbols that are printed, are generated by items and spanners
-(staff-elements). An item has one horizontal position, whereas a
-spanner spans several columns.
-
-=head1 DEPENDENCIES
-
-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 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, noteheads)
-should be calculated.
-
-=head1 BREAKING
-
-So what is this PREBREAK and POSTBREAK stuff?
-
-Let's take text as an example. In German some compound
-words change their spelling if they are broken: "backen" becomes
-"bak-ken".  TeX has a mechanism to deal with this, you would define
-the spelling of "backen" in TeX in this way
-
-       \discretionary{bak-}{ken}{backen}
-
-These 3 arguments are called "prebreak", "postbreak" and "nobreak"
-text.
-
-The same problem exists when typesetting music. If a line of music is
-broken, the next line usually gets a clef. So in TeX terms, the clef
-is a postbreak. The same thing happens with meter signs: Normally the
-meter follows the bar. If a line is broken at that bar, the bar along
-with the meter stays on the "last" line, but the next line also gets a
-meter sign after the clef. Using the previous notation,
-
-       \discretionary{bar meter}{clef meter}{ bar meter }
-
-In GNU Lilypond, we have the same concepts (and the same
-terminology). Each (nonrhythmic) symbol is typeset in  a nonrhythmic column
-At a breakpoint, multiple symbols are printed; symbols to be printed
-if the line is not broken, symbols to appear on the previous line, and
-on the next line if it is broken.
-
-=head1 SPACING
-
-
-Some terminology: I call a vertical group of symbols (notes) which
-start at the same time a "column".  Each line of a score has notes in
-it, grouped in columns. The difference in starting time between those
-columns makes it possible to determine ideal distances between those
-columns.
-
-Example:
-
-       time ----->
-
-       cols:   col1    col2    col3    col4
-
-
-       voice1  1               1
-
-       voice2  2       2       2       2
-
-
-       (1 is a whole note, 2 a half note.)
-
-       time_difference (col1 , col2) = 0.5 wholes,
-       time_difference (col1 , col3) = 1 wholes,
-       time_difference (col2 , col3) = 0.5 wholes,
-       etc.
-
-these differences are translated into ideal distances 
-
-        distance (col1,col2) = 10 pt
-        distance (col1,col3) = 14.1 pt
-        distance (col2,col3) = 10 pt
-        etc.
-
-as you can see, these distance are conflicting. So instead of
-satisfying all those ideals simultaneously, a compromise is sought.
-
-This is Columbus' egg: GNU LilyPond attaches "springs" to each
-column-pair.  each spring has an equilibrium-position which is equal to
-the above mentioned distance, so
-
-spring (col1, col2) and spring (col2,col3) try to push column 1
-and 3 away (to a distance of 20pt) from each other, whereas the spring
-between col 1 and col 3 tries to pull those two together (to a
-distance of 14.1 pt). The net result of this pushing and pulling is an
-equilibrium situation (the pushing cancels the pulling), which can be
-calculated as the solution of Quadratic program: it is the solution
-with minimum potential energy, for you physicists out there.
-
-This algorithm for doing one line, gives a "badness" parameter for
-each line (the potential energy). Now one can use TeX's algorithm for
-making paragraphs (using this new version of "badness"): one should
-try to minimise the overall badness of a paragraph. GNU LilyPond also
-uses the concept of pre- and post-breaks.
-
-(actually, it is a bit more complicated: each column also has a
-minimum distance to other columns, to prevent symbols from running
-into symbols of other columns.)
-
-
-=head1 SPACING 2
-
-
-This of course does not solve the problem of generating the
-springs. This is an area that needs a lot of work, and the optimal
-solution to find is not of a mathematical nature.
-
-Gourlay's solution is used.
-
-
diff --git a/Documentation/lilyliterature.pod b/Documentation/lilyliterature.pod
deleted file mode 100644 (file)
index 5bba17b..0000000
+++ /dev/null
@@ -1,296 +0,0 @@
-=head1 NAME
-
-Lily Literature -- reading on music engraving/typesetting/etc.
-
-=head1 DESCRIPTION
-
-A list of resources on music printing/writing and engraving.  Please
-note that don't have access to most material.
-
-[Personal comments appear in brackets.  What I (HWN) know, I've
-commented myself. They are just my personal comments, not to be taken
-too seriously]
-
-=head2 Music engraving: references
-
-Helene Wanske.  ``Musiknotation --- Von der Syntax des Notenstichs zum
-EDV-gesteuerten Notensatz'', Schott-Verlag, Mainz 1988.ISBN 3-7957-2886-x.
-
-[I. A very thorough overview of engraving practices of various
-craftsmen. It includes detailed specs of characters, dimensions etc.
-II. a thorough overview of a (by now antiquated) automated system
-called Ikarus; EDV Means e(lektronischen) D(aten)v(erarbeitung),
-electronic data processing HWN]
-
-Maxwell Weaner and Walter Boelke, Standard Music Notation Practice,
-revised edition by Arnold Broido and Daniel Dorff. Music Publisher's
-Association of the United States Inc., 1993.
-
-Ted Ross. ``Teach yourself the art of music engraving and processing''
-(3rd edition). Hansen House, Miami Beach, FLorida.
-
-[This is about I<engraving> i.e. professional music typesetting, and
-includes some good spacing tables MB]
-
-Gardner Read. ``Modern Rhythmic Notation.'' Indiana University Press,
-1978.
-
-Gardner Read. ``Music Notation'' (2nd edition). Taplinger Publishing,
-New York.
-
-[This is as close to the ``standard'' reference work for music
-notation issues as one is likely to get. MB]
-
-K. Hader. ``Aus der Werkstatt eines Notenstechers'' Waldheim--Eberle
-Verlag, Vienna 1948
-
-MPA. Standard music notation specifications for computer programming.
-December 1996
-
-[Pamphlet explaining some fine points in music font design HWN]
-
-
-=head2 Notation with computers
-
-Donald Byrd.  ``Music Notation by Computer''.  Dissertation Indiana
-University, 1985.
-
-Donald Byrd.  ``A System for Music Printing by Computer.''  Computers
-and the Humanities, 8 (1974), 161-72.
-
-Leland Smith.  ``Editing and Printing Music by Computer.''  Journal of
-Music Theory, 17 (1973), 292-309.
-
-[If I remember correctly, this was concerned more with an input
-language than with the typography. SP.]
-
-David A Gomberg.  ``A Computer-Oriented System for Music Printing.''
-Dissertation Washington University. 1975.
-
-Walter B Hewlett. and Eleanor Selfridge-Field.  ``Directory of Computer
-Assisted Research in Musicology''.  Menlo Park, CA: Center for Computer
-Assisted Research in the Humanities.
-
-[Annual editions since 1985, many containing surveys of music
-typesetting technology. SP]
-
-David A.  Gomberg; ``A Computer-oriented System for Music Printing.''
-Computers and the Humanities, Vol.11, pp 63-80.
-
-John S. Gourlay. ``Spacing a Line of Music,'' Technical Report
-OSU-CISRC-10/87-TR35, Department of Computer and Information Science,
-The Ohio State University, 1987.
-
-[Algorithm for generating spacing in one line of (polyphonic) music,
-tailored for use with MusiCopy. LilyPond uses a variant of it (as of
-pl 76) HWN]
-
-Allen Parish, Wael A. Hegazy, John S. Gourlay, Dean K. Roush and
-F. Javier Sola. ``MusiCopy: An automated Music Formatting System''.
-Technical Report OSU-CISRC-10/87-TR29, Department of Computer and
-Information Science, The Ohio State University, 1987.
-
-[A brief overview of MusiCopy HWN]
-
-John S. Gourlay, A. Parrish, D. Roush, F. Sola, Y. Tien. ``Computer
-Formatting of Music,'' Technical Report OSU-CISRC-2/87-TR3, Department
-of Computer and Information Science, The Ohio State University, 1987.
-
-[This paper discusses the development of algorithms for the formatting
-of musical scores (from abstract). It also appeared at PROTEXT III,
-Ireland 1986]
-
-Wael A. Hegazy. ``On the Implementation of the MusiCopy Language
-Processor,'' Technical Report OSU-CISRC-10/87-TR34, Department of
-Computer and Information Science, The Ohio State University, 1987.
-
-[Describes the "parser" which converts MusiCopy MDL  to MusiCopy
-Simultaneities & columns HWN]
-
-Wael A. Hegazy and John S. Gourlay. ``Optimal line breaking in
-music''.  Technical Report OSU-CISRC-8/87-TR33, Department of Computer
-and Information Science, The Ohio State University, 1987
-
-[This generalizes TeX's breaking algorithm to music. It also appeared in
-Document Manipulation and Typography, J.C. van Vliet (ed) 1988. HWN]
-
-Dean K. Roush. ``Using MusiCopy''. Technical Report
-OSU-CISRC-18/87-TR31, Department of Computer and Information Science,
-The Ohio State University, 1987
-
-[User manual of MusiCopy. Includes an impressive example piece.  HWN.]
-
-A. Parrish and John S. Gourlay. ``Computer Formatting of Musical
-Simultaneities,'' Technical Report OSU-CISRC-10/87-TR28, Department of
-Computer and Information Science, The Ohio State University, 1987.
-
-[Placement of balls, stems, dots which occur at the same moment
-("Simultaneity") HWN]
-
-D. Roush. ``Music Formatting Guidelines,'' Technical Report
-OSU-CISRC-3/88-TR10, Department of Computer and Information Science,
-The Ohio State University, 1988.
-
-[Rules on formatting music formulated for use in computers HWN]
-
-F. Sola. ``Computer Design of Musical Slurs, Ties and Phrase Marks,''
-Technical Report OSU-CISRC-10/87-TR32, Department of Computer and
-Information Science, The Ohio State University, 1987.
-
-[Overview of a procedure for generating slurs HWN]
-
-F. Sola and D. Roush. ``Design of Musical Beams,'' Technical Report
-OSU-CISRC-10/87-TR30, Department of Computer and Information Science,
-The Ohio State University, 1987.
-
-[Calculating beam slopes HWN]
-
-John. S. Gourlay. ``A language for music printing'', Communications
-of the ACM, Vol. 29(5), 388--401, 1986.
-
-[This paper describes the MusiCopy musicsetting system and an input
-language to go with it. HWN]
-
-Dorothea Blostein and Lippold Haken, ``The Lime Music Editor: A Diagram
-Editor Involving Complex Translations'', Software Practice and
-Experience, Vol. 24, No. 3, March 1994, pp. 289-306.
-
-[A description of various conversions, decisions and issues relating
-to this interactive editor HWN]
-
-Lippold Haken and Dorothea Blostein, ``The Tilia Music Representation:
-Extensibility, Abstraction, and Notation Contexts for the Lime Music
-Editor'', Computer Music Journal, Vol. 17, No. 3, 1993, pp. 43-58
-
-[A description of Lime internals (which resemble older (before
-0.0.68pre) LilyPond data structures somewhat) HWN]
-
-Lippold Haken and Dorothea Blostein, ``A New Algorithm for Horizontal
-Spacing of Printed Music'', International Computer Music Conference,
-Banff, Sept. 1995, pp. 118-119.
-
-[This describes an algorithm which uses springs between adjacent
-columns. This algorithm is a "subclass" of the LilyPond algorithm. HWN]
-
-Dorothea Blostein and Lippold Haken, ``Justification of Printed Music'',
-Communications of the ACM, VolJ34, No. 3, March 1991, pp. 88-99.
-
-[This paper provides a shallow overview of the algorithm used in LIME
-for spacing individual lines. HWN]
-
-Gary M. Rader. ``Creating Printed Music Automatically''. Computer Vol
-29(6), June 1996, pp 61--69.
-
-[Describes a system called MusicEase, and explains that it uses
-"constraints" (which go unexplained) to automatically position various
-elements. HWN]
-
-Stephen Dowland Page.  ``Computer Tools for Music Information
-Retrieval''.  Dissertation University of Oxford, 1988.
-
-[Don't ask Stephen for a copy. Write to the Bodleian Library, Oxford,
-or to the British Library, instead. SP]
-
-Ren\'e Roelofs. ``Een Geautomatiseerd Systeem voor het Afdrukken van
-Muziek'' afstudeerscriptie Bestuurlijke informatica, no 45327, Erasmus
-universiteit Rotterdam, 1991.  (``An automated system for printing
-music'' Master's Thesis Managerial Computer Science.)
-
-[This dutch thesis describes a simplistic (monophonic) typesetting system,
-and focuses on the breaking algorithm, which is taken from Hegazy &
-Gourlay HWN]
-
-Miguel Filgueiras and Jos\'e Paulo Leal. ``Representation and
-manipulation of music documents in SceX''.  Electronic Publishing,
-vol. 6 (4), 507--518, 1993.
-
-Eric Foxley, Music --- A language for typesetting music scores.
-Software --- Practice and Experience, Vol. 17(8), 485--502, 1987.
-
-[A paper on a TROFF preprocessor to typeset music. The output shown is
-not very sophisticated, and contains some typographical atrocities HWN]
-
-Miguel Filgueiras, ``Implementing a Symbolic Music Processing
-System''. LIACC, Universidade do Porto, 1996; submitted.
-
-Miguel Filgueiras, ``Some Music Typesetting Algorithms''. LIACC,
-Universidade do Porto, forthcoming.
-
-=head2 Engraving: further reading
-
-Herbert Chlapik. ``Die Praxis des Notengraphikers''. Doblinger, 1987.
-ISBN 3-9000 035-96-2.
-
-[An clearly written book for the casually interested reader. It shows
-some of the conventions and difficulties in printing music HWN]
-
-The University of Colorado Music Engraving page.
-http://obenamots.cc.colorado.edu/Musicpress/engraving.html
-
-Anthony Donato. Preparing Music Manuscript. Englewood Cliffs:
-Prentice-Hall, 1963.
-
-Donemus. ``Uitgeven van muziek''. Donemus Amsterdam, 1900
-
-George Heussenstamm. The Norton Manual of Music Notation. New York:
-Norton, 1987.
-
-Erdhard Karkoshka. ``Notation in New Music. Trans. Ruth
-Koenig''. Praeger Publishers, New York, 1972.  Out of print.
-
-C. Roemer, The Art of Music Copying. Roerick music co., Sherman Oaks
-(CA), 1973.
-
-Glen Rosecrans. Music Notation Primer. New York: Passantino, 1979.
-
-Kurt Stone. Music Notation in the Twentieth Century. New York: Norton,
-1980.
-
-
-=head2 Other stuff
-
-
-More on GNU Music:
-http://dept-info.labri.u-bordeaux.fr/~strandh/Gsharp
-
-Peter S. Langston, ``Unix music tools at Bellcore''.  Software ---
-Practice and Experience, Vol. 20(S1), S1/47--S1/61, 1990.
-
-[This paper deals with some command-line tools for music editing and
-playback. It doesn't mention notation issues, but does come with the
-grand idea (not) of using music to monitor complex systems. Imagine
-your nuclear plant supervisor to use AC/DC for checking the reactor HWN]
-
-
-=head2 File formats
-
-Tablature: http://wabakimi.carleton.ca/~phacket2/guitar/tabfaq.html
-
-Cindy Grande, NIFF6a Notation Interchange File Format.  Grande
-Software Inc., 1995.  ftp://blackbox.cartah.washington.edu/pub/,
-http://www.jtauber.com/music/encoding/niff/
-
-[Specs for NIFF, a comprehensive but binary (yuk) format for notation HWN]
-
-SMDL, Standard Musical Description Language 
-ftp://ftp.ornl.gov/pub/sgml/wg8/smdl/10743.pdf
-
-MPDL,
-
-HMSL, Hierarchical Music Structured Language, 
-
-DARMS, 
-
-enigma, 
-
-SCORE,
-
-
-=head1 AUTHORS
-
-References and comments contributed by Han-Wen Nienhuys (HWN), Miguel
-Filgueiras, Mark Basinski (MB), Dorothea Blostein, Stephen Page (SP),
-Jan Nieuwenhuizen, Peter Kerr.
-
-This should really be redone in BibTeX
-
index faa26928e4363234050abdb7608c4d73bbf6c7e5..c2d26569354600196d85ced6763d45a837a60b9f 100644 (file)
@@ -10,7 +10,7 @@ lilypond - the GNU music typesetter
 
 GNU LilyPond is a program which converts music definition files into
 visual or auditive output: it can typeset formatted sheet music to a
-TeX file and and (mechanical) performances to MIDI files.
+TeX file and play (mechanical) performances to MIDI files.
 
 =head1 OPTIONS
 
@@ -22,12 +22,12 @@ add F<FILE> to the search path for input files.
 
 =item B<-M,--midi>
 
-do midi output only
+do midi output only.
 
 =item B<-d,--debug>,
 
-Turn debugging info. GNU LilyPond will read the file F<.dstreamrc>, which
-tells for what functions and classes may produce copious debugging
+Turn debugging info on.  GNU LilyPond reads the file F<.dstreamrc>, 
+which lists what functions and classes may produce copious debugging
 output.
 
 =item B<-w,--warranty>,
@@ -41,11 +41,11 @@ Set the default output file to F<FILE>.
 
 =item B<-h,--help>,
 
-Show a summary of usage
+Show a summary of usage.
 
 =item B<-i,--init=>F<FILE>
 
-set init file to F<FILE> (default: F<symbol.ly>)
+set init file to F<FILE> (default: F<symbol.ly>).
 
 =item B<--include, -I>=F<DIRECTORY>
 
@@ -53,21 +53,21 @@ add F<DIRECTORY> to the search path for input files.
 
 =item B<--ignore-version, -V>
 
-make incompatible mudela version non-fatal 
+make incompatible mudela version non-fatal.
 
 =back
 
 =head1 FEATURES
 
-This is an overview of the features that GNU LilyPond supports. For
-details on how to use them, you should consult mudela(5)
+This is an overview of the features that GNU LilyPond supports.  For
+details on how to use them, you should consult mudela(5).
 
 =over 5
 
 =item *
 
 ASCII script input, with identifiers (for music reuse),
-customizable notenames, customizable fontset
+customizable notenames, customisable fontset.
 
 =item *
 
@@ -79,7 +79,7 @@ MIDI to Mudela conversion through the mi2mu program.
 
 =item *
 
-Multiple staffs in one score. Each staff can have a different meters.
+Multiple staffs in one score.  Each staff can have a different meters.
 
 =item *
 
@@ -90,11 +90,11 @@ transposition dynamics (both absolute and hairpin style)
 =item *
 
 multiple voices within one staff; beams optionally shared
-between voices. Up to four voices is handled cleanly.
+between voices.  Up to four voices is handled cleanly.
 
 =item *
 
-multiple scores within one input file. Each score is output to
+multiple scores within one input file.  Each score is output to
 a different file.
 
 =item *
@@ -105,11 +105,11 @@ clef changes, meter changes, cadenza-mode, key changes, repeat bars
 
 =head1 DISCLAIMER & COPYING POLICY
 
-GNU LilyPond is copyright 1996,97 by its authors. GNU LilyPond is
-distributed under the terms of the GNU General Public
-License. GNU LilyPond is provided without any warranty what so ever.
-GNU LilyPond may be freely distributed.  For further information consult
-the GNU General Public License, which is in the file F<COPYING>
+GNU LilyPond is copyright 1996, 1997 by its authors.  GNU LilyPond is
+distributed under the terms of the GNU General Public License.  GNU LilyPond 
+is provided without any warranty what so ever.
+GNU LilyPond may be freely distributed.  For further information consult 
+the GNU General Public License, from the file F<COPYING>.
 
 =head1 AUTHORS
 
@@ -132,7 +132,7 @@ Jan Nieuwenhuizen <jan@digicash.com>,  http://www.digicash.com/~jan.
 =head1 PROBLEMS
 
 
-There is an extensive list of todoes and bugs. See F<TODO>. In
+There is an extensive list of todoes and bugs.  See F<TODO>.  In
 general, try to find out 
 
 =over 4
@@ -159,7 +159,7 @@ send a description of the platform you use
 
 =item *
 send a description of the LilyPond version you use (with
-compile/config options please)
+compile/configure options please)
 
 =item *
 send a description of the bug itself.
@@ -171,8 +171,8 @@ send it to bug-gnu-music@vuse.vanderbilt.edu
 
 It does help if you can find out where the bug comes from: if GNU
 LilyPond bombs out, then please recompile using with debugging info
-turned on, and send gdb stacktrace of the crash. It also helps if you
-can print the values of the objects. So if your trace is
+turned on, and send gdb stacktrace of the crash.  It also helps if you
+can print the values of the objects.  So if your trace is
 
        received SIGSEGV 
        (gdb) backtrace 12
@@ -193,7 +193,7 @@ Than it would help if you send a dump of the Interval and the Item
 
 =item F<symbol.ly>
 
-The initialisation file with symbol tables etc. It
+The initialisation file with symbol tables etc.  It
 includes files from the directory F<init/>.
 
 =back
@@ -214,7 +214,7 @@ On technical details of LilyPond
 
 =item mudela-man
 
-On the input format. This is a LilyPond-enhanced LaTeX document.
+On the input format.  This is a LilyPond-enhanced LaTeX document.
 
 =item MANIFESTO
 
@@ -227,7 +227,7 @@ The GNU LilyPond FAQ list
 =item http://www.stack.nl/~hanwen/lilypond/index.html
 
 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
+and PS files for some standard music files.  It also has the complete
 LilyPond documentation
 
 =back
@@ -235,7 +235,7 @@ LilyPond documentation
 GNU LilyPond is
 updated very frequently, the latest version is always available at:
 ftp://pcnov095.win.tue.nl/pub/lilypond and
-ftp://alpha.gnu.ai.mit.edu/gnu/
+ftp://alpha.gnu.ai.mit.edu/gnu/lilypond/
 
 
 For programs which are part of the GNU music project, the following
@@ -251,13 +251,13 @@ subject "subscribe" to info-gnu-music-request@vuse.vanderbilt.edu
 
 =item help-gnu-music@vuse.vanderbilt.edu
 
-For help with programs from the GNU music project. To subscribe: send
+For help with programs from the GNU music project.  To subscribe: send
 mail with subject "subscribe" to
 help-gnu-music-request@vuse.vanderbilt.edu
 
 =item bug-gnu-music@vuse.vanderbilt.edu
 
-If you have bugreports, you should send them to this list. If you want
+If you have bugreports, you should send them to this list.  If you want
 to read all bugreports, you should subscribe to this list.  To
 subscribe: send mail with subject "subscribe" to
 bug-gnu-music-request@vuse.vanderbilt.edu
@@ -284,19 +284,19 @@ than the names being similar :-)
 (for a  detailed changelog, see F<NEWS>)
 
 GNU LilyPond's roots lie in MPP, a preprocessor to the rather arcane
-MusiXTeX macro package for TeX. A friend of mine, Jan Nieuwenhuizen
+MusiXTeX macro package for TeX.  A friend of mine, Jan Nieuwenhuizen
 wrote the first 44 versions (0.01 to 0.44), then his program caught my
 attention, and I was slowly sucked in to the interesting problem of
-easily producing beautifully printed music. I contributed some
-code. We soon realised that MPP's design was too fundamentally broken
+easily producing beautifully printed music.  I contributed some
+code.  We soon realised that MPP's design was too fundamentally broken
 to be repaired, so it was decided to rewrite MPP.  We debated a lot about
-the requirements to an inputformat (fall 1995). I sat down and started
+the requirements to an inputformat (fall 1995).  I sat down and started
 with a parser-first, bottom-up rewrite called mpp95 (which totally
 failed, obviously).
 
 After long and hard thinking, I came up with an algorithm for the
 horizontal spacing of multiple staffs (april 1996) I coded it (and did
-not test it). After starting with this fundamental piece, I slowly
+not test it).  After starting with this fundamental piece, I slowly
 added the stages which come before spacing, and after.  A half year
 later, I had a first working version, (october 1996).  I announced
 Patchlevel 0.0.7 (or 8) to the mutex list after asking some technical
@@ -304,7 +304,7 @@ details on spacing; it was downloaded approximately 4 times.  Then I
 got the hang of it, and in the subsequent two months, I coded until it
 had doubled in size (pl 23).
 
-Most the other history is described in the NEWS file. The first large
+Most the other history is described in the NEWS file.  The first large
 scale release (0.1) was done after approximately 78 patchlevels on
 August 1, 1997.
 
index c5fadae0039c659270541df97790947087e61474..ab1adf7a3e1d690a221a4c67ad9d4ea8edfe1235 100644 (file)
@@ -16,6 +16,11 @@ of interest to LilyPond users.
 LilyPond is part of the GNU Project started by the Free Software
 Foundation to create a system of free software for the world-community
 
+=item http://www.zib.de/Visual/software/doc++/index.html
+
+The documentation system for C++ sources, which the LilyPond sources use.
+
+
 =back
 
 =head2 Ftp 
@@ -34,8 +39,8 @@ An ftp site which is in CTAN.
 
 =item ftp://ftp.redhat.com/pub/contrib/
 
-RedHat Software develops and markets a GNU/Linux distribution (of
-which we are avid users)
+The FTP site of RedHat Software.
+
 
 =back
 
@@ -45,7 +50,7 @@ Beta releases will also be at
 
 =item ftp://pcnov095.win.tue.nl/pub/lilypond
 
-=item ftp://alpha.gnu.ai.mit.edu/gnu/
+=item ftp://alpha.gnu.ai.mit.edu/gnu/lilypond/
 
 =back
 
@@ -73,8 +78,9 @@ mailing list have been setup:
 
 =item info-gnu-music@vuse.vanderbilt.edu
 
-For information on the GNU Music project, to subscribe: send mail with
-subject "subscribe" to info-gnu-music-request@vuse.vanderbilt.edu
+A moderated list for information on the GNU Music project, to
+subscribe: send mail with subject "subscribe" to
+info-gnu-music-request@vuse.vanderbilt.edu
 
 =item help-gnu-music@vuse.vanderbilt.edu
 
@@ -93,7 +99,7 @@ bug-gnu-music-request@vuse.vanderbilt.edu
 
 For discussions concerning the GNU Music project, to subscribe: send
 mail with subject "subscribe" to
-gnu-music-discuss-request@vuse.vanderbilt.edu,
+gnu-music-discuss-request@vuse.vanderbilt.edu
 
 =back
 
@@ -126,4 +132,10 @@ The Linux webwatcher.
 Transcriptions of the music of Thomas Ravenscroft, partly using
 LilyPond
 
+=item http://www.redhat.com/
+
+develops and markets a GNU/Linux distribution (of
+which we are avid users)
+
+
 =back
diff --git a/Documentation/literature.pod b/Documentation/literature.pod
new file mode 100644 (file)
index 0000000..f96915a
--- /dev/null
@@ -0,0 +1,298 @@
+=head1 NAME
+
+Lily Literature -- reading on music engraving/typesetting/etc.
+
+=head1 DESCRIPTION
+
+A list of resources on music printing/writing and engraving.  Please
+note that don't have access to most material.
+
+[Personal comments appear in brackets.  What I (HWN) know, I've
+commented myself. They are just my personal comments, not to be taken
+too seriously]
+
+=head2 Music engraving: references
+
+Helene Wanske.  ``Musiknotation --- Von der Syntax des Notenstichs zum
+EDV-gesteuerten Notensatz'', Schott-Verlag, Mainz 1988.ISBN 3-7957-2886-x.
+
+[I. A very thorough overview of engraving practices of various
+craftsmen. It includes detailed specs of characters, dimensions etc.
+II. a thorough overview of a (by now antiquated) automated system
+called Ikarus; EDV Means e(lektronischen) D(aten)v(erarbeitung),
+electronic data processing HWN]
+
+Maxwell Weaner and Walter Boelke, Standard Music Notation Practice,
+revised edition by Arnold Broido and Daniel Dorff. Music Publisher's
+Association of the United States Inc., 1993.
+
+Ted Ross. ``Teach yourself the art of music engraving and processing''
+(3rd edition). Hansen House, Miami Beach, FLorida.
+
+[This is about I<engraving> i.e. professional music typesetting, and
+includes some good spacing tables MB]
+
+Gardner Read. ``Modern Rhythmic Notation.'' Indiana University Press,
+1978.
+
+Gardner Read. ``Music Notation'' (2nd edition). Taplinger Publishing,
+New York.
+
+[This is as close to the ``standard'' reference work for music
+notation issues as one is likely to get. MB]
+
+K. Hader. ``Aus der Werkstatt eines Notenstechers'' Waldheim--Eberle
+Verlag, Vienna 1948
+
+MPA. Standard music notation specifications for computer programming.
+December 1996
+
+[Pamphlet explaining some fine points in music font design HWN]
+
+
+=head2 Notation with computers
+
+Donald Byrd.  ``Music Notation by Computer''.  Dissertation Indiana
+University, 1985.
+
+Donald Byrd.  ``A System for Music Printing by Computer.''  Computers
+and the Humanities, 8 (1974), 161-72.
+
+Leland Smith.  ``Editing and Printing Music by Computer.''  Journal of
+Music Theory, 17 (1973), 292-309.
+
+[If I remember correctly, this was concerned more with an input
+language than with the typography. SP.]
+
+David A Gomberg.  ``A Computer-Oriented System for Music Printing.''
+Dissertation Washington University. 1975.
+
+Walter B Hewlett. and Eleanor Selfridge-Field.  ``Directory of Computer
+Assisted Research in Musicology''.  Menlo Park, CA: Center for Computer
+Assisted Research in the Humanities.
+
+[Annual editions since 1985, many containing surveys of music
+typesetting technology. SP]
+
+David A.  Gomberg; ``A Computer-oriented System for Music Printing.''
+Computers and the Humanities, Vol.11, pp 63-80.
+
+John S. Gourlay. ``Spacing a Line of Music,'' Technical Report
+OSU-CISRC-10/87-TR35, Department of Computer and Information Science,
+The Ohio State University, 1987.
+
+[Algorithm for generating spacing in one line of (polyphonic) music,
+tailored for use with MusiCopy. LilyPond uses a variant of it (as of
+pl 76) HWN]
+
+Allen Parish, Wael A. Hegazy, John S. Gourlay, Dean K. Roush and
+F. Javier Sola. ``MusiCopy: An automated Music Formatting System''.
+Technical Report OSU-CISRC-10/87-TR29, Department of Computer and
+Information Science, The Ohio State University, 1987.
+
+[A brief overview of MusiCopy HWN]
+
+John S. Gourlay, A. Parrish, D. Roush, F. Sola, Y. Tien. ``Computer
+Formatting of Music,'' Technical Report OSU-CISRC-2/87-TR3, Department
+of Computer and Information Science, The Ohio State University, 1987.
+
+[This paper discusses the development of algorithms for the formatting
+of musical scores (from abstract). It also appeared at PROTEXT III,
+Ireland 1986]
+
+Wael A. Hegazy. ``On the Implementation of the MusiCopy Language
+Processor,'' Technical Report OSU-CISRC-10/87-TR34, Department of
+Computer and Information Science, The Ohio State University, 1987.
+
+[Describes the "parser" which converts MusiCopy MDL  to MusiCopy
+Simultaneities & columns HWN]
+
+Wael A. Hegazy and John S. Gourlay. ``Optimal line breaking in
+music''.  Technical Report OSU-CISRC-8/87-TR33, Department of Computer
+and Information Science, The Ohio State University, 1987
+
+[This generalizes TeX's breaking algorithm to music. It also appeared in
+Document Manipulation and Typography, J.C. van Vliet (ed) 1988. HWN]
+
+Dean K. Roush. ``Using MusiCopy''. Technical Report
+OSU-CISRC-18/87-TR31, Department of Computer and Information Science,
+The Ohio State University, 1987
+
+[User manual of MusiCopy. Includes an impressive example piece.  HWN.]
+
+A. Parrish and John S. Gourlay. ``Computer Formatting of Musical
+Simultaneities,'' Technical Report OSU-CISRC-10/87-TR28, Department of
+Computer and Information Science, The Ohio State University, 1987.
+
+[Placement of balls, stems, dots which occur at the same moment
+("Simultaneity") HWN]
+
+D. Roush. ``Music Formatting Guidelines,'' Technical Report
+OSU-CISRC-3/88-TR10, Department of Computer and Information Science,
+The Ohio State University, 1988.
+
+[Rules on formatting music formulated for use in computers HWN]
+
+F. Sola. ``Computer Design of Musical Slurs, Ties and Phrase Marks,''
+Technical Report OSU-CISRC-10/87-TR32, Department of Computer and
+Information Science, The Ohio State University, 1987.
+
+[Overview of a procedure for generating slurs HWN]
+
+F. Sola and D. Roush. ``Design of Musical Beams,'' Technical Report
+OSU-CISRC-10/87-TR30, Department of Computer and Information Science,
+The Ohio State University, 1987.
+
+[Calculating beam slopes HWN]
+
+John. S. Gourlay. ``A language for music printing'', Communications
+of the ACM, Vol. 29(5), 388--401, 1986.
+
+[This paper describes the MusiCopy musicsetting system and an input
+language to go with it. HWN]
+
+Dorothea Blostein and Lippold Haken, ``The Lime Music Editor: A Diagram
+Editor Involving Complex Translations'', Software Practice and
+Experience, Vol. 24, No. 3, March 1994, pp. 289-306.
+
+[A description of various conversions, decisions and issues relating
+to this interactive editor HWN]
+
+Lippold Haken and Dorothea Blostein, ``The Tilia Music Representation:
+Extensibility, Abstraction, and Notation Contexts for the Lime Music
+Editor'', Computer Music Journal, Vol. 17, No. 3, 1993, pp. 43-58
+
+[A description of Lime internals (which resemble older (before
+0.0.68pre) LilyPond data structures somewhat) HWN]
+
+Lippold Haken and Dorothea Blostein, ``A New Algorithm for Horizontal
+Spacing of Printed Music'', International Computer Music Conference,
+Banff, Sept. 1995, pp. 118-119.
+
+[This describes an algorithm which uses springs between adjacent
+columns. This algorithm is a "subclass" of the LilyPond algorithm. HWN]
+
+Dorothea Blostein and Lippold Haken, ``Justification of Printed Music'',
+Communications of the ACM, VolJ34, No. 3, March 1991, pp. 88-99.
+
+[This paper provides a shallow overview of the algorithm used in LIME
+for spacing individual lines. HWN]
+
+Gary M. Rader. ``Creating Printed Music Automatically''. Computer Vol
+29(6), June 1996, pp 61--69.
+
+[Describes a system called MusicEase, and explains that it uses
+"constraints" (which go unexplained) to automatically position various
+elements. HWN]
+
+Stephen Dowland Page.  ``Computer Tools for Music Information
+Retrieval''.  Dissertation University of Oxford, 1988.
+
+[Don't ask Stephen for a copy. Write to the Bodleian Library, Oxford,
+or to the British Library, instead. SP]
+
+Ren\'e Roelofs. ``Een Geautomatiseerd Systeem voor het Afdrukken van
+Muziek'' afstudeerscriptie Bestuurlijke informatica, no 45327, Erasmus
+universiteit Rotterdam, 1991.  (``An automated system for printing
+music'' Master's Thesis Managerial Computer Science.)
+
+[This dutch thesis describes a simplistic (monophonic) typesetting system,
+and focuses on the breaking algorithm, which is taken from Hegazy &
+Gourlay HWN]
+
+Miguel Filgueiras and Jos\'e Paulo Leal. ``Representation and
+manipulation of music documents in SceX''.  Electronic Publishing,
+vol. 6 (4), 507--518, 1993.
+
+Eric Foxley, Music --- A language for typesetting music scores.
+Software --- Practice and Experience, Vol. 17(8), 485--502, 1987.
+
+[A paper on a TROFF preprocessor to typeset music. The output shown is
+not very sophisticated, and contains some typographical atrocities HWN]
+
+Miguel Filgueiras, ``Implementing a Symbolic Music Processing
+System''. LIACC, Universidade do Porto, 1996; submitted.
+
+Miguel Filgueiras, ``Some Music Typesetting Algorithms''. LIACC,
+Universidade do Porto, forthcoming.
+
+=head2 Engraving: further reading
+
+Herbert Chlapik. ``Die Praxis des Notengraphikers''. Doblinger, 1987.
+ISBN 3-9000 035-96-2.
+
+[An clearly written book for the casually interested reader. It shows
+some of the conventions and difficulties in printing music HWN]
+
+The University of Colorado Music Engraving page.
+http://obenamots.cc.colorado.edu/Musicpress/engraving.html
+
+Anthony Donato. Preparing Music Manuscript. Englewood Cliffs:
+Prentice-Hall, 1963.
+
+Donemus. ``Uitgeven van muziek''. Donemus Amsterdam, 1900
+
+George Heussenstamm. The Norton Manual of Music Notation. New York:
+Norton, 1987.
+
+Erdhard Karkoshka. ``Notation in New Music. Trans. Ruth
+Koenig''. Praeger Publishers, New York, 1972.  Out of print.
+
+C. Roemer, The Art of Music Copying. Roerick music co., Sherman Oaks
+(CA), 1973.
+
+Glen Rosecrans. Music Notation Primer. New York: Passantino, 1979.
+
+Kurt Stone. Music Notation in the Twentieth Century. New York: Norton,
+1980.
+
+
+=head2 Other stuff
+
+
+Peter S. Langston, ``Unix music tools at Bellcore''.  Software ---
+Practice and Experience, Vol. 20(S1), S1/47--S1/61, 1990.
+
+[This paper deals with some command-line tools for music editing and
+playback. It doesn't mention notation issues, but does come with the
+grand idea (not) of using music to monitor complex systems. Imagine
+your nuclear plant supervisor to use AC/DC for checking the reactor HWN]
+
+
+=head2 File formats
+
+Tablature: http://wabakimi.carleton.ca/~phacket2/guitar/tabfaq.html
+
+Cindy Grande, NIFF6a Notation Interchange File Format.  Grande
+Software Inc., 1995.  ftp://blackbox.cartah.washington.edu/pub/,
+http://www.jtauber.com/music/encoding/niff/
+
+[Specs for NIFF, a comprehensive but binary (yuk) format for notation HWN]
+
+SMDL, Standard Musical Description Language,
+ftp://ftp.ornl.gov/pub/sgml/wg8/smdl/10743.pdf. ISO/IEC DIS 10743. 
+
+[An ISO defined SGML language. A much more thorough treatment of music
+definition than Mudela  (but not suited for manual entry). It deals
+with notation and perfomance issues by (basically) saying "You can
+embed a MIDI or NIFF file" (sic) HWN]
+
+MPDL,
+
+HMSL, Hierarchical Music Structured Language, 
+
+DARMS, 
+
+enigma, 
+
+SCORE,
+
+
+=head1 AUTHORS
+
+References and comments contributed by Han-Wen Nienhuys (HWN), Miguel
+Filgueiras, Mark Basinski (MB), Dorothea Blostein, Stephen Page (SP),
+Jan Nieuwenhuizen, Peter Kerr.
+
+This should really be redone in BibTeX
+
index 77a68f1f529298443a8749f02655eb21d825b5b2..1e35a7547a58be07cba89b078930dc4c8cc05162 100644 (file)
@@ -80,11 +80,11 @@ This is an overview of the features that Mi2mu supports.
 =head1
 DISCLAIMER & COPYING POLICY
 
-Mi2mu is copyright 1996,97 by its authors. Mi2mu is distributed 
+Mi2mu is copyright 1996, 1997 by its authors. Mi2mu is distributed 
 as part of GNU LilyPond, under the terms of the GNU General Public
 License.  Mi2mu is provided without any warranty what so ever.
 Mi2mu may be freely distributed.  For further information consult
-the GNU General Public License, which is in the file F<COPYING>.
+the GNU General Public License, from the file F<COPYING>.
 
 =head1 AUTHORS
 
index a918c5df2e95c83f16bfd3dca2f2122e4db78b14..369cfc745cacd605a4b8af0e87ce701d3e253c15 100644 (file)
@@ -41,7 +41,8 @@ chords by \verb+<+ and \verb+>+.
 \begin[verbatim]{mudela}
 \score {
         \melodic {      % {...} is a voice
-        c'4 g'4         % c and g are pitches, 4 is the duration (quaver)
+        c'4 g'4         % c and g are pitches, 4 is the duration
+                        % (crotchet/quarter note)
         c''4 ''c4       % c' is 1 octave up, 'c 1 down.
         <c'4 g'4>       % <...> is a chord
         }
index 8e3d0de2eacf9b944db34439b28191449f16cf04..a4cb803430e493cfe63604425691312e113c79de 100644 (file)
@@ -24,7 +24,8 @@ effective language for defining music.  We call this language (rather
 arrogantly) The Musical Definition Language or Mudela, for
 short.\footnote{If anybody comes up with a better name, we'd gladly
   take this. Gourlay already uses Musical Description Language,
-  G-Sharp Score Definition Language. We're not being original here}
+  G-Sharp Score Definition Language.  ISO standard 10743 defines a
+  Standard Music Description Language.  We're not being original here}
 
 The first aim of Mudela is to define a piece of music, being complete
 from both from a musical typesetting, as from a musical performing
@@ -218,10 +219,10 @@ meaning of \verb+_+ and the resolution of words
 You enter a note by giving the name and the reciprocal of the duration:
 
 \begin[fragment,verbatim]{mudela}
-a'4     % dutch names
+a'4     % Dutch names
 \end{mudela}
 
-is a A-1 pitched quaver. The ' signifies an octave change.  A-1 is 440
+is a A-1 pitched crotchet. The ' signifies an octave change.  A-1 is 440
 Hz concert-pitch. \verb+c'+ is also known as the central c. More examples:
 
 \begin[fragment,verbatim]{mudela}
@@ -235,11 +236,11 @@ a''     % 880
 
 The last one  is an A flat, (just below 110 Hz concert-pitch). The \verb+*2/3+
 signifies that this note is part of a triplet (3 in stead of 2). The
-duration is one and a half quaver (\verb+4.+) times 2/3.
+duration is one and a half quarter note (\verb+4.+) times 2/3.
 
 Notenames are just a special kind of identifiers, and can be declared
 for any language appropriate (see \file{init/dutch.ly}).  The default language
-for notenames is defined to be dutch. In dutch, the notenames are
+for notenames is defined to be Dutch. In Dutch, the notenames are
 a,b,c,d,e,f and g. Sharps are formed by adding the extension "is",
 flats by adding ``es''
 
@@ -334,7 +335,7 @@ a4 \dynamic { 0 } % 0 = fff, 7 = ppp
 Mudela defines the following dynamic identifiers:
 
 \begin{verbatim}
-ppp pp p mp mf df ff fff        % df iso f, f is a notename.
+ppp pp p mp mf f ff fff
 \end{verbatim}
 and the following abbreviations:
 \begin{verbatim}
@@ -492,7 +493,7 @@ You can set the voicegroup of a voice with the command \verb+\group+, e.g.,
 
 In this example, the two oboe voices share one staff and are initially
 in the voicegroup called "oboes". They will share beams, dynamics etc.
-After two quavers, oboeI "pushes" its group: a new voicegroup is
+After two quarter notes, oboeI "pushes" its group: a new voicegroup is
 created, called "oboes+solo". The \verb+\group "-"+ command makes the
 voice enter "oboes" again.
 
@@ -547,7 +548,7 @@ same syntax as grouping:
 \end{verbatim}
 
 Make the piece start with a partial measure [english translation?]
-lasting 1 3/4 quaver.
+lasting 1 3/4 quarter notes.
 
 These commands are also "voice elements", and constitute simple mudela
 (consisting of stuff with duration 0).
diff --git a/Documentation/mutopia.pod b/Documentation/mutopia.pod
new file mode 100644 (file)
index 0000000..bdefc53
--- /dev/null
@@ -0,0 +1,35 @@
+=head1 NAME 
+
+Mutopia project - manifesto
+
+=head1 DESCRIPTION
+
+Random ranting about the Mutopia project, aka "Music To the People." 
+[Not yet finished, so this is unpolished]
+
+=head1 WHY
+
+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 to justify this policy: the high prices are there to guarantee
+diversity (keeping lots of stock is expensive), and to encourage new
+work being composed.
+
+This is bad. Storing a Mudela file takes almost no space at all, and
+if sheet music could be had for free, then it would be much easier
+obtain less famous music.  These composers have died long ago, and not
+having their music available only discourages people from
+experimenting with it.  You deserve to get public domain music for
+free (zero cents)
+
+=head1 WHAT 
+
+For literature, the project Gutenberg has an archive of public domain
+literary works. For music, this does not exist yet.
+
+We also need an archive of public domain sheet music; this is what we
+call The Mutopia Project.
+
+
+
index 9da5f26af94695c6daab864db525f9ef77568cba..30497834997c91aa858688a738d9e5c19042949d 100644 (file)
@@ -9,11 +9,6 @@ packages. Feel free to add info (and mail it to me).
 
 =head2 Free packages (with source)
 
-=item G Sharp, http://dept-info.labri.u-bordeaux.fr/~strandh/Gsharp
-
-An alpha version notation editor for X in Scheme. Source available on
-request.
-
 =item Rosegarden, http://www.bath.ac.uk/~masjpf/rose.html
 
 A Notation editor/Sequencer for X (windows95 port underway). Outputs musictex.
@@ -51,7 +46,7 @@ MusixTeX is a macro package for TeX to typeset polyphonic or
 instrumental music by Daniel Taupin, Ross Mitchell and Andreas
 Egler. It includes a full-featured set of fonts.
 
-=item ABC2MTeX, http://www.gmd.de/Misc/Music/
+=item ABC2MTeX, http://www.gre.ac.uk/~c.walshaw/abc
 
 A preprocessor to MusixTeX by Chris Walshaw for transcribing folk and
 traditional music.
index 3a2b240602ab7855475c4509d0f22a12063e3623..a91ed8b4efb5d52080a1dfa5a25f4e3d0ef84d09 100644 (file)
@@ -61,7 +61,7 @@ R\bR\bR\bRU\bU\bU\bUN\bN\bN\bNN\bN\bN\bNI\bI\bI\bIN\bN\bN\bNG\bG\bG\bG
 
 
 
-3/Aug/97                  LilyPond 0.1.1                        1
+8/Aug/97                  LilyPond 0.1.7                        1
 
 
 
@@ -89,9 +89,9 @@ R\bR\bR\bRE\bE\bE\bEC\bC\bC\bCO\bO\bO\bOM\bM\bM\bMM\bM\bM\bME\bE\bE\bEN\bN\bN\bND\bD\bD\bDE\bE\bE\bED\bD\bD\bD
        Although not strictly necessary, these are recommended to
        have.
 
-       +\bo         Perl.  Most scripts are written in Perl. Most
+       +\bo         Perl-5.  Most scripts are written in Perl. Most
                  documentation was created with the perl's Plain
-                 Old Documentation.
+                 Old Documentation. (I use 5.003)
 
        +\bo         GNU find
 
@@ -127,7 +127,7 @@ C\bC\bC\bCO\bO\bO\bON\bN\bN\bNF\bF\bF\bFI\bI\bI\bIG\bG\bG\bGU\bU\bU\bUR\bR\bR\bRI\bI\bI\bIN\bN\bN\bNG\bG\bG\bG a\b
 
 
 
-3/Aug/97                  LilyPond 0.1.1                        2
+8/Aug/97                  LilyPond 0.1.7                        2
 
 
 
@@ -193,7 +193,7 @@ INSTALL(1)            LilyPond documentation           INSTALL(1)
 
 
 
-3/Aug/97                  LilyPond 0.1.1                        3
+8/Aug/97                  LilyPond 0.1.7                        3
 
 
 
@@ -259,7 +259,7 @@ I\bI\bI\bIN\bN\bN\bNS\bS\bS\bST\bT\bT\bTA\bA\bA\bAL\bL\bL\bLL\bL\bL\bLI\bI\bI\bIN\bN\bN\bNG\bG\bG\bG
 
 
 
-3/Aug/97                  LilyPond 0.1.1                        4
+8/Aug/97                  LilyPond 0.1.7                        4
 
 
 
@@ -325,7 +325,7 @@ R\bR\bR\bRE\bE\bE\bED\bD\bD\bDH\bH\bH\bHA\bA\bA\bAT\bT\bT\bT L\bL\bL\bLI\bI\bI\bIN\bN\bN\bNU\bU\bU\bUX\bX\bX\bX
 
 
 
-3/Aug/97                  LilyPond 0.1.1                        5
+8/Aug/97                  LilyPond 0.1.7                        5
 
 
 
@@ -337,17 +337,17 @@ INSTALL(1)            LilyPond documentation           INSTALL(1)
 D\bD\bD\bDE\bE\bE\bEB\bB\bB\bBI\bI\bI\bIA\bA\bA\bAN\bN\bN\bN G\bG\bG\bGN\bN\bN\bNU\bU\bU\bU/\b/\b/\b/L\bL\bL\bLI\bI\bI\bIN\bN\bN\bNU\bU\bU\bUX\bX\bX\bX
        A Debian package is in the works
 
-W\bW\bW\bWI\bI\bI\bIN\bN\bN\bND\bD\bD\bDO\bO\bO\bOZ\bZ\bZ\bZE\bE\bE\bE
-       Windows NT:
+W\bW\bW\bWI\bI\bI\bIN\bN\bN\bND\bD\bD\bDO\bO\bO\bOW\bW\bW\bWS\bS\bS\bS N\bN\bN\bNT\bT\bT\bT/\b/\b/\b/9\b9\b9\b95\b5\b5\b5
+       So, you're stuck with Windows, eh?  Well, don't worry, you
+       just need (to get) Cygnus' windows32 port of gnu
+       development stuff; have a look at
+       http://www.cygnus.com/gnu-win32.
 
-       you need the cygnus windows32 gnu port development stuff;
-       have a look at http://www.cygnus.com/gnu-win32.
-
-       to make GNU LilyPond under, brr, aargh, shudder..
+       To make GNU LilyPond under, brr, aargh, shudder...
        windows32, well, simply type:
 
                bash configure
-               make windows32
+               make
 
 
 A\bA\bA\bAU\bU\bU\bUT\bT\bT\bTH\bH\bH\bHO\bO\bO\bOR\bR\bR\bRS\bS\bS\bS
@@ -391,6 +391,6 @@ A\bA\bA\bAU\bU\bU\bUT\bT\bT\bTH\bH\bH\bHO\bO\bO\bOR\bR\bR\bRS\bS\bS\bS
 
 
 
-3/Aug/97                  LilyPond 0.1.1                        6
+8/Aug/97                  LilyPond 0.1.7                        6
 
 
diff --git a/NEWS b/NEWS
index 140b08c42a69a13036478f1580e0b29d3e55d73e..cdf96ae04fbf074b5cb42a08685ee54fcfe0c5a9 100644 (file)
--- a/NEWS
+++ b/NEWS
+pl 7
+       - Audio_element as base for Audio_item and Audio_staff. fixes
+midi-lyric segfault
+       - added "Gallina a due violini"
+       - make MIDI files on website.
+       - Collision now also is an Element_group.
+       - bf: announce Collision when created
+
+********
+aug 13
+pl 6
+       - bf: 13 shift/reduce in parser fixed
+       - bf: plets in parser
+       - bf: main.o (again)
+       - german notenames (RM)
+       - Score_elem::offset_ now relative to its X/Y groups. Slight
+speed increase? 
+
+********
+aug 12
+pl 5
+
+       - Wordwrap revert
+       - added LilyPond in WWW titles
+       - oops. A quaver is a 8th note, not a 4th
+       - bf: main.o remaking in lily/Makefile 
+       - unhair Voice_iterator 
+       - bf: error if no music in score
+       - bf: don't create translators if Chord element is empty
+       - bf: ctor of Tempo_req
+       - use virtual do_equal_b() for request comparison
+       - bf: turned off default plets: c4*2/3 c4*2/3 -> c4*2/3 c4*4/9
+       - bf: time_int() of an empty chord/voice
+       - more corrections to GMP Manifesto
+       - debian updates (AF)
+       - bf: g++ ICE in Performer_group_performer
+       - use fread() for reading in Simple_file_storage
+
+pl 0.1.3.jcn1
+       - mi2mu: simplification +bf lily_stream: indentation and wordwrap
+       - mi2mu: bf: blunt: non-alpha(num) chars from identifiers
+
+*********
+aug 11
+pl 4
+       - correction of GNU Music Manifesto
+       - moved lowlevel stuff of Source_file to Mapped_file_storage. 
+Interface via File_storage. (Now using Simple_file_storage)
+       - bf: c4-"A"-"B"
+       - bf: exit status
+       - declarable keys
+       - Engraver_group_engraver::find_simple_engraver()
+       - bf: lily/Makefile
+       - bf: Midi_note_event ctor 
+       - bf: tempo request
+       - popular twinkle twinkle (JV)
+       - mudela: parse tempo requests, \midi{ \tempo 4= 60;}
+
+******
+aug 8
+pl 3
+       - don't crash if no Clef_engraver.
+       - PScore -> Paper_score
+       - bf: Score_elem::extent() init of interval
+       - bfs: {Horizontal,Vertical}_group related
+       - bf: don't change original Item while doing making 
+       multiple copies
+       - bf: configure DATADIR
+       - bf: type of spanbar.
+
+pl 0.1.2.jcn1
+       - minor doco fixes
+       - revived Midi_walker
+       - moved midi out of performer-* to audio-*
+       - Audio_staff
+       - removed all <ugh> members from performers
+
+*******
+aug 7
+pl 2
+       - junked Line_of_staff
+       - bf: --output
+       - bf: . in lexer
+       - bf: mi2mu version number.
+       - bf: in mudela-book
+       - bf: don't forget to make mi2mu
+       - Bar_number_grav: measure numbers (experimental)
+       - Bar_column_engraver, Bar_column: scripts on bars
+       - rewrite of {Horizontal,Vertical}_group. Yes, again. 
+Now neatly integrated into class hierarchy
+       - Axis, Axis_group
+       - Debian rules (AF)
+
 pl 0.1.1.jcn1
        - Audio{column,score,item,...}, more generic audio
        - bf: Makefiles
-       - added empty flower/aclocal.m4?
        - bf: mi2mu mudela version
+*********
+aug 5
 
 pl 0.1.1
-       - {Horizontal, Vertical}_group.  A score_element may be in at most one. 
+       - {Horizontal, Vertical}_group.  A score_element may be in at most one.
        - This means Horizontal_group_item and Vertical_group_spanner need special support.
        - This also means a big speed increase
        - configure cleanup
diff --git a/README b/README
index 81977e36033fc59448d3583d01a31af5e0cfbfeb..5b975730b59447ec4c2e3ee9a9a2214d25059092 100644 (file)
--- a/README
+++ b/README
@@ -5,6 +5,7 @@ GNU LilyPond which converts music definition files into visual or
 audio output: it can typeset formatted sheet music in TeX and 
 and (mechanical) perfomances to MIDI files.
 
+
 1. VERSIONING
 
 if you have downloaded a
@@ -46,30 +47,17 @@ You can also simply read the .pod sources. They are ASCII text.
 
 LilyPond is a long way from finished and polished. I do appreciate
 criticism, comments, bugreports, patches, etc. Please send e-mail to
-the mailing lists 
-
-
-       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.
-
-
-       
+the mailing lists. See Documentation/links.pod for more info 
 
-Have fun!
 
 6. DOZE
 
 If you have received this file as part of a DOS/Window32 distribution
 (lilypond-*.zip ), then it is advisable to also download the source
-package, since it contains the complete documentation
+package, since it might contain more documentation
 
        ftp://pcnov095.win.tue.nl/pub/lilypond/ (Europe)
-       ftp://alpha.gnu.ai.mit.edu/gnu/ (US)
+       ftp://alpha.gnu.ai.mit.edu/gnu/lilypond/ (US)
 
 The website also contains the complete documentation
 
@@ -77,5 +65,20 @@ The website also contains the complete documentation
 
 
 
+7. CAVEATS
+
+Solaris
+
+Stack frame overwrite on Solaris 2.x (this will produce a seg
+fault, signal 11).  Stacktrace
+
+       Engraver_group_engraver::Engraver_group_engraver(int)
+       Score_engraver::Score_engraver( )
+       get_group_engraver_p()
+
+We don't know a fix or workaround, but compiling without optimisation
+might help (Without -O2 optimisation, my execs run fine on Solaris;
+without -O2, but with purify, it dumps core)
+
 
 
diff --git a/TODO b/TODO
index f617a2a566520854bcf4ffa5ae9defaf259e9fa9..66701d0090398ebf82fa8eb77cdd429aa4055f8e 100644 (file)
--- a/TODO
+++ b/TODO
@@ -5,13 +5,25 @@ done, or is an idea that I want to think about
 
 Most of the items are marked in the code as well, with full explanation. 
 grep for TODO and ugh/ugr
+       * Generate TeX titles from MudelaHeader
 
-       * generate stuff in out/default, out/sun5-irix etc iso out/ 
-and out-sun5/
+       * integrate midi-elts from mi2mu and lily
+
+       * virtualise PCols to make encapsulated spacing problems
+
+       * fix spacing: standchen: distance bar-note, 
+         strange stretching and compressing of 8's
+       * Doc Mutopia (Music To The People) 
+
+       * context in spring-spacer.
 
-       * derive dstream, texstream from ostream?
+       * don't count bars which are not on first beat.
 
-       * A typical pop-music example.
+       * generate stuff in out/default, out/sun5-irix etc iso out/ 
+       and out-sun5/
+
+       * derive lily_stream, Dstream, texstream from ostream?
 
        * check libtool, automake
 
@@ -31,21 +43,21 @@ and out-sun5/
 
        * get rid of gif files.
 
-       * set_midi_channel/staff() out of performer.
-
        * dots into separate item.
 
        * use String iso Text_def for lyrics.
 
        * use position 0 for center of staff iso bottom.
 
+       * Klavarskribo?
+
        * return status on exit
 
        * lyrics in chords still fuck up.
 
        * rewire acknowledge_element() logic with a process_acknowledged()
        
-       * Global type registration.  
+       * Global type registration.
 
                My_class * p = create_object( My_class )
                Type t = get_type ( *p );
@@ -68,10 +80,12 @@ and out-sun5/
 
 3RD PARTY BUGS:
 
+       * collision.cc: 138, g++ errors
+
        * bugreport to doc++ devel: struct not in class hier; public
        virtual baseclasses
 
-       * DOC++ bugs/ newer version?
+       * DOC++ bugs/newer version?
 
        * Rational infty(HUGE_VAL) on glibc / w32
 
@@ -81,10 +95,20 @@ and out-sun5/
        yy_scan_buffer in C++..
 
        * (where are the) gcc compile warnings on linux
-       
+
+LILY BUGS
+
+       \score { < 
+               \melodic { \id "Staff" ""; c'4 g'4 }
+               \lyric {   \id "Lyric" ""; hello4 bye4 < a chord > }
+               \lyric {   \id "Lyric" ""; bye4 hello4 }
+               \melodic { \id "Staff" ""; c'4 g'4 }
+       > }
 
 PROJECTS
 
+       * emacs-mode for mudela
+
        * input converters
        - NIFF?
        - ABC? 
@@ -174,17 +198,23 @@ PROJECTS
          besides lists of flats/sharps, possibly via declaration
        - key transposition. 
        - key undo: \key bes; .. . \key; should print natural   
-       - special key: \key 'b bes bis';
+       - special key: \key bes 'b bis';
        - spacing, national styles?
 
-PARSER
-       * Duration -> Musical_duration, typedef Rational Duration?
+       * Support for TAB
+       - redo Notehead to allow digits as heads
+       - add a \tablature {} lexer mode for easy entering
 
-BUGS
 
        * should adjust stemlength for flag number.
 
-       * lilypond - -> crash
+       * breaking:
+       - caching breakpoints
+       - saving them
+       - allowing users to set them.
+       - penalties
+       - specify number of lines
+       - set linelength per line
 
 SEVERELY LACKING:
 
@@ -272,8 +302,6 @@ SMALLISH PROJECTS
 
        * centered whole rest
 
-       * caching breakpoints / saving them. 
-
        * use dstream feature in mi2mu
 
         * qtor, btor, mtor-> tor( QUIET_ver ), tor( DEBUG_ver ), etc.
@@ -308,10 +336,6 @@ SMALLISH PROJECTS
 
        * configure idealspacing: arithmetic spacing
 
-       * LilyPond .deb. Other packaging methods?
-
-       * detect -pipe
-
 DOC
        * Score_elem structure.
 
@@ -346,7 +370,6 @@ FUTURE
        * volta
 
 IDEAS
-       * check out CORBA for Score_elems?
 
        * derive PCol from Score_elem? More in Score_elems? Spacing?
 
@@ -388,7 +411,7 @@ IDEAS
          % fingering:        footing:
            < a-4 c-2 g-1 >   < c-\ltoe e-\lheel >
 
-       * parameterised scripts for fingering and footing:
+       * stackparameterised scripts for fingering and footing:
 
             % toe to bheel   four to five
            %   ^_u            4_5  
diff --git a/VERSION b/VERSION
index 1a78f879c5c73b62dd39f5107a96c2ea7d491ac5..a0f69a468efc64bd965e8303cec8630482cd728d 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 TOPLEVEL_MAJOR_VERSION = 0
 TOPLEVEL_MINOR_VERSION = 1
-TOPLEVEL_PATCH_LEVEL = 1
+TOPLEVEL_PATCH_LEVEL = 7
 
 # use to send patches, always empty for released version:
-TOPLEVEL_MY_PATCH_LEVEL = .jcn1
+TOPLEVEL_MY_PATCH_LEVEL = 
index f1b640c0aecba48105c1070f305f596c9e9773e3..bad1df51ec2d9ed9b92d89d974f37f022c51c1bf 100644 (file)
@@ -1,4 +1,5 @@
 #!@PERL@ -w
+# -*-perl-*-
 
 =head1 TODO
 
@@ -105,6 +106,10 @@ sub convert_0_0_60_to_0_0_61
    
 }
 
+sub convert_0_1_0_to_0_1_1
+{
+    s/\\tempo (.*):(.*);/\\tempo $1 = $2;/g
+}
 ###############################################################
 
 sub    last_conversion
@@ -144,19 +149,22 @@ my %minor_conversions = ("0.0.50" => \&no_conv,
                         "0.0.58" => \&convert_0_0_57_to_0_0_58,
                         "0.0.59" => \&convert_0_0_58_to_0_0_59,
                         "0.0.60" => \&convert_0_0_59_to_0_0_60,
-                        "0.0.61" => \&convert_0_0_60_to_0_0_61
+                        "0.0.61" => \&convert_0_0_60_to_0_0_61,
+                        "0.1.1" => \&convert_0_1_0_to_0_1_1
                         );
  
 
 sub versions 
 {
-    return (sort keys %minor_conversions);
+    return (sort { cmpver; } (keys %minor_conversions));
 }
     
 
-sub    show_rules
+sub show_rules
 {
-    print "Rules: ", join(", ", sort keys %minor_conversions), "\n";
+    my (@v) = versions;
+
+    print "Rules: ", join(", ", @v), "\n";
     
 }
 
@@ -167,7 +175,6 @@ sub do_conversion
     my @applicable_conversion;
     my @mudela_levels;
     
-#    die "This is too old  to convert " if $from < 50;
     my @v = versions;
     foreach $ver (@v) {
        if (version_compare($ver, $from) > 0 && version_compare($ver,$to) <= 0 ){ 
index d8e79346cdddbb99f0fb7b99744de0052a8b4f73..3be14353cb14472d98e8427a0361b7d698dcc05a 100755 (executable)
@@ -10,11 +10,4 @@ fi
 
 cat $versionfile| sed 's/#.*$//g'|sed 's/\([^ ]*\)[\t ]*=[ \t]*\([^ ]*\)$/#define \1 \"\2\"/g' 
 echo
-if [ -z $CXX ]
-then
-    COMPILER=unknown
-else
-    COMPILER="$CXX `$CXX --version`"
-fi
-
-echo "#define COMPILER "\"$COMPILER\"
+    
index 28f85f79bad9f5f3a3b18b7d3f5a5204574ffd6e..e6796215f3b25b4f2518a4718b79a9c671d245f3 100644 (file)
@@ -1,12 +1,12 @@
 #!@PERL@ -w
-# stupid script to generate WWW site.
+# stupid script to generate WWW site. -*-Perl-*-
 
 use FileHandle;
 use Getopt::Long;
 my $lily_version;
 my $footstr;
 my $mw_id = "<!make_website!>";
-my $id_str = "make-website 0.3";
+my $id_str = "make-website 0.4";
 
 my $TAR="tar";
 my $MAKE="make";
@@ -40,12 +40,11 @@ sub set_html_footer
     my $username=$pw[6];
 
     $footstr = 
-       "\n<hr>Please take me <a href=index.html>back to the index</a>\n<hr>
+       "\n<hr>Please take me <a href=index.html>back to the LilyPond index</a>\n<hr>
 <font size=-1>
-This page was generated by <code>" . $id_str . "</code> from lilypond-$lily_version by
+This page was built using <code>" . $id_str . "</code> from lilypond-$lily_version by
 <p>
 <address><br>$username <a href=mailto:$MAILADRESS>&lt<!bla>$MAILADRESS</a>&gt</address>
-<p>" . `date` . "
 <p></font>";
 }
     
@@ -76,7 +75,7 @@ sub my_system
 
 local $base="lilypond/";
 local @examples=("twinkle", "multi", "wohltemperirt" ,"standchen", "toccata-fuga-E", 
-                "scsii-menuetto", "collisions", "cadenza", "scales");
+                "scsii-menuetto", "collisions", "cadenza", "scales", "twinkle-pop");
 
 # rhythm, scales, 
 
@@ -104,7 +103,7 @@ sub gen_manuals
 {
     print "generating TeX doco list\n";
     open HTMLLIST, ">tex_manuals.html";
-    print HTMLLIST "<HTML><TITLE>LilyPond manuals</title>\n" ;
+    print HTMLLIST "<HTML><TITLE>PostScript Manuals</TITLE>\n" ;
     print HTMLLIST "<BODY><h1>LilyPond manuals (in PostScript)</h1>";
     print HTMLLIST "<ul>\n";
     my @todo=();
@@ -124,7 +123,7 @@ sub gen_list
 {
     print "generating HTML list\n";
     open HTMLLIST, ">example_output.html";
-    print HTMLLIST "<html><body><title>LilyPond examples</title>\n
+    print HTMLLIST "<html><body><TITLE>Rendered Examples</TITLE>\n
 These example files are taken from the LilyPond distribution.\n
 LilyPond currently only outputs TeX and MIDI. The pictures and\n
  PostScript files were generated using TeX, Ghostscript and some graphics tools. \n
@@ -192,8 +191,10 @@ sub edit_html
        $subst .= $back if (! $a =~ /index.html/ );
        $file =~ s/$sep/$subst$sep/g ;
        $file =~ s/\.gif/\.$image/g;
+       $file =~ s!<TITLE>(.*)</TITLE>!<TITLE>LilyPond WWW: $1</TITLE>!g;
        open H, ">$a";
        print H $mw_id;
+       
        print H $file;
        close H;
     }
@@ -213,7 +214,7 @@ sub copy_txt_file
 sub copy_files
 {  
     print "copying files\n";
-    print `ln -s $depth/out ./docxx` if ( ! -x "docxx" ) ;
+    my_system "ln -s $depth/out ./docxx" if ( ! -x "docxx" ) ;
     my_system "cp $depth/TODO ./TODO.txt",
     "cp $depth/ANNOUNCE ./ANNOUNCE.txt",
     "cp $depth/NEWS ./NEWS.txt",
@@ -237,7 +238,13 @@ sub set_images
 
 sub docxx_update
 {
-    my_system "$MAKE -C $depth doc++";
+    open BANNER, ">/tmp/lilybanner.html";
+    my $ban = $footstr;
+    $ban =~ s!index.html!../index.html!g;
+    print BANNER $ban;
+    close BANNER;
+    my_system "$MAKE -C $depth docxx-opts=\"-p -S -k -B /tmp/lilybanner.html\" doc++";
+    # should add a cute header.
 }
 
 sub do_tar
@@ -283,8 +290,8 @@ sub main
     if (! $opt_noexamples) {
        gen_examples;
        gen_list;
+       gen_manuals;
     }
-    gen_manuals;
     set_images;
 
     edit_html;
index 11f27a40aadf4b740b5a2948de60f3b71e56f7dd..374f223a1f4f0c29aecc2ff6b1e13d3dd12a9da4 100644 (file)
@@ -3,6 +3,7 @@
 my $mudcount = 0;
 my $mudela_b = 0;
 my $outname = "-";
+my $outdir;
 use Getopt::Long;
 
 sub gen_mufile
@@ -99,7 +100,7 @@ sub main
     if  (defined ($opt_outdir)) {
        $outdir = $opt_outdir .  "/";
     } else {
-       $outdir = "";
+       $outdir = ".";
     }
    
     if (defined ($ARGV[0])) {
@@ -110,12 +111,17 @@ sub main
     if (defined ($opt_outname)) {
        $outname = $opt_outname ;
     } else { 
-       die "Need to have an output name, use --outname" if ( $infile == "-");
+       die "Need to have an output name, use --outname" if ( $infile eq "-");
        $outname = "$infile.tex";
     }
-    
+
+    my $openout ="$outdir$outname"; 
+    if  ( $infile eq $openout ) {
+       die "The input can't be the output\n";
+    }
+
     open INFILE, "<$infile";
-    open BOOK, ">$outdir$outname";
+    open BOOK, ">$openout";
     while (<INFILE>) {
        if ($mudela_b) {
            if (end_b "mudela") {
index ab1ca42f2771ed4a9aba4bcb51eb842f1fc78cae..3042b7989dccb5898de9cc1205c646e367275861 100755 (executable)
--- a/configure
+++ b/configure
@@ -542,7 +542,10 @@ if test x$srcdir != x.; then
   echo Please look in the INSTALL instructions for
   echo directions for multi-architecture building
     
-  { echo "configure: error: This package does not support --srcdir." 1>&2; exit 1; }
+  
+    echo "configure: warning: This package does not support --srcdir!" 1>&2
+    warn_b=yes
+
 fi
 
 # if given here, these vars are initted at the checking point.
@@ -557,7 +560,6 @@ checking_b=yes
 debug_b=yes
 optimise_b=no
 profile_b=no
-warn_b=no    
 
 ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -684,7 +686,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:688: checking for $ac_word" >&5
+echo "configure:690: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -715,7 +717,7 @@ test -n "$CXX" || CXX="gcc"
 
 
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:719: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:721: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
 
 ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -725,11 +727,11 @@ ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $L
 cross_compiling=$ac_cv_prog_cxx_cross
 
 cat > conftest.$ac_ext <<EOF
-#line 729 "configure"
+#line 731 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cxx_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -749,12 +751,12 @@ if test $ac_cv_prog_cxx_works = no; then
   { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:753: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:755: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
 cross_compiling=$ac_cv_prog_cxx_cross
 
 echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:758: checking whether we are using GNU C++" >&5
+echo "configure:760: checking whether we are using GNU C++" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -763,7 +765,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:767: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:769: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gxx=yes
 else
   ac_cv_prog_gxx=no
@@ -778,7 +780,7 @@ if test $ac_cv_prog_gxx = yes; then
   ac_save_CXXFLAGS="$CXXFLAGS"
   CXXFLAGS=
   echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:782: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:784: checking whether ${CXX-g++} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -808,7 +810,7 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:812: checking for $ac_word" >&5
+echo "configure:814: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -864,7 +866,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:868: checking for a BSD compatible install" >&5
+echo "configure:870: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -918,7 +920,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:922: checking for $ac_word" >&5
+echo "configure:924: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_TAR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -952,7 +954,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:956: checking for $ac_word" >&5
+echo "configure:958: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_FIND'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -982,14 +984,18 @@ done
 test -n "$FIND" || FIND="error"
 
 
-if test FIND = error; then
-   
-    echo "configure: warning: Couldn't find \`find'.  Please use --enable-tex-dir" 1>&2
+
+       if test $FIND = "error" 
+       then
+               
+    echo "configure: warning: can't find \`find\'. Please use --enable-tex-dir. " 1>&2
     warn_b=yes
 
-fi
+       fi
 
 
+    
+
 
 
 
@@ -1014,7 +1020,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1018: checking for $ac_word" >&5
+echo "configure:1024: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1048,7 +1054,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1052: checking for $ac_word" >&5
+echo "configure:1058: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1082,7 +1088,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1086: checking for $ac_word" >&5
+echo "configure:1092: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_MAKE'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1114,7 +1120,7 @@ test -n "$MAKE" || MAKE="error"
 # Extract the first word of "perl", so it can be a program name with args.
 set dummy perl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1118: checking for $ac_word" >&5
+echo "configure:1124: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1148,7 +1154,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1152: checking for $ac_word" >&5
+echo "configure:1158: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_PODMAN'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1184,7 +1190,7 @@ if test "x$TEXPREFIX" = xauto ; then
     
 
     echo $ac_n "checking TeX/MF root dir directory""... $ac_c" 1>&6
-echo "configure:1188: checking TeX/MF root dir directory" >&5    
+echo "configure:1194: checking TeX/MF root dir directory" >&5    
 
     find_root_prefix="$prefix"
     
@@ -1225,7 +1231,7 @@ if test "x$TEXDIR" = xauto ; then
     
     
     echo $ac_n "checking TeX input directory""... $ac_c" 1>&6
-echo "configure:1229: checking TeX input directory" >&5    
+echo "configure:1235: checking TeX input directory" >&5    
     find_dirdir=`(cd $find_texprefix; 
       $FIND ./ -type d -a -name tex -print |sort|head -1|sed 's#^\./##')`
     
@@ -1245,7 +1251,9 @@ echo "configure:1229: checking TeX input directory" >&5
 
 fi
 
-    
+
+
+
 
 
        if test $MAKE = "error" 
@@ -1326,7 +1334,7 @@ else
 fi
 
 echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
-echo "configure:1330: checking how to run the C++ preprocessor" >&5
+echo "configure:1338: checking how to run the C++ preprocessor" >&5
 if test -z "$CXXCPP"; then
 if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1339,12 +1347,12 @@ ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $L
 cross_compiling=$ac_cv_prog_cxx_cross
   CXXCPP="${CXX-g++} -E"
   cat > conftest.$ac_ext <<EOF
-#line 1343 "configure"
+#line 1351 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1356: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1364,17 +1372,17 @@ echo "$ac_t""$CXXCPP" 1>&6
 
 ac_safe=`echo "FlexLexer.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for FlexLexer.h""... $ac_c" 1>&6
-echo "configure:1368: checking for FlexLexer.h" >&5
+echo "configure:1376: checking for FlexLexer.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1373 "configure"
+#line 1381 "configure"
 #include "confdefs.h"
 #include <FlexLexer.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1378: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1386: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1400,7 +1408,7 @@ else
 fi
 
 
-for a in `find -type d -and -not -name 'out*'`; do
+for a in `find . -type d -and -not -name 'out*' -print`; do
     if test ! -d  $a/$OUTDIR_NAME; then
        mkdir $a/$OUTDIR_NAME
     fi
@@ -1409,8 +1417,6 @@ done
 subdirs="flower"
 
 
-# ugh
-eval "DIR_DATADIR=$datadir/lilypond"
     
 trap '' 1 2 15
 cat > confcache <<\EOF
@@ -1526,7 +1532,6 @@ ac_given_srcdir=$srcdir
 ac_given_INSTALL="$INSTALL"
 
 trap 'rm -fr `echo "make/$OUTDIR_NAME/Configure_variables.make:make/Configure_variables.make.in
-    lib/$OUTDIR_NAME/config.hh:lib/config.hh.in
     Makefile:make/Toplevel.make.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
@@ -1625,7 +1630,6 @@ EOF
 cat >> $CONFIG_STATUS <<EOF
 
 CONFIG_FILES=\${CONFIG_FILES-"make/$OUTDIR_NAME/Configure_variables.make:make/Configure_variables.make.in
-    lib/$OUTDIR_NAME/config.hh:lib/config.hh.in
     Makefile:make/Toplevel.make.in"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
@@ -1812,7 +1816,7 @@ If you want to make site-wide extensions to the makefiles, please use
     
 END
 
-if test $warn_b = "yes" ; then
+if test x$warn_b = "xyes" ; then
 cat <<EOF
     
     **************************************************
index ffe79f3e4aca29800c6169a087614d2bc14befe3..e3e93c03bd5262ceefa0d233d50c2c8e27b35967 100644 (file)
@@ -8,7 +8,7 @@ if test x$srcdir != x.; then
   echo Please look in the INSTALL instructions for
   echo directions for multi-architecture building
     
-  AC_MSG_ERROR(This package does not support --srcdir.)
+  AC_LILY_WARN(This package does not support --srcdir!)
 fi
 
 # if given here, these vars are initted at the checking point.
@@ -23,7 +23,6 @@ checking_b=yes
 debug_b=yes
 optimise_b=no
 profile_b=no
-warn_b=no    
 
 AC_LANG_CPLUSPLUS
 
@@ -119,10 +118,9 @@ AC_CHECK_PROGS(TAR, tar, error)
 AC_CHECK_PROGS(FIND, find, error)
 
 dnl should check out -print
-if test FIND = error; then
-   AC_LILY_WARN(Couldn't find \`find'.  Please use --enable-tex-dir)
-fi
+AC_CHECK_SEARCH_RESULT($FIND, \`find\'. Please use --enable-tex-dir)
 
+    
 AC_SUBST(OUTDIR_NAME)
 AC_SUBST(CXXFLAGS)
 AC_SUBST(CPPFLAGS)
@@ -160,10 +158,11 @@ if test "x$TEXDIR" = xauto ; then
     AC_TEX_SUBDIR(TEXDIR)
 fi
 
-dnl if test "x$MFDIR" = xauto; then
-dnl     AC_MF_SUBDIR(MFDIR)
-dnl fi
-    
+
+AC_JUNK_ARGS( [if test "x$MFDIR" = xauto; then
+     AC_MF_SUBDIR(MFDIR)
+ fi]
+)
 
 AC_CHECK_SEARCH_RESULT($MAKE, GNU make,  You should install GNU make)
 AC_CHECK_SEARCH_RESULT( $BISON, bison,  Please install Bison, 1.25 or better)
@@ -197,7 +196,7 @@ fi
 AC_CHECK_HEADER(FlexLexer.h, true,
        AC_LILY_WARN(can't find flex header. Please install Flex headers correctly))
 
-for a in `find -type d -and -not -name 'out*'`; do
+for a in `find . -type d -and -not -name 'out*' -print`; do
     if test ! -d  $a/$OUTDIR_NAME; then
        mkdir $a/$OUTDIR_NAME
     fi
@@ -205,11 +204,8 @@ done
 
 AC_CONFIG_SUBDIRS(flower)
 
-# ugh
-eval "DIR_DATADIR=$datadir/lilypond"
     
 AC_OUTPUT(make/$OUTDIR_NAME/Configure_variables.make:make/Configure_variables.make.in
-    lib/$OUTDIR_NAME/config.hh:lib/config.hh.in
     Makefile:make/Toplevel.make.in)
 
 touch make/$OUTDIR_NAME/Site.make
@@ -229,7 +225,7 @@ If you want to make site-wide extensions to the makefiles, please use
     
 END
 
-if test $warn_b = "yes" ; then
+if test x$warn_b = "xyes" ; then
 cat <<EOF
     
     **************************************************
index 750c10145881d5e5de26b4be0c67c81ddd281696..13daeba0b8aab387f5d08605199d30ede6513dc7 100644 (file)
@@ -40,7 +40,7 @@ SUBDIRS = include test
 #
 SCRIPTS = 
 README_FILES = ONEWS NEWS README TODO
-EXTRA_DISTFILES= configure config.hh.in configure.in aclocal.m4 VERSION $(README_FILES) $(SCRIPTS) Flower-flags.make.in
+EXTRA_DISTFILES= aclocal.m4 configure config.hh.in configure.in VERSION $(README_FILES) $(SCRIPTS) Flower-flags.make.in
 #
 
 
index 57ad102788a65da08df99651fbeb68fba24529ee..f2720c2744a72fb58af91846dbcc6e152913588f 100644 (file)
@@ -1,4 +1,7 @@
 
+pl 26
+       - Getopt_long : command -- and command - 
+       - Getopt_long: cosmetics
 
 pl 25
        - unordered_substitute and unordered_del
index 6706447fcfc1d9389b234c98116f9fdb9f0c9958..46a01d28e5333f571636739ec9b8e2ecea1a66f1 100644 (file)
@@ -1,5 +1,5 @@
 This library contains some general purpose routines which aren't
-standardised libraries yet. It may be replaced by STL in time
+standardised libraries yet. It may be replaced by STL in time.
 
 It was written by:
 
@@ -9,4 +9,4 @@ and
 
        Jan Nieuwenhuizen <jan@digicash.com>
 
-It is licensed under the GNU GPL.
\ No newline at end of file
+It is licensed under the GNU GPL.
index d05f7ff918571601ba9acd4b3e9df705a1b8fcb6..7aec79ceb059dae6f4b399eff01d92aa69f825d9 100644 (file)
@@ -1,6 +1,6 @@
 MAJOR_VERSION = 1
 MINOR_VERSION = 1
-PATCH_LEVEL = 25
+PATCH_LEVEL = 26
 # use to send patches, always empty for released version:
 MY_PATCH_LEVEL = # include separator: "-1" or ".a"
 #
diff --git a/flower/aclocal.m4 b/flower/aclocal.m4
new file mode 100644 (file)
index 0000000..57ac696
--- /dev/null
@@ -0,0 +1,2 @@
+
+dnl this file intentionally left blank :)
index 23b77bbbc4ed51df03e99c1ef957e8683b4f48d2..ce0a51d36385413ce6bcf7a0947cd5339e56606d 100644 (file)
@@ -13,6 +13,7 @@
 #include "text-db.hh"
 #include "string-convert.hh"
 #include "assoc-iter.hh"
+
 /// indent of each level 
 const INDTAB = 2;
 
@@ -75,8 +76,6 @@ Dstream::silence(String s)
     return (*silent_assoc_p_)[s];
 }
 
-/** Output a string via the Dstream. This is the only output
- interface. It delegates all conversion to String class.  */
 Dstream &
 Dstream::operator<<(String s)
 {
@@ -172,5 +171,4 @@ Dstream::clear_silence()
     for (Assoc_iter<String, bool> i(*silent_assoc_p_); i.ok(); i++) {
        i.val() = 0;
     }
-                       
 }
index 63130d1204217978496e1c7eb22f32eebe458ed6..19fd8acab26592fa55bf62a846582c9481391af1 100644 (file)
@@ -16,7 +16,7 @@ const char eol= '\n';
 template<class K,class V>
 struct Assoc;
 
-/**  debug stream. 
+/**  Debug stream. 
    a class for providing debug output of nested structures,
    with indents according to \{\}()[].
 
@@ -47,11 +47,12 @@ public:
     /**
       if rcfile == 0, then do not read any rc file.
       */
-      
     Dstream(ostream *r, char const * rcfile);
     virtual ~Dstream();
     Dstream &identify_as(String s);
 
+/** Output a string via the Dstream. This is the only output
+ interface. It delegates all conversion to String class.  */
     Dstream &operator << (String s);
     /**
       Output memory locations.
index 6db9cd4dfdb7c0ea8a24d8eb1740e837703807a8..89b0196bf28e61dd94722694ec35b2c99738ec92 100644 (file)
@@ -14,7 +14,7 @@ struct Long_option_init {
     char const * longname;
     char        shortname;
 
-    ostream &printon(ostream &errorout);
+    void printon(ostream &errorout)const ;
 };
 
 
@@ -28,54 +28,56 @@ struct Long_option_init {
   argument reordering
   */
 class Getopt_long {
-public:
-    /** errorcodes: no error, argument expected, no argument expected,
-      unknown option, illegal argument (eg. int expected).  */
-    enum Errorcod { E_NOERROR = 0, E_ARGEXPECT, E_NOARGEXPECT, E_UNKNOWNOPTION,
-               E_ILLEGALARG } ;
-
-
-private:
 
     /// the option info.
-    Long_option_init *the_opts;
-    int table_len;
+    const Long_option_init *option_a_;
+    int table_len_i_;
     
-    /// if doing short option, argv[optind][optindind] is processed next.
-    int optindind;
+    /// if doing short option, arg_value_ch_a_a_[optind][optindind] is processed next.
+    int argument_index_i_;
 
     /// the option found
-    Long_option_init *beet;
+    const Long_option_init *found_option_l_;
 
-    /// get ready for processing next error.
-    bool next();
-    Long_option_init *parselong();
-    Long_option_init *parseshort();
-    
-    ostream *errorout;
 
-    /// report an error and abort
-    void report(Errorcod c);
-public:
+public: 
+    /** errorcodes: no error, argument expected, no argument expected,
+      unknown option, illegal argument (eg. int expected).  */
+    enum Errorcod { E_NOERROR = 0, E_ARGEXPECT, E_NOARGEXPECT, E_UNKNOWNOPTION,
+               E_ILLEGALARG } ;
 
     /// argument. Set to 0 if not present
-    char* optarg;
+    char const * optional_argument_ch_C_;
 
     /// current error status
-    Errorcod error;
+    Errorcod error_;
 
-    /// return an integer (with err. detect)
-    long intarg();
-    /// argv[optind] will be processed next.
-    int optind;
+    /// arg_value_ch_a_a_[array_index_i_] will be processed next.
+    int array_index_i_;
 
     /// the arguments
-    char **argv;
+    char **arg_value_ch_a_a_;
 
     /// the arg. count
-    int argc;
-    
-    /* *************** */
+    int argument_count_i_;
+
+    ostream *error_ostream_l_;
+
+public:
+    /// get ready for processing next error.
+    void next();
+    const Long_option_init *parselong();
+    const Long_option_init *parseshort();
+    void OK()const;
+    bool ok() const;
+
+    /// report an error and abort
+    void report(Errorcod c);
+
+
+    /// return an integer (with err. detect)
+    long argument_to_i();
     
     /**
       What to do with  errors. 
@@ -92,9 +94,9 @@ public:
       @return pointer to next option found.
       0 if error occurred, or next argument is no option.
       */
-    Long_option_init *operator()();
+    const Long_option_init *operator()();
 
-    char *current_arg();
-    char * get_next_arg();
+    char const *current_arg();
+    char const * get_next_arg();
 };
 #endif
index c2e5a3b7902ed9685eb6a2a927c4921eba291262..afffc2f4b2e2eb7a6b0b276f1e889c7a098d36c1 100644 (file)
@@ -9,64 +9,65 @@
 #include "lgetopt.hh"
 
 long
-Getopt_long::intarg()
+Getopt_long::argument_to_i()
 {
     long l;
-    if (sscanf(optarg, "%ld", &l) != 1)
+    if (!optional_argument_ch_C_ 
+       || sscanf(optional_argument_ch_C_, "%ld", &l) != 1)
        report(E_ILLEGALARG);
     
     return l;
 }
 
-Long_option_init *
+const Long_option_init *
 Getopt_long::parselong()
 {
-    char const *optnm = argv[optind] + 2 ;
+    char const *optnm = arg_value_ch_a_a_[array_index_i_] + 2 ;
     assert(*optnm);
     
-    char *endopt = strchr(optnm, '=');
+    char const *endopt = strchr(optnm, '=');
     int searchlen  = (endopt) ? endopt - optnm : strlen(optnm);
     
-    beet=0;
-    for (int i=0; i< table_len; i++) {
-       char const *ln = the_opts[i].longname;
+    found_option_l_=0;
+    for (int i=0; i< table_len_i_; i++) {
+       char const *ln = option_a_[i].longname;
 
        if (ln && !strncmp(ln, optnm, searchlen)) {
-           beet = the_opts+i;
+           found_option_l_ = option_a_+i;
            break;
        }
     }  
 
-    if (!beet) {
+    if (!found_option_l_) {
        report(E_UNKNOWNOPTION);
        return 0;
     }
-    optind++;
-    optindind = 0;
+    array_index_i_++;
+    argument_index_i_ = 0;
 
     
-    if (beet->take_arg) {
+    if (found_option_l_->take_arg) {
        if (endopt)
-           optarg = endopt +1; // a '='
+           optional_argument_ch_C_ = endopt +1; // a '='
        else {
-           optarg = argv[optind];
-           optind++;
+           optional_argument_ch_C_ = arg_value_ch_a_a_[array_index_i_];
+           array_index_i_++;
        }
-       if (!optarg)
+       if (!optional_argument_ch_C_)
            report(E_ARGEXPECT);
 
     } else {
-       optarg = 0;
+       optional_argument_ch_C_ = 0;
        if (endopt)
            report(E_NOARGEXPECT);
     }
     
-    return beet;
+    return found_option_l_;
 }
 
 
-ostream &
-Long_option_init::printon(ostream &errorout)
+void
+Long_option_init::printon(ostream &errorout)const
 {
     if (shortname)     
        errorout <<"-" << shortname;
@@ -74,150 +75,164 @@ Long_option_init::printon(ostream &errorout)
        errorout << ", ";
     if (longname)      
        errorout << "`--" << longname << "'";
-    return errorout;
 }
 
 // report an error, GNU style.
 void
 Getopt_long::report(Errorcod c)
 {
-    error = c;
-    if (!errorout)
+    error_ = c;
+    if (!error_ostream_l_)
        return;
 
-    *errorout << argv[0] << ": ";
+    *error_ostream_l_ << arg_value_ch_a_a_[0] << ": ";
     switch (c) {
     case E_ARGEXPECT:
-       *errorout<< "option ";
-       beet->printon(*errorout);
-       *errorout << "requires an argument"<<endl;
+       *error_ostream_l_<< "option ";
+       found_option_l_->printon(*error_ostream_l_);
+       *error_ostream_l_ << "requires an argument"<<endl;
        break;
     case  E_NOARGEXPECT:
-       *errorout << "option `--" <<
-           beet->longname << "' does not allow an argument"<<endl;
+       *error_ostream_l_ << "option `--" <<
+           found_option_l_->longname << "' does not allow an argument"<<endl;
        break;
        
     case E_UNKNOWNOPTION:
-       *errorout << "unrecognized option ";
-       if (optindind)
-           *errorout << "-" << argv[optind][optindind] << endl;
+       *error_ostream_l_ << "unrecognized option ";
+       if (argument_index_i_)
+           *error_ostream_l_ << "-" << arg_value_ch_a_a_[array_index_i_][argument_index_i_] << endl;
        else
-           *errorout << argv[optind] << endl;
+           *error_ostream_l_ << arg_value_ch_a_a_[array_index_i_] << endl;
 
        break;
     case E_ILLEGALARG:
-       *errorout << "illegal argument `" << optarg << "\'to option ";
-       beet->printon(*errorout);
-       *errorout << '\n';
+       *error_ostream_l_ << "illegal argument `" << optional_argument_ch_C_ << "\'to option ";
+       found_option_l_->printon(*error_ostream_l_);
+       *error_ostream_l_ << '\n';
     default:
        assert(false);
     }
     exit(2); 
 }
     
-Long_option_init *
+const Long_option_init *
 Getopt_long::parseshort()
 {
-    char c=argv[optind][optindind];
-    beet=0;
+    char c=arg_value_ch_a_a_[array_index_i_][argument_index_i_];
+    found_option_l_=0;
     assert(c);
     
-    for (int i=0; i < table_len; i++)
-       if (the_opts[i].shortname == c) {
-           beet  = the_opts+i;
+    for (int i=0; i < table_len_i_; i++)
+       if (option_a_[i].shortname == c) {
+           found_option_l_  = option_a_+i;
            break;
        }
 
-    if (!beet){
+    if (!found_option_l_){
        report(E_UNKNOWNOPTION);
        return 0;
     }
 
-    optindind++;
-    if (!beet->take_arg){
-       optarg = 0;
-       return beet;
+    argument_index_i_++;
+    if (!found_option_l_->take_arg){
+       optional_argument_ch_C_ = 0;
+       return found_option_l_;
     }
-    optarg = argv[optind] + optindind;
+    optional_argument_ch_C_ = arg_value_ch_a_a_[array_index_i_] + argument_index_i_;
 
-    optind ++;
-    optindind = 0;
+    array_index_i_ ++;
+    argument_index_i_ = 0;
     
-    if (!optarg[0]) {
-       optarg = argv[optind];
-       optind ++;
+    if (!optional_argument_ch_C_[0]) {
+       optional_argument_ch_C_ = arg_value_ch_a_a_[array_index_i_];
+       array_index_i_ ++;
     }
-    if (!optarg) {
+    if (!optional_argument_ch_C_) {
        report(E_ARGEXPECT);
     }
     
-    return beet;
+    return found_option_l_;
 }
 
-Long_option_init *
+const Long_option_init *
 Getopt_long::operator()() 
 {
-    if (!next())
+    if (!ok())
        return 0;
     
-    if (optindind)
-       return parseshort();
+    next();
+    
+    if (argument_index_i_)
+       return parseshort();
+    
+    const char * argument_C = arg_value_ch_a_a_[array_index_i_];
     
-    if (argv[optind][0] != '-')
+    if (argument_C[0] != '-')
        return 0;
 
-    if (argv[optind][1] == '-') {// what to do with "command  --  bla"
-       return parselong();
+    if (argument_C[1] == '-') {// what to do with "command  --  bla"
+       if ( argument_C[2] )
+           return parselong();
+       else
+           return 0;
     } else {
-       optindind = 1;
-       return parseshort();
+       if (argument_C[ 1 ]) {
+           argument_index_i_ = 1;
+           return parseshort();
+       } else {
+           return 0;
+       }
     }
 }
 
-Getopt_long::Getopt_long(int c, char **v, Long_option_init *lo)
+Getopt_long::Getopt_long(int c, char  **v, Long_option_init *lo)
 {
-    the_opts = lo;
-    errorout = &cerr;
-    argv = v;
-    argc = c;
-    optind = 1;
-    optindind = 0;
+    option_a_ = lo;
+    error_ostream_l_ = &cerr;
+    arg_value_ch_a_a_ = v;
+    argument_count_i_ = c;
+    array_index_i_ = 1;
+    argument_index_i_ = 0;
 
     //    reached end of option table?
-    int i;
-    for (i = 0;  the_opts[i].longname ||the_opts[i].shortname; i++)
-       ;
-    table_len = i;
+    table_len_i_ =0;
+    for (int i = 0;  option_a_[i].longname ||option_a_[i].shortname; i++)
+       table_len_i_ ++;
 }
 
 bool
-Getopt_long::next()
+Getopt_long::ok()const
 {
+    return  array_index_i_ < argument_count_i_;
+}
 
-    error = E_NOERROR;
-    while (optind < argc && !argv[optind][optindind]) {
-       optind++;
-       optindind = 0;
+void
+Getopt_long::next()
+{
+    error_ = E_NOERROR;
+    while (array_index_i_ < argument_count_i_
+          && !arg_value_ch_a_a_[array_index_i_][argument_index_i_]) {
+       array_index_i_++;
+       argument_index_i_ = 0;
     }
-    return (optind < argc);
 }
    
-char *
+char const *
 Getopt_long::current_arg()
 {
-    if (optind >= argc)
+    if (array_index_i_ >= argument_count_i_)
        return 0;
-    char * a = argv[optind];
-    return a + optindind;
+    char const * a = arg_value_ch_a_a_[array_index_i_];
+    return a + argument_index_i_;
 }
 
-char *
+char const *
 Getopt_long::get_next_arg()
 {
-    char * a = current_arg();
-    if ( a) {
-       optind ++;
-       optindind = 0;
+    char const * a = current_arg();
+    if (a) {
+       array_index_i_ ++;
+       argument_index_i_= 0;
     }
     return a;
 }
index bd6a6660d2c6bce301bffb25ed247365ee4e5d6d..5674ca90a35dc9c728166b52a0d8cdb30394d12f 100644 (file)
@@ -66,7 +66,7 @@ File_path::find(String nm)const
         path+= String(path.length_i()? "/":"")+nm;
 
         fdebug << path << "? ";
-        FILE *f = fopen(path, "r"); // ugh!
+        FILE *f = fopen(path.ch_C(), "r"); // ugh!
         if (f) {
             fdebug << "found\n";
             fclose(f);
index b3d80dc62da047dc3752eb993bd8fa81c1b976d6..0a7c423ff5df740155c3a497997575b86a6768d4 100644 (file)
@@ -30,7 +30,7 @@
        eisis   = \melodic_request { -1 2 2 }
        feses   = \melodic_request { -1 3 -2 }
        fes     = \melodic_request { -1 3 -1 }
-       "f"     = \melodic_request { -1 3 0 }
+       f       = \melodic_request { -1 3 0 }
        fis     = \melodic_request { -1 3 1 }
        fisis   = \melodic_request { -1 3 2 }
        geses   = \melodic_request { -1 4 -2 }
@@ -97,3 +97,7 @@
 
 
 }
+
+
+
+keyCminor =  \key \bes \es \as;
index 5fe3255194c30adc604c4a8fbed95516df99458c..c80d39e6fe268eca69321b16123b29dde09f883d 100644 (file)
@@ -5,7 +5,6 @@
 staff_engraver = \requesttranslator {
                  Engraver "Engraver_group_engraver"
                  \alias "Staff";
-                 \consists "Line_group_engraver";
                  \consists "Bar_engraver";
                  \consists "Clef_engraver";
                  \consists "Key_engraver";
@@ -14,6 +13,8 @@ staff_engraver = \requesttranslator {
                  \consists "Staff_sym_engraver";
                  \consists "Collision_engraver";
                  \consists "Rest_collision_engraver";
+
+                 \consists "Line_group_engraver";
                  \contains \requesttranslator {
                          Engraver  "Voice_group_engravers"
                          \alias "Voice_group";
@@ -37,8 +38,10 @@ piano_staff_engraver = \requesttranslator {
        \alias "Hoenoemjedat";
        \consists "Span_bar_engraver";
        \consists "Vertical_align_engraver";
-       \consists "Line_group_engraver";
        \consists "Piano_bar_engraver";
+
+       % This should come last
+       \consists "Line_group_engraver";
        \contains\requesttranslator { \staff_engraver }
 }
 
@@ -50,6 +53,7 @@ staff_group_engraver = \requesttranslator {
        \consists "Line_group_engraver";
        \contains\requesttranslator { \staff_engraver }
 }
+
 lyric_engraver = \requesttranslator {
        Engraver "Engraver_group_engraver"
        \alias "Lyric";
@@ -68,6 +72,9 @@ orchestral_score_translator = \requesttranslator {
        Engraver Score_engraver
        \alias "Score";
 
+       \consists "Bar_column_engraver";
+       \consists "Bar_number_grav";
+
        \consists "Bar_align_engraver";
        \consists "Clef_align_engraver";
        \consists "Key_align_engraver";
@@ -76,11 +83,10 @@ orchestral_score_translator = \requesttranslator {
        \consists "Vertical_align_engraver";
        \consists "Span_score_bar_engraver";
 
+
        \contains \requesttranslator { \staff_group_engraver }
        \contains \requesttranslator { \lyric_engraver }
        \contains \requesttranslator { \piano_staff_engraver }
-
-       
 }
 
 
diff --git a/init/german.ly b/init/german.ly
new file mode 100644 (file)
index 0000000..7defccd
--- /dev/null
@@ -0,0 +1,93 @@
+%
+% common german names for notes. "es" means flat, "is" means sharp
+%
+% by Roland Meier <meier@informatik.th-darmstadt.de>
+% based on swedish.ly by Mats Bengtsson.
+
+
+%
+% Please note that, while these names are used to enter *notes*, they
+% actually are *melodic*s, i.e. they represent a pitch solely. Notes
+% have a rhythmic part too. This is the reason that we don't write 'note { .. }'
+%
+\notenames {
+       ceses   = \melodic_request { -1 0 -2 }
+       ces     = \melodic_request { -1 0 -1 }
+       c       = \melodic_request { -1 0 0 }
+       cis     = \melodic_request { -1 0 1 }
+       cisis   = \melodic_request { -1 0 2 }
+       deses   = \melodic_request { -1 1 -2 }
+       des     = \melodic_request { -1 1 -1 }
+       d       = \melodic_request { -1 1 0 }
+       dis     = \melodic_request { -1 1 1 }
+       disis   = \melodic_request { -1 1 2 }
+       eses    = \melodic_request { -1 2 -2 }
+       es      = \melodic_request { -1 2 -1 }
+       e       = \melodic_request { -1 2 0 }
+       eis     = \melodic_request { -1 2 1 }
+       eisis   = \melodic_request { -1 2 2 }
+       feses   = \melodic_request { -1 3 -2 }
+       fes     = \melodic_request { -1 3 -1 }
+       f       = \melodic_request { -1 3 0 }
+       fis     = \melodic_request { -1 3 1 }
+       fisis   = \melodic_request { -1 3 2 }
+       geses   = \melodic_request { -1 4 -2 }
+       ges     = \melodic_request { -1 4 -1 }
+       g       = \melodic_request { -1 4 0 }
+       gis     = \melodic_request { -1 4 1 }
+       gisis   = \melodic_request { -1 4 2 }
+       ases    = \melodic_request { -1 5 -2 }
+       as      = \melodic_request { -1 5 -1 }
+       a       = \melodic_request { -1 5 0 }
+       ais     = \melodic_request { -1 5 1 }
+       aisis   = \melodic_request { -1 5 2 }
+       heses   = \melodic_request { -1 6 -2 }
+       b       = \melodic_request { -1 6 -1 }
+       h       = \melodic_request { -1 6 0 }
+       his     = \melodic_request { -1 6 1 }
+       hisis   = \melodic_request { -1 6 2 }
+
+
+       %
+       % upper case: 1 octave lower.
+       %
+
+
+       Ceses   = \melodic_request { -2 0 -2 }
+       Ces     = \melodic_request { -2 0 -1 }
+       C       = \melodic_request { -2 0 0 }
+       Cis     = \melodic_request { -2 0 1 }
+       Cisis   = \melodic_request { -2 0 2 }
+       Deses   = \melodic_request { -2 1 -2 }
+       Des     = \melodic_request { -2 1 -1 }
+       D       = \melodic_request { -2 1 0 }
+       Dis     = \melodic_request { -2 1 1 }
+       Disis   = \melodic_request { -2 1 2 }
+       Eses    = \melodic_request { -2 2 -2 }
+       Es      = \melodic_request { -2 2 -1 }
+       E       = \melodic_request { -2 2 0 }
+       Eis     = \melodic_request { -2 2 1 }
+       Eisis   = \melodic_request { -2 2 2 }
+       Feses   = \melodic_request { -2 3 -2 }
+       Fes     = \melodic_request { -2 3 -1 }
+       F       = \melodic_request { -2 3 0 }
+       Fis     = \melodic_request { -2 3 1 }
+       Fisis   = \melodic_request { -2 3 2 }
+       Geses   = \melodic_request { -2 4 -2 }
+       Ges     = \melodic_request { -2 4 -1 }
+       G       = \melodic_request { -2 4 0 }
+       Gis     = \melodic_request { -2 4 1 }
+       Gisis   = \melodic_request { -2 4 2 }
+       Ases    = \melodic_request { -2 5 -2 }
+       As      = \melodic_request { -2 5 -1 }
+       A       = \melodic_request { -2 5 0 }
+       Ais     = \melodic_request { -2 5 1 }
+       Aisis   = \melodic_request { -2 5 2 }
+       Heses   = \melodic_request { -2 6 -2 }
+       B       = \melodic_request { -2 6 -1 }
+       H       = \melodic_request { -2 6 0 }
+       His     = \melodic_request { -2 6 1 }
+       Hisis   = \melodic_request { -2 6 2 }
+
+
+}
index 0ee376eac48cf3d78222c2325f5a7ee07e2a84e1..95602c32357c2060ea402cf29472900568022472 100644 (file)
@@ -1,6 +1,6 @@
 
 \include "performer.ly"
 default_midi = \midi {
-        \tempo 4:60;
+        \tempo 4=60;
        \requesttranslator{ \default_midi_perf }
 }
index 6a1c283df0cab8561540f52c968da57514fef9b7..9f37993065cb8df2811dcb772bf67ac767f48262 100644 (file)
@@ -25,6 +25,8 @@ lfheel = \script { "fheel" 0 0 -1  0 0 }
 rfheel = \script { "fheel" 0 0 1 0 0 }
 lftoe = \script { "ftoe" 0 0 -1 0 0 }
 rftoe = \script { "ftoe" 0 0 1 0 0 }
+turn = \script { "turn" 0 0 1 0 0 }
+
 %
 % left toe:      right heel:
 %
index 22f16645e0a87e3e1b8fc7668113c338b7d284f1..f679da11956ec889e5bd0e18a9cea1b3037d1c3c 100644 (file)
@@ -27,7 +27,7 @@
        eississ = \melodic_request { -1 2 2 }
        fessess = \melodic_request { -1 3 -2 }
        fess    = \melodic_request { -1 3 -1 }
-       "f"     = \melodic_request { -1 3 0 }
+       f       = \melodic_request { -1 3 0 }
        fiss    = \melodic_request { -1 3 1 }
        fississ = \melodic_request { -1 3 2 }
        gessess = \melodic_request { -1 4 -2 }
index 62baead4666cf7abb02d613ac5ab69bf27185208..8d84256d94e0a0e23f779864e0001ceccf87f166 100644 (file)
@@ -1,4 +1,4 @@
-\version "0.1.0";
+\version "0.1.1";
 
 \include "dynamic.ly"
 \include "dutch.ly" 
@@ -8,6 +8,7 @@
 % ugh
 \include "midi.ly"
 
+% declarations for standard directions
 left = -1
 right = 1
 up = 1
index ebc9c375a44714b7103b75e4f6c00cae461d9de5..f3fdd6de458fc62a2d11ec636d1a491c20098291 100644 (file)
@@ -36,6 +36,7 @@ table_sixteen=
            "ftoe" "\ftoe"                      0.0\pt  6.0\pt  -1.0\pt 5.0\pt
            "-back" "\backorfront"              0.0\pt  6.0\pt  0.0\pt  3.0\pt
            "front" "\backorfront"              0.0\pt  6.0\pt  0.0\pt  3.0\pt
+           "turn"  "\turn"                     -2.0\pt 7.0\pt  0.0\pt  4.0\pt
        }
 
      "style" = \table {
index ff17863b409191f75610f39029bfda512b362808..7b18bfbf52c00404d6e61bb3e62ce199ff70321f 100644 (file)
@@ -5,7 +5,7 @@
  description: 
  composer(s): heu
  entered-by: jcn
- copyright: GPL
+ copyright: PD
 
  Tested Features: beams and beamflags
 EndMudelaHeader
index 2201747c62849df8cbc84ccc813658297e96dcaa..9814cad784cff7c994c6be7a09f628fea97ce864 100644 (file)
@@ -1,8 +1,9 @@
 %{MudelaHeader
- title:
- description:Cadenza to Mozart Horn concerto 3
- composer(s):unknown
- entered-by:HWN
+ filename: cadenza.ly
+ title: Cadenza ad libitum
+ description: Cadenza to Mozart Horn concerto 3
+ composer(s): unknown
+ entered-by: HWN
  copyright: public domain
 
  Tested Features: cadenza mode
@@ -10,7 +11,7 @@
 EndMudelaHeader
 %}
 
-\version "0.1.0";
+\version "0.1.1";
 
 
 cad = \melodic  {\id "Staff" "french horn";
@@ -42,7 +43,7 @@ cad = \melodic  {\id "Staff" "french horn";
        r8 'a ['b cis]
        \duration 16;   [d cis d e]
        f4~ [f e d c]
-       'b4
+       'b4-\turn
        \octave c'; [2/3 d'8 c'8 a8]1/1
        g2
                \bar "" ;
@@ -51,15 +52,15 @@ cad = \melodic  {\id "Staff" "french horn";
                \bar "" ;
        [g8.(_"a tempo" e g8. )e]
        a4. g8 [f8 e8 d8 c8]
-       'g2 d2^"tr"
+       'g2 d2^"\tr"
        c4
        }
 \score {
        \melodic { \cad }
        \paper {
        
-               unitspace= 14.0\mm;
+               unitspace= 16.0\mm;
                geometric= 1.4;
        }
-       \midi { \tempo 4:90; }
+       \midi { \tempo 4 = 90; }
 }
index d281dc0e74e73d347401279112c09dcd5824dd00..2a9505752b4b56ec4601028b320c4f7299f8a9ea 100644 (file)
@@ -10,7 +10,7 @@
  Tested Features:test the Collision resolution 
 EndMudelaHeader
 %}
-\version "0.1.0";
+\version "0.1.1";
 
 
 
index ac772fdf9f9c1eb5bd404dc39ac2faf24a317d89..8dc5c69796ddf8eb7a73906d725bd38cf784eeaa 100644 (file)
@@ -17,7 +17,7 @@ EndMudelaHeader
 % (maybe even sooner :-)
 %
 
-\version "0.0.58";
+\version "0.1.1";
 
 alto = \melodic{ 
        
diff --git a/input/gallina.ly b/input/gallina.ly
new file mode 100644 (file)
index 0000000..08f9b99
--- /dev/null
@@ -0,0 +1,232 @@
+%{
+From mats.bengtsson@s3.kth.seThu Aug 14 02:11:19 1997
+Date: Wed, 13 Aug 1997 18:24:53 +0200
+From: Mats Bengtsson <mats.bengtsson@s3.kth.se>
+To: Han-Wen Nienhuys <hanwen@stack.nl>
+Subject: Re: brevis? 
+
+[snip]
+
+Here comes a sample score where I've tried to fiddle around with different
+spacing parameters to get a decent layout, but it still looks quite strange.
+For example is the second half of the bar more spread out than the first
+half in many cases. 
+Hopefully it could be useful input to future improvements. I've entered the
+music directly from the 1637 manuscript and intend to publish it public
+domain on for example ftp.gmd.de when finished. You could include it as an
+example in the distribution, but in that case I could add a LaTeX title file.
+There were no beams in the manuscript so I didn't use them in this edition 
+either.
+
+      /Mats
+
+--------------------------------------------------
+%}
+%{
+ title: La Gallina a 2 violini
+ date: 1637
+ source: the manuscript of Canzoni overo Sonate Concertate 
+   libro terzo, opera duodecima 
+ composer(s): Tarquinio Merula (?-?)
+ entered-by: Mats Bengtsson
+ copyright: Public Domain 
+
+ Tested Features: Note placement, multipart score, figured base
+
+%}
+
+vi1=\melodic{
+  \meter 4/4;
+  \octave c'';
+
+  d8 d d d d4 A16 B c A |
+  B8 G G G16 A B8 G G G16 A | 
+  B8 G G A16 B c4 B |
+  A8 D G4. Fis16 E Fis4 |
+  G2 r2 |
+  r1 |
+  d8 d d d d4 A16 B c A |
+  B8 G G G16 A B8 G G G16 A | 
+  B8 G G A16 B c8 e d c |
+  B G c2 B4 |
+  c2 r |
+  r1 |
+  g8 g g g g4 d16 e f d |
+  e8 c c c16 d e8 c c c16 d |
+  e8 c c d16 e f4 e |
+  d8 G c2 B4 |
+  c8 G G G16 A B4 G |
+  r8 G G G16 A B4 G |
+  r8 E16 Fis G8 G  Fis G G Fis|
+  G2 r |
+  r1 |
+  r16 d c B A G Fis E D8 d d d16 c |
+  B8 d d d16 c B8 d d d16 e |
+  fis4 g2 fis4 |
+  r16 g f e d c B A G8 g g g16 f |
+  e8 g g g16 f e8 g g g16 a |
+  b4 c'2 b4 |
+  c'8 g g g16 f e4 d |
+  r8 g g g16 f e4 d |
+  r8 d16 A B8 B16 c A2 |
+  B1 |
+  \meter 3/2;
+  r4 d d d d d |
+  e1. |
+  r4 c c c c c |
+  d1. |
+  r4 d8 c B4 c8 d G4 A8 B |
+  E1. |
+  r4 e8 d cis4 d8 e A4 B8 cis |
+  Fis1. |
+  r4 d d d d d |
+  e e8 d c4 d8 e A4 B8 c |
+  Fis4 fis8 e d4 e8 fis B4 c8 d |
+  G4 g g g g g |
+  a4 c'8 b a4 b8 c' f4 g8 a |
+  d4 g g g g g |
+  a d8 c B4 c8 d A2 |
+  \meter 4/4;
+  B1 |
+  d8 d d d d4 A16 B c A |
+  B8 G G G16 A B8 G G G16 A | 
+  B8 G  c2 B4 |
+  c2 r |
+  g8 g g g g4 d16 e f d |
+  e8 G G G16 A B8 d d d16 e |
+  fis4 g2 fis4 |
+  r16 g f e d c B A G8 g g g16 f |
+  e2 r8 d d d16 e |
+  fis a g fis e d c B A8 d d d16 e |
+  fis4 g2 fis4 |
+  g1
+  \bar "|.";
+}
+
+vi2=\melodic{
+  \meter 4/4;
+  \octave c'';
+
+  r1 | r | r | 
+  d8 d d d d4 A16 B c A |
+  B8 G G G16 A B8 G G G16 A | 
+  B8 G G A16 B c4 B |
+  A8 D G4. Fis16 E Fis4 |
+  G2 r2 |
+  r1 |
+  g8 g g g g4 d16 e f d |
+  e8 c c c16 d e8 c c c16 d |
+  e8 c c d16 e f4 e |
+  d8 G c2 B4 |
+  c2 r |
+  r1 |
+  g8 g g g g4 d16 e f d |
+  e2 r8 G G G16 A |
+  B4 G r8 G G A16 B 
+  c4 B A2 |
+  G r16 d c B A G Fis E |
+  D8 d d d16 c B8 d d d16 e |
+  fis4 g g4. fis8 |
+  g2 r |
+  r16 d c B A G Fis E D8 d d d16 c |
+  B4 c2 B4 |
+  c d G2 |
+  r16 g f e d c B A G8 g g g16 f |
+  e4 d r8 g g g16 f |
+  e4 d r8 c16 G B8 B16 c |
+  A4 G2 Fis4 |
+  G1 |
+  \meter 3/2;
+  r1. |
+  r4 g8 f e4 f8 g c4 d8 e |
+  A1. |
+  r4 a8 g fis4 g8 a d4 e8 fis |
+  B1. |
+  r4 g g g g g |
+  a1. |
+  r4 a a a a a |
+  b d8 c B4 c8 d G4 A8 B |
+  E4 g8 f e4 f8 g c4 d8 e |
+  A4 a8 g fis4 g8 a d4 e8 fis |
+  B4 b8 a g4 a8 b e4 fis8 g |
+  c4 A A A A A |
+  B d8 c B4 c8 d D4 E |
+  Fis2 G Fis |
+  \meter 4/4;
+  G1 |
+  r1 | r1 |
+  g8 g g g g4 d16 e f d |
+  e8 c c c16 d e8 G G G16 A |
+  B8 G c2 B4 |
+  c2 r |
+  r16 d c B A G Fis E D8 d d d16 c |
+  B4 c2 B4 |
+  c8 G G G16 A B d c B A G Fis E |
+  D8 d d d16 e fis16 a g fis e d c B |
+  A d c B A G Fis E D4 d |
+  B1
+  \bar "|.";
+}
+
+bc=\melodic{
+  \clef "bass";
+  \meter 4/4;
+  \octave c;
+
+  G2 d^"4 3" | G1 |
+  g2 c4 G | d1^"3 4 3" |
+  G1 | g2 c4 G |
+  d1^"3 4 3" | G |
+  g2 c4 d | G1^"3 4 3" |
+  c1 | c2 F4 c | 
+  G1^"3 4 3" | c |
+  c2 F4 c | G1^"3 4 3" |
+  c2 G | g G |
+  c4 G d2^"3 4 3" | G g |
+  fis g | d1^"3 4 3" |
+  G2 B | d1^"3 4 3" |
+  G^"3 4 3" | c4 B c2 |
+  G1^"3 4 3" | c4 B c g |
+  c B c G | d1^"3 4 3" |
+  G1 |
+  \meter 3/2;
+  g1. | c |
+  f | d^"\sharp" |
+  g | c |
+  A | d^"\sharp" |
+  G | c |
+  d^"\sharp" | e |
+  f | g1 B2 |
+  d1.^"3 4 3" |
+  \meter 4/4;
+  G1 |
+  g2 fis | g G |
+  g1^"3 4 3" | c |
+  G^"3 4 3" | c2 G |
+  d1^"3 4 3" | G^"3 4 3" |
+  c2 G | d1^"\sharp" ( |
+  ) d^"3 4 3" | G |
+  \bar "|.";
+}
+
+\score{
+  < \multi 3;
+    \vi1
+    \vi2
+    \bc
+  >
+  \paper{
+    geometric=1.2;
+    unitspace=8.\mm;
+    linewidth=18.\cm;
+    gourlay_maxmeasures=4.;
+    gourlay_energybound = 70000.;
+       basicspace = 2.8\pt;
+  }
+}
+
+
+
+
+
index 3baaadf9e1f0c44c734b6910784ed27fd4f54fdc..71b146c9134232fa1571d0f95792a045b94fca21 100644 (file)
@@ -2,12 +2,16 @@
 
  filename:
  title:
+ date:
  description: 
+ opus:
+ source:
  composers:
  entered-by:
  copyright:
-
+ remarks:
  Tested Features:
+
 EndMudelaHeader
 %}
-\version "0.1.0";
+\version "0.1.1";
index 45237a2d7e3a21a1cdee781ce47b361f9a24054a..5d79a702234766c00162a59cfe905d977d728dba 100644 (file)
@@ -10,7 +10,7 @@
  Tested Features: local key, key, forced accidentals
 EndMudelaHeader
 %}
-\version "0.1.0";
+\version "0.1.1";
 
 
 blah = \melodic{
index 0ba3de2f7806dee3b6f480924ee4398e332650d9..6f0451ef6fe8c57e7bbe8a28c8c03afd01c16f86 100644 (file)
@@ -5,12 +5,12 @@
  description:  bare bones version. (written down from memory :-)
  composers: Mozart, KV 265
  entered-by: HWN
- copyright: none
+ copyright: PD
 
  Tested Features: example file with comments
 EndMudelaHeader
 %}
-\version "0.1.0";
+\version "0.1.1";
 
 
 % the % is a comment.
index 141d191a9e222360293d69a50fab69b73f3ba9cf..90ce751c7a8ffa439c5412efc8a398c3349b8867 100644 (file)
@@ -12,7 +12,7 @@ EndMudelaHeader
 %}
 
 
-\version "0.1.0";
+\version "0.1.1";
 
 \score{
        \melodic 
index da3290ec4440a7564a6aea41d9c6e3eb1e8120e0..76ef37688453084b90352867f0e480e76859a25d 100644 (file)
@@ -24,7 +24,7 @@
 % \lbheel \lbheel \lfheel \lftoe
 % \rbheel \rbtoe \rfheel \rftoe
 
-\version "0.1.0";
+\version "0.1.1";
 
 \score{
                \melodic {
index a321ca34a74da7cf90e4a9a3a62f1c859e717f9d..a2ab5383812bf7973ee8fe75d586d9e642d51cfa 100644 (file)
@@ -14,7 +14,7 @@ EndMudelaHeader
 
 
 
-\version "0.1.0";
+\version "0.1.1";
 
 ritme = \melodic{ %\octave ;
        \partial 8;
diff --git a/input/rock.ly b/input/rock.ly
deleted file mode 100644 (file)
index b6434ab..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-mel = \melodic { 
-       [c8 c32 c16] 
-}
index 0e30979237f5500fbc243a5b9df611b2862ef9dc..f69bc1b650a9ee20adecd659a3fee9ad2bfd8144 100644 (file)
@@ -15,7 +15,7 @@ EndMudelaHeader
 % scales with accents.
 %
 
-\version "0.1.0";
+\version "0.1.1";
 blah =         \melodic {
                \meter 6/8;     
                \octave  'c ;
index 51d8a9093f7b4997aa4923aed5c462dabcf36cfc..8e005edee9355bc089ca321d8824099b3548cffd 100644 (file)
@@ -10,7 +10,7 @@
  Tested Features: scripts, text.
 EndMudelaHeader
 %}
-\version "0.1.0";
+\version "0.1.1";
 
 
 blah =         \melodic {
index 1c69f21f99f00a0106566894046f4caeef36539a..35ba9023f2ef40a1fd3c6e805bdb959eae87147c 100644 (file)
@@ -3,6 +3,8 @@
  filename: scsii-menuetto.ly
  title: Solo Cello Suites, Suite II part V, Menuetto I
  description: Cello suite transcribed for Viola
+ source: ?
+ opus: BWV 1008 no. 5
  composers: Johann Sebastian Bach (1685-1750)
  entered-by: JCN
  copyright: public domain
@@ -13,7 +15,7 @@
 EndMudelaHeader
 %}
 
-\version "0.1.0";
+\version "0.1.1";
 
 %% Stuff from MPP version
 % \lefttitle{Menuetto}
@@ -111,7 +113,7 @@ IImenuetto = \melodic{
                \output "scsii-menuetto.out";
        }
        \midi{ 
-               \tempo 4:120;
+               \tempo 4 = 120;
                \output "scsii-menuetto.midi";
        }
 }
index 87223a1b04b950b1c2c5d5e0f17e7520f4f6fd39..b49616ff9e3109e641b160267cfcf446f79669c8 100644 (file)
@@ -5,13 +5,13 @@
  description: 
  composer(s): HWN
  entered-by: HWN
- copyright: GPL
+ copyright: PD
 
  Tested Features: test slurs and ties
 EndMudelaHeader
 %}
 
-\version "0.1.0";
+\version "0.1.1";
 
 \score{
        \melodic{\octave c';
index 1769e18564f22ceebe27cf83d3885c7ccd6e7dec..58d1dd27c1fa4e912836f8f54a9a791a2bb0443f 100644 (file)
@@ -2,18 +2,18 @@
 
  filename: standchen.ly
  title: St\"andchen (Serenade) "Leise flehen meine Lieder"
description:  D.957 No.4
opus:  D. 957 No. 4
  composers: Franz Schubert (1797-1828)
         Text by Ludwig Rellstab (1799-1860)
  entered-by:JCN
- copyright:
+ copyright: public domain
 
  Tested Features: multivoice, accents, lyrics, chords, piano music
 
 EndMudelaHeader
 %}
 
-\version "0.1.0";
+\version "0.1.1";
 
 commands = \melodic{
        \skip 2.*4;
@@ -152,8 +152,11 @@ melodie = \melodic{
 %%48
        \textstyle "italic";
        < 
-       { fis2.~  \group "+1"; \stem \down; f2. }
-       { d'2. ~ \stem \up; d'4 r4_"decresc." d'4 } 
+       { fis2.~
+       %\group "+1"; 
+               \stem \down; f2. }
+       { d'2. ~ \stem \up;
+               d'4 r4_"decresc." d'4 } 
        >
        \textstyle "roman"; |
 %%50
@@ -485,6 +488,6 @@ tekstII = \lyric{
                \output "standchen.out";
        }
        \midi{
-               \tempo 4:54;
+               \tempo 4 = 54;
        }
 }
index a1d59b84c9584fef61158e76580eda4fb95e5979..828796f9d0631d4df0d4d4455016ece5c5f3ee0b 100644 (file)
@@ -1,14 +1,14 @@
 %{MudelaHeader
 
  filename: toccata-fuga-E.ly
- title: toccata and fuga in E-major bwv 566
- description:  
+ title: toccata and fuga in E-major 
+ opus: BWV 566
  toccata: 3 bar excerpt
  2nd fuga: transposed subject --- 4 bar excerpt
 
  composers: Johann Sebastian Bach (1685-1750)
  entered-by: JCN
- copyright:
+ copyright: public domain
 
  Tested Features:
  purpose of this file is testing: 
@@ -20,7 +20,7 @@ EndMudelaHeader
 %}
 
 
-\version "0.1.0";
+\version "0.1.1";
 
 toccata_commands = \melodic{
        \meter 4/4;
@@ -72,6 +72,7 @@ fuga2_commands = \melodic{
 
 fuga2_right = \melodic{
        \$fuga2_commands  
+       \clef violin;
        % 15
        \octave c';
        <\multi 2;
@@ -151,7 +152,7 @@ break = \melodic{
        >
        \paper{}
        \midi{
-               \tempo 4:96;
+               \tempo 4 = 96;
        }
 }
 
diff --git a/input/twinkle-pop.ly b/input/twinkle-pop.ly
new file mode 100644 (file)
index 0000000..41561e6
--- /dev/null
@@ -0,0 +1,47 @@
+%{MudelaHeader
+
+ filename: twinkle.ly
+ title: Ah, vous dirais-je, maman 
+ description: twinkle twinkle in pop-song-settings
+ composers: traditional
+
+ entered-by: HWN, chords by Johan Vromans
+ copyright: public domain
+
+ Tested Features: lyrics and chords
+EndMudelaHeader
+%}
+
+\version "0.1.1";
+
+melodie = \melodic {
+        \clef"violin";
+        \meter 2/4 ;
+        \octave  c';
+
+        c4^"C" c |      g     g |       a^"F"  a |      g2^"C"   |
+        f4^"F" f |      e^"C" e |       d^"G7" d |      c2^"C"   |
+        g4^"G" g |      f^"F" f |       e^"C"  e |      d^"G7" d |
+        g^"G"  g |      f^"F" f |       e^"C"  e |      d^"G7" d |
+        c4^"C" c |      g     g |       a^"F"  a |      g2^"C"   |
+        f4^"F" f |      e^"C" e |       d^"G7" d |      c2^"C"   |
+}
+
+texte = \lyric{ 
+         
+        \textstyle "italic";
+        Ah!4 vous dir- ai_- je ma man2
+        Ce4 qui cau- se mon tour- ment2
+        Pa-4 pa veut que je rai- so- nne
+        Comme4 un- e grand- e per- so- nne
+        Moi4 je dis que les bon- bons2
+        Val-4 ent mieux que la rai- son2
+        
+}
+
+\score {
+        <  \melodic <  \id "Piano" "";  \melodie >
+           \lyric   < \id "Lyric" "";  \texte >
+        >
+        \paper { unitspace= 2.5\cm; }
+}
index 4835e7783aad506f57741c0ab8876de59710d7c2..ba47c25d35b2f9df74ad339bec25f9e9a0a5775c 100644 (file)
@@ -3,18 +3,19 @@
  filename: twinkle.ly
  title: twinkle twinkle little star
  description: 
+  traditional song in various languages.
   "Ah, vous dirais-je, maman" 
   "Altijd is Kortjakje ziek"
   "Twinkle twinkle little star"
 
- composers: ?
+ composers: Traditional
  entered-by: HWN & JCN
  copyright: public domain
 
  Tested Features: lyrics
 EndMudelaHeader
 %}
-\version "0.1.0";
+\version "0.1.1";
 
 melody = \melodic{
        \clef violin;
@@ -32,7 +33,7 @@ melody = \melodic{
 
 accompany = \melodic {
        \clef "bass";
-       \octave'c;
+       \octave 'c;
        \duration 4;
        c4 c' | e' c' | f' c' | e' c' | 
        d' b | c' a | f g | c2 | 
@@ -60,6 +61,12 @@ tekst = \lyric{
        midden4 in_de week maar s'_zon- dags niet.2
 }
 
+%{
+
+Ja inderdaad. Dit is geen educatieve danwel muzikaal verantwoorde
+tekst. Mogen wij ook af en toe ergens op afgeven?
+
+%}
 hegedraagjetekst = \lyric{ 
        Al-4 tijd zuigt Bill Gates mijn piek,2
        "\TeX"4 is slecht- ser dan mu- ziek.2
@@ -125,7 +132,7 @@ textiii = \lyric{
                
                % ugh
                \lyric < \id "Lyric" "1"; 
-                       \global \tekst \hegedraagjetekst >
+                       \global \tekst >
                \lyric < \id "Lyric" "2";  \global
                        \texte >
                \lyric < \id "Lyric" "3"; \global
@@ -136,7 +143,7 @@ textiii = \lyric{
                unitspace= 2.5\cm;
        }
        \midi{ 
-               \tempo 4:120 ;
+               \tempo 4 = 120 ;
        }
 }
 
index 6807b651d52b1854d76475ae81266d4d733dfbcd..b3c6234a820a8ec66d08ea70929113569bf20276 100644 (file)
@@ -1,7 +1,10 @@
 %{
- title: Das Wohltemperirte Clavier I, Fuga II (c-minor)
- description: following Henle's Urtext
- composer(s): J.S. Bach
+ filename: wohltemperirt.ly
+ title: Fuga a 3
+ description: Das Wohltemperirte Clavier I, Fuga II (c-minor) 
+ Opus: BWV ?
+ source: Henle's Urtext
+ composer(s): Johann Sebastian Bach (1685-1750)
  entered-by: HWN and Werner Lemberg
  copyright: Public Domain 
 
@@ -9,7 +12,7 @@
 
 %}
 
-\version "0.1.0";
+\version "0.1.1";
 
                                     % should add \need{dutch.ini} for
                                     % correct parsing of note names
@@ -17,7 +20,7 @@
 global = 
     \melodic {
          \meter 4/4;                % should be \meter C
-         \key bes es as; 
+         \keyCminor 
     }
   
 dux =
@@ -173,11 +176,9 @@ bassdux =
                  >
              >
 
-    \paper{
-%      castingalgorithm=0.;
-    }
+    \paper{}
     \midi {
-        \tempo 4:84;
+        \tempo 4 = 84;
     }
 }
 
index 1fbb2d83c27b1022761e7321b0ae083389cd9faa..9538b989aee0ba33619c93bdc755fc300df6472c 100644 (file)
@@ -52,7 +52,7 @@ LOADLIBES +=
 # MAINTARGET = $(bindir)/$(EXECUTABLE)# huh?
 MAINTARGET = $(outdir)/$(LIBRARY)# huh?
 
-default: $(MAINTARGET)
+default: configheader $(MAINTARGET)
 #
 
 localclean:
@@ -68,3 +68,10 @@ include ./$(depth)/make/Rules.make
 -include $(DEPFILES)
 #
 
+.PHONY: configheader
+
+configheader: $(outdir)/config.hh
+
+# Ugh ugh
+$(outdir)/config.hh: config.hh.in
+       sed 's!@datadir@!$(datadir)!'<  $< > $@
index c2e3c152be363cf7035d9389e068a4147a0385ca..666012f0c62c9a7a35a3dc30454891493de69dd0 100644 (file)
@@ -34,7 +34,7 @@ Binary_source_file::error_str( char const* pos_ch_c_l )
        return "";
 
     char const* begin_ch_c_l = pos_ch_c_l - 8 >? ch_C();
-    char const* end_ch_c_l = pos_ch_c_l + 7 <? ch_C() + length_off();
+    char const* end_ch_c_l = pos_ch_c_l + 7 <? ch_C() + length_i();
 
     String pre_str( (Byte const*)begin_ch_c_l, pos_ch_c_l - begin_ch_c_l );
     pre_str = String_convert::bin2hex_str( pre_str );
index 2aa23dfdaa871dd0d93d74f48514c9aa012465ca..1e7112e2c9fbfee2a0403455e452d27663b351d9 100644 (file)
@@ -1,6 +1,6 @@
 /* @configure_input@ */
 #ifndef CONFIG_HH
 #define CONFIG_HH
-#define  DIR_DATADIR "@DIR_DATADIR@"
+#define  DIR_DATADIR "@datadir@/lilypond"
 
 #endif
index 4a46bf9e64b69caacb6abbd9141add9a9e26e828..b2a71951032b5696ffea33e009e064f4e6caf631 100644 (file)
@@ -4,6 +4,7 @@
   source file of the LilyPond music typesetter
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+          Jan Nieuwenhuizen <jan@digicash.com>
 */
 #include <assert.h>
 #include "duration-convert.hh"
@@ -115,9 +116,7 @@ Duration_convert::mom2standardised_dur( Moment mom )
 //     if ( !dur_array_s.length_i() )
        if ( !dur_array_s.size() )
                set_array();
-//     assert( dur_array_s.length_i() );
        assert( dur_array_s.size() );
-//     for ( int i = 0; i < dur_array_s.length_i() - 1; i++ ) {
        for ( int i = 0; i < dur_array_s.size() - 1; i++ ) {
                Moment lower_mom = dur2_mom( dur_array_s[ i ] );
                if ( mom <= lower_mom ) {
@@ -125,22 +124,18 @@ Duration_convert::mom2standardised_dur( Moment mom )
                        // kinda ok
                        if ( i || ( mom / lower_mom > Moment( 3, 4 ) ) )
                                return dur_array_s[ i ];
-                       else
-                               return Duration( 0 );
+                       else {
+                           Duration d;
+                           d.type_i_ = 0;
+                           return d;
+                       }
                }
                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() ];
        return dur_array_s[ dur_array_s.size() - 1 ];
 }
 
index 8c08c128023e1325dd422f38b71b790d680a8ff7..fab55e756c9a10e786667dc476068517c7b444fa 100644 (file)
@@ -3,9 +3,8 @@
 
   source file of the LilyPond music typesetter
 
-  copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
+           Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
 #include "proto.hh"
 int Duration::division_1_i_s = 384 * 4;
 
 
-Duration::Duration( int type_i, int dots_i = 0)
+Duration::Duration()
 {
-// this breaks mi2mu quite effectively
-//    assert(duration_type_b(type_i));
-       type_i_ = type_i;
-       dots_i_ = dots_i;
+       type_i_ = 1;
+       dots_i_ = 0;
        ticks_i_ = 0;
 }
 
@@ -85,12 +82,6 @@ Plet::Plet()
     iso_i_ = 1;
 }
 
-Plet::Plet( int iso_i, int type_i )
-{
-       iso_i_ = iso_i;
-       type_i_ = type_i;
-}
-
 Moment
 Plet::mom()const
 {
diff --git a/lib/file-storage.cc b/lib/file-storage.cc
new file mode 100644 (file)
index 0000000..16bee29
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+  file-storage.cc -- implement Mapped_file_storage
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  Jan Nieuwenhuizen <jan@digicash.com>
+*/
+#include <sys/types.h>         // open, mmap
+#include <sys/stat.h>          // open
+#include <sys/mman.h>          // mmap
+#include <limits.h>            // INT_MAX
+#include <fcntl.h>             // open 
+#include <unistd.h>            // close, stat
+#include <stdio.h>             // fdopen
+#include <string.h>            // strerror
+#include <errno.h>             // errno
+
+
+
+#include "string.hh"
+#include "proto.hh"
+#include "warn.hh"
+#include "file-storage.hh"
+
+Mapped_file_storage::Mapped_file_storage(String s)
+{
+    data_caddr_ = 0;
+    fildes_i_ = 0;
+    size_off_ = 0;
+    open(s);
+}
+
+char const*
+Mapped_file_storage::ch_C()const
+{
+    return (char const*)data_caddr_;
+}
+
+void
+Mapped_file_storage::map()
+{
+    if ( fildes_i_ == -1 )
+       return;
+
+    data_caddr_ = (caddr_t)mmap( (void*)0, size_off_, PROT_READ, MAP_SHARED, fildes_i_, 0 );
+
+    if ( (int)data_caddr_ == -1 )
+       warning( String( "can't map: error no: " ) + strerror( errno ));
+}
+
+
+void
+Mapped_file_storage::open(String name_str)
+{
+    fildes_i_ = ::open( name_str, O_RDONLY );  
+           
+    if ( fildes_i_ == -1 ) {
+       warning( String( "can't open: " ) + name_str + String( ": " ) + strerror( errno )); 
+        return;
+    }
+
+    struct stat file_stat;
+    fstat( fildes_i_, &file_stat );
+    size_off_ = file_stat.st_size;
+    map();
+}
+
+void
+Mapped_file_storage::unmap()
+{
+    if ( data_caddr_ ) {
+       munmap( data_caddr_, size_off_ );
+       data_caddr_ = 0;
+       size_off_ = 0;
+    }
+}
+
+void
+Mapped_file_storage::close()
+{
+    unmap();
+    if ( fildes_i_ ) {
+       ::close( fildes_i_ );
+       fildes_i_ = 0;
+    }
+}
+
+int
+Mapped_file_storage::length_i()const
+{
+    return size_off_;
+}
+
+Mapped_file_storage::~Mapped_file_storage()
+{
+    close();
+}
index c8554f343a3b0620fb42b4359c6833a47fde765d..c46fc5a7c0d7320ad4ef9834ec46e421e970e6fa 100644 (file)
 // ugh, to get me in lily lib
 extern bool no_triplets_bo_g;
 
-/** (plet)
-  The type and replacement value of a  plet (triplet, quintuplet.) Conceptually the same as a rational, but 4/6 != 2/3 
+/** 
+  The type and replacement value of a  plet (triplet, quintuplet.) Conceptually the same as a rational, but 4/6 != 2/3.
+  
+  (plet)
  */
 struct Plet {
-    Plet( int replace_i, int type_i );
     Plet();
     Moment mom()const;
     bool unit_b()const;
@@ -39,7 +40,7 @@ struct Duration {
     /**
       Ctor of Duration. type_i should be a power of 2. 
        */
-    Duration( int type_i = 1, int dots_i = 0);
+    Duration();
     /// is the "plet factor" of this note != 1 ?
     bool plet_b();
     String str()const;
diff --git a/lib/include/file-storage.hh b/lib/include/file-storage.hh
new file mode 100644 (file)
index 0000000..8500462
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+  file-storage.hh -- declare File_storage, Mapped_file_storage, Simple_file_storage
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef FILE_STORAGE_HH
+#define FILE_STORAGE_HH
+
+#include "proto.hh"
+
+/**
+  store a file in-memory.
+ */
+class File_storage
+{
+public:
+    virtual char const* ch_C()const=0;
+    virtual int length_i()const=0;
+    virtual ~File_storage(){}
+};
+
+/**
+  Use mmap to "copy"  a file into memory
+ */
+class Mapped_file_storage:public File_storage
+{
+public:
+    Mapped_file_storage(String);    
+protected:
+    virtual char const* ch_C()const;
+    virtual int length_i()const;
+    virtual ~Mapped_file_storage();
+private:
+    void open(String name);
+    void close();
+
+    void map();
+    void unmap();
+    int fildes_i_;
+    off_t size_off_;
+    caddr_t data_caddr_;
+};
+
+/**
+  read file char by char and copy into a malloc array.
+ */
+class Simple_file_storage  : public File_storage
+{
+    char * data_p_;
+    int len_i_;
+protected:    
+    virtual char const*ch_C()const;
+    virtual int length_i()const;
+    virtual ~Simple_file_storage();
+public:
+    Simple_file_storage(String);
+};
+#endif // FILE_STORAGE_HH
index 17a7b341a8dcc408283ae5bbcdc4ddbc3c0ef894..21cadf9b791e4f953c8524196b015c72a5bb8d06 100644 (file)
@@ -14,4 +14,7 @@ struct Duration;
 struct Duration_iterator;
 struct Source_file;
 struct Sources;
+struct File_storage;
+struct Mapped_file_storage;
+struct Simple_file_storage;
 #endif // PROTO_HH
index 6fdcc5d88a56dd6c2e7200df10d2fcaf2fe68b79..39cd533e410cdc6b7a011c78ca259ae8f464f51d 100644 (file)
@@ -5,9 +5,13 @@
 
 #ifndef SOURCE_FILE_HH
 #define SOURCE_FILE_HH
-#include "fproto.hh"
+
+#include "proto.hh"
 #include "string.hh"
+
 class istream;
+
+
 /// class for reading and mapping a file. 
 class Source_file
 {
@@ -17,26 +21,19 @@ public:
     Source_file( String filename_str_r );
     virtual ~Source_file();
 
-    char const* ch_C();
-    virtual String error_str( char const* pos_ch_c_l );
+    char const* ch_C()const;
+    virtual String error_str( char const* pos_ch_c_l )const;
     istream * istream_l();
-    bool in_b( char const* pos_ch_c_l );
-    off_t length_off();
-    virtual int line_i( char const* pos_ch_c_l );
-    String name_str();
-    String file_line_no_str( char const* ch_c_l );
+    bool in_b( char const* pos_ch_c_l )const;
+    int length_i()const;
+    virtual int line_i( char const* pos_ch_c_l )const;
+    String name_str()const;
+    String file_line_no_str( char const* ch_c_l )const;
 
 private:
-    void close();
-    void map();
-    void open();
-    void unmap();
-
-    istream* istream_p_;
-    int fildes_i_;
     String name_str_;
-    off_t size_off_;
-    caddr_t data_caddr_;
+    istream* istream_p_;
+    File_storage * storage_p_;
 };
 
 #endif // SOURCE_FILE_HH //
index bc4a859c0a2121869443c65b6cd5e4c433fe3f7c..9d443ed0dbd50766946e589606320e8843858e8d 100644 (file)
@@ -14,6 +14,7 @@ public:
     void set_path(File_path*p_C);
     Sources();
     void set_binary(bool);
+    ~Sources();
 private:
     const File_path * path_C_;
     void add( Source_file* sourcefile_p );
diff --git a/lib/simple-file-storage.cc b/lib/simple-file-storage.cc
new file mode 100644 (file)
index 0000000..be022ce
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+  simple-file-storage.cc -- implement Simple_file_storage
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include <stdio.h>
+
+#include "file-storage.hh"
+#include "varray.hh"
+#include "string.hh"
+#include "warn.hh"
+
+/**
+  Stupid but foolproof way of opening files.
+
+  TODO 
+  Should use obstack. Should check IO status
+
+  This is of course a build it yourself version of mmap, so we should
+  have been using that... (see Mapped_file_storage) But we noticed
+  some problems with this (unexplained lexer crashes)
+  
+  */
+
+Simple_file_storage::Simple_file_storage(String s)
+{
+    data_p_ =0;
+    FILE * f = fopen ( s.ch_C(), "r");
+    if ( !f ) {
+       warning("can't open file\n");
+       return ;
+    }
+
+    int ret = fseek( f, 0, SEEK_END);
+    len_i_ = ftell(f);
+    rewind(f);
+    data_p_ = new char[len_i_+1];
+    data_p_[len_i_] = 0;
+    ret = fread(data_p_, sizeof(char), len_i_, f);
+    assert (ret==len_i_);
+    fclose(f);
+}
+
+char const*
+Simple_file_storage::ch_C() const
+{
+    return data_p_;
+}
+
+int
+Simple_file_storage::length_i()const
+{
+    return len_i_;
+}
+    
+
+Simple_file_storage::~Simple_file_storage()
+{
+    delete []data_p_;
+}
index 8f28f9b5f5bb857b5776f41c0f38da662f65426c..ffc7a341ed1d3004b1e93a82c95b474ef4890ee4 100644 (file)
@@ -1,50 +1,40 @@
-//
-// source-file.cc
-//
-
-#include <sys/types.h>         // open, mmap
-#include <sys/stat.h>          // open
-#include <sys/mman.h>          // mmap
-#include <limits.h>            // INT_MAX
-#include <fcntl.h>             // open 
-#include <unistd.h>            // close, stat
-#include <stdio.h>             // fdopen
-#include <string.h>            // strerror
-#include <errno.h>             // errno
+/*
+  source-file.cc -- implement 
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Jan Nieuwenhuizen <jan@digicash.com> 
+  & Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
 #include <assert.h>
 #include <strstream.h>
 
 #include "string.hh"
 #include "proto.hh"
 #include "plist.hh"
-
-
 #include "warn.hh"
 #include "windhoos-suck-suck-suck-thank-you-cygnus.hh"
-
 #include "source-file.hh"
+#include "file-storage.hh"
 
 Source_file::Source_file( String filename_str )
 {
-    data_caddr_ = 0;
-    fildes_i_ = 0;
-    size_off_ = 0;
     name_str_ = filename_str;
     istream_p_ = 0;
-
-    open();
-    if ( fildes_i_ > 0 )
-       map();
+    storage_p_ = new Simple_file_storage(filename_str);
 }
 
 istream*
 Source_file::istream_l()
 {
-    if ( !fildes_i_ )
+    if ( !name_str_.length_i())
        return &cin;
+    
     if ( !istream_p_ ) {
-       if ( size_off_ ) // can-t this be done without such a hack?
-           istream_p_ = new istrstream( ch_C(), size_off_ );
+       if ( length_i() ) // can-t this be done without such a hack?
+           istream_p_ = new istrstream( ch_C(), length_i() );
         else {
            istream_p_ = new istrstream( "", 0 );
            istream_p_->set(ios::eofbit);
@@ -53,35 +43,29 @@ Source_file::istream_l()
     return istream_p_;
 }
 
-Source_file::~Source_file()
+String
+Source_file::file_line_no_str(char const *ch_C )const
 {
-    delete istream_p_;
-    istream_p_ = 0;
-    unmap();
-    close();
+    return name_str() + ": "
+       + String( line_i( ch_C ) );
 }
 
-char const*
-Source_file::ch_C()
+String
+Source_file::name_str()const
 {
-    assert( this );
-    return (char const*)data_caddr_;
+    return name_str_;
 }
-
-void
-Source_file::close()
+Source_file::~Source_file()
 {
-    if ( fildes_i_ ) {
-       ::close( fildes_i_ );
-       fildes_i_ = 0;
-    }
+    delete istream_p_;
+    istream_p_ = 0;
+    delete storage_p_;
 }
-
 String
-Source_file::error_str( char const* pos_ch_C )
+Source_file::error_str( char const* pos_ch_C )const
 {
     char const* data_ch_C = ch_C();
-    char const * eof_C_ = data_ch_C + size_off_;
+    char const * eof_C_ = data_ch_C + length_i();
     if ( !in_b( pos_ch_C ) )
        return "(position unknown)";
 
@@ -121,19 +105,14 @@ Source_file::error_str( char const* pos_ch_C )
 }
 
 bool
-Source_file::in_b( char const* pos_ch_C )
+Source_file::in_b( char const* pos_ch_C )const
 {
-    return ( pos_ch_C && ( pos_ch_C >= ch_C() ) && ( pos_ch_C <= ch_C() + size_off_ ) );
+    return ( pos_ch_C && ( pos_ch_C >= ch_C() ) && ( pos_ch_C <= ch_C() + length_i() ) );
 }
 
-off_t
-Source_file::length_off()
-{
-    return size_off_;
-}
 
 int
-Source_file::line_i( char const* pos_ch_C )
+Source_file::line_i( char const* pos_ch_C )const
 {
     if ( !in_b( pos_ch_C ) )
        return 0;
@@ -146,56 +125,14 @@ Source_file::line_i( char const* pos_ch_C )
     return i;
 }
 
-void
-Source_file::map()
-{
-    if ( fildes_i_ == -1 )
-       return;
-
-    data_caddr_ = (caddr_t)mmap( (void*)0, size_off_, PROT_READ, MAP_SHARED, fildes_i_, 0 );
-
-    if ( (int)data_caddr_ == -1 )
-       warning( String( "can't map: " ) + name_str_ + String( ": " ) + strerror( errno ));
-}
-
-String
-Source_file::name_str()
-{
-    return name_str_;
-}
-
-void
-Source_file::open()
+int
+Source_file::length_i()const
 {
-    if ( !name_str_.length_i() || ( name_str_ == "-" ) ) {
-       fildes_i_ = 0;
-       return;
-    }
-
-    fildes_i_ = ::open( name_str_, O_RDONLY ); 
-           
-    if ( fildes_i_ == -1 ) {
-       warning( String( "can't open: " ) + name_str_ + String( ": " ) + strerror( errno )); 
-        return;
-    }
-
-    struct stat file_stat;
-    fstat( fildes_i_, &file_stat );
-    size_off_ = file_stat.st_size;
+    return storage_p_->length_i();
 }
 
-void
-Source_file::unmap()
+char const *
+Source_file::ch_C()const
 {
-    if ( data_caddr_ ) {
-       munmap( data_caddr_, size_off_ );
-       data_caddr_ = 0;
-       size_off_ = 0;
-    }
-}
-String
-Source_file::file_line_no_str(char const *ch_C )
-{
-    return name_str() + ": "
-       + String( line_i( ch_C ) );
+    return storage_p_->ch_C();
 }
index 6be3ca42fc82473dc10dd351542674153a8776f2..ec490f17e727fed3142d70c04ef86009d6b9bf3b 100644 (file)
@@ -72,3 +72,6 @@ Sources::sourcefile_l( char const* ch_C )
            return *sourcefile_l_pcur;
     return 0;
 }
+
+Sources::~Sources()
+{}
index 1cee326a744dfadf6bea9f38f04b2b5e644c8e47..16f59f5d5c660768787c8965626f5875ecefe313 100644 (file)
@@ -37,7 +37,7 @@ EXTRA_DISTFILES = VERSION
 
 # list of custom libraries:
 #
-MODULE_LIBDEPS= check-flower-deps check-lily-deps
+MODULE_LIBDEPS= check-flower-deps check-lib-deps 
 MODULE_LIBES= -llily -lflower
 
 #
@@ -70,3 +70,8 @@ localinstall: installexe
 localuninstall: uninstallexe
 
 $(outdir)/lily-version.o: $(outdir)/version.hh
+
+# make config.hh. Ugh
+$(outdir)/main.o: $(libout)/config.hh
+
+$(libout)/config.hh: check-lib-deps
index 885745a247c5d518ef9d6bd118b1c4c6558de138..c6d2ee88d978a3da62dbe4afbc6fb75c6a5cca22 100644 (file)
@@ -1,10 +1,10 @@
 # kept in dist bo stripping stable stuff, still to copy...
 
 # a bit of a hack to keep exec size under control.
-stablecc=atom.cc command-request.cc musical-request.cc bar.cc boxes.cc \
+stablecc=atom.cc  bar.cc boxes.cc \
        keyword.cc leastsquares.cc \
        lookup.cc meter.cc\
-       parser.cc \
+       parser.cc notename-table.cc lexer.cc\
        qlp.cc qlpsolve.cc\
-       template*.cc  template6.cc version.cc tex-stream.cc  tex.cc\
+       template*.cc  version.cc tex-stream.cc  tex.cc\
        identifier.cc note.cc
index 013490db64f6405e364965f74cf70f94021f3e8a..c04453cdaa59eb20b92f1fb6684db8da8a604e2f 100644 (file)
@@ -1,6 +1,6 @@
 MAJOR_VERSION = 0
 MINOR_VERSION = 1
-PATCH_LEVEL = 1
+PATCH_LEVEL = 7
 # use to send patches, always empty for released version:
 # include separator: ".postfix", "-pl" makes rpm barf
 
index f90625a25f46e610bb53ed5870f301458ca086af..0d8eb44f44cc59ad9130ff6625988b2b838a771c 100644 (file)
 #include "varray.hh"
 #include "debug.hh"
 
-
-
 void
 Atom::print() const
 {
+#ifndef NPRINT
     mtor << "texstring: " <<sym_.tex<<"\n";    
+#endif
 }
 
 Box
@@ -39,14 +39,14 @@ String
 Atom::TeX_string() const
 {
     /* infinity checks. */
-    assert( abs(off_.x) < 100 CM);
-    assert( abs(off_.y) < 100 CM);
+    assert( abs(off_.x()) < 100 CM);
+    assert( abs(off_.y()) < 100 CM);
     
     // whugh.. Hard coded...
     String s("\\placebox{%}{%}{%}");
     Array<String> a;
-    a.push(print_dimen(off_.y));
-    a.push(print_dimen(off_.x));
+    a.push(print_dimen(off_.y()));
+    a.push(print_dimen(off_.x()));
     a.push(sym_.tex);
     return substitute_args(s, a);
 }
diff --git a/lily/audio-element.cc b/lily/audio-element.cc
new file mode 100644 (file)
index 0000000..6ab6c02
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+  audio-element.cc -- implement Audio_element
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "audio-element.hh"
+IMPLEMENT_IS_TYPE_B(Audio_element);
+Audio_element::~Audio_element()
+{}
index 689c34af3851cebc7e5f87fe7ed7e8a79e4ff0f0..a041a7d2f3112a34b8dafc62f769e662e00a1073 100644 (file)
@@ -9,12 +9,17 @@
 #include "audio-item.hh"
 #include "midi-item.hh"
 
-#if 0
 Audio_instrument::Audio_instrument( String instrument_str )
        : Audio_item( 0 )
 {
+    str_ = instrument_str;
+}
+
+Midi_item*
+Audio_instrument::midi_item_p()
+{
+    return new Midi_instrument( 0, str_ );
 }
-#endif
                                       
 Audio_item::Audio_item( Request* req_l )
 {
@@ -34,10 +39,9 @@ Audio_key::midi_item_p()
 }
 
 
-Audio_note::Audio_note( Request* req_l, bool on_b )
+Audio_note::Audio_note( Request* req_l )
        : Audio_item( req_l )
 {
-    on_b_ = on_b;
 }
 
 Midi_item*
@@ -82,3 +86,5 @@ Audio_text::midi_item_p()
     return new Midi_text( this );
 }
 
+
+IMPLEMENT_IS_TYPE_B1(Audio_item, Audio_element);
index 8094b3e369a07eecd4f81fe6396a9eed8b1c6e48..27f82a074699a413b34df8070d406ed297b77e97 100644 (file)
@@ -6,49 +6,98 @@
   (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
 */
 
+#include <time.h>
 #include "debug.hh"
+#include "string.hh"
+#include "string-convert.hh"
+#include "main.hh"
 #include "midi-def.hh"
+#include "midi-item.hh"
+#include "midi-stream.hh"
 #include "audio-column.hh"
+#include "audio-staff.hh"
 #include "audio-score.hh"
+#include "score.hh"
 
-Audio_score::Audio_score( Midi_def* l )
+Audio_score::Audio_score( Score* l )
 {
-    midi_l_ = l;
+    score_l_ = l;
 }
 
 void
-Audio_score::play( Audio_item* i, Audio_column* c )
+Audio_score::add( Audio_column* p )
 {
-    assert( c );
-    assert( i );
+    p->audio_score_l_ = this;
+    audio_column_p_list_.bottom().add(p);
+}
 
-    c->add( i );
-//    typeset_element( i );
+void
+Audio_score::output( Midi_stream& midi_stream_r )
+{
+    int tracks_i = audio_staff_l_list_.size() + 1;
+    // ugh
+    int clocks_per_4_i = 384;
+    midi_stream_r << Midi_header( 1, tracks_i, clocks_per_4_i );
+    output_header_track( midi_stream_r );
+    int n = 1;
+    for ( PCursor<Audio_staff*> i( audio_staff_l_list_ ); i.ok(); i++ )
+       i->output( midi_stream_r, n++ );
 }
 
 void
-Audio_score::add( Audio_column* p )
+Audio_score::output_header_track( Midi_stream& midi_stream_r )
 {
-    p->audio_score_l_ = this;
-    audio_column_p_list_.bottom().add(p);
+    Midi_track midi_track;
+    
+    time_t t = time( 0 );
+
+    // perhaps multiple text events?
+    String str = String( "Creator: " ) + get_version_str() + "\n";
+
+    Midi_text creator( Midi_text::TEXT, str );
+    midi_track.add( Moment( 0 ), &creator );
+
+    str = "Automatically generated at ";
+    str += ctime( &t );
+    str = str.left_str( str.length_i() - 1 );
+    str += "\n";
+    Midi_text generate( Midi_text::TEXT, str );
+    midi_track.add( Moment( 0 ), &generate );
+
+    str = "from musical definition: ";
+
+    str += score_l_->location_str();
+    Midi_text from( Midi_text::TEXT, str );
+    midi_track.add( Moment( 0 ), &from );
+
+    Midi_text track_name( Midi_text::TRACK_NAME, "Track " 
+                         + String_convert::i2dec_str( 0, 0, '0' ) );
+    midi_track.add( Moment( 0 ), &track_name );
+
+    Midi_tempo tempo( score_l_->midi_p_->get_tempo_i( Moment( 1, 4 ) ) );
+    midi_track.add( Moment(0), &tempo);
+
+    midi_stream_r  << midi_track;
+}
+
+void
+Audio_score::add_staff( Audio_staff* l )
+{
+    audio_staff_l_list_.bottom().add( l );
 }
 
-#if 0
 void
-Audio_score::output(Tex_stream &ts)
+Audio_score::add(Audio_element *p)
 {
-    ts << "\n "<<  midi_l_->lookup_l()->texsetting << "%(Tex id)\n";
-    ts<< super_elem_l_->TeX_string();
-    ts << "\n\\EndLilyPondOutput";
+    audio_elem_p_list_.bottom().add( p);
 }
-#endif
 
 void
 Audio_score::print() const
 {    
 #ifndef NPRINT
     mtor << "Audio_score { ";
-    midi_l_->print();
+    score_l_->midi_p_->print();
     mtor << "\ncolumns: ";
     for ( PCursor<Audio_column*> i( audio_column_p_list_ ); i.ok(); i++ )
        i->print();
@@ -59,15 +108,5 @@ Audio_score::print() const
 void
 Audio_score::process()
 {
-#if 0
-    clean_cols();
-    print();
-    *mlog << "Preprocessing elements... " <<flush;
-    preprocess();
-    *mlog << "\nCalculating column positions ... " <<flush;
-    calc_breaking();
-    *mlog << "\nPostprocessing elements..." << endl;
-    postprocess();
-#endif
 }
 
diff --git a/lily/axis-group-item.cc b/lily/axis-group-item.cc
new file mode 100644 (file)
index 0000000..bc1bffd
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+  axis-item.cc -- implement Axis_group_item
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "axis-group-item.hh"
+#include "p-col.hh"
+
+IMPLEMENT_IS_TYPE_B2(Axis_group_item, Axis_group_element, Item);
+
+void
+Axis_group_item::OK() const
+{
+    Link_array<Score_elem> elems = axis_admin_.elem_l_arr_; 
+    for (int i=0; i < elems.size(); i++) {
+       Item * it_l = elems[i]->item();
+       assert(it_l);
+  
+       // somebody probably broke it in pieces
+       assert (it_l->pcol_l_ == pcol_l_ );
+    }
+}
+
+void
+Axis_group_item::do_breakable_col_processing()
+{
+    if (!pcol_l_->breakable_b())
+       return;
+    OK();
+    copy_breakable_items();
+    
+           
+    Link_array<Score_elem> elems = axis_admin_.elem_l_arr_; 
+    for (int i=0; i < elems.size(); i++) {
+       Item* it_l = elems[i]->item();
+       for ( int j=0; j < 2; j++) {
+           Item *new_l = it_l->find_prebroken_piece(broken_to_a_[j]->pcol_l_);
+           ((Axis_group_item*)broken_to_a_[j])->add_element( new_l );
+       }
+    }
+    Item::do_breakable_col_processing();
+}
+
+void
+Axis_group_item::do_print() const
+{ 
+    Axis_group_element::do_print(); 
+}
diff --git a/lily/axis-group-spanner.cc b/lily/axis-group-spanner.cc
new file mode 100644 (file)
index 0000000..94aab23
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+  axis-group-spanner.cc -- implement Axis_group_spanner
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "axis-group-spanner.hh"
+#include "item.hh"
+#include "p-col.hh"
+
+/** Do stuff if we're not broken. In this case the last and first
+  columns usually are pre- and postbreak respectively,
+  so the items from these columns need adjusting.
+  */
+void
+Axis_group_spanner::do_break_processing_if_unbroken()
+{
+    Link_array<Score_elem> elems = axis_admin_.elem_l_arr_;
+    Line_of_score *my_line = line_l();
+    for (int i=0; i < elems.size(); i++) {
+       if (!elems[i]->line_l()) {
+           Item * item_l = elems[i]->item();
+           if  (item_l
+                && item_l->breakable_b_ 
+                && item_l->break_status_i() == 0) {
+               // last two checks are paranoia
+               Item * broken_item_l = 
+                   item_l->find_prebroken_piece( my_line );
+               add_element( broken_item_l );
+           }
+           remove_element( elems[i] );  
+       }
+    }
+    
+}
+void
+Axis_group_spanner::do_break_processing()
+{
+    set_my_columns();
+    bool breaking_self_b = ! Spanner::line_l();
+    if (!breaking_self_b)  {
+       do_break_processing_if_unbroken();
+       Spanner::do_break_processing();
+       return;
+    }
+
+    break_into_pieces( true );
+    Link_array<Score_elem> loose_elems = axis_admin_.elem_l_arr_;
+    remove_all();
+    
+    for (int i=0; i < loose_elems.size(); i++) {
+       Score_elem * elt = loose_elems[i];
+       Line_of_score *elt_line = elt->line_l();
+       
+       if ( ! elt_line ){
+           /* this piece doesn't know where it belongs.
+              Find out if it was broken, and use the broken remains
+              */
+           if (elt->spanner()) {
+               Spanner * sp = elt->spanner();
+               
+               for (int j =0; j < broken_into_l_arr_.size(); j++) {
+                   Axis_group_spanner * my_broken_l
+                        = (Axis_group_spanner*)broken_into_l_arr_[j];
+                   
+                   Spanner * broken_span_l 
+                       = sp->find_broken_piece(
+                           ((Score_elem*)my_broken_l)->line_l());
+                   
+                   if (broken_span_l) 
+                       my_broken_l->add_element(broken_span_l );
+                   
+               }
+           } else if (elt->item() 
+                      && elt->item()->breakable_b_ 
+                      && elt->item()->break_status_i() == 0) {
+
+               // broken items
+               for (int j =0; j < 2; j++) {
+                   Item * my_item = elt->item()->broken_to_a_[j];
+                   Line_of_score * item_line_l = my_item->line_l() ;
+                   if ( ! item_line_l ) 
+                       continue;
+                   
+                   Axis_group_spanner * v
+                       = (Axis_group_spanner*)find_broken_piece( item_line_l );
+                   if (v)
+                       v->add_element( my_item );
+               }
+                   
+           }
+       } else {
+         /* this piece *does* know where it belongs.
+            Put it in appropriate piece of this spanner
+            */
+           Axis_group_spanner * my_broken_l
+               = (Axis_group_spanner*)find_broken_piece( elt->line_l() );
+           my_broken_l->add_element( elt );
+       }
+    }
+    
+    Spanner::do_break_processing();
+}
+
+void
+Axis_group_spanner::do_print() const
+{
+    Axis_group_element::do_print();
+}
+
+
+
+IMPLEMENT_IS_TYPE_B2(Axis_group_spanner, Spanner, Axis_group_element);
diff --git a/lily/axis-group.cc b/lily/axis-group.cc
new file mode 100644 (file)
index 0000000..b6b5eec
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+  axis-group.cc -- implement Axis_group_administration
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "interval.hh"
+#include "axis-group.hh"
+#include "score-elem.hh"
+#include "debug.hh"
+
+/** don't copy anything: an element can only be in one
+  Axis_group_element at one time.  */
+Axis_group_administration::Axis_group_administration(
+    Axis_group_administration const&)
+{
+}
+
+bool 
+Axis_group_administration::contains_b(Score_elem const *e)const
+{
+    return elem_l_arr_.find_l(e);
+}
+
+Interval
+Axis_group_administration::extent(Axis axis)const
+{
+    Interval r;
+    for (int i=0; i < elem_l_arr_.size(); i++) 
+       r.unite(elem_l_arr_[i]->extent(axis));
+    return r;
+}
+
+void
+Axis_group_administration::add_element(Score_elem*e,
+                                      Axis_group_element*g, Axis a1, Axis a2)
+{
+    assert( ! e->axis_group_l_a_[a1] && !e->axis_group_l_a_[a2] );
+    e->axis_group_l_a_[a1] = g;
+    e->axis_group_l_a_[a2] = g;    
+    elem_l_arr_.push ( e);
+}
+
+
+
+void
+Axis_group_administration::remove_element(Score_elem*e, Axis a1, Axis a2)
+{
+    assert( contains_b( e));
+    elem_l_arr_.unordered_substitute(e,0);
+    
+    e->axis_group_l_a_[a1] = 0;
+    e->axis_group_l_a_[a2] = 0;    
+}
+
+void
+Axis_group_administration::remove_all(Axis a1, Axis a2)
+{
+    for (int i=0; i < elem_l_arr_.size(); i++) { 
+       Score_elem*e=elem_l_arr_[i];
+       e->axis_group_l_a_[a1] = 0;
+       e->axis_group_l_a_[a2] = 0;  
+    }
+    elem_l_arr_.clear();
+}
+
+
+void    
+Axis_group_administration::print() const
+{
+#ifndef NPRINT
+    for (int i=0; i < elem_l_arr_.size(); i++) 
+       mtor << elem_l_arr_[i]->name() << ' ';
+#endif
+}
diff --git a/lily/axis.cc b/lily/axis.cc
new file mode 100644 (file)
index 0000000..eddfd0c
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+  axis.cc -- implement Axis
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "axes.hh"
+#include "string.hh"
+
+String
+axis_name_str(Axis a)
+{
+    return String (a + 'x');
+}
diff --git a/lily/bar-column-grav.cc b/lily/bar-column-grav.cc
new file mode 100644 (file)
index 0000000..1dda511
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+  bar-column-grav.cc -- implement Bar_column_engraver
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#include "bar-column-grav.hh"
+#include "bar-column.hh"
+#include "request.hh"
+#include "script.hh"
+#include "bar.hh"
+
+Bar_column_engraver::Bar_column_engraver()
+{
+    bar_l_ =0;
+    barcol_p_ =0;
+}
+
+
+void
+Bar_column_engraver::acknowledge_element(Score_elem_info info)
+{
+    if (info.elem_l_->is_type_b(Script::static_name()) 
+       && info.req_l_->command()
+       && info.origin_grav_l_arr_.size() == 1) {
+       script_l_arr_.push( (Script*)info.elem_l_->item());
+    } else {
+       if  (info.origin_grav_l_arr_.size() == 1 
+            && info.elem_l_->is_type_b(Bar::static_name()))
+            bar_l_ = (Bar*)info.elem_l_->item();
+    }
+       
+    if ( bar_l_ && !barcol_p_ ) {
+       barcol_p_ = new Bar_column;
+       barcol_p_->breakable_b_ =true;
+       barcol_p_->set_bar( bar_l_ );
+       announce_element(Score_elem_info(barcol_p_, 0));
+    }
+
+    if  (barcol_p_ ) {
+       for (int i=0; i < script_l_arr_.size(); i++) {
+           script_l_arr_[i]->breakable_b_ = true;
+           barcol_p_->add(script_l_arr_[i]);
+       }
+       script_l_arr_.clear();
+    }
+}
+
+void
+Bar_column_engraver::do_pre_move_processing()
+{
+    if (barcol_p_) {
+       typeset_element( barcol_p_ );
+       barcol_p_ =0;
+    }
+}
+
+void
+Bar_column_engraver::do_post_move_processing()
+{
+    script_l_arr_.clear();
+    bar_l_ =0;
+}
+
+IMPLEMENT_IS_TYPE_B1(Bar_column_engraver, Engraver);
+ADD_THIS_ENGRAVER(Bar_column_engraver);
diff --git a/lily/bar-column.cc b/lily/bar-column.cc
new file mode 100644 (file)
index 0000000..123b512
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+  bar-column.cc -- implement Bar_column
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "bar.hh"
+#include "bar-column.hh"
+
+Bar_column::Bar_column()
+{
+    bar_l_ =0;
+    breakable_b_ = true;
+}
+
+void
+Bar_column::set_bar(Bar*b)
+{
+    Script_column::add_support( b );
+    bar_l_ = b;        
+}
+
+void
+Bar_column::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+    Script_column::do_substitute_dependency(o,n);
+    if ( o == bar_l_ ) {
+       bar_l_ = n ? (Bar*)n->item() : 0;
+    }
+}
+
+IMPLEMENT_IS_TYPE_B1(Bar_column, Script_column);
+
index 3362ce00245b059eb3a1a56765dc465a99f475f6..3847e9a5ba298e1043b05f8e457cd8debaca4dc1 100644 (file)
@@ -24,7 +24,7 @@ Bar_engraver::do_try_request(Request*r_l)
     if (!c_l|| !c_l->bar()) 
        return false;
     Bar_req  * b= c_l->bar();
-    if (bar_req_l_ && bar_req_l_->compare(*b))
+    if (bar_req_l_ && bar_req_l_->equal_b(b))
        return false;
     
     bar_req_l_ = b;
@@ -55,7 +55,7 @@ void
 Bar_engraver::do_pre_move_processing()
 {
       if (bar_p_) {
-         typeset_breakable_item(bar_p_);
+         typeset_element(bar_p_);
          bar_p_ =0;
       }
 }
diff --git a/lily/bar-number-grav.cc b/lily/bar-number-grav.cc
new file mode 100644 (file)
index 0000000..4b0535f
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+  bar-number-grav.cc -- implement Bar_number_grav
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#include "bar-number-grav.hh"
+#include "script.hh"
+#include "text-def.hh"
+#include "command-request.hh"
+#include "bar.hh"
+
+Bar_number_grav::Bar_number_grav()
+{
+    number_i_ =1;
+    script_p_ =0;
+}
+
+static Command_script_req dummy;
+
+void
+Bar_number_grav::acknowledge_element(Score_elem_info i)
+{
+    if (i.origin_grav_l_arr_.size() == 1 &&
+       i.elem_l_->is_type_b( Bar::static_name()) && !script_p_) {
+
+       script_p_ = new Script;
+       Text_def *td_p =new Text_def;
+       td_p->text_str_ = number_i_++;
+       script_p_->specs_l_ = td_p;
+       script_p_->breakable_b_ = true;
+       script_p_->dir_i_ = 1;
+
+       announce_element(Score_elem_info( script_p_, &dummy));
+    }
+}
+
+void
+Bar_number_grav::do_pre_move_processing()
+{
+    if ( script_p_ ) {
+       typeset_element(script_p_);
+       script_p_ =0;
+    }
+}
+
+IMPLEMENT_IS_TYPE_B1(Bar_number_grav,Engraver);
+ADD_THIS_ENGRAVER(Bar_number_grav);
index b45d977b2625914282ed1c060376f8e64d84ccdf..2342d227b256bbbd223e9a4a93f8c6b103c4d709 100644 (file)
@@ -15,6 +15,7 @@
 
 Bar::Bar()
 {
+    breakable_b_ = true;
     type_str_ = "|";
     spanned_i_ = 0;
 }
@@ -40,13 +41,15 @@ Bar::brew_molecule_p()const
 }
 
 /**
+  Prescriptions for splitting bars.
   TODO: parametrise this (input-settable)
  */
-char const *bar_breaks[][3] ={
+static char const *bar_breaks[][3] ={
     {":|", ":|:", "|:"},
     {"|", "|", ""},
     {"", "|:", "|:"},
     {"||.", "||.", ""},
+    {":|", ":|", ""},
     {0,0,0}
 };
 
@@ -58,7 +61,11 @@ Bar::do_pre_processing()
            type_str_ = bar_breaks[i][break_status_i()+1];
     }
   
-    // span_score_bar needs dims.
-//    transparent_b_ = empty_b_ = (type_str_ == "");
+    /*
+      span_score_bar needs dims, so don't do
+    
+      transparent_b_ = empty_b_ = (type_str_ == "");
+      
+      */
 }
     
index 9079d277ba292c8f90b7189377b3ceb07af1be11..4dd852f1882d16e31b81b187227fc6c86093af7c 100644 (file)
@@ -312,7 +312,7 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
        a.translate(Offset (-w, -w * sl));
        for (int j = 0; j  < lhalfs; j++) {
            Atom b(a);
-           b.translate_y( -dir_i_ * dy * (lwholebeams+j));
+           b.translate( -dir_i_ * dy * (lwholebeams+j), Y_AXIS);
            leftbeams.add( b );
        }
     }
@@ -327,7 +327,7 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
        int j = 0;
        for (; j  < rwholebeams; j++) {
            Atom b(a);
-           b.translate_y( -dir_i_ * dy * j);
+           b.translate( -dir_i_ * dy * j, Y_AXIS);
            rightbeams.add( b ); 
        }
 
@@ -337,7 +337,7 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
        
        for (; j  < rwholebeams + rhalfs; j++) {
            Atom b(a);
-           b.translate_y( -dir_i_ * dy * j);
+           b.translate( -dir_i_ * dy * j, Y_AXIS);
            rightbeams.add(b ); 
        }
        
@@ -366,7 +366,7 @@ Beam::brew_molecule_p() const
        sb.translate(Offset(x, (x * slope  + left_pos)* inter_f));
        mol_p->add(sb);
     }
-    mol_p->translate_x(x0 - left_col_l_->hpos_f_);
+    mol_p->translate(x0 - left_col_l_->hpos_f_, X_AXIS);
     return mol_p;
 }
 
index 1798cb93c3033162798b3131d29d248aab1976d2..d06bfd21654d448ea1c3b494e0693e8efbe0ff61 100644 (file)
@@ -8,7 +8,7 @@ Box::Box()
 
 Box::Box(Interval ix, Interval iy)
 {
-    x = ix;
-    y = iy;
+    x() = ix;
+    y() = iy;
 }
 
index 1ef5c4bc6f48b41b63831e14c942e0b9c4889e82..8edb91a8b669785fac6fc04a3396d4e2274a20ae 100644 (file)
@@ -120,7 +120,7 @@ Break_algorithm::Break_algorithm()
 }
 
 void
-Break_algorithm::set_pscore(PScore*s)
+Break_algorithm::set_pscore(Paper_score*s)
 {
     pscore_l_ = s;
     linelength = s->paper_l_->linewidth_f();
index e7126456e2d8830fc9f2610508c99dfdafbdf5e5..a4426bcea2e4a5e19ad1a2425bc36d640d7b9508 100644 (file)
@@ -106,7 +106,7 @@ Clef_engraver::do_pre_move_processing()
 {
     if (!clef_p_)
        return;
-    typeset_breakable_item(clef_p_);
+    typeset_element(clef_p_);
     clef_p_ = 0;
 }
     
index 15cc5687b21786cd60e0c38665d81a9ff78f246f..67742488ca421babf2b6f08450578f870ee13fd1 100644 (file)
@@ -27,6 +27,7 @@ Clef_item::do_pre_processing()
 
 Clef_item::Clef_item()
 {
+    breakable_b_ =true;
     default_b_ = false;
     change_b_ = true;
     read("violin");
@@ -59,7 +60,7 @@ Clef_item::brew_molecule_p()const
        t += "_change";
     Symbol s = paper()->lookup_l()->clef(t);
     Molecule*output = new Molecule(Atom(s));
-    output->translate_y( paper()->internote_f() * y_off);
+    output->translate( paper()->internote_f() * y_off, Y_AXIS);
     return output;
 }
 
index 2a4903d10518cc72127d769d39c03e3a8ce5bd26..8eaa7cd30f45bde0d633d2a26e540da5ad47fc99 100644 (file)
@@ -16,9 +16,10 @@ Collision_engraver::acknowledge_element(Score_elem_info i)
     if (!(i.elem_l_->name() == Note_column::static_name()))
        return;
 
-    if (!col_p_)
+    if (!col_p_) {
        col_p_ = new Collision;
-    
+       announce_element(Score_elem_info(col_p_,0));
+    }
     col_p_->add((Note_column*)i.elem_l_->item());
 }
 
index f9a15bc4fa4a11615a42c022e713fa9c8dc1e197..0af68c462e2e3efc6fe9ca1a61cd264d31997416 100644 (file)
@@ -20,6 +20,7 @@ void
 Collision::add(Note_column* ncol_l)
 {
     clash_l_arr_.push(ncol_l);
+    add_element( ncol_l );
     add_dependency(ncol_l);
 }
 /**
@@ -76,7 +77,7 @@ Collision::do_pre_processing()
     do {
        if (!clash_group_arr_a[idx(d, false)].size()){
            clash_group_arr_a[idx(d,  false)] = clash_group_arr_a[idx(d, true)];
-           clash_group_arr_a[idx(d, true)].set_size(0);
+           clash_group_arr_a[idx(d, true)].clear();
        }
     } while ((d *= -1) != 1);
                                  
@@ -133,10 +134,14 @@ Collision::do_pre_processing()
     Real inter_f = paper()->internote_f();
     Real wid_f = paper()->note_width();
     for (int j=0; j < 4; j++) {
-       if (col_l_a[j])
-           col_l_a[j]->translate(Offset(x_off[j] * wid_f,
-                                        y_off[j] * inter_f));
-       
+       if (col_l_a[j]) {
+           /* collision.cc:138: request for method `translate' is ambiguous 
+              
+              (shaddup)
+            */
+           Offset o(x_off[j] * wid_f, y_off[j] * inter_f);
+           ((Score_elem*)col_l_a[j])->translate(o);
+       }
     }
 }
 
index cf5ef632f8533752febb5df770dbe84127754480..9fe1c9118be6cbe28213eedcd3274c402bf9a12c 100644 (file)
@@ -13,6 +13,7 @@
 void
 Command_script_req::do_print() const
 {}
+Command_script_req::Command_script_req(){}
 
 IMPLEMENT_IS_TYPE_B1(Command_script_req,Command_req);
 
@@ -22,7 +23,17 @@ IMPLEMENT_IS_TYPE_B1(Cadenza_req, Timing_req);
 void
 Cadenza_req::do_print()const
 {
+#ifndef NPRINT
     mtor << on_b_;
+#endif
+}
+
+bool
+Cadenza_req::do_equal_b(Request*r)const
+{
+    Cadenza_req*cad =  r->command()->timing()->cadenza();
+    
+    return cad->on_b_ == on_b_;
 }
 
 Cadenza_req::Cadenza_req(bool b)
@@ -32,10 +43,11 @@ Cadenza_req::Cadenza_req(bool b)
 /* *************** */
 
 
-int
-Bar_req::compare(Bar_req const &c1)const
+bool
+Bar_req::do_equal_b(Request*r)const
 {
-    return type_str_ == c1.type_str_;
+    Bar_req * b = r->command()->bar();
+    return type_str_ == b->type_str_;
 }
 
 
@@ -56,7 +68,14 @@ Partial_measure_req::Partial_measure_req(Moment m)
 {
     duration_ =m;
 }
-/* *************** */
+
+bool
+Partial_measure_req::do_equal_b(Request* r)const
+{
+    Partial_measure_req *p = r->command()->timing()->partial();
+
+    return p->duration_ == duration_;
+}
 
 
 IMPLEMENT_IS_TYPE_B1(Timing_req,Command_req);
@@ -83,6 +102,11 @@ IMPLEMENT_IS_TYPE_B1(Barcheck_req,Timing_req);
 void
 Barcheck_req::do_print() const{}
 
+bool
+Barcheck_req::do_equal_b(Request*)const
+{
+    return true;
+}
 /* *************** */
 
 IMPLEMENT_IS_TYPE_B1(Clef_change_req,Command_req);
@@ -128,13 +152,18 @@ IMPLEMENT_IS_TYPE_B1(Meter_change_req,Timing_req);
 void
 Meter_change_req::do_print() const
 {
+#ifndef NPRINT
     mtor << beats_i_ << "/" << one_beat_i_;
+#endif
 }
 
-int
-Meter_change_req::compare(Meter_change_req const &m)
+bool
+Meter_change_req::do_equal_b(Request * r)const
 {
-    return m.beats_i_ == beats_i_ && one_beat_i_ == m.one_beat_i_;
+    Meter_change_req * m = r->command()->timing()->meterchange();
+    
+    return m->beats_i_ == beats_i_ 
+       && one_beat_i_ == m->one_beat_i_;
 }
 
 Meter_change_req::Meter_change_req()
@@ -150,6 +179,28 @@ Meter_change_req::set(int b,int o)
     one_beat_i_=o;
 }
 
+
+Tempo_req::Tempo_req()
+{
+    metronome_i_ = 60;
+    dur_. type_i_ = 4;
+}
+
+void
+Tempo_req::do_print()const
+{
+    mtor << dur_.str() << " = " <<metronome_i_ ;
+}
+IMPLEMENT_IS_TYPE_B1(Tempo_req, Timing_req);
+
+bool
+Tempo_req::do_equal_b(Request *r)const
+{
+    Tempo_req *t = r->command()->timing()->tempo();
+    
+    return t->dur_.length()== dur_.length() && metronome_i_ == t->metronome_i_;
+}
+
 /* *************** */
 
 
@@ -162,6 +213,14 @@ Measure_grouping_req::do_print() const
        mtor << beat_i_arr_[i] <<"*" << elt_length_arr_[i]<<" ";
     }
 }
+
+
+bool 
+Measure_grouping_req::do_equal_b(Request*)const
+{
+    return false;              // todo
+}
+
 /* *************** */
 
 void
index df349421bb658035b7020c45132a70c39d96d113..8f604dbcba5108b1db0ed06785c4c6bf9a1e3456 100644 (file)
@@ -24,7 +24,7 @@ Crescendo::Crescendo()
 Interval
 Crescendo::symbol_height()const
 {
-    return get_symbol().dim.y;
+    return get_symbol().dim[Y_AXIS];
 }
 
 static Real absdyn_dim = 10 PT;        // ugh
index 8f99590581b991f38b20ef74db08dda47344f5a0..72d76607df46c68345f1198ba67fb946fce9d6e3 100644 (file)
@@ -28,7 +28,7 @@ Dynamic_engraver::Dynamic_engraver()
 void
 Dynamic_engraver::do_post_move_processing()
 {
-    dynamic_req_l_arr_.set_size(0);
+    dynamic_req_l_arr_.clear();
 }
 
 bool    
index 138bd146a372a72beb3c8ee66949f9498325b42a..c22739a849cd149e70282771510049746b4cd060 100644 (file)
@@ -13,7 +13,7 @@
 void
 Horizontal_vertical_group_item::do_print()const
 {
-    Horizontal_vertical_group::do_print();
+    Horizontal_vertical_group_element::do_print();
 }
 
-IMPLEMENT_IS_TYPE_B2(Horizontal_vertical_group_item,Horizontal_vertical_group,Item);
+IMPLEMENT_IS_TYPE_B2(Horizontal_vertical_group_item,Horizontal_vertical_group_element,Item);
index badb6db85102ac2d91bd86d6a0959ea358729806..5115c5c70b77eef2287f224045084daf444a6f8e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- elem-group.cc -- implement Horizontal_vertical_group
+  elem-group.cc -- implement Horizontal_vertical_group_element
 
   source file of the GNU LilyPond music typesetter
 
 #include "item.hh"
 #include "debug.hh"
 
-bool
-Elbement_group::contains_b(Score_elem const*e)const
+void
+Axis_group_element::do_unlink()
 {
-    return elem_l_arr_.find_l(e);
+    remove_all();
 }
 
-Elbement_group::Elbement_group(Elbement_group const &s)
-    : Score_elem(s)
-{
-}
 
-Interval
-Vertical_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
-Horizontal_group::do_width()const 
+bool
+Axis_group_element::contains_b(Score_elem const*e)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;
+    return axis_admin_.contains_b(e);
 }
 
-
-IMPLEMENT_IS_TYPE_B1(Horizontal_group, Elbement_group);
-IMPLEMENT_IS_TYPE_B1(Vertical_group, Elbement_group);
-
-
-void
-Elbement_group::add_element(Score_elem*i_l)
+Link_array<Score_elem>
+Axis_group_element::get_extra_dependencies()const
 {
-    assert(i_l!= this);
-    assert(! contains_b(i_l));
-
-    elem_l_arr_.push(i_l);
-    add_dependency(i_l);
+    return axis_admin_.elem_l_arr_;
 }
 
 void
-Horizontal_group::add_element(Score_elem*elt)
+Axis_group_element::do_print()const
 {
-    assert ( !elt->x_group_l_ );
-    elt->x_group_l_ = this;
-    Elbement_group::add_element(elt);
+    axis_admin_.print();
 }
 
-void
-Vertical_group::add_element(Score_elem*e)
-{
-    assert( ! e->y_group_l_ );
-    e->y_group_l_ = this;
-
-    Elbement_group::add_element(e);
-}
+// ****************
 
 
 void
-Horizontal_group::translate_x(Real x)
+Vertical_group_element::add_element(Score_elem*e)
 {
-    for (int i=0; i < elem_l_arr_.size(); i++) 
-       elem_l_arr_[i]->translate_x(x);
+    axis_admin_.add_element(e, this, Y_AXIS, Y_AXIS);
 }
 
 void
-Vertical_group::translate_y(Real y)
+Vertical_group_element::remove_element(Score_elem*e)
 {
-    for (int i=0; i < elem_l_arr_.size(); i++) 
-       elem_l_arr_[i]->translate_y(y);
+    axis_admin_.remove_element(e, Y_AXIS, Y_AXIS);
 }
 
 
-IMPLEMENT_IS_TYPE_B1(Elbement_group, Score_elem);
-
-void
-Elbement_group::do_print() const
+Interval
+Vertical_group_element::do_height() const
 {
-#ifndef NPRINT
-    for (int i=0; i < elem_l_arr_.size(); i++) 
-       mtor << elem_l_arr_[i]->name() << ' ';
-#endif
+    return axis_admin_.extent(Y_AXIS);
 }
-
 void
-Horizontal_group::do_substitute_dependency(Score_elem* old, Score_elem *new_l)
+Vertical_group_element::remove_all()
 {
-    int i;
-
-    while ((i=elem_l_arr_.find_i(old))>=0) {
-       old->x_group_l_ =0;
-       
-       if (new_l){ 
-           new_l->x_group_l_ = this;
-           elem_l_arr_[i] = new_l;
-       }else {     
-           elem_l_arr_.unordered_del(i);
-       }
-    }
+    axis_admin_.remove_all(Y_AXIS,Y_AXIS);
 }
+// ****************
 
 void
-Vertical_group::do_substitute_dependency(Score_elem* old, Score_elem *new_l)
-{
-    int i;
-
-    while ((i=elem_l_arr_.find_i(old))>=0) {
-       old->y_group_l_ =0;
-       
-       if (new_l){ 
-           new_l->y_group_l_ =this;
-           elem_l_arr_[i] = new_l;
-       }else {     
-           elem_l_arr_.unordered_del(i);
-       }
-    }
-}
-
-Vertical_group::Vertical_group(Vertical_group 
-                              const &s)
-    : Elbement_group(s)
+Horizontal_group_element::remove_all()
 {
+    axis_admin_.remove_all(X_AXIS,X_AXIS);
 }
 
-Horizontal_group::Horizontal_group(Horizontal_group 
-                                  const &s)
-       : Elbement_group(s)
+void
+Horizontal_group_element::add_element(Score_elem*e)
 {
+    axis_admin_.add_element(e,this, X_AXIS,X_AXIS);
 }
 
-Elbement_group::Elbement_group()
+void
+Horizontal_group_element::remove_element(Score_elem*e)
 {
-    transparent_b_ = true;
+    axis_admin_.remove_element(e,X_AXIS,X_AXIS);
 }
 
-IMPLEMENT_IS_TYPE_B2(Horizontal_vertical_group, Horizontal_group, Vertical_group);
 
-
-Horizontal_vertical_group::Horizontal_vertical_group()
+Interval
+Horizontal_group_element::do_width()const
 {
+    return axis_admin_.extent(X_AXIS);
 }
 
-void
-Horizontal_vertical_group::do_substitute_dependency(Score_elem*o,Score_elem*n)
-{
-    Vertical_group::do_substitute_dependency(o,n);
-    Horizontal_group::do_substitute_dependency(o,n);
-}
 
-void
-Horizontal_vertical_group::add_element(Score_elem*e)
-{
-    Vertical_group::add_element(e);
-    Horizontal_group::add_element(e);
-}
+// ****************
 
 void
-Horizontal_vertical_group::do_print()const
+Horizontal_vertical_group_element::remove_all()
 {
-    Vertical_group::do_print();
+    axis_admin_.remove_all(X_AXIS,Y_AXIS);
 }
-
 void
-Vertical_group::do_print()const
+Horizontal_vertical_group_element::add_element(Score_elem *e)
 {
-    Elbement_group::do_print();
+    axis_admin_.add_element(e, this, X_AXIS, Y_AXIS);
 }
 
 void
-Horizontal_group::do_print() const
+Horizontal_vertical_group_element::remove_element(Score_elem*e)
 {
-    Elbement_group::do_print();
+    axis_admin_.remove_element(e, X_AXIS, Y_AXIS);
 }
 
 
 
-void
-Vertical_group::remove_element(Score_elem*s)
-{
-    remove_dependency( s );
-}
-
-void
-Horizontal_group::remove_element(Score_elem*s)
-{
-    remove_dependency( s );
-}
+IMPLEMENT_IS_TYPE_B1(Axis_group_element, Score_elem);
+IMPLEMENT_IS_TYPE_B1(Horizontal_group_element, Axis_group_element);
+IMPLEMENT_IS_TYPE_B1(Vertical_group_element, Axis_group_element);
+IMPLEMENT_IS_TYPE_B2(Horizontal_vertical_group_element, Horizontal_group_element, Vertical_group_element);
index 672c8f2e5f33d760bb314217484b2df1650c98d2..69038b5024eae8375109b40a8cd326a346fe5c76 100644 (file)
 
 Engraver* get_engraver_p(String);
 
+void
+Engraver_group_engraver::print()const
+{ 
+    Engraver::print(); 
+}
+
 Engraver_group_engraver::~Engraver_group_engraver()
 {
     assert(removable_b());
@@ -160,7 +166,7 @@ void
 Engraver_group_engraver::terminate_engraver(Engraver*r_l)
 {
     mtor << "Removing " << r_l->name() << " at " << get_staff_info().when() << "\n";
-    r_l->do_removal_processing();
+    r_l->removal_processing();
     Engraver * grav_p =remove_engraver_p(r_l);
     
     delete grav_p;
@@ -176,7 +182,8 @@ Engraver_group_engraver::do_print()const
 #ifndef NPRINT
     if ( !check_debug)
        return ;
-    mtor << "ID: " << id_str_ << "\n";
+    mtor << "ID: " << id_str_ ;
+    mtor << " iterators: " << iterator_count_<< "\n";
     for (PCursor<Engraver*> i(grav_list_.top()); i.ok(); i++)
        i->print();
 #endif
@@ -266,7 +273,7 @@ Engraver_group_engraver::do_announces()
               nongroup_l_arr_[i]->acknowledge_element(info);
        }
     }
-    announce_info_arr_.set_size(0);
+    announce_info_arr_.clear();
 }
 
 
@@ -274,7 +281,7 @@ void
 Engraver_group_engraver::do_removal_processing()
 {
     for (PCursor<Engraver*> i(grav_list_.top()); i.ok(); i++)
-       i->do_removal_processing();
+       i->removal_processing();
 }
 
 Staff_info
@@ -309,3 +316,16 @@ Engraver_group_engraver::is_bottom_engraver_b()const
 {
     return !itrans_l_->get_default_itrans_l();
 }
+
+Engraver*
+Engraver_group_engraver::get_simple_engraver(char const *type)const
+{
+    for (int i=0; i < nongroup_l_arr_.size(); i++) {
+       if (nongroup_l_arr_[i]->name() == type )
+           return nongroup_l_arr_[i];
+    }
+    if ( daddy_grav_l_ )
+       return daddy_grav_l_->get_simple_engraver(type);
+    return 0;
+}
+
index 4dea919ecaedf486bfb7156f74c7a25182c45aa7..697a4844a20ed14462671b464126fda8d7e5fd05 100644 (file)
@@ -26,6 +26,15 @@ Engraver::post_move_processing()
     status = MOVE_INITED;
 }
 
+void
+Engraver::removal_processing()
+{
+    if ( status < CREATION_INITED )
+       do_creation_processing();
+    
+    do_removal_processing();
+}
+
 bool
 Engraver::try_request(Request * r)
 {
@@ -97,12 +106,6 @@ Engraver::paper()const
     return daddy_grav_l_->paper();
 }
 
-void
-Engraver::typeset_breakable_item(Item * nobreak_p)
-{
-    daddy_grav_l_->typeset_breakable_item(nobreak_p);
-}
-
 bool
 Engraver::contains_b(Engraver *grav_l)const
 {
index 9bf570e5b8a2d9725a91bcbc7fb17aa6585b1749..e755af94c5446f9e70d462dbc48f3d728a4fb85d 100644 (file)
@@ -38,11 +38,11 @@ General_script_def::equal_b(General_script_def const&g)const
     if (name() != g.name())
        return false;
 
-    return do_equal_b(g);
+    return do_equal_b(&g);
 }
 
 bool
-General_script_def::do_equal_b(General_script_def const&)const
+General_script_def::do_equal_b(General_script_def const*)const
 {
     return true;
 }
index 03f6d3cd7ca2e85e5c1233fa666a08b01628be0e..6a0d2376a458eb306ef66a44be190ac5dd3e39b7 100644 (file)
@@ -145,14 +145,18 @@ Gourlay_breaking::do_solve()const
 
     Array<int> final_breaks;
 
+    Array<Col_hpositions> lines;
     /* skip 0-th element, since it is a "dummy" elt*/
     for (int i = optimal_paths.size()-1; i> 0; ) {
        final_breaks.push ( i );
        assert ( i > optimal_paths[i].prev_break_i_);
+
+       // there was no "feasible path"
+       if (!optimal_paths[i].line_config_.config.size() )
+          return lines; 
        i = optimal_paths[i].prev_break_i_;
     }
 
-    Array<Col_hpositions> lines;
     for (int i= final_breaks.size(); i--; ) 
        lines.push ( optimal_paths[final_breaks[i]].line_config_ );
 
index 0781bf9cb32de9995badb74ea21244ea214b83b9..f35ae8e354b0b0482c877dbb031d022afb4454a6 100644 (file)
@@ -14,7 +14,7 @@ void
 Rhythmic_grouping::init()
 {
     interval_ = 0;
-    children.set_size(0);     
+    children.clear();     
 }
 
 void
index d08519a8913e06b81a8880794556262b68630323..2d978bb60ebbaeb28f1314ec41faa8c007bf8e1f 100644 (file)
@@ -10,6 +10,7 @@
 #include "head-column.hh"
 #include "note-head.hh"
 #include "stem.hh"
+#include "script.hh"
 
 Head_column::Head_column()
 {
@@ -36,9 +37,18 @@ void
 Head_column::set(Stem*stem_l)
 {
     stem_l_ = stem_l;
-    add_dependency(stem_l);
+    Score_elem::add_dependency(stem_l);
+    for (int i=0; script_l_arr_.size(); i++)
+       script_l_arr_[i]->set_stem( stem_l );
 }
 
+void
+Head_column::add(Script *script_l)
+{
+    Script_column::add(script_l) ;
+    if  (stem_l_ )
+       script_l->set_stem( stem_l_ );
+}
 void
 Head_column::add(Note_head *n_l)
 {
index 952f6d867073f430403791de50c565d922e432e9..2db5d4ac0b75a27188fd578964091a79aa78291a 100644 (file)
@@ -40,8 +40,10 @@ Note_head_engraver::do_process_requests()
     n_p->set_rhythmic(note_req_l_->rhythmic());
 
     if (note_req_l_->note()) {
-       n_p->position_i_ = note_req_l_->note()->height() +
-           *get_staff_info().c0_position_i_l_;
+       n_p->position_i_ = note_req_l_->note()->height();
+       Staff_info inf = get_staff_info();
+       if (inf.c0_position_i_l_)
+           n_p->position_i_ += *inf.c0_position_i_l_;
     } else if (note_req_l_->rest()) {
        n_p->rest_b_ = true;
     }
index 46c9b70b853b2a40d761e7ad48d6ec727e337ced..8b4427fc0d68d3341847f380fbd36f5dbdba5371 100644 (file)
@@ -69,8 +69,8 @@ Horizontal_align_item::do_pre_processing()
                Horizontal_align_item_content(
                    item_l_arr_[i], priority_i_arr_[i]));
        content.sort(Horizontal_align_item_content::compare);
-       item_l_arr_.set_size(0);
-       priority_i_arr_.set_size(0);
+       item_l_arr_.clear();
+       priority_i_arr_.clear();
        for  (int i =0; i < content.size(); i++) {
            item_l_arr_.push( content[i].item_l_ );
            priority_i_arr_.push( content[i].priority_i_);
@@ -93,14 +93,14 @@ Horizontal_align_item::do_pre_processing()
     Real center_dx_f = 0;
     for ( int i=0 ;  i < item_l_arr_.size(); i++) {
        Real dx = where_f -dims[i][-1];
-       item_l_arr_[i]->translate_x( dx );
+       item_l_arr_[i]->translate( dx , X_AXIS);
        if (item_l_arr_[i] == center_l_)
            center_dx_f = where_f;
        where_f += dims[i].length();
     }
     if (center_dx_f && !align_i_ )
        for ( int i=0 ;  i < item_l_arr_.size(); i++) 
-           item_l_arr_[i]->translate_x( - center_dx_f );
+           item_l_arr_[i]->translate( - center_dx_f , X_AXIS);
     
 }
 
index 15af0bd803dde19582dbb42df7202ed1d9468cd6..409f2feadf324c3bc59ef092e8679e331a83350d 100644 (file)
@@ -9,33 +9,10 @@
 #include "p-col.hh"
 #include "horizontal-group-item.hh"
 
-IMPLEMENT_IS_TYPE_B2(Horizontal_group_item, Horizontal_group, Item);
+IMPLEMENT_IS_TYPE_B2(Horizontal_group_item, Horizontal_group_element, Axis_group_item);
 
 void
-Horizontal_group_item::OK() const
-{
-    for (int i=0; i < elem_l_arr_.size(); i++) {
-       Item * it_l = elem_l_arr_[i]->item();
-       
-       assert(it_l&& it_l->pcol_l_ == pcol_l_ );
-    }
-}
-
-void
-Horizontal_group_item::do_breakable_col_processing()
-{
-    if (!pcol_l_->breakable_b())
-       return;
-    OK();
-    copy_breakable_items();
-    
-    Link_array<Score_elem> elems = elem_l_arr_;
-
-    for (int i=0; i < elems.size(); i++) {
-       Item* it_l = elems[i]->item();
-       for ( int j=0; j < 2; j++) {
-           Item *new_l = it_l->find_prebroken_piece(broken_to_a_[j]->pcol_l_);
-           ((Horizontal_group_item*)broken_to_a_[j])->add_element( new_l );
-       }
-    }
+Horizontal_group_item::do_print() const
+{ 
+    Axis_group_item::do_print(); 
 }
diff --git a/lily/include/audio-element.hh b/lily/include/audio-element.hh
new file mode 100644 (file)
index 0000000..6deaf15
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+  audio-element.hh -- declare Audio_element
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef AUDIO_ELEMENT_HH
+#define AUDIO_ELEMENT_HH
+
+#include "virtual-methods.hh"
+
+struct Audio_element {
+    virtual ~Audio_element();
+    DECLARE_MY_RUNTIME_TYPEINFO;
+};
+#endif // AUDIO_ELEMENT_HH
index e6104dcb7f3db3823ce44d56fa039ca688ce58bb..1b0a4fccf9bf4947e2302d5f2a3ef3e932a85cf0 100644 (file)
@@ -9,29 +9,30 @@
 
 #include "lily-proto.hh"
 #include "string.hh"
+#include "audio-element.hh"
 
 /**
   Any piece of audio information.
   We need virtual constructors, 
   let's try decentralised factory for specific audio implemenations.
+
+  TODO:
+
+  virtual Niff_item* niff_item_p() = 0;
+  
+  virtual CSound_item* score_item_p() = 0;
  */
-struct Audio_item {
+struct Audio_item : public Audio_element {
     Audio_item( Request* req_l );
 
     /// Create a midi-item from myself.
     virtual Midi_item* midi_item_p() = 0;
 
-#if 0
-    /// Not implemented. Anyone?
-    virtual Niff_item* niff_item_p() = 0;
-
-    /// Not implemented. Anyone?
-    virtual Cscore_item* score_item_p() = 0;
-#endif
-    
     Audio_column* audio_column_l_;
     Request* req_l_;
 
+    DECLARE_MY_RUNTIME_TYPEINFO;
+    
 private:
     Audio_item( Audio_item const& );
     Audio_item& operator=( Audio_item const& );
@@ -43,16 +44,15 @@ struct Audio_key : public Audio_item {
     virtual Midi_item* midi_item_p();
 };
 
-#if 0
 struct Audio_instrument : public Audio_item {
-    Audio_instrument( Request* req_l );
+    Audio_instrument( String instrument_str );
+    virtual Midi_item* midi_item_p();
+    String str_;
 };
-#endif
                                       
 struct Audio_note : public Audio_item {
-    Audio_note( Request* req_l, bool on_b );
+    Audio_note( Request* req_l );
     virtual Midi_item* midi_item_p();
-    bool on_b_;
 };
 
 struct Audio_text : Audio_item {
index 845b598e4705e42ceae29c79e5c8e1e43875fe13..407a7b412d3f09a077cef837b043e98592698008 100644 (file)
@@ -7,8 +7,7 @@
 #ifndef AUDIO_SCORE_HH
 #define AUDIO_SCORE_HH
 
-#include "proto.hh"
-#include "parray.hh"
+#include "lily-proto.hh"
 #include "plist.hh"
 
 /** all stuff which goes onto midi. notes, signs, symbols in a score
 
 class Audio_score {
 public:
-    Audio_score( Midi_def* );
+    Audio_score( Score* l );
 
     void add( Audio_column* );
+    void add_staff( Audio_staff* l );
+    void add(Audio_element*p);
 
-//    void output(Tex_stream &ts);
+    
+    void output( Midi_stream& midi_stream_r );
+    void output_header_track( Midi_stream& midi_stream_r );
 
-    void play( Audio_item* i, Audio_column* c );
     void print() const;
     void process();
 
     Pointer_list<Audio_column*> audio_column_p_list_;
-    Midi_def *midi_l_;
+    Link_list<Audio_staff*> audio_staff_l_list_;
+    Pointer_list<Audio_element*> audio_elem_p_list_;
+    Score* score_l_;
 };
 
 #endif // AUDIO_SCORE_HH
diff --git a/lily/include/axes.hh b/lily/include/axes.hh
new file mode 100644 (file)
index 0000000..7dfe8fb
--- /dev/null
@@ -0,0 +1,24 @@
+
+/*
+  axes.hh -- declare 
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef AXES_HH
+#define AXES_HH
+
+enum Axis {
+    X_AXIS =0,
+    Y_AXIS =1,
+    NO_AXES=2,
+};
+
+class String;
+
+String axis_name_str(Axis);
+
+#endif // AXES_HH
diff --git a/lily/include/axis-group-item.hh b/lily/include/axis-group-item.hh
new file mode 100644 (file)
index 0000000..a461f52
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+  axis-item.hh -- declare Axis_group_item
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef AXIS_ITEM_HH
+#define AXIS_ITEM_HH
+
+#include "axis-group.hh" 
+#include "item.hh"
+
+/**
+  A grouping item. Its special support is in do_breakable_col_processing().
+ */
+
+class Axis_group_item : public virtual Axis_group_element, public Item {
+protected:
+    virtual void do_breakable_col_processing();
+    void OK()const;
+    virtual void do_print() const;
+public:
+    DECLARE_MY_RUNTIME_TYPEINFO;
+
+};
+
+#endif // AXIS_ITEM_HH
diff --git a/lily/include/axis-group-spanner.hh b/lily/include/axis-group-spanner.hh
new file mode 100644 (file)
index 0000000..2b7d6e2
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+  axis-group-spanner.hh -- declare Axis_group_spanner
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef SPAN_AXIS_GROUP_HH
+#define SPAN_AXIS_GROUP_HH
+
+#include "spanner.hh"
+#include "axis-group.hh"
+
+/** An element which groups a line in a certain direction. The most
+  useful example of this is the Vertical_group_spanner */
+class Axis_group_spanner : public Spanner, public virtual Axis_group_element
+{
+    void do_break_processing_if_unbroken();
+protected:
+    virtual void do_break_processing();
+    virtual void do_print()const;
+
+public:
+    DECLARE_MY_RUNTIME_TYPEINFO;
+};
+
+#endif // SPAN_AXIS_GROUP_HH
diff --git a/lily/include/axis-group.hh b/lily/include/axis-group.hh
new file mode 100644 (file)
index 0000000..bdf758c
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+axis-group.hh -- declare Axis_group_administration, Axis_group_element
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef Axis_group_administration_HH
+#define Axis_group_administration_HH
+
+#include "parray.hh"
+#include "axes.hh"
+#include "real.hh"
+#include "lily-proto.hh"
+#include "score-elem.hh"
+/**
+  Do the dirty work for Axis_group_element.
+ */
+struct Axis_group_administration {
+    Link_array<Score_elem> elem_l_arr_;
+    
+    Interval extent(Axis)const;
+    void print() const ;
+    Axis_group_administration(Axis_group_administration const&);
+    Axis_group_administration(){}
+    void remove_all(Axis a1,Axis a2);
+    
+    bool contains_b(Score_elem const *)const;
+    void add_element(Score_elem*, Axis_group_element*, Axis a1, Axis a2);
+    void remove_element(Score_elem*, Axis a1, Axis a2);
+};
+
+/** 
+  Treat a group of elements a unity in either or both axis sense .
+  This is a wrapper around Axis_group_administration
+  */
+class Axis_group_element : public virtual Score_elem {
+protected:
+    Axis_group_administration axis_admin_;
+    virtual void do_print()const;
+    virtual Link_array<Score_elem> get_extra_dependencies()const;
+    virtual void do_unlink();
+
+public:
+    virtual void remove_all()=0;
+    virtual void add_element(Score_elem*)=0;
+    virtual void remove_element(Score_elem*)=0;
+    virtual bool contains_b(Score_elem const *)const;
+    DECLARE_MY_RUNTIME_TYPEINFO;
+};
+#endif // Axis_group_administration_HH
diff --git a/lily/include/bar-column-grav.hh b/lily/include/bar-column-grav.hh
new file mode 100644 (file)
index 0000000..70b7bcf
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+  bar-column-grav.hh -- declare Bar_column_engraver
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef BAR_COLUMN_GRAV_HH
+#define BAR_COLUMN_GRAV_HH
+
+#include "engraver.hh"
+
+/// couple bars and appropriate scripts
+class Bar_column_engraver :public Engraver {
+    Bar_column *barcol_p_;
+    Array< Script * >  script_l_arr_;
+
+    Bar *bar_l_;
+    
+protected:
+    virtual void acknowledge_element(Score_elem_info);
+    virtual void do_pre_move_processing();
+    virtual void do_post_move_processing();
+public:
+    Bar_column_engraver();
+    DECLARE_MY_RUNTIME_TYPEINFO;
+};
+
+#endif // BAR_COLUMN_GRAV_HH
diff --git a/lily/include/bar-column.hh b/lily/include/bar-column.hh
new file mode 100644 (file)
index 0000000..7c7fb42
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+  bar-column.hh -- declare Bar_column
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef BAR_COLUMN_HH
+#define BAR_COLUMN_HH
+
+#include "script-column.hh"
+
+/**  
+  The scripts  over  a and the bar itself.
+ */
+class Bar_column : public Script_column {
+    Bar * bar_l_;
+
+public:
+    Bar_column();
+    void set_bar( Bar*);
+protected:
+    SCORE_ELEM_CLONE(Bar_column);
+    void do_substitute_dependency(Score_elem*,Score_elem*);
+    DECLARE_MY_RUNTIME_TYPEINFO;
+};
+
+#endif // BAR_COLUMN_HH
diff --git a/lily/include/bar-number-grav.hh b/lily/include/bar-number-grav.hh
new file mode 100644 (file)
index 0000000..287706b
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+  bar-number-grav.hh -- declare Bar_number_grav
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef BAR_NUMBER_GRAV_HH
+#define BAR_NUMBER_GRAV_HH
+
+#include "engraver.hh"
+
+/**
+  catch bars, and put a number over them.
+ */
+class Bar_number_grav : public Engraver {
+    Script * script_p_;
+    int number_i_;
+protected:
+
+    void acknowledge_element(Score_elem_info);
+    void do_pre_move_processing();
+public:
+    Bar_number_grav();
+    DECLARE_MY_RUNTIME_TYPEINFO;
+};
+#endif // BAR_NUMBER_GRAV_HH
index 9a7a8b92b60d9e0e8fa4d2c17416560e37f1dfc0..c03527e6ccdc78ad91bcaa8b5dbecc94a810c458 100644 (file)
@@ -8,6 +8,8 @@
 #define BAR_HH
 #include "item.hh"
 /**
+  A vertical bar.
+  
   TODO: connections with pre and postbreak
  */
 class Bar:public Item {
index 22a2eec3a5f29ee524cd192aaee3e5277ac1f177..8161a84518ccd43b342a4ec3f236bd034c579ba7 100644 (file)
@@ -9,19 +9,28 @@
 #include "real.hh"
 #include "interval.hh"
 #include "offset.hh"
+#include "axes.hh"
 
-/// a square subset of Real^2
 struct Box {
-    Interval x, y;
-
+    Interval interval_a_[NO_AXES];
+    
+    Interval &x() {return interval_a_[X_AXIS]; }
+    Interval &y(){ return interval_a_[Y_AXIS]; }
+    Interval x()const{ return interval_a_[X_AXIS]; }
+    Interval y()const{return interval_a_[Y_AXIS]; }
+    Interval operator[](Axis a ) {
+       return interval_a_[a];
+    }
+    
     void translate(Offset o) {
-       x.translate(o.x);
-       y.translate(o.y);
+       x().translate(o.x());
+       y().translate(o.y());
     }
+
     /// smallest box enclosing #b#
     void unite(Box b) {
-       x.unite(b.x);
-       y.unite(b.y);
+       x().unite(b.x());
+       y().unite(b.y());
     }
     Box();
     Box(Interval ix, Interval iy);
index e016a8806afa7ca008952f74edd10f725659445f..0a9fafe68cf461118b4b6fcc84545a80d2304797 100644 (file)
@@ -36,7 +36,7 @@ struct Col_stats
 class Break_algorithm {
 protected:
 
-    PScore *pscore_l_;
+    Paper_score *pscore_l_;
     Real linelength;
 
     /// search all pcols which are breakable.
@@ -69,7 +69,7 @@ public:
     Line_spacer* (*get_line_spacer)();
     
     Break_algorithm();
-    void set_pscore(PScore*);
+    void set_pscore(Paper_score*);
 
     /// check if the spacing/breaking problem is well-stated
     void problem_OK()const;
index 3891a5a0c16c0943e3897ccd540a306f96fecb9a..162c5fe38597d1c0c40a6265861e0a84e486f0e0 100644 (file)
 #ifndef COLLISION_HH
 #define COLLISION_HH
 #include "lily-proto.hh"
-#include "item.hh"
+#include "elem-group-item.hh"
 
-/** TODO 
+/**
+  Resolve conflicts between various Note_columns (chords).
+  
+  TODO 
 
   multistaff support (see Chlapik: equal noteheads should be on the
   same hpos.)  
 */
-class Collision : public Item {
+class Collision : public Horizontal_vertical_group_item {
 protected:
     virtual void do_substitute_dependency(Score_elem*,Score_elem*);
     virtual void do_pre_processing();
@@ -26,6 +29,5 @@ public:
     DECLARE_MY_RUNTIME_TYPEINFO;
     void add (Note_column*ncol_l);
     Collision();
-    
 };
 #endif // COLLISION_HH
index 11a1e44bdfe135f9f87584fa8e7be86164e8b2e7..5d173ca9f9250ad9d9535ae1b03d14f703312cf0 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  command-request.hh -- declare Non musical requests
+  command-request.hh -- declare non-musical requests
 
   source file of the GNU LilyPond music typesetter
 
@@ -12,6 +12,7 @@
 
 #include "request.hh"
 #include "varray.hh"
+#include "duration.hh"
 
 /** Request which are  assumed to be "happening" before the
   musical requests. */
@@ -34,6 +35,8 @@ public:
 
 class Command_script_req : public Command_req,  public Script_req {
 public:
+    // huh? 
+    Command_script_req();
     REQUESTMETHODS(Command_script_req, commandscript);
 };
 
@@ -49,15 +52,29 @@ public:
 class Timing_req  : public Command_req  {
 public:
     REQUESTMETHODS(Timing_req, timing);
+    virtual Tempo_req * tempo(){return 0; }
+    Tempo_req();
 };
 
 
+class Tempo_req : public Timing_req
+{
+public:
+    Duration dur_;
+    int metronome_i_;
+
+    Tempo_req();
+    REQUESTMETHODS(Tempo_req, tempo);
+    bool do_equal_b(Request *)const;
+};
+
 class Partial_measure_req  : public Timing_req  {
 public:
     Moment duration_;
 
     Partial_measure_req(Moment);
     REQUESTMETHODS(Partial_measure_req, partial);
+    bool do_equal_b(Request*)const;
 };
 
 /**
@@ -67,9 +84,9 @@ class Meter_change_req  : public Timing_req  {
 public:
     int beats_i_, one_beat_i_;
 
-    int compare(Meter_change_req const&);
     Meter_change_req();
     void set(int,int);
+    bool do_equal_b(Request*)const;
     REQUESTMETHODS(Meter_change_req, meterchange);
 };
 
@@ -78,6 +95,7 @@ class Cadenza_req  : public Timing_req  {
 public:
     /// turn on?
     bool on_b_;
+    bool do_equal_b(Request*)const;
     Cadenza_req(bool);
     REQUESTMETHODS(Cadenza_req,cadenza);
 };
@@ -85,7 +103,7 @@ public:
 /// check if we're at start of a  measure.
 class Barcheck_req  : public Timing_req  {
 public:
-
+    bool do_equal_b(Request *)const;
     REQUESTMETHODS(Barcheck_req,barcheck);
 };
 
@@ -93,7 +111,7 @@ class Measure_grouping_req : public Timing_req  {
 public:
     Array<int> beat_i_arr_;
     Array<Moment> elt_length_arr_;
-
+    bool do_equal_b(Request *)const;
     REQUESTMETHODS(Measure_grouping_req, measuregrouping);
 };
 
@@ -103,7 +121,8 @@ class Bar_req  : public Command_req  {
 public:
     String type_str_;
     Bar_req(String);
-    int compare(const Bar_req&)const;
+    bool do_equal_b(Request*)const;
+
     REQUESTMETHODS(Bar_req,bar);
 };
 
index bf532c035d592a6fe5060f96176cbe2a7f47ba51..b1248cc99095cd077c59646630387250d03e4e41 100644 (file)
 #ifndef ELEM_GROUP_ITEM_HH
 #define ELEM_GROUP_ITEM_HH
 
+#include "axis-group-item.hh"
 #include "elem-group.hh"
-#include "item.hh"
 
-class Horizontal_vertical_group_item  : public Item, public Horizontal_vertical_group {
+
+/**
+  Treat a collection of items as a unity
+ */
+class Horizontal_vertical_group_item  : public Axis_group_item, public Horizontal_vertical_group_element {
+protected:
+    virtual void do_print() const;
+    virtual void remove_all() { Horizontal_vertical_group_element::remove_all(); }
 public:
+    virtual void add_element(Score_elem*e) { Horizontal_vertical_group_element::add_element(e); }
+    virtual void remove_element(Score_elem*e) { Horizontal_vertical_group_element::remove_element(e); }
+
     DECLARE_MY_RUNTIME_TYPEINFO;
     SCORE_ELEM_CLONE(Horizontal_vertical_group_item);
-protected:
-    virtual void do_print() const;
+  
+       
 };
 
 #endif // ELEM_GROUP_ITEM_HH
index 9569dcd90cee3e08161bdb0499c385d524acb2fd..baf3010c09b2c41a1a044a44e05f1dc105dcc28f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  elem-group.hh -- declare Horizontal_vertical_group
+  elem-group.hh -- declare Horizontal_vertical_group_element
 
   source file of the GNU LilyPond music typesetter
 
 #define ELEM_GROUP_HH
 
 #include "score-elem.hh"
+#include "axis-group.hh"
 
-class Elbement_group: public virtual Score_elem {
+
+
+/**
+  Treat a group of elements a unity in horizontal sense .
+  A column is a typical Vertical_group.
+ */
+class Horizontal_group_element : public virtual Axis_group_element {
 protected:
-    Link_array<Score_elem> elem_l_arr_;
-    
-    virtual void do_print() const ;
-public:
-    Elbement_group(Elbement_group const&);
-    Elbement_group();
-    bool contains_b(Score_elem const *)const;
-    void add_element(Score_elem*);
-    DECLARE_MY_RUNTIME_TYPEINFO;
-};
+    virtual void remove_all();
+    virtual Interval do_width()const;
 
-class Horizontal_group : public Elbement_group {
 public:
     DECLARE_MY_RUNTIME_TYPEINFO;
-    Horizontal_group(){}
-    void add_element(Score_elem*);
-    Horizontal_group(Horizontal_group const&);
-    void remove_element(Score_elem*);
+    virtual void add_element(Score_elem*);
+    virtual void remove_element(Score_elem*);
 
-protected:
-    virtual Horizontal_group * horizontal_group() { return this; }
-    virtual void do_substitute_dependency(Score_elem*,Score_elem*);
-    virtual void do_print() const ;
-    virtual void translate_x(Real);
-    virtual Interval do_width()const;
 };
-
-class Vertical_group : public Elbement_group {
+/**
+  Like Horizontal_group_element, but in X direction
+ */
+class Vertical_group_element : public virtual Axis_group_element {
 protected:
-    virtual void translate_y(Real);
-    virtual void do_print() const ;
     virtual Interval do_height()const;
-    virtual void do_substitute_dependency(Score_elem*,Score_elem*);
-    virtual Vertical_group * vertical_group() { return this; }
+    virtual void remove_all();
+
 public:
-    void add_element(Score_elem*);
-    void remove_element(Score_elem*);
-    
-    Vertical_group(Vertical_group const &);
-    Vertical_group(){}
+    virtual void add_element(Score_elem*);
+    virtual void remove_element(Score_elem*);
     DECLARE_MY_RUNTIME_TYPEINFO;
 };
 
@@ -61,18 +48,16 @@ public:
   dimensions are the unions of the dimensions of what it contains.
   Translation means translating the contents.
   */
-class Horizontal_vertical_group : public Vertical_group
-                                 public Horizontal_group 
+class Horizontal_vertical_group_element : public Vertical_group_element
+                                 public Horizontal_group_element 
 {  
 protected:
-    virtual Horizontal_vertical_group* elem_group() { return this; }
+    virtual void remove_all();
 public:
-    Horizontal_vertical_group();
-    bool contains_b(Score_elem const *)const;
-    DECLARE_MY_RUNTIME_TYPEINFO;
-    virtual void do_substitute_dependency(Score_elem*,Score_elem*);
-    virtual void do_print() const;
-    void add_element(Score_elem*);
+    virtual void add_element(Score_elem*);
+    virtual void remove_element(Score_elem*);
+    
+    DECLARE_MY_RUNTIME_TYPEINFO;    
 };
 
 #endif // ELEM_GROUP_HH
index 96e67feaa84660eaabcaeb0f6d834a9e8759da2b..2e3e4941bd164414a9468edb5564493403f5d9f7 100644 (file)
@@ -24,7 +24,6 @@
   */
 class Engraver_group_engraver : public Engraver, public virtual Translator {
 protected:
-    
     Pointer_list<Engraver*> grav_list_;
     Link_array<Engraver_group_engraver> group_l_arr_;
     Link_array<Engraver> nongroup_l_arr_;
@@ -32,11 +31,10 @@ protected:
     Array<Score_elem_info> announce_info_arr_;
     
     virtual void do_print()const;
-
     virtual bool removable_b()const;
-
 public:
-    virtual void print() const { Engraver::print(); }
+    Engraver*get_simple_engraver(char const*typeinfo)const;
+    virtual void print() const ;
 
     Input_translator * itrans_l_;
     void check_removal();
@@ -53,7 +51,8 @@ public:
      */
     virtual void terminate_engraver(Engraver * grav_l);
     
-   DECLARE_MY_RUNTIME_TYPEINFO;
+    
+    DECLARE_MY_RUNTIME_TYPEINFO;
     
     /**
       Remove #grav_l# from the list, and return it.
@@ -84,7 +83,6 @@ public:
      */
     Translator * ancestor_l(int l=1);
     int depth_i() const;
-
 };
 
 #endif // ENGRAVERGROUP_HH
index 52cd3bd7eaebf3abe0528a83cffdc918ad851b5f..60b8b95ca1975a93f7b1dc94286357fa3b8bc91d 100644 (file)
@@ -64,11 +64,6 @@ protected:
     virtual void do_creation_processing () {}
     virtual void do_removal_processing() {}
 
-    /**
-      typeset a "command" item. Default: pass on to daddy.
-      If the column is not breakable, #pre_p# and #post_p# are junked
-      */
-    virtual void typeset_breakable_item(Item * nobreak_p);
     /**
       Invoke walker method to typeset element. Default: pass on to daddy.
       */
@@ -129,6 +124,7 @@ public:
     bool is_bottom_engraver() const;
 
     void post_move_processing();
+    void removal_processing();
     
     Engraver_group_engraver * daddy_grav_l_;
 
index acaa554019b557b17b01b7eeede3e99ec40d1d81..c384d4fa104be5ab64bfc9157737af2e9f180663 100644 (file)
@@ -30,7 +30,7 @@ public:
     virtual ~General_script_def() {}
     
 protected:
-    virtual bool do_equal_b(General_script_def const &)const;
+    virtual bool do_equal_b(General_script_def const *)const;
     virtual void do_print()const;
 };
 
index 77065d84cb491d4f6eb5b9e93469047610139efd..f95733201b155bb06d60ec5916ef44020792f12f 100644 (file)
@@ -12,6 +12,9 @@
 
 #include "script-column.hh"
 
+/**
+  Scripts and rests/noteheads
+ */
 class Head_column : public Script_column
 { 
 public:
@@ -27,7 +30,7 @@ public:
     Stem* stem_l_;
 
     void add(Note_head*);
-    void add(Script*s) { Script_column::add(s) ; }
+    virtual void add(Script*s);
     virtual void set(Stem*);
     Head_column();
     DECLARE_MY_RUNTIME_TYPEINFO;
index 2a5b2be2801680f2f7b033e3739d3ce143f2b7af..57711a27be418f219c2a0ecbd5160c7ac7a8aa92 100644 (file)
@@ -9,17 +9,22 @@
 #define HEADGRAV_HH
 #include "engraver.hh"
 
-struct Note_head_engraver : Engraver {
+/**
+  make balls and rests
+ */
+class Note_head_engraver : public Engraver {
     Note_head* note_p_;
     Rhythmic_req * note_req_l_;
     
-    /* *************** */
+public:
     Note_head_engraver();
+    DECLARE_MY_RUNTIME_TYPEINFO;
+protected:
     virtual bool do_try_request(Request *req_l) ;
     virtual void do_process_requests();
     virtual void do_pre_move_processing();
     virtual void do_post_move_processing();
-    DECLARE_MY_RUNTIME_TYPEINFO;
+
 };
 
 
index 3495af9f9787ccd3a6e8d4d4716b00af77aba86c..f1fc8b3c9c6ab11f46ba0dc584c9944b1d69b35f 100644 (file)
 #define HORIZONTAL_GROUP_ITEM_HH
 
 #include "elem-group.hh"
-#include "item.hh"
+#include "axis-group-item.hh"
 
-class Horizontal_group_item : public Item, public Horizontal_group {
+class Horizontal_group_item : public Axis_group_item, public Horizontal_group_element {
+protected:
+    virtual void remove_all() { Horizontal_group_element::remove_all(); }
+    virtual void do_print() const;
+public:
+    virtual void add_element(Score_elem*e) { Horizontal_group_element::add_element(e); }
+    virtual void remove_element(Score_elem*e) { Horizontal_group_element::remove_element(e); }
     DECLARE_MY_RUNTIME_TYPEINFO;
     SCORE_ELEM_CLONE(Horizontal_group_item);
-protected:
-    virtual void do_breakable_col_processing();
-    void OK()const;
-    virtual void do_print() const { Elbement_group::do_print(); }
+  
+
 };
 
 #endif // HORIZONTAL_GROUP_ITEM_HH
index b2883a30cf87afa0212a34f8a71b5b529b2693fd..49f44bec01b0eb64bc4fd9f2dfc2a2b06f2af40c 100644 (file)
@@ -24,7 +24,10 @@ struct Input_translator_list : public Pointer_list<Input_translator*>
     ~Input_translator_list(){}
 };
 
-struct Input_translator : Input { 
+/** Define a intereter for music. This is an runtime interface to the
+ typesystem */
+class Input_translator : public Input { 
+public:
     Input_translator_list contains_itrans_p_list_;
     Array<String> consists_str_arr_;
     Array<String> alias_str_arr_;
index dcbae6374fc33f0f35b615e3d9f02dc63b073217..0768c5885ebc2a49e6c64a6d754dd105151c1448 100644 (file)
@@ -14,7 +14,7 @@
 #include "score-elem.hh"
 
 /**
- a horizontally fixed size element of the score
+  A horizontally fixed size element of the score.
 
   Item is the datastructure for printables whose width is known
   before the spacing is calculated
@@ -30,7 +30,10 @@ public:
     
     Item * broken_to_a_[2];
 
-    // nobreak = 0, pre =1, post = 2
+    /// should be put in a breakable col.
+    bool breakable_b_;
+    int break_status_i_;
+    /// nobreak = 0, pre = -1, post = 1
     int break_status_i()const;
     Item * find_prebroken_piece(PCol*)const;
     Item * find_prebroken_piece(Line_of_score*)const;    
@@ -47,7 +50,6 @@ protected:
     virtual void do_print()const;
 
     void copy_breakable_items();
-
 };
 
 
index 7b54214892bc15e10a5671520c40049c4440d278..51a978e592bf8512bcfbc9f3c8f269e100b897ce 100644 (file)
 #include "engraver.hh"
 #include "key.hh"
 
-struct Key_engraver : Engraver {
+/**
+  Make the key signature.
+ */
+class Key_engraver : public Engraver {
+    void create_key();
+    void read_req(Key_change_req * r);
+
+public:
     Key key_;
     Key_change_req * keyreq_l_;
     Key_item * kit_p_;
@@ -21,17 +28,15 @@ struct Key_engraver : Engraver {
     bool default_key_b_;
     bool change_key_b_;
     
+protected:
     virtual bool do_try_request(Request *req_l);
     virtual void do_process_requests();
     virtual void do_pre_move_processing();
     virtual void do_post_move_processing();
     virtual void acknowledge_element(Score_elem_info);
+public:
     Key_engraver();
     DECLARE_MY_RUNTIME_TYPEINFO;
-private:
-    void create_key();
-    
-    void read_req(Key_change_req * r);
 };
 
 #endif // KEYGRAV_HH
index a1ab3dc6d48960bf01e16f4c16f287f9286d53f5..b980e3ff0fce06473f685434c1c0bc63f36c9608 100644 (file)
@@ -19,7 +19,6 @@ struct Key_item : Item {
     bool default_b_;
 
     
-    /* *************** */
     DECLARE_MY_RUNTIME_TYPEINFO;
     SCORE_ELEM_CLONE(Key_item);
 
@@ -27,6 +26,7 @@ struct Key_item : Item {
     void add(int pitch, int acc);
     void read(const Key_engraver&);
     void set_c_position(int);
+protected:
     virtual void do_pre_processing();
     Molecule* brew_molecule_p()const;
 };
index 5619bf021a9c7afbfa1d478301aacae2ee5e5ca1..5e42f95f1e06f9ee52202f7031178403a3b485b0 100644 (file)
 #define LILY_PROTO_HH
 #include "proto.hh"
 
-struct My_lily_lexer;
+
 struct Absolute_dynamic_req;
+struct Axis_group_element;
+struct Axis_group;
 struct Translator;
+struct Audio_element;
 struct Audio_column;
 struct Audio_item;
 struct Audio_key;
 struct Audio_meter;
 struct Audio_note;
+struct Audio_note_off;
 struct Audio_score;
+struct Audio_staff;
 struct Audio_tempo;
 struct Atom;
 struct Bar;
+struct Bar_column_engraver;
+struct Bar_column;
 struct Bar_engraver;
 struct Bar_req;
 struct Barcheck_req;
@@ -50,6 +57,7 @@ struct Complex_music;
 struct Cresc_req;
 struct Crescendo ;
 struct Decresc_req;
+
 struct Directional_spanner;
 struct Disallow_break_req;
 struct Durational_req;
@@ -64,7 +72,7 @@ struct Group_change_req;
 struct Group_feature_req;
 struct Head_column;
 struct Horizontal_align_item;
-struct Horizontal_group;
+struct Horizontal_group_element;
 struct Horizontal_group_item;
 struct Horizontal_vertical_group;
 struct Idealspacing;
@@ -92,6 +100,7 @@ struct Local_key_engraver;
 struct Lookup;
 struct Lyric_item;
 struct Lyric_req;
+struct My_lily_lexer;
 struct Measure_grouping_req;
 struct Melodic_req;
 struct Meter;
@@ -105,11 +114,14 @@ struct Midi_item;
 struct Midi_key;
 struct Midi_meter;
 struct Midi_note;
+struct Midi_note_event;
+struct Midi_note_off;
 struct Midi_output;
 struct Midi_score;
 struct Midi_stream;
 struct Midi_tempo;
 struct Midi_track;
+struct Midi_walker;
 struct Mixed_qp;
 struct Molecule;
 struct Music_general_chord;
@@ -130,7 +142,7 @@ struct Offset;
 struct Output;
 struct Performer;
 struct PCol;
-struct PScore;
+struct Paper_score;
 struct Paper_def;
 struct Partial_measure_req;
 struct Plet;
@@ -184,6 +196,7 @@ struct Symtable;
 struct Symtables;
 struct Super_elem;
 struct Terminate_voice_req;
+struct Tempo_req;
 struct Tex_stream;
 struct Text_def;
 struct Text_gob;
@@ -197,7 +210,7 @@ struct Time_description;
 struct Timing_req;
 struct Vertical_brace;
 struct Vertical_spanner;
-struct Vertical_group;
+struct Vertical_group_element;
 struct Vertical_align_spanner;
 struct Vertical_align_engraver;
 struct Vertical_align_element;
index 2d4ed66e8f74b64715a463497f116bae12abf742..7316df60e7ca674efeefdef29575113a32c23c60 100644 (file)
@@ -21,20 +21,26 @@ struct Local_acc {
 
   TODO:
   update item if Items are removed
+
+  TODO
+  
+  figure out private/public
+  
  */
-struct Local_key_item : Item {
+class Local_key_item : public Item {
+public:
     DECLARE_MY_RUNTIME_TYPEINFO;
     Array<Local_acc> accs;
     Link_array<Item> support_items_;
     int c0_position;
 
-    /* *************** */
+
     
     Local_key_item(int c0position);
     void add_support(Item*);
     void add(int oct, int pitch, int acc);
     void add(Melodic_req*);
-public:
+protected:
     virtual void do_pre_processing();    
     virtual void do_substitute_dependency(Score_elem*,Score_elem*);
     virtual Molecule* brew_molecule_p()const;
index 7ec479ebd208b2af90a6b2e2120a8c4badcc9c13..0c461a36d6c7ac1d8fb6c08da20bf062d7825218 100644 (file)
@@ -12,6 +12,7 @@ String find_file(String);
 String get_version_str();
 extern Sources* source_l_g;
 extern bool only_midi;
+extern int exit_status_i_;
 
 extern String default_out_fn;
 
index 13073251abf910b5fe3f45c70d38595134d9cfa6..89a7543567fa92f5123eb0db11eb067e2e3b24fc 100644 (file)
@@ -16,6 +16,7 @@
 
 
 /** 
+  definitions for midi output. Rather empty
  */
 struct Midi_def {
     // ugh!
@@ -25,7 +26,6 @@ struct Midi_def {
     /// output file name
     String outfile_str_;
 
-    Assoc<String, Real> *real_vars_p_;
     Input_translator* itrans_p_;
 
     /// duration of whole note
@@ -37,11 +37,9 @@ struct Midi_def {
 
     Real duration_to_seconds_f(Moment);
     Global_translator* get_global_translator_p() const;
-    Real get_var( String s ) const;
     int get_tempo_i( Moment moment );
     void print() const;
     void set( Input_translator* itrans_p );
-    void set_var( String s, Real r );
     void set_tempo( Moment moment, int count_per_minute_i );
 };
 
index 369d4a48862a14ecb3312b4c51a4e4e9d1413166..4906f27ba865678dad30e26c1e803fdbb7571c1c 100644 (file)
@@ -9,6 +9,8 @@
 
 #include "string.hh"
 #include "lily-proto.hh"
+#include "virtual-methods.hh"
+#include "moment.hh"
 
 /**
   Any piece of midi information.
@@ -16,6 +18,7 @@
   Maybe use base classes for RIFF files?
  */
 struct Midi_item {
+    DECLARE_MY_RUNTIME_TYPEINFO;
     Midi_item( Audio_item* audio_item_l ); 
     static String i2varint_str( int i );
     void output( Midi_stream* midi_stream_l ) const;
@@ -29,72 +32,104 @@ private:
     Midi_item& operator =( Midi_item const& );
 };
 
-struct Midi_key : public Midi_item {
-    Midi_key( Audio_item* audio_item_l );
-       
+/**
+  variable sized MIDI data
+ */
+struct Midi_chunk : Midi_item {
+    DECLARE_MY_RUNTIME_TYPEINFO;
+    Midi_chunk();
+
+    void add( String str );
+    void set( String header_str, String data_str, String footer_str );
+    virtual String str() const;
+
+private:
+    String data_str_;
+    String footer_str_;
+    String header_str_;
+};
+
+struct Midi_duration : public Midi_item {
+    DECLARE_MY_RUNTIME_TYPEINFO;
+    Midi_duration( Real seconds_f );
+
     virtual String str() const;
+    Real seconds_f_;
+};
+
+struct Midi_header : Midi_chunk {
+    DECLARE_MY_RUNTIME_TYPEINFO;
+
+    Midi_header( int format_i, int tracks_i, int clocks_per_4_i );
+
 };
 
 /**
   Change instrument event
  */
 struct Midi_instrument : public Midi_item {
+    DECLARE_MY_RUNTIME_TYPEINFO;
     Midi_instrument( int channel_i, String instrument_str );
 
     virtual String str() const;
     String instrument_str_;
 };
                                       
-struct Midi_note : public Midi_item {
-    /**
-      Generate a note-event on a channel.
-
-      @param #melreq_l# is the pitch. 
-     */
-    Midi_note( Audio_item* audio_item_l ); 
 
+struct Midi_key : public Midi_item {
+    DECLARE_MY_RUNTIME_TYPEINFO;
+    Midi_key( Audio_item* audio_item_l );
+       
     virtual String str() const;
-
-    /* *************** */
-    int const c0_pitch_i_c_ = 60;
-    bool on_b_;
-    Byte dynamic_byte_;
 };
 
-struct Midi_duration : public Midi_item {
-    Midi_duration( Real seconds_f );
+struct Midi_meter : Midi_item {
 
+    DECLARE_MY_RUNTIME_TYPEINFO;
+    Midi_meter( Audio_item* audio_item_l ); 
+  
     virtual String str() const;
-    /* *************** */
-    Real seconds_f_;
+    int clocks_per_1_i_;
 };
 
-struct Midi_chunk : Midi_item {
-    Midi_chunk();
+/**
+  Turn a note on (blond).
+ */
+struct Midi_note : public Midi_item {
+    DECLARE_MY_RUNTIME_TYPEINFO;
+    Midi_note( Audio_item* audio_item_l ); 
 
-    void add( String str );
-    void set( String header_str, String data_str, String footer_str );
+    Moment duration() const;
+    int pitch_i() const;
     virtual String str() const;
-private:
-    String data_str_;
-    String footer_str_;
-    String header_str_;
+
+    int const c0_pitch_i_c_ = 60;
+    Byte dynamic_byte_;
 };
 
-struct Midi_header : Midi_chunk {
-    /* *************** */
-    Midi_header( int format_i, int tracks_i, int clocks_per_4_i );
+/**
+  Turn a note off (dark).
+ */
+struct Midi_note_off : public Midi_item {
+    DECLARE_MY_RUNTIME_TYPEINFO;
+    Midi_note_off( Midi_note* midi_note_l ); 
+
+    int pitch_i() const;
+    virtual String str() const;
+
+    Byte aftertouch_byte_;
 };
 
 struct Midi_text : Midi_item {
+    DECLARE_MY_RUNTIME_TYPEINFO;
+    
     enum Type { 
        TEXT = 1, COPYRIGHT, TRACK_NAME, INSTRUMENT_NAME, LYRIC, 
        MARKER, CUE_POINT
     };
-
-    Midi_text( Audio_item* audio_item_l );
     Midi_text( Midi_text::Type type, String text_str );
-
+    Midi_text( Audio_item* audio_item_l );
+    
     virtual String str() const;
 
     Type type_;
@@ -102,24 +137,19 @@ struct Midi_text : Midi_item {
 };
 
 struct Midi_tempo : Midi_item {
-    Midi_tempo( Audio_item* audio_item_l ); 
+    DECLARE_MY_RUNTIME_TYPEINFO;
     Midi_tempo( int per_minute_4_i );
-
+    Midi_tempo( Audio_item* audio_item_l ); 
+  
     virtual String str() const;
 
     int per_minute_4_i_;
 };
 
-struct Midi_meter : Midi_item {
-    Midi_meter( Audio_item* audio_item_l ); 
-
-    virtual String str() const;
-    int clocks_per_1_i_;
-};
-
 struct Midi_track : Midi_chunk {
+    DECLARE_MY_RUNTIME_TYPEINFO;
     int number_i_;
-    /* *************** */
+    
     Midi_track();
 
     void add( int delta_time_i, String event );
diff --git a/lily/include/midi-output.hh b/lily/include/midi-output.hh
deleted file mode 100644 (file)
index 0338916..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-  midioutput.hh -- declare Midi_output
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef MIDIOUTPUT_HH
-#define MIDIOUTPUT_HH
-#include "lily-proto.hh"
-
-
-struct Midi_output {
-    #if 0
-    Midi_output(Score* score_l, Midi_def* );
-
-    void do_staff(Staff*st_l, int count);
-    void header();
-    void staffs();
-
-    Score* score_l_;
-    Midi_def* midi_l_;
-    Midi_stream* midi_stream_l_;
-#endif
-};
-
-#endif // MIDIOUTPUT_HH
-
index c18cb9c4e9761761c110996548c6de57b68f82d5..9fded298d5e0274ddc234614c3d54721ddb6cb12 100644 (file)
@@ -1,7 +1,8 @@
-//
-//  midistream.hh -- part of GNU LilyPond
-//
-//  copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
+/*
+  midi-stream.hh -- declare Midi_stream
+
+  (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
+ */
 
 #ifndef MIDI_STREAM_HH
 #define MIDI_STREAM_HH
 #include <iostream.h>
 #include "string.hh"
 
-/// Midi output
+/// Midi outputfile
 struct Midi_stream {
-    ostream* os_p_;
-    String filename_str_;
-    int clocks_per_4_i_;
-    int tracks_i_;
-    
-    Midi_stream( String filename_str, int tracks_i, int clocks_per_4_i_ );
+    Midi_stream( String filename_str );
     ~Midi_stream();
 
     Midi_stream& operator <<( String str );
     Midi_stream& operator <<( Midi_item const& mitem_c_r );
     Midi_stream& operator <<( int i );
 
-    void header();
     void open();
 
-//private:
-//    Midi_stream(Midi_stream const&);
+    ostream* os_p_;
+    String filename_str_;
 };
-#endif // MIDI_STREAM_HH //
+
+#endif // MIDI_STREAM_HH
diff --git a/lily/include/midi-walker.hh b/lily/include/midi-walker.hh
new file mode 100644 (file)
index 0000000..a9ce619
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+  midi-walker.hh -- declare Midi_walker
+
+  (c) 1996, 1997 Han-Wen Nienhuys  <hanwen@stack.nl>
+                 Jan Nieuwenhuizen <jan@digicash.com>
+ */
+
+#ifndef MIDI_WALKER_HH
+#define MIDI_WALKER_HH
+
+#include "proto.hh"
+#include "plist.hh"
+#include "pcursor.hh"
+#include "pqueue.hh"
+#include "lily-proto.hh"
+#include "moment.hh"
+
+struct Midi_note_event : PQueue_ent<Moment, Midi_note_off*>
+{
+    bool ignore_b_;
+    Midi_note_event();
+};
+
+int compare(Midi_note_event const& left, Midi_note_event const& right );
+
+/**
+  walk audio and output midi
+  */
+class Midi_walker : public PCursor<Audio_item*> 
+{
+public:
+    Midi_walker( Audio_staff* audio_staff_l, Midi_track* midi_track_l );
+    ~Midi_walker();
+
+    void process();
+
+private:
+    void do_start_note( Midi_note* note_l );
+    void do_stop_notes( Moment now_mom );
+    void output_event( Moment now_mom, Midi_item* l );
+
+    Midi_track* track_l_;
+    PQueue<Midi_note_event> stop_note_queue;
+    Moment last_mom_;
+};
+
+
+#endif // MIDI_WALKER_HH
index 2eccfd3ee8b6cbf381f82736939eed4ae654307b..d1057bebf0d6a317219fbeddb8452148ebfa658b 100644 (file)
@@ -22,8 +22,7 @@ struct Molecule {
     void add_bottom(const Molecule &m);
     void add(Molecule const &m);
     void translate(Offset);
-    void translate_y(Real);
-    void translate_x(Real);
+    void translate(Real,Axis);
     void add(Atom const & a) ;
     /// how big is #this#? 
     Box extent() const;
index 42ad968c420a575bf517e86a74ee72c532117abc..c38340706e8fa053970c4fb8b89355b035b41046 100644 (file)
 #include "moment.hh"
 
 class Music_iterator {
+   Array<Translator *>report_to_l_arr_;
+   void push_translator(Translator*);
+    void pop_translator();
 protected:
     bool first_b_;
     virtual void do_print()const;
     
-public:
-    Music_iterator *daddy_iter_l_;
-    DECLARE_MY_RUNTIME_TYPEINFO;
-    Array<Translator *>report_to_l_arr_;
-
-    Translator *report_to_l()const;
-    
-    static Music_iterator* static_get_iterator_p(Music*,Translator*);
+    virtual Translator * get_req_translator_l();
     Music_iterator* get_iterator_p(Music*)const;
     void set_translator(Translator*);
-    void push_translator(Translator*);
-    void pop_translator();
-
+    Music_iterator *daddy_iter_l_;
     
+public:
+    Translator *report_to_l()const;
+    DECLARE_MY_RUNTIME_TYPEINFO;
+    static Music_iterator* static_get_iterator_p(Music*,Translator*);
     Music_iterator();
     
     virtual void process_and_next(Moment until);
@@ -42,16 +41,8 @@ public:
     virtual ~Music_iterator();
     virtual void construct_children();
     void print()const;
-    virtual Translator * get_req_translator_l();
 };
 
-class Change_iterator : public Music_iterator {
-    Change_reg * change_l_;
-public:
-     DECLARE_MY_RUNTIME_TYPEINFO;
-    virtual void process_and_next(Moment);
-    Change_iterator(Change_reg*);
-};
 
 class Chord_iterator : public Music_iterator
 {
@@ -91,7 +82,10 @@ class Voice_iterator :  private PCursor<Music*>, public Music_iterator
     Moment here_mom_;
     const Voice * voice_C_;
     Music_iterator * iter_p_;
-    void next_element();
+    void start_next_element();
+    void leave_element();
+    void set_voice_translator();
+    
 public:
     Voice_iterator(Voice const*);
     DECLARE_MY_RUNTIME_TYPEINFO;
index 41531a790218770701f6aa02855a7bc039e2b38b..63ce4b8799d1b4cb8c078086c74ae349daa6f2a7 100644 (file)
 #include "lily-proto.hh"
 #include "string.hh"
 
-/** In Lily, everything that has a length and a pitch (which can be
-  transposed) is considered "music", 
+/** 
+  Anything which has length or pitch.
+  
+  In Lily, everything that can be thought to have a length and a pitch
+  (which has a duration which can be transposed) is considered "music",
 
   Music is hierarchical: 
 
-  @seealso Music_list
+  @see Music_list
+
   */
 class Music:public Input {
 public:
     Music_list * parent_music_l_;
     
-    /** what kind of iterator needed to walk this music?  This doesn't
+    /** The kind of iterator needed to walk this music.  This doesn't
       make sense for simple (ie non-list) music, but it does no harm
       here. Yes, it did harm Music_list: you can forget to copy it.
       
index 782541d68925c7222f945442ff3d1ca55df2715b..6152be77825b0351eff9169d3b418be504c146ab 100644 (file)
@@ -51,9 +51,10 @@ public:
     
     /* *************** */
     void set_duration(Duration);
-    static int compare(const Rhythmic_req &, const Rhythmic_req &);
+    bool do_equal_b(Request*)const;
     virtual Moment duration() const;
     Rhythmic_req();
+    static int compare(Rhythmic_req const&,Rhythmic_req const&);
     REQUESTMETHODS(Rhythmic_req, rhythmic);
 };
 
@@ -88,7 +89,7 @@ public:
     Text_req(int d, Text_def*);
     ~Text_req();
     Text_req(Text_req const&);
-    static int compare(const Text_req&,const Text_req&);
+
     REQUESTMETHODS(Text_req,text);
 };
 
@@ -120,8 +121,8 @@ struct Melodic_req :virtual Musical_req
     /// return pitch from central c (in halfnotes)
     int pitch()const; 
     Melodic_req();
-    static int compare(Melodic_req const&, Melodic_req const&);
-   
+    bool do_equal_b(Request*)const;
+    static int compare(    Melodic_req const&,Melodic_req const&);
     REQUESTMETHODS(Melodic_req,melodic);
 };
 
@@ -132,6 +133,7 @@ public:
     /// force/supress printing of accidental.
     bool forceacc_b_;
     Note_req();
+    bool do_equal_b(Request*)const;
     Rhythmic_req* rhythmic() { return Rhythmic_req::rhythmic(); }
     REQUESTMETHODS(Note_req, note);
  };
@@ -166,7 +168,7 @@ public:
     enum {
        NOSPAN, START, STOP
     } spantype ;
-    static int compare(const Span_req &r1, const Span_req &r2);
+    bool do_equal_b(Request*)const;
     REQUESTMETHODS(Span_req,span);
 
     Span_req();
index 6c963824985e3b868182389a589325c1d309bf74..e606a0f4b3dfb58c4f355d6af08582f810c1d64e 100644 (file)
@@ -38,6 +38,8 @@ class My_lily_parser {
 public:
     int default_octave_i_;
     Duration default_duration_;
+    Plet plet_;
+    
     String textstyle_str_;
     bool first_b_;
     bool last_duration_mode_b_ ;
index 561944f00f84375ed37c04aec27cfceac8251f7c..43ebda4432c4cec3422ca874d0ea3ad48d6742e3 100644 (file)
@@ -23,7 +23,7 @@ class Note_column_engraver :public Engraver {
     bool h_shift_b_;
     int dir_i_;
     
-    /* *************** */
+
     bool acceptable_elem_b(Score_elem const*)const;
 protected:
     virtual void set_feature(Feature);
index b925617e426d3421e3f465a1ec253c74d0d68d75..0fb8aecbd43fab4ae98831306d1ca4fe7b1f0b2d 100644 (file)
@@ -18,7 +18,6 @@ public:
     DECLARE_MY_RUNTIME_TYPEINFO;
 
     Note_performer();
-    ~Note_performer();
 
 protected:
     virtual void process_requests();
@@ -28,7 +27,6 @@ protected:
 
 private:
     Melodic_req * note_req_l_;
-    Moment off_mom_;
 };
 
 #endif // NOTE_PERFORMER_HH
index bd5b2695323f497ff318baebd0e5c4befeac1bc4..00bc73e0e29032e2813403b2c4381f4554d3853f 100644 (file)
@@ -6,33 +6,49 @@
 
 #ifndef OFFSET_HH
 #define OFFSET_HH
+
 #include "real.hh"
+#include "axes.hh"
+
 
 /// 2d vector 
 struct Offset {
-    Real x,y;
-
-    Offset operator+(Offset o)const {
-       Offset r(*this);
-       r+=o;
-       return r;
+    Real coordinate_a_[NO_AXES];
+    
+    Real &y() { return coordinate_a_[Y_AXIS]; }
+    Real &x() { return coordinate_a_[X_AXIS]; }
+    Real y()const { return coordinate_a_[Y_AXIS]; }
+    Real x()const { return coordinate_a_[X_AXIS]; }
+    
+    Real &operator[](Axis i) {
+       return coordinate_a_[i];
+    }
+    Real operator[](Axis i) const{
+       return coordinate_a_[i];
     }
     
     Offset operator+=(Offset o) {
-       x+=o.x;
-       y+=o.y;
+       x()+=o.x();
+       y()+=o.y();
        return *this;
     }
     Offset(Real ix , Real iy) {
-       x=ix;
-       y=iy;
+       x()=ix;
+       y()=iy;
     }
     Offset() {
-       x=0.0;
-       y=0.0;
+       x()=0.0;
+       y()=0.0;
     }
 };
 
+inline Offset
+operator+(Offset o1, Offset const& o2)
+{
+    o1 += o2;
+    return o1;
+}
+    
 #endif // OFFSET_HH
 
 
index 136d25293c3fefd0e1b8bdd3ff982eb7b209f3e8..d66921dc8717c13030f91270db13759eea399a38 100644 (file)
@@ -23,7 +23,7 @@
 class PCol { 
 public:
     Link_list<Item *> its;
-    Link_list<Spanner *> stoppers, starters;
+    Link_list<Spanner *> starters;
     
     /** prebreak is put before end of line.
     if broken here, then (*this) column is discarded, and prebreak
@@ -49,7 +49,7 @@ public:
     bool error_mark_b_;
     bool used_b_ ;             // manual override.. 
     
-    PScore * pscore_l_;
+    Paper_score * pscore_l_;
 
     /* *************** */
     /// which  one (left =0)
@@ -79,7 +79,7 @@ public:
     void set_rank(int);
 
     void OK() const;
- void set_breakable();
   void set_breakable();
     virtual void do_set_breakable();
     void print()const;
 private:
index 596e718c418808e00f351528734d34297ca582a8..12ba8c77ad047455297cc3b8c198d18224702cc8 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  p-score.hh -- declare PScore
+  p-score.hh -- declare Paper_score
 
   source file of the GNU LilyPond music typesetter
 
 #include "plist.hh"
 
 /** all stuff which goes onto paper. notes, signs, symbols in a score
-     #PScore# contains the items, the columns.
+     #Paper_score# contains the items, the columns.
     
     */
 
-class PScore {
+class Paper_score {
 public:
     Paper_def *paper_l_;
 
@@ -41,7 +41,7 @@ public:
     /* *************** */
     /* CONSTRUCTION */
     
-    PScore(Paper_def*);
+    Paper_score(Paper_def*);
     /// add a line to the broken stuff. Positions given in #config#
     void set_breaking(Array<Col_hpositions> const &);
 
@@ -49,9 +49,9 @@ public:
        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,int breakstatus=0);
+    void typeset_item(Item *item_p,  PCol *pcol_l);
 
-    ///    add to bottom of pcols
+    /// add to bottom of pcols
     void add(PCol*);
 
     /**
@@ -75,7 +75,7 @@ public:
     /* STANDARD ROUTINES */
     void OK()const;
     void print() const;
-    ~PScore();
+    ~Paper_score();
     void typeset_element(Score_elem*);
     void typeset_broken_spanner(Spanner*);
     /// add a Spanner
index d172c0bc389b1084649449e341d245baae16e9ca..44fc05e12a2b96545161e5c439a7aadd48c368c6 100644 (file)
@@ -18,7 +18,7 @@
 
 /** 
 
-  symbols, dimensions and constants
+  Symbols, dimensions and constants pertaining to visual output.
 
   This struct takes care of all kinds of symbols, dimensions and
   constants. Most of them are related to the point-size of the fonts,
@@ -68,7 +68,7 @@ public:
     /// height of the staff
     Real standard_height()const;
 
-    /// width of a quaver ball
+    /// width of a crotchet ball
     Real note_width() const;
     void print() const;
 
index fdca52a576725745d6a4dca6f1348806921c1a4b..4c57fc7af84f08de274b88b8890b89b0e9f268d7 100644 (file)
@@ -23,22 +23,14 @@ public:
     DECLARE_MY_RUNTIME_TYPEINFO;
     Input_translator* itrans_l_;
 
-    Performer_group_performer();
-    ~Performer_group_performer();
-
     virtual void add( Performer* perf_p );
-    virtual void print()const { Performer::print() ; }
-    virtual Moment get_mom() const;
     virtual bool do_try_request( Request* req_l );
-    virtual bool try_request(Request*r) { return Performer::try_request(r) ; }
-
-    // <ugh>
-    virtual void set_track( int& track_i_r );
-    virtual int get_track_i() const;
-    // </ugh>
+    virtual void print() const;
+    virtual bool try_request(Request* r);
+    
 
 protected:
-
+    virtual ~Performer_group_performer();
     virtual Translator* find_get_translator_l( String name, String id );
     virtual Translator* get_default_interpreter();
 
index eda9b784f39fa3d460b18dc7020fc7cd9aa5750d..0126c7b231d7c3bd4db3d364dd2da06f4b06cc28 100644 (file)
@@ -27,16 +27,9 @@ public:
     Performer();
     virtual ~Performer();
 
-    
     void print() const;
     virtual void process_requests();
 
-    virtual void set( Moment mom );
-    // <ugh>
-    virtual void set_track( int& track_i_r );
-    virtual int get_track_i() const;
-    // </ugh>
-
     virtual bool try_request( Request* req_l );
 
     virtual void do_removal_processing();
@@ -44,13 +37,10 @@ public:
 
 protected:
     virtual void do_creation_processing();
-
     virtual bool do_try_request(Request*);
     virtual int get_tempo_i() const;
     virtual void do_print() const;
-    virtual Moment get_mom() const;
-    virtual void play( Audio_item* p );
-    virtual void play( Midi_item* l );
+    virtual void play( Audio_element * elem_p  );
 };
 
 #include "global-performers.hh"
index 37bf51caa8603d390e873dfa131e44e6c8bb3030..07e480137eb3929efe2671dff3e12305eab48be3 100644 (file)
@@ -46,8 +46,10 @@ public:
     virtual Blank_req * blank() { return 0; }
     virtual Musical_req *musical() { return 0; }
     virtual Command_req * command() { return 0; }
+    bool equal_b(Request*) const;
 protected:
-    virtual void do_print()const ;
+    virtual bool do_equal_b(Request*) const;
+    virtual void do_print()const;
 };
 
 #define REQUESTMETHODS(T,accessor)     \
@@ -67,7 +69,8 @@ public:
     General_script_def *scriptdef_p_;
 
     /* *************** */
-    static int compare(const Script_req &, const Script_req &);
+    bool do_equal_b(Request*)const;
+
     Script_req();
     REQUESTMETHODS(Script_req,script);
     ~Script_req();
index 7e2db4272c68cf179959d083dcf29af77d0fc45d..6dfdaf16c9635b9fe4ace311f3a44b66c9b427a2 100644 (file)
 #include "script-column.hh"
 #include "head-column.hh"
 
-/** 
-  struct to treat a set of rests as union (one voicegroup should
-  only produce one rest.
-  */
+/** struct to treat a set of rests as union (one voice should only
+  produce one rest.  */
 class Rest_column : public Head_column {
 public:
     DECLARE_MY_RUNTIME_TYPEINFO;
index 4dcee6837e466dd84019115b21fbb44d133c3650..718137ecfa2cb4b7c9fffdf575a7aa109d3849d4 100644 (file)
@@ -12,6 +12,9 @@
 
 #include "engraver.hh"
 
+/**
+  Group  a number of items across staffs
+ */
 class Score_align_engraver: public Engraver
 {
     Horizontal_group_item  * align_p_;
index 396fc0312b93841a216e0261d7e03185e4c23d39..e108bc82132c8393cabf4e33146b4f869c0803fa 100644 (file)
 #include "p-col.hh"
 
 /**
-
-    When typesetting hasn't started on PScore yet, the columns which
-    contain data have a rhythmical position. Score_column is the type
-    with a rhythmical time attached to it. The calculation of
-    idealspacing is done with data in these columns. (notably: the
-    #durations# field)
-
-    */
+  Column with durational info.
+  
+  The columns which contain data have a rhythmical
+  position. Score_column is the type with a rhythmical time attached
+  to it. The calculation of idealspacing is done with data in these
+  columns. (notably: the #durations# field)
+
+  */
 
 class Score_column : public PCol {
     friend class Score;
index 39c06152622eed91ea2c3185ccc9358ee8575d51..82a6fbfe3d7a64dff7e54ab8ea70ad5cb22b2c9d 100644 (file)
@@ -15,6 +15,8 @@
 
 #define SCORE_ELEM_CLONE(T) VIRTUAL_COPY_CONS(T, Score_elem)
 
+
+
 /** 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
@@ -29,11 +31,6 @@ class Score_elem : private Directed_graph_node {
     Molecule *output;          // should scrap, and use temp var?
 
 
-    /**
-      This is  needed, because #output# may still be
-      NULL.
-      */
-    Offset offset_;
 
     /**
       for administration of what was done already
@@ -56,12 +53,26 @@ class Score_elem : private Directed_graph_node {
     
     Status status_;
 
+    Score_elem* dependency(int) const;
+    Score_elem* dependent(int) const;
+    int dependent_size() const;
+    int dependency_size() const;
 public:
-    PScore *pscore_l_;    
-    Vertical_group  *y_group_l_;
-    Horizontal_group *x_group_l_;
+    /**
+      This is  needed, because #output# may still be
+      NULL.
+      */
+    Offset offset_;
+
+
+
+
+    Paper_score *pscore_l_;    
+    Axis_group_element * axis_group_l_a_[2];
+
     Score_elem(Score_elem const&);
     virtual String TeX_string () const ;
+    String TeX_string_without_offset(Offset)const;
     virtual void print() const;
     
     Paper_def *paper() const;
@@ -70,17 +81,24 @@ public:
     Score_elem();
     DECLARE_MY_RUNTIME_TYPEINFO;    
     
+    Interval extent(Axis)const;
     Interval width() const;
     Interval height() const;
-    virtual void translate_x(Real);
-    virtual void translate_y(Real);
     Status status() const;
     
      /**
       translate the symbol. The symbol does not have to be created yet. 
       */
     void translate(Offset);
-    Offset offset()const;
+    /**
+      translate in one direction
+     */
+    
+    void translate(Real, Axis);
+    Real relative_coordinate(Axis_group_element*, Axis)const;
+    Offset absolute_offset()const;
+    Real absolute_coordinate(Axis)const;
+    Axis_group_element*common_group(Score_elem const* s, Axis a)const;
 
     void add_processing();
     void OK() const;
@@ -91,6 +109,9 @@ public:
     void post_processing();
     void molecule_processing();
 
+    /**
+      Remove all  links (dependencies, dependents, Axis_group_elements.
+     */
     void unlink();
     void unlink_all();
     void substitute_dependency(Score_elem*,Score_elem*);
@@ -109,19 +130,12 @@ public:
     /*
       virtual accessors
      */
-    virtual Vertical_group * vertical_group() { return 0; }
-    virtual Horizontal_group * horizontal_group() { return 0; }
 
     virtual Spanner* spanner()  { return 0; }
-    virtual Horizontal_vertical_group* elem_group() { return 0; }
     virtual Item * item() { return 0; }
     virtual Line_of_score * line_l() const;
     SCORE_ELEM_CLONE(Score_elem);
-    Score_elem* dependency(int) const;
-    Score_elem* dependent(int) const;
-    int dependent_size() const;
-    int dependency_size() const;
-    
     /// no dimension, translation is noop
     bool empty_b_;
     /// do not print anything black
@@ -135,7 +149,7 @@ protected:
     virtual void do_print() const {}
     /// generate the molecule    
     virtual Molecule* brew_molecule_p()const;
-    ///executed directly after the item is added to the PScore
+    ///executed directly after the item is added to the Paper_score
     virtual void do_add_processing();
     /// do calculations before determining horizontal spacing
     virtual void do_pre_processing();
@@ -149,9 +163,8 @@ protected:
     virtual void do_break_processing();
     virtual void handle_broken_dependencies();
     virtual void handle_prebroken_dependencies();
-
-
-
+    virtual Link_array<Score_elem> get_extra_dependencies()const;
+    virtual void do_unlink();
 };
 
 
index 7a722edc2ebdb154cd031c14edac087ae01d7bf7..39941cda65ba05c1c88e42f9101eb9e9350812e1 100644 (file)
@@ -13,6 +13,9 @@
 #include "engraver-group.hh"
 #include "global-translator.hh"
 
+/**
+  Top level engraver. Puts elements into appropriate columns.
+ */
 class Score_engraver : 
     public Engraver_group_engraver, public Global_translator 
 {
@@ -28,7 +31,7 @@ class Score_engraver :
     Score_column* musical_column_l_;
     
     friend class Score;
-    void set_cols(Score_column*,Score_column*);
+    void set_columns(Score_column*,Score_column*);
     void typeset_all();
     
 public:
@@ -52,7 +55,6 @@ protected:
     virtual void do_creation_processing();
     virtual void do_removal_processing();
     virtual void announce_element(Score_elem_info);
-    virtual void typeset_breakable_item(Item * nobreak_p);
     virtual void do_announces();
     virtual void typeset_element(Score_elem*elem_p);
     virtual Paper_def * paper() const;
index b4030800b49443dc7e1a7ee221be4c35733e6c59..b0b584e72a0bc937c3981502b0ac4f57b49f922a 100644 (file)
@@ -11,6 +11,9 @@
 #include "performer-group-performer.hh"
 #include "global-translator.hh"
 
+/**
+  Top level performer. Completely takes care of MIDI output
+ */
 class Score_performer: 
     public Performer_group_performer, public Global_translator 
 {
@@ -20,29 +23,22 @@ public:
     ~Score_performer();
 
 protected:
-    virtual Translator* ancestor_l( int l );
+    virtual Translator* ancestor_l(int l);
     virtual int depth_i() const;
 
     virtual void finish();
-    virtual Moment get_mom() const;
-    virtual void prepare( Moment mom );
+    virtual void prepare(Moment mom);
     virtual void process();
-    virtual void set_score( Score* score_l );
+    virtual void set_score(Score* score_l);
     virtual void start();
     virtual int get_tempo_i() const;
-    virtual void play(Audio_item*);
-    virtual void play(Midi_item*);
+    virtual void play(Audio_element* p);
 
 private:
     void header(Midi_stream&);
 
-    Midi_def* midi_l_;
-
-    Moment prev_mom_;
     Moment now_mom_;
     Audio_column* audio_column_l_;
-
-    Link_array<Midi_item> midi_item_l_arr_;
 };
 
 #endif // SCORE_PERFORMER_HH
index ecd4f8cc109c5dd342fe44fcadd2d48bfe28f84a..058fb173b0eb4fce16018a6f1049a7d595f3fbda 100644 (file)
@@ -26,7 +26,7 @@ public:
     Paper_def *paper_p_;
     Midi_def *midi_p_;
     Music * music_p_;
-    PScore *pscore_p_;
+    Paper_score *pscore_p_;
     Audio_score* audio_score_p_;
 
     int errorlevel_i_;
@@ -44,7 +44,6 @@ public:
     /// output to file
     void output(String fn);
 
-    
     ///
     void set(Midi_def* midi_p);
     ///
@@ -66,7 +65,6 @@ private:
     // utils:
     PCursor<Score_column*> create_cols(Moment, PCursor<Score_column*> &last);
 
-
     /**
       make the pcol_l_ fields of each Score_column point to the correct PCol,
       remove any unnecessary Score_column's
index aeb9d11277a5c35d0b5f540bc26c61862dcd6c2e..b3d73aac9520c4efdedc7ba93dc876245e330964 100644 (file)
@@ -25,7 +25,7 @@ public:
     Link_array<Item> support_l_arr_;
     DECLARE_MY_RUNTIME_TYPEINFO;
    
-    void add(Script *);
+    virtual void add(Script *);
     void add_support(Item*);
 };
 
index 890ce377bc064b497978dfb752fa20f95a26b0a4..65898a0549a91f963f668b1163f755c508947391 100644 (file)
@@ -37,7 +37,7 @@ public:
     virtual Atom get_atom(Paper_def* p, int dir_i_)const;
     DECLARE_MY_RUNTIME_TYPEINFO;
 
-    virtual bool do_equal_b(General_script_def const &)const;
+    virtual bool do_equal_b(General_script_def const *)const;
     virtual void do_print() const;
     Script_def();
     void set_from_input(String, bool, int, int ,bool,int );
index 2e622aa7ff8f834e73ececadfbc74b42701fa51f..ce72d40deff7b96861431c2ad61af576abe07132 100644 (file)
@@ -15,15 +15,12 @@ class Script_engraver : public Engraver {
     Array<Script *> script_p_arr_;
     Array<Script_req *> script_req_l_arr_;
 
-    /* *************** */
-    bool acceptable_elem_b(Score_elem*);
 public:
     DECLARE_MY_RUNTIME_TYPEINFO;
     Script_engraver();
 protected:
     virtual bool do_try_request(Request*);
     virtual void do_process_requests();
-    virtual void acknowledge_element(Score_elem_info);
     virtual void do_pre_move_processing();
     virtual void do_post_move_processing();
 
index 2031a28ad685b6155383eb24d6163a4ddeda1010..bd7a5cc08636ddec8ee50337adadc039fc7c7b9c 100644 (file)
@@ -17,7 +17,6 @@ class Script : public Item, public Staff_side {
     
     Stem *stem_l_;
 
-    /* *************** */
 protected:
     Molecule *brew_molecule_p()const;
     virtual void do_substitute_dependency(Score_elem*,Score_elem*);
@@ -25,6 +24,7 @@ protected:
     virtual Interval symbol_height()const;
     virtual void do_pre_processing();
     virtual Interval do_width() const;
+    SCORE_ELEM_CLONE(Script);
 private:
 
     void set_default_dir();
index f81428dc034471edc9f2502d3d1e72136aafff60..03a63aaece2c4cede931bf504d3d93a8198f3715 100644 (file)
 
 #include "engraver.hh"
 
+/** 
+
+  Make bars that span multiple "staffs". Catch bars, and span a
+  Span_bar over them if we find more than 2 bars
+
+  */
 class Span_bar_engraver : public Engraver
 {
     Span_bar * spanbar_p_;
index d181ebbc9531f9ca0f87fd279206301d6a60cc85..724caa3b9f52d52572069b28189b5bdc543f3821 100644 (file)
@@ -17,6 +17,7 @@ class Span_bar : public Bar
     Link_array<Bar> spanning_l_arr_;
 
 public:
+    Span_bar();
     DECLARE_MY_RUNTIME_TYPEINFO;
     SCORE_ELEM_CLONE(Span_bar);
     void add(Bar* );
@@ -25,7 +26,6 @@ public:
 protected:
     virtual Interval do_width()const;
     virtual void do_pre_processing();
-    virtual void translate_y(Real y);
     
     virtual void do_substitute_dependency(Score_elem*,Score_elem*);
     virtual Molecule * brew_molecule_p()const;
index 5b53ffbb7158e4cb1e5ba9be7219b02a65bb4249..836424c0c21d7adaf089c7353b393cff0af090f5 100644 (file)
 
 #include "span-bar-grav.hh"
 
+/** 
+
+  Make the bars that Span the entire score line (system). A
+  Span_bar_engraver which generates a special bar.
+
+  */
+
 class Span_score_bar_engraver : public Span_bar_engraver 
 {
 public:
index 821c762cf00213e15b8261eec5b806b517d34dea..2f65af207b73e1c68e4b5d027aea64a29c33c162 100644 (file)
@@ -13,7 +13,7 @@
 #include "spanner.hh"
 #include "elem-group.hh"
 
-class Spanner_elem_group : public Spanner, public Horizontal_vertical_group {
+class Spanner_elem_group : public Spanner, public Horizontal_vertical_group_element {
     
 protected:
     virtual Interval do_width()const;
index 30a72290c0e5dc42035e1550559d97d005548214..79e1bd4cfdb90d76d299232d8c9236038242ff61 100644 (file)
@@ -10,7 +10,7 @@
 #include "lily-proto.hh"
 #include "score-elem.hh"
 
-/** a symbol which is attached between two columns. A spanner is a
+/** 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.
 
index 85b828d2fa257e292de8820c821ba99d18346628..0a38a2e25539d34c1a6cff9f87d806685e6f01cf 100644 (file)
@@ -16,7 +16,7 @@
 #include "colhpos.hh"
 
 /** 
-  Determine positions of columns connected by springs and held apart by rods
+  Determine positions of columns connected by springs and held apart by rods.
   
   
     Generate a spacing which
index 8d6a45d92f2f9eda25436ea84c6bb178249dc6fd..b73e9b9fe517d051519e93dc4ce96a7dcc5de375 100644 (file)
@@ -21,22 +21,12 @@ public:
     String instrument_str();
 
 protected:
-    virtual void play( Midi_item* l );
-    virtual void play( Audio_item* l );
+    virtual void play( Audio_element* p );
     virtual void do_removal_processing();
     virtual void do_creation_processing();
-    // <ugh>
-    virtual void set_track( int& track_i_r );
-    virtual int get_track_i() const;
-    // </ugh>
 
 private:
-    void header();
-
-    Moment midi_mom_;
-    Midi_track* midi_track_p_;
-    Pointer_list<Audio_item*> audio_item_p_list_;
-    int track_i_;
+    Audio_staff* audio_staff_p_;
 };
 
 #endif // STAFF_PERFORMER_HH
index 4186c01be10cd371d4fd574e5443ec5feda3336e..73f174f1052e5ecf430362d5b6c47b76258f0515 100644 (file)
@@ -13,9 +13,8 @@
 #include "score-elem.hh"
 #include "interval.hh"
 
-/** A symbol which sits along a staff
+/** A symbol which sits along a staff.
 
-  Should override translate_y() ?
   */
 class Staff_side : virtual Score_elem {
     Link_array<Score_elem> support_l_arr_;
diff --git a/lily/include/staffline.hh b/lily/include/staffline.hh
deleted file mode 100644 (file)
index db08cb6..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-  staffline.hh -- horizontal structures for broken scores.
-
-  (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef STAFFLINE_HH
-#define STAFFLINE_HH
-
-#include "spanner-elem-group.hh"
-
-/// one broken line of staff.
-struct Line_of_staff : public Spanner_elem_group{
-
-    SCORE_ELEM_CLONE(Line_of_staff);
-public:
-    DECLARE_MY_RUNTIME_TYPEINFO;
-
-    /* *************** */
-    /** 
-      Add an element. If it is a Element_group, only the dependency
-      (otherwise, might translate doubly) */
-    void add_element(Score_elem*);
-};
-
-#endif
index d090ea707a3c06909dcb769378f33cf8352bad3b..c6b7360e05a5338d673e680f57f136466ef25fa3 100644 (file)
 #define SUPER_ELEM_HH
 
 #include "score-elem.hh"
-/** The toplevel element. The PScore contains this element, and any
+/** The toplevel element. The Paper_score contains this element, and any
   element shoud be a dependency for the super element.
   */
-class Super_elem : public virtual Score_elem {
+class Super_elem : public Score_elem {
 public:
     Link_array<Line_of_score> lines_arr_;
     Line_of_score * line_of_score_l_;
index e1e24b25e068b45dfbe405471e0649be60187ef9..3e2eafc7d3ab592a262a669f4d1d47fc386e4af9 100644 (file)
@@ -33,13 +33,9 @@ struct Atom {
     void translate(Offset o) {
        off_ += o;
     }
-    void translate_x(Real r){ 
-       off_.x += r;
+    void translate(Real r,Axis a){
+       off_[a] += r;
     }
-    void translate_y(Real r) {
-       off_.y += r;
-    }
-    
     /// how big is #this#?
     Box extent() const;
     Atom(Symbol s);
index 371aeb44b8e26da5b797b2f45953cd3c922b996d..3f7d4332460d4caff2bf8e07c5797bb99941eeeb 100644 (file)
@@ -28,10 +28,9 @@ public:
     String text_str_;
     String style_str_;
     
-    /* *************** */
     virtual void do_print() const;
     virtual ~Text_def() {};
-    bool do_equal_b(const Text_def&)const;
+    virtual bool do_equal_b(const General_script_def*)const;
     Text_def();
     virtual void print() const;
     Interval width(Paper_def*) const;
diff --git a/lily/include/timing-grav.hh b/lily/include/timing-grav.hh
new file mode 100644 (file)
index 0000000..96abc5c
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+  timing-grav.hh -- declare Timing_engraver
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef TIMING_GRAV_HH
+#define TIMING_GRAV_HH
+
+#include "engraver.hh"
+#include "time-description.hh"
+#include "grouping.hh"
+#include "parray.hh"
+
+/**
+  Do time bookkeeping
+ */
+class Timing_engraver : public Engraver
+{   
+    Time_description time_;
+    Rhythmic_grouping  default_grouping_;
+    
+    Link_array<Timing_req> timing_req_l_arr_;
+    virtual void fill_staff_info(Staff_info&);
+    virtual bool do_try_request(Request *req_l);
+    virtual void do_process_requests();
+    virtual void do_pre_move_processing();
+    virtual void do_creation_processing();
+    virtual void do_post_move_processing();
+    Timing_engraver();
+    DECLARE_MY_RUNTIME_TYPEINFO;
+}
+
+#endif // TIMING_GRAV_HH
index b96dfba33529a6192c80bbb7ee41745857fcb462..0fc0029b5bdc6ab01ebd12ced7091bd363a28499 100644 (file)
@@ -11,6 +11,7 @@
 #define VERTICAL_ALIGN_ITEM_HH
 
 #include "elem-group.hh"
+
 /**
   Order elements top to bottom.
  */
index d092d96488d47b63056dc798c85ef840990ae282..ab90bdb6b657cab7a39543ad0e2038e1ef21dfec 100644 (file)
 #ifndef SPAN_VERTICAL_GROUP_HH
 #define SPAN_VERTICAL_GROUP_HH
 
-#include "spanner.hh"
+#include "axis-group-spanner.hh"
 #include "elem-group.hh"
 
-/** An element which groups a line. Due to technical problems, this
  cannot be used as a baseclass */
-class Vertical_group_spanner : public Spanner, public Vertical_group
+/** An element which groups a line. 
+ */
+class Vertical_group_spanner : public Axis_group_spanner, public Vertical_group_element
 {
 protected:
-    virtual void do_break_processing();
-    virtual void do_print()const;
-    VIRTUAL_COPY_CONS(Vertical_group_spanner, Score_elem);
-
-private:
-    void remove_all();
-    /// shouldn't be copied.
-    Vertical_group_spanner(Vertical_group_spanner const&);
-
+    SCORE_ELEM_CLONE(Vertical_group_spanner);
+    virtual void remove_all() { Vertical_group_element::remove_all(); }
 public:
-    Vertical_group_spanner();
     DECLARE_MY_RUNTIME_TYPEINFO;
+    virtual void add_element(Score_elem*e) { Vertical_group_element::add_element(e); }
+    virtual void remove_element(Score_elem*e) { Vertical_group_element::remove_element(e); }
+  
 };
 
 #endif // SPAN_VERTICAL_GROUP_HH
index 083798be00bbe1d4e4abd9300a585d92a30a362e..7553b8cf6bbdc1ef2ba9f11865e4286fbc389aad 100644 (file)
 
 Item::Item()
 {
+    breakable_b_ = false;
+    break_status_i_ = 0;
     pcol_l_ = 0;
-    broken_to_a_[0]
-       = broken_to_a_[1]=0;
+    broken_to_a_[0] = broken_to_a_[1]=0;
 }
 
 IMPLEMENT_IS_TYPE_B1(Item, Score_elem);
@@ -33,11 +34,9 @@ Item::do_print() const
 Real 
 Item::hpos_f()const
 {
-    return pcol_l_->hpos_f_ + offset().x;
+    return pcol_l_->hpos_f_ + absolute_coordinate(X_AXIS);
 }
 
-
-
 Line_of_score *
 Item::line_l()const
 {
@@ -47,43 +46,42 @@ Item::line_l()const
 int
 Item::break_status_i() const
 {
-    PCol * c = pcol_l_;
-    if (c->breakable_b())
-       return 0;
-    else if (!c->daddy_l_) 
-       return 0; 
-    else if (c == c->daddy_l_->prebreak_p_)
-       return -1;
-    else 
-       return 1;
+    return break_status_i_;
 }
 
 void
 Item::copy_breakable_items()
 {
+    if ( broken_to_a_[0] || broken_to_a_[1] )
+       return;
+    Item *new_copies[2];
     for (int i=0; i < 2; i++) {
        Item * item_p = clone()->item();
        item_p->copy_dependencies(*this);
-       /* add our pre and postbreaks blondly to our own y_group
-          Let Vertical_group_spanner figure out the mess.
-        */
-       if  ( y_group_l_ )
-           y_group_l_->add_element( item_p );
-       pscore_l_->typeset_item(item_p, pcol_l_, -1+ 2*i);
+       
+       item_p->break_status_i_ =  -1+ 2*i;
+       pscore_l_->typeset_item(item_p, pcol_l_);
        item_p->handle_prebroken_dependencies();
-       broken_to_a_[i] = item_p;
+       new_copies[i] =item_p;
     }
+    broken_to_a_= new_copies;
 }
 
 void
 Item::do_breakable_col_processing()
 {
-    PCol * c = pcol_l_;
-    if (!c->breakable_b())
+    if (!breakable_b_ || !pcol_l_->breakable_b())
        return;
-    
+
     copy_breakable_items();
     handle_prebroken_dependencies();
+
+    /*
+      Otherwise the broken items won't be pre_process()'ed.
+     */
+    add_dependency( broken_to_a_[0] );
+    add_dependency( broken_to_a_[1] );    
+
 }
 
 Item*
@@ -116,6 +114,6 @@ Item::find_prebroken_piece(PCol*c)const
 void
 Item::handle_prebroken_dependencies()
 {
-    if ( pcol_l_->breakable_b() || pcol_l_->daddy_l_ )
+    if ( breakable_b_ )
        Score_elem::handle_prebroken_dependencies();
 }
index 84288bd1012dc75d57cdcfe1c32acfc5c4aac600..5de204bd2507b9f31981d4a6958add82cadfd7af 100644 (file)
@@ -28,7 +28,11 @@ void
 Key_engraver::create_key()
 {
     if (!kit_p_) {
-       int c0_i= *get_staff_info().c0_position_i_l_;   
+       int c0_i=0;
+
+       Staff_info inf = get_staff_info();
+       if (inf.c0_position_i_l_)
+           c0_i = *get_staff_info().c0_position_i_l_;  
        
        kit_p_ = new Key_item(c0_i);
        announce_element(Score_elem_info(kit_p_,keyreq_l_));
@@ -67,9 +71,9 @@ Key_engraver::acknowledge_element(Score_elem_info info)
 void
 Key_engraver::do_process_requests()
 {
-    if (key_.multi_octave_b_)
+    if (key_.multi_octave_b_) {
        assert(false); // TODO . 
-    else if (keyreq_l_) {
+    else if (keyreq_l_) {
        create_key();
     }
 }
@@ -79,7 +83,7 @@ Key_engraver::do_pre_move_processing()
 { 
     if (kit_p_) {
        kit_p_->default_b_ = default_key_b_;
-       typeset_breakable_item( kit_p_);
+       typeset_element( kit_p_);
        kit_p_ = 0;
     }
 }
@@ -90,7 +94,7 @@ void
 Key_engraver::read_req(Key_change_req * r)
 {
     key_.multi_octave_b_ = r->multi_octave_b_;
-    accidental_idx_arr_.set_size(0);
+    accidental_idx_arr_.clear();
     for (int i = 0; i < r->melodic_p_arr_.size(); i ++) {
        Melodic_req *  m_l =r->melodic_p_arr_[i];
        int n_i =m_l->notename_i_;
index aa8401e005e520b8b744464bf772888afa6edace..299695561f2da23f456e81774466d430ace55e9a 100644 (file)
@@ -1,10 +1,20 @@
+/*
+  key-item.cc -- implement Key_item
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+
+  keyplacement by Mats Bengtsson
+*/
+
 #include "key-item.hh"
 #include "key.hh"
 #include "debug.hh"
 #include "molecule.hh"
 #include "paper-def.hh"
 #include "lookup.hh"
-//#include "clef-grav.hh"
+
 #include "key-grav.hh"
 
 const int FLAT_TOP_PITCH=2; /* fes,ges,as and bes typeset in lower octave */
@@ -12,6 +22,7 @@ const int SHARP_TOP_PITCH=4; /*  ais and bis typeset in lower octave */
 
 Key_item::Key_item(int c)
 {
+    breakable_b_ =true;
     default_b_ = false;
     set_c_position(c);
 }
@@ -58,7 +69,7 @@ Key_item::brew_molecule_p()const
     for (int i =0; i < pitch.size(); i++) {
        Symbol s= paper()->lookup_l()->accidental(acc[i]);
        Atom a(s);
-       a.translate_y((c_position + pitch[i]) * inter);
+       a.translate((c_position + pitch[i]) * inter, Y_AXIS);
        Molecule m(a);
        output->add_right(m);   
     }
index cf9ec478e494b50923f067bd624f0bc7c73e56ae..04dd26bdcc2d6cbf873d3b8d259575852c1c6490 100644 (file)
@@ -5,7 +5,7 @@ Least_squares::OK() const
     assert( input.size() > 1 );
     Real dx = 0.0;
     for (int i=1; i < input.size(); i++)
-       dx += abs (input[i-1].x - input[i].x);
+       dx += abs (input[i-1].x() - input[i].x());
 
     assert(dx);
 }
@@ -19,8 +19,8 @@ Least_squares::minimise(Real &coef, Real &offset)
     Real sxy = 0.0;
 
     for (int i=0; i < input.size();i++) {
-       Real x=input[i].x;
-       Real y = input[i].y;
+       Real x=input[i].x();
+       Real y = input[i].y();
        sx += x;
        sy += y;
        sqx += sqr(x);
index 51ea87a08dd3a5fcde94cd98740d7524f5fd02f6..0634e76c4a6dea644f29029efe4f237e0450f206 100644 (file)
@@ -70,7 +70,7 @@ TEX           {AA}|-|{PUNCT}|{ACCENT}|{NATIONAL}
 WORD           {A}{AN}*
 ALPHAWORD      {A}+
 INT            -?{N}+
-REAL           {INT}?\.{N}*
+REAL           ({INT}\.{N}*)|(-?\.{N}+)
 KEYWORD                \\{WORD}
 WHITE          [ \n\t\f]
 BLACK          [^ \n\t\f]
@@ -179,9 +179,6 @@ LYRICS              ({AA}|{NATIONAL})[^0-9 \t\n\f]*
                return INT;
        }
 
-       \+\+            {
-               return CONCAT;
-       }
        \" {
                start_quote();
        }
@@ -223,7 +220,7 @@ LYRICS              ({AA}|{NATIONAL})[^0-9 \t\n\f]*
                /* ugr. This sux. */
                String s (YYText()); 
                int i = 0;
-               while ((i=s.index_i("_")) != -1) // change word binding "_" to " "
+                       while ((i=s.index_i("_")) != -1) // change word binding "_" to " "
                        *(s.ch_l() + i) = ' ';
                if ((i=s.index_i("\\,")) != -1)   // change "\," to TeX's "\c "
                        {
@@ -335,6 +332,14 @@ My_lily_lexer::scan_escaped_word(String str)
                yylval.id = id;
                return id->token_code_i_;
        }
+       if ( YYSTATE != notes ) {
+               Melodic_req * mel_l = lookup_melodic_req_l(str);
+               if (mel_l) {
+                   mtor << "(notename)\n";
+                   yylval.melreq = mel_l;
+                   return NOTENAME_ID;
+               }
+       }
        LexerError( "Unknown escaped string: `" + str + "'");   
        mtor << "(string)";
        String *sp = new String( str);
@@ -354,17 +359,6 @@ My_lily_lexer::scan_bare_word(String str)
                    return NOTENAME_ID;
                }
        }
-#if 0
-       if (YYSTATE != notes) {
-               // ugr. Should do this in note mode?
-       //              Identifier * id = lookup_identifier(str);
-               if (id) {
-                       mtor << "(identifier)\n";
-                       yylval.id = id;
-                       return id->token_code_i_;
-               }
-       }
-#endif
 
        yylval.string=new String( str );
        return STRING;
index 2e4b5063350214cbba02b0f453aaa4ba9436af96..3fc21f24728f722afc32eb8d591c8befdbcbdbd2 100644 (file)
@@ -11,7 +11,6 @@
 #include "command-request.hh"
 #include "bar.hh"
 #include "debug.hh"
-#include "staffline.hh"
 #include "line-group-grav.hh"
 
 Line_group_engraver::Line_group_engraver()
@@ -22,7 +21,7 @@ Line_group_engraver::Line_group_engraver()
 void
 Line_group_engraver::acknowledge_element(Score_elem_info  elem)
 {
-    if ( !elem.elem_l_->y_group_l_ )
+    if ( !elem.elem_l_->axis_group_l_a_[Y_AXIS] )
        staffline_p_->add_element(elem.elem_l_);
 }
 
index 78fbae299214cc5eb5220371f8cf9ad22aa39c50..bd474f4d2bb021a9d1a159c026f16943cab05e17 100644 (file)
@@ -40,8 +40,15 @@ Local_key_engraver::do_pre_move_processing()
                
                
 
-           if (!key_item_p)
-               key_item_p = new Local_key_item(*get_staff_info().c0_position_i_l_);
+           if (!key_item_p) {
+               int c0_i=0;
+
+               Staff_info inf = get_staff_info();
+               if (inf.c0_position_i_l_)
+                   c0_i = *get_staff_info().c0_position_i_l_;  
+               
+               key_item_p = new Local_key_item(c0_i);
+           }
            key_item_p->add(note_l);
            key_item_p->add_support(support_l);
            local_key_.oct(note_l->octave_i_)
@@ -57,12 +64,14 @@ Local_key_engraver::do_pre_move_processing()
        typeset_element(key_item_p);
     }
     
-    mel_l_arr_.set_size(0);
-    tied_l_arr_.set_size(0);
-    support_l_arr_.set_size(0);
-    forced_l_arr_.set_size(0); 
+    mel_l_arr_.clear();
+    tied_l_arr_.clear();
+    support_l_arr_.clear();
+    forced_l_arr_.clear();     
 }
-
+/*
+  whoah .. this looks hairy!
+ */
 void
 Local_key_engraver::acknowledge_element(Score_elem_info info)
 {    
@@ -95,11 +104,9 @@ void
 Local_key_engraver::do_process_requests()
 {
     Time_description const * time_C_ = get_staff_info().time_C_;
-    if (time_C_->whole_in_measure_){
+    if (time_C_ && !time_C_->whole_in_measure_){
        if (key_C_)
            local_key_= *key_C_;
-       else if(0&& time_C_->when_ >Moment(0))
-           warning ("Help me! can't figure out current key");
     }
 }
 
index 50f870c1cfe9b1f2b353d5ffe7907c3df742135f..6f84c2d40dfd28bd38621443dde879d424d1c961 100644 (file)
@@ -66,7 +66,7 @@ Local_key_item::brew_molecule_p()const
        if (accs[i].octave_i_ != lastoct) {
            if (octmol){
                Real dy =lastoct*7*paper()->internote_f();
-               octmol->translate_y( dy);
+               octmol->translate( dy, Y_AXIS);
                output->add(*octmol);
                delete octmol;
            }
@@ -76,20 +76,20 @@ Local_key_item::brew_molecule_p()const
        Symbol s =paper()->lookup_l()->accidental(accs[i].accidental_i_);   
        Atom a(s);
        Real dy = (accs[i].name_i_ + c0_position) * paper()->internote_f();
-       a.translate_y(dy);
+       a.translate(dy, Y_AXIS);
 
        octmol->add_right(a);
     }
 
     if (octmol){
        Real dy =lastoct*7*paper()->internote_f();
-       octmol->translate_y( dy);
+       octmol->translate( dy, Y_AXIS);
        output->add(*octmol);
        delete octmol;
     }
 
     Interval head_width=itemlist_width(support_items_);
-    output->translate_x(-output->extent().x.right + head_width.left );
+    output->translate(-output->extent().x().right + head_width.left , X_AXIS);
     
     return output;
 }
index 6bc298e14798138be4ee70d69fe3eb43c24de6a1..e51a3e8b89498e103e2406abe7bc8f18f08f39fa 100644 (file)
@@ -109,7 +109,7 @@ Lookup::bar(String s, Real h) const
     a.push(print_dimen( h));
     Symbol ret=(*symtables_)("bars")->lookup(s);;
     ret.tex = substitute_args(ret.tex, a);
-    ret.dim.y = Interval( 0, h);
+    ret.dim.y() = Interval( 0, h);
     return ret;
 }
 
@@ -183,7 +183,7 @@ Lookup::hairpin(Real &wid, bool decresc) const
     Array<String> a;
     a.push(idx);
     ret.tex = substitute_args(ret.tex, a);
-    ret.dim.x = Interval(0,wid);
+    ret.dim.x() = Interval(0,wid);
     return ret;
 }
 
@@ -192,9 +192,8 @@ Lookup::linestaff(int lines, Real wid) const
 {
     Real internote_f = paper_l_ ->internote_f();
     Symbol s;
-    s.dim.x = Interval(0,wid);
     Real dy = (lines >0) ? (lines-1)*internote_f : 0;
-    s.dim.y = Interval(0,dy);
+    s.dim = Box(Interval(0,wid), Interval(0,dy));
 
     Array<String> a;
     a.push(lines);
@@ -211,8 +210,8 @@ Symbol
 Lookup::meter(Array<Scalar> a) const
 {
     Symbol s;
-    s.dim.x = Interval( 0 PT, 10 PT);
-    s.dim.y = Interval(0, 20 PT);      // todo
+    s.dim.x() = Interval( 0 PT, 10 PT);
+    s.dim.y() = Interval(0, 20 PT);    // todo
     String src = (*symtables_)("param")->lookup("meter").tex;
     s.tex = substitute_args(src,a);
     return s;    
@@ -229,8 +228,8 @@ Lookup::stem(Real y1,Real y2) const
     }
     Symbol s;
     
-    s.dim.x = Interval(0,0);
-    s.dim.y = Interval(y1,y2);
+    s.dim.x() = Interval(0,0);
+    s.dim.y() = Interval(y1,y2);
     
     Array<String> a;
     a.push(print_dimen(y1));
@@ -263,7 +262,7 @@ Lookup::vbrace(Real &y) const
        Array<String> a;
        a.push(idx);
        s.tex = substitute_args(s.tex,a);
-       s.dim.y = Interval(0,y);
+       s.dim.y() = Interval(0,y);
     }
     {
        Array<String> a;
index 85e8e630fd14e4401d0d535374ca9fb7966c0d95..0ab6b7920447fa9c96922c5db4b8cd36718de680 100644 (file)
@@ -36,7 +36,7 @@ Lyric_engraver::do_process_requests()
     if ( lreq_l_ ) {  
        lyric_item_p_ =  new Text_item(lreq_l_->tdef_p_ );
 
-       lyric_item_p_->translate_x( paper()->note_width()/2 );
+       lyric_item_p_->translate( paper()->note_width()/2 , X_AXIS);
        lyric_item_p_->dir_i_ = -1;
        lyric_item_p_->fat_b_ = true;
        announce_element( Score_elem_info( lyric_item_p_, lreq_l_));
index a87d9b28852241a821362f4e8bec1608094afa42..eff3d6cc811f3244dd57a039a9284ffb18264adc 100644 (file)
@@ -23,6 +23,7 @@
 Sources* source_l_g = 0;
 bool only_midi = false;
 bool version_ignore_b_ = false;
+int exit_status_i_;
 
 void destill_inname( String &name_str_r);
 
@@ -65,7 +66,10 @@ usage()
 #ifdef STRING_UTILS_INLINED
        "STRING_UTILS_INLINED "
 #endif
-       "datadir= " DIR_DATADIR "\n" 
+       "datadir= " DIR_DATADIR 
+
+       "\n";
+       
        ;
     
     
@@ -76,13 +80,10 @@ notice()
 {
     cout <<
        "\n"
-       "GNU LilyPond, a music typesetter.\n"
-       "Copyright (C) 1996,97 by\n"
+       "GNU LilyPond -- The GNU Project music typesetter.\n"
+       "Copyright 1996,97 by\n"
        "  Han-Wen Nienhuys <hanwen@stack.nl>\n"
        "  Jan Nieuwenhuizen <jan@digicash.com>\n"
-       "Contributors\n"
-       "  Mats Bengtsson <matsb@s3.kth.se>\n"
-       "  Werner Lemberg <xlwy01@uxp1.hrz.uni-dortmund.de>\n"
        "\n"
        "    This program is free software; you can redistribute it and/or\n"
        "modify it under the terms of the GNU General Public License version 2\n"
@@ -106,7 +107,7 @@ void
 do_one_file(String init_str, String file_str)
 {
     if ( init_str != "" && "" == path.find( init_str ) ) {
-       error ( "Can not find `" + init_str +"'");
+       error ( "Can not find `" + init_str +"\'");
        return ;
     }
     if ( file_str!= "" && path.find( file_str ) == "" ) {
@@ -146,20 +147,20 @@ main (int argc, char **argv)
     cout << get_version_str() << endl;
     String init_str("symbol.ly");
     
-    while (Long_option_init * opt = oparser()) {
+    while (Long_option_init const * opt = oparser()) {
        switch ( opt->shortname){
        case 'o':
-           set_default_output(oparser.optarg);
+           set_default_output(oparser.optional_argument_ch_C_);
            break;
        case 'w':
            notice();
            exit(0);
            break;
        case 'I':
-           path.push(oparser.optarg);
+           path.push(oparser.optional_argument_ch_C_);
            break;
        case 'i':
-           init_str = oparser.optarg;
+           init_str = oparser.optional_argument_ch_C_;
            break;
        case 'h':
            usage();
@@ -181,7 +182,7 @@ main (int argc, char **argv)
     }
 
     int p=0;
-    char *arg ;
+    const char *arg ;
     while ( (arg= oparser.get_next_arg()) ) {
        String f(arg);
        destill_inname(f);
@@ -192,7 +193,7 @@ main (int argc, char **argv)
        do_one_file(init_str, "");      
     }
 
-    return 0;
+    return exit_status_i_;
 }
 
 /// make input file name: add default extension. "" is stdin.
index 3112f1855620fa498dd83758c26ae705d6036e93..d65e5cfae28770ddee958b64f2d77eaaea3fc75f 100644 (file)
@@ -100,7 +100,7 @@ void
 Meter_engraver::do_pre_move_processing()
 {
     if (meter_p_) {
-       typeset_breakable_item(meter_p_);
+       typeset_element(meter_p_);
        meter_p_ =0;
        meter_req_l_ = 0;
     }
index e578cef5fe498b0f832ab0950756c62715032cdc..6c74a1edbff82297034b458d27c2c1bc18053668 100644 (file)
@@ -7,6 +7,7 @@
 Meter::Meter(Array<Scalar>a)
     :args(a)
 {
+    breakable_b_ = true;
 }
 
 Molecule*
index 280b6304d17cbe2ba2286fd1dc95929081d7fe95..800c1e9cd17169d2b813f583c94f56b20f2e0685 100644 (file)
 
 // statics Midi_def
 // ugh
+
 int Midi_def::den_i_s = 4;
 int Midi_def::num_i_s = 4;
 
 Midi_def::Midi_def()
 {
-    outfile_str_ = "lelie.midi"; 
+    outfile_str_ = ""; 
     itrans_p_ = 0;
-    real_vars_p_ = new Assoc<String,Real>;
     // ugh
     set_tempo( Moment( 1, 4 ), 60 );
 }
@@ -39,14 +39,12 @@ Midi_def::Midi_def( Midi_def const& s )
 {
     whole_seconds_f_ = s.whole_seconds_f_;
     itrans_p_ = s.itrans_p_ ? new Input_translator( *s.itrans_p_ ) : 0;
-    real_vars_p_ = new Assoc<String,Real> ( *s.real_vars_p_ );
     outfile_str_ = s.outfile_str_;
 }
 
 Midi_def::~Midi_def()
 {
     delete itrans_p_;
-    delete real_vars_p_;
 }
 
 Real
@@ -64,14 +62,6 @@ Midi_def::get_global_translator_p() const
     return  itrans_p_->get_group_performer_p()->global_l();
 }
 
-Real
-Midi_def::get_var( String s ) const
-{
-    if ( !real_vars_p_->elt_b( s ) )
-       error ( "unknown midi variable `"  + s + "'" );
-    return real_vars_p_->elem( s );
-}
-
 int
 Midi_def::get_tempo_i( Moment moment )
 {
@@ -85,9 +75,6 @@ Midi_def::print() const
     mtor << "Midi {";
     mtor << "4/min: " << Real( 60 ) / ( whole_seconds_f_ * 4 );
     mtor << "out: " << outfile_str_;
-    for (Assoc_iter<String,Real> i( *real_vars_p_ ); i.ok(); i++) {
-       mtor << i.key() << "= " << i.val() << "\n";
-    }
     mtor << "}\n";
 #endif
 }
@@ -105,9 +92,3 @@ Midi_def::set_tempo( Moment moment, int count_per_minute_i )
     whole_seconds_f_ = Moment( count_per_minute_i ) / Moment( 60 ) / moment;
 }
 
-void
-Midi_def::set_var( String s, Real r )
-{
-   real_vars_p_->elem( s ) = r;
-}
-
index d520eac8fb06c38e70da49936a1337efd72772af..88ac41f6b412f2b6cc52c27cbf58b7b983c019a3 100644 (file)
 #include "midi-stream.hh"
 #include "audio-item.hh"
 
+IMPLEMENT_IS_TYPE_B(Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_chunk, Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_duration, Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_header, Midi_chunk);
+IMPLEMENT_IS_TYPE_B1(Midi_instrument, Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_key,Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_meter, Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_note, Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_note_off, Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_tempo, Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_text, Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_track, Midi_chunk);
+
 Midi_chunk::Midi_chunk()
     : Midi_item( 0 )
 {
@@ -256,20 +269,19 @@ Midi_instrument::Midi_instrument( int channel_i, String instrument_str )
 String
 Midi_instrument::str() const
 {
-    // ugh, does not work...
-    return String( "" );
     Byte program_byte = 0;
     for ( int i = 0; instrument_name_sz_a_[i]; i++ )
        if ( instrument_str_ == String(instrument_name_sz_a_[ i ] )) { 
            program_byte = (Byte)i;
            break;
        }
-    if ( program_byte ) {
-       String str = String( (char)( 0xc0 + channel_i_ ) );
-       str += String( (char)program_byte );
-       return str;
-    }
-    return String( "" );
+
+    if ( !program_byte )
+       return String( "" );
+
+    String str = String( (char)( 0xc0 + channel_i_ ) );
+    str += String( (char)program_byte );
+    return str;
 }
 
 Midi_item::Midi_item( Audio_item* audio_item_l )
@@ -329,32 +341,88 @@ Midi_key::str() const
     return String_convert::hex2bin_str( str );
 }
 
+Midi_meter::Midi_meter( Audio_item* audio_item_l )
+    : Midi_item( audio_item_l )
+{
+    clocks_per_1_i_ = 18;
+}
+
+String
+Midi_meter::str() const
+{
+    Meter_change_req* m = audio_item_l_->req_l_->command()->meterchange();
+    int num_i = m->beats_i_;
+    int den_i = m->one_beat_i_;
+
+    String str = "ff5804";
+    str += String_convert::i2hex_str( num_i, 2, '0' );
+    str += String_convert::i2hex_str( intlog2( den_i ) , 2, '0' );
+    str += String_convert::i2hex_str( clocks_per_1_i_, 2, '0' );
+    str += String_convert::i2hex_str( 8, 2, '0' );
+    return String_convert::hex2bin_str( str );
+}
+
 Midi_note::Midi_note( Audio_item* audio_item_l )
     : Midi_item( audio_item_l )
 {
-    // ugh
-    dynamic_byte_ = 0x64;
-    on_b_ = ( (Audio_note*)audio_item_l_ )->on_b_;
-    if ( on_b_ ) // poor man-s staff dynamics:
-       dynamic_byte_ -= 0x10 * channel_i_;
-    else
-       dynamic_byte_ += 0x32; // 0x64 is supposed to be neutral, but let-s try
+    dynamic_byte_ = 0x7f;
+}
+
+Moment
+Midi_note::duration() const
+{
+    return audio_item_l_->req_l_->musical()->rhythmic()->duration();
+}
+
+int
+Midi_note::pitch_i() const
+{
+    return audio_item_l_->req_l_->musical()->melodic()->pitch();
 }
 
 String
 Midi_note::str() const
 {
-    Note_req* n = audio_item_l_->req_l_->musical()->melodic()->note();
-    int pitch_i = n->pitch() + c0_pitch_i_c_;
-    if ( pitch_i != INT_MAX ) {
-       Byte status_byte = ( on_b_ ? 0x90 : 0x80 ) + channel_i_;
-       String str = String( (char)status_byte );
-       str += (char)pitch_i;
-       // poor man-s staff dynamics:
-       str += (char)dynamic_byte_;
-       return str;
-    }
-    return String( "" );
+    if ( pitch_i() == INT_MAX )
+       return String( "" );
+
+    Byte status_byte = (char)( 0x90 + channel_i_ );
+
+    String str = String( (char)status_byte );
+    str += (char)( pitch_i() + c0_pitch_i_c_ );
+
+    // poor man's staff dynamics:
+    str += (char)( dynamic_byte_ - 0x10 * channel_i_ );
+
+    return str;
+}
+
+Midi_note_off::Midi_note_off( Midi_note* midi_note_l )
+    : Midi_item( midi_note_l->audio_item_l_ )
+{
+    // 0x64 is supposed to be neutral, but let's try
+    aftertouch_byte_ = 0x64;
+    channel_i_ = midi_note_l->channel_i_;
+}
+
+int
+Midi_note_off::pitch_i() const
+{
+    return audio_item_l_->req_l_->musical()->melodic()->pitch();
+}
+
+String
+Midi_note_off::str() const
+{
+    if ( pitch_i() == INT_MAX )
+       return String( "" );
+
+    Byte status_byte = (char)( 0x80 + channel_i_ );
+
+    String str = String( (char)status_byte );
+    str += (char)( pitch_i() + Midi_note::c0_pitch_i_c_ );
+    str += (char)aftertouch_byte_;
+    return str;
 }
 
 Midi_tempo::Midi_tempo( Audio_item* audio_item_l )
@@ -378,27 +446,6 @@ Midi_tempo::str() const
     return String_convert::hex2bin_str( str );
 }
 
-Midi_meter::Midi_meter( Audio_item* audio_item_l )
-    : Midi_item( audio_item_l )
-{
-    clocks_per_1_i_ = 18;
-}
-
-String
-Midi_meter::str() const
-{
-    Meter_change_req* m = audio_item_l_->req_l_->command()->meterchange();
-    int num_i = m->beats_i_;
-    int den_i = m->one_beat_i_;
-
-    String str = "ff5804";
-    str += String_convert::i2hex_str( num_i, 2, '0' );
-    str += String_convert::i2hex_str( intlog2( den_i ) , 2, '0' );
-    str += String_convert::i2hex_str( clocks_per_1_i_, 2, '0' );
-    str += String_convert::i2hex_str( 8, 2, '0' );
-    return String_convert::hex2bin_str( str );
-}
-
 Midi_text::Midi_text( Audio_item* audio_item_l )
     : Midi_item( audio_item_l )
 {
index 38f462d760982fc21ec2274b2cb671756260f457..04777b50c881d078d171cddec9be3c49b1d421e5 100644 (file)
 #include "midi-stream.hh"
 #include "debug.hh"
 
-Midi_stream::Midi_stream( String filename_str, int tracks_i, int clocks_per_4_i ) 
+Midi_stream::Midi_stream( String filename_str )
 {
     filename_str_ = filename_str;
-    tracks_i_ = tracks_i;
-    clocks_per_4_i_ = clocks_per_4_i;
     os_p_ = 0;
     open();
-    header();
 }
 
 Midi_stream::~Midi_stream()
@@ -62,20 +59,6 @@ Midi_stream::operator <<( int i )
     return *this;
 }
 
-void
-Midi_stream::header()
-{
-/*
-                4D 54 68 64     MThd
-    String str = "MThd";
-                00 00 00 06     chunk length
-                00 01   format 1
-                00 01   one track
-                00 60   96 per quarter-note
-*/
-      *this << Midi_header( 1, tracks_i_, clocks_per_4_i_ );
-}
-
 void
 Midi_stream::open()
 {
index 8cf348d9f7d7e45c6416b62bbea69d04db2b4f23..4b4eed261ddacd136013915f1467a480e7222247 100644 (file)
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>, Jan Nieuwenhuizen <jan@digicash.com>
-  
-  TODO
-
-  Ideally this should also use a register system, to process slurs,
-  dynamics, etc.
-  
-*/
-
-/* reincluded for code jatting */
-#if 0
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+           Jan Nieuwenhuizen <jan@digicash.com>
+ */
 
-#include "command-request.hh"
-#include "musical-request.hh"
-#include "p-score.hh"
-#include "staff.hh"
 #include "midi-walker.hh"
+#include "audio-column.hh"
+#include "audio-item.hh"
+#include "audio-staff.hh"
 #include "midi-item.hh"
 #include "midi-stream.hh"
 #include "debug.hh"
-#include "staff-column.hh"
 
-Midi_walker::Midi_walker(Staff *st_l, Midi_track* track_l)
-    : PCursor<Staff_column*>(st_l->cols_)
+Midi_note_event::Midi_note_event() 
+{ 
+    ignore_b_ = false;
+}
+
+int
+compare( Midi_note_event const& left, Midi_note_event const& right )
 {
-    track_l_ = track_l;
-    last_moment_= 0;
+    return sign( left.key - right.key );
 }
 
-/**
-  output notestop events for all notes which end before #max_moment#
- */
-void
-Midi_walker::do_stop_notes(Moment max_moment)
+Midi_walker::Midi_walker( Audio_staff* audio_staff_l, Midi_track* track_l )
+    : PCursor<Audio_item*>( audio_staff_l->audio_item_l_list_ )
 {
-    while (stop_notes.size() && stop_notes.front().key <= max_moment) {
-       Note_event  ent=stop_notes.get();
-       if (ent.ignore_b_) 
-           continue;
-       
-       Moment stop_moment = ent.key;
-       Melodic_req * req_l = ent.val;
-       
-       Midi_note note(req_l, track_l_->number_i_, false);
-       output_event(note, stop_moment);
-    }
+    track_l_ = track_l;
+    last_mom_ = 0;
 }
+
+Midi_walker::~Midi_walker()
+{ 
+    // ugh
+    do_stop_notes( last_mom_ + Moment( 10, 1 ) );
+}
+
 /**
-  Find out if start_note event is needed,  and do it if needed.
+  Find out if start_note event is needed, and do it if needed.
  */
 void 
-Midi_walker::do_start_note(Note_req*note_l)
+Midi_walker::do_start_note( Midi_note* note_l )
 {
-    Moment stop = note_l->duration() + ptr()->when();
-    for(int i=0; i < stop_notes.size(); i++) {
-       if (stop_notes[i].val->melodic()->pitch() ==
-           note_l->pitch()) {
-           if ( stop_notes[i].key < stop){
-               stop_notes[i].ignore_b_=true;
-           }
-           else
-               return; // skip the stop note 
+    Moment stop_mom = note_l->duration() + ptr()->audio_column_l_->at_mom();
+    for ( int i=0; i < stop_note_queue.size(); i++ ) {
+       if ( stop_note_queue[ i ].val->pitch_i() == note_l->pitch_i() ) {
+           if ( stop_note_queue[ i ].key < stop_mom )
+               stop_note_queue[ i ].ignore_b_ = true;
+           else // skip the stopnote 
+               return; 
        }
     }
-    Note_event e;
-    e.val = note_l;
-    e.key = stop;
-    
-    stop_notes.insert(e);
-    
-    Midi_note note(note_l, track_l_->number_i_, true);
-    output_event(note, ptr()->when());
-}
 
-
-/** advance the track to #now#, output the item, and adjust current
-  "moment".  */
-void
-Midi_walker::output_event(Midi_item &i, Moment now)
-{
-    Moment delta_t = now - last_moment_ ;
-    last_moment_ += delta_t;
-    track_l_->add(delta_t, &i );    
+    Midi_note_event e;
+    e.val = new Midi_note_off( note_l );
+    e.key = stop_mom;
+    stop_note_queue.insert( e );
+    
+    output_event( ptr()->audio_column_l_->at_mom(), note_l );
 }
 
+/**
+  Output note events for all notes which end before #max_mom#
+ */
 void
-Midi_walker::process_requests()
+Midi_walker::do_stop_notes( Moment max_mom )
 {
-    do_stop_notes(ptr()->when());
-
-    for ( int i = 0; i < ptr()->commandreq_l_arr_.size(); i++ )  {
-       Command_req *c_l = ptr()->commandreq_l_arr_[i]->command();
-       Meter_change_req* meter_l = c_l->meterchange();
-       if ( meter_l )
-           output_event( Midi_time( meter_l->beats_i_, meter_l->one_beat_i_, 18 ),  ptr()->when() );
-       Key_change_req* key_l = c_l->keychange();
-       if ( key_l ) {
-           int sharps_i = key_l->sharps_i();
-           int flats_i = key_l->flats_i();
-           // midi cannot handle non-conventional keys
-           if ( !( flats_i && sharps_i ) )
-               output_event( Midi_key( sharps_i - flats_i, key_l->minor_b() ), ptr()->when() );
-       }
-    }
-
-    for ( int i = 0; i < ptr()->musicalreq_l_arr_.size(); i++ )  {
-       Musical_req *m = ptr()->musicalreq_l_arr_[i]->musical();
-       if (!m)
-           return;
-       Rhythmic_req *n = m->rhythmic();
-       if ( !n)
-           continue;
-       Note_req * note_l = n->note();
-       if (!note_l)
+    while ( stop_note_queue.size() && stop_note_queue.front().key <= max_mom ) {
+       Midi_note_event e = stop_note_queue.get();
+       if ( e.ignore_b_ ) 
            continue;
-       do_start_note(note_l);
+       
+       Moment stop_mom = e.key;
+       Midi_note_off* note_l = e.val;
+       
+       output_event( stop_mom, note_l );
     }
 }
 
-Midi_walker::~Midi_walker()
+/** 
+  Advance the track to #now#, output the item, and adjust current "moment". 
+ */
+void
+Midi_walker::output_event( Moment now_mom, Midi_item* l )
 {
-    do_stop_notes( last_moment_ + Moment(10,1)); // ugh
+    Moment delta_t = now_mom - last_mom_ ;
+    last_mom_ += delta_t;
+    track_l_->add( delta_t, l );
 }
 
-
-int
-compare(Note_event const&e1, Note_event const&e2)
+void
+Midi_walker::process()
 {
-    return sign(e1.key - e2.key);
+    do_stop_notes( ptr()->audio_column_l_->at_mom() );
+
+    Midi_item* p = ptr()->midi_item_p();
+    p->channel_i_ = track_l_->number_i_;
+    
+    if ( p->name() != Midi_note::static_name() )
+       output_event( ptr()->audio_column_l_->at_mom(), p );
+    else
+       do_start_note( (Midi_note*)p );
+       
+    delete p;
 }
 
-#endif
index ee4fe5e48527549fa91dd0e7db647b34087fd03a..f9cc7bb12a9da38d87b4e51a55c4616fda3d913d 100644 (file)
@@ -14,9 +14,6 @@
 #include "debug.hh"
 #include "tex.hh"
 
-
-/* *************** */
-
 String
 Molecule::TeX_string() const
 {
@@ -43,15 +40,10 @@ Molecule::translate(Offset o)
 }
 
 void
-Molecule::translate_x(Real x)
-{
-    translate(Offset(x,0));
-}
-
-void
-Molecule::translate_y(Real y)
+Molecule::translate(Real x,Axis a)
 {
-    translate(Offset(0,y));
+    for (iter_top(ats,c); c.ok(); c++)
+       c->translate(x,a);
 }
 
 void
@@ -69,7 +61,9 @@ Molecule::add_right(Molecule const &m)
        add(m);
        return;
     }
-   Real xof=extent().x.right - m.extent().x.left;
+     Real xof=extent().x().right - m.extent().x().left;
+     
     Molecule toadd(m);
     toadd.translate(Offset(xof, 0.0));
     add(toadd);
@@ -82,7 +76,8 @@ Molecule::add_left(Molecule const &m)
        add(m);
        return;
     }
-    Real xof=extent().x.left - m.extent().x.right;
+  Real xof=extent().x().left - m.extent().x().right;
+   
     Molecule toadd(m);
     toadd.translate(Offset(xof, 0.0));
     add(toadd);
@@ -96,9 +91,10 @@ Molecule::add_top(Molecule const &m)
        add(m);
        return;
     }
-  Real yof=extent().y.right - m.extent().y.left;
+   Real yof=extent().y().right - m.extent().y().left;
+
     Molecule toadd(m);
-    toadd.translate_y(yof);
+    toadd.translate(yof, Y_AXIS);
     add(toadd);
 }
 
@@ -109,9 +105,9 @@ Molecule::add_bottom(Molecule const &m)
        add(m);
        return;
     }
-    Real yof=extent().y.left- m.extent().y.right;
+     Real yof=extent().y().left- m.extent().y().right;
     Molecule toadd(m);
-    toadd.translate_y(yof);
+    toadd.translate(yof, Y_AXIS);
     add(toadd);
 }
 
index 25e5f2b63f393d7d38276bb80187513469d27a64..cf3f4f13ea81a3b2d6a5fcc64954d1bab030c572 100644 (file)
@@ -54,19 +54,16 @@ Music_iterator::get_req_translator_l()
 void
 Music_iterator::push_translator(Translator*t)
 {
-    if (t) {
-       report_to_l_arr_.push(t);
-       t->iterator_count_ ++;
-    }
+    report_to_l_arr_.push(t);
+    t->iterator_count_ ++;
 }
 
 void
 Music_iterator::pop_translator()
 {
-    if (report_to_l()) {
-       report_to_l()->iterator_count_ --;
-       report_to_l_arr_.pop();
-    }
+    report_to_l()->iterator_count_ --;
+    assert (report_to_l()->iterator_count_ >=0);
+    report_to_l_arr_.pop();
 }
 
 Translator* 
@@ -79,12 +76,14 @@ Music_iterator::report_to_l()const
 
 
 void
-Music_iterator::set_translator(Translator*reg)
+Music_iterator::set_translator(Translator*trans)
 {   
-    if (report_to_l()==reg)
+    if (report_to_l()==trans)
        return;
-    pop_translator();
-    push_translator(reg);
+    if ( report_to_l() )
+       pop_translator();
+    if (trans)
+       push_translator(trans);
 }
 
 void
@@ -121,9 +120,7 @@ Music_iterator::static_get_iterator_p(Music *m,
                                      Translator *report_l)
 {
     Music_iterator * p =0;
-    if (m->is_type_b( Change_reg::static_name()))
-       p = new Change_iterator((Change_reg*)m);
-    else if (m->is_type_b( Request_chord::static_name()))
+    if (m->is_type_b( Request_chord::static_name()))
        p = new Request_chord_iterator( (Request_chord*) m);
     else if (m->is_type_b( Chord::static_name())) 
        p =  new Chord_iterator( (Chord*) m);
@@ -172,10 +169,11 @@ Chord_iterator::construct_children()
     for(PCursor<Music*> i(chord_C_->music_p_list_.top());  //, int j = 0; 
        i.ok(); j++, i++) {
        Music_iterator * mi =  get_iterator_p( i.ptr());
-       set_translator(mi->report_to_l()->ancestor_l( chord_C_->multi_level_i_ ));
-       if ( mi->ok() )
+       if ( mi->ok() ) {
+           set_translator(mi->report_to_l()->ancestor_l( 
+               chord_C_->multi_level_i_ ) );
            children_p_list_.bottom().add( mi );
-       else 
+       else 
            delete mi;
     }
 }
@@ -244,26 +242,45 @@ Voice_iterator::Voice_iterator(Voice const*v)
 void
 Voice_iterator::construct_children()
 {
-    if (ok()) {
-       iter_p_ = Music_iterator::get_iterator_p( ptr() );      
-       if (iter_p_->report_to_l()->depth_i() > report_to_l()->depth_i())
-           set_translator(iter_p_->report_to_l());
+    while (PCursor<Music*>::ok()) {
+       start_next_element();
+       if ( !iter_p_->ok()) {
+           leave_element();
+       } else {
+           set_voice_translator();
+           break;
+       }
     }
 }
 
-void
-Voice_iterator::next_element()
+void 
+Voice_iterator::leave_element()
 {
-    delete iter_p_ ;
+    delete iter_p_;
     iter_p_ =0;
-    here_mom_ += ptr()->time_int().length();
+    MInterval elt_time = ptr()->time_int();
+    if (!elt_time.empty_b())
+       here_mom_ += elt_time.length();
     PCursor<Music*>::next();
-    construct_children();
+}
+
+void
+Voice_iterator::start_next_element()
+{
+    assert( !iter_p_);
+    iter_p_ = get_iterator_p( ptr());
+}
+
+void
+Voice_iterator::set_voice_translator()
+{
+    if (iter_p_->report_to_l()->depth_i() > report_to_l()->depth_i())
+       set_translator(iter_p_->report_to_l());
 }
 
 Voice_iterator::~Voice_iterator()
 {
-    delete iter_p_;
+    assert(! iter_p_);
 }
 
 
@@ -272,21 +289,30 @@ IMPLEMENT_IS_TYPE_B1(Voice_iterator,Music_iterator);
 void
 Voice_iterator::process_and_next(Moment until)
 {
-    while (ok()) {
+    while (1) {
        Moment local_until = until - here_mom_;
-       while ( iter_p_ && iter_p_->ok() ) {
+       while ( iter_p_->ok() ) {
            Moment here = iter_p_->next_moment();
            if (here != local_until)
-               return;
+               goto loopexit;
+           
            iter_p_->process_and_next(local_until);
        }
-       if (!iter_p_)
-           iter_p_ = Music_iterator::get_iterator_p( ptr() );
-       else if (!iter_p_->ok() )
-           next_element();
+
+       if (!iter_p_->ok() ) {
+           leave_element();
+           if ( PCursor<Music*>::ok() ) {
+               start_next_element();
+               set_voice_translator();
+           } else {
+               goto loopexit;
+           }
+       }
     }
+
+loopexit:
+
     Music_iterator::process_and_next(until);
-    assert(!ok() || next_moment() > until);
 }
 
 Moment
@@ -298,44 +324,9 @@ Voice_iterator::next_moment()const
 bool
 Voice_iterator::ok()const
 {
-    return PCursor<Music*>::ok();
+    return iter_p_;
 }
 
-/* ***************** */
-
-
-Change_iterator::Change_iterator(Change_reg * ch)
-{
-    change_l_ = ch;
-}
-
-
-IMPLEMENT_IS_TYPE_B1(Change_iterator,Music_iterator);
-
-/*
-  TODO: pop/pushgroup
- */
-void
-Change_iterator::process_and_next(Moment mom)
-{
-#if 0
-    if ( id[0] == '-') {
-       
-    
-    Engraver_group_engraver *group_l =
-       report_to_l()->find_get_translator_l(change_l_->type_str_, 
-                                            change_l_->id_str_);
-
-    report_to_l()->daddy_grav_l_->remove_engraver_p(report_to_l());
-    group_l->add(report_to_l());
-#endif
-    Music_iterator::process_and_next(mom);
-}
-
-
-
-/* ******************** */
-
 
 IMPLEMENT_IS_TYPE_B1(Request_chord_iterator,Music_iterator);
 
index bd1cef64d8f9d8357d1ef76c0e19d6135181609f..97f5a8a9e7b2ce4e3bfab79311c792fb96ae6ec6 100644 (file)
@@ -30,6 +30,7 @@ Chord::time_int()const
     MInterval m;
     for (iter(music_p_list_.top(), i); i.ok(); i++)
        m.unite(i->time_int());
+
     return m;
 }
 
@@ -54,8 +55,15 @@ MInterval
 Voice::time_int() const
 {
     Moment last=0;
-    for (iter(music_p_list_.top(), i); i.ok(); i++)
-       last += i->time_int().length();
+    for (iter(music_p_list_.top(), i); i.ok(); i++) {
+       MInterval interval = i->time_int();
+       
+        /*
+         c4 <> c4
+        */
+       if ( !interval.empty_b() )
+           last += interval.length();
+    }
     return  offset_mom_ + MInterval(0,last);
 }
 
index 0d14c09c386ad81f67dabcddc7e4dbc651dd7614..4bd6598489798b38bca071e5d3d89c4b6b7d75f2 100644 (file)
@@ -80,6 +80,7 @@ Blank_req::do_print()const
     Spacing_req::do_print();
 }
 /* *************** */
+
 Melodic_req::Melodic_req()
 {
     notename_i_ = 0;
@@ -98,6 +99,7 @@ Melodic_req::transpose(Melodic_req const & delta)
        notename_i_ -= 7;
        octave_i_ ++;
     }
+
     int new_pitch = pitch();
     int delta_acc = new_pitch - old_pitch - delta_pitch;
     
@@ -107,18 +109,28 @@ Melodic_req::transpose(Melodic_req const & delta)
     }
 }
 
-
 IMPLEMENT_IS_TYPE_B1(Melodic_req,Musical_req);
 
+bool
+Melodic_req::do_equal_b(Request*r)const
+{
+    Melodic_req* m= r->musical()->melodic();
+    return !compare( *m, *this);
+}
+
 int
-Melodic_req::compare(Melodic_req const&m1, Melodic_req const&m2)
-{
-    if (m1.octave_i_ != m2.octave_i_)
-       return m1.octave_i_ -m2.octave_i_;
-    else if (m1.notename_i_ != m2.notename_i_)
-       return m1.notename_i_ - m2.notename_i_;
-    else  if (m1.accidental_i_ != m2.accidental_i_)
-       return m1.accidental_i_ - m2.accidental_i_;
+Melodic_req::compare(Melodic_req const &m1 , Melodic_req const&m2)
+{
+    int o=  m1.octave_i_ - m2.octave_i_;
+    int n = m1.notename_i_ - m2.notename_i_;
+    int a = m1.accidental_i_ - m2.accidental_i_;
+    
+    if (o)
+       return o;
+    if ( n)
+       return n;
+    if (a)
+       return a;
     return 0;
 }
 
@@ -126,7 +138,8 @@ void
 Melodic_req::do_print() const
 {
 #ifndef NPRINT
-    mtor << "notename: " << notename_i_ << " acc: " <<accidental_i_<<" oct: "<< octave_i_;
+    mtor << "notename: " << notename_i_ 
+        << " acc: " <<accidental_i_<<" oct: "<< octave_i_;
 #endif
 }
 
@@ -137,9 +150,9 @@ Melodic_req::height() const
 }
 
 /*
- should be settable from input to allow "viola"-mode
 should be settable from input to allow "viola"-mode
  */
-static Byte pitch_byte_a[ 7 ] = { 0, 2, 4, 5, 7, 9, 11 };      
+static Byte pitch_byte_a[  ] = { 0, 2, 4, 5, 7, 9, 11 };       
 
 int
 Melodic_req::pitch() const
@@ -151,7 +164,15 @@ Melodic_req::pitch() const
 int
 Rhythmic_req::compare(Rhythmic_req const &r1, Rhythmic_req const &r2)
 {
-    return sign(r1.duration() - r2.duration());
+    return (r1.duration() - r2.duration());
+}
+
+bool
+Rhythmic_req::do_equal_b(Request*r)const
+{
+    Rhythmic_req* rh = r->musical()->rhythmic();
+
+    return !compare(*this, *rh);
 }
 
 void
@@ -200,6 +221,13 @@ Lyric_req::do_print() const
 }
 
 /* *************** */
+bool
+Note_req::do_equal_b(Request*r)const
+{
+    return Rhythmic_req::do_equal_b(r) && Melodic_req::do_equal_b(r);
+}
+
+
 Note_req::Note_req()
 {
     forceacc_b_ = false;
@@ -243,10 +271,13 @@ IMPLEMENT_IS_TYPE_B1(Slur_req,Span_req);
 void
 Slur_req::do_print()const{}
 /* *************** */
-int
-Span_req:: compare(Span_req const &r1, Span_req const &r2)
+
+
+bool
+Span_req:: do_equal_b(Request*r)const
 {
-     return r1.spantype - r2.spantype;
+    Span_req * s = r->span();
+    return spantype - s->spantype;
 }
 
 Span_req::Span_req()
@@ -261,11 +292,17 @@ Script_req::Script_req(Script_req const&s)
     scriptdef_p_ = s.scriptdef_p_ ? s.scriptdef_p_->clone() : 0;
 }
 
-int
-Script_req::compare(Script_req const &d1, Script_req const &d2)
+/*
+  don't check dirs?
+  
+  (d1.dir_i_ == d2.dir_i_ )
+ */
+bool
+Script_req::do_equal_b(Request*r)const
 {
-    return !(d1.dir_i_ == d2.dir_i_ &&
-       d1.scriptdef_p_->equal_b(*d2.scriptdef_p_));
+    Script_req * s = r->script();
+    
+    return  scriptdef_p_->equal_b(*s->scriptdef_p_);
 }
 
 Script_req::Script_req()
@@ -301,13 +338,8 @@ Script_req::~Script_req()
     delete scriptdef_p_;
 }
 /* *************** */
-int
-Text_req:: compare(Text_req const &r1, Text_req const &r2)
-{
-    bool b1 = (r1.dir_i_ == r2.dir_i_);
-    bool b2 = (r1.tdef_p_ ->equal_b(*r2.tdef_p_));
-    return b1 && b2;
-}
+
+
 Text_req::~Text_req()
 {
     delete tdef_p_;
@@ -333,7 +365,6 @@ void
 Text_req::do_print() const
 {
 #ifndef NPRINT
-
     mtor << " dir " << dir_i_ ;
     tdef_p_->print();
 #endif
index a67aac8a7608b9b5d42ab64afb2de3071eefba59..18155a56e7584574c8faf79fdaec026d8999d632 100644 (file)
@@ -33,11 +33,9 @@ static Keyword_ent the_key_tab[]={
     {"duration", DURATIONCOMMAND},
     {"absdynamic", ABSDYNAMIC},
     {"group", GROUP},
-    {"geometric", GEOMETRIC},
     {"hshift", HSHIFT},
     {"id", ID},
     {"in", IN_T},
-    {"init_end", INIT_END},
     {"requesttranslator", REQUESTTRANSLATOR},
     {"lyric", LYRIC},
     {"key", KEY},
@@ -47,7 +45,6 @@ static Keyword_ent the_key_tab[]={
     {"midi", MIDI},
     {"mm", MM_T},
     {"multi", MULTI},
-    {"note", NOTE},
     {"notenames", NOTENAMES},
     {"octave", OCTAVECOMMAND},
     {"output", OUTPUT},
@@ -59,7 +56,6 @@ static Keyword_ent the_key_tab[]={
     {"script", SCRIPT},
     {"skip", SKIP},
     {"staff", STAFF},
-    {"start", START_T},
     {"stem", STEM},
     {"table", TABLE},
     {"spandynamic", SPANDYNAMIC}, 
@@ -68,8 +64,6 @@ static Keyword_ent the_key_tab[]={
     {"texid", TEXID},
     {"textstyle", TEXTSTYLE},
     {"transpose", TRANSPOSE},
-    {"unitspace", UNITSPACE},
-    {"width", WIDTH},
     {"version", VERSION},
     {"grouping", GROUPING},
     {0,0}
index 5c14442745860ffb32fef0245173469b6d690165..3f12eba6fe04598bb2b12e8c8bd5319d26914ab0 100644 (file)
@@ -203,7 +203,7 @@ My_lily_parser::get_parens_request(char c)
     case ']':
     {
        Beam_req*b = new Beam_req;
-       int p_i=default_duration_.plet_.type_i_ ; // ugh . Should junk?
+       int p_i=plet_.type_i_ ; // ugh . Should junk?
        if (p_i!= 1)
            b->nplet = p_i;
        req_p = b;
@@ -270,11 +270,11 @@ My_lily_parser::add_requests(Chord*v)
     for (int i = 0; i < pre_reqs.size(); i++) {
        v->add(pre_reqs[i]);
     }
-    pre_reqs.set_size(0);
+    pre_reqs.clear();
     for (int i = 0; i <post_reqs.size(); i++) {
        v->add(post_reqs[i]);
     }
-    post_reqs.set_size(0);
+    post_reqs.clear();
 }
 
 Input
index 67614565588c115f2457835906209d1539022192..7ce98ae77cac26a79d38f46143f83045b3ffea94 100644 (file)
@@ -49,7 +49,7 @@ Note_column_engraver::acknowledge_element(Score_elem_info i)
 
     char const*nC = i.elem_l_->name();
 
-    if (nC == Script::static_name()) {
+    if (nC == Script::static_name() && i.req_l_ && i.req_l_->musical()) {
        script_l_arr_.push((Script*)i.elem_l_->item());
     } else if (nC == Note_head::static_name()) {
        Note_head * h_l = (Note_head*)i.elem_l_->item();
@@ -78,7 +78,7 @@ Note_column_engraver::acknowledge_element(Score_elem_info i)
                ncol_p_->add(script_l_arr_[i]);
        }
     
-       script_l_arr_.set_size(0);
+       script_l_arr_.clear();
     }
 
 }
@@ -107,7 +107,7 @@ Note_column_engraver::do_pre_move_processing()
 void
 Note_column_engraver::do_post_move_processing()
 {
-    script_l_arr_.set_size(0);
+    script_l_arr_.clear();
     stem_l_ =0;
 }
 
index be234fcdd11d0ae6e0e9907d47c90513289fda2d..5471110e900fc0585a5ee7ced49ca30785a26eda 100644 (file)
@@ -20,11 +20,6 @@ ADD_THIS_PERFORMER(Note_performer);
 Note_performer::Note_performer()
 {
     note_req_l_ = 0;
-    off_mom_ = 0;
-}
-
-Note_performer::~Note_performer()
-{
 }
 
 void 
@@ -33,7 +28,6 @@ Note_performer::do_print() const
 #ifndef NPRINT
     if ( note_req_l_ ) {
        note_req_l_->print();
-       mtor << ( off_mom_ ? "on" : "off" ) << "\n";
     }
 #endif
 }
@@ -45,17 +39,8 @@ Note_performer::process_requests()
     if ( !note_req_l_ || !note_req_l_->melodic()  || !note_req_l_->rhythmic() )
        return;
 
-    // ugh! Midi specific
-    Moment mom = get_mom();
-    if ( !off_mom_ ) { // start note
-       off_mom_ = mom + note_req_l_->duration();
-       play( new Audio_note( note_req_l_, true ) );
-    }
-    else if ( mom == off_mom_ ) { // stop note
-       play( new Audio_note( note_req_l_, false ) );
-       note_req_l_ = 0;
-       off_mom_ = 0;
-    }
+    play( new Audio_note( note_req_l_ ) );
+    note_req_l_ = 0;
 }
 
 bool 
@@ -64,14 +49,9 @@ Note_performer::do_try_request( Request* req_l )
     if ( note_req_l_ )
        return false;
     
- // huh?
-//    if (req_l->musical() && (req_l->musical()->note() || req_l->musical()->rest()))
-//     note_req_l_ = req_l->musical()->rhythmic();
-    if ( req_l->musical() && req_l->musical()->note() )
-// huh?
-       note_req_l_ = req_l->musical()->melodic();
-    else
+    if ( !req_l->musical() || !req_l->musical()->note() )
        return false;
 
+    note_req_l_ = req_l->musical()->melodic();
     return true;
 }
index 48b6b7ba6d16641a59b7fb6cf282f8afc95ebe41..1e37bb328b9a9ca5ff0799d5521803b7a4847754 100644 (file)
@@ -114,12 +114,12 @@ Note_head::brew_molecule_p() const
        s = p->lookup_l()->rest(balltype_i_, streepjes_b);
     }
     out = new Molecule(Atom(s));
-    out->translate_x( x_dir_i_ * s.dim.x.length() );
+    out->translate( x_dir_i_ * s.dim.x().length() , X_AXIS);
     if (dots_i_) {
        Symbol d = p->lookup_l()->dots(dots_i_ );
        Molecule dm;
        dm.add(Atom(d));
-       dm.translate_y( inter_f * dot_delta_y_i_ );
+       dm.translate( inter_f * dot_delta_y_i_ , Y_AXIS);
        out->add_right(dm);
     }
 
@@ -136,11 +136,11 @@ Note_head::brew_molecule_p() const
        Molecule sm;
        sm.add(Atom(str));
        if (position_i_ % 2)
-           sm.translate_y(-inter_f* dir);
+           sm.translate(-inter_f* dir, Y_AXIS);
        out->add(sm);       
     }
     
-    out->translate_y(inter_f*position_i_);
+    out->translate(inter_f*position_i_, Y_AXIS);
     return out;
 }
 
index 661ccfeaec6ad6454cc4aa610a6737103c93ff47..3e1af5259a2895764a78d4d231064c00d441b9bf 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  p-score.cc -- implement PScore
+  p-score.cc -- implement Paper_score
 
   source file of the GNU LilyPond music typesetter
 
 #include "word-wrap.hh"
 #include "gourlay-breaking.hh"
 
-PScore::PScore(Paper_def*p)
+Paper_score::Paper_score(Paper_def*p)
 {
     paper_l_ = p;
     super_elem_l_   = new Super_elem;
     typeset_element(super_elem_l_);
 }
 
-PScore::~PScore()
+Paper_score::~Paper_score()
 {
     super_elem_l_->unlink_all();
 }
 
 void
-PScore::typeset_element(Score_elem * elem_p)
+Paper_score::typeset_element(Score_elem * elem_p)
 {
     elem_p_list_.bottom().add(elem_p);
     elem_p->pscore_l_ = this;
@@ -41,18 +41,15 @@ PScore::typeset_element(Score_elem * elem_p)
 }
 
 void
-PScore::typeset_item(Item *i, PCol *c, int breakstat)
+Paper_score::typeset_item(Item *i, PCol *c)
 {
     assert(c && i);
+    int breakstat = i->break_status_i_;
 
     if (breakstat == -1) {
-       typeset_item(i, c->prebreak_p_);
-       return;
-    }
-
-    if (breakstat == 1) {
-       typeset_item(i, c->postbreak_p_);
-       return;
+       c = c->prebreak_p_;
+    }else if (breakstat == 1) {
+       c = c->postbreak_p_;
     }
 
     c->add(i);
@@ -60,10 +57,9 @@ PScore::typeset_item(Item *i, PCol *c, int breakstat)
 }
 
 void
-PScore::typeset_broken_spanner(Spanner*span_p)
+Paper_score::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);
@@ -71,7 +67,7 @@ PScore::typeset_broken_spanner(Spanner*span_p)
 
 
 void
-PScore::typeset_unbroken_spanner(Spanner*span_p)
+Paper_score::typeset_unbroken_spanner(Spanner*span_p)
 {
     span_p_list_.bottom().add(span_p);
     span_p->pscore_l_=this;
@@ -87,7 +83,7 @@ PScore::typeset_unbroken_spanner(Spanner*span_p)
 
 
 void
-PScore::clean_cols()
+Paper_score::clean_cols()
 {
     int rank_i = 0;
     for (iter_top(col_p_list_,c); c.ok(); )
@@ -100,7 +96,7 @@ PScore::clean_cols()
 }
 
 void
-PScore::add(PCol *p)
+Paper_score::add(PCol *p)
 {
     p->pscore_l_ = this;
     if (p->breakable_b()){
@@ -111,7 +107,7 @@ PScore::add(PCol *p)
 }
 
 void
-PScore::output(Tex_stream &ts)
+Paper_score::output(Tex_stream &ts)
 {
     ts << "\n "<<  paper_l_->lookup_l()->texsetting << "%(Tex id)\n";
     ts<< super_elem_l_->TeX_string();
@@ -120,21 +116,23 @@ PScore::output(Tex_stream &ts)
 
 
 void
-PScore::OK()const
+Paper_score::OK()const
 {
 #ifndef NDEBUG
     for (iter_top(col_p_list_,cc); cc.ok(); cc++)
        cc->OK();
+    for (PCursor<Score_elem*> i( elem_p_list_.top()); i.ok(); i++) 
+       i->OK();
 #endif
 }
 
 void
-PScore::print() const
+Paper_score::print() const
 {    
 #ifndef NPRINT
     if ( !check_debug)
        return ;
-    mtor << "PScore { ";
+    mtor << "Paper_score { ";
     paper_l_->print();
     mtor << "\n elements: ";
     for (iter_top(elem_p_list_,cc); cc.ok(); cc++)     
@@ -151,21 +149,21 @@ PScore::print() const
 }
 
 void
-PScore::preprocess()
+Paper_score::preprocess()
 {
     super_elem_l_->breakable_col_processing();
     super_elem_l_->pre_processing();
 }
 
 void
-PScore::postprocess()
+Paper_score::postprocess()
 {
     super_elem_l_->post_processing();
     super_elem_l_->molecule_processing();
 }
 
 PCursor<PCol *>
-PScore::find_col(PCol const *c)const
+Paper_score::find_col(PCol const *c)const
 {
     PCol const *what = c;
     if (what->daddy_l_ )
@@ -176,7 +174,7 @@ PScore::find_col(PCol const *c)const
 
 
 void
-PScore::set_breaking(Array<Col_hpositions> const &breaking)
+Paper_score::set_breaking(Array<Col_hpositions> const &breaking)
 {
     super_elem_l_->line_of_score_l_->set_breaking( breaking);
     super_elem_l_->break_processing();
@@ -205,7 +203,7 @@ PScore::set_breaking(Array<Col_hpositions> const &breaking)
 }
 
 void
-PScore::calc_breaking()
+Paper_score::calc_breaking()
 {
     Break_algorithm *algorithm_p;
     Array<Col_hpositions> sol;
@@ -217,7 +215,7 @@ PScore::calc_breaking()
        sol = algorithm_p->solve();
        delete algorithm_p;
        if ( ! sol.size()) { 
-           error ( "Can not solve this casting problem exactly; revert to Word_wrap");
+            warning( "Can not solve this casting problem exactly; revert to Word_wrap");
            try_wrap = true;
        } 
     }
@@ -231,7 +229,7 @@ PScore::calc_breaking()
 }
 
 void
-PScore::process()
+Paper_score::process()
 {
     clean_cols();
     print();
@@ -241,11 +239,16 @@ PScore::process()
     calc_breaking();
     *mlog << "\nPostprocessing elements..." << endl;
     postprocess();
+    
+#ifndef NDEBUGA
+    for(PCursor<Score_elem*> i(elem_p_list_.top()); i.ok(); i++) 
+       assert (i->status() >= 9);
+#endif
 }
 
 /** Get all breakable columns between l and r, (not counting l and r).  */
 Link_array<PCol>
-PScore::breakable_col_range(PCol*l,PCol*r)const
+Paper_score::breakable_col_range(PCol*l,PCol*r)const
 {
     Link_array<PCol> ret;
 
@@ -264,7 +267,7 @@ PScore::breakable_col_range(PCol*l,PCol*r)const
     return ret;
 }
 Link_array<PCol>
-PScore::col_range(PCol*l,PCol*r)const
+Paper_score::col_range(PCol*l,PCol*r)const
 {
     Link_array<PCol> ret;
     
@@ -282,7 +285,7 @@ PScore::col_range(PCol*l,PCol*r)const
 }
 
 Link_array<PCol>
-PScore::broken_col_range(PCol*l,PCol*r)const
+Paper_score::broken_col_range(PCol*l,PCol*r)const
 {
     Link_array<PCol> ret;
 
index 4cf44b1f8d9b2f8f9ad505c7c0ebc7be9b4898a7..baace2c030f282b80db685a7ac1d45062d156907 100644 (file)
@@ -51,7 +51,6 @@ Paper_def::Paper_def()
     itrans_p_ = 0;
     lookup_p_ = 0;
     real_vars_p_ = new Assoc<String,Real>;
-    outfile_str_ = "lelie.tex";
 }
 
 Paper_def::~Paper_def()
index d494a11a48d7b015fc5b1912668dba0c8f7ed496..b06ca442cd48495f9089543185a824688b65cd53 100644 (file)
@@ -12,7 +12,7 @@
 #include <iostream.h>
 
 // mmm
-#define MUDELA_VERSION "0.1.0"
+#define MUDELA_VERSION "0.1.1"
 
 #include "script-def.hh"
 #include "symtable.hh"
@@ -77,6 +77,7 @@
     Symtable * symtable;
     Symtables * symtables;
     Text_def * textdef;
+    Tempo_req *tempo;
     char c;
     const char *consstr;
     int i;
@@ -100,7 +101,6 @@ yylex(YYSTYPE *s,  void * v_l)
 %pure_parser
 
 /* tokens which are not keywords */
-%token CONCAT
 
 %token ALIAS
 %token BAR
@@ -114,14 +114,12 @@ yylex(YYSTYPE *s,  void * v_l)
 %token DURATIONCOMMAND
 %token ABSDYNAMIC
 %token END
-%token GEOMETRIC
 %token GROUPING
 %token GROUP
 %token REQUESTTRANSLATOR
 %token HSHIFT
 %token IN_T
 %token ID
-%token INIT_END
 %token LYRIC
 %token KEY
 %token MELODIC
@@ -130,7 +128,6 @@ yylex(YYSTYPE *s,  void * v_l)
 %token METER
 %token MM_T
 %token MULTI
-%token NOTE
 %token NOTENAMES
 %token OCTAVECOMMAND
 %token OUTPUT
@@ -152,8 +149,6 @@ yylex(YYSTYPE *s,  void * v_l)
 %token TEXID
 %token TEXTSTYLE
 %token TITLE
-%token UNITSPACE
-%token WIDTH
 %token VERSION
 
 /* escaped */
@@ -168,7 +163,7 @@ yylex(YYSTYPE *s,  void * v_l)
 %token <id>    VOICE_IDENTIFIER
 %token <id>    POST_REQUEST_IDENTIFIER
 %token <id>    SCRIPT_IDENTIFIER
-%token <id>    STAFF_IDENTIFIER
+%token <id>    COMMAND_IDENTIFIER
 %token <id>    REAL_IDENTIFIER
 %token <id>    INPUT_TRANS_IDENTIFIER
 %token <id>    INT_IDENTIFIER
@@ -190,7 +185,7 @@ yylex(YYSTYPE *s,  void * v_l)
 %type <i>      int
 %type <i>      script_dir
 %type <id>     declaration
-%type <duration>       explicit_duration notemode_duration
+%type <duration>       explicit_duration notemode_duration entered_notemode_duration
 %type <interval>       dinterval
 %type <intvec> intastint_list
 %type <lookup> symtables symtables_body
@@ -217,6 +212,7 @@ yylex(YYSTYPE *s,  void * v_l)
 %type <symbol> symboldef
 %type <symtable>       symtable symtable_body
 %type <itrans> input_translator_spec input_translator_spec_body
+%type <tempo>  tempo_request
 
 %left PRIORITY
 
@@ -461,15 +457,16 @@ midi_block:
        '{' midi_body '}'       { $$ = $3; }
        ;
 
-midi_body: /* empty */                 {
-               $$ = THIS->default_midi(); // midi / audio / perform
+midi_body: /* empty */                 {
+               $$ = THIS->default_midi();
        }
        | midi_body OUTPUT STRING ';'   { 
                $$->outfile_str_ = *$3; 
                delete $3; 
        }
-       | midi_body TEMPO notemode_duration ':' int ';' {
-               $$->set_tempo( $3->length(), $5 );
+       | midi_body tempo_request ';' {
+               $$->set_tempo( $2->dur_.length(), $2->metronome_i_ );
+               delete $2;
        }
        | midi_body input_translator_spec       {
                $$->set( $2 );
@@ -479,6 +476,15 @@ midi_body: /* empty */                     {
        }
        ;
 
+tempo_request:
+       TEMPO entered_notemode_duration '=' int         {
+               $$ = new Tempo_req;
+               $$->dur_ = *$2;
+               delete $2;
+               $$-> metronome_i_ = $4;
+       }
+       ;
+
 /*
        MUSIC
 */
@@ -562,33 +568,23 @@ full_element:
                THIS->add_requests((Chord*)$2);//ugh
                $$ = $2;
        }
+       | command_elt
        | voice_command ';'     { $$ = 0; }
        ;       
 
 simple_element:
        music_elt 
        | lyrics_elt
-       | command_elt
        ;
 
 command_elt:
-/* empty */    {
+       command_req {
                $$ = new Request_chord;
                $$-> set_spot( THIS->here_input());
-       }
-/* cont: */
-       command_req {
-               $2-> set_spot( THIS->here_input());
-               ((Chord*)$$) ->add($2);//ugh
+               $1-> set_spot( THIS->here_input());
+               ((Chord*)$$) ->add($1);//ugh
 
        }
-       | GROUP STRING ';' { // ugh ugh ugh
-               Change_reg *chr_p = new Change_reg;
-               $$ = chr_p;
-               chr_p-> type_str_ = "Voice_group_engravers"; //ugh
-               chr_p-> id_str_ = *$2;
-               delete $2;
-       }
        ;
 
 command_req:
@@ -600,6 +596,9 @@ abbrev_command_req:
         '|'                            { 
                $$ = new Barcheck_req;
        }
+       | COMMAND_IDENTIFIER    {
+               $$ = $1->request(true);
+       }
        ;
 
 verbose_command_req:
@@ -620,13 +619,15 @@ verbose_command_req:
        }
        | SKIP duration_length {
                Skip_req * skip_p = new Skip_req;
-               skip_p->duration_ = Duration(1,0);
                skip_p->duration_.set_plet($2->numerator().as_long(), 
                        $2->denominator().as_long());
                
                delete $2;
                $$ = skip_p;
        }
+       | tempo_request {
+               $$ = $1;
+       }
        | CADENZA int   {
                $$ = new Cadenza_req($2);
        }
@@ -653,7 +654,6 @@ verbose_command_req:
        | GROUPING intastint_list {
                $$ = get_grouping_req(*$2); delete $2;
        }
-       
        ;
 
 post_requests:
@@ -735,7 +735,8 @@ dynamic_req:
 close_plet_parens:
        ']' INT '/' INT {
                $$ = ']';
-               THIS->default_duration_.set_plet($2,$4);
+               THIS->plet_.type_i_ = $4;
+               THIS->plet_.iso_i_ = $2;
        }
        ;
 
@@ -763,7 +764,8 @@ close_request_parens:
 open_plet_parens:
        '[' INT '/' INT {
                $$ = '[';
-               THIS->default_duration_.set_plet($2,$4);
+               THIS->plet_.type_i_ = $4;
+               THIS->plet_.iso_i_ = $2;
        }
        ;
 
@@ -872,7 +874,7 @@ voice_command:
                THIS->set_duration_mode(*$2);
                delete $2;
        }
-       | DURATIONCOMMAND notemode_duration {
+       | DURATIONCOMMAND entered_notemode_duration {
                THIS->set_default_duration($2);
                delete $2;
        }
@@ -910,12 +912,12 @@ dots:
        | dots '.'      { $$ ++; }
        ;
 
-notemode_duration:
+entered_notemode_duration:
        /* */           { 
                $$ = new Duration(THIS->default_duration_);
        }
        | dots          {
-               $$ = new Duration(THIS->default_duration_);
+               $$ = new Duration(THIS->default_duration_);             
                $$->dots_i_  = $1;
        }
        | explicit_duration     {
@@ -924,6 +926,14 @@ notemode_duration:
        }
        ;
 
+notemode_duration:
+       entered_notemode_duration {
+               $$ = $1;
+               $$->plet_.type_i_ *= THIS->plet_.type_i_;
+               $$->plet_.iso_i_ *= THIS->plet_.iso_i_;
+       }
+       ;
+
 explicit_duration:
        int             {
                $$ = new Duration;
@@ -931,7 +941,6 @@ explicit_duration:
                        THIS->parser_error("Not a duration");
                else {
                        $$->type_i_ = $1;
-                       $$->set_plet(THIS->default_duration_);
                     }
        }
        | explicit_duration '.'         {
index f465139920138e15445d70560c2bc9ea6ce30cd8..b697dca1a66dd65d2f0f9d56a710c3a11a6490bf 100644 (file)
 #include "debug.hh"
 
 IMPLEMENT_IS_TYPE_B2(Performer_group_performer,Performer, Translator);
-
 ADD_THIS_PERFORMER(Performer_group_performer);
 
-Performer_group_performer::Performer_group_performer()
-{
-}
-
 Performer_group_performer::~Performer_group_performer()
 {
+
 }
 
 void
@@ -51,6 +47,42 @@ Performer_group_performer::depth_i() const
     return daddy_perf_l_->depth_i() + 1;
 }
 
+void
+Performer_group_performer::do_creation_processing()
+{
+    for ( PCursor<Performer*> i( perf_p_list_.top() ); i.ok(); i++ )
+       i->creation_processing();
+}
+
+void
+Performer_group_performer::do_print()const
+{
+#ifndef NPRINT
+    if ( !check_debug)
+       return ;
+    for ( PCursor<Performer*> i( perf_p_list_.top() ); i.ok(); i++ )
+       i->print();
+#endif
+}
+
+void
+Performer_group_performer::do_removal_processing()
+{
+    for ( PCursor<Performer*> i( perf_p_list_.top() ); i.ok(); i++ )
+       i->do_removal_processing();
+}
+
+bool
+Performer_group_performer::do_try_request( Request* req_l )
+{
+    bool hebbes_b =false;
+    for (int i =0; !hebbes_b && i < nongroup_l_arr_.size() ; i++)
+       hebbes_b =nongroup_l_arr_[i]->try_request(req_l);
+    if ( !hebbes_b && daddy_perf_l_ )
+       hebbes_b = daddy_perf_l_->try_request(req_l);
+    return hebbes_b ;
+}
+
 Translator*
 Performer_group_performer::find_get_translator_l( String n,String id )
 {
@@ -109,83 +141,27 @@ Performer_group_performer::get_default_interpreter()
        return perf_p->get_default_interpreter();
 }
 
-Moment
-Performer_group_performer::get_mom() const
-{
-    Moment mom = Performer::get_mom();
-
-    for ( int i = 0; i < nongroup_l_arr_.size(); i++ )
-       nongroup_l_arr_[ i ]->set( mom );
-    
-    return mom;
-}
-
 bool
 Performer_group_performer::is_bottom_performer_b() const
 {
     return !itrans_l_->get_default_itrans_l();
 }
 
-
-void
-Performer_group_performer::process_requests()
-{
-    for ( PCursor<Performer*> i( perf_p_list_.top() ); i.ok(); i++ )
-       i->process_requests();
-}
-
-//<ugh>
-int
-Performer_group_performer::get_track_i() const
-{
-    int track_i = Performer::get_track_i();
-
-    for ( int i = 0; i < nongroup_l_arr_.size(); i++ )
-       nongroup_l_arr_[ i ]->set_track( track_i );
-    
-    return track_i;
-}
-
-void
-Performer_group_performer::set_track( int& track_i_r )
-{
-    for ( PCursor<Performer*> i( perf_p_list_.top() ); i.ok(); i++ )
-        i->set_track( track_i_r );
-}
-//</ugh>
-
-bool
-Performer_group_performer::do_try_request( Request* req_l )
-{
-    bool hebbes_b =false;
-    for (int i =0; !hebbes_b && i < nongroup_l_arr_.size() ; i++)
-       hebbes_b =nongroup_l_arr_[i]->try_request(req_l);
-    if ( !hebbes_b && daddy_perf_l_ )
-       hebbes_b = daddy_perf_l_->try_request(req_l);
-    return hebbes_b ;
-}
-
 void
-Performer_group_performer::do_print()const
-{
-#ifndef NPRINT
-    if ( !check_debug)
-       return ;
-    for ( PCursor<Performer*> i( perf_p_list_.top() ); i.ok(); i++ )
-       i->print();
-#endif
+Performer_group_performer::print() const 
+{ 
+    Performer::print();
 }
 
 void
-Performer_group_performer::do_creation_processing()
+Performer_group_performer::process_requests()
 {
     for ( PCursor<Performer*> i( perf_p_list_.top() ); i.ok(); i++ )
-       i->creation_processing();
+       i->process_requests();
 }
 
-void
-Performer_group_performer::do_removal_processing()
+bool 
+Performer_group_performer::try_request( Request* r )
 {
-    for ( PCursor<Performer*> i( perf_p_list_.top() ); i.ok(); i++ )
-       i->do_removal_processing();
+    return Performer::try_request( r ); 
 }
index 246fc603e219bf51e1fd4cbc8ced5076394be65f..c1d84ca83b380be89a93bda7be1604105e855b02 100644 (file)
@@ -29,24 +29,12 @@ Performer::do_print() const
 {
 }
 
-Moment
-Performer::get_mom() const
-{
-    return daddy_perf_l_->get_mom();
-}
-
 void 
-Performer::play( Audio_item* p ) 
+Performer::play( Audio_element* p ) 
 { 
     daddy_perf_l_->play( p ); 
 }
 
-void 
-Performer::play( Midi_item* l ) 
-{ 
-    daddy_perf_l_->play( l ); 
-}
-
 int
 Performer::get_tempo_i()const
 {
@@ -68,24 +56,6 @@ Performer::process_requests()
 {
 }
 
-void
-Performer::set( Moment )
-{
-} 
-
-//<ugh>
-int
-Performer::get_track_i() const
-{
-    return daddy_perf_l_->get_track_i();
-}
-
-void
-Performer::set_track( int& )
-{
-}
-//</ugh>
-
 bool 
 Performer::do_try_request( Request* req_l )
 {
@@ -105,17 +75,11 @@ void
 Performer::creation_processing()
 {
     if (!init_b_) { 
-/*     if ( daddy_perf_l_ ) {
-           init_b_ = true;     // ugh. avoid recursion
-           daddy_perf_l_->creation_processing();
-           init_b_ = false;
-       }
-       
-       */
        do_creation_processing();
        init_b_ = true;
     }
 }
+
 void
 Performer::do_creation_processing()
 {
index 15a90ca6e3de3f4f00320b3b4c45a0e3a627378a..36589b64554f4a81c9c06def26310233f05f986f 100644 (file)
@@ -23,3 +23,21 @@ Request::time_int() const
     return MInterval(0, duration());
 }
 
+
+bool
+Request::equal_b(Request *r)const
+{
+    if ( is_type_b ( r->name() ) )
+       return r->do_equal_b( (Request*)this );
+    if ( r->is_type_b( name ()))
+       return do_equal_b( r );
+        
+    return false;
+}
+
+bool
+Request::do_equal_b(Request*)const
+{
+    return false;
+}
+    
index 29fdac1a3d47c3ef1df153725ad2852152cd768e..bf18c12e1ad3a2c5f344c1060b4aad33e711cc4e 100644 (file)
@@ -31,8 +31,10 @@ Rest_collision_engraver::acknowledge_element(Score_elem_info i)
     } 
     else if (nC == Note_column::static_name()) {
        // what should i do, what should _engraver do?
-       if (!rest_collision_p_)
+       if (!rest_collision_p_) {
            rest_collision_p_ = new Rest_collision;
+           announce_element(Score_elem_info(rest_collision_p_, 0));
+       }
        rest_collision_p_->add((Note_column*)i.elem_l_->item());
     }
     else if (nC == Rest_column::static_name()) {
index babf47bd321bb8d1f49a36ec2925ed4738b15444..9660c144eddddb751dfde22c3465504a7145dbee 100644 (file)
@@ -22,7 +22,7 @@ void
 Score_align_engraver::do_pre_move_processing()
 {
     if (align_p_) {
-       typeset_breakable_item( align_p_);
+       typeset_element( align_p_);
        align_p_ =0;
     }
 }
@@ -34,10 +34,13 @@ Score_align_engraver::acknowledge_element(Score_elem_info inf)
     
        if (!align_p_ ) {
            align_p_ = new Horizontal_group_item;
+           align_p_->breakable_b_ = true;
            announce_element(Score_elem_info(align_p_,0));
        }
-       
-       align_p_->add_element(inf.elem_l_);
+       Score_elem * unbound_elem = inf.elem_l_;
+       while ( unbound_elem->axis_group_l_a_[X_AXIS] )
+           unbound_elem = unbound_elem->axis_group_l_a_[X_AXIS];
+       align_p_->add_element(unbound_elem );
     }
     
 }
index 3e945a5e2bc3962f6c3e750363aef90de5c64014..c80314ef4a90bd26b0e346e782b1c0ae31bfa940 100644 (file)
@@ -5,7 +5,9 @@
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
-
+/*
+  too big. Should split.
+ */
 #include "p-score.hh"
 #include "paper-def.hh"
 #include "lookup.hh"
@@ -44,16 +46,16 @@ Score_elem::dependent_size() const
 }
 
 
+
 String
-Score_elem::TeX_string() const
+Score_elem::TeX_string_without_offset(Offset o)const
 {
-    assert( status_ > POSTCALCED);
     if (transparent_b_ )
        return "";
     String s( "\\placebox{%}{%}{%}");
     Array<String> a;
-    a.push(print_dimen(offset_.y));
-    a.push(print_dimen(offset_.x));
+    a.push( print_dimen(o.y() ));
+    a.push( print_dimen(o.x() ));
     String t = output->TeX_string();
     if (t == "")
        return t;
@@ -64,7 +66,13 @@ Score_elem::TeX_string() const
        r = String("\n%start: ") + name() + "\n";
     r += substitute_args(s, a);;
     return r;
-    
+}
+
+String
+Score_elem::TeX_string() const
+{
+    assert( status_ > POSTCALCED);
+    return TeX_string_without_offset(offset_);
 }
 
 void
@@ -81,8 +89,7 @@ Score_elem::Score_elem(Score_elem const&s)
 {
     transparent_b_ = s.transparent_b_;
     empty_b_ = s.empty_b_;
-    x_group_l_ = 0;
-    y_group_l_ = 0;    
+    axis_group_l_a_[0] = axis_group_l_a_[1] =0;
     status_ = s.status_;
     assert(!s.output);
     output = 0;
@@ -100,26 +107,69 @@ Score_elem::~Score_elem()
 
 }
 
-void
-Score_elem::translate_x(Real x)
+/*
+  GEOMETRY
+ */
+Real
+Score_elem::absolute_coordinate(Axis a)const
 {
-    offset_.x += x;
+    Real r = offset_[a];
+    for ( Axis_group_element * axis_group_l = axis_group_l_a_[a];
+         axis_group_l; axis_group_l = axis_group_l->axis_group_l_a_[a])
+       
+       r += axis_group_l->offset_[a];
+    return r;
 }
 
+Offset
+Score_elem::absolute_offset() const
+{
+    return Offset(absolute_coordinate(X_AXIS), absolute_coordinate(Y_AXIS));
+}
 
+ void
+Score_elem::translate(Real y, Axis a)
+{
+    offset_[a] += y;
+}
 
-void
-Score_elem::translate_y(Real y)
+Real
+Score_elem::relative_coordinate(Axis_group_element*e, Axis a)const
 {
-    offset_.y += y;
+    Real r =0.0;
+    for ( Axis_group_element * axis_group_l = axis_group_l_a_[a];
+         axis_group_l != e;
+         axis_group_l = axis_group_l->axis_group_l_a_[a])
+       r +=  axis_group_l->offset_[a];
+
+    return r;
 }
 
+Axis_group_element* 
+Score_elem::common_group(Score_elem const* s, Axis a)const
+{
+    Link_array<Axis_group_element> my_groups;
+    for ( Axis_group_element * axis_group_l = axis_group_l_a_[a];
+         axis_group_l;
+         axis_group_l = axis_group_l->axis_group_l_a_[a])
+       my_groups.push( axis_group_l );
+
+    Axis_group_element* common_l=0;
+    for ( Axis_group_element * axis_group_l = s->axis_group_l_a_[a];
+         !common_l && axis_group_l;
+         axis_group_l = axis_group_l->axis_group_l_a_[a])
+       common_l = my_groups.find_l( axis_group_l );
+
+    return common_l;
+}
+
+
 
 void
 Score_elem::translate(Offset O)
 {
-    translate_y(O.y);
-    translate_x(O.x);
+    offset_ += O;
 }
 
 Interval
@@ -129,20 +179,30 @@ Score_elem::do_width() const
 
     if (!output){
        Molecule*m = brew_molecule_p();
-       r = m->extent().x;
+       r = m->extent().x();
        delete m;
     } else
-       r = output->extent().x;
+       r = output->extent().x();
     return r;
 }
 
 Interval
 Score_elem::width() const
 {
-    Interval r=(empty_b_)?Interval(0,0):do_width();
+    return extent( X_AXIS);
+}
 
+Interval
+Score_elem::extent(Axis a)const
+{
+    Interval r;
+    if ( !empty_b_ ) {
+       
+       r = (a == X_AXIS)? do_width(): do_height();
+    }
+    
     if (!r.empty_b()) // float exception on DEC Alpha
-       r+=offset_.x;
+       r+=offset_[a];
 
     return r;
 }
@@ -153,25 +213,22 @@ Score_elem::do_height() const
     Interval r;
     if (!output){
        Molecule*m = brew_molecule_p();
-       r = m->extent().y;
+       r = m->extent().y();
        delete m;
     } else
-       r = output->extent().y;
+       r = output->extent().y();
     return r;
 }
 
 Interval
 Score_elem::height() const
 {
-    Interval r=(empty_b_)?Interval(0,0): do_height();
-
-    if (!r.empty_b())
-       r+=offset_.y;
-
-  
-    return r;
+    return extent(Y_AXIS);
 }
 
+/*
+  STANDARD METHS
+ */
 void
 Score_elem::print()const
 {
@@ -179,8 +236,8 @@ Score_elem::print()const
     mtor << name() << "{\n";
     mtor << "dets: " << dependent_size() << "dependencies: " << 
        dependency_size();
-    if (offset_.x || offset_.y)
-       mtor << "offset (" << offset_.x << ", " << offset_.y <<")";
+    if (offset_.x() || offset_.y())
+       mtor << "offset (" << offset_.x() << ", " << offset_.y() <<")";
     mtor << "\n";
 
     do_print();
@@ -191,13 +248,10 @@ Score_elem::print()const
 #endif
 }
 
-
-
 Score_elem::Score_elem()
 {
     transparent_b_ = empty_b_ = false;
-    x_group_l_ = 0;
-    y_group_l_ =0;
+    axis_group_l_a_[0] = axis_group_l_a_[1] =0;
     pscore_l_=0;
     offset_ = Offset(0,0);
     output = 0;
@@ -233,6 +287,9 @@ Score_elem::pre_processing()
     for (int i=0; i < dependency_size(); i++)
        dependency(i)->pre_processing();
 
+    Link_array<Score_elem> extra(get_extra_dependencies());
+    for (int i=0; i < extra.size(); i++)
+       extra[i]->pre_processing();
     
     do_pre_processing();
     status_ = PRECALCED;
@@ -253,7 +310,11 @@ Score_elem::breakable_col_processing()
     for (int i=0; i < dependency_size(); i++)
        dependency(i)->breakable_col_processing();
 
+      Link_array<Score_elem> extra(get_extra_dependencies());
+    for (int i=0; i < extra.size(); i++)
+       extra[i]->breakable_col_processing();
     
+  
     do_breakable_col_processing();
     status_ = PREBROKEN;
 }
@@ -273,6 +334,11 @@ Score_elem::break_processing()
     for (int i=0; i < dependency_size(); i++)
        dependency(i)->break_processing();
 
+    Link_array<Score_elem> extra(get_extra_dependencies());
+    for (int i=0; i < extra.size(); i++)
+       extra[i]->break_processing();
+    
+
     
     do_break_processing();
     status_ = BROKEN;
@@ -297,6 +363,12 @@ Score_elem::post_processing()
   
     for (int i=0; i < dependency_size(); i++)
        dependency(i)->post_processing();
+
+    Link_array<Score_elem> extra(get_extra_dependencies());
+    for (int i=0; i < extra.size(); i++)
+       extra[i]->post_processing();
+    
+
     do_post_processing();
     status_=POSTCALCED;
 }
@@ -317,11 +389,21 @@ Score_elem::molecule_processing()
     for (int i=0; i < dependency_size(); i++)
        dependency(i)->molecule_processing();
 
+    Link_array<Score_elem> extra(get_extra_dependencies());
+    for (int i=0; i < extra.size(); i++)
+       extra[i]->molecule_processing();
+    
+
     if (transparent_b_)
        return ;
     output= brew_molecule_p();
 }
 
+/*
+  
+  VIRTUAL STUBS
+
+ */
 void
 Score_elem::do_post_processing()
 {
@@ -341,7 +423,6 @@ Score_elem::do_pre_processing()
 void
 Score_elem::do_add_processing()
 {
-
 }
 
 void
@@ -349,16 +430,13 @@ Score_elem::do_substitute_dependency(Score_elem*,Score_elem*)
 {
 }
 void
-Score_elem::do_substitute_dependent(Score_elem*o,Score_elem*n)
+Score_elem::do_substitute_dependent(Score_elem*,Score_elem*)
 {
-    if  ( o== y_group_l_ ) {
-       y_group_l_ = n ?  n->vertical_group() : 0;
-    } else if (o == x_group_l_ ) {
-       x_group_l_ = n ? n->horizontal_group() : 0;
-    }
 }
 
-
+void
+Score_elem::do_unlink()
+{}
 
 IMPLEMENT_IS_TYPE_B(Score_elem);
 
@@ -368,11 +446,7 @@ 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
@@ -381,8 +455,10 @@ Score_elem::line_l()const
 }
 
 /*
+  
   DEPENDENCIES
- */
+
+  */
 
 void
 Score_elem::remove_dependency(Score_elem*e)
@@ -437,7 +513,6 @@ Score_elem::handle_broken_dependencies()
            }
            remove_us_arr.push(elt);
        } 
-       
     }
 
     remove_us_arr.default_sort();
@@ -445,6 +520,7 @@ Score_elem::handle_broken_dependencies()
     for (int i=0;  i <remove_us_arr.size(); i++)
        remove_dependency(remove_us_arr[i]);
 
+    status_ = BROKEN;
 }
 
 /*
@@ -463,31 +539,32 @@ Score_elem::handle_broken_dependencies()
 void
 Score_elem::handle_prebroken_dependencies()
 {
-    Link_array<Score_elem> remove_us_arr;
+    Link_array<Score_elem> old_arr, new_arr;
+    
     for (int i=0; i < dependency_size(); i++) {
        Score_elem * elt = dependency(i);
        Item *it_l = elt->item();
-       if (it_l && it_l->pcol_l_->breakable_b())
+       if (it_l && it_l->breakable_b_)
            if (item()) {
                Score_elem *new_l = it_l->find_prebroken_piece(item()->pcol_l_);
                if (new_l != elt ) {
-                   do_substitute_dependency( elt, new_l);
-                   remove_us_arr.push(elt);
-                   
-                   add_dependency(new_l);
+                   new_arr.push (new_l);
+                   old_arr.push(elt);
                } 
            }else {
-               add_dependency(it_l->broken_to_a_[0]);
-               add_dependency(it_l->broken_to_a_[1]);          
+               new_arr.push(it_l->broken_to_a_[0]);
+               old_arr.push(0);
+               old_arr.push(0);                
+               new_arr.push(it_l->broken_to_a_[1]);            
            }
-
     }
     
-    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]);
-
+    for (int i=0;  i < old_arr.size(); i++)
+       if (old_arr[i])
+           substitute_dependency( old_arr[i], new_arr[i] );
+       
+       
+    status_ = PREBROKEN;
 }
 
 
@@ -497,14 +574,18 @@ Score_elem::unlink_all()
 {
     for (int i=0; i < dependency_size(); i++) 
        dependency(i)->unlink_all();
+    Link_array<Score_elem> extra(get_extra_dependencies());
+    for (int i=0; i < extra.size(); i++)
+       extra[i]->unlink_all();
+    
     junk_links();
-    y_group_l_ = 0;
-    x_group_l_ = 0;
+    axis_group_l_a_[0] = axis_group_l_a_[1] =0;
 }
 
 void
 Score_elem::unlink()
 {
+    do_unlink();
     while ( dependency_size()) {
        do_substitute_dependency(dependency(0),0);
        remove_edge_out_idx(0);
@@ -512,9 +593,11 @@ Score_elem::unlink()
     while  ( dependent_size() ) {
        dependent(0)->remove_dependency(this);
     }
-}
-
+    for (int j=0; j < 2; j++)
+       if ( axis_group_l_a_[j])
+           axis_group_l_a_[j]->remove_element(this);
 
+}
 
 void
 Score_elem::OK()const
@@ -525,3 +608,10 @@ Score_elem::OK()const
     }
 #endif
 }
+
+Link_array<Score_elem>
+Score_elem::get_extra_dependencies()const
+{
+    Link_array<Score_elem> empty;
+    return empty;
+}
index 8c31c827c7f5b8399dba99c9dbf4768617286165..0b40a875dfe61ffcac1a8c6d8ce67f557b3129f8 100644 (file)
@@ -5,12 +5,12 @@
 
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
+
 #include "super-elem.hh"
 #include "scoreline.hh"
 #include "debug.hh"
 #include "score-elem.hh"
 #include "bar.hh"              // needed for Bar::static_name
-#include "staffline.hh"
 #include "score-grav.hh"
 #include "p-col.hh"
 #include "p-score.hh"
@@ -40,14 +40,9 @@ Score_engraver::Score_engraver()
 void
 Score_engraver::prepare(Moment w)
 {
-    command_column_l_ = new Score_column(w);
-    musical_column_l_ = new Score_column(w);
+    set_columns(new Score_column(w),  new Score_column(w));
     
-    command_column_l_->musical_b_ = false;
-    musical_column_l_->musical_b_ = true;
     
-    score_l_->pscore_p_->add(command_column_l_);
-    score_l_->pscore_p_->add(musical_column_l_);
     disallow_break_b_ = false;
     post_move_processing();
 }
@@ -59,7 +54,7 @@ Score_engraver::finish()
            *mlog << "[" << breaks_i_ << "]" << flush;
    
     check_removal();
-    do_removal_processing();
+    removal_processing();
 }
 
 void
@@ -77,6 +72,7 @@ Score_engraver::do_removal_processing()
     scoreline_l_->right_col_l_ = get_staff_info().command_pcol_l();
     scoreline_l_->right_col_l_ ->set_breakable();
     typeset_all();
+    set_columns(0,0);
 }
 
 void
@@ -125,28 +121,25 @@ Score_engraver::do_announces()
 void
 Score_engraver::typeset_element(Score_elem *elem_p)
 {
-    musical_item_p_arr_.push(elem_p);
-}
-
-void
-Score_engraver::typeset_breakable_item(Item * nobreak_p)
-{
-    if (nobreak_p) {
-       nobreak_item_p_arr_.push(nobreak_p);
-    }
+    if  ( elem_p->item() && elem_p->item()->breakable_b_ ) {
+       nobreak_item_p_arr_.push(elem_p->item());
+    } else
+       musical_item_p_arr_.push(elem_p);
 }
 
 void
 Score_engraver::typeset_all()
 {
     PCol * c= get_staff_info().command_pcol_l();
-    PScore *ps_l = score_l_->pscore_p_;
+    Paper_score *ps_l = score_l_->pscore_p_;
 
     for  (int i =0; i < nobreak_item_p_arr_.size(); i++) {
-       ps_l->typeset_item(nobreak_item_p_arr_[i], c, 0);
+       ps_l->typeset_item(nobreak_item_p_arr_[i], c);
+
+       // should get rid of this.. .
        scoreline_l_->add_dependency(nobreak_item_p_arr_[i]);
     }
-    nobreak_item_p_arr_.set_size(0);
+    nobreak_item_p_arr_.clear();
     
     for (int i=0; i < musical_item_p_arr_.size(); i++) {
        PCol* m = get_staff_info().musical_pcol_l();
@@ -156,11 +149,11 @@ Score_engraver::typeset_all()
        if (elem_p->spanner()) {
            ps_l->typeset_unbroken_spanner(elem_p->spanner());
        } else if (elem_p->item()) {
-           ps_l->typeset_item(elem_p->item(), m, 0);
+           ps_l->typeset_item(elem_p->item(), m);
        } else
            assert(false);
     }
-    musical_item_p_arr_.set_size(0);
+    musical_item_p_arr_.clear();
 }
 
 
@@ -179,6 +172,33 @@ Score_engraver::do_pre_move_processing()
     typeset_all();
 }
 
+void
+Score_engraver::set_columns(Score_column *new_command_l, 
+                           Score_column *new_musical_l)
+{
+    if ( command_column_l_ && command_column_l_->used_b() )
+       score_l_->pscore_p_->add(command_column_l_);
+    else {
+       delete command_column_l_ ;
+       command_column_l_ =0;
+    }
+    if (new_command_l) {
+       command_column_l_ = new_command_l;
+       command_column_l_->musical_b_ = false;
+    }
+    if ( musical_column_l_ && musical_column_l_->used_b())
+       score_l_->pscore_p_->add (musical_column_l_);
+    else {
+       delete musical_column_l_;
+       musical_column_l_ = 0;
+    }
+    
+    if (new_musical_l) {
+       musical_column_l_ = new_musical_l;
+       musical_column_l_->musical_b_ = true;
+    }
+}
+
 
 Staff_info
 Score_engraver::get_staff_info()const
@@ -208,6 +228,5 @@ Score_engraver::do_try_request(Request*r)
 }
 
 IMPLEMENT_IS_TYPE_B1(Score_engraver,Engraver_group_engraver);
-
 ADD_THIS_ENGRAVER(Score_engraver);
 
index 243b8622f9d7bb3e05b163860a65b2b3858c047b..3d5293ee267f8a598f655da640ffeaf535064c6b 100644 (file)
@@ -20,7 +20,7 @@ void
 Score_horizontal_align_engraver::do_pre_move_processing()
 {
     if (halign_p_) {
-       typeset_breakable_item(halign_p_);
+       typeset_element(halign_p_);
        halign_p_ =0;
     }
        
@@ -36,6 +36,7 @@ Score_horizontal_align_engraver::acknowledge_element(Score_elem_info i)
        Score_align_engraver * align_grav_l = (Score_align_engraver*) reg;
        if (!halign_p_) {
            halign_p_ = new Break_align_item;
+           halign_p_->breakable_b_ = true;
            announce_element(Score_elem_info(halign_p_,0));
        }
        Item * it = i.elem_l_->item();
index bb05c0f16a88ac815f1b550c1be64e4294639ecc..ea27d507b84c9482364ca1f25d7878a1a41cfa24 100644 (file)
   score-performer.cc -- implement Score_performer
 
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 1996, 1997 Jan Nieuwenhuizen <jan@digicash.com>
  */
 
-#include <time.h>
 #include "score-performer.hh"
 #include "input-translator.hh"
 #include "midi-def.hh"
-#include "audio-item.hh"
 #include "audio-column.hh"
+#include "audio-item.hh"
 #include "audio-score.hh"
-#include "midi-item.hh"
 #include "midi-stream.hh"
 #include "string-convert.hh"
 #include "debug.hh"
-#include "main.hh"
 #include "score.hh"
 #include "source-file.hh"
 #include "source.hh"
+#include "audio-staff.hh"
 
 IMPLEMENT_IS_TYPE_B1(Score_performer,Performer_group_performer);
+
 ADD_THIS_PERFORMER(Score_performer);
 
+
 Score_performer::Score_performer()
 {
-    midi_l_ = 0;
 }
 
+
 Score_performer::~Score_performer()
 {
 }
 
+
 Translator* 
-Score_performer::ancestor_l( int l 
+Score_performer::ancestor_l(int l
 { 
-    return Global_translator::ancestor_l( l );
+    return Global_translator::ancestor_l(l);
 }
 
+
 int 
 Score_performer::depth_i() const 
 { 
     return Global_translator::depth_i();
 }
 
+
 void
 Score_performer::finish()
 {
     Performer_group_performer::do_removal_processing();
-
-
-    Midi_stream output_stream( midi_l_->outfile_str_, midi_item_l_arr_.size() + 1, 384 );    
-    *mlog << "MIDI output to " << midi_l_->outfile_str_ << " ..." << endl;    
-
-    header( output_stream);
-//    int track_i = 1;
-    for (int i=0; i<  midi_item_l_arr_.size(); i++) {
-       Midi_item * it_p = midi_item_l_arr_[i];
-       
-//     if ( it_p->is_type_b( Midi_track::static_name()))
-//         ((Midi_track*)it_p )->number_i_ = track_i ++;
-       output_stream<< *it_p;
-    }
-    *output_stream.os_p_ << flush;
-    *mlog << endl;
 }
 
-void
-Score_performer::play( Audio_item* l )
-{
-    l->audio_column_l_ = audio_column_l_;
-    audio_column_l_->add( l );
-}
 
 void
-Score_performer::play( Midi_item* l )
+Score_performer::play(Audio_element * p)
 {
-    midi_item_l_arr_.push( l );
-}
-
-Moment
-Score_performer::get_mom() const
-{
-    return now_mom_;
+    if  (p->is_type_b(Audio_item::static_name())) {
+       audio_column_l_->add( (Audio_item*)p);
+    } else if (p->is_type_b(Audio_staff::static_name())) {
+       score_l_->audio_score_p_->add_staff( (Audio_staff*)p );
+    }
+    score_l_->audio_score_p_->add(p);
 }
 
-void
-Score_performer::header(Midi_stream &output_stream)
-{
-    Midi_track midi_track;
-    
-    time_t t = time( 0 );
-
-    // perhaps multiple text events?
-    String str = String( "Creator: " ) + get_version_str() + "\n";
-
-    Midi_text creator( Midi_text::TEXT, str );
-    midi_track.add( Moment( 0 ), &creator );
-
-    str = "Automatically generated at ";
-    str += ctime( &t );
-    str = str.left_str( str.length_i() - 1 );
-    str += "\n";
-    Midi_text generate( Midi_text::TEXT, str );
-    midi_track.add( Moment( 0 ), &generate );
-
-    str = "from musical definition: ";
-
-    str += score_l_->location_str();
-    Midi_text from( Midi_text::TEXT, str );
-    midi_track.add( Moment( 0 ), &from );
-
-    Midi_text track_name( Midi_text::TRACK_NAME, "Track " 
-                         + String_convert::i2dec_str( 0, 0, '0' ) );
-    midi_track.add( Moment( 0 ), &track_name );
-
-    Midi_tempo tempo ( get_tempo_i() );
-    midi_track.add( Moment(0), &tempo);
-
-    output_stream  << midi_track;
-}
 
 void 
-Score_performer::prepare( Moment m )
+Score_performer::prepare(Moment m)
 {
     now_mom_ = m;
-    audio_column_l_ = new Audio_column( m );
-    
-    score_l_->audio_score_p_->add( audio_column_l_ );
+    audio_column_l_ = new Audio_column(m);
+    score_l_->audio_score_p_->add(audio_column_l_);
 }
 
+
 void 
 Score_performer::process()
 {
     process_requests();
-    prev_mom_ = now_mom_;
 }
 
+
 void
-Score_performer::set_score(Score* score_l )
+Score_performer::set_score(Score* score_l)
 {
-    Global_translator::set_score( score_l );
-    midi_l_ = score_l->midi_p_;
+    Global_translator::set_score(score_l);
 }
 
+
 void
 Score_performer::start()
 {
-    //<ugh>
-    int track_i = 1;
-    Performer_group_performer::set_track( track_i );
-    //</ugh>
-
-    if ( midi_l_->outfile_str_ == "" )
-       midi_l_->outfile_str_ = default_out_fn + ".midi";
 }
 
 
 int
 Score_performer::get_tempo_i()const
 {
-    return midi_l_->get_tempo_i(Moment( 1, 4 ));
+    return score_l_->midi_p_->get_tempo_i(Moment(1, 4));
 }
index 729df8e0205bcbb6a680a304fed78f520becf41f..53208cebc7aa80921f07a5c1277475032b13e65f 100644 (file)
@@ -15,8 +15,8 @@
 #include "main.hh"
 #include "source.hh"
 #include "source-file.hh"
-#include "midi-output.hh"
 #include "midi-def.hh"
+#include "midi-stream.hh"
 #include "audio-score.hh"
 #include "p-col.hh"
 #include "music-iterator.hh"
@@ -59,11 +59,20 @@ Score::run_translator(Global_translator * trans_l)
                                                                  trans_l);
     iter->construct_children();
 
+    if ( ! iter->ok() ) {
+       delete iter;
+       warning ("Need music in a score");
+       errorlevel_i_ =1;
+       return ;
+    }
+    
     trans_l->start();
+    
     while ( iter->ok() || trans_l->moments_left_i() ) {
        Moment w = infinity_mom;
        if (iter->ok() ) {
            w = iter->next_moment();
+           mtor << w;
            iter->print();
        }
        trans_l->modify_next( w );
@@ -92,7 +101,7 @@ Score::midi()
        return;
     
     *mlog << "\nCreating MIDI elements ..." << flush;
-    audio_score_p_ = new Audio_score( midi_p_ );
+    audio_score_p_ = new Audio_score( this );
     
     Global_translator* score_trans=  midi_p_->get_global_translator_p();
     run_translator( score_trans );
@@ -104,6 +113,8 @@ Score::midi()
 //     return;
     }
     *mlog << endl;
+
+    midi_output();
 }
     
 void
@@ -113,7 +124,7 @@ Score::paper()
        return;
     
     *mlog << "\nCreating elements ..." << flush;
-    pscore_p_ = new PScore(paper_p_);
+    pscore_p_ = new Paper_score(paper_p_);
     
     Global_translator * score_trans=  paper_p_->get_global_translator_p();
     run_translator( score_trans );
@@ -125,7 +136,6 @@ Score::paper()
 //     return;
     }
     
-    // debugging
     *mlog << endl;
     pscore_p_->process();
 
@@ -133,41 +143,24 @@ Score::paper()
     paper_output();
 }
 
-
 void
-Score::set(Paper_def *pap_p)
+Score::midi_output()
 {
-    delete paper_p_;
-    paper_p_ = pap_p;
-}
-
-void
-Score::set(Midi_def* midi_p)
-{    
-    delete midi_p_;
-    midi_p_ = midi_p;
-}
-
+    if ( midi_p_->outfile_str_ == "" )
+       midi_p_->outfile_str_ = default_out_fn + ".midi";
 
+    Midi_stream midi_stream( midi_p_->outfile_str_ );    
+    *mlog << "MIDI output to " << midi_p_->outfile_str_ << " ..." << endl;    
 
-void
-Score::print() const
-{
-#ifndef NPRINT
-    mtor << "score {\n"; 
-    music_p_->print();
-    if (midi_p_)
-       midi_p_->print();
-    
-    mtor << "}\n";
-#endif
+    audio_score_p_->output( midi_stream );
+    *mlog << endl;
 }
 
 void
 Score::paper_output()
 {
     if (paper_p_->outfile_str_=="")
-       paper_p_->outfile_str_ = default_out_fn + ".out";
+       paper_p_->outfile_str_ = default_out_fn + ".tex";
 
     if ( errorlevel_i_ ) { 
        *mlog << "lilypond: warning: no output to: " << paper_p_->outfile_str_ 
@@ -182,21 +175,32 @@ Score::paper_output()
     the_output << "% outputting Score, defined at: " <<
        location_str() << "\n";
     pscore_p_->output(the_output);
-    
 }
 
 void
-Score::midi_output()
+Score::print() const
 {
-#if 0
-    if (!midi_p_)
-       return;
-
-    if (midi_p_->outfile_str_ == "")
-       midi_p_->outfile_str_ = default_out_fn + ".midi";
+#ifndef NPRINT
+    mtor << "score {\n"; 
+    music_p_->print();
+    if (midi_p_)
+       midi_p_->print();
     
-    *mlog << "midi output to " << midi_p_->outfile_str_ << " ...\n";    
-    Midi_output(this, midi_p_);
+    mtor << "}\n";
 #endif
 }
 
+void
+Score::set(Paper_def *pap_p)
+{
+    delete paper_p_;
+    paper_p_ = pap_p;
+}
+
+void
+Score::set(Midi_def* midi_p)
+{    
+    delete midi_p_;
+    midi_p_ = midi_p;
+}
+
index d4951dbb8317fd9a28ff85a2951043d5546cf0e5..2cf31bcbed0b64984df0aeb67918e118a30570b9 100644 (file)
@@ -7,7 +7,6 @@
 */
 
 #include "scoreline.hh"
-#include "staffline.hh"
 #include "dimen.hh"
 #include "spanner.hh"
 #include "symbol.hh"
@@ -17,8 +16,8 @@
 
 
 /* To do:
+
    take out hard coded TeX stuff.
-   
    */
 String
 Line_of_score::TeX_string() const
@@ -33,27 +32,29 @@ Line_of_score::TeX_string() const
         PCol* col_l= cols[i];
         // all items in the current line & staff.
         String chunk_str;
-        Real delta  = col_l->hpos_f_ - lastpos;
+
            
+        Link_array<Score_elem> elems;
            
         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();
+            elems.push(j);
         }
+
         // spanners.
         for (iter_top(col_l->starters,j); j.ok(); j++) {
             if (j->name() != name())
-                chunk_str += j->TeX_string();
+               elems.push(j);
         }
-        if (chunk_str!="") {
-            // moveover
-            if (delta)
-                s +=String( "\\kern ") + print_dimen(delta);
-            s += chunk_str;
-            lastpos = col_l->hpos_f_;
+        
+        for (int j =0; j< elems.size(); j++) {
+            Offset o = elems[j]->absolute_offset();
+            o[X_AXIS] += cols[i]->hpos_f_;
+            s += elems[j]->TeX_string_without_offset(o);
         }
      }
      s += "}";
@@ -75,7 +76,8 @@ IMPLEMENT_IS_TYPE_B1(Line_of_score,Spanner);
 void
 Line_of_score::add(Score_elem*e)
 {
-    if( !e->dependent_size())  // avoid excess dependencies.
+    // avoid excess dependencies.
+    if(!( e->axis_group_l_a_[0] || e->axis_group_l_a_[1]))
        add_dependency(e);
 }
 
index be558b29c153fcf12e145259acba072f7a7a600d..3cfc56969cb4ce3d91cca71a1a1a51a00ea9bf85 100644 (file)
@@ -28,9 +28,8 @@ do_scores()
        
        if (is_p->errorlevel_i_) {
            is_p->warning("Score contains errors. Will not process it. ");
-         
+           exit_status_i_ |= 1;
        } else { 
-       
            is_p->print ();
            is_p->process();
        }
@@ -38,7 +37,7 @@ do_scores()
        is_p =0;
 
     }
-    score_array_global.set_size(0);
+    score_array_global.clear();
 }
 
 void
index 166eb348bb7db6f2b5a070f8da17387e8fa252f5..1c1df618ba7b061f54a4d7252b10ea71fe9067fb 100644 (file)
@@ -20,6 +20,7 @@ void
 Script_column::add(Script*s_l)
 {
     script_l_arr_.push(s_l);
+    add_dependency(s_l);
     add_element(s_l);
 }
 
@@ -89,13 +90,13 @@ 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)
 {
-    Horizontal_vertical_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 5475ec8cf2369df2959d72d0b3613b3393d62aba..856879eed77ad451b58b4a09db8600b4c5f9f4e1 100644 (file)
@@ -44,13 +44,13 @@ Script_def::do_print() const
 }
 
 bool
-Script_def::do_equal_b(General_script_def const &g)const 
+Script_def::do_equal_b(General_script_def const *g)const 
 {
-    Script_def const & c = (Script_def const&) g;
-    return (symidx_str_ == c.symidx_str_ &&
-            rel_stem_dir_i_ == c.rel_stem_dir_i_&&
-            staff_dir_i_ == c.staff_dir_i_&&
-            invertsym_b_ == c.invertsym_b_);
+    Script_def const * c = (Script_def const*) g;
+    return (symidx_str_ == c->symidx_str_ &&
+            rel_stem_dir_i_ == c->rel_stem_dir_i_&&
+            staff_dir_i_ == c->staff_dir_i_&&
+            invertsym_b_ == c->invertsym_b_);
 }
 
 int
index e33f121bb178eab8ba92e740ccf85bad5c0dc295..cd58609143543ad8d6051db89678890e9d14a3d9 100644 (file)
@@ -21,11 +21,11 @@ Script_engraver::do_try_request(Request *r_l)
     if (!r_l->musical() || ! r_l->musical()->musicalscript())
        return false ;
     
-    for (int i=0; i < script_req_l_arr_.size(); i++)
-       if ( !Script_req::compare(*script_req_l_arr_[i], *r_l->script())) {
+    for (int i=0; i < script_req_l_arr_.size(); i++) {
+       if ( r_l->equal_b(script_req_l_arr_[i]))
            return true;
-       }
        
+    }
     script_req_l_arr_.push( r_l->script());
     
     return true;
@@ -44,44 +44,22 @@ Script_engraver::do_process_requests()
     }
 }
 
-bool
-Script_engraver::acceptable_elem_b(Score_elem*s_l)
-{
-    char const *nC = s_l->name();
-    return (nC == Stem::static_name());
-}
-
-void
-Script_engraver::acknowledge_element(Score_elem_info info)
-{
-    Score_elem *elem_l = info.elem_l_;
-    if (!acceptable_elem_b(elem_l))
-       return;
-    
-    for (int i=0; i < script_p_arr_.size(); i++) {
-       Script*script_l = script_p_arr_[i];
-       if (elem_l->name() == Stem::static_name())
-           script_l->set_stem((Stem*)elem_l->item());
-    }
-}
-
 void
 Script_engraver::do_pre_move_processing()
 {
     Staff_symbol* s_l = get_staff_info().staff_sym_l_;
     for (int i=0; i < script_p_arr_.size(); i++) {
-       
        Script*script_p = script_p_arr_[i];
        script_p->set_staffsym( s_l);
        typeset_element(script_p);
     }
-    script_p_arr_.set_size(0);
+    script_p_arr_.clear();
 }
 
 void
 Script_engraver::do_post_move_processing()
 {
-    script_req_l_arr_.set_size(0);
+    script_req_l_arr_.clear();
 }
 
 
index 4fed33001398e65ea5299accfa66310f082e8261..eb88b8756f4a8bb13e1ee8c489eba34bc8d41591 100644 (file)
@@ -67,12 +67,16 @@ Script::set_default_dir()
 Interval
 Script::do_width() const
 {
-    return specs_l_->get_atom(paper(), dir_i_).extent().x;
+    return specs_l_->get_atom(paper(), dir_i_).extent().x();
 }
 
 void
 Script::do_pre_processing()
 {
+    if  (breakable_b_ && break_status_i() != 1) {
+       transparent_b_ = empty_b_ = true;
+    }
+    
     if (!dir_i_)
        set_default_dir();
     inside_staff_b_ = specs_l_->inside_b();
@@ -81,7 +85,7 @@ Script::do_pre_processing()
 Interval
 Script::symbol_height()const
 {
-    return specs_l_->get_atom(paper(), dir_i_).extent().y;
+    return specs_l_->get_atom(paper(), dir_i_).extent().y();
 }
 
 Molecule*
@@ -90,7 +94,7 @@ Script::brew_molecule_p() const
     Real dy = paper()->internote_f();
     
     Molecule*out = new Molecule(specs_l_->get_atom(paper(), dir_i_));
-    out->translate_y(dy * pos_i_);
+    out->translate(dy * pos_i_, Y_AXIS);
     return out;
 }
 
index feabdd45b4b2ebbfb2350edc4e1d10711e03c923..1c5c51df4e67046d3c75d6de1ddc4e16e4994827 100644 (file)
@@ -85,13 +85,13 @@ Slur_engraver::do_pre_move_processing()
            end_slur_l_arr_[i]->dir_i_ = dir_i_;
        typeset_element(end_slur_l_arr_[i]);
     }
-    end_slur_l_arr_.set_size(0);
+    end_slur_l_arr_.clear();
 }
 
 void
 Slur_engraver::do_post_move_processing()
 {
-    new_slur_req_l_arr_.set_size(0);
+    new_slur_req_l_arr_.clear();
 }
 Slur_engraver::~Slur_engraver()
 {
index a6d40fdd9c69bea88f13e90510a6c3dc95b57f1f..8e2663a2655770581b308c323208cf4684650b42 100644 (file)
@@ -25,8 +25,10 @@ Span_bar_engraver::get_span_bar_p()const
 void
 Span_bar_engraver::acknowledge_element(Score_elem_info i)
 {
-    if ( i.origin_grav_l_arr_.size() > 1 && 
-        i.elem_l_->is_type_b( Bar::static_name() ) ) {
+    int depth = i.origin_grav_l_arr_.size();
+    if ( depth > 1
+        && i.elem_l_->is_type_b( Bar::static_name() ) ) 
+    {
        bar_l_arr_.push( (Bar*)i.elem_l_->item() );
        
        if (bar_l_arr_.size() >= 2 && !spanbar_p_) {
@@ -46,7 +48,7 @@ Span_bar_engraver::do_pre_move_processing()
        for (int i=0; i < bar_l_arr_.size() ; i++)
            spanbar_p_->add(bar_l_arr_[i]);
        spanbar_p_->set( valign_l_ );
-       typeset_breakable_item(spanbar_p_);
+       typeset_element(spanbar_p_);
        spanbar_p_ =0;
     }
     bar_l_arr_.set_size( 0);
index 24430729bd623e5c5cf573e62f17cf037a9eee19..1c9a8ba15962356d32c56b5979a206656c058ed3 100644 (file)
@@ -43,15 +43,6 @@ Span_bar::do_substitute_dependency(Score_elem*o, Score_elem*n)
     spanning_l_arr_.substitute( bold , b);
 }
 
-/*
-  A no-op if not yet output: the span_bar slavish follows what it spans
- */
-void
-Span_bar::translate_y(Real y)
-{
-    if (status() == OUTPUT)
-       Score_elem::translate_y(y);
-}
 
 void
 Span_bar::set(Vertical_align_element *a)
@@ -63,7 +54,7 @@ Span_bar::set(Vertical_align_element *a)
 Interval
 Span_bar::do_width() const
 {
-    return paper()->lookup_l()->bar(type_str_, 40 PT).dim.x; // ugh
+    return paper()->lookup_l()->bar(type_str_, 40 PT).dim.x(); // ugh
 }
 void
 Span_bar::do_pre_processing()
@@ -91,18 +82,31 @@ Span_bar::get_bar_sym(Real dy) const
     return paper()->lookup_l()->bar(type_str_, dy);
 }
 
+
 Molecule*
 Span_bar::brew_molecule_p()const
 {
-    Interval y;
-    for (int i=0; i < spanning_l_arr_.size(); i++)
-       y.unite( spanning_l_arr_[i]->height() );
-    Symbol s = get_bar_sym(y.length());
-        Molecule*output = new Molecule(Atom(s));
-    output->translate_y (  y[-1] );
+    Interval y_int;
+    for (int i=0; i < spanning_l_arr_.size(); i++) {
+       Axis_group_element *common = 
+           common_group(spanning_l_arr_[i], Y_AXIS);
+       
+       Real y = spanning_l_arr_[i]->relative_coordinate(common, Y_AXIS)  
+           -relative_coordinate(common,Y_AXIS);
+
+       y_int.unite( y + spanning_l_arr_[i]->height() );
+    }
 
+    Symbol s = get_bar_sym(y_int.length());
+    Molecule*output = new Molecule(Atom(s));
+    output->translate (  y_int[-1], Y_AXIS );
     return output;
 }
 
 
 IMPLEMENT_IS_TYPE_B1(Span_bar,Bar);
+
+Span_bar::Span_bar()
+{
+    type_str_ = "";
+}
index cccbd03b7825f2ed0878d41c2f3b3c3ed9bd6ccc..4afd1358d78b2502424a4a104a8091a71fd426ed 100644 (file)
@@ -17,7 +17,6 @@ Span_score_bar_engraver::get_span_bar_p() const
 
 
 IMPLEMENT_IS_TYPE_B1(Span_score_bar_engraver, Span_bar_engraver);
-
 IMPLEMENT_IS_TYPE_B1(Piano_bar_engraver, Span_score_bar_engraver);
 
 Span_bar*
index 8e2c98bf1996bba52e0d759015616ad13bdb3f28..d463c2889d6700310d86b02156f44404a677a2e5 100644 (file)
@@ -11,7 +11,7 @@
 
 
 
-IMPLEMENT_IS_TYPE_B2(Spanner_elem_group,Spanner,Horizontal_vertical_group);
+IMPLEMENT_IS_TYPE_B2(Spanner_elem_group,Spanner,Horizontal_vertical_group_element);
 
 Interval
 Spanner_elem_group::do_width() const
@@ -24,7 +24,7 @@ Spanner_elem_group::do_print() const
 {
 #ifndef NPRINT
     Spanner::do_print();
-    Horizontal_vertical_group::do_print();
+    Horizontal_vertical_group_element::do_print();
 #endif
 }
 
index 0039caefb50735d7f373d0f7d2efccb131ac77ff..01a02cf8d44e7bd408037b11f35fa45ed931fe35 100644 (file)
@@ -36,6 +36,9 @@ Spanner::do_print()const
 void
 Spanner::break_into_pieces(bool copy_deps_b)
 {
+    if (  broken_into_l_arr_.size() )
+       return; 
+        
     PCol * left = left_col_l_;
     PCol * right = right_col_l_;
     if(left->daddy_l_) left = left->daddy_l_;
index 615975807753b40cf708123adb7059394f742e39..5f7fed022db0e9291ecb8d71604c82486850a349 100644 (file)
@@ -16,6 +16,7 @@ Staff_info::score_l()
 {
     return score_l_;
 }
+
 Staff_info::Staff_info()
 {
     score_l_ =0;
index a1efbfcebcfcab1cab3427d989c542a1b8c7f07a..3605653c38322625cd9ef718cc023baefe8e65df 100644 (file)
@@ -6,79 +6,50 @@
   (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
  */
 
-
 #include "staff-performer.hh"
 #include "translator.hh"
 #include "input-translator.hh"
 #include "debug.hh"
-#include "midi-def.hh"
 #include "audio-column.hh"
 #include "audio-item.hh"
-#include "midi-item.hh"
-#include "midi-stream.hh"
-#include "string.hh"
-#include "string-convert.hh"
-
+#include "audio-staff.hh"
 
 IMPLEMENT_IS_TYPE_B1(Staff_performer,Performer_group_performer);
 ADD_THIS_PERFORMER(Staff_performer);
 
 Staff_performer::Staff_performer()
 {
-    midi_track_p_ = new Midi_track;
+    audio_staff_p_ = 0;
 }
 
 Staff_performer::~Staff_performer()
 {
-    delete midi_track_p_;
+    delete audio_staff_p_;
 }
 
 void
 Staff_performer::do_creation_processing()
 {
-}
+    audio_staff_p_ = new Audio_staff;
 
-void
-Staff_performer::do_removal_processing()
-{
-    header();
+    // staff name
+    play(new Audio_text( Audio_text::TRACK_NAME, instrument_str()));
 
-    Moment midi_mom = 0;
-    for ( PCursor<Audio_item*> i( audio_item_p_list_ ); i.ok(); i++ ) {
-       Audio_item* l = *i;
-       Moment mom = l->audio_column_l_->at_mom();
-       Moment delta_t = mom - midi_mom_ ;
-       midi_mom_ += delta_t;
-       Midi_item* p = l->midi_item_p();
-       p->channel_i_ = track_i_;
-       midi_track_p_->add( delta_t, p );
-       delete p;
-    }
+    // instrument description
+    play(new Audio_text( Audio_text::INSTRUMENT_NAME, instrument_str()));
 
-    Performer::play( midi_track_p_ );
+    // tempo
+    play(new Audio_tempo(get_tempo_i()));
+
+    // instrument
+    play(new Audio_instrument(instrument_str()));
 }
 
 void
-Staff_performer::header()
+Staff_performer::do_removal_processing()
 {
-    // set track name
-    Midi_text track_name( Midi_text::TRACK_NAME, instrument_str() );
-    midi_track_p_->add( Moment( 0 ), &track_name );
-
-    // set instrument description
-    Midi_text instrument_name( Midi_text::INSTRUMENT_NAME, instrument_str() );
-    midi_track_p_->add( Moment( 0 ), &instrument_name );
-
-    // set instrument :-)
-    // lieve wendy, nu heb je mijn track_i_ / get_staff_i weggehaald...
-    // zie ook note-performer: ugh
-    // ugh, need to know channel (===track===staff) too
-    int channel_i = track_i_;
-    Midi_instrument instrument( channel_i, instrument_str() );
-    midi_track_p_->add( Moment( 0 ), &instrument );
-
-    Midi_tempo midi_tempo( get_tempo_i() );
-    midi_track_p_->add( Moment( 0 ), &midi_tempo );
+    Performer::play( audio_staff_p_ );
+    audio_staff_p_ = 0;
 }
 
 String 
@@ -88,31 +59,11 @@ Staff_performer::instrument_str()
 }
 
 void 
-Staff_performer::play( Audio_item* p )
+Staff_performer::play( Audio_element* p )
 {
-    audio_item_p_list_.bottom().add( p );
-    Performer::play( p );
-}
-
-// huh?
-void 
-Staff_performer::play( Midi_item* p )
-{
-    Performer::play( p );
-}
-
-
-//<ugh>
-int
-Staff_performer::get_track_i() const
-{
-    return track_i_;
-}
-
-void
-Staff_performer::set_track( int& track_i_r )
-{
-    track_i_ = track_i_r++;
+    if (p->is_type_b(Audio_item::static_name())) {
+       audio_staff_p_->add((Audio_item*)p);
+    }
+    Performer::play(p);
 }
-//</ugh>
 
index a661a0cb974d1721251dbe63b8535af057ab8768..6cade842a53a5f892e73be8aaf4508d472dd0e73 100644 (file)
@@ -106,13 +106,7 @@ Staff_side::do_post_processing()
 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);
-
+    support_l_arr_.unordered_substitute(o,n);
     if (staff_sym_l_ == o)
        staff_sym_l_ = n ? (Staff_symbol*) n->spanner():0;
 }
diff --git a/lily/staffline.cc b/lily/staffline.cc
deleted file mode 100644 (file)
index f8bbcd3..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
-  staffline.cc -- implement Line_of_staff
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "staffline.hh"
-#include "scoreline.hh"
-#include "dimen.hh"
-#include "spanner.hh"
-#include "symbol.hh"
-#include "paper-def.hh"
-#include "molecule.hh"
-#include "p-col.hh"
-#include "p-score.hh"
-
-
-
-IMPLEMENT_IS_TYPE_B2(Line_of_staff,Spanner,Horizontal_vertical_group);
index 38f84a48dcae51f548e65184d439a80439b3fbe8..70fca43bf7005a2a3a14b96b0642074533fc7831 100644 (file)
@@ -43,7 +43,7 @@ Stem_beam_engraver::do_try_request(Request*req_l)
        if (bool(beam_p_ ) == bool(mus_l->beam()->spantype == Span_req::START))
            return false;
        
-       if (beam_req_l_ && Beam_req::compare(*beam_req_l_ , *mus_l->beam()))
+       if (beam_req_l_ && beam_req_l_ ->equal_b(mus_l))
            return false;
        
        beam_req_l_ = mus_l->beam();
@@ -55,7 +55,7 @@ Stem_beam_engraver::do_try_request(Request*req_l)
            get_staff_info().time_C_->whole_in_measure_))
            return false;
 
-       if (stem_req_l_ && Stem_req::compare(*stem_req_l_, *mus_l->stem()))
+       if (stem_req_l_ && !stem_req_l_->equal_b( mus_l ) )
            return false;
 
        stem_req_l_ = mus_l->stem();
index cf811ddf56025118613ec50b517be066b8026f43..d0f9f8105c72cd8a949f74406b105273cbdfb28f 100644 (file)
@@ -237,7 +237,7 @@ Stem::do_width()const
     if (!print_flag_b_ || abs(flag_i_) <= 4)
        return Interval(0,0);   // TODO!
     Paper_def*p= paper();
-    Interval r(p->lookup_l()->flag(flag_i_).dim.x);
+    Interval r(p->lookup_l()->flag(flag_i_).dim.x());
     r+= stem_xoffset_f_;
     return r;
 }
@@ -270,7 +270,7 @@ Stem::brew_molecule_p()const
            assert(false); 
     }
 
-    out->translate_x(stem_xoffset_f_);
+    out->translate(stem_xoffset_f_, X_AXIS);
     return out;
 }
 
index 29674b58d4909909756f4fa2a724babfe50827ff..8a830276104a917548efb524867af6ad78227a41 100644 (file)
@@ -17,5 +17,5 @@ Symbol::Symbol(String s, Box b)
 String
 Symbol::str()const 
 {
-    return  "symbol(\'"+tex+"\', (" + dim.x.str() + ", " + dim.y.str() + "))";
+    return  "symbol(\'"+tex+"\', (" + dim.x().str() + ", " + dim.y().str() + "))";
 }
index effc9ec53980be945e7cb3ddc4a5ed0132d56682..de06b70477f10154c6b1d063135242f67a210bc2 100644 (file)
 #include "plist.hh"
 #include "audio-column.hh"
 #include "audio-item.hh"
-#include "cursor.tcc"
-#include "list.tcc"
+#include "audio-staff.hh"
 #include "pcursor.tcc"
 #include "plist.tcc"
 
 
-IPL_instantiate(Audio_item);
+IPL_instantiate(Audio_element);
 IPL_instantiate(Audio_column);
 
+
index 356565c4f7293a8e9a77e86960bcc621dbc4baad..c337baf38a1084f4693bdff4e2679a7a6dfca61a 100644 (file)
@@ -24,8 +24,8 @@ Lookup::beam_element(int sidx, int widx, Real slope) const
     bs.tex = substitute_args(bs.tex,args);
     int w = 2 << widx;
     Real width = w PT;
-    bs.dim.x = Interval(0,width);
-    bs.dim.y = Interval(0,width*slope);
+    bs.dim.x() = Interval(0,width);
+    bs.dim.y() = Interval(0,width*slope);
     return bs;
 }
 
@@ -55,8 +55,8 @@ Lookup::rule_symbol(Real height, Real width) const
     args.push(print_dimen(height));
     args.push(print_dimen(width));
     bs.tex = substitute_args(bs.tex,args);
-    bs.dim.x = Interval(0,width);
-    bs.dim.y = Interval(0,height);
+    bs.dim.x() = Interval(0,width);
+    bs.dim.y() = Interval(0,height);
     return bs;
 }
 
@@ -97,8 +97,8 @@ Lookup::beam(Real &slope, Real width) const
     
     Symbol ret;
     ret.tex = m.TeX_string();
-    ret.dim.y = Interval(0,width*slope);
-    ret.dim.x = Interval(0,width);
+    ret.dim.y() = Interval(0,width*slope);
+    ret.dim.x() = Interval(0,width);
     
     return ret;
 }
index c1ba56bd89623823fd400fc0da71ba355dfc1af7..b7c0660a43843b5c98bbd2e78894d879d2f96df4 100644 (file)
@@ -52,8 +52,8 @@ Lookup::half_slur_middlepart(Real &dx, int dir) const
 
     Symbol s;
     
-    s.dim.y = Interval(min(0,0), max(0,0)); // todo
-    s.dim.x = Interval(0,dx);
+    s.dim.y() = Interval(min(0,0), max(0,0)); // todo
+    s.dim.x() = Interval(0,dx);
 
     String f =  String("\\hslurchar");
     f += direction_char(0);
@@ -67,7 +67,7 @@ Lookup::half_slur_middlepart(Real &dx, int dir) const
     f+=String( "{" ) + String( idx ) + "}";
     s.tex = f;
     Atom a(s);
-    a.translate_x(dx/2);
+    a.translate(dx/2, X_AXIS);
     s.tex = a.TeX_string();
 
     return s;
@@ -95,8 +95,8 @@ Lookup::half_slur(int dy, Real &dx, int dir, int xpart) const
     }
        
     Symbol s;
-    s.dim.x = Interval(0,dx);
-    s.dim.y = Interval(min(0,dy), max(0,dy));
+    s.dim.x() = Interval(0,dx);
+    s.dim.y() = Interval(min(0,dy), max(0,dy));
 
 
     String f = String("\\hslurchar");
@@ -156,8 +156,8 @@ Lookup::slur (int dy , Real &dx, int dir) const
     }
     
     Symbol s;
-    s.dim.x = Interval(0,dx);
-    s.dim.y = Interval(min(0,dy), max(0,dy));
+    s.dim.x() = Interval(0,dx);
+    s.dim.y() = Interval(min(0,dy), max(0,dy));
 
     String f = String("\\slurchar") + String( direction_char(y_sign) );
 
@@ -182,7 +182,7 @@ Lookup::slur (int dy , Real &dx, int dir) const
     s.tex = f;
 
     Atom a(s);
-    a.translate_x(dx/2);
+    a.translate(dx/2, X_AXIS);
     s.dim = a.extent();
     s.tex = a.TeX_string();
     return s;    
@@ -209,10 +209,10 @@ Lookup::big_slur(int dy , Real &dx, int dir) const
     Molecule mol;
     mol.add(l);
     Atom a(m);
-    a.translate_y(slur_extra * internote_f);
+    a.translate(slur_extra * internote_f, Y_AXIS);
     mol.add_right(m);
     mol.add_right(r);
-    mol.translate_y( l_dy * internote_f);
+    mol.translate( l_dy * internote_f, Y_AXIS);
     Symbol s;
     s.tex = mol.TeX_string();
     s.dim = mol.extent();
index 9ab7d0a25b5f9d6f21f485d9c40cda432a175dec..39318c909454f389f56b4a125b12a820feb38b60 100644 (file)
@@ -18,7 +18,7 @@ Text_def::width(Paper_def * p) const
 {
     Atom a = get_atom(p,0);
 
-    Real guess_width_f = text_str_.length_i() * a.sym_.dim.x.length(); // ugh
+    Real guess_width_f = text_str_.length_i() * a.sym_.dim.x().length(); // ugh
     Interval i(0, guess_width_f);
     i += - (align_i_ + 1)* i.center();
     return i;
@@ -39,10 +39,11 @@ Text_def::Text_def()
 }
 
 bool
-Text_def::do_equal_b(Text_def const &def)const
+Text_def::do_equal_b(General_script_def const *gdef) const
 {
-    return align_i_ == def.align_i_ && text_str_ == def.text_str_
-       && style_str_ == def.style_str_;
+    Text_def const *def= (Text_def*)gdef;
+    return align_i_ == def->align_i_ && text_str_ == def->text_str_
+       && style_str_ == def->style_str_;
 }
 
 Atom
index 5095b23b3c92e7949e872cc6aa1b57e8af4b34a4..be857aaf808ae1a4861c199aa7eb13d3c4ac0bf2 100644 (file)
@@ -23,9 +23,7 @@ Text_engraver::do_try_request(Request*req_l)
     Musical_req *m = req_l->musical();
     if (!m || ! m->text())
        return false;
-    if (text_req_l_ &&
-       Text_req::compare(*m->text(), *text_req_l_))
-
+    if (text_req_l_ && text_req_l_->equal_b(m))
        return false;
 
     text_req_l_ = m->text();
index 3ae99c40ad1b352ad71fe51d995d682dcb15be96..ad5745f6a5fe9f3fb260d52480592afec66f3314 100644 (file)
@@ -36,7 +36,7 @@ Text_item::do_pre_processing()
 Interval
 Text_item::symbol_height()const
 {
-    return tdef_p_->get_atom(paper(), dir_i_).sym_.dim.y;
+    return tdef_p_->get_atom(paper(), dir_i_).sym_.dim.y();
 }
     
 Molecule*
@@ -51,8 +51,8 @@ Text_item::brew_molecule_p() const
     Molecule* mol_p = new Molecule(a);
 
     if(dir_i_<0 )              // should do something better anyway.
-       mol_p->translate_y( -mol_p->extent().y.left );
-    mol_p->translate_y( pos_i_ * paper()->internote_f());
+       mol_p->translate( -mol_p->extent().y().left , Y_AXIS);
+    mol_p->translate( pos_i_ * paper()->internote_f(), Y_AXIS);
     
     return mol_p;
 }
index 437739019ae8b8346667529b5c3ac35c69b3df58..a9e6f4f25722c0499166e9bb6314bbeb54735094 100644 (file)
@@ -69,7 +69,7 @@ Text_spanner::do_pre_processing()
 Interval
 Text_spanner::height()const
 {
-    return brew_molecule_p()->extent().y;
+    return brew_molecule_p()->extent().y();
 }
 
 void
diff --git a/lily/timing-grav.cc b/lily/timing-grav.cc
new file mode 100644 (file)
index 0000000..97d7c92
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+  timing-grav.cc -- implement Timing_engraver
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#if 0
+
+#include "timing-grav.hh"
+#include "command-request.hh"
+
+
+Timing_engraver::Timing_engraver()
+{
+    default_grouping_ = Rhythmic_grouping(MInterval(0,4),4); // ugh
+}
+
+void
+Timing_engraver::fill_staff_info(Staff_info &inf)
+{
+    inf.time_C_ = &time_;
+    inf.rhythmic_C_ = &default_grouping_;
+}
+
+
+#endif
index 4ba8b7c5a4d69f566273907571113be9c4e20a20..7ebf647c34094df89c7a08f354e6b335880ff01f 100644 (file)
@@ -27,6 +27,13 @@ Vertical_align_element::do_substitute_dependency(Score_elem*o,Score_elem*n)
        else
            elem_l_arr_.del(i);
 }
+
+/**
+  Align elements top to bottom. 
+  The first element has its top at y =0.0 afterwards
+
+  TODO configurable, like Horizontal_align_item
+ */
 void
 Vertical_align_element::do_post_processing()
 {
@@ -41,7 +48,7 @@ Vertical_align_element::do_post_processing()
 
     Real where_f=0;
     for ( int i=0 ;  i < elem_l_arr_.size(); i++) {
-       elem_l_arr_[i]->translate_y( - dims[i][1] - where_f);
+       elem_l_arr_[i]->translate( - dims[i][1] - where_f, Y_AXIS);
        where_f += dims[i].length();
     }
 }
index c6690f6ef1917b3d4fe16e554f8a7cd6709dba42..1ab374c1d8de0892c72183d5a66830589eddb11e 100644 (file)
@@ -35,8 +35,8 @@ void
 Vertical_align_engraver::acknowledge_element(Score_elem_info i)
 {
     if ( i.origin_grav_l_arr_.size() == 2 && 
-        i.elem_l_->is_type_b(Vertical_group::static_name()) &&
-        !i.elem_l_->y_group_l_   ) {
+        i.elem_l_->is_type_b(Vertical_group_element::static_name()) &&
+        !i.elem_l_->axis_group_l_a_[Y_AXIS]   ) {
        assert( !valign_p_->contains_b(  i.elem_l_) );
 
        valign_p_->add ( i.elem_l_ );
index d858349ca59bd5f7de0c2b124d6afc7d0cee9a76..2e11db74207ec83dabd550be07a2a953205c977d 100644 (file)
 #include "item.hh"
 #include "p-col.hh"
 
-/**
-  Uncouple all elements of this Vertical_group. Ugh!
- */
-void
-Vertical_group_spanner::remove_all()
-{
-    for (int i=0; i < elem_l_arr_.size(); i++){
-       elem_l_arr_[i]->y_group_l_ = 0;
-    }
-    elem_l_arr_.set_size(0);
-    junk_dependencies();   
-}
-
-void
-Vertical_group_spanner::do_break_processing()
-{
-    set_my_columns();
-    if ( line_l() ) {
-       return;
-    }
-    break_into_pieces( false );
-
-    Link_array<Score_elem> elem_l_arr = elem_l_arr_;
-    remove_all();
-    
-    
-    
-    for (int i=0; i < elem_l_arr.size(); i++) {
-       Score_elem * elt = elem_l_arr[i];
-       Line_of_score *elt_line = elt->line_l();
-       
-       if  ( elt-> y_group_l_ )
-           continue;
-       
-       if ( ! elt_line ){ 
-           if (elt->spanner()) {
-               Spanner * sp = elt->spanner();
-               
-               for (int j =0; j < broken_into_l_arr_.size(); j++) {
-                   Vertical_group_spanner * my_broken_l
-                        = (Vertical_group_spanner*)broken_into_l_arr_[j];
-                   
-                   Spanner * broken_span_l 
-                       = sp->find_broken_piece(my_broken_l->line_l());
-                   
-                   if (broken_span_l) {
-                       my_broken_l->add_element(broken_span_l );
-                   }
-               }
-           } else if (elt->item() && elt->item()->pcol_l_->breakpoint_b()
-                      && elt->item()->break_status_i() == 0) {
-               for (int j =0; j < 2; j++) {
-                   Item * my_item = elt->item()->broken_to_a_[j];
-                   Line_of_score * item_line_l_ = my_item->line_l() ;
-                   if ( ! item_line_l_ ) 
-                       continue;
-                   
-                   Vertical_group_spanner * v
-                       = (Vertical_group_spanner*)find_broken_piece( item_line_l_);
-                   if (v) {
-                       v->add_element( my_item );
-                   }
-               }
-           }
-       } else {
-           Vertical_group_spanner * my_broken_l
-               = (Vertical_group_spanner*)find_broken_piece( elt->line_l() );
-           my_broken_l->add_element( elt );
-       }
-    }
-    for (int j =0; j < broken_into_l_arr_.size(); j++) 
-       broken_into_l_arr_[j]->break_processing();      
-}
-
-Vertical_group_spanner::Vertical_group_spanner()
-{
-}
-
-void
-Vertical_group_spanner::do_print() const
-{
-    Vertical_group::do_print();
-}
-
-
-
-IMPLEMENT_IS_TYPE_B2(Vertical_group_spanner, Spanner, Vertical_group);
-
-Vertical_group_spanner::Vertical_group_spanner(Vertical_group_spanner const &s)
-    : Spanner(s), Vertical_group(s)
-{
-}
+IMPLEMENT_IS_TYPE_B2(Vertical_group_spanner, Axis_group_spanner, Vertical_group_element);
index 99e0bbf008833fa599918532b265f524c33edf12..2f4197f2086653d4fd107356841b5d87538d5d7a 100644 (file)
@@ -16,7 +16,7 @@ depth = ..
 # identify module:
 #
 NAME = make
-
+SUBDIRS = debian
 
 # list of distribution files:
 
@@ -24,6 +24,7 @@ NAME = make
 # configure and make.
 EXTRA_DISTFILES = Configure_variables.make.in lilypond.spec.in Toplevel.make.in \
        lilypond.lsm.in $(outdir)/lilypond.spec $(outdir)/lilypond.lsm
+
 #
 
 # generic variables:
index 07e44b7041b3908667c160af6fe362ef5dbc7d22..a09bf62d74924c637c7c1f531c492499bf38d9a0 100644 (file)
@@ -12,7 +12,7 @@
 
 # so why does make still consider xx.y : RCS/xx.y,v ?
 # there is no suffix ,v anymore!
-.SUFFIXES: .cc .o .hh .y .l .pod .text .1 .dep .html
+.SUFFIXES: .cc .o .hh .y .l  .dep
 
 
 # compile rules:
index 206e2c02679160be445ac73204716ac5094c754f..d84b62e30432f8b31915b137c62d0d68ab57e766 100644 (file)
@@ -8,7 +8,7 @@
 #      Han-Wen Nienhuys <hanwen@stack.nl>
 
 .PHONY : all clean config default dist doc doc++ dummy exe help lib TAGS html\
-       check-flower-deps check-lily-deps check-doc-deps
+       check-flower-deps check-lib-deps check-doc-deps
 
 # target all:
 #
@@ -123,7 +123,7 @@ doc:
 
 # doc++ documentation of classes
 doc++: $(progdocs)     
-       doc++ -k -p -d $(DOCDIR) $^
+       $(docxx) $(docxx-opts) -d $(DOCDIR) $^
 
 # ugh. should generate in out/
 dist:
@@ -224,7 +224,7 @@ $(LIBFLOWER): check-flower-deps
 check-flower-deps:
        $(MAKE)  -C $(depth)/flower/ default
 
-check-lily-deps: check-flower-deps
+check-lib-deps: check-flower-deps
        $(MAKE)  -C $(depth)/lib
 
 check-doc-deps:
index b601cbd8a45afdafcda3a59979463583f4869d01..c1a022fa1981a41f4f3399c1ee8644caecb2f74c 100644 (file)
@@ -157,9 +157,6 @@ RANLIB_COMMAND=$(RANLIB) $@
 
 DO_CXX_COMPILE=$(DODEP)\
        $(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION) 
-# "CC = $(CC)"
-# "CXX = $(CXX)"
-#
 
 # linker:
 #
@@ -205,7 +202,8 @@ DOCDIR=$(depth)/$(outdir)
 
 # .hh should be first. Don't know why
 # take some trouble to auto ignore sources and obsolete stuff.
-progdocs=$(shell $(FIND) ./ -name '*.hh' |egrep -v '$(OUTDIR_NAME)') $(shell $(FIND) ./ -name '*.cc'|egrep -v '$(OUTDIR_NAME)')
+progdocs=$(shell $(FIND) ./ -name '*.hh' |egrep -v '$(OUTDIR_NAME)') \
+       $(shell $(FIND) ./ -name '*.cc' |egrep -v '$(OUTDIR_NAME)') \
 
 
 pod2html=pod2html
@@ -221,3 +219,7 @@ endif
 # substitute $(STRIP) in Site.make if you want stripping
 DO_STRIP=true
 
+
+docxx-opts=-S -k -p
+docxx=doc++
+
diff --git a/make/debian/Makefile b/make/debian/Makefile
new file mode 100644 (file)
index 0000000..a09a412
--- /dev/null
@@ -0,0 +1,20 @@
+depth = ../..
+
+NAME= debian
+
+# generic variables:
+#
+include ./$(depth)/make/Variables.make
+include ./$(depth)/make/Files.make 
+#
+
+# generic targets and rules:
+#
+include ./$(depth)/make/Targets.make
+include ./$(depth)/make/Rules.make
+#
+
+
+EXTRA_DISTFILES = README.debian.ex changelog control\
+       copyright dirs diversions.ex docs examples info.ex menu.ex postinst\
+       postrm rules watch
diff --git a/make/debian/README.debian.ex b/make/debian/README.debian.ex
new file mode 100644 (file)
index 0000000..99296fb
--- /dev/null
@@ -0,0 +1,6 @@
+lilypond for DEBIAN
+-------------------
+
+Comments regarding the Package
+
+Anthony Fok <foka@gpu.srv.ualberta.ca>, Wed,  6 Aug 1997 02:14:59 -0600
diff --git a/make/debian/changelog b/make/debian/changelog
new file mode 100644 (file)
index 0000000..c8fea56
--- /dev/null
@@ -0,0 +1,10 @@
+lilypond (0.1.0-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Anthony Fok <foka@gpu.srv.ualberta.ca>  Wed,  6 Aug 1997 04:40:57 -0600
+
+Local variables:
+mode: debian-changelog
+add-log-mailing-address: "foka@gpu.srv.ualberta.ca"
+End:
diff --git a/make/debian/control b/make/debian/control
new file mode 100644 (file)
index 0000000..cd13df8
--- /dev/null
@@ -0,0 +1,22 @@
+Source: lilypond
+Section: tex
+Priority: contrib/optional
+Maintainer: Anthony Fok <foka@gpu.srv.ualberta.ca>
+Standards-Version: 2.2.0.0
+
+Package: lilypond
+Architecture: any
+Depends: ${shlibs:Depends}
+Recommends: tetex-base, musixtex | musixtex-fonts
+Description: GNU LilyPond -- A preprocessor to make TeX typeset music.
+ GNU 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 beams,
+ slurs, triplets, multiple voices.
+ .
+ Note: LilyPond uses the fonts from MusiXTeX.  Please install the package
+       musixtex or musixtex-fonts when you install lilypond.  :)
+ .
+  URL: http://www.stack.nl/~hanwen/lilypond/
+  Authors: Han-Wen Nienhuys <hanwen@stack.nl>
+           Jan Nieuwenhuizen <jan@digicash.com>
diff --git a/make/debian/copyright b/make/debian/copyright
new file mode 100644 (file)
index 0000000..244cda9
--- /dev/null
@@ -0,0 +1,36 @@
+This package was debianized by Anthony Fok foka@gpu.srv.ualberta.ca on
+Wed,  6 Aug 1997 04:30:28 -0600
+
+It was downloaded from
+    ftp://pcnov095.win.tue.nl/pub/lilypond/lilypond-0.1.0.tar.gz
+
+It is also available from:
+    ftp://alpha.gnu.ai.mit.edu/gnu/lilypond-0.1.0.tar.gz
+
+For more informatino about GNU LilyPond, please visit:
+    http://www.stack.nl/~hanwen/lilypond/ for more information.
+
+
+Authors:
+    Han-Wen Nienhuys <hanwen@stack.nl>
+    Jan Nieuwenhuizen <jan@digicash.com>
+Copyright:
+
+  GNU LilyPond is Copyright (C) Free Software Foundation, Inc.
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; version 2 dated June, 1991.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program;  if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave., Cambridge, MA 02139, USA.
+
+  On Debian GNU/Linux systems, the complete text of the GNU General
+  Public License can be found in `/usr/doc/copyright/GPL.gz'.
diff --git a/make/debian/dirs b/make/debian/dirs
new file mode 100644 (file)
index 0000000..2a3cf99
--- /dev/null
@@ -0,0 +1,2 @@
+usr/bin
+usr/lib/texmf/doc
diff --git a/make/debian/diversions.ex b/make/debian/diversions.ex
new file mode 100644 (file)
index 0000000..aebbbe5
--- /dev/null
@@ -0,0 +1 @@
+<FILE> <Diverted to> <Packagename>
diff --git a/make/debian/docs b/make/debian/docs
new file mode 100644 (file)
index 0000000..191b9f8
--- /dev/null
@@ -0,0 +1,3 @@
+Documentation/out/*.text
+Documentation/*.doc
+Documentation/lelie_logo.gif
diff --git a/make/debian/examples b/make/debian/examples
new file mode 100644 (file)
index 0000000..3be67ec
--- /dev/null
@@ -0,0 +1,2 @@
+input/*.ly
+input/*.tex
diff --git a/make/debian/info.ex b/make/debian/info.ex
new file mode 100644 (file)
index 0000000..5a311f0
--- /dev/null
@@ -0,0 +1,15 @@
+# This is a configuration files for installing a .info menu
+# The Description to be placed into the directory
+DESCR="Description"
+
+# The section this info file should be placed in (Regexp) followed by
+# the new section name to be created if the Regexp does not match
+# (Optional. If not given the .info will be appended to the directory)
+#SECTION_MATCH="Regexp"
+#SECTION_NAME="New Section Name"
+
+# The file referred to from the Info directory
+FILE=lilypond.info
+
+# Optional. The files to be copied to /usr/info
+#FILES=*.info
diff --git a/make/debian/menu.ex b/make/debian/menu.ex
new file mode 100644 (file)
index 0000000..179992f
--- /dev/null
@@ -0,0 +1 @@
+text Apps/Misc lilypond none "lilypond Description" /usr/bin/lilypond
diff --git a/make/debian/postinst b/make/debian/postinst
new file mode 100644 (file)
index 0000000..8647e7a
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+set -e
+
+if [ -x /usr/bin/texhash -a -e /usr/lib/texmf/ls-R ]; then
+    texhash
+fi
+
diff --git a/make/debian/postrm b/make/debian/postrm
new file mode 100644 (file)
index 0000000..cca5631
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+set -e
+
+case "$1" in
+    remove)
+        if [ -x /usr/bin/texhash -a -e /usr/lib/texmf/ls-R ]; then
+            texhash
+        fi
+    ;;
+
+    upgrade)
+    ;;
+
+    purge)
+        if [ -x /usr/bin/texhash -a -e /usr/lib/texmf/ls-R ]; then
+            texhash
+        fi
+    ;;
+
+    failed-upgrade|abort-install|abort-upgrade|disappear)
+    ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 0
+    ;;
+esac
diff --git a/make/debian/rules b/make/debian/rules
new file mode 100644 (file)
index 0000000..c27fa64
--- /dev/null
@@ -0,0 +1,57 @@
+#!/usr/bin/make -f
+# Made with the aid of debmake, by Christoph Lameter,
+# based on the sample debian/rules file for GNU hello by Ian Jackson.
+
+package=lilypond
+
+build:
+       $(checkdir)
+       ./configure --enable-checking --disable-debugging \
+               --enable-printing --prefix=/usr --enable-optimize \
+               --enable-shared
+       make all
+
+       touch build
+
+clean:
+       $(checkdir)
+       -rm -f build
+       -make distclean
+       -rm -f {,*/}out/{*,.build} flower/config.{log,status}
+       -rm -f `find . -name "*~"`
+       -rm -rf debian/tmp debian/files* core debian/substvars
+
+binary-indep:  checkroot build
+       $(checkdir)
+# There are no architecture-independent files to be uploaded
+# generated by this package.  If there were any they would be
+# made here.
+
+binary-arch:   checkroot build
+       $(checkdir)
+       -rm -rf debian/tmp
+       install -d debian/tmp
+       cd debian/tmp && install -d `cat ../dirs`
+       make prefix=`pwd`/debian/tmp/usr install
+       ln -fs ../../../doc/lilypond debian/tmp/usr/lib/texmf/doc/lilypond
+# Must have debmake installed for this to work. Otherwise please copy
+# /usr/bin/debstd into the debian directory and change debstd to debian/debstd
+       debstd -m BUGS TODO NEWS DEDICATION ANNOUNCE README
+       dpkg-gencontrol
+       chown -R root.root debian/tmp
+       chmod -R go=rX debian/tmp
+       dpkg --build debian/tmp ..
+
+define checkdir
+       test -f debian/rules
+endef
+
+# Below here is fairly generic really
+
+binary:                binary-indep binary-arch
+
+checkroot:
+       $(checkdir)
+       test root = "`whoami`"
+
+.PHONY: binary binary-arch binary-indep clean checkroot
diff --git a/make/debian/watch b/make/debian/watch
new file mode 100644 (file)
index 0000000..2b1a91d
--- /dev/null
@@ -0,0 +1,5 @@
+# Example watch control file for uscan
+# Rename this file to "watch" and then you can run the "uscan" command
+# to check for upstream updates and more.
+# Site                 Directory       Pattern                 Version Script
+pcnov095.win.tue.nl    /pub/lilypond   lilypond-*.tar.gz       debian  uupdate
index 40fca3decab3272cc0688be9a5ee58789e716308..72d3c71938502fe02e8ce6b6d1b4dc01452693de 100644 (file)
@@ -1,7 +1,7 @@
 Begin3
 Title: LilyPond
-Version: 0.1.1
-Entered-date: 05AUG97
+Version: 0.1.7
+Entered-date: 14AUG97
 Description:   GNU LilyPond is a program which converts music
                definition files into visual or auditive output: it can
                typeset formatted sheet music to a TeX file and and
@@ -14,8 +14,8 @@ Author: hanwen@stack.nl (Han-Wen Nienhuys)
        jan@digicash.com (Jan Nieuwenhuizen)
 Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
 Primary-site: sunsite.unc.edu /pub/Linux/apps
-       340k lilypond-0.1.1.tar.gz 
+       340k lilypond-0.1.7.tar.gz 
 Original-site: pcnov095.win.tue.nl /pub/lilypond/
-       340k lilypond-0.1.1.tar.gz 
+       340k lilypond-0.1.7.tar.gz 
 Copying-policy: GPL
 End
index 604160109c34dc2fa0046a177f65448d9e5dc8e0..93d06809d7fadc4e9c646ecb5ddbedacd9bf31ca 100644 (file)
@@ -1,9 +1,9 @@
 Name: lilypond
-Version: 0.1.1
+Version: 0.1.7
 Release: 1
 Copyright: GPL
 Group: Applications/Publishing
-Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.1.1.tar.gz
+Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.1.7.tar.gz
 Summary: A preprocessor to make TeX typeset music.
 URL: http://www.stack.nl/~hanwen/lilypond
 Packager: Han-Wen Nienhuys <hanwen@stack.nl>
@@ -27,8 +27,8 @@ rm -rf $RPM_BUILD_ROOT
 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/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/links.text Documentation/out/mi2mu.text Documentation/out/mudela-book.text Documentation/out/other-packages.text BUGS TODO NEWS DEDICATION ANNOUNCE README 
-%doc input/beams.ly input/cadenza.ly input/collisions.ly input/coriolan-alto.ly input/header.ly input/keys.ly input/kortjakje.ly input/multi.ly input/pedal.ly input/rhythm.ly input/rock.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/mudela-course.doc Documentation/mudela-man.doc 
+%doc Documentation/out/AUTHORS.text Documentation/out/CodingStyle.text Documentation/out/INSTALL.text Documentation/out/MANIFESTO.text Documentation/out/convert-mudela.text Documentation/out/faq.text Documentation/out/gnu-music.text Documentation/out/index.text Documentation/out/internals.text Documentation/out/language.text Documentation/out/lilypond.text Documentation/out/links.text Documentation/out/literature.text Documentation/out/mi2mu.text Documentation/out/mudela-book.text Documentation/out/mutopia.text Documentation/out/other-packages.text BUGS TODO NEWS DEDICATION ANNOUNCE README 
+%doc input/beams.ly input/cadenza.ly input/collisions.ly input/coriolan-alto.ly input/gallina.ly input/header.ly input/keys.ly input/kortjakje.ly input/multi.ly input/pedal.ly input/rhythm.ly input/scales.ly input/scripts.ly input/scsii-menuetto.ly input/scsii-menuetto.tex input/slurs.ly input/standchen.ly input/standchen.tex input/toccata-fuga-E.ly input/twinkle-pop.ly input/twinkle.ly input/wohltemperirt.ly Documentation/mudela-course.doc Documentation/mudela-man.doc 
 %doc Documentation/lelie_logo.gif
 /usr/bin/convert-mudela
 /usr/bin/mudela-book
index bd430b8aa7f5c7aad4d727c36ca2c604a6dc8e11..704221df8ab047ad5115404326c18f6269f51fb6 100644 (file)
 depth = ..
 #
 
-# identify module:
-#
 NAME = mi2mu
 MODULE_NAME = mi2mu
-#
 
 # generic variables:
 #
@@ -25,7 +22,7 @@ include ./$(depth)/make/Variables.make
 include ./$(depth)/make/Files.make 
 #
 
-# versioning
+# identify module:
 #
 include $(mi2mu-dir)/VERSION
 build = $(mi2mu-dir)/$(outdir)/.build
@@ -49,7 +46,7 @@ EXTRA_DISTFILES = VERSION TODO
 
 # list of custom libraries:
 #
-MODULE_LIBDEPS=check-flower-deps check-lily-deps
+MODULE_LIBDEPS=check-flower-deps check-lib-deps
 MODULE_LIBES=-llily -lflower
 #
 
index 01de76df271305a61d83e14e57651fd8dcc47d17..df3a7ce45afdeed3b9596b81fe5b608b0fa04ef9 100644 (file)
@@ -16,6 +16,8 @@ IMPORTANT
 
 PROJECTS
 
+       * junk one in list vs. array
+
        * write something interesting in mi2mu manual page
 
        * check/use type 0 / 1 / 2 of midi file
index 5596987483e885411df781e0b6cbb62f1255d9ef..22b9eff149db9de3da073571260d946582181667 100644 (file)
@@ -1,6 +1,6 @@
 MAJOR_VERSION = 0
 MINOR_VERSION = 0
-PATCH_LEVEL = 18
+PATCH_LEVEL = 19
 # use to send patches, always empty for released version:
 MY_PATCH_LEVEL = 
 #
index 8c6622d324a41796cc9e0e51a08066c37756350d..755d19fb55e89743ee6b49908267af3dd83283ea 100644 (file)
@@ -9,26 +9,26 @@
 #define LILY_STREAM_HH
 
 /// Lily output
-struct Lily_stream {
-    ostream* os_p_;
-    String filename_str_;
-    int indent_i_;
-    int column_i_;
-    int wrap_column_i_;
-    bool comment_mode_bo_;
-    
+class Lily_stream {
+public:    
     Lily_stream( String filename_str );
     ~Lily_stream();
 
     Lily_stream& operator <<( String str );
     Lily_stream& operator <<( Midi_event& midi_event_r );
 
-    void check_comment( String str );
+private:
     void header();
-    void indent();
-    void newline();
     void open();
-    void tnedni();
+    void output( String str );
+    void output_wrapped( String str );
+
+    ostream* os_p_;
+    String filename_str_;
+    int indent_i_;
+    int column_i_;
+    int wrap_column_i_;
+    bool comment_mode_b_;
 };
 
 #endif // LILY_STREAM_HH
index c25d65831b4308e3e9364c1bb573ed19cbc80a71..3d654ae3df4cae97dd868c8c156b5f480897c917 100644 (file)
@@ -14,6 +14,7 @@ public:
 
        void add_event( Moment mom, Midi_event* midi_event_p );
        Moment end_mom();
+       String id_str();
        String name_str();
        void output_mudela( Lily_stream& lily_stream_r );
        Moment next_begin_mom( Moment now_mom );
index 97fdcaab561d7b12d4891393db8594dbe17c78dd..91824e20988593150d835ec14a92c8a0c21e757f 100644 (file)
@@ -14,7 +14,7 @@ Lily_stream::Lily_stream( String filename_str )
     filename_str_ = filename_str;
     os_p_ = 0;
     indent_i_ = 0;
-    comment_mode_bo_ = false;
+    comment_mode_b_ = false;
     column_i_ = 0;
     wrap_column_i_ = 60;
     open();
@@ -31,49 +31,15 @@ Lily_stream::~Lily_stream()
 Lily_stream&
 Lily_stream::operator <<( String str )
 {
-    static String nobreak_str = "\\`'_-.^<>*@";
+    static String word_sep_str = "{} \t\n";
     while ( str.length_i() ) {
-       int max_i = wrap_column_i_ - column_i_ - 1;
-       int i = str.length_i() - 1 <? max_i;
-       int nl_i = str.left_str( i + 1 ).index_i( '\n' );
-       if ( nl_i != -1 ) {
-           i = nl_i - 1;
-           str = str.nomid_str( nl_i, 1 );
-       }
-
-       if ( ( i != str.length_i() - 1 ) && ( nl_i == -1 ) ) {
-           while ( i && ( isalnum( str[ i ] ) 
-                          || ( nobreak_str.index_i( str[ i ] ) != -1 ) ) )
-               i--;
-
-           if ( !i ) { // no room left
-               if ( column_i_ > 8 * indent_i_ ) {
-                   newline();
-                   if ( comment_mode_bo_ && ( str[ 0 ] != '%' ) )
-                       str = "%" + str;
-                   continue;
-               }
-               else { // cannot break neatly...
-                   i = max_i;
-               }
-           }
-       }
-                               
-       String line = str.left_str( i + 1 ); 
-       str = str.mid_str( i + 1, INT_MAX );
-       *os_p_ << line;
-       column_i_ += line.length_i();
-       if ( nl_i != -1 )
-           newline();
-       else
-           check_comment( line );
-       if ( ( str.length_i() && ( nl_i == -1 ) ) || ( column_i_ >= wrap_column_i_ ) ) {
-           //brr.
-           if ( comment_mode_bo_ )
-               str = "%" + str;
-           newline();
-       }
-    }  
+       int i = str.index_any_i( word_sep_str ) + 1;
+       if ( !i )
+           i = str.length_i();
+       String word = str.left_str( i );
+       str = str.mid_str( i, str.length_i() );
+       output_wrapped( word );
+    }
     return *this;
 }
 
@@ -85,18 +51,6 @@ Lily_stream::operator <<( Midi_event& midi_event_r )
     return *this;
 }
 
-void
-Lily_stream::check_comment( String str )
-{
-    int newline_i = str.index_last_i( '\n' );
-    if ( newline_i != -1 ) {
-       str = str.mid_str( newline_i +1, INT_MAX );
-       comment_mode_bo_ = false;
-    }
-    if ( str.index_i( '%' ) != -1 )
-       comment_mode_bo_ = true;
-}
-
 void
 Lily_stream::header()
 {
@@ -110,23 +64,6 @@ Lily_stream::header()
     // ugh
     *os_p_ << "\\version \"0.1.0\";\n";
 }
-/*
-  snapnie: dit kan toch automaties? Zie ook dstream.
-  */
-void
-Lily_stream::indent()
-{
-    indent_i_++;
-    newline();
-}
-
-void
-Lily_stream::newline()
-{
-    *os_p_ << endl << String( '\t', indent_i_ );
-    column_i_ = indent_i_ * 8;
-    comment_mode_bo_ = false;
-}
 
 void
 Lily_stream::open()
@@ -137,10 +74,70 @@ Lily_stream::open()
 }
 
 void
-Lily_stream::tnedni()
+Lily_stream::output( String str )
+{
+    for ( int i = 0; i < str.length_i(); i++ ) {
+       char c = str[ i ];
+       switch ( c ) {
+           case '{' :
+           case '<' :
+               indent_i_++;
+               column_i_++;
+               *os_p_ << c;
+               break;
+           case '}' :
+           case '>' :
+               assert( indent_i_ );
+               indent_i_--;
+               column_i_++;
+               *os_p_ << c;
+               break;
+           case '%' :
+               comment_mode_b_ = true;
+               *os_p_ << c;
+               column_i_++;
+               break;
+           case '\t' :
+               column_i_ += 8;
+               *os_p_ << c;
+               break;
+           case '\n' :
+               *os_p_ << endl;
+               *os_p_ << String( '\t', indent_i_ );
+               column_i_ = indent_i_ * 8;
+               comment_mode_b_ = false;
+               break;
+           default :
+               column_i_++;
+               *os_p_ << c;
+               break;
+       }       
+    }
+}
+
+void
+Lily_stream::output_wrapped( String str )
 {
-    assert( indent_i_ > 0 );
-    indent_i_--;
-    newline();
+    // enough room left -> doit
+    if ( column_i_ + str.length_i() <= wrap_column_i_ ) {
+       output( str );
+       return;
+    }
+
+    // we're at BOL already; this will never fit -> doit
+    if ( column_i_ == indent_i_ * 8 ) {
+       output( str );
+       return;
+    }
+    
+    // ok, let's wrap
+    // preserve comment mode
+    if ( comment_mode_b_ )
+       output( String( "\n%" ) );
+    else 
+       output( String( "\n" ) );
+    
+    output( str );
 }
 
+
index f447a181dbc21fbd1a3e868df4b5388a016a8391..a50cf55ff658060af1fcccd45a2293d7231cde8b 100644 (file)
@@ -93,7 +93,7 @@ main( int argc_i, char* argv_sz_a[] )
        Getopt_long getopt_long( argc_i, argv_sz_a, long_option_init_a );
 
        String output_str;
-       while ( Long_option_init* long_option_init_p = getopt_long() )
+       while ( Long_option_init const* long_option_init_p = getopt_long() )
                switch ( long_option_init_p->shortname ) {
                case 'b':
                        Duration_convert::no_quantify_b_s = true;
@@ -115,7 +115,7 @@ main( int argc_i, char* argv_sz_a[] )
                        Duration_convert::no_smaller_than_i_s = 32;
                        break;
                case 'o':
-                       output_str = getopt_long.optarg;
+                       output_str = getopt_long.optional_argument_ch_C_;
                        break;
                case 'p':
                        Duration_convert::no_triplets_b_s = true;
@@ -124,7 +124,7 @@ main( int argc_i, char* argv_sz_a[] )
                        level_ver = QUIET_ver;
                        break;
                case 's': {
-                               int i = String_convert::dec2_i( getopt_long.optarg );
+                               int i = String_convert::dec2_i( getopt_long.optional_argument_ch_C_ );
                                if ( !i ) {
                                        identify();
                                        usage();
@@ -152,7 +152,7 @@ main( int argc_i, char* argv_sz_a[] )
        // flag -q must be checked first
        identify();
 
-       char* arg_sz = 0;
+       char const* arg_sz = 0;
        while ( ( arg_sz = getopt_long.get_next_arg() ) ) {
                My_midi_parser midi_parser( arg_sz, & source );
                midi_parser_l_g = &midi_parser;
index f698cde71cda66ae22814ca92b7f24ddc5e353fe..712a5ae9414f42f1a4042c08fbbc869cb48fb1ec 100644 (file)
@@ -175,12 +175,13 @@ Midi_text::mudela_str( bool command_mode_bo )
                || ( text_str_.length_i() != (int)strlen( text_str_.ch_C() ) ) )
                return "";
 
-       return "% " + text_str_ + "\n\t";
+       return "% " + text_str_ + "\n";
 }
 
 Midi_time::Midi_time( int num_i, int den_i, int clocks_4_i, int count_32_i )
-       : sync_dur_( 8 )
 {
+       sync_dur_.type_i_ = 8;
+       
        sync_f_ = 1.0;
        if ( count_32_i != 8 )
                warning( String( "#32 in quarter: " ) + String( count_32_i ));
@@ -192,7 +193,9 @@ Midi_time::Midi_time( int num_i, int den_i, int clocks_4_i, int count_32_i )
 Moment
 Midi_time::bar_mom()
 {
-       return Moment( num_i_ ) * Duration_convert::dur2_mom( Duration( 1 << den_i_ ) );
+    Duration d;
+    d.type_i_ =  1 << den_i_ ;
+       return Moment( num_i_ ) * Duration_convert::dur2_mom( d );
 }
 
 int
index ce33c6bc83d4d18a46f7244efdf7ee79c7bbb104..d28e90734010ce1fa8f763c9a8a31dcb292d51b5 100644 (file)
@@ -148,8 +148,6 @@ the_meta_event:
                                break;
                        case Midi_text::TRACK_NAME:
                                midi_parser_l_g->track_name_str_ = *$2;
-                               while ( midi_parser_l_g->track_name_str_.index_i( ' ' ) != -1 )
-                                       *(midi_parser_l_g->track_name_str_.ch_l() + midi_parser_l_g->track_name_str_.index_i( ' ' ) ) = '_';
                                break;
                        case Midi_text::INSTRUMENT_NAME:
                                midi_parser_l_g->instrument_str_ = *$2;
index 62cc98910fd2453d5a68250336fb70921b55cb95..7b3262045c37a84bfdbc256d2b241427a4b3747f 100644 (file)
@@ -36,42 +36,32 @@ Midi_score::output_mudela( String filename_str )
        for ( PCursor<Midi_track*> i( midi_track_p_list_.top() ); i.ok(); i++ ) {
                tor( NORMAL_ver ) << "track " << track_i++ << ": " << flush;
                i->output_mudela( lily_stream );
-               lily_stream.newline();
+               lily_stream << "\n";
                tor( NORMAL_ver ) << endl;
        }
 
-       lily_stream << "\\score{";
-       lily_stream.indent();
-               lily_stream << " < \\multi 3;";
-               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 << "\\melodic{ ";
-                               lily_stream << "\\$" << i->name_str();
-                               lily_stream << " }";
-                               lily_stream.newline();
-                       }
-                       lily_stream.tnedni();
-                       lily_stream << ">";
-               lily_stream.newline();
-               lily_stream << "\\paper{";
-                       lily_stream.indent();
-                       lily_stream << "unitspace = 20.0\\mm;";
-                       lily_stream.tnedni();
-               lily_stream << "}";
-               lily_stream.newline();
-               lily_stream << "\\midi{";
-                       lily_stream.indent();
-                       // not use silly 0 track
-                       midi_track_p_list_.bottom()->midi_tempo_p_->output_mudela( lily_stream, true );
-                       lily_stream.tnedni();
-               lily_stream << "}";
-               lily_stream.tnedni();
+       lily_stream << "\\score{\n";
+       lily_stream << " < \\multi 3;\n";
+       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 << "\\melodic{ ";
+               lily_stream << "\\$" << i->id_str();
+               lily_stream << " }\n";
+       }
+       lily_stream << ">\n";
+
+       lily_stream << "\\paper{";
+       lily_stream << "unitspace = 20.0\\mm;";
+       lily_stream << "}\n";
+
+       lily_stream << "\\midi{";
+               // not use silly 0 track
+               midi_track_p_list_.bottom()->midi_tempo_p_->output_mudela( lily_stream, true );
+       lily_stream << "}\n";
 
-       lily_stream << "}";
-       lily_stream.newline();
+       lily_stream << "}\n";
 
        return 0;
 }
index f575ccfe68ca8f3445a6392e6d9675ee07a4d5ee..0efb7035010e89dd38b84bafa6c56b903304bd1c 100644 (file)
@@ -125,6 +125,17 @@ Midi_track::get_free_midi_voice_l( Moment mom )
 #endif
 }
 
+String
+Midi_track::id_str()
+{
+       String str = name_str();
+       for ( int i = 0; i < str.length_i(); i++ )
+               if ( ( !i && !isalpha( str[ i ] ) )
+                       || !isalnum( str[ i ] ) )
+                       *( str.ch_l() + i ) = '_';
+       return str;
+}
+
 String
 Midi_track::name_str()
 {
@@ -223,17 +234,12 @@ Midi_track::process()
        tor( DEBUG_ver ) << ":sdne" << endl;
 }
 
-
 void
 Midi_track::output_mudela( Lily_stream& lily_stream_r )
 {
-       lily_stream_r << name_str() << " = \\melodic{";
-       lily_stream_r.indent();
-       lily_stream_r << "% midi copyright:" << copyright_str_;
-       lily_stream_r.newline();
-       lily_stream_r << "% instrument:" << instrument_str_;
-       lily_stream_r.newline();
-
+       lily_stream_r << "$" << id_str() << " = \\melodic{\n";
+       lily_stream_r << "% midi copyright:" << copyright_str_ << "\n";
+       lily_stream_r << "% instrument:" << instrument_str_ << "\n";
 //     int bar_i = 1;
        int bar_i = 0;
 
@@ -333,9 +339,7 @@ Midi_track::output_mudela( Lily_stream& lily_stream_r )
 //     bar_i++;
 //     tor( NORMAL_ver ) << '[' << bar_i << ']' << flush; 
 
-       lily_stream_r.tnedni();
-       lily_stream_r << "} % " << name_str();
-       lily_stream_r.newline();
+       lily_stream_r << "} % " << name_str() << "\n";
 }
 
 
@@ -346,13 +350,12 @@ Midi_track::output_mudela_begin_bar( Lily_stream& lily_stream_r, Moment now_mom,
        Moment into_bar_mom = now_mom - Moment( bar_i - 1 ) * bar_mom;
        if ( bar_i > 1 ) {
                if ( !into_bar_mom )
-                       lily_stream_r << "|";
-               lily_stream_r.newline();
+                       lily_stream_r << "|\n";
        }
        lily_stream_r << "% " << String_convert::i2dec_str( bar_i, 0, ' ' );
        if ( into_bar_mom )
                lily_stream_r << ":" << Duration_convert::dur2_str( Duration_convert::mom2_dur( into_bar_mom ) );
-       lily_stream_r.newline();
+       lily_stream_r << "\n";
 }
 
 
index e3a4c988cca4cbc9e0ab8a20f0244dc5423f7a02..7c86998486b5706902820bb5afb359db24519ee8 100644 (file)
@@ -121,7 +121,8 @@ My_midi_parser::note_end_midi_event_p( int channel_i, int pitch_i, int dyn_i )
 //     running_i64_i64_a_[ channel_i ][ pitch_i ] = -1;
 //     assert( start_i64 != -1 ); // did we start?
 
-       Duration dur( 0 );
+       Duration dur;
+       dur.type_i_ = 0;
        if ( Duration_convert::no_quantify_b_s )
                dur = Duration_convert::ticks2_dur( (I64)now_i64_ - start_i64 );
        else {
index 59c50fb1e4903349f9612d18db2dac734352c4c2..1b38526a5ca1018da5e757c4bdad6c0a3c5c335b 100644 (file)
@@ -2,12 +2,11 @@
 % A tex file to help determine dims.
 %
 
-\font\musicfont=musixsps
-\font\slurfont=xhslu16
+\font\musicfont=musix16
+\font\slurfont=xslu16
 \font\specfont=musixspx
-\def\thefont{\musicfont}
+\def\thefont{\musicfont}
 %\def\thefont{\specfont}
-\def\thefont{\slurfont}
 
 \def\mb#1{{\thefont\char#1}}
 
@@ -21,7 +20,7 @@
         \divide\wid by 2
         \here=-\wid
         \loop\ifdim\here<\wid\advance\here by\inc
-                \hbox to0pt{\kern\here\vrule width0.05pt height 4pt\hss}%
+                \hbox to0pt{\kern\here\vrule width0.05pt height 1pt depth 1pt\hss}%
         \repeat%
 }
 
         \divide\wid by 2
         \here=-\wid
         \loop\ifdim\here<\wid\advance\here by\inc
-                \vbox to0pt{\vskip\here\vrule width2pt height 0.05pt\vss}%
+                \hbox to0pt{\vbox to0pt{\vss\hrule width2pt height 0.05pt\kern\here}\hss}%
         \repeat%
 }
-\def\twhrul{\hbox to 0pt{\hbox{\hruler{20}\vrule
-        width0.1pt height 3ptdepth 1pt}}}
-\def\twvrul{\hbox{\vbox to 20pt{\vruler{20}\vrule
-        width3pt height 0.1pt}}}
+\def\twhrul{\hbox to 0pt{\hbox{\hruler{20}%
+       \vrule width0.1pt height 2pt depth 2pt}}}
+\def\twvrul{\vbox to0pt{\vss\hbox to0pt{\hss\vruler{12}}\vss}%
+       \kern-1pt\vrule width4pt height 0.1pt}%
+       
  
 \def\doitem#1{
-        #1 %
-         %\twvrul%doesn't work
-        \hbox to 50pt{\qquad\twhrul\mb{#1}\hss}\setbox0=\hbox{\mb{#1}} width \the\wd0\ depth \the\dp0 \ height \the\ht0}
+        #1%
+        \vbox to12pt{\vfill\hbox to0pt{\qquad\kern-1pt\twvrul\hss}}%
+        \hbox to50pt{\qquad\twhrul\mb{#1}\hss}%
+       \setbox0=\hbox{\mb{#1}} width \the\wd0\ depth \the\dp0 \ height \the\ht0}
 
 \newcount\n
 \def\charn{\n=-1
index 0c71bea3a17a54b8a4f6aef360fe3035000cab43..e51404f93ee549b9c7c000b7c9f562d7f59ba3c3 100644 (file)
@@ -97,6 +97,7 @@
 \def\ldoubledot{\kern-\notewidth\doubledot}
 \def\ltripledot{\kern-\notewidth\tripledot}
 
+\mdef\turn{67}
 \maccentdef\sforzato{30}{-3/2}
 \maccentdef\marcato{20}{-1/1}
 \maccentdef\imarcato{21}{1/1}
 \mdef\ispicato{29}
 \mdef\upbow{23}
 \mdef\downbow{22}
+
+\def\tr{{\it tr}}