]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 0.0.22 release/0.0.22
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 10 Jan 1997 00:58:03 +0000 (01:58 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 10 Jan 1997 00:58:03 +0000 (01:58 +0100)
133 files changed:
.dstreamrc
Documentation/CodingStyle.pod
Documentation/README.pod
Documentation/lilygut.pod
NEWS
README
Sources.make
Variables.make
flower/NEWS [new file with mode: 0644]
genheader
hdr/beam.hh
hdr/break.hh
hdr/clef.hh
hdr/command.hh
hdr/debug.hh
hdr/getcommand.hh
hdr/grouping.hh
hdr/identparent.hh
hdr/inputcommand.hh
hdr/inputcommands.hh
hdr/inputscore.hh
hdr/inputstaff.hh
hdr/item.hh
hdr/key.hh
hdr/keyitem.hh
hdr/leastsquares.hh
hdr/linespace.hh
hdr/localkeyitem.hh
hdr/lookup.hh
hdr/meter.hh
hdr/moment.hh
hdr/notehead.hh
hdr/paper.hh
hdr/parseconstruct.hh
hdr/pcol.hh
hdr/proto.hh
hdr/pscore.hh
hdr/pstaff.hh
hdr/qlp.hh
hdr/qlpsolve.hh
hdr/request.hh
hdr/sccol.hh
hdr/score.hh
hdr/scoreline.hh
hdr/script.hh
hdr/simplestaff.hh
hdr/simplewalker.hh
hdr/slur.hh
hdr/staff.hh
hdr/staffcommands.hh
hdr/staffelem.hh
hdr/staffline.hh
hdr/stcol.hh
hdr/stem.hh
hdr/swalker.hh
hdr/tex.hh
hdr/timedescription.hh
hdr/tstream.hh
init/Makefile
init/script.ini
init/table_sixteen.ini
kortjakje.ly
lilyponddefs.tex
maartje.ly
pavane.ly
pavane.tex [new file with mode: 0644]
scales.ly [new file with mode: 0644]
src/bar.cc
src/beam.cc
src/boxes.cc
src/break.cc
src/calcideal.cc
src/clef.cc
src/clefitem.cc
src/command.cc
src/debug.cc
src/getcommands.cc
src/grouping.cc
src/inputcommand.cc
src/inputcommands.cc
src/inputscore.cc
src/inputstaff.cc
src/item.cc
src/key.cc
src/keyitem.cc
src/leastsquares.cc
src/lexer.l
src/linespace.cc
src/linestaff.cc
src/localkeyitem.cc
src/lookup.cc
src/meter.cc
src/molecule.cc
src/note.cc
src/notehead.cc
src/paper.cc
src/parser.y
src/pcol.cc
src/pscore.cc
src/pstaff.cc
src/qlp.cc
src/qlpsolve.cc
src/request.cc
src/rest.cc
src/rhythmstaff.cc
src/sccol.cc
src/score.cc
src/scoreline.cc
src/scores.cc
src/script.cc
src/simpleprint.cc
src/simplestaff.cc
src/simplewalker.cc
src/slur.cc
src/staff.cc
src/staffcommands.cc
src/staffelem.cc
src/staffline.cc
src/stcol.cc
src/stem.cc
src/swalker.cc
src/symbol.cc
src/template1.cc
src/template2.cc
src/template3.cc
src/tex.cc
src/texbeam.cc
src/textdef.cc
src/timedescription.cc
src/voice.cc
src/warn.cc
src/wordwrap.cc
titledefs.tex [new file with mode: 0644]

index 8a79bb8f834af4d61e7a622bef83cfd4a09ac569..0c3afc09bd245376c5842f6540d6589c8901f059 100644 (file)
@@ -3,7 +3,7 @@
 My_flex_lexer          1
 yyFlexLexer            1
 PCol                   1
-Score_column           1
+Score_column           0
 Ineq_constrained_qp    1
 Spacing_problem        0
 Colinfo                        0
@@ -21,18 +21,18 @@ parse_duration              1
 parse_pitchmod         1
 Col_configuration      1
 Request                        1
-Note_req               1
+Note_req               0
 Rhythmic_req           1
 Rest_req               1
 delete_identifiers     1
 Command                        1
 Staff_commands         1
 Stem                   1
-Staff                  1
+Staff                  0
 Score                  1
-Voice                  1
-Voice_element          1
+Voice                  0
+Voice_element          0
 Input_cursor           1
 Commands_at            1
-Input_command          1
-Time_description       1       
\ No newline at end of file
+Input_command          0
+Time_description       1
\ No newline at end of file
index a0ffcaf4ea3ca37d2ccbb70daa11cabf96df5c70..995188dec2fe1b6d4ebbb3275a14e1d75a52e78a 100644 (file)
@@ -6,8 +6,6 @@ CodingStyle - standards while programming for LilyPond
 
 Please use these standards while doing programming for LilyPond
 
-
-
 Functions and methods do not return errorcodes, but use assert for
 checking status. 
 
@@ -33,16 +31,16 @@ in emacs:
 
 =head2 DATA MEMBERS
 
-       Class::member
-
-if the member's name resembles its type, then I use
+       Class::member()
+       Class::member_type_()
 
-       class Fubular { ..}
-
-       Class::fubular_
+the C<type> is a Hungarian notation postfix
 
 =head2 COMMENTS
 
+The source is commented in the DOC++ style.  Check out doc++ at
+F<http://www.ZIB-Berlin.DE/VisPar/doc++/doc++.html>
+
        /// short description
        class Class {
                ///
index 6ced7dae173e87eec2424c948a487771408c7a7b..750aa773ea77ec72aff46e4999fe62e1addf1d4b 100644 (file)
@@ -9,25 +9,134 @@ Lilypond - a music typesetter
 =head1 DESCRIPTION
 
 LilyPond typesets music. It translates script files (mudela files or
-F<.ly>'s) into TeX input.
+F<.ly>'s) into TeX input.  Typesetting music is a complex task,
+whereas the message that printed music conveys is usually a simple
+one. LilyPond is a try at providing a simple interface for setting
+music LilyPond has these features:
+
+
+=over 5
+
+=item * ASCII script input, with identifiers (for music reuse),
+customizable notenames, customizable fontset
+
+=item *
+multiple staffs in one score
+
+=item *
+multiple stafftypes (melodic, rhythmic)
+
+=item *
+beams, slurs, chords, super/subscripts (accents and text),
+triplets, clef changes, meter changes, general n-plet (triplet,
+quadruplets, etc.)
+
+=item *
+multiple scores within one input file. Each score is output to
+a different file.
+
+=back
+
+=head1 DESIGN CONSIDERATIONS
+
+LilyPond was written with some
+considerations in mind:
+
+=over 5
+
+=item *
+Describing a well-defined language for defining music. We call this
+language (rather arrogantly) The Musical Definition Language (mudela
+for short). LilyPond reads a mudela sourcefile
+and outputs a TeX file.  This musical definition language should:
+
+=over 5
+
+=item 1
+define the musical message of the writer as unambigiously as
+possible.
+
+=item 2
+be easily readable. (as compared to, say, MusixTeX input)
+
+=item 3
+be writable in ASCII (with a simple texteditor).
+
+=back
+
+At this time, the language isn't yet defined precisely. It is evolving as
+LilyPond is getting more complex.
+
+=item *
+We want to provide an easy-to-use interface for typesetting music in
+its broadest sense. This interface should be intuitive from a musical
+point of view. By broadest sense we mean: it is designed for music
+printed left to right in staffs, using notes to designate rythm and
+pitch.
+
+=item *
+LilyPond uses MusiXTeX fonts and TeX for its output. This is not a key
+issue: in a future version, LilyPond might bypass TeX, but at the moment
+TeX is very convenient for producing output.
+
+=item  *
+ Generate high-quality output. Ideally it should be of a professional
+quality. We'd like to render Herbert Chlapiks words, "Fine music
+setting is not possible without a knowledgeable printer,"  untrue.
+
+=item *
+LilyPond does not display notes directly, nor will it be rehacked to be
+used interactively. LilyPond writes output to a file.  It will not be
+extended to play music, or to recognize music.
+
+We're thinking about adding MIDI output, though
+
+=item *
+LilyPond is intended to run on Unix platforms, but it should
+be portable to any platform which can run TeX and the GNU tools
+
+=item *
+LilyPond is free. Commercial windows packages for setting music are
+abundant. Free musicprinting software is scarce.
+
+=item *
+LilyPond is written in GNU C++. It will not be downgraded/ported to fit
+broken systems.
+
+=back
+
+
 
 =head1 OPTIONS
 
+=over 5
+
 =item  B<-d,--debug>,
-debugging
+
+debugging. LilyPond will read the file F<.dstreamrc>, which tells for what functions to produce copious debugging output. 
 
 =item  B<-w,--warranty>,
+
 warranty
 
 =item  B<-o,--output>,
+
 default output file
 
 =item  B<-h,--help>,
+
 help
 
-=head1 LICENSE
+=back
+
+=head1 
+DISCLAIMER & COPYING POLICY
 
-GNU GPL. See file COPYING
+LilyPond is copyright 1996,97 by its authors. LilyPond is
+distributed under the terms of the GNU General Public
+License. LilyPond is provided without any warranty what so ever.
+LilyPond may be freely distributed.  For further information consult
+the GNU General Public License, which is in the file F<COPYING>
 
 =head1 PREREQUISITES
 
@@ -35,37 +144,46 @@ Compilation:
 
 =over 5
 
-=item  - Unix (any decent Linux distribution is fine)
+=item *
+ Unix. Any decent Linux distribution is fine. LilyPond is known to run
+on Linux and Solaris
 
-=item  - GNU C++ v2.7  or better (with libg++ )
+=item *
+ GNU C++ v2.7  or better (with libg++ )
 
-=item  - GNU make.
+=item *
+ GNU make.
 
-=item  - flex (2.5.1 or better)
+=item *
+ flex (2.5.1 or better)
 
-=item  - bison/yacc
+=item *
+bison/yacc
 
-=item  - The "flower" library,
+=item *
+The "flower" library,
 which should be available from the
 same source you got this from.
 
-=item  - perl
+=item *
+perl
 
 =back
 
+
+The Makefile uses  perl for trivial operations,  and you could  tinker
+with it to use sed or awk.
+
 Operation:
 
 =over 5
 
-=item  TeX
+=item *        TeX
 
-=item  the MusixTeX fonts
+=item *        the MusixTeX fonts
 
 =back
 
-The Makefile uses  perl for trivial operations,  and you could  tinker
-with it to use sed or awk.
-
 =head1 COMPILING
 
 Do:
@@ -77,27 +195,48 @@ Do:
        cd lilypond-1.2.13
        make
 
+You might want to edit Variables.make to tailor the compilation flags.
 why G++ >= 2.7? LilyPond & flower lib uses:
 
 =over 5
 
-=item  builtin bool
+=item *
+builtin bool
 
-=item  typeof
+=item *
+typeof
 
-=item  operator <?, operator >?
+=item   *
+operator <?, operator >?
 
-=item  the new for-scope
+=item   *
+the new for-scope
 
-=item  class Rational (libg++)
+=item   *
+class Rational (libg++)
 
-=item  named return values
+=item   *
+named return values
 
 =back
 
-=head1 AUTHOR
+=head1 AUTHORS
+
+=over 5
+
+=item *
+Han-Wen Nienhuys <hanwen@stack.nl>, Main author
+
+=item *
+Jan Nieuwenhuizen <jan@digicash.com>, bits of FlowerLib, general comments.
 
-Han-Wen Nienhuys <hanwen@stack.nl>, <jan@digicash.com>
+=item *
+Mats Bengtsson <matsb@s3.kth.se>, bugfixes, testing.
+
+=back
+
+Your name could be here! If you want to help, then take a look at the
+SMALLISH PROJECTS section of LilyPond. Some do not involve coding C++
 
 =head1 EXAMPLES
 
@@ -133,8 +272,10 @@ Check out kortjakje.ly, it has some comments
 
 =head1 PROBLEMS
 
-If LilyPond bombs out, then please recompile using B<-g>, and send a gdb
-stacktrace of the crash. It also helps if you can print the values of the objects. So if you trace is
+If LilyPond bombs out, then please recompile using B<-g>, and send a
+copy of the input which causes the error and a gdb stacktrace of the
+crash. It also helps if you can print the values of the objects. So if
+you trace is
 
        (gdb) backtrace 12
        #0  Interval::operator+= (this=0x11fffec60..)
@@ -148,7 +289,7 @@ Than it would help if you send a dump of the Interval and the Item
 (use: 'print *this' or use LilyPond print() methods).
 
 This is a beta version of LilyPond. Please send your helpful comments
-and patches to me,
+and patches to me (see AUTHORS section)
 
 LilyPond is updated very frequently, the latest version is always available at:
 
@@ -160,16 +301,11 @@ F<ftp://pcnov095.win.tue.nl/pub/lilypond>
 F<symbol.ini> The initialisation file with symbol tables etc. It
 includes files from the directory F<init/>.
 
-=head1 HOW DOES IT WORK
+=head1 SEE ALSO
 
-=over 5
+lilygut(1), lilyinput(1)
 
-Use The Source, Luke. If you don't know C++, you can try editing
-the file F<.dstreamrc> for copious debugging output. (use B<-d>)
+=head1 REMARKS
 
-the subdir F<Documentation/> contains some more-in-depth matter on LilyPond
-
-The source is commented in the DOC++ style.  Check out doc++ at
-F<http://www.ZIB-Berlin.DE/VisPar/doc++/doc++.html>
-
-=back
+LilyPond has no connection with the music package RoseGarden, other
+than the names being similar.
index 295ed2844ce9b28fa3df1b709282f1c3a6f9696f..20d5f0364bc8a4db4678cc4d8b41fa21460c2755 100644 (file)
@@ -5,7 +5,8 @@ LilyGuts - doco to the internals of LilyPond
 =head1 DESCRIPTION
 
 This page documents some aspects of the internals of 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 stuff comes from e-mail I wrote, some from e-mail others wrote,
+some are large comments taken away from the headers
 
 =head1 OVERVIEW
 
@@ -67,48 +68,53 @@ Different staffs can produce different outputs; a melodious voice
 which is put into a percussion-Staff, will be typeset as the rythm of
 that voice.
 
-After C<Staff> made up her mind (Would C<Staff> be a smart
-name? How about C<struct Susan {}> :-), the resultant items and
+After C<Staff> made up her mind, the resultant items and
 spanners are put on the PScore, and pointers to these items are
 stored in the C<Voice_element>. This construction enables the
 beams/stems to look up the balls it has to connect to. 
 
 =over 5
 
-=item Note_req
+=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>
 
 Staff 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 Staff to decide. The Staff can decide on positioning
+is also for the  C<Staff> to decide. The  C<Staff> can decide on positioning
 based on ottava commands and the appropriate clef.
 
-=item Rest_req
+=item C<Rest_req>
 
 Why a request? It might be a good idea to not typeset the rest, if the
 paper is too crowded.
 
-=item Span_req
+=item C<Span_req>
 
 This type of request typically results in the creation of a C<Spanner>
 
-=item Beam_req
+=item C<Beam_req>
 
 Staff 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  Dynamic
+=item  C<Dynamic>
 
-Each dynamic is bound to one note ( a crescendo spanning multiple
+Each dynamic is bound to one note (a crescendo spanning multiple
 notes is thought to be made of two "dynamics": a start and a stop).
 Dynamic changes can occur in a smaller time than the length of its
-note, therefore fore each Dynamic request carries a time, measured
+note, therefore fore each  C<Dynamic> request carries a time, measured
 from the start of its note.
 
-This subfield would come in handy, if mpp96 was adapted for midi
+This subfield would come in handy, if LilyPond  was adapted for midi
 support.
 
 =back
@@ -145,7 +151,7 @@ This table decribes the proper order for the different commands:
 
 =head1 BREAKING
 
-[Source files: command.hh, scommands.cc]
+[Source files: F<command.hh>, F<scommands.cc>]
 
 BREAKING, PREBREAK POSTBREAK, etc.
 
@@ -226,7 +232,7 @@ This is Columbus' egg: 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
+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
@@ -283,7 +289,6 @@ signifies a "list of". (This is not complete)
 
 [partly by Mark Basinski <basinski@arizona.edu>]
 
-
 Herbert Chlapik, 
 
 W.A. Hegazy and J. S. Gourlay. Optimal line breaking in music. In
diff --git a/NEWS b/NEWS
index def00e3b86bbab1f052242ba134a4c285b8478a1..a2033eb3665e15ea6a448a9e7fc0a34fc1587eed 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,19 +1,34 @@
+pl 22:
+       - doco from mpp
+       - repeat signs
+       - | checks for bar in a voice (Barcheck_req)
+Internal changes:
+       - naming (Hungarian notation, svec vs. Array)
+       - huge memleak fixed; unearthed lots of bugs
+       - bug noteheadswap
+       - cleanup PScore, Score
+       - removed Staff_commands, plugging commands into Staff_column directly
+
 pl 21:
-       - Move breaking stuff into a separate class Break_algorithm
-       - dependencies for Staff_elem's
        - scripts
        - texts
        - nplets (triplets!)
+Internal changes:
+       - Move breaking stuff into a separate class Break_algorithm
+       - dependencies for Staff_elem's
 
 pl 20:
-       - Rational for time measurement
        - updated doco to .pod
+       - include files from .ly
+Internal changes:
+       - Rational for time measurement
        - directionalspanner/textspanner
-       - include files
 
 pl 19:
-       - struct Moment
        - grouping code: LilyPond can set advanced multibeams.
+Internal changes:
+       - struct Moment
+
 
 pl 18:
        - robust Staff_commands
diff --git a/README b/README
index 9b08b5b1e38e7add12ad2efe29e4c8b0a11ecbd1..414facda003d3666a7ea8f290725eaf9547b8ac5 100644 (file)
--- a/README
+++ b/README
@@ -4,4 +4,16 @@ To generate the pretty-printed docs, do this:
 
        make doc
 
-in the top-level dir
\ No newline at end of file
+in the top-level dir
+
+
+======================
+
+NOTE:
+
+LilyPond is a long way from finished and polished. I do appreciate
+criticism, comments, bugreports, patches, etc. Please send e-mail to
+
+       hanwen@stack.urc.tue.nl
+
+Have fun!
\ No newline at end of file
index f274a9ebcd227a86b493f979345ee73493917d76..0be964c269eb5e309252ba96fe578daea28ab1f9 100644 (file)
@@ -22,33 +22,21 @@ hdr=    qlp.hh linespace.hh qlpsolve.hh\
        staffelem.hh idealspacing.hh break.hh\
        scriptdef.hh script.hh textdef.hh textitem.hh
 
-mycc=   qlp.cc qlpsolve.cc leastsquares.cc\
-       inputcommands.cc inputmusic.cc  \
-       inputscore.cc inputstaff.cc inputcommand.cc\
-       timedescription.cc\
-       break.cc linespace.cc molecule.cc staffline.cc\
-       pscore.cc tex.cc item.cc pcol.cc staff.cc \
-       rhythmstaff.cc  score.cc note.cc  main.cc misc.cc\
-       symbol.cc request.cc notename.cc  voice.cc\
-       keyword.cc linestaff.cc table.cc command.cc\
-       warn.cc debug.cc symtable.cc boxes.cc\
-       pstaff.cc  tstream.cc\
-       calcideal.cc scores.cc  \
-       dimen.cc paper.cc lookup.cc staffcommands.cc\
-       sccol.cc stcol.cc getcommands.cc simplestaff.cc\
-       melodicstaff.cc simpleprint.cc\
-       spanner.cc textspanner.cc directionalspanner.cc \
-       notehead.cc  stem.cc \
-       rest.cc bar.cc meter.cc keyitem.cc localkeyitem.cc clefitem.cc\
-       swalker.cc scoreline.cc\
-       simplewalker.cc scriptdef.cc script.cc\
-       texbeam.cc texslur.cc clef.cc key.cc slur.cc beam.cc\
-       idealspacing.cc  grouping.cc identifier.cc\
-       lexerinit.cc mylexer.cc textdef.cc textitem.cc\
-       staffelem.cc wordwrap.cc\
+mycc=bar.cc beam.cc boxes.cc break.cc calcideal.cc clef.cc\
+       clefitem.cc command.cc debug.cc dimen.cc directionalspanner.cc\
+       getcommands.cc grouping.cc idealspacing.cc identifier.cc\
+       inputcommand.cc inputcommands.cc inputmusic.cc inputscore.cc\
+       inputstaff.cc item.cc key.cc keyitem.cc keyword.cc\
+       leastsquares.cc lexerinit.cc linespace.cc linestaff.cc\
+       localkeyitem.cc lookup.cc main.cc melodicstaff.cc meter.cc\
+       misc.cc molecule.cc mylexer.cc note.cc notehead.cc notename.cc\
+       paper.cc pcol.cc pscore.cc pstaff.cc qlp.cc qlpsolve.cc\
+       request.cc rest.cc rhythmstaff.cc sccol.cc score.cc\
+       scoreline.cc scores.cc script.cc scriptdef.cc simpleprint.cc\
+       simplestaff.cc simplewalker.cc slur.cc spanner.cc staff.cc\
+       staffcommands.cc staffelem.cc staffline.cc stcol.cc stem.cc\
+       swalker.cc symbol.cc symtable.cc table.cc tex.cc texbeam.cc\
+       texslur.cc textdef.cc textitem.cc textspanner.cc\
+       timedescription.cc tstream.cc voice.cc warn.cc wordwrap.cc\
        template1.cc template2.cc template3.cc template4.cc\
-       template5.cc\
-       version.cc
-
-
-
+       template5.cc version.cc
\ No newline at end of file
index cd4a663b6ecf025b97a1c85d668a31a1c56ff04e..eea032df7fbcb6c78adce67fe626d661646daa05 100644 (file)
@@ -37,7 +37,7 @@ endif
 # version info
 MAJVER=0
 MINVER=0
-PATCHLEVEL=21
+PATCHLEVEL=22
 VERSION=$(MAJVER).$(MINVER).$(PATCHLEVEL)
 CXXVER=`$(CXX) --version`
 
@@ -77,7 +77,8 @@ DNAME=$(PACKAGENAME)-$(VERSION)
 othersrc=lexer.l parser.y
 SCRIPTS=make_version make_patch genheader
 IFILES=dimen.tex symbol.ini kortjakje.ly pavane.ly  maartje.ly\
-       lilyponddefs.tex test.tex .dstreamrc cadenza.ly
+       lilyponddefs.tex test.tex .dstreamrc cadenza.ly scales.ly\
+       titledefs.tex pavane.tex
 OFILES=Makefile Variables.make Sources.make COPYING README NEWS
 DFILES=$(OFILES) $(IFILES) $(SCRIPTS)
 
diff --git a/flower/NEWS b/flower/NEWS
new file mode 100644 (file)
index 0000000..ae66f7d
--- /dev/null
@@ -0,0 +1,2 @@
+pl 22:
+       - Array::add -> Array::push
\ No newline at end of file
index 739df26c472238744f9f5e1b7613795c4aec7855..f153e3e6ca8f4ebc3d15e0bb50d7c3df72256297 100755 (executable)
--- a/genheader
+++ b/genheader
@@ -1,10 +1,11 @@
 #!/bin/sh
 def=`echo $1 | sed s/\\\./_/ | tr a-z A-Z`
+
 cat << HERE
 /*
   $1 -- part of LilyPond
 
-  (c) 1996 Han-Wen Nienhuys
+  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
 #ifndef $def
index 2fd78100c35d52a612669ca96f3b059f5e8e24ae..912f47dc72005f28867a1b2181b45825e064a294 100644 (file)
@@ -17,9 +17,6 @@ struct Beam:  public Directional_spanner {
     Real left_pos;
     /// dir: -1 below heads, +1 above heads.
 
-
-    Rhythmic_grouping *group;
-
     /****************/
     
     virtual Interval width()const;    
index 4c0f6b33b678bfb09559ed0eff0baf84bb175a06..4475e7d1730e699c9e8a67eeaaae85c7407295fc 100644 (file)
@@ -6,18 +6,18 @@
 
 #ifndef BREAK_HH
 #define BREAK_HH
-#include "vray.hh"
+#include "varray.hh"
 #include "proto.hh"
-typedef svec<PCol*>  Line_of_cols;
+typedef Array<PCol*>  Line_of_cols;
 
 struct Col_configuration {
     Line_of_cols cols;
-    svec<Real> config;
+    Array<Real> config;
     Real energy;
 
     /****************/
     void OK()const;
-    void setsol(svec<Real>);
+    void setsol(Array<Real>);
     Col_configuration() ;
     void add( PCol*c);
     void print() const;
@@ -33,21 +33,21 @@ struct Break_algorithm {
     /// check if the spacing/breaking problem is well-stated
     void problem_OK()const;
     /// search all pcols which are breakable.
-    svec<PCol *> find_breaks() const;
+    Array<PCol *> find_breaks() const;
 
      /// helper: solve for the columns in #curline#.
-    svec<Real> solve_line(Line_of_cols) const;
+    Array<Real> solve_line(Line_of_cols) const;
 
     
     /// does curline fit on the paper?    
     bool feasible(Line_of_cols)const;
     
-    virtual svec<Col_configuration> solve()=0;
+    virtual Array<Col_configuration> solve()=0;
 };
 
 /// wordwrap type algorithm: move to next line if current is optimal.
 struct Word_wrap : Break_algorithm {
-    virtual svec<Col_configuration> solve();
+    virtual Array<Col_configuration> solve();
     Word_wrap(PScore&);
 };
 #endif // BREAK_HH
index 243ea6ebdd8f9e1a8a9fe37b1ac53115a71f717c..3b61ca3bc76f739e5fc92752b32ec0e01b2842c2 100644 (file)
@@ -7,14 +7,14 @@
 #ifndef CLEF_HH
 #define CLEF_HH
 #include "scalar.hh"
-#include "vray.hh"
+#include "varray.hh"
 
 struct Clef {
     int c0_pos;
     String clef_type;
 
     Clef();
-    void read(svec<Scalar> args);    
+    void read(Array<Scalar> args);    
 };
 #endif // CLEF_HH
 
index 43d016bbeeaeb6c73fd64922db455cf1ef54b203..d4dda9411c4735844e9e6ad6bd7ddd92ddffda17 100644 (file)
@@ -2,7 +2,7 @@
 #define COMMAND_HH
 
 #include "glob.hh"
-#include "vray.hh"
+#include "varray.hh"
 #include "scalar.hh"
 
 enum Commandcode {
@@ -17,7 +17,7 @@ struct Command {
     Commandcode code;
 
     /// analogous to argv[]
-    svec<Scalar> args;
+    Array<Scalar> args;
 
     ///
     int priority;
index 1d1ae745c31f6344335e4459e73d392124bcacf2..2f5c4ba47e48a65680f88101323c76d2b4d2bb4e 100644 (file)
@@ -6,7 +6,6 @@
 #include "real.hh"
 
 void error(String s);          // errors
-void error_t(String s, Real when);
 
 // warnings
 void warning(String s);
index 79e6bd407a2b9f5c85fc0e02743a305ae15f6aaa..e2ce456cf79acec76d25fecd674b6309ca2f9e40 100644 (file)
@@ -10,7 +10,9 @@
 
 
 Command* get_meter_command(int,int);
+Command get_defaultbar_command();
 
+void split_bar_command(Command &pre_com, Command &no_break_com, Command &post_com,String s);
 
 
 #endif // GETCOMMAND_HH
index 9541123b9ee2174c3fb874fd822dc12b6cc70573..6e13f3217e54bfa29938e47d0e273fa96359dc60 100644 (file)
@@ -9,19 +9,19 @@
 
 #include "moment.hh"
 #include "interval.hh"
-#include "vray.hh"
+#include "varray.hh"
 
 typedef Interval_t<Moment> MInterval;
 
 /// data structure which represents rhythmic units 
 struct Rhythmic_grouping {    
     
-    svec<Rhythmic_grouping*> children;
+    Array<Rhythmic_grouping*> children;
     MInterval *interval_;
     
     /****************/
 
-    svec<MInterval> intervals();
+    Array<MInterval> intervals();
     MInterval interval()const;
     Moment length() const;
     void intersect(MInterval);
@@ -30,19 +30,19 @@ struct Rhythmic_grouping {
     Rhythmic_grouping(Rhythmic_grouping const&);
     Rhythmic_grouping(MInterval, int n=1);
     Rhythmic_grouping();
-    Rhythmic_grouping(svec<Rhythmic_grouping*>);
+    Rhythmic_grouping(Array<Rhythmic_grouping*>);
     ~Rhythmic_grouping();
 
     void add_child(Moment start, Moment len);
 
     void split(Rhythmic_grouping r);
-    void split(svec<MInterval>);
+    void split(Array<MInterval>);
     void split(int n);
 
     void print() const;
     void OK() const;
 
-    svec<int> generate_beams(svec<int>, int&);
+    Array<int> generate_beams(Array<int>, int&);
 
 private:
     void init();
index 653158da4d90d43f717b0e50bb43ab056746ceb2..f4e1705d4152e24466485eeaf8d02157a65acc16 100644 (file)
@@ -28,6 +28,8 @@ struct Identifier {
     IDACCESSOR(Music_general_chord, mchord)
     IDACCESSOR(Lookup,lookup)
     IDACCESSOR(Notename_tab, notename_tab)
+private:
+    Identifier(Identifier const&){}
 };
 #endif // IDENTPARENT_HH
 
index 639b6542e1e6582e127905f84f152fa0b8102d52..61f968ee53cbea66cc8f35781fffefab9749d2d0 100644 (file)
@@ -8,27 +8,26 @@
 #define INPUTCOMMAND_HH
 #include "proto.hh"
 #include "scalar.hh"
-#include "vray.hh"
+#include "varray.hh"
 #include "moment.hh"
 
 struct Input_command {
     /// analogous to argv[]
-    svec<Scalar> args;
+    Array<Scalar> args;
     void print()const;
     Input_command();
 
     operator Command();
 };
-
-Input_command* get_meterchange_command( int,int);
-Input_command* get_key_interpret_command(svec<int >);
-Input_command* get_clef_interpret_command(String w);
+Input_command *get_meterchange_command( int,int);
+Input_command *get_key_interpret_command(Array<int >);
+Input_command *get_clef_interpret_command(String w);
 Input_command *get_reset_command();
 Input_command *get_partial_command(Moment u);
 Input_command *get_skip_command(int,Moment);
-Input_command *get_grouping_command(svec<int>);
-Input_command *get_bar_command( );
-
-svec<int> get_default_grouping(int count);
+Input_command *get_grouping_command(Array<int>);
+Input_command *get_bar_command(String);
+Input_command *get_newmeasure_command();
+Array<int> get_default_grouping(int count);
 #endif // INPUTCOMMAND_HH
 
index e2c487f2042b9ee43d98998d867409f1497609ea..20e6a1cb06ecf8cbc519c4ae0f3b13a8e67dd05e 100644 (file)
@@ -53,7 +53,7 @@ struct Input_commands : public IPointerList<Commands_at*> {
 
     void reset();
     void print()const;
-    Staff_commands *parse() const;
+    void parse(Staff *) const;
 };
 
 #endif // INPUTCOMMANDS_HH
index a34e6d957944d9fcb8c97ae55d6236dc2644392d..39e6a367fdce4f23f0db53067b17ca7b7e8cc74b 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef ISCORE_HH
 #define ISCORE_HH
-#include "vray.hh"
+#include "varray.hh"
 #include "proto.hh"
 #include "plist.hh"
 
@@ -14,8 +14,8 @@ struct Input_score {
     
     /****************************************************************/
     Input_score();
-    Input_score(Input_score&);
-    void add(svec<Input_command*> &s);
+    Input_score(Input_score const&);
+    void add(Array<Input_command*> &s);
     void add(Input_staff*);
     ~Input_score();
     /// construction
index e2caea7dc2b0e5ec56e6a82bbb4a87662f66e713..6fac2046434e417069f64f352c352a44ffc698b6 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "string.hh"
 #include "plist.hh"
-#include "vray.hh"
+#include "varray.hh"
 #include "proto.hh"
 
 struct Input_staff {
@@ -22,10 +22,9 @@ struct Input_staff {
     void add(Input_music*m);
     Input_staff(Input_staff&);
     Input_staff(String);
-    void add(svec<Input_command*> &s);
-    Staff* parse(PointerList<Input_command*>);
+    void add(Array<Input_command*> &s);
+    Staff* parse(PointerList<Input_command*>, Score*);
     void print() const;
 };
 
 
index 516a7b8f9eec378ee4b8f2439c41797bae544032..9b234819ec44e9ebe9d83e6bc2d23a6b06969563 100644 (file)
@@ -10,7 +10,7 @@
 /// a horizontally fixed size element of the score
 struct Item : Staff_elem {
     /// indirection to the column it is in
-    PCol * pcol_;
+    PCol * pcol_l_;
 
     /****************/
     
index f0141d688f58c3238c43a89e65d636228ef48ad5..791c0861cf880e69d030b540f382bca48ecde5ab 100644 (file)
@@ -7,17 +7,17 @@
 #ifndef KEY_HH
 #define KEY_HH
 
-#include "vray.hh"
+#include "varray.hh"
 #include "scalar.hh"
 
 class Key {
-    svec<int> accidentals;
+    Array<int> accidentals;
 
     /****************/
 
 public:
-    svec<int> read(svec<Scalar> );
-    svec<int> oldkey_undo(svec<Scalar>);
+    Array<int> read(Array<Scalar> );
+    Array<int> oldkey_undo(Array<Scalar>);
 
     Key();
     void set(int i, int acc);
@@ -31,7 +31,7 @@ struct Local_key
     Local_key();
 
 private:
-    svec<Key> octaves;
+    Array<Key> octaves;
 };
 
 #endif // KEY_HH
index ffd0abeb9da7a4060743f906b44b0d041858d16e..43ce9ca0a7fa7bf56c3cf20b40329233fdd08b7d 100644 (file)
@@ -8,12 +8,12 @@
 #define KEYITEM_HH
 
 #include "item.hh"
-#include "vray.hh"
+#include "varray.hh"
 
 /// 
 struct Keyitem : Item {
-    svec<int> pitch;
-    svec<int> acc;
+    Array<int> pitch;
+    Array<int> acc;
     int c_position;
 
     
@@ -21,7 +21,7 @@ struct Keyitem : Item {
     
     Keyitem(int cposition);
     void add(int pitch, int acc);
-    void read(svec<int> k);
+    void read(Array<int> k);
 
     void preprocess();
 
index 105efd0aa714ed3d3869450edb2a0a2687b796d7..e7368e398bfacbaedbb12e17eab66677c6dd3955 100644 (file)
@@ -6,11 +6,11 @@
 
 #ifndef LEASTSQUARE_HH
 #define LEASTSQUARE_HH
-#include "vray.hh"
+#include "varray.hh"
 #include "offset.hh"
 
 struct Least_squares {
-    svec<Offset> input;
+    Array<Offset> input;
     void minimise(Real &coef, Real &offset);
 };
 
index 75f4b9fb742733d3322d8c880ab88ff434387ad7..50f13bd35cfd6deaacd5bbf209077a8cb0621fc5 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "glob.hh"
 #include "plist.hh"
-#include "vray.hh"
+#include "varray.hh"
 #include "vector.hh"
 #include "interval.hh"
 
@@ -29,8 +29,8 @@ struct Colinfo {
 
 /// spacing for one line.
 class Spacing_problem {
-    svec<const Idealspacing*> ideals;
-    svec<Colinfo> cols;
+    Array<const Idealspacing*> ideals;
+    Array<Colinfo> cols;
 
     /// the index of #c# in #cols#
     int col_id(const PCol *c) const;
@@ -51,7 +51,7 @@ class Spacing_problem {
 
 public:
     /// solve the spacing problem
-    svec<Real> solve() const;
+    Array<Real> solve() const;
     /**
     return the column positions, and the energy (last element)
     */
index 05a468b973a625a1782588c6e72b5249bc152bbd..6276977b776f1ccab8427d6a7bd60ebeee70b8e8 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef LOCALKEYITEM_HH
 #define LOCALKEYITEM_HH
 #include "item.hh"
-#include "vray.hh"
+#include "varray.hh"
 
 struct Local_acc {
     int name , acc, octave;
@@ -15,8 +15,8 @@ struct Local_acc {
 };
 
 struct Local_key_item : Item {
-    svec<Local_acc> accs;
-    svec<Notehead*> group;
+    Array<Local_acc> accs;
+    Array<Notehead*> group;
     int c0_position;           // move into walker
 
     /****************/
index 5fa14d57a891f79ae31afbc56e395a6a815956cb..f947a7d734f7ac9a4f8cee3aafd5c8c2945e6a52 100644 (file)
@@ -28,7 +28,7 @@ struct Lookup {
       pos == -3: below staff
       */
 
-    Symbol meter(svec<Scalar>);
+    Symbol meter(Array<Scalar>);
     Symbol stem(Real y1_pos, Real y2_pos);
     Symbol rule_symbol(Real height, Real width);
     Symbol accidental(int);
index 33838c15258e3131ea1caae3722e626ca1ed996a..ca364cf59c47f535b5491c10d0760180c770b61b 100644 (file)
@@ -7,13 +7,13 @@
 #ifndef METER_HH
 #define METER_HH
 #include "item.hh"
-#include "vray.hh"
+#include "varray.hh"
 
 struct Meter: Item {
-    svec<Scalar> args;
+    Array<Scalar> args;
     /****************/
     
-    Meter(svec<Scalar> args) ;
+    Meter(Array<Scalar> args) ;
     Molecule*brew_molecule() const;
 };
 #endif // METER_HH
index 332774138486bc6fd3f6bd52e32716f3ebe90768..1f34eae5abf04bdd47166a2fc7d49075cc8873f2 100644 (file)
@@ -1,13 +1,14 @@
 /*
-  (c) 1996 Han-Wen Nienhuys
+  (c) 1996,97 Han-Wen Nienhuys
 */
 
 #ifndef MOMENT_HH
 #define MOMENT_HH
 
 #include "rational.hh"
-
+class String;
 typedef Rational Moment;
+void error_t(String const &s, Moment when);
 
 #endif // 
 
index be0a345283dcb847afb4c0588efec372e21b8ff4..860d16280d39d004c08dfc337ee2421e4701e249 100644 (file)
@@ -12,7 +12,8 @@
 struct Notehead : public Item
 {
     int position;
-
+    /// -1 = lowest, 0 = inside, 1 = top
+    int extremal;
     /// needed for the help-lines
     int staff_size;
     int dots;
index 34c6ce3e20268453c8a766cce085ad5810dd7cda..6da51df33e01000006c4aed17f7c640f82a9bc93 100644 (file)
@@ -5,7 +5,7 @@
 
 /// symbols, dimensions and constants
 struct Paperdef {
-    Lookup *lookup_;
+    Lookup *lookup_p_;
     String outfile;
 
     Real linewidth;
@@ -21,6 +21,7 @@ struct Paperdef {
     Paperdef(Lookup*);
     void set(Lookup*);
     ~Paperdef();
+    Paperdef(Paperdef const&);
     Real interline()const;
     Real internote()const;
     Real rule_thickness()const;
index dea0d0cd9510c62360f0b4e9e83f5bc5d4f6cb57..8afb32d94bf1ae6854dea50f1ed7e1ac9c644a4e 100644 (file)
@@ -16,7 +16,7 @@ Staff * get_new_rhythmstaff();
 Voice_element * get_note_element(String,int * ,int *);
 Voice_element* get_rest_element(String,int *);
 Staff * get_new_melodicstaff();
-void add_requests( Voice_element*v, svec<Request*>&req);
+void add_requests( Voice_element*v, Array<Request*>&req);
 Request* get_request(char);
 void set_text_style(String);
 Script_def* get_scriptdef(char);
index 7da7c02cb262519a147362efc03b53057834f089..a0f2a87624b76fb2008d7845ccb044f44477c0ac 100644 (file)
@@ -13,32 +13,33 @@ struct PCol {
     
 
     /// prebreak is put before end of line.
-    PCol *prebreak;
+    PCol *prebreak_p_;
     /**
     if broken here, then (*this) column is discarded, and prebreak
     is put at end of line, owned by Col
     */
 
     /// postbreak at beginning of the new line
-    PCol *postbreak;
+    PCol *postbreak_p_;
     /**  \See{prebreak}
     */
     
-    PCol *daddy;
+    PCol *daddy_l_;
     /** if this column is pre or postbreak, then this field points to
      the parent.  */
     
     /// if lines are broken then this column is in #line#
-    const Line_of_score *line;
+    const Line_of_score *line_l_;
 
     /// if lines are broken then this column x-coord #hpos#
     Real hpos;
 
-    PScore * pscore_;
+    PScore * pscore_l_;
 
     /****************/
     /// which  one (left =0)
     int rank() const;
+
     /// does this column have items, does it have spacings attached?
     bool used() const;
     
@@ -62,6 +63,8 @@ struct PCol {
     void OK() const;
     void set_breakable();
     void print()const;
+private:
+    PCol(PCol const&){}
 };
 /**
     This is a class to address items vertically. It contains the data for:
index b11ca6c59f87730ca2a8d4afd3dd7c3e5ae25630..ac215970feaaee45908b813bc0be418b8d815462 100644 (file)
@@ -15,6 +15,7 @@
 struct Absdynamic_req;
 struct Accidental;
 struct Atom;
+struct Barcheck_req;
 struct Beam;
 struct Beam_req;
 struct Box;
index 8ad259412e3aa07636eac076d2d4aebd23564a8e..f79624735356498e7969a3c2b8c2996a33d8ba1f 100644 (file)
@@ -4,13 +4,13 @@
 #define PSCORE_HH
 
 #include "break.hh"
-#include "vray.hh"
+#include "varray.hh"
 #include "pcol.hh"
 #include "pstaff.hh"
 
 /// all stuff which goes onto paper
 struct PScore {
-    Paperdef *paper_;          // indirection.
+    Paperdef *paper_l_;
     
     /// the columns, ordered left to right
     IPointerList<PCol *> cols;
@@ -34,63 +34,62 @@ struct PScore {
     IPointerList<Spanner*> broken_spans;
 
     /****************/
-
-    void add_broken(Spanner*);
-    
-    svec<Item*> select_items(PStaff*, PCol*);
-
-    /// before calc_breaking
-    void preprocess();
-    
-    void calc_breaking();
-    /**
-      calculate where the lines are to be broken.
-
-      POST
-    
-      lines contain the broken lines.
-     */
-
-    /// after calc_breaking
-    void postprocess();
+    /* CONSTRUCTION */
     
+    PScore(Paperdef*);
     /// add a line to the broken stuff. Positions given in #config#
-    void set_breaking(svec< Col_configuration> );
+    void set_breaking(Array<Col_configuration>);
 
     void add(PStaff *);
     
     /// add item
     void typeset_item(Item *,  PCol *,PStaff*,int=1);
 
-    /// add an Spanner
+    /// add a Spanner
     void typeset_spanner(Spanner*, PStaff*);
  
     ///    add to bottom of pcols
     void add(PCol*);
-    /**
+    void add_broken(Spanner*);
+
+    /* INSPECTION */
+    Array<Item*> select_items(PStaff*, PCol*);
+
+    /// return argument as a cursor.
+    PCursor<PCol *> find_col(const PCol *)const;
+
+    /* MAIN ROUTINES */
+    void process();
 
-    */
+    /// last deed of this struct
     void output(Tex_stream &ts);
 
-    Idealspacing* get_spacing(PCol *, PCol *);
-    /*
-    get the spacing between c1 and c2, create one if necessary.
-    */
+    /* UTILITY ROUTINES */
 
-    /// return argument as a cursor.
-    PCursor<PCol *> find_col(PCol *)const;
+    /// get the spacing between c1 and c2, create one if necessary.
+    Idealspacing* get_spacing(PCol *c1, PCol *c2);
 
-    /// delete unused columns
-    void clean_cols();
+    /// connect c1 and c2
+    void do_connect(PCol *c1, PCol *c2, Real distance_f, Real strength_f);
 
-    /// invarinants
+    /// connect c1 and c2 and any children of c1 and c2
+    void connect(PCol* c1, PCol *c2, Real distance_f,Real  strength_f= 1.0);
+    
+    /* STANDARD ROUTINES */
     void OK()const;
-
-    PScore(Paperdef*);
     void print() const;
+private:
+    /// before calc_breaking
+    void preprocess();
+
+    /// calculate where the lines are to be broken, and use results
+    void calc_breaking();
 
-        /// which is first (left, higher)
-    int compare_pcols( PCol*, PCol*)const;
+    /// after calc_breaking
+    void postprocess();
+    
+    /// delete unused columns
+    void clean_cols();
 };
 /** notes, signs, symbols in a score can be grouped in two ways:
     horizontally (staffwise), and vertically (columns). #PScore#
index 6d0bdcf34191dd0d03ec4beb7a16ae73b4f3ab45..78a68fb306a29542d087be3574992b1f180f30a2 100644 (file)
@@ -7,8 +7,8 @@
 
 /// items grouped horizontally
 struct PStaff {
-    Molecule * stafsym;
-    PScore * pscore_;
+    Molecule * stafsym_p_;
+    PScore * pscore_l_;
     
     
     PointerList<const Spanner*> spans;
@@ -19,6 +19,8 @@ struct PStaff {
     void add(Item*i);
     PStaff(PScore*);
     virtual ~PStaff();
+private:
+    PStaff(PStaff const&);
 };
 
 #endif
index b539fe6b865798de9a309e9a10c961ec75d72360..db5438499d6beaf75723159e637fcbe6ef8e369d 100644 (file)
@@ -7,8 +7,8 @@
 class Ineq_constrained_qp {
     friend class Active_constraints;
 
-    svec<Vector> cons;
-    svec<Real> consrhs;
+    Array<Vector> cons;
+    Array<Real> consrhs;
 public:
     Matrix quad;
     Vector lin;
@@ -55,8 +55,8 @@ public:
 
 /// Quadratic programming with mixed linear constraints
 class Mixed_qp :public Ineq_constrained_qp {
-    svec<int> eq_cons;
-    svec<Real> eq_consrhs;
+    Array<int> eq_cons;
+    Array<Real> eq_consrhs;
 public:
     Mixed_qp(int n);
     void OK() const;
index 4d29bcc4a0cf6c566e2888cdae75f2f08d8c9ec3..b9789bfc4aac1f042b06b24b993210f7ad3e8271 100644 (file)
@@ -7,8 +7,8 @@ class Active_constraints {
     
 
     Matrix A,H;
-    svec<int> active;
-    svec<int> inactive;                // actually this is a set, not an array.
+    Array<int> active;
+    Array<int> inactive;               // actually this is a set, not an array.
     const Ineq_constrained_qp *opt;
 
 public:
@@ -71,7 +71,7 @@ public:
     int constraint_id() const { return ac->inactive[j]; }
     Vector vec() const { return ac->vec(constraint_id()); }
     Real rhs() const { return ac->rhs(constraint_id()); }
-    bool ok() const { return j < ac->inactive.sz(); }
+    bool ok() const { return j < ac->inactive.size(); }
 };
 /**
     loop through the inactive constraints.
index 43b31d75cc98e23e20a374e50317f04a50a57a4c..a6ae0fbc88aa30b0066a06b8a912d91a5ced6350 100644 (file)
@@ -8,14 +8,20 @@
 
 /// a voice element wants something printed
 struct Request {
-    Voice_element*elt;         // indirection.
+    Voice_element*elt_l_;
     
     /****************/
 
     Request();
+    Request(Request const&);
     virtual ~Request(){}
 
     virtual void print()const ;
+    virtual Moment duration() const { return 0.0; }
+    virtual Request* clone() const =0;
+
+    /*  accessors for children */
+    virtual Barcheck_req *barcheck() { return 0; }
     virtual Note_req *note() {return 0;}
     virtual Script_req *script() {return 0;}
     virtual Stem_req *stem() {return 0;}
@@ -26,14 +32,17 @@ struct Request {
     virtual Slur_req *slur() { return 0 ; }
     virtual Rhythmic_req*rhythmic() { return 0; }
     virtual Melodic_req *melodic() { return 0; }
-    virtual Moment duration() const { return 0.0; }
-    virtual Request* clone() const =0;
 };
 
 /**
 see lilygut page
  */
        
+struct Barcheck_req : Request {
+    virtual Barcheck_req *barcheck() { return this; }
+    void print ()const;
+    Request*clone() const;
+};
 
 /// a request with a duration
 struct Rhythmic_req : virtual Request {
@@ -107,6 +116,7 @@ struct Span_req : Request {
        NOSPAN, START, STOP
     } spantype ;
 
+    virtual void print() const;
     Span_req*span() { return this; }
     Span_req();
     virtual Request*clone()const;
@@ -132,6 +142,7 @@ appropriate number over the beam
 
 /// a slur
 struct Slur_req : Span_req {
+
     virtual Request*clone()const;
     virtual Slur_req*slur() { return this; }
 };
@@ -148,6 +159,7 @@ struct Script_req : Request {
     Request *clone()const;
     Script_req(int d, Script_def*);
     ~Script_req();
+    Script_req(Script_req const&);
 };
 /** eg upbow, downbow. Why a request? These symbols may conflict with
 slurs and brackets, so this also a request */
@@ -162,7 +174,8 @@ struct Text_req : Request {
     virtual void print() const;
     Request *clone()const;
     Text_req(int d, Text_def*);
-    ~Text_req();  
+    ~Text_req();
+    Text_req(Text_req const&);
 };
 
 
index 8c1d82b3aede30e62d7dd7a39e4a46f833a5b6aa..615376309c77f256ee6792814d983dd5ffd0239d 100644 (file)
@@ -7,25 +7,23 @@
 #ifndef SCCOL_HH
 #define SCCOL_HH
 #include "proto.hh"
-#include "vray.hh"
+#include "varray.hh"
 #include "moment.hh"
 
 
 struct Score_column {
 
     /// indirection to column
-    PCol * pcol_;
+    PCol * pcol_l_;
 
     /// length of notes/rests in this column
-    svec<Moment> durations;
+    Array<Moment> durations;
     
-    Moment when;
-
     /// 
-    bool musical;
+    bool musical_;
     
     /****************/
-    
+    Moment when() {  return when_; }
     Score_column(Moment when);       
     static int compare(Score_column & c1, Score_column &c2);
     void add_duration(Moment );
@@ -33,6 +31,9 @@ struct Score_column {
     void set_breakable();
     bool used();
     void print() const;
+
+private:
+    Moment when_;
 };
 /**
 
index 5363b475cb44d7c7a3114139bc82d32f044de8d8..f58367c30ecfad4b5ff229590ec7c4f440cc0a75 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef SCORE_HH
 #define SCORE_HH
-#include "vray.hh"
+#include "varray.hh"
 #include "proto.hh"
 #include "plist.hh"
 #include "moment.hh"
@@ -8,12 +8,12 @@
 /// the total music def of one movement
 struct Score {
     /// paper_, staffs_ and commands_ form the problem definition.
-    Paperdef *paper_;
+    Paperdef *paper_p_;
     IPointerList<Staff*> staffs_;
     
     /// "runtime" fields for setting up spacing    
     IPointerList<Score_column*> cols_;
-    PScore *pscore_;
+    PScore *pscore_p_;
 
     /****************************************************************/
 
@@ -22,22 +22,32 @@ struct Score {
     ~Score();    
     void add(Staff*);        
 
-
-
-    void OK() const;
-    PCursor<Score_column *> find_col(Moment,bool);
+    /// do everything except outputting to file
     void process();
+    
+    /// output to file
     void output(String fn);
-    PCursor<Score_column*> create_cols(Moment);
+
+    // standard
+    void OK() const;
     void print() const;
+
+    // utils:
+    PCursor<Score_column*> create_cols(Moment);
+    PCursor<Score_column *> find_col(Moment,bool);
+    /// when does the last *musical* element finish?
     Moment last() const;
     
 private:
-    void do_pcols();    
+    Score(Score const&){}
+    void do_cols();
+    /**
+      make the pcol_l_ fields of each Score_column point to the correct PCol,
+      remove any unnecessary Score_column's
+     */
+
+    /// remove unused cols
     void clean_cols();
-    void distribute_commands();
-    void do_connect(PCol *c1, PCol *c2, Real d,Real);
-    void connect(PCol* c1, PCol *c2, Real d,Real = 1.0);
     
     /// add #Idealspacings# to #pscore_#
     void calc_idealspacing();
index 5734a7b4b458b4c396f242c661eac7f708686103..233496932a9926f27e78df3506681b3cfc038eaf 100644 (file)
@@ -8,7 +8,7 @@
 #define SCORELINE_HH
 #include "plist.hh"
 #include "proto.hh"
-#include "vray.hh"
+#include "varray.hh"
 
 /// the columns of a score that form one line.
 struct
@@ -17,11 +17,11 @@ Line_of_score {
 
     // need to store height of each staff.
     IPointerList<Line_of_staff*> staffs;
-    PScore * pscore_;  // needed to generate staffs
+    PScore * pscore_l_;        // needed to generate staffs
 
     /****************/
     void process() ;
-    Line_of_score(svec<PCol *> sv,  PScore *);
+    Line_of_score(Array<PCol *> sv,  PScore *);
 
     String TeXstring() const;
 
index 08d7a64f1884d2d93b2d38ab8ee7bb8602c16633..01dd75c53d50258fcb21edcad6d42b063096e639 100644 (file)
@@ -15,8 +15,8 @@ struct Script : Item{
     int symdir;
     int pos;
     int staffsize;
-    Script_def*specs;
-    Stem * stem_;
+    Script_def*specs_l_;
+    Stem * stem_l_;
     Item * support;
 
     /****************/
@@ -24,7 +24,7 @@ struct Script : Item{
     void       set_symdir();
     void       set_default_dir();
     void       set_default_pos();
-
+    Symbol symbol()const;
     Molecule*  brew_molecule()const;
     virtual void do_post_processing();
     virtual void do_pre_processing();
index 34e48b0d23c27c25e4e756b158bbb7a53d2cba49..f074dc169d6541029f0a1915f257355a0a548552 100644 (file)
@@ -19,7 +19,7 @@
 struct Simple_staff;
 struct Note_info {
     Rhythmic_req *rq;
-    svec<Script_req*> scripts;
+    Array<Script_req*> scripts;
     Note_info();
     Note_info(Rhythmic_req*);
 };
@@ -27,8 +27,8 @@ struct Note_info {
 /// column of Simple_staff: store one request
 struct Simple_column : Staff_column {
 
-    svec<Note_info> notes;
-    svec<Slur_req *> slurs;
+    Array<Note_info> notes;
+    Array<Slur_req *> slurs;
     Stem_req *stem_;
     Moment stem_requester_len;
     Beam_req *beam_;
index 635b9fbbcc66b737d2a32f3ac4d1d73875383219..34403e465ca425be6265ac4744398e3dbab28963 100644 (file)
 
 struct Simple_walker: Staff_walker {
     Stem *stem_;
-    svec<Notehead *>noteheads;
+    Array<Notehead *>noteheads;
     Local_key local_key_;
     Key key_;
-    svec<int> *oldkey_undo;
-    svec<int> typesetkey;
+    Array<int> *oldkey_undo;
+    Array<int> typesetkey;
     Beam *beam_;
     Local_key_item *local_key_item_;
     bool wantkey;              // urgh
+    int processed_bar_priority;
     bool processed_key;
     bool processed_clef;
     Clef clef_;
     Rhythmic_grouping default_grouping;
     Rhythmic_grouping *current_grouping;
-    svec<Slur_req*> pending_slur_reqs;
-    svec<Slur*>  pending_slurs;
-    
+    Array<Slur_req*> pending_slur_reqs;
+    Array<Slur*>  pending_slurs;
+
     /****************/
 
     virtual void do_TYPESET_command(Command*);
index cf8c2261ab4e327fa4945a1f2773a9be2d9ae484..9a3333f0630dd1da79a677a715bc8cfeb1769156 100644 (file)
@@ -9,11 +9,11 @@
 
 #include "directionalspanner.hh"
 #include "fproto.hh"
-#include "vray.hh"
+#include "varray.hh"
 
 struct Slur : Directional_spanner {
 
-    svec<Notehead*> encompass;
+    Array<Notehead*> encompass;
     //int dir;
 
     bool open_left,open_right;                 
index 5414fc3f8b3aa905d1733672f60388801d3c01e3..7d6be0e12f0adc704dbd7ef95b944f4d740b233f 100644 (file)
@@ -9,36 +9,42 @@ struct Staff {
     /// synchronous horizontal stuff
     IPointerList<Voice*> voices;
 
-    /// commands in chronological order
-    Staff_commands *staff_commands_;
-    
     /// runtime field
     IPointerList<Staff_column*> cols;
 
-    /// indirections to the Score and PScore
-    Score *score_;
-    PScore *pscore_;
+    Score *score_l_;
+    PScore *pscore_l_;
 
     /****************************************************************/
     void add(PointerList<Voice*> &s);
-    void process_commands(Moment l);
+
+    /// throw away cols later the #l#
+    void truncate_cols(Moment l);
 
     Staff(const Staff&src);
     void add_voice(Voice *v);
     void add_staff_column(Staff_column *sp);
 
     Paperdef*paper()const;
+    
     /// interpret all requests and add items to #destination#.
     void process();
     /**
     This routines calls virtual functions from Staff, to delegate the
     interpretation of requests to a derived class of Staff */
+
+    
     void setup_staffcols();
 
     void OK() const;
     void print() const;
+
+    /// when does the last *musical* element finish?
     Moment last() const;
+
+    /// remove unused cols
     void clean_cols() ;
+    
     Staff_column * get_col(Moment,bool);
 
     Staff();
@@ -51,6 +57,8 @@ struct Staff {
     virtual void walk()=0;    
     virtual Staff_column * create_col(Score_column * )=0;
     virtual ~Staff() { }
+private:
+    void set_time_descriptions();
 };
 #endif
 
index 633b73285cfb9e739d466a8940fb88b6ccc7e312..e0e27be4be8ce75eebee3500e8b3f29e4e189b65 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "proto.hh"
 #include "command.hh"
-#include "vray.hh"
+#include "varray.hh"
 #include "plist.hh"
 #include "timedescription.hh"
 
@@ -28,20 +28,5 @@ struct Staff_commands_at : public IPointerList<Command*> {
     void add(Command c);
 };
 
-/// the list of commands in Score
-struct Staff_commands : public IPointerList<Staff_commands_at*>
-{
-    Staff_commands_at*find(Moment);
-    void add(Staff_commands_at*);
-    void clean(Moment last);
-    void OK() const;
-    void print() const;
-    Moment last() const;
-};
-/** the list of commands in Score. Put in a separate class, since it
-  otherwise clutters the methods of Score.
-
-  */
-
 #endif
 
index a12addbfac9caf378efafe65134580e2087269af..bd10f216a858b3ddcc39fbae5a757993978dc034 100644 (file)
@@ -6,7 +6,7 @@
 
 #ifndef STAFFELEM_HH
 #define STAFFELEM_HH
-#include "vray.hh"
+#include "varray.hh"
 #include "proto.hh"
 #include "offset.hh"
 #include "molecule.hh"
@@ -20,13 +20,13 @@ struct Staff_elem {
        OUTPUT,                 // molecule has been output
     } status;
     bool calc_children;
-    svec<Staff_elem*> dependencies;
+    Array<Staff_elem*> dependencies;
     
-    /// indirection to the pstaff it is in
-    PStaff *pstaff_;
+    ///  the pstaff it is in
+    PStaff *pstaff_l_;
 
     /****************/
-    
+    Staff_elem(Staff_elem const&);
     String TeXstring () const ;
     virtual void print() const;
     virtual Interval width() const;
index 12d30c376430a74429a83de88391c315c6b7cd85..663c9584b25bbc931fa522b606509a84e6d84ccc 100644 (file)
@@ -9,15 +9,15 @@
 
 #include "real.hh"
 #include "plist.hh"
-#include "vray.hh"
+#include "varray.hh"
 #include "glob.hh"
 #include "pstaff.hh"
 
 /// one broken line of staff.
 struct Line_of_staff {
 
-    Line_of_score  * line_of_score_;
-    PStaff *pstaff_;
+    Line_of_score  * line_of_score_l_;
+    PStaff *pstaff_l_;
 
     /****************/
     
index 9e7501edc752f3eb4f22946a16bb355e0cdf7fc6..2bdd3b8bb9f6ed113b144cfd627eb8186a2d55da 100644 (file)
@@ -7,19 +7,19 @@
 #ifndef STCOL_HH
 #define STCOL_HH
 #include "proto.hh"
-#include "vray.hh"
+#include "varray.hh"
 #include "moment.hh"
 
 /// store simultaneous requests
 struct Staff_column {
-    /// indirection
-    Score_column *score_column;
+
+    Score_column *score_column_l_;
 
     /// fields to collect data vertically.
-    svec<Voice_element *> v_elts;
+    Array<Voice_element *> v_elts;
 
     /// idem
-    Staff_commands_at *s_commands;
+    Staff_commands_at *staff_commands_p_;
 
     Time_description *tdescription_;
     
@@ -29,7 +29,7 @@ struct Staff_column {
     bool mus() const;
     Moment when() const;
     void add(Voice_element*ve);
-
+    void OK() const;
     /****************************************************************
       VIRTUAL
     ****************************************************************/
@@ -37,6 +37,8 @@ struct Staff_column {
     virtual void process_requests()=0;
 
     virtual ~Staff_column();
+private:
+    Staff_column(Staff_column const&){}
 };
 
 
index ad2856b0f208d3fbf0b188de3f2e566cf20dadde..b7d7e05e29517daf7532308061b3e29e838ed2e5 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef STEM_HH
 #define STEM_HH
 #include "item.hh"
-#include "vray.hh"
+#include "varray.hh"
 #include "moment.hh"
 
 /// the rule attached to the ball
@@ -46,7 +46,7 @@ struct Stem : public Item {
 
     Real stem_xoffset;
     
-    svec<Notehead*> heads;
+    Array<Notehead*> heads;
 
     /****************/
     Stem(int center, Moment duration);
index 0d66a55fb4c91e9b5e95ea0d9a7abca4f58cc1e2..046ded590e9b3eef7058b0a876066552cffffb50 100644 (file)
@@ -30,6 +30,8 @@ struct Staff_walker : public PCursor<Staff_column*> {
     virtual void process_requests()=0;
     virtual void do_TYPESET_command(Command*)=0;
     virtual void do_INTERPRET_command(Command*)=0 ;
+private:
+    Staff_walker(Staff_walker const&);
 };
 /**
   manage run-time info when walking staffcolumns such as: key,
index aba60f06c42a0d27a1057a066a16d2ff3ba5129e..c33f30e202d5884479b61299f86d35ea54c8c4f6 100644 (file)
@@ -7,7 +7,7 @@
 
 /// parameter substitution in TeXstrings
 String
-substitute_args(String source, svec<String> args);
+substitute_args(String source, Array<String> args);
 /**
   this structure provides a simple macro mechanism:
 
@@ -17,7 +17,7 @@ substitute_args(String source, svec<String> args);
 
 /// parameter substitution in TeXstrings
 String
-substitute_args(String source, svec<Scalar> args);
+substitute_args(String source, Array<Scalar> args);
 
 /// #h# is in points
 String vstrut(Real h);
index 2cdbc8de2380b21f48af7d08ac338bb51a4c1949..2194ee0a16641ac93be9864fe126c12fc9c8ba6a 100644 (file)
@@ -26,11 +26,18 @@ struct Time_description {
     /****************/
     void OK() const;
     Time_description(Rational, const Time_description*);
+    String str()const;
     void print() const;
     void setpartial(Rational p);
     Rational barleft();
     void set_meter(int,int);
+    static int compare (Time_description&, Time_description&);
 };
 
+#include "compare.hh"
+
+
+instantiate_compare(Time_description&,Time_description::compare);
+
 #endif // Time_description_HH
 
index 9474dd69a8d8413b00695efc046295aa39fac83b..e75d27a4b3a5ae7ac2cb0b542d05ba1b3b16afc8 100644 (file)
@@ -18,6 +18,8 @@ struct Tex_stream {
 
     /// close the file
     ~Tex_stream();
+private:
+    Tex_stream(Tex_stream const&);
 };
 /**
   Use this class for writing to a TeX file.
index b9d962d1ed12d8349bd39c6e2e41cd920deae426..19dfcbfcaf555311d300d5d6d259515660f4b34a 100644 (file)
@@ -1,5 +1,8 @@
 DFILES=dutch.ini table_sixteen.ini table_twenty.ini\
        english.ini script.ini
 
+default:
+       echo huh?
+
 dist:
        ln Makefile $(DFILES) $(DDIR)/$(INITDIR)
index 6ac23c92c5865120e6386a8d87098beabd8f568c..aeee0b01ac096312f3a4f4a72a123c1d25851195 100644 (file)
@@ -3,12 +3,14 @@
 % indexstring same_dir_as_stem above_below_staff symbol_can_beinverted }
 %
 
+accent = script { "sforzato" -1 0 0 }
+marcato = script { "marcato" -1 0 1  }
+staccatissimo = script { "staccatissimo" -1 0 1 }
+portato= script { "portato" -1 0 1 }
 fermata = script { "fermata" 1 0 1 }
 stopped = script { "stopped" 0 1 0 }
-accent = script { "accent" -1 0 0 }
 staccato = script { "staccato" -1 0 0 }
-staccatissimo = script { "staccatissimo" 1 0 1 }
+tenuto = script {"tenuto" -1 0 0 }
 portato = script { "portato" -1 0 0  }
-marcato = script { "marcato" -1 0 1  }
 upbow = script { "upbow" 0 1 0 }
 downbow = script { "downbow" 0 1 0 }
index 2b719ecd88254d38c13e0335afa21cf5ec55f20a..5eb42dde18783ae671ce08f81696e05a9f978605 100644 (file)
@@ -14,12 +14,15 @@ symboltables {
            "fermata" "\fermata"                0pt  0pt        0pt 11.25pt
            "-fermata" "\ifermata"              0pt  0pt        -11.25pt 0pt
            "portato" "\portato"                0pt 0pt         0pt 0pt
-           "accent" "\maccent"                 -1pt 8pt        0pt 0pt
-           "marcato" "\marcato"                0pt  0pt        0pt 11.25pt
-           "-marcato" "\imarcato"              0pt  0pt        -11.25pt 0pt 
+           "-portato" "\iportato"              0pt 0pt         0pt 0pt
+           "tenuto" "\tenuto"                  0pt 0pt         0pt 0pt
+           "-tenuto" "\itenuto"                0pt 0pt         0pt 0pt
+           "sforzato" "\sforzato"              -0.8pt 4.8pt    -1.92pt 1.92pt
+           "marcato" "\marcato"                0pt  4.8pt      0pt 4pt
+           "-marcato" "\imarcato"              0pt  4.8pt      -4pt 0pt 
            "staccato" "\staccato"              0pt  0pt         0pt 5pt
            "staccatissimo" "\staccatissimo"    0pt 0pt         0pt 7.5pt
-           "istaccatissimo" "\staccatissimo"   0pt 0pt         -7.5pt 0pt
+           "-staccatissimo" "\istaccatissimo"  0pt 0pt         -7.5pt 0pt
            "upbow" "\upbow"                    -1pt 6pt        0pt 5pt
            "downbow" "\downbow"                0pt 5pt         0pt 7.5pt
     }
@@ -67,9 +70,13 @@ symboltables {
      }
 
      "bars" = table {
-            "empty"    "\emptybar"     0pt     0pt     0pt     0pt
-            "|"        "\maatstreep"   0pt     5pt     -12pt   12pt
-            "||"       "\finishbar"    0pt     2pt     -12pt   12pt
+       "empty" "\emptybar"     0pt     0pt     0pt     0pt
+       "|"     "\maatstreep"   0pt     5pt     -8pt    8pt
+       "||"    "\finishbar"    0pt     2pt     -8pt    8pt
+       ":|"    "\repeatbar"    -4pt    0pt     -8pt    8pt
+       "|:"    "\startrepeat"  0pt     4pt     -8pt    8pt
+       ":|:"   "\repeatbarstartrepeat" 0pt     8pt     -8pt    8pt
+
      }
 
      "rests" = table {
index f5e6d081397af8ff4e5edcd2b437fb41c6a19970..ac78340c4fade31a8d7ae2e51e723a882486646a 100644 (file)
@@ -11,17 +11,20 @@ melodie = music {
        \octave {}              % set the default octave
        % the default note duratino is 4
        %%% theme
-         c c g g       a a
-         g2            % g2 means a "g-1" pitched half-note 
-       f f     e e     d d  c2
-         g g   f f     e e     d d     g g     f f     e e     d d
+       c c |                   % the '|' checks if there is a new measure here.
+       g g|
+       a a|
+
+       g2|     % g2 means a "g-1" pitched half-note 
+       f f|    e e|    d d|  c2
+       g g|    f f|    e e|    d d|    g g|    f f|    e e|    d d|
        %%% var 1
          c r8 c8               % r8 means an 8th rest.
-                 (             % start a slur
+                 (|            % start a slur
                                % NOTE: the slurstart should be directly after the note
                        )       % end a slur.
-                         g r8 g8 (     ) a r8 a8 (     ) g r4 
-         f r8 f8 (     ) e4 r8 e8 (    ) d4 r8 d8 (    ) c4 r4
+                         g r8 g8 (|    ) a r8 a8 (|    ) g r4 
+         f r8 f8 (|    ) e4 r8 e8 (    |) d4 r8 d8 (|  ) c4 r4 
 $}
 
                                % more of this.
@@ -49,7 +52,6 @@ bstaf = staff {
        music { begeleiding }   % use the declared music
                commands {      % commands with Staff-wide impact.
                        clef bass       % bass-clef
-
                }
        }
 
@@ -57,6 +59,7 @@ bstaf = staff {
 vstaf = staff {
        melodic
                music { melodie }
+               commands { clef violin }
                                % default clef is violin clef
        }
 
@@ -69,8 +72,8 @@ score {
        }
        commands {
                meter 2 4       % a 2/4 meter.
-               skip 32:0       % skip 32 measures, and generate the bars
-               meter 6 8       % another meter
+               skip 33:0       % skip 32 measures, and generate the bars
+%              meter 6 8       % another meter
        }
 }
 
index 24df3eedaa7231a7e7f96926d07bbc793a2d4ee6..eadca08e81cf2f1a1af9cc8198d3f55bbfd3c061 100644 (file)
@@ -1,7 +1,22 @@
 %%
 %% include file for LilyPond
 
-\def\mdef#1#2{\def#1{{\musicfnt\char#2}}}
+\def\mdef#1#2{\def#1{\mchar{#2}}}
+\def\mchar#1{\musicfnt\char#1}
+\def\rationalmultiply#1*#2/#3{\multiply #1 by #2 \divide #1 by #3}
+\def\maccentraise#1#2{\dimen0=\noteheight
+        \rationalmultiply\dimen0*#2%
+        \raise\dimen0\hbox{#1}}
+\def\maccentdef#1#2#3{\def#1{\maccentraise{\mchar{#2}}{#3}}}
+\def\vcenter#1{\vbox to 0pt{\vss #1\vss}}
+
+\def\topalign#1{\vbox to 0pt{#1\vss}}
+\def\botalign#1{\vbox to 0pt{\vss #1}}
+
+\def\centeralign#1{\hbox to 0pt{\hss#1\hss}}
+\def\leftalign#1{\hbox to 0pt{#1\hss}}
+\def\rightalign#1{\hbox to 0pt{\hss#1}}
+
 
 %% musix defs
 \parindent=0pt
@@ -9,6 +24,7 @@
         \newcount\n
         \newdimen\balkhoog
         \newdimen\notewidth
+        \newdimen\noteheight
         \newdimen\notewidthhalf
         \newdimen\notewidthdouble
         \newdimen\staffrulethickness
         \font\italicfont=cmti10
         \balkhoog=20pt
         \notewidth=6pt
+        \noteheight=5pt
         \staffrulethickness=0.4pt
-
         \musixcalc
 }
+
+
 \def\musixsixteendefs{
         \font\textfont=cmr8
         \font\meterfont=cmbx12
@@ -45,6 +63,7 @@
         \balkhoog=16pt
         \staffrulethickness=0.4pt
         \notewidth=5pt
+        \noteheight=4pt
         \musixcalc
 }
 
         \advance\interstaffrule by -\staffrulethickness
         \notewidthhalf=\notewidth
         \notewidthdouble=\notewidth
-        \divide \notewidthhalf by 2
+        \rationalmultiply \notewidthhalf*1/2
         \multiply \notewidthdouble by 2
-        \balkhalf=\balkhoog
-        \divide \balkhalf by 2
+               \balkhalf=\balkhoog
+ \rationalmultiply\balkhalf*1/2 
 }
-
+\def\dyn{\italicfont}
 
 \def\slurcharh#1{{\slurhfont\char#1}}
 \def\slurcharu#1{{\slurufont\char#1}}
 
 \def\maatstreep{\vrule height\balkhoog}
 \def\finishbar{\vrule height\balkhoog  width 1pt}
+\maccentdef\repeatcolon{55}{2/1}
+
+\def\repeatbar{\rightalign{\repeatcolon\kern 2pt\finishbar}}
+\def\startrepeat{\hbox{\finishbar\kern 2pt\repeatcolon}}
+\def\repeatbarstartrepeat{\hbox{\repeatbar\kern 1pt\startrepeat}}
+
 \def\generalmeter#1#2{\botalign{\vbox to\balkhalf{\vss \meterfont#1}%
         \nointerlineskip
         \vbox to \balkhalf{\vss\meterfont #2}}}
-\def\lineseparator{\vbox{\mussepline\vskip -5pt\mussepline}}
-
+\def\defaultlineseparator{\vbox{\mussepline\vskip -5pt\mussepline}}
+\def\lineseparator{\defaultlineseparator}
 \def\beauty{%
         \par\vskip 10pt plus 30pt minus 10pt\par
         \hskip -5pt\lineseparator
 \def\ldoubledot{\kern-\notewidth\doubledot}
 \def\ltripledot{\kern-\notewidth\tripledot}
 
-\mdef\maccent{30}
+\maccentdef\sforzato{30}{-3/2}
+\maccentdef\marcato{20}{-1/1}
+\maccentdef\imarcato{21}{1/1}
+\maccentdef\staccato{24}{-1/1}
+\maccentdef\istaccato{25}{1/1}
+\maccentdef\staccatissimo{28}{-1/1}
+\maccentdef\istaccatissimo{29}{1/1}
+\maccentdef\portato{18}{-9/10}
+\maccentdef\iportato{19}{9/10}
+\maccentdef\tenuto{26}{0/1}
+\maccentdef\itenuto{27}{0/1}
 \mdef\fermata{80}
 \mdef\ifermata{81}
-\mdef\iaccent{31}
-\mdef\msxmarcato{20}
-\def\marcato{\botalign{\msxmarcato}}
-\mdef\msximarcato{21}
-\def\imarcato{\topalign{\msximarcato}}
-\mdef\staccato{24}
-\mdef\istaccato{25}
-\mdef\staccatissimo{16}
-\mdef\istaccatissimo{17}
+
+
+
 \mdef\spicato{28}
 \mdef\ispicato{29}
-\mdef\upbow{22}
-\mdef\downbow{23}
+\mdef\upbow{23}
+\mdef\downbow{22}
 \mdef\portato{26}
 
 \def\stem#1#2{\vrule height#2 depth-#1}
 
 \def\settext#1{\textfont #1}
 \def\setitalic#1{\italicfont #1}
-
-\def\vcenter#1{\vbox to 0pt{\vss #1\vss}}
-
-\def\topalign#1{\vbox to 0pt{#1\vss}}
-\def\botalign#1{\vbox to 0pt{\vss #1}}
-
-\def\centeralign#1{\hbox to 0pt{\hss#1\hss}}
-\def\leftalign#1{\hbox to 0pt{#1\hss}}
index 28d1d780409c3171ec07f40adde9bc94f2a4b2f1..f585c27b80800f09cd5c7cf42706f9f12f452c09 100644 (file)
@@ -47,7 +47,7 @@ c8
        $}
 
        commands {
-%      skip 0:0.125
+
        skip 3:0%BUG
        key $ fis cis gis $
        skip 2:0
@@ -67,8 +67,9 @@ score {
        commands {
                meter 4 4
                partial 8
-               skip 1:0
-               skip 2:0                
+               skip 1:2
+               bar ":|:"
+               skip 2:0
                meter 2 4
                skip 19:0
        }
index 96fb1da3daf6cb10004160de7282f6b842943e2d..a5ad5cc311f23e9aeebf0d2908175b0307960fcc 100644 (file)
--- a/pavane.ly
+++ b/pavane.ly
@@ -12,79 +12,80 @@ staff {melodic
        \duration { 8}
 
 % 1
-       d2( [)d e cis `b]
-       `a4 [`b cis] [cis `b] `b4
-       fis2( [)fis g e d]
-       cis4 [d e(] [)e fis d cis]
-       `b4 [cis d(] [)d e cis `b]
-       cis2 r2^"c\'edez"
-       r4 fis2 fis4
-       fis2^"en mesure" ()[fis e a fis]
-       fis4-- e4-- d4-- e4--
-       `b2()[`b^"un peu retenu" `a( d cis]
+       d2( [)d e cis `b]               |       
+       `a4 [`b cis] [cis `b] `b4       |
+       fis2( [)fis g e d]              |
+       cis4 [d e(] [)e fis d cis]      |
+       `b4 [cis d(] [)d e cis `b]      |
+       cis2 r2^"c\'edez"               |
+       r4 fis2 fis4                    |
+       fis2^"en mesure" ()[fis e a fis]|
+       fis4-- e4-- d4-- e4--           |
+       `b2()[`b^"un peu retenu" `a( d cis]|
 % 11
-       )`b [`fis^"en \'elargissant"-- `a-- `b--] cis4-- `b4--
-       `fis2 r2
+       )`b [`fis^"en \'elargissant"-- `a-- `b--] cis4-- `b4--|
+       `fis2 r2                        |
        cis4^"1er mouvement" d4^"tr\`es lontain" ()[d cis d e]
        \octave {  }
-       a4 gis2.
-       a4 b4()[b a b 'cis]
-       fis4 e4 cis2
-       e4 fis4 () [fis e fis gis]
-       cis4 `b4()`b8 r8 r4^"tr\`es soutenu"
+       |       a4 gis2.        |
+       a4 b4()[b a b 'cis]     |
+       fis4 e4 cis2            |
+       e4 fis4 () [fis e fis gis]      |
+       cis4 `b4()`b8 r8 r4^"tr\`es soutenu"    |
 
-       r4 r4   %2/4 meter
+       r4 r4   %2/4 meter
 
-       'cis4_"ppp" 'd4 () ['d 'cis 'd 'e]
-       a4 gis2.
-       a4 b4()[b a b 'cis]
-       fis4 e4 cis2
-       e4_"pp" fis4()[fis e fis gis]
-       cis4_"mf" `b4()`b8 r8 r4^"un peu plus lent"
-       r1
-       r2 r4 r4%^\fermata
+       'cis4_"\dyn ppp" 'd4 () ['d 'cis 'd 'e] |
+       a4 gis2.        |
+       a4 b4()[b a b 'cis]     |
+       fis4 e4 cis2    |
+       e4_"\dyn pp" fis4()[fis e fis gis]      |
+       cis4_"\dyn mf" `b4()`b8 r8 r4^"un peu plus lent"        |
+       r1      |
+       r2 r4 r4 %^\fermata
 %% cut 'n paste.
        \octave { ' }
-       d2^"Reprenez le mouvement"( [)d e cis `b]
-       `a4 [`b cis] [cis `b] `b4
-       fis2( [)fis g e d]
-       cis4 [d e(] [)e fis d cis]
-       `b4 [cis d(] [)d e cis `b]
-       cis2 r2^"c\'edez"
-       r4 fis2 fis4
-       fis2^"en mesure"()[fis e a fis]
-       fis4-- e4-- d4-- e4--
-       `b2() [`b `a-. d-. cis-.]
-       `b-. [`fis^"large" `a `b] cis4 `b4      `fis2 r2
-       r1
+       | d2^"Reprenez le mouvement"( [)d e cis `b]     |
+       `a4 [`b cis] [cis `b] `b4       |
+       fis2( [)fis g e d]      |
+       cis4 [d e(] [)e fis d cis]      |
+       `b4 [cis d(] [)d e cis `b]      |
+       cis2 r2^"c\'edez"       |
+       r4 fis2 fis4    |
+       fis2^"en mesure"()[fis e a fis] |
+       fis4-- e4-- d4-- e4--   |
+       `b2() [`b `a-. d-. cis-.]       |
+       `b-. [`fis^"large" `a `b] cis4 `b4      `fis2 r2        |
+
+       %% mark B
+       r1^"1er mouvement"      
        \duration {8}
-       r2 [c-.( e-. c-. )`a-. ]
-       \plet {2/3}\octave{}
-       [c e a ] \plet{1/1} b4-> () [b c-- e-- a--]
-       b4. b8()g2
-       r1
-       r2
-       [f a f d]
+       | r2 [c-.( e-. c-. )`a-. ]      
+       \plet {2/3}\octave{}    |
+       |       [c e a ] \plet{1/1} b4-> () [b c-- e-- a--]     |
+       b4. b8()g2      |
+       r1      |
+       r2              [f a f d] 
        \plet {2/3}
-       [f a 'c] \plet{1/1} 'e4-^ () ['e f-> a-> 'c->]
-       e4._"sf" e8()c4 r4
-       r1
-       r4 r4-\fermata
+       | [f a 'c] \plet{1/1} 'e4-^ () ['e f-> a-> 'c->]        |
+       'e4._"sf" 'e8()'c4 r4 |
+       r1      |
+       r4 r4-\fermata  
        \octave { ' }
-       d2( [)d e cis `b]
-       `a4 [`b cis] [cis `b] `b4
-       fis2( [)fis g e d]
-       cis4 [d e(] [)e fis d cis]
-       `b4 [cis d(] [)d e cis `b]
-       cis2 r2^"c\'edez"
-       r4 fis2 fis4
-       fis2()[fis e a fis]
-       fis4-- e4-- d4-- e4--
-       \octave{ }
-       b2()[b a 'd 'cis]
-       b [fis a b ] 'cis4 b4
-       fis2 r2
-       r1-\fermata
+       |d2( [)d e cis `b]      |
+       `a4 [`b cis] [cis `b] `b4       |
+       fis2( [)fis g e d]      |
+       cis4 [d e(] [)e fis d cis]      |
+       `b4 [cis d(] [)d e cis `b]      |
+       cis2 r2^"c\'edez"       |
+       r4 fis2 fis4    |
+       fis2()[fis e a fis]     |
+       fis4-- e4-- d4-- e4--   
+       \octave{ }      
+       | b2()[b a 'd 'cis]     |
+       b [fis a b ] 'cis4 b4   |
+       fis2 r2 |
+       r1-\fermata     
                $}
        commands {      
                key  $fis cis $
@@ -95,20 +96,24 @@ score {
                horn
        }
        paper {
-               symboltables { table_sixteen}
+               output "pavane.out"
                unitspace 1.5 cm
                geometric 1.4
        }
-       commands  {meter 4 4
-
+       commands  {
+               meter 4 4
                skip 18:0
                meter 2 4
                skip 1:0
                meter 4 4 
-               skip 29:0
+               skip 20:0
+               bar "|:"
+               skip 9:0
                meter 2 4
                skip 1:0
+               bar ":|"
                meter 4 4
                skip 13:0
+               bar "||"
        }
 }
\ No newline at end of file
diff --git a/pavane.tex b/pavane.tex
new file mode 100644 (file)
index 0000000..69a1362
--- /dev/null
@@ -0,0 +1,12 @@
+\documentclass{article}         %UGH
+\usepackage{a4}
+\begin{document}
+\input lilyponddefs
+\input titledefs
+\def\interscoreline{\vskip12pt}
+\title{Pavane pour une Infante d\'efunte}
+\composer{Maurice Ravel}
+\instrument{Cor en Fa}
+\maketit
+\input pavane.out
+\end{document}
diff --git a/scales.ly b/scales.ly
new file mode 100644 (file)
index 0000000..99d6f56
--- /dev/null
+++ b/scales.ly
@@ -0,0 +1,36 @@
+
+blah =
+staff {melodic
+       music{  $ c1
+       \duration { 8}
+       [c-> d-> e-> f->][g-> a-> b-> 'c->]
+\octave{'}     ['c-^ b-^ a-^ g-^][f-^ e-^ d-^ c-^]
+
+\octave{}      ['c-^ b-^ a-^ g-^][f-^ e-^ d-^ c-^]
+
+       [c-. d-. e-. f-.][g-. a-. b-. 'c-.]
+       ['c-- b-- a-- g][f-- e-- d c--]
+       [c-\portato d-\portato e-\portato f-\portato][g-\portato a-\portato b-\portato 'c-\portato]
+       ['c-\upbow b-\upbow a-\downbow g-\downbow][f-\downbow e-\downbow d-\upbow c-\upbow]
+       [c-| d-| e-| f-|][g-| a-| b-| 'c-|]
+       ['c b a g][f e d c]
+       [c d e f][g a b 'c]
+       ['c b a g][f e d c]
+               $}
+       commands {      
+       }
+}
+score {
+       staff {
+       blah
+       }
+       paper {
+               symboltables { table_sixteen}
+               unitspace 1.5 cm
+               geometric 1.4
+       }
+       commands  {meter 4 4
+
+               skip 18:0
+       }
+}
\ No newline at end of file
index 01807f123e24fda107160bd764ad0ad2f397224b..edfd6a8e3c40d609ec294a6deea5efa916848224 100644 (file)
@@ -12,7 +12,7 @@ Bar::Bar( String t)
 Molecule*
 Bar::brew_molecule()const
 {    
-    Symbol s = paper()->lookup_->bar(type);
+    Symbol s = paper()->lookup_p_->bar(type);
 Molecule*    output = new Molecule(Atom(s));
 return output;
     
index 5edf3ce7eba7af27c9a50a37a9d90cc2c7b53d2d..1016320deae1339c35785637aff3a4e3ebde1fc9 100644 (file)
@@ -50,7 +50,6 @@ Beam::center()const
 
 Beam::Beam()
 {
-    group = 0;
     slope = 0;
     left_pos = 0.0;
     dir =0;
@@ -85,7 +84,7 @@ Beam::set_default_dir()
 void
 Beam::solve_slope()
 {
-    svec<Stem_info> sinfo;
+    Array<Stem_info> sinfo;
     for (iter_top(stems,i); i.ok(); i++) {
        i->set_default_extents();
        Stem_info info(i);
@@ -93,14 +92,14 @@ Beam::solve_slope()
     }
     Real leftx = sinfo[0].x;
     Least_squares l;
-    for (int i=0; i < sinfo.sz(); i++) {
+    for (int i=0; i < sinfo.size(); i++) {
        sinfo[i].x -= leftx;
        l.input.add(Offset(sinfo[i].x, sinfo[i].idealy));
     }
 
     l.minimise(slope, left_pos);
     Real dy = 0.0;
-    for (int i=0; i < sinfo.sz(); i++) {
+    for (int i=0; i < sinfo.size(); i++) {
        Real y = sinfo[i].x * slope + left_pos;
        Real my = sinfo[i].miny;
 
@@ -113,7 +112,7 @@ Beam::solve_slope()
 
                                // URG
     Real sl = slope*paper()->internote();
-    paper()->lookup_->beam(sl, convert_dimen(20,"pt"));
+    paper()->lookup_p_->beam(sl, convert_dimen(20,"pt"));
     slope = sl /paper()->internote();
 }
 
@@ -141,28 +140,28 @@ Beam::set_grouping(Rhythmic_grouping def, Rhythmic_grouping cur)
 {
     def.OK();
     cur.OK();
-    assert(cur.children.sz() == stems.size());
+    assert(cur.children.size() == stems.size());
     
     cur.split(def);
-    group = new Rhythmic_grouping(cur);
-    svec<int> b;
+
+    Array<int> b;
     {
        iter_top(stems,s);
-       svec<int> flags;
+       Array<int> flags;
        for (; s.ok(); s++) {
            int f = intlog2(abs(s->flag))-2;
            assert(f>0);
            flags.add(f);
        }
        int fi =0;
-       b= group->generate_beams(flags, fi);
+       b= cur.generate_beams(flags, fi);
        b.insert(0,0);
        b.add(0);
-       assert(stems.size() == b.sz()/2);
+       assert(stems.size() == b.size()/2);
     }
 
     iter_top(stems,s);
-    for (int i=0; i < b.sz() && s.ok(); i+=2, s++) {
+    for (int i=0; i < b.size() && s.ok(); i+=2, s++) {
        s->beams_left = b[i];
        s->beams_right = b[i+1];
     }
@@ -179,8 +178,8 @@ Beam::do_break_at( PCol *, PCol *) const
 void
 Beam::do_pre_processing()
 {
-    left  = (*stems.top())   ->pcol_;
-    right = (*stems.bottom())->pcol_;    
+    left  = (*stems.top())   ->pcol_l_;
+    right = (*stems.bottom())->pcol_l_;    
     assert(stems.size()>1);
     if (!dir)
        set_default_dir();
@@ -207,7 +206,7 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
     Real dy=paper()->internote()*2;
     Real stemdx = paper()->rule_thickness();
     Real sl = slope*paper()->internote();
-    paper()->lookup_->beam(sl, convert_dimen(20,"pt"));
+    paper()->lookup_p_->beam(sl, convert_dimen(20,"pt"));
 
     Molecule leftbeams;
     Molecule rightbeams;
@@ -217,7 +216,7 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
        int lhalfs= lhalfs = here->beams_left - prev->beams_right ;
        int lwholebeams= here->beams_left <? prev->beams_right ;
        Real w = (here->hpos() - prev->hpos())/4;
-       Atom a =  paper()->lookup_->beam(sl, w);
+       Atom a =  paper()->lookup_p_->beam(sl, w);
        a.translate(Offset (-w, -w * sl));
        for (int j = 0; j  < lhalfs; j++) {
            Atom b(a);
@@ -231,7 +230,7 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
        int rwholebeams = here->beams_right <? next->beams_left; 
 
        Real w = next->hpos() - here->hpos();
-       Atom a = paper()->lookup_->beam(sl, w + stemdx);
+       Atom a = paper()->lookup_p_->beam(sl, w + stemdx);
        
        int j = 0;
        for (; j  < rwholebeams; j++) {
@@ -240,7 +239,7 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
            rightbeams.add( b ); 
        }
        w /= 4;
-       a = paper()->lookup_->beam(sl, w);
+       a = paper()->lookup_p_->beam(sl, w);
        
        for (; j  < rwholebeams + rhalfs; j++) {
            Atom b(a);
@@ -257,7 +256,6 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
 Molecule*
 Beam::brew_molecule() const return out;
 {
-    assert(left->line == right->line);
     Real inter=paper()->internote();
     out = new Molecule;
     Real x0 = stems.top()->hpos();
@@ -288,5 +286,5 @@ Beam::print()const
 
 Beam::~Beam()
 {
-    delete group;
+
 }
index d6564663a1e63710df939c2ffbfb60a0eed5c601..f83f7659e929eca8fe24a4771caf09c9d2020c7a 100644 (file)
@@ -1,6 +1,6 @@
 #include "boxes.hh"
 #include "const.hh"
-#include "vray.hh"
+#include "varray.hh"
 
 
 Box::Box()
index e27abd9b849099eb2a0257add77bbd07c7b811b7..2a0586edff2b0e0775029ba4dcf5074b787c1b04 100644 (file)
 /*
   return all breakable columns
  */
-svec<PCol *>
+Array<PCol *>
 Break_algorithm::find_breaks() const
 {
-    svec<PCol *> retval;
+    Array<PCol *> retval;
     for (iter_top(pscore_.cols,c); c.ok(); c++)
        if (c->breakable())
-
-
            retval.add(c);
 
     return retval;
 }
 
 // construct an appropriate Spacing_problem and solve it. 
-svec<Real>
+Array<Real>
 Break_algorithm::solve_line(Line_of_cols curline) const
 {
    Spacing_problem sp;
 
    sp.add_column(curline[0], true, 0.0);
-   for (int i=1; i< curline.sz()-1; i++)
+   for (int i=1; i< curline.size()-1; i++)
        sp.add_column(curline[i]);
    sp.add_column(curline.last(), true, linelength);
 
@@ -41,21 +39,21 @@ Break_algorithm::solve_line(Line_of_cols curline) const
    for (iter_top(pscore_.suz,i); i.ok(); i++) {
        sp.add_ideal(i);
    }
-   svec<Real> the_sol=sp.solve();
+   Array<Real> the_sol=sp.solve();
    return the_sol;
 }
 
 Break_algorithm::Break_algorithm(PScore&s)
     :pscore_(s)
 {
-    linelength = s.paper_->linewidth;
+    linelength = s.paper_l_->linewidth;
 }
 
 bool
 Break_algorithm::feasible(Line_of_cols curline) const
 {
     Real l =0;
-    for (int i=0; i < curline.sz(); i++)
+    for (int i=0; i < curline.size(); i++)
        l +=curline[i]->width().length();
     return l < linelength;    
 }
@@ -88,7 +86,7 @@ Col_configuration::add( PCol*c)
 }
 
 void
-Col_configuration::setsol(svec<Real> sol)
+Col_configuration::setsol(Array<Real> sol)
 {
     config = sol;
     energy = config.last();
@@ -100,11 +98,13 @@ Col_configuration::print() const
 {
 #ifndef NPRINT
     mtor << "energy : " << energy << '\n';
-    mtor << "line of " << config.sz() << " cols\n";
+    mtor << "line of " << config.size() << " cols\n";
 #endif
 }
 void
 Col_configuration::OK()const
 {
-    assert(config.sz() == cols.sz());
+#ifndef NDEBUG
+    assert(config.size() == cols.size());
+#endif
 }
index 77cef180ef47bf4a83eb7e326d4e00f6eee7f879..b6d34115081e2ca5c5f063dde5ebfe24aa0420b8 100644 (file)
@@ -9,32 +9,12 @@
 #include "dimen.hh"
 
 
-void
-Score::do_connect(PCol *c1, PCol *c2, Real d, Real h)
-{
-    if (!c1 || !c2 )
-       return;
-    Idealspacing*sp=pscore_->get_spacing(c1,c2);
-       
-    if (!sp->hooke){
-       sp->hooke = h;
-       sp->space =d;
-    }
-}
-
-void
-Score::connect(PCol* c1, PCol *c2, Real d, Real h)
-{
-    do_connect(c1,c2,d,h);
-    do_connect(c1->postbreak, c2,d,h);
-    do_connect(c1, c2->prebreak,d,h);
-    do_connect(c1->postbreak, c2->prebreak,d,h);
-}
+/*
+  this needs A LOT of rethinking.
 
-/* this needs A LOT of rethinking.
+  generate springs between columns.
 
-    generate springs between columns.
-    */
+  */
 void
 Score::calc_idealspacing()
 {
@@ -43,21 +23,20 @@ Score::calc_idealspacing()
     for (; i.ok(); i++) {
        assert(i->used());
        PCursor<Score_column*> j(i+1);
-       if (i->musical) {
+       if (i->musical_) {
            assert(j.ok());
-           for (int n=0; n < i->durations.sz(); n++) {
+           for (int n=0; n < i->durations.size(); n++) {
                Moment d = i->durations[n];
-               Real dist = paper_->duration_to_dist(d);
-               while (j->when < d + i->when)
+               Real dist = paper_p_->duration_to_dist(d);
+               while (j->when() < d + i->when())
                    j++;
-               
-               assert( j->when== d+i->when);
+               assert( j->when()== d+i->when());
 
-               connect(i->pcol_, j->pcol_, dist);
-               if (!j->musical && (j+1).ok() 
-                   && (j+1)->when == j->when) {
+               pscore_p_->connect(i->pcol_l_, j->pcol_l_, dist);
+               if (!j->musical_ && (j+1).ok() 
+                   && (j+1)->when() == j->when()) {
                    j++;
-                   connect(i->pcol_, j->pcol_,  dist);
+                   pscore_p_->connect(i->pcol_l_, j->pcol_l_,  dist);
                }
            }
        } else if (j.ok()) {
@@ -66,14 +45,13 @@ Score::calc_idealspacing()
              the last col is breakable, and therefore in use
              */
            
-           Moment d = j->when - i->when;
-           Real dist = (d) ? paper_->duration_to_dist(d) :
+           Moment d = j->when() - i->when();
+           Real dist = (d) ? paper_p_->duration_to_dist(d) :
                convert_dimen(2,"pt"); // todo
            
-           connect(i->pcol_, j->pcol_, dist, (d) ? 1.0:1.0);
+           pscore_p_->connect(i->pcol_l_, j->pcol_l_, dist, (d) ? 1.0:1.0);
        }
-           // !j.ok() might hold if we're at the last col.
-       
+       // !j.ok() might hold if we're at the last col.
     }
 }
 
index 49671dd4267f5d87109b5405a4873fe7b08f2c13..0abd26f44ae72e6bc9a0a8ea49f2bc3e46de2f62 100644 (file)
@@ -7,7 +7,7 @@ Clef::Clef()
 }
 
 void
-Clef::read(svec<Scalar>args)
+Clef::read(Array<Scalar>args)
 {
     clef_type = args[0];
     if (clef_type == "violin") {
index 4289c643749d412839cf9026816b173c03b37098..c6b8f09d0bb98c61664407549205079c2fffcc65 100644 (file)
@@ -31,7 +31,7 @@ Clef_item::brew_molecule()const
     String t = type;
     if  (change)
        t += "_change";
-    Symbol s = paper()->lookup_->clef(t);
+    Symbol s = paper()->lookup_p_->clef(t);
     Molecule*output = new Molecule(Atom(s));
     output->translate(Offset(0, paper()->interline()/2 * y_off));
     return output;
index 98be691cd30a259db5ead74c515f1125ecb8b5c4..7ddebc6f820210661aa0573532379603df54ee43 100644 (file)
@@ -21,9 +21,9 @@ Command::print() const
     mtor << "Command " << "code " << code << " prio " << priority;
     if ( isbreak())
        mtor << "(break separator)";
-    if (args.sz()) {
+    if (args.size()) {
        mtor<< " args: ";
-       for (int i = 0; i<args.sz(); i++)
+       for (int i = 0; i<args.size(); i++)
            mtor << "`"<<args[i] <<"',";
     }
     mtor << "\n";
index 1d27e81359bc04e3f9f07eeabf411d8802f07e6d..ea0cb4b8c44c6ee9b6891a453dbfff7fc9c2ece7 100644 (file)
@@ -16,7 +16,6 @@ ostream * nulldev = new ofstream("/dev/null");
 void
 mynewhandler()
 {
-    cerr << "Out of free store memory. Aborting.. "<< flush;
     assert(false);
 }
 
@@ -30,7 +29,9 @@ float_handler(int)
 void
 debug_init()
 {
+#ifndef NDEBUG
     set_new_handler(&mynewhandler);
+#endif
     set_matrix_debug(monitor);
     signal(SIGFPE, float_handler);
 }   
@@ -44,32 +45,3 @@ set_debug(bool b)
 }
 
 
-#if 0 // want to debug mem functions
-
-
-/// 
-static
-void foobulize(void *p , size_t s)
-{
-//    assert(s < 2000000);
-    memset(p, 0xf0, s);
-}
-/**
-  trash a portion of memory. Make sure access to deleted stuff is bogus.
-  */
-void *
-operator new (size_t s)
-{
-    void *p = malloc(s);
-    assert(p);
-//    foobulize(p,s);
-    return p;
-}
-
-void
-operator delete(void *p, size_t s)
-{
-    foobulize(p,s);
-    free(p);
-}
-#endif
index b415e0b1cfb5d0a1cef5376a4bdeca5bb6acbb9b..6545c0ec1c083f5cb445aa0c74d73cb3552dbb61 100644 (file)
@@ -4,7 +4,7 @@
 #include "command.hh"
 
 Command*
-get_key_typeset_command(svec<Scalar>which)
+get_key_typeset_command(Array<Scalar>which)
 {
     Command*c = new Command;
     c->code = TYPESET;    
@@ -20,7 +20,6 @@ get_meter_command(int n, int m)
 {
     Command*c = new Command;
     
-//    c->when = w;
     c->code = TYPESET;
     c->args.add( "METER");
     c->args.add( n );
@@ -29,3 +28,38 @@ get_meter_command(int n, int m)
     return c;
 }
 
+Command
+get_defaultbar_command()
+{
+    Command c;
+    c.code = TYPESET;
+    c.args.add("BAR");
+    c.args.add("default");
+    return c;
+}
+
+void
+split_bar_command(Command &pre_com, Command &no_break_com, Command &post_com,
+                 String s)
+{
+    Command c;
+    c.code = TYPESET;
+    c.priority = (s=="default") ? 100: 110;
+    c.args.add("BAR");
+    if(s=="default")
+       s = "|";
+    
+    if (s == "|" || s == ":|" || s == "||") {
+       c.args.add(s);
+       pre_com= no_break_com= c;       
+    } else if (s == ":|:") {
+       no_break_com=post_com=pre_com = c;
+       
+       pre_com.args.add( ":|");
+       no_break_com.args.add( s);
+       post_com.args.add( "|:");
+    }else if (s=="|:") {
+       c.args.add(s);
+       no_break_com=post_com=c;
+    } 
+}
index c7d38dbdae5b0a12e6eb44c9191a0340787a5147..4b8efaee6cdb8b74eeda27701ef5e387e6114aed 100644 (file)
@@ -12,14 +12,16 @@ Rhythmic_grouping::init()
 void
 Rhythmic_grouping::OK()const
 {
-    assert(bool(children.sz()) != bool(interval_));
+#ifndef NDEBUG
+    assert(bool(children.size()) != bool(interval_));
 
-    for (int i= 0; i < children.sz(); i++) {
+    for (int i= 0; i < children.size(); i++) {
        children[i]->OK();
        if (i>0)
            assert(children[i-1]->interval().right ==
                   children[i]->interval().left);
     }
+#endif
 }
 
 Moment
@@ -48,7 +50,7 @@ Rhythmic_grouping::split(Rhythmic_grouping r)
     r.intersect(interval());
     split(r.intervals());
     
-    for (int i= 0; i < children.sz(); i++) {
+    for (int i= 0; i < children.size(); i++) {
        if (!children[i]->interval_) {
            Rhythmic_grouping here(r);  
            children[i]->split(here);
@@ -57,17 +59,17 @@ Rhythmic_grouping::split(Rhythmic_grouping r)
 }
 
 
-svec<MInterval>
+Array<MInterval>
 Rhythmic_grouping::intervals()
 {
-    svec<MInterval> r;
-    if (interval_ || children.sz() == 1) {
+    Array<MInterval> r;
+    if (interval_ || children.size() == 1) {
        MInterval i(interval());
        MInterval r1(i), r2(i);
        r1.right = r2.left = i.center();
        r.add(r1); r.add(r2);
     } else {
-       for (int i=0; i < children.sz(); i++)
+       for (int i=0; i < children.size(); i++)
            r.add(children[i]->interval());
     }
     return r;
@@ -80,7 +82,7 @@ Rhythmic_grouping::intersect(MInterval t)
        return;
     }
     
-    for (int i=0; i < children.sz(); i++) {
+    for (int i=0; i < children.size(); i++) {
        MInterval inter = intersection(t, children[i]->interval());
        if (inter.empty() || inter.length() <= 0) {
            delete children[i];
@@ -89,7 +91,7 @@ Rhythmic_grouping::intersect(MInterval t)
            children[i]->intersect(t);
        }
     }
-    for (int i=0; i < children.sz(); ) {
+    for (int i=0; i < children.size(); ) {
        if (!children[i])
            children.del(i);
        else
@@ -99,14 +101,14 @@ Rhythmic_grouping::intersect(MInterval t)
 }
 
 void
-Rhythmic_grouping::split(svec<MInterval> splitpoints)
+Rhythmic_grouping::split(Array<MInterval> splitpoints)
 {
     //check on splitpoints..
     int j = 0, i=0, starti = 0, startj = 0;
     
-    svec<Rhythmic_grouping*> ch;
+    Array<Rhythmic_grouping*> ch;
     while (1) {
-       if  ( i >= children.sz() || j >= splitpoints.sz())
+       if  ( i >= children.size() || j >= splitpoints.size())
            break;
        
        assert( 
@@ -152,7 +154,7 @@ Rhythmic_grouping::Rhythmic_grouping(MInterval t, int n)
 }
 
 
-Rhythmic_grouping::Rhythmic_grouping(svec<Rhythmic_grouping*> r)
+Rhythmic_grouping::Rhythmic_grouping(Array<Rhythmic_grouping*> r)
     :children(r)
 {
     interval_ =0;
@@ -168,7 +170,7 @@ void
 Rhythmic_grouping::copy(Rhythmic_grouping const&s)
 {
     interval_ =  (s.interval_)? new MInterval(*s.interval_) : 0;
-    for (int i=0; i < s.children.sz(); i++)
+    for (int i=0; i < s.children.size(); i++)
        children.add(new Rhythmic_grouping(*s.children[i]));
 }
 
@@ -189,7 +191,7 @@ void
 Rhythmic_grouping::junk()
 {
     delete interval_;
-    for (int i=0; i < children.sz(); i++)
+    for (int i=0; i < children.size(); i++)
        delete children[i];
     init();
 }
@@ -201,7 +203,7 @@ Rhythmic_grouping::print()const
     mtor << "{ \n";
     if (interval_)
        mtor<<" Interval "<< interval_->str();
-    for (int i=0; i < children.sz(); i++) {
+    for (int i=0; i < children.size(); i++) {
        children[i]->print();
     }
     mtor << "}\n";
@@ -212,14 +214,14 @@ void
 Rhythmic_grouping::add_child(Moment start, Moment len)
 {
     Moment stop = start+len;
-    for (int i=0; i < children.sz(); i ++) {
+    for (int i=0; i < children.size(); i ++) {
        MInterval j=children[i]->interval();
        if (j.left == start && j.right==stop) {
            return;
        }
     }
     
-    if (children.sz())
+    if (children.size())
        assert ( children.last()->interval().right== start);
 
     children.add(new Rhythmic_grouping(MInterval(start, stop)));
@@ -231,23 +233,23 @@ Rhythmic_grouping::Rhythmic_grouping()
 }
 
 int
-min_elt(svec<int> v)
+min_elt(Array<int> v)
 {
     int i = 1000;              // ugh
-    for (int j = 0 ; j <  v.sz(); j++)
+    for (int j = 0 ; j <  v.size(); j++)
        i = i <? v[j];
     return i;
 }
 
-svec<int>
-Rhythmic_grouping::generate_beams(svec<int> flags, int &flagidx)
+Array<int>
+Rhythmic_grouping::generate_beams(Array<int> flags, int &flagidx)
 {
     
     assert (!interval_) ;
     
-    svec< svec<int> > children_beams;
-    for (int i=0; i < children.sz(); i++) {
-       svec<int> child_beams;
+    Array< Array<int> > children_beams;
+    for (int i=0; i < children.size(); i++) {
+       Array<int> child_beams;
        if (children[i]->interval_) {
            int f = flags[flagidx++];
            child_beams.add(f);
@@ -257,18 +259,18 @@ Rhythmic_grouping::generate_beams(svec<int> flags, int &flagidx)
        }
        children_beams.add(child_beams);
     }
-    svec<int> beams;
+    Array<int> beams;
     int lastm, m, nextm;
-    for (int i=0; i  < children_beams.sz(); i++) {
+    for (int i=0; i  < children_beams.size(); i++) {
        bool add_left =  (i >0);
-       bool add_right = (i  < children_beams.sz() -1);
+       bool add_right = (i  < children_beams.size() -1);
 
        if (!i)
            m =  min_elt(children_beams[i]);
        if (add_right)
            nextm = min_elt(children_beams[i+1]);
        
-       if (children_beams[i].sz() == 1) {
+       if (children_beams[i].size() == 1) {
            if (add_right)
                beams.add(m);
            if (add_left)
@@ -283,7 +285,7 @@ Rhythmic_grouping::generate_beams(svec<int> flags, int &flagidx)
        lastm = m;
        m = nextm;      
     }
-    assert(!(beams.sz()%2));
+    assert(!(beams.size()%2));
     return beams;
 }
 
index fda5ceefcf5b85d853e0b5393a737251c5c1463c..9cedc52c2ab5c42d5d235999f533d85bab375d1b 100644 (file)
@@ -10,7 +10,7 @@ Input_command::Input_command()
 Input_command::operator Command()
 {
     Command c;
-    if (!args.sz())
+    if (!args.size())
        return c;
     
     c.code = INTERPRET;
@@ -45,22 +45,22 @@ get_partial_command(Moment u)
 }
 
 Input_command*
-get_grouping_command(svec<int>a ) 
+get_grouping_command(Array<int>a ) 
 {
     Input_command*c = new Input_command;
     c->args.add("GROUPING");    
-    for (int i=0; i < a.sz(); i ++)
+    for (int i=0; i < a.size(); i ++)
        c->args.add(a[i]);
 
     return c;
 }
 
 Input_command*
-get_key_interpret_command(svec<int >a ) 
+get_key_interpret_command(Array<int >a ) 
 {
     Input_command*c = new Input_command;
     c->args.add("KEY");
-    for (int i=0; i < a.sz(); i ++) {
+    for (int i=0; i < a.size(); i ++) {
        c->args.add(a[i]);
     }
     return c;
@@ -87,12 +87,11 @@ get_meterchange_command(int n, int m)
 }
 
 Input_command *
-get_bar_command()
+get_newmeasure_command()
 {
     Input_command*c = new Input_command;
 
-    c->args.add( "BAR");
-    c->args.add( "|");
+    c->args.add( "NEWMEASURE");
 
     return c;
 }
@@ -114,9 +113,9 @@ void
 Input_command::print()const
 {
     mtor << "{ ";
-    if (args.sz()) {
+    if (args.size()) {
        mtor<< " args: ";
-       for (int i = 0; i<args.sz(); i++)
+       for (int i = 0; i<args.size(); i++)
            mtor << "`"<<args[i] <<"',";
     }
     mtor << "}\n";
@@ -131,10 +130,19 @@ get_clef_interpret_command(String w)
     return c;
 }
 
-svec<int>
+Input_command*
+get_bar_command(String w)
+{
+    Input_command*c = new Input_command;
+    c->args.add("BAR");
+    c->args.add(w);
+    return c;
+}
+
+Array<int>
 get_default_grouping(int count)
 {
-    svec<int> s;
+    Array<int> s;
     if (!(count % 3 )) {
        for (int i=0; i < count/3; i++)
            s.add(3);
index 64e8fa9598ef7e6a9fe950d12de4d90a77b66d4a..90d6eeffa64831cf2499dbfa554a1711d912e9a5 100644 (file)
@@ -4,6 +4,8 @@
 #include "staffcommands.hh"
 #include "getcommand.hh"
 #include "command.hh"
+#include "stcol.hh"
+#include "staff.hh"
 
 void
 Commands_at::print() const
@@ -25,7 +27,7 @@ Commands_at::Commands_at(Moment dt, Commands_at* prev)
     : tdescription_(dt, (prev)? &prev->tdescription_ : 0)
 {
     if (prev&& !tdescription_.whole_in_measure) {
-       bottom().add(get_bar_command());
+       bottom().add(get_newmeasure_command());
     }
 }
 
@@ -70,7 +72,7 @@ Commands_at::parse(Staff_commands_at*s)
 {
     s->tdescription_ = tdescription_;
     for (iter_top(*this,cc); cc.ok(); cc++) {
-       if (cc->args.sz() &&  cc->args[0] !="") {
+       if (cc->args.size() &&  cc->args[0] !="") {
            Command c = **cc;
            s->add(c);
            
@@ -169,30 +171,31 @@ Input_commands::add(Input_command c)
     
 }
 
-Staff_commands*
-Input_commands::parse() const
+void
+Input_commands::parse(Staff * staff_l) const
 {
     print();
-    Staff_commands*nc = new Staff_commands;
-
     for (iter_top(*this,i); i.ok(); i++) {
 
-       Staff_commands_at* s= nc->find(i->when());
-       if (!s){
-           s = new Staff_commands_at(i->tdescription_);
-           nc->add(s);
-       }
+       Staff_column* col_l = staff_l->get_col(i->when(), false);
+       if (!col_l->staff_commands_p_)
+           col_l->staff_commands_p_ = new Staff_commands_at(i->tdescription_);
+       
+       Staff_commands_at * com_l = col_l->staff_commands_p_;
+       
        if (!i->when()) {   /* all pieces should start with a breakable. */
+           com_l->set_breakable();
+           #if 0
            Command c;//(0.0);
            c.code = INTERPRET;
            c.args.add("BAR");
            c.args.add("empty");
-           s->add(c);
+           com_l->add(c);
+           #endif
        }
 
-       i->parse(s);
+       i->parse(com_l);
     }
-    return nc;
 }
 
 
index 8bbe7e266e3bccf21a496c9d16de40d5367fd853..cdc348c725fd3f5f9d78a5509293f06285290bd6 100644 (file)
@@ -6,10 +6,10 @@
 #include "paper.hh"
 
 void
-Input_score::add(svec<Input_command*> &s)
+Input_score::add(Array<Input_command*> &s)
 {
     commands_.bottom().add(get_reset_command());
-    for (int i=0; i < s.sz(); i++)
+    for (int i=0; i < s.size(); i++)
        commands_.bottom().add(s[i]);
 }
 
@@ -29,19 +29,20 @@ Input_score::set(Paperdef*p)
 Score*
 Input_score::parse()
 {
-    Paperdef* p=new Paperdef(*paper_);
-    Score *s = new Score(p);
+    Paperdef* paper_p=new Paperdef(*paper_);
+    Score *s_p = new Score(paper_p);
     
     for (iter_top(staffs_,i); i.ok(); i++) {
-       Staff* staf=i->parse(commands_);
-       s->add(staf);
+       Staff* staf_p=i->parse(commands_, s_p);
+       s_p->add(staf_p);
     }
-    return s;
+    return s_p;
 }
 
 Input_score::~Input_score()
 {
-    // should fix paper/symtabs to allow this deletion.
+    // TODO!
+//should fix paper/symtabs to allow this deletion.
 //    delete paper_;
 }
 
index 97622a9dab808840dddf81196bedf73e536a19b1..1786f3e29359be6e4401c522e461b9fe2f3589f6 100644 (file)
 #include "staff.hh"
 
 void
-Input_staff::add(svec<Input_command*> &s)
+Input_staff::add(Array<Input_command*> &s)
 {
     commands_.bottom().add(get_reset_command());
-    for (int i=0; i < s.sz(); i++)
+    for (int i=0; i < s.size(); i++)
        commands_.bottom().add(s[i]);
     s.set_size(0);
 }
@@ -30,7 +30,7 @@ Input_staff::add(Input_music*m)
 }
 
 Staff*
-Input_staff::parse(PointerList<Input_command*> score_wide)
+Input_staff::parse(PointerList<Input_command*> score_wide, Score*score_l)
 {
     Staff *p=0;
     
@@ -38,7 +38,7 @@ Input_staff::parse(PointerList<Input_command*> score_wide)
        p = new Melodic_staff;
     else if (type == "rhythmic")
        p = new Rhythmic_staff;
-
+    p->score_l_ = score_l;
     for (iter_top(music_,i); i.ok(); i++) {
        Voice_list vl = i->convert();
        p->add(vl);
@@ -50,7 +50,7 @@ Input_staff::parse(PointerList<Input_command*> score_wide)
     for (iter_top(commands_,i); i.ok(); i++) 
        commands.add(**i);
 
-    p->staff_commands_ = commands.parse();
+    commands.parse(p);
 
     return p;
 }
@@ -60,7 +60,7 @@ Input_staff::Input_staff(Input_staff&s)
     for (iter_top(s.commands_,i); i.ok(); i++)
        commands_.bottom().add(new Input_command(**i));
     for (iter_top(s.music_,i); i.ok(); i++)
-       add(i);
+       add(i->clone());
 
     type = s.type;
 }
index 64dcc1e1f448e0e57fe2807efc43dc4e52325937..11096c95c006e305042076c207ed8999517b95b7 100644 (file)
@@ -3,7 +3,7 @@
 
 Item::Item()
 {
-    pcol_ = 0;
+    pcol_l_ = 0;
 }
 
 void
index dac8c266ec2240c641e325e9b813b07d261c3575..cd7f400737c4a56464ed4d599ca1c016e3e23cbe 100644 (file)
@@ -36,14 +36,14 @@ Local_key::reset(Key k)
        octaves[i] = k;
 }
 
-svec<int>
-Key::read(svec<Scalar> s)
+Array<int>
+Key::read(Array<Scalar> s)
 {
-    svec<int> newkey;
+    Array<int> newkey;
     for (int j = 0; j < 7; j++)
        accidentals[j] = 0;
    
-    for (int i=0; i < s.sz(); ) {
+    for (int i=0; i < s.size(); ) {
        int large = s[i++];
        int small = s[i++];
        accidentals[large]=small;
@@ -54,21 +54,21 @@ Key::read(svec<Scalar> s)
     return newkey;
 }
 
-svec<int>
-Key::oldkey_undo(svec<Scalar>s)
+Array<int>
+Key::oldkey_undo(Array<Scalar>s)
 {
-    svec<int> oldkey;
-    svec<int> newkey;
+    Array<int> oldkey;
+    Array<int> newkey;
     newkey.set_size(7);
-    for (int i=0; i < newkey.sz(); i++)
+    for (int i=0; i < newkey.size(); i++)
        newkey[i] = 0;
        
-    for (int i=0; i < s.sz(); ) {
+    for (int i=0; i < s.size(); ) {
        int large = s[i++];
        int small = s[i++];
        newkey[large] = small;
     }
-    for (int i=0; i < newkey.sz(); i++)
+    for (int i=0; i < newkey.size(); i++)
        if (accidentals[i] && accidentals[i] != newkey[i]) {
            oldkey.add(i);
            oldkey.add(0);
index 3499149352cde1c6f14235781244981276a7e66f..29b1f25e5c9fc91ad59e3622280ec6c85299bb3e 100644 (file)
@@ -12,9 +12,9 @@ Keyitem::Keyitem(int c)
 }
 
 void
-Keyitem::read(svec<int> s)
+Keyitem::read(Array<int> s)
 {
-    for (int i = 0 ; i< s.sz(); ) {
+    for (int i = 0 ; i< s.size(); ) {
        int note = s[i++];
        int acc = s[i++];
            
@@ -36,14 +36,14 @@ Keyitem::brew_molecule()const
     Molecule*output = new Molecule;
     Real inter = paper()->interline()/2;
     
-    for (int i =0; i < pitch.sz(); i++) {
-       Symbol s= paper()->lookup_->accidental(acc[i]);
+    for (int i =0; i < pitch.size(); i++) {
+       Symbol s= paper()->lookup_p_->accidental(acc[i]);
        Atom a(s);
        a.translate(Offset(0,(c_position + pitch[i]) * inter));
        Molecule m(a);
        output->add_right(m);   
     }
-    Molecule m(paper()->lookup_->fill(Box(
+    Molecule m(paper()->lookup_p_->fill(Box(
        Interval(0, paper()->note_width()),
        Interval(0,0))));
     output->add_right(m);
index 1e1c91cee36f650db9d56467ac523fc9dafb072a..adbc09821936e93a768636f36443db2d789ecc09 100644 (file)
@@ -8,7 +8,7 @@ Least_squares::minimise(Real &coef, Real &offset)
     Real sqx =0.0;
     Real sxy = 0.0;
 
-    for (int i=0; i < input.sz();i++) {
+    for (int i=0; i < input.size();i++) {
        Real x=input[i].x;
        Real y = input[i].y;
        sx += x;
@@ -16,7 +16,7 @@ Least_squares::minimise(Real &coef, Real &offset)
        sqx += sqr(x);
        sxy += x*y;
     }
-    int N = input.sz();
+    int N = input.size();
     
 
     coef = (N * sxy - sx*sy )/(N*sqx - sqr(sx));
index 22bda7c92eeb821d9ccb82ec97eb0e551fed9369..9f99dd27134fafd5c4129ce9297883beeb4088ba 100644 (file)
@@ -5,7 +5,7 @@
 #include "string.hh"
 #include "notename.hh"
 #include "lexer.hh"
-#include "vray.hh"
+#include "varray.hh"
 #include "parser.hh"
 #include "debug.hh"
 
@@ -31,7 +31,7 @@ AN            {AA}|{N}
 WORD           {A}{AN}*
 ALPHAWORD      {A}+
 INT            -?{N}+
-REAL           {INT}(\.{N}*)?
+REAL           {INT}?(\.{N}*)?
 
 OPTSIGN                !?
 PITCHMOD       ['`]*{OPTSIGN}
@@ -95,8 +95,6 @@ DOTS          \.+
        yylval.i = String(YYText()).value();
        return INT;
 }
-<notes>\|              {
-}
 <notes>[%#].*\n                { 
 
 }
@@ -110,21 +108,13 @@ DOTS              \.+
        return YYText()[0];
        
 }
-<notes>[\[)]   { /* parens () are NO mistake */
-       yylval.c = YYText()[0];
-       return OPEN_REQUEST_PARENS;
-}
-<notes>[\](]   { /* parens () are NO mistake */
-       yylval.c = YYText()[0];
-       return CLOSE_REQUEST_PARENS;
-}
 <notes>\"[^\"]*\" {
        String s (YYText()+1);
        s = s.left(s.len()-1);
        yylval.string = new String(s);
        return STRING;
 }
-<notes>[/.^>_-] {
+<notes>[()\[\]|/.^>_-] {
        return yylval.c = YYText()[0];
 
 }
index f35f64e2fabfe0a2bb7c7c7c86147a9bdc4c69ee..920d3ba7abb7344f8fef66aaa3545e2b3ee91ac7 100644 (file)
@@ -12,7 +12,7 @@ const Real COLFUDGE=1e-3;
 bool
 Spacing_problem::contains(const PCol *w)
 {
-    for (int i=0; i< cols.sz(); i++)
+    for (int i=0; i< cols.size(); i++)
        if (cols[i].pcol_ == w)
            return true;
     return false;
@@ -21,7 +21,7 @@ Spacing_problem::contains(const PCol *w)
 int 
 Spacing_problem::col_id(const PCol *w)const
 {
-    for (int i=0; i< cols.sz(); i++)
+    for (int i=0; i< cols.size(); i++)
        if (cols[i].pcol_ == w)
            return i;
     assert(false);
@@ -32,20 +32,20 @@ void
 Spacing_problem::OK() const
 {
 #ifndef NDEBUG
-    Union_find connected(cols.sz());
-    svec<int> fixed;
-    for (int i=0; i < ideals.sz(); i++) {
+    Union_find connected(cols.size());
+    Array<int> fixed;
+    for (int i=0; i < ideals.size(); i++) {
        assert(ideals[i]->hooke > 0);
        int l = col_id(ideals[i]->left);
        int r = col_id(ideals[i]->right);
        connected.connect(l,r);         
     }
-    for (int i = 0; i < cols.sz(); i++)
+    for (int i = 0; i < cols.size(); i++)
        if (cols[i].fixed())
            fixed.add(i);
-    for (int i = 0; i < cols.sz(); i++) {
+    for (int i = 0; i < cols.size(); i++) {
        bool c=false;
-       for (int j =0; j<fixed.sz(); j++)
+       for (int j =0; j<fixed.size(); j++)
            c |=  connected.equiv(j,i);
        assert(c);
     }
@@ -101,7 +101,7 @@ Spacing_problem::check_feasible() const
 Vector
 Spacing_problem::try_initial_solution() const
 {
-    int dim=cols.sz();
+    int dim=cols.size();
     Vector initsol(dim);
     for (int i=0; i < dim; i++) {
        if (cols[i].fixed()) {
@@ -135,7 +135,7 @@ Spacing_problem::make_matrices(Matrix &quad, Vector &lin, Real &c) const
     quad.fill(0);
     lin.fill(0);
     c = 0;
-    for (int j=0; j < ideals.sz(); j++){
+    for (int j=0; j < ideals.size(); j++){
        Idealspacing const*i=ideals[j];
        int l = col_id(i->left);
        int r = col_id(i->right);
@@ -156,7 +156,7 @@ Spacing_problem::make_matrices(Matrix &quad, Vector &lin, Real &c) const
 void
 Spacing_problem::make_constraints(Mixed_qp& lp) const
 {    
-    int dim=cols.sz();
+    int dim=cols.size();
     for (int j=0; j < dim; j++) {
        Colinfo *c=&(cols[j]);
        if (c->fixed()) {
@@ -173,7 +173,7 @@ Spacing_problem::make_constraints(Mixed_qp& lp) const
     }
 }
 
-svec<Real>
+Array<Real>
 Spacing_problem::solve() const
 {
     print();
@@ -181,7 +181,7 @@ Spacing_problem::solve() const
     assert(check_feasible());
 
     /* optimalisatiefunctie */        
-    Mixed_qp lp(cols.sz());
+    Mixed_qp lp(cols.size());
     make_matrices(lp.quad,lp.lin, lp.const_term);
     make_constraints(lp);    
     Vector start=find_initial_solution();    
@@ -191,7 +191,7 @@ Spacing_problem::solve() const
     }
        
 
-    svec<Real> posns(sol);
+    Array<Real> posns(sol);
     posns.add(lp.eval(sol));
     return posns;
 }
@@ -234,11 +234,11 @@ void
 Spacing_problem::print() const
 {
 #ifndef NPRINT
-    for (int i=0; i < cols.sz(); i++) {
+    for (int i=0; i < cols.size(); i++) {
        mtor << "col " << i<<' ';
        cols[i].print();
     }
-    for (int i=0; i < ideals.sz(); i++) {
+    for (int i=0; i < ideals.size(); i++) {
        print_ideal(ideals[i]);
     }
 #endif
index 6d3985cb8b1621a944722c9df978f69edd53b550..f9430e9b7338f4aecc2fea8f51fc62d880cc1dd7 100644 (file)
@@ -15,8 +15,8 @@ Linestaff::Linestaff(int l, PScore *s)
 void
 Linestaff::brew_molecule(Real width)
 {
-    Atom a  = pscore_->paper_->lookup_->linestaff(nolines,width);
-    stafsym = new Molecule(a);    
+    Atom a  = pscore_l_->paper_l_->lookup_p_->linestaff(nolines,width);
+    stafsym_p_ = new Molecule(a);
 }
 
 
index 42bb268df01db8976ef97142470985cdfdd871b7..d23b26277f64884f95f94e16abb556be24effb3b 100644 (file)
@@ -33,7 +33,7 @@ Local_key_item::brew_molecule()const
     Molecule*    output = new Molecule;
     Molecule*octmol = 0;
     int lastoct = -100;
-    for  (int i = 0; i <  accs.sz(); i++) {
+    for  (int i = 0; i <  accs.size(); i++) {
        if (accs[i].octave != lastoct) {
            if (octmol){
                Real dy =lastoct*7*paper()->interline()/2;
@@ -44,7 +44,7 @@ Local_key_item::brew_molecule()const
            octmol= new Molecule;
        }
        lastoct = accs[i].octave;
-       Symbol s =paper()->lookup_->accidental(accs[i].acc);   
+       Symbol s =paper()->lookup_p_->accidental(accs[i].acc);   
        Atom a(s);
        Real dy = (accs[i].name + c0_position) * paper()->interline()/2;
        a.translate(Offset(0,dy));
index 9c8def52cf56f40947bb830b135f0aaa5d337472..200ae0994b9693da588ee58b5d30cdb6277b86c3 100644 (file)
@@ -31,7 +31,7 @@ Lookup::add(String s, Symtable*p)
 Symbol
 Lookup::text( String style, String text , int dir)
 {
-    svec<String> a;
+    Array<String> a;
  
     a.add(text);
     Symbol tsym =  (*symtables_)("style")->lookup(style);
@@ -129,7 +129,7 @@ Lookup::streepjes(int i)
     }
     Symbol ret = (*symtables_)("streepjes")->lookup(idx);
     
-    svec<String> a;
+    Array<String> a;
     a.add(arg);
     ret.tex = substitute_args(ret.tex, a);
 
@@ -146,7 +146,7 @@ Lookup::linestaff(int lines, Real wid)
     Real dy=(lines-1)*internote()*2;
     s.dim.y = Interval(0,dy);
 
-    svec<String> a;
+    Array<String> a;
     a.add(lines);
     a.add(print_dimen(wid));
 
@@ -158,7 +158,7 @@ Lookup::linestaff(int lines, Real wid)
 
 
 Symbol
-Lookup::meter(svec<Scalar> a)
+Lookup::meter(Array<Scalar> a)
 {
     Symbol s;
     s.dim.x = Interval( convert_dimen(0,"pt"),
@@ -179,7 +179,7 @@ Lookup::stem(Real y1,Real y2)
     s.dim.x = Interval(0,0);
     s.dim.y = Interval(y1,y2);
     
-    svec<String> a;
+    Array<String> a;
     a.add(print_dimen(y1));
     a.add(print_dimen(y2));
        
index dc3cb40f3e4645ef2c51f838705ed3e83b301cf8..fb8224ec07ee23ef3411ef23bc62b2ced0fb00b2 100644 (file)
@@ -4,7 +4,7 @@
 #include "paper.hh"
 #include "lookup.hh"
 
-Meter::Meter(svec<Scalar>a)
+Meter::Meter(Array<Scalar>a)
     :args(a)
 {
 }
@@ -12,7 +12,7 @@ Meter::Meter(svec<Scalar>a)
 Molecule*
 Meter::brew_molecule()const
 {
-    Symbol s = paper()->lookup_->meter(args);
+    Symbol s = paper()->lookup_p_->meter(args);
 return new Molecule(Atom(s));
 }
 
index 6b9db4cac3147a1020788589e1180214518430dc..682204880d11d95291426140c9037c7c9fd53737 100644 (file)
@@ -1,4 +1,4 @@
-#include "vray.hh"
+#include "varray.hh"
 #include "interval.hh"
 #include "dimen.hh"
 #include "string.hh"
@@ -32,7 +32,7 @@ Atom::TeXstring() const
 {
     // whugh.. Hard coded...
     String s("\\placebox{%}{%}{%}");
-    svec<String> a;
+    Array<String> a;
     a.add(print_dimen(off.y));
     a.add(print_dimen(off.x));
     a.add(sym.tex);
index 30ded730d47f4910e89594854d9483d3b1ab5ae3..4454e67727b7c054754d27dcb2cec9a91471b7ed 100644 (file)
@@ -7,7 +7,7 @@
 #include "voice.hh"
 #include "notename.hh"
 #include "identparent.hh"
-#include "vray.hh"
+#include "varray.hh"
 #include "textdef.hh"
 
 int default_duration = 4, default_dots=0, default_octave=0;
@@ -149,6 +149,9 @@ get_request(char c)
 {
     Request* ret=0;
     switch (c) {
+    case '|':
+       ret = new Barcheck_req;
+       break;
     case '[':
     case ']':
     {
@@ -177,8 +180,9 @@ get_request(char c)
     case ']':
        ret->span()->spantype = Span_req::STOP;
        break;
+       
     default:
-       assert(false);
+
        break;
     }
 
@@ -186,9 +190,9 @@ get_request(char c)
 }
 
 void
-add_requests(Voice_element *v, svec<Request*> &req)
+add_requests(Voice_element *v, Array<Request*> &req)
 {
-    for (int i = 0; i < req.sz(); i++) {
+    for (int i = 0; i < req.size(); i++) {
        v->add(req[i]);
     }
     req.set_size(0);
@@ -203,7 +207,7 @@ get_scriptdef(char c)
        break;
     case  '+' : s = "stopped";
        break;
-    case '-' : s = "portato";
+    case '-' : s = "tenuto";
        break;
     case  '|':  s = "staccatissimo";
        break;
index 5db73866004130ab3851effd31c21d177c6ecbf0..f6521a58fed326c2032ff5d17cdfd8b0b7b8cf52 100644 (file)
@@ -14,6 +14,7 @@ Notehead::Notehead(int ss)
     position = 0;
     balltype = 0;
     dots = 0;
+    extremal = 0;
 }
 
 void
@@ -39,11 +40,11 @@ Notehead::brew_molecule() const return out;
     Paperdef *p = paper();
 
     Real dy = p->internote();
-    Symbol s = p->lookup_->ball(balltype);
+    Symbol s = p->lookup_p_->ball(balltype);
     
     out = new Molecule(Atom(s));
     if (dots) {
-       Symbol d = p->lookup_->dots(dots);
+       Symbol d = p->lookup_p_->dots(dots);
        Molecule dm;
        dm.add(Atom(d));
        if (!(position %2))
@@ -55,7 +56,7 @@ Notehead::brew_molecule() const return out;
     if (streepjes) {
        int dir = sign(position);
        int s =(position<-1) ? -((-position)/2): (position-staff_size)/2;
-       Symbol str = p->lookup_->streepjes(s);
+       Symbol str = p->lookup_p_->streepjes(s);
        Molecule sm;
        sm.add(Atom(str));
        if (position % 2)
index 82b858387680f6415dd9f521f23bf2289b40b854..09fd19aad43efbf79ed6face06b89a6d40426a8f 100644 (file)
@@ -25,7 +25,7 @@ Paperdef::rule_thickness()const
 
 Paperdef::Paperdef(Lookup *l)
 {
-    lookup_ = l;
+    lookup_p_ = l;
 
     linewidth = convert_dimen(15,"cm");                // in cm for now
     whole_width = 8 * note_width();
@@ -34,32 +34,40 @@ Paperdef::Paperdef(Lookup *l)
 
 Paperdef::~Paperdef()
 {
-    delete lookup_;
+    delete lookup_p_;
+}
+Paperdef::Paperdef(Paperdef const&s)
+{
+    lookup_p_ = new Lookup(*s.lookup_p_);
+    geometric_ = s.geometric_;
+    whole_width = s.whole_width;
+    outfile = s.outfile;
+    linewidth = s.linewidth;
 }
 
 void
 Paperdef::set(Lookup*l)
 {
-    assert(l != lookup_);
-    delete lookup_;
-    lookup_ = l;
+    assert(l != lookup_p_);
+    delete lookup_p_;
+    lookup_p_ = l;
 }
 
 Real
 Paperdef::interline() const
 {
-    return lookup_->ball(4).dim.y.length();
+    return lookup_p_->ball(4).dim.y.length();
 }
 
 Real
 Paperdef::internote() const
 {
-    return lookup_->internote();
+    return lookup_p_->internote();
 }
 Real
 Paperdef::note_width()const
 {
-    return lookup_->ball(4).dim.x.length( );
+    return lookup_p_->ball(4).dim.x.length( );
 }
 Real
 Paperdef::standard_height() const
index 3ef8d182ff833bcc89f8fa854e8860f3392c971f..a2603284b3de3efecb140cc1e3290ef14ef357b0 100644 (file)
@@ -2,7 +2,6 @@
 #include <iostream.h>
 
 #include "lookup.hh"
-
 #include "misc.hh"
 #include "lexer.hh"
 #include "paper.hh"
@@ -19,7 +18,7 @@
 #define YYDEBUG 1
 #endif
 
-svec<Request*> pre_reqs, post_reqs;
+Array<Request*> pre_reqs, post_reqs;
 
 Paperdef*default_paper();
 %}
@@ -42,9 +41,9 @@ Paperdef*default_paper();
     char c;
     int ii[10];
 
-    svec<String> * strvec;
-    svec<Input_command*> *commandvec;
-    svec<int> *intvec;
+    Array<String> * strvec;
+    Array<Input_command*> *commandvec;
+    Array<int> *intvec;
 
     Input_staff *staff;    
     Input_score *score;
@@ -72,11 +71,11 @@ Paperdef*default_paper();
 %token <ii> NOTENAME 
 %token <real> REAL
 %token <string> STRING
-%token <c> OPEN_REQUEST_PARENS CLOSE_REQUEST_PARENS
+
 %token <i> DOTS INT
 %type <consstr> unit
 %type <intvec> pitch_list
-
+%type <c> open_request_parens close_request_parens
 %type <id> declaration
 %type <string> declarable_identifier
 %type <paper> paper_block paper_body
@@ -204,7 +203,7 @@ score_commands_block:
        COMMANDS '{' score_commands_body '}' { $$ =$3;}
        ;
 
-score_commands_body:                   { $$ = new svec<Input_command*>; }
+score_commands_body:                   { $$ = new Array<Input_command*>; }
        | score_commands_body score_command             {
                $$->add($2);
        }
@@ -215,7 +214,7 @@ staff_commands_block: COMMANDS '{' staff_commands_body '}'  {
        ;
 
 staff_commands_body:
-       /* empty */                     { $$ = new svec<Input_command*>; }
+       /* empty */                     { $$ = new Array<Input_command*>; }
        | staff_commands_body staff_command     {
                $$->add($2);
        }
@@ -246,6 +245,10 @@ skipcommand:
 
 score_command:
        skipcommand
+       | BAR STRING                    {
+               $$ = get_bar_command(*$2);
+               delete $2;
+       }
        | METER  int int                {
                $$ = get_meterchange_command($2, $3);
        }
@@ -377,10 +380,20 @@ post_requests:
        ;
 
 post_request:
-       CLOSE_REQUEST_PARENS            { $$ = get_request($1); }
+       close_request_parens            { $$ = get_request($1); }
        | script_req
        | textscript_req
        ;
+close_request_parens:
+       '('     { $$='('; }
+       |']'    { $$ = ']' }
+       ;
+
+open_request_parens:
+       '|'     {$$='|'}
+       |')'    {$$=')'}
+       |'['    {$$='['}
+       ;
 
 script_definition:
        SCRIPT '{' script_body '}'      { $$ = $3; }
@@ -434,7 +447,7 @@ pre_requests:
        ;
 
 pre_request: 
-       OPEN_REQUEST_PARENS             { $$ = get_request($1); }
+       open_request_parens             { $$ = get_request($1); }
        ;
 
 
@@ -489,7 +502,7 @@ voice_elt:
        UTILITIES
 */
 pitch_list:                    {
-               $$ = new svec<int>;
+               $$ = new Array<int>;
        }
        | pitch_list NOTENAME   {
                $$->add($2[0]);
@@ -508,7 +521,7 @@ int:
 
 int_list:
        /* */           {
-               $$ = new svec<int>;
+               $$ = new Array<int>;
        }
        | int_list int          {
                $$->add($2);
index 52df4297d4ab8be9155d8e98220a6f8f2e685368..b64873345d6e4d91b9a3b16f416fdca3665a6aa9 100644 (file)
@@ -18,12 +18,12 @@ PCol::width() const
 int
 PCol::rank() const
 {
-    if(!pscore_)
+    if(!pscore_l_)
        return -1;
-    PCursor<PCol*> me=pscore_->find_col( (PCol*)this);
+    PCursor<PCol*> me=pscore_l_->find_col( (PCol*)this);
     if (!me.ok())
        return -1;
-    PCursor<PCol*> bot(pscore_->cols.top());
+    PCursor<PCol*> bot(pscore_l_->cols.top());
     return me - bot;
 }
 
@@ -39,10 +39,11 @@ PCol::print() const
     mtor << "# symbols: " << its.size() ;
     if (breakable()){
        mtor << "\npre,post: ";
-       prebreak->print();
-       postbreak->print();
-    } else if (daddy) {
-       mtor<<'\n' << ((this == daddy->prebreak) ? "prebreak" : "postbreak");
+       prebreak_p_->print();
+       postbreak_p_->print();
+    } else if (daddy_l_) {
+       mtor<<'\n' << ((this == daddy_l_->prebreak_p_) ?
+                      "prebreak_p_" : "postbreak");
     }
     mtor << "extent: " << width().str() << "\n";
     mtor << "}\n";
@@ -52,17 +53,23 @@ PCol::print() const
 int
 PCol::compare(const PCol &c1, const PCol &c2)
 {
-    return c1.pscore_->compare_pcols((PCol*)&c1,(PCol*)&c2);
+    PScore*ps_l = c1.pscore_l_;
+    PCursor<PCol*> ac(ps_l->find_col(&c1));
+    PCursor<PCol*> bc(ps_l->find_col(&c2));
+    assert(ac.ok() && bc.ok());
+    return ac - bc;
 }
 
 void
-PCol::OK () const
+PCol::OK() const
 {
-    if (prebreak || postbreak ) {
-       assert(prebreak&&postbreak);
-       assert(prebreak->daddy == this);
-       assert(postbreak->daddy == this);
-    }    
+#ifndef NDEBUG
+    if (prebreak_p_ || postbreak_p_ ) {
+       assert(prebreak_p_&&postbreak_p_);
+       assert(prebreak_p_->daddy_l_ == this);
+       assert(postbreak_p_->daddy_l_ == this);
+    }
+#endif
 }
 
 void
@@ -71,42 +78,39 @@ PCol::set_breakable()
     if (breakable())
        return;
 
-    prebreak = new PCol(this);
-    postbreak = new PCol(this);
-    prebreak->pscore_ = pscore_;
-    postbreak->pscore_ = pscore_;
-    
+    prebreak_p_ = new PCol(this);
+    postbreak_p_ = new PCol(this);
+    prebreak_p_->pscore_l_ = pscore_l_;
+    postbreak_p_->pscore_l_ = pscore_l_;
 }
 
 bool
 PCol::breakable() const
 {
-    return prebreak||postbreak;
+    return prebreak_p_||postbreak_p_;
 }
 
 PCol::PCol(PCol *parent)
 {
-    daddy = parent;
-    prebreak=0;
-    postbreak=0;
-    line=0;
+    daddy_l_ = parent;
+    prebreak_p_=0;
+    postbreak_p_=0;
+    line_l_=0;
  
-    pscore_ = 0;
+    pscore_l_ = 0;
 }
 
 PCol::~PCol()
 {
-    delete prebreak;
-    delete postbreak;  
+    delete prebreak_p_;
+    delete postbreak_p_;       
 }
 
 void
 PCol::add( Item *i)
 {
     its.bottom().add(i);
-    i->pcol_ = this;
+    i->pcol_l_ = this; 
 }
 
 bool
index bd9154647d76ea7a80f83db68bc3e2be206d97d3..696c54283848d27dc957d386d4f5db91b28d634f 100644 (file)
@@ -42,22 +42,45 @@ PScore::clean_cols()
 void
 PScore::add(PStaff *s)
 {
-    assert(s->pscore_ == this);
+    assert(s->pscore_l_ == this);
     staffs.bottom().add(s);
 }
 
+
+void
+PScore::do_connect(PCol *c1, PCol *c2, Real d, Real h)
+{
+    if (!c1 || !c2 )
+       return;
+    Idealspacing*s_l=get_spacing(c1,c2);
+       
+    if (!s_l->hooke){
+       s_l->hooke = h;
+       s_l->space =d;
+    }
+}
+
+void
+PScore::connect(PCol* c1, PCol *c2, Real d, Real h)
+{
+    do_connect(c1,c2,d,h);
+    do_connect(c1->postbreak_p_, c2,d,h);
+    do_connect(c1, c2->prebreak_p_,d,h);
+    do_connect(c1->postbreak_p_, c2->prebreak_p_,d,h);
+}
+
 void
 PScore::typeset_item(Item *i, PCol *c, PStaff *s, int breakstat)
 {
     assert(c && i && s);
 //    assert(!breakstat != 4 || c->breakable() );
     if (breakstat == 0) {
-       typeset_item(i, c->prebreak, s);
+       typeset_item(i, c->prebreak_p_, s);
        return;
     }
 
     if (breakstat == 2) {
-       typeset_item(i, c->postbreak, s);
+       typeset_item(i, c->postbreak_p_, s);
        return;
     }
 
@@ -73,7 +96,7 @@ PScore::typeset_item(Item *i, PCol *c, PStaff *s, int breakstat)
 void
 PScore::typeset_spanner(Spanner*span_p, PStaff*ps)
 {
-    span_p->pstaff_ = ps;
+    span_p->pstaff_l_ = ps;
     spanners.bottom().add(span_p);
     ps->spans.bottom().add(span_p);
 
@@ -82,29 +105,20 @@ PScore::typeset_spanner(Spanner*span_p, PStaff*ps)
 }
 
 
-int
-PScore::compare_pcols(PCol*a,  PCol*b)const
-{
-    PCursor<PCol*> ac(find_col(a));
-    PCursor<PCol*> bc(find_col(b));
-    assert(ac.ok() && bc.ok());
-    return ac - bc;
-}
-
 void
 PScore::add(PCol *p)
 {
-    p->pscore_ = this;
+    p->pscore_l_ = this;
     if (p->breakable()){
-       p->prebreak->pscore_ = this;
-       p->postbreak->pscore_ = this;
+       p->prebreak_p_->pscore_l_ = this;
+       p->postbreak_p_->pscore_l_ = this;
     }
     cols.bottom().add(p);
 }
 
 PScore::PScore( Paperdef*p)
 {
-    paper_ = p;
+    paper_l_ = p;
 }
 
 void
@@ -112,7 +126,7 @@ PScore::output(Tex_stream &ts)
 {
     int l=1;
 
-    ts << "\n "<<  paper_->lookup_->texsetting << "%(Tex id)\n";
+    ts << "\n "<<  paper_l_->lookup_p_->texsetting << "%(Tex id)\n";
     for (iter_top(lines,lic); lic.ok(); lic++) {
        ts << "% line of score no. " << l++ <<"\n";
        ts << lic->TeXstring();
@@ -122,13 +136,13 @@ PScore::output(Tex_stream &ts)
 }
 
 
-svec<Item*>
-PScore::select_items(PStaff*ps , PCol*pc)
+Array<Item*>
+PScore::select_items(PStaff*ps, PCol*pc)
 {
-    svec<Item*> ret;
+    Array<Item*> ret;
     assert(ps && pc);
     for (iter_top(pc->its,i); i.ok(); i++){
-       if (i->pstaff_ == ps)
+       if (i->pstaff_l_ == ps)
            ret.add((Item*)(const Item*)i);
     }
     return ret;
@@ -150,7 +164,7 @@ PScore::print() const
 {    
 #ifndef NPRINT
     mtor << "PScore { ";
-    paper_->print();
+    paper_l_->print();
     mtor << "\ncolumns: ";
     for (iter_top(cols,cc); cc.ok(); cc++)
        cc->print();
@@ -196,34 +210,34 @@ PScore::postprocess()
 }
 
 PCursor<PCol *>
-PScore::find_col(PCol *c)const
+PScore::find_col(const PCol *c)const
 {
-    PCol*what = (PCol*)c;
-    if (what->daddy )
-       what = what -> daddy;
+    const PCol*what = c;
+    if (what->daddy_l_ )
+       what = what->daddy_l_;
     
-    return cols.find(what);
+    return cols.find((PCol*)what);
 }
 
 void
 PScore::add_broken(Spanner*s)
 {
-    assert(s->left->line == s->right->line);
+    assert(s->left->line_l_ == s->right->line_l_);
     broken_spans.bottom().add(s);
     s->left->starters.bottom().add (s);
     s->right->stoppers.bottom().add (s);
 }
 
 void
-PScore::set_breaking(svec<Col_configuration> breaking)
+PScore::set_breaking(Array<Col_configuration> breaking)
 {
-    for (int j=0; j < breaking.sz(); j++) {
-       svec<PCol*> &curline(breaking[j].cols);
-       svec<Real> &config(breaking[j].config);
+    for (int j=0; j < breaking.size(); j++) {
+       Array<PCol*> &curline(breaking[j].cols);
+       Array<Real> &config(breaking[j].config);
        
-       Line_of_score *p = new Line_of_score(curline,this);
-       lines.bottom().add(p);          
-       for (int i=0; i < curline.sz(); i++){
+       Line_of_score *s_p = new Line_of_score(curline,this);
+       lines.bottom().add(s_p);        
+       for (int i=0; i < curline.size(); i++){
            curline[i]->hpos = config[i];
        }
     }
@@ -235,3 +249,15 @@ PScore::calc_breaking()
     Word_wrap w(*this);
     set_breaking(w.solve());
 }
+
+void
+PScore::process()
+{
+    clean_cols();
+    *mlog << "Preprocessing ... ";
+    preprocess();
+    *mlog << "Calculating ... ";
+    calc_breaking();
+    *mlog << "Postprocessing ... ";
+    postprocess();
+}
index ba7789c91bf505ca721ed658dcfa749fedbb1d50..3c7d82deae661a64019b1747739fe247444d418a 100644 (file)
@@ -1,19 +1,20 @@
 #include "pstaff.hh"
 #include "molecule.hh"
+
 PStaff::~PStaff()
 {
-    delete stafsym;
+    delete stafsym_p_;
 }
 
 PStaff::PStaff(PScore*ps)
 {
-    pscore_=ps;
-    stafsym = 0;
+    pscore_l_=ps;
+    stafsym_p_ = 0;
 }
 
 void
 PStaff::add(Item *i )
 {
     its.bottom().add(i);
-    i->pstaff_ = this;
+    i->pstaff_l_ = this;
 }
index 460bd864231b27646bbab9d76cb29ef1ae857f92..5aa8e9f45e7592f21fb9ab8c0a252886e4e9700e 100644 (file)
@@ -34,7 +34,7 @@ void
 Ineq_constrained_qp::OK() const
 {
 #ifndef NDEBUG    
-    assert(cons.sz() == consrhs.sz());
+    assert(cons.size() == consrhs.size());
     Matrix Qdif= quad - quad.transposed();
     assert(Qdif.norm()/quad.norm() < EPS);
 #endif    
@@ -52,12 +52,12 @@ Mixed_qp::solve(Vector start) const
     print();
     Ineq_constrained_qp pure(*this);
     
-    for  (int i= eq_cons.sz()-1; i>=0; i--) {
+    for  (int i= eq_cons.size()-1; i>=0; i--) {
        pure.eliminate_var(eq_cons[i], eq_consrhs[i]);
        start.del(eq_cons[i]);
     }
     Vector sol = pure.solve(start);
-    for (int i= 0; i < eq_cons.sz(); i++) {
+    for (int i= 0; i < eq_cons.size(); i++) {
        sol.insert( eq_consrhs[i],eq_cons[i]);
     }
     return sol;
@@ -80,7 +80,7 @@ Ineq_constrained_qp::eliminate_var(int idx, Real value)
     row.del(idx);
     lin +=row ;
 
-   for (int i=0; i < cons.sz(); i++) {
+   for (int i=0; i < cons.size(); i++) {
       consrhs[i] -= cons[i](idx) *value;
       cons[i].del(idx);
    }
@@ -91,8 +91,8 @@ Ineq_constrained_qp::eliminate_var(int idx, Real value)
 void
 Ineq_constrained_qp::assert_solution(Vector sol) const
 {
-    svec<int> binding;
-    for (int i=0; i < cons.sz(); i++) {
+    Array<int> binding;
+    for (int i=0; i < cons.size(); i++) {
        Real R=cons[i] * sol- consrhs[i];
        assert(R> -EPS);
        if (R < EPS)
@@ -109,7 +109,7 @@ Ineq_constrained_qp::print() const
     mtor << "Quad " << quad;
     mtor << "lin " << lin <<"\n"
        << "const " << const_term<<"\n";
-    for (int i=0; i < cons.sz(); i++) {
+    for (int i=0; i < cons.size(); i++) {
        mtor << "constraint["<<i<<"]: " << cons[i] << " >= " << consrhs[i];
        mtor << "\n";
     }
@@ -137,7 +137,7 @@ Mixed_qp::OK() const
 {
 #ifndef NDEBUG
     Ineq_constrained_qp::OK();
-    assert(eq_consrhs.sz() == eq_cons.sz());
+    assert(eq_consrhs.size() == eq_cons.size());
 #endif    
 }
 
@@ -146,7 +146,7 @@ Mixed_qp::print() const
 {
 #ifndef NPRINT
     Ineq_constrained_qp::print();
-    for (int i=0; i < eq_cons.sz(); i++) {
+    for (int i=0; i < eq_cons.size(); i++) {
        mtor << "eq cons "<<i<<": x["<<eq_cons[i]<<"] == " << eq_consrhs[i]<<"\n";
     }
 #endif
index 88b703bbbbad7965b56c9dfb6d7eee5e90d703f7..8482bfd8752616df03c35f855569e6de5a623620 100644 (file)
@@ -9,12 +9,12 @@ String
 Active_constraints::status() const
 {
     String s("Active|Inactive [");
-    for (int i=0; i< active.sz(); i++) {
+    for (int i=0; i< active.size(); i++) {
        s += String(active[i]) + " ";
     }
 
     s+="| ";
-    for (int i=0; i< inactive.sz(); i++) {
+    for (int i=0; i< inactive.size(); i++) {
        s += String(inactive[i]) + " ";
     }
     s+="]";
@@ -23,26 +23,29 @@ Active_constraints::status() const
 }
 
 void
-Active_constraints::OK() {
+Active_constraints::OK()
+{
+    #ifndef NDEBUG
     H.OK();
     A.OK();
-    assert(active.sz() +inactive.sz() == opt->cons.sz());
+    assert(active.size() +inactive.size() == opt->cons.size());
     assert(H.dim() == opt->dim());
-    assert(active.sz() == A.rows());
-    svec<int> allcons;
+    assert(active.size() == A.rows());
+    Array<int> allcons;
 
-    for (int i=0; i < opt->cons.sz(); i++)
+    for (int i=0; i < opt->cons.size(); i++)
        allcons.add(0);
-    for (int i=0; i < active.sz(); i++) {
+    for (int i=0; i < active.size(); i++) {
        int j = active[i];
        allcons[j]++;
     }
-    for (int i=0; i < inactive.sz(); i++) {
+    for (int i=0; i < inactive.size(); i++) {
        int j = inactive[i];
        allcons[j]++;
     }
-    for (int i=0; i < allcons.sz(); i++)
+    for (int i=0; i < allcons.size(); i++)
        assert(allcons[i] == 1);
+#endif
 }
 
 Vector
@@ -60,7 +63,7 @@ Active_constraints::add(int k)
     int cidx=inactive[k];
     active.add(cidx);
 
-    inactive.swap(k,inactive.sz()-1);
+    inactive.swap(k,inactive.size()-1);
     inactive.pop();
 
     Vector a( opt->cons[cidx] );
@@ -92,7 +95,7 @@ Active_constraints::add(int k)
 void
 Active_constraints::drop(int k)
 {
-    int q=active.sz()-1;
+    int q=active.size()-1;
 
         // drop indices
     inactive.add(active[k]);
@@ -124,7 +127,7 @@ Active_constraints::Active_constraints(Ineq_constrained_qp const *op)
            H(op->dim()),
            opt(op)
 {
-    for (int i=0; i < op->cons.sz(); i++)
+    for (int i=0; i < op->cons.size(); i++)
        inactive.add(i);
     Choleski_decomposition chol(op->quad);
     H=chol.inverse();
index 4cb98c2f3459cccbe6a35ddc4d71c8d712141a75..f87f103a6c285e53445356c735bd722b7275c9d7 100644 (file)
@@ -8,6 +8,7 @@
 #define RCONS(T) VIRTUALCONS(T, Request)
 
 RCONS(Rest_req);
+RCONS(Barcheck_req);
 RCONS(Text_req);
 RCONS(Rhythmic_req);
 RCONS(Stem_req);
@@ -18,6 +19,14 @@ RCONS(Span_req);
 RCONS(Slur_req);
 RCONS(Beam_req);
 
+void
+Barcheck_req::print() const    
+{
+#ifndef NPRINT
+    mtor << "Barcheck\n";
+#endif
+}
+
 void
 Request::print() const    
 {
@@ -26,11 +35,22 @@ Request::print() const
 #endif
 }
 
-Request::Request()
+void
+Span_req::print() const    
 {
-    elt = 0;
+#ifndef NPRINT
+    mtor << "Span_req {" << spantype << "}\n";
+#endif
 }
 
+Request::Request()
+{
+    elt_l_ = 0;
+}
+Request::Request(Request const&)
+{
+    elt_l_ = 0;
+}
 Melodic_req::Melodic_req()
 {
     name = 0;
@@ -105,6 +125,12 @@ Script_req::Script_req(int d , Script_def*def)
     scriptdef = def;
 }
 
+Script_req::Script_req(Script_req const &s)
+{
+    dir = s.dir;
+    scriptdef = new Script_def(*s.scriptdef);
+}
+
 void
 Script_req::print() const
 {
@@ -118,7 +144,11 @@ Script_req::~Script_req()
     delete scriptdef;
 }
 
-
+Text_req::Text_req(Text_req const& s)
+{
+    spec = new Text_def(*s.spec);
+    dir = s.dir;
+}
 Text_req::Text_req(int d , Text_def*def)
 {
     dir = d;
index edb89c3696f08a795c5f5f5f3b4b50a6c4f370cd..d06489507c4f72f7f0dfd15010073e3de3c9d670 100644 (file)
@@ -22,16 +22,14 @@ Rest::print()const
 Molecule*
 Rest::brew_molecule()const
 {
-    assert(pstaff_);
-
     Paperdef *p =paper();
 
     Symbol s;
-    s = p->lookup_->rest(balltype);
+    s = p->lookup_p_->rest(balltype);
     
     Molecule *m = new Molecule(Atom(s));
     if (dots) {
-       Symbol d =p->lookup_->dots(dots);
+       Symbol d =p->lookup_p_->dots(dots);
        Molecule dm;
        dm.add(Atom(d));
        m->add_right(dm);
index 9142986abce6dd65af07115de91d12fd73da98bd..c78eedb256c7cf2abfafda1f2b61d7833d38dd14 100644 (file)
@@ -25,7 +25,7 @@ Rhythmic_staff::get_TYPESET_item(Command *com)
     Item *i = Simple_staff::get_TYPESET_item(com);
     if (!i) return 0;
     i->translate(Offset(0,
-                       -score_->paper_->standard_height()/2));
+                       -score_l_->paper_p_->standard_height()/2));
     return i;
 }
 
index ec8784a9bdf4bdf1dda20800336bc2c65136c806..bbd0dba1aeda4e56d77c8596591d7d34c106ec7a 100644 (file)
@@ -5,35 +5,37 @@
 int
 Score_column::compare(Score_column & c1, Score_column &c2)
 {
-       return sign(c1.when - c2.when);
+       return sign(c1.when_ - c2.when_);
 }
 
 void
-Score_column::set_breakable() {
-    pcol_->set_breakable();
+Score_column::set_breakable()
+{
+    pcol_l_->set_breakable();
 }
+
 Score_column::Score_column(Moment w)
 {
-    when = w;
-    pcol_ = new PCol(0);
-    musical = false;
+    when_ = w;
+    pcol_l_ = new PCol(0);
+    musical_ = false;
 }
 
 bool
 Score_column::used() {
-    return pcol_->used();
+    return pcol_l_->used();
 }
 
 void
 Score_column::print() const
 {
 #ifndef NPRINT
-    mtor << "Score_column { mus "<< musical <<" at " <<  when<<'\n';
+    mtor << "Score_column { mus "<< musical_ <<" at " <<  when_<<'\n';
     mtor << "durations: [";
-    for (int i=0; i < durations.sz(); i++)
+    for (int i=0; i < durations.size(); i++)
        mtor << durations[i] << " ";
     mtor << "]\n";
-    pcol_->print();
+    pcol_l_->print();
     mtor << "}\n";
 #endif
 }
@@ -52,7 +54,7 @@ Score_column::preprocess()
 void
 Score_column::add_duration(Moment d)
 {
-    for (int i = 0; i< durations.sz(); i++) {
+    for (int i = 0; i< durations.size(); i++) {
        if (d == durations[i])
            return ;
     }
index 2819a21965865df6fe5625a4bc3035a6ebc83ca5..706fc53d99e2cfe854ad332f00da27671b2c96a2 100644 (file)
 void
 Score::process()
 {
-    *mlog << "\nProcessing ... ";
+    *mlog << "\nProcessing music ... ";
     
-    assert (paper_);
+    assert (paper_p_);
     
     /// distribute commands to disciples
-    pscore_ = new PScore(paper_);
+    pscore_p_ = new PScore(paper_p_);
     for (iter_top(staffs_,i); i.ok(); i++) {
-       i->process_commands(last());
-       i->set_output(pscore_);
+       i->truncate_cols(last());
+       i->set_output(pscore_p_);
        i->process();
     }
 
     // do this after processing, staffs first have to generate PCols.
-    do_pcols();
-
-    clean_cols();    // can't move this farther up.
-
+    find_col(last(), false)->set_breakable();
+    do_cols();
     calc_idealspacing();
 
     // debugging
-    print ();
     OK();
-
-    pscore_->preprocess();
-    *mlog << "Calculating ... ";
-    pscore_->calc_breaking();
-    *mlog << "Postprocessing ... ";
-    pscore_->postprocess();
-
-    // TODO: calculate vertical structs?
-    // TODO: calculate mixed structs.?
+    pscore_p_->process();    
     *mlog << "\n";
 }
 
@@ -52,15 +41,13 @@ Score::clean_cols()
        i->clean_cols();
     
     for (iter_top(cols_,c); c.ok(); ) {
-       if (!c->pcol_->used()) {
+       if (!c->pcol_l_->used()) {
            c.del();
        } else {
            c->preprocess();
            c++;
        }
     }
-    
-    pscore_->clean_cols();
 }
 /*
   this sux.  We should have Score_column create the appropriate PCol.
@@ -73,14 +60,14 @@ Score::create_cols(Moment w)
     Score_column* c1 = new Score_column(w);
     Score_column* c2 = new Score_column(w);
     
-    c1->musical = false;
-    c2->musical = true;
+    c1->musical_ = false;
+    c2->musical_ = true;
     
     iter_top(cols_,i);
 
     for (; i.ok(); i++) {
-       assert(i->when != w);
-       if (i->when > w)
+       assert(i->when() != w);
+       if (i->when() > w)
            break;
     }
 
@@ -102,9 +89,9 @@ Score::find_col(Moment w,bool mus)
 {
     iter_top(cols_,i);
     for (; i.ok(); i++) {
-       if (i->when == w && i->musical == mus)
+       if (i->when() == w && i->musical_ == mus)
            return i;
-       if (i->when > w)
+       if (i->when() > w)
            break;
     }
     i = create_cols(w);
@@ -114,12 +101,13 @@ Score::find_col(Moment w,bool mus)
 }
 
 void
-Score::do_pcols()
+Score::do_cols()
 {
     iter_top(cols_,i);
     for (; i.ok(); i++) {
-       pscore_->add(i->pcol_);
+       pscore_p_->add(i->pcol_l_);
     }
+    clean_cols();    // can't move clean_cols() farther up.
 }
 Moment
 Score::last() const
@@ -137,12 +125,12 @@ Score::OK() const
 #ifndef NDEBUG
     for (iter_top(staffs_,i); i.ok(); i++) {
        i->OK();
-       assert(i->score_ == this);
+       assert(i->score_l_ == this);
     }
     staffs_.OK();
     cols_.OK();
     for (iter_top(cols_,cc); cc.ok() && (cc+1).ok(); cc++) {
-       assert(cc->when <= (cc+1)->when);
+       assert(cc->when() <= (cc+1)->when());
     }
 #endif    
 }
@@ -159,8 +147,8 @@ Score::print() const
     for (iter_top(cols_,i); i.ok(); i++) {
        i->print();
     }
-    if (pscore_)
-       pscore_->print();
+    if (pscore_p_)
+       pscore_p_->print();
     
     mtor << "}\n";
 #endif
@@ -168,25 +156,26 @@ Score::print() const
 
 Score::Score(Paperdef*p)
 {
-    pscore_=0;
-    paper_ = p;
+    pscore_p_=0;
+    paper_p_ = p;              // ?? safe?
 }
 
 Score::~Score()
 {
-    delete pscore_;
+    delete pscore_p_;
+    delete paper_p_;
 }
 
 void
 Score::output(String s)
 {
     OK();
-    if (paper_->outfile=="")
-       paper_->outfile = s;
+    if (paper_p_->outfile=="")
+       paper_p_->outfile = s;
     
-    *mlog << "output to " << paper_->outfile << "...\n";
-    Tex_stream the_output(paper_->outfile);    
-    pscore_->output(the_output);
+    *mlog << "output to " << paper_p_->outfile << "...\n";
+    Tex_stream the_output(paper_p_->outfile);    
+    pscore_p_->output(the_output);
 }
 
 
@@ -194,7 +183,7 @@ Score::output(String s)
 void
 Score::add(Staff*s)
 {
-    s->score_ = this;
+    s->score_l_ = this;
     staffs_.bottom().add(s);
 }
 
index 39c13c48b8d054c116083bf86db4cfd30cc7c4c3..ed28c5b543a9cf85705fb3a9d98b0b15aff6aadb 100644 (file)
@@ -22,17 +22,17 @@ Line_of_score::TeXstring() const
 }
 
 
-Line_of_score::Line_of_score(svec<PCol *> sv,
+Line_of_score::Line_of_score(Array<PCol *> sv,
                             PScore *ps)
 {
-    pscore_ = ps;
-    for (int i=0; i< sv.sz(); i++) {
+    pscore_l_ = ps;
+    for (int i=0; i< sv.size(); i++) {
        PCol *p=(PCol *) sv[i];
        cols.bottom().add(p);
-       p->line=this;
+       p->line_l_=this;
     }
 
-    for (iter_top(pscore_->staffs,sc); sc.ok(); sc++)
+    for (iter_top(pscore_l_->staffs,sc); sc.ok(); sc++)
        staffs.bottom().add(new Line_of_staff(this, sc));    
 }
 /* construct a line with the named columns. Make the line field
index 1d0679c534268c540518fa7cfb03080da5a7f42f..1b7b6558de72fbb02545f336fd0df2b5252448b4 100644 (file)
@@ -3,7 +3,7 @@
 #include "score.hh"
 #include "string.hh"
 
-static svec<Input_score*> sv;
+static Array<Input_score*> score_array_global;
 
 static String outfn="lelie.uit";
 
@@ -11,21 +11,21 @@ static String outfn="lelie.uit";
 void
 do_scores()
 {
-    for (int i=0; i < sv.sz(); i++) {
-       Score * s = sv[i]->parse();     
-       delete sv[i];
-       
-       s->process();
-       s->output(outfn);
-       delete s;
+    for (int i=0; i < score_array_global.size(); i++) {
+       Score * s_p = score_array_global[i]->parse();   
+       delete score_array_global[i];
+       s_p->print ();
+       s_p->process();
+       s_p->output(outfn);
+       delete s_p;
     }
-    sv.set_size(0);
+    score_array_global.set_size(0);
 }
 
 void
 add_score(Input_score * s)
 {
-    sv.add(s);
+    score_array_global.add(s);
 }
 
 
index 493c6823d77f7008fdf14b462e3b2c1bff03c8e0..4f5ed1c0e7ca23e16a7e74db12bad72fd2eb1a3a 100644 (file)
@@ -5,15 +5,15 @@
 #include "molecule.hh"
 #include "lookup.hh"
 
-Script::Script(Script_req* rq, Item*i , int staflen, Stem*st_p)
+Script::Script(Script_req* rq, Item*i , int staflen, Stem*st_l)
 {
-    dependencies.add(st_p);
+    dependencies.add(st_l);
     dependencies.add(i);
     
     staffsize =staflen;
-    specs = rq->scriptdef;
+    specs_l_ = rq->scriptdef;
     support= i;
-    stem_ = st_p;
+    stem_l_ = st_l;
     pos = 0;
     symdir=1;
     dir =rq->dir;
@@ -22,42 +22,51 @@ Script::Script(Script_req* rq, Item*i , int staflen, Stem*st_p)
 void
 Script::set_symdir()
 {
-    if (specs->invertsym)
+    if (specs_l_->invertsym)
        symdir = (dir < 0) ? -1:1;
 }
 
 void
 Script::set_default_dir()
 {
-    if (specs->stemdir) {
-       if (!stem_)
+    if (specs_l_->stemdir) {
+       if (!stem_l_)
            dir = 1;
        else
-           dir = stem_->dir * specs->stemdir;
+           dir = stem_l_->dir * specs_l_->stemdir;
     }
 }
 
 void
 Script::set_default_pos()
 {
-    assert(dir);
-    Real y;
     Real inter= paper()->internote();
-
-    int d = specs->staffdir;
+    Interval dy = symbol().dim.y;
+    
+    int d = specs_l_->staffdir;
     if (!d) {
        Interval v= support->height();
-       pos = rint(v[dir]/inter) + dir* 2;
+       pos = rint((v[dir]  -dy[-dir])/inter) + dir* 2;
     } else {
-       y  = (d > 0) ? staffsize + 2: -2; // ug
+       Real y  = (d > 0) ? staffsize + 2: -2; // ug
        y *=inter;
        Interval v= support->height();
 
-       if (dir > 0) {
+       if (d > 0) {
            y = y >? v.max();
-       }else if (dir < 0) {
+       } else if (d < 0) {
            y = y <? v.min();
        }
+
+       if (stem_l_) {
+           Interval v= stem_l_->height();
+
+           if (d > 0) {
+               y = y >? v.max();
+           }else if (d < 0) {
+               y = y <? v.min();
+           }
+       }
        pos = int(rint(Real(y)/inter));
     }
 }
@@ -65,7 +74,14 @@ Script::set_default_pos()
 Interval
 Script::width() const
 {
-    return paper()->lookup_->script(specs->symidx).dim.x;
+    return symbol().dim.x;
+}
+
+Symbol
+Script::symbol()const
+{
+    String preidx = (symdir < 0) ?"-" :"";
+    return paper()->lookup_p_->script(preidx+specs_l_->symidx);
 }
 
 void
@@ -80,16 +96,13 @@ Script::do_post_processing()
 {
     set_default_pos();
 }
+
 Molecule*
 Script::brew_molecule() const
 {
-    Paperdef *p =paper();
-
-    Real dy = p->internote();
-    String preidx = (symdir < 0) ?"-" :"";
-    Symbol ss =p->lookup_->script(preidx+specs->symidx);
-    Molecule*out = new Molecule(Atom(ss));
+    Real dy = paper()->internote();
+    
+    Molecule*out = new Molecule(Atom(symbol()));
     out->translate(Offset(0,dy * pos));
-    return
-       out;
+    return out;
 }
index b3f2ac40c0bc719787d42593975e52086f0a37d5..de3d6ec921ac0db212b597d92236defbad58bcd8 100644 (file)
@@ -13,7 +13,7 @@ Item *
 Simple_staff::get_TYPESET_item(Command *com)
 {
     Item *s=0;
-    svec<Scalar> arg( com->args);
+    Array<Scalar> arg( com->args);
     String type =arg[0];
     arg.del(0);
     if (type ==  "BAR" ) {
@@ -32,12 +32,12 @@ Simple_staff::get_TYPESET_item(Command *com)
 
 
 Interval
-itemlist_width(const svec<Item*> &its)
+itemlist_width(const Array<Item*> &its)
 {
     Interval iv ;
     iv.set_empty();
      
-    for (int j =0; j < its.sz(); j++){
+    for (int j =0; j < its.size(); j++){
        iv.unite (its[j]->width());
 
     }
@@ -49,18 +49,18 @@ Simple_column::typeset_item(Item *i, int breakst)
 {
     assert(i);
     
-    staff_->pscore_->typeset_item(i, score_column->pcol_,
+    staff_->pscore_l_->typeset_item(i, score_column_l_->pcol_l_,
                                  staff_->theline,breakst);
     
     if (breakst == BREAK_PRE - BREAK_PRE) {
        
-        svec<Item*> to_move(
-           staff_->pscore_->select_items(staff_->theline,
-                                         score_column->pcol_->prebreak));
+        Array<Item*> to_move(
+           staff_->pscore_l_->select_items(staff_->theline,
+                                         score_column_l_->pcol_l_->prebreak_p_));
        Interval column_wid = itemlist_width(to_move);
        assert(!column_wid.empty());
 
-       for (int j=0; j < to_move.sz(); j++) {
+       for (int j=0; j < to_move.size(); j++) {
            to_move[j]->translate(Offset(-column_wid.right, 0));
        }
     }
@@ -70,13 +70,13 @@ void
 Simple_column::typeset_item_directional(Item *i, int dir, int breakst)
 {
     assert(i);
-    PCol * c=score_column->pcol_;
+    PCol * c=score_column_l_->pcol_l_;
     if (breakst == 0)
-       c = c->prebreak;
+       c = c->prebreak_p_;
     else if (breakst == 2)
-       c = c->postbreak;
+       c = c->postbreak_p_;
     
-    svec<Item*> to_move(staff_->pscore_->select_items(staff_->theline,
+    Array<Item*> to_move(staff_->pscore_l_->select_items(staff_->theline,
                                                      c));    
     typeset_item(i, breakst);
 
@@ -89,8 +89,8 @@ Simple_column::typeset_item_directional(Item *i, int dir, int breakst)
 void
 Simple_staff::set_output(PScore* ps )
 {
-    pscore_ = ps;
-    pscore_->add(theline);
+    pscore_l_ = ps;
+    pscore_l_->add(theline);
 }
 
 
index 636b6691de7515aca6ca459b6e227abe78678bb4..f0087ebd3fda6c45786c881b3613c5507d7e3fd1 100644 (file)
@@ -39,9 +39,15 @@ Scalar
 void
 Simple_column::process_requests()
 {
-    for (int i = 0 ; i < v_elts.sz(); i ++)
+    for (int i = 0 ; i < v_elts.size(); i ++)
        for (iter_top(v_elts[i]->reqs,j); j.ok(); j++) {
            Request *rq= j;
+           if (rq->barcheck()) {
+               if (tdescription_->whole_in_measure) {
+                   error("Barcheck failed, " + tdescription_->str());
+               }
+           }
+                                  
            if (rq->rhythmic()){
                notes.add(rq->rhythmic());
            }
index 945f5151decff85f9e46c5f78db10c5f1f2ed5d8..21ed11573af506ead3bdbd1089fffad83bccf698 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  UGR
+  UGR!! CHAOS RULEZ
   */
 #include "textspanner.hh"
 #include "script.hh"
 #include "textitem.hh"
 
 Rhythmic_grouping
-parse_grouping(svec<Scalar> a, Moment one_beat)
+parse_grouping(Array<Scalar> a, Moment one_beat)
 {
-    svec<int> r;
-    for (int i= 0 ; i < a.sz(); i++)
+    Array<int> r;
+    for (int i= 0 ; i < a.size(); i++)
        r.add(a[i]);
     Moment here =0.0;
 
-    svec<Rhythmic_grouping*> children;
-    for (int i=0; i < r.sz(); i++) {
+    Array<Rhythmic_grouping*> children;
+    for (int i=0; i < r.size(); i++) {
        
        Moment last = here;
        here += one_beat * r[i];
@@ -45,19 +45,19 @@ parse_grouping(svec<Scalar> a, Moment one_beat)
 void
 Simple_walker::do_INTERPRET_command(Command*com)
 {
-    svec<Scalar> args(com->args);
+    Array<Scalar> args(com->args);
     args.del(0);
     if (com->args[0] == "GROUPING") {  
        default_grouping = parse_grouping(args,
                                          col()->tdescription_->one_beat);
-    }else if (com->args[0] == "BAR") {
+    }else if (com->args[0] == "NEWMEASURE") {
        local_key_.reset(key_);
 
     } else if (com->args[0] == "KEY") {
        
        if (col()->when() > Moment(0)) {
            assert(!oldkey_undo);
-           oldkey_undo = new svec<int>( key_.oldkey_undo(args));
+           oldkey_undo = new Array<int>( key_.oldkey_undo(args));
        }
        
        typesetkey = key_.read(args);
@@ -84,7 +84,13 @@ Simple_walker::do_TYPESET_command(Command*com)
        if (processed_clef) 
            return;
     }
-    
+    if (com->args[0] == "BAR") {
+       
+       if (processed_bar_priority > com->priority)
+           return;
+       else
+           processed_bar_priority = com->priority;
+    }
 
     Item* i = staff()->get_TYPESET_item(com);
     if (!i)
@@ -132,11 +138,13 @@ Simple_walker::do_note(Note_info n)
        Item*rhythmic=0;
     if (n.rq->note()) {
        Note_req * req = n.rq->note() ;
-       const Voice *v = req->elt->voice_;
+       const Voice *v = req->elt_l_->voice_;
 
        Notehead*n = s->get_notehead(req, clef_.c0_pos);
        rhythmic=n;
-       stem_->add(n);
+       if (stem_)
+           stem_->add(n);
+       
        if (current_grouping) {
            current_grouping->add_child(
                c->tdescription_->whole_in_measure, req->duration());
@@ -168,14 +176,15 @@ Simple_walker::process_requests()
            error("Too many beams (t = "
                          +String(c->when())+")");
        beam_ = new Beam;
+       assert(!current_grouping);
        current_grouping = new Rhythmic_grouping;
     }
     
-    for (int i=0; i < c->slurs.sz(); i++) {
+    for (int i=0; i < c->slurs.size(); i++) {
        Slur_req*sl = c->slurs[i];
 
        if (sl->spantype == Span_req::START) {
-           if  (find_slur(sl->elt->voice_ )>=0)
+           if  (find_slur(sl->elt_l_->voice_ )>=0)
                error_t("Too many slurs in voice", col()->when());
            pending_slur_reqs.add(sl);
            pending_slurs.add(new Slur);
@@ -190,7 +199,7 @@ Simple_walker::process_requests()
        stem_ = s->get_stem(c->stem_->stem(), c->stem_requester_len);
     }
     
-    for (int i = 0; i <  c->notes.sz(); i ++)  {
+    for (int i = 0; i <  c->notes.size(); i ++)  {
        do_note(c->notes[i]);
     }
     
@@ -208,6 +217,7 @@ Simple_walker::process_requests()
        /* needed, otherwise placement of
           local_key fucks up */
     }
+
     if (c->beam_&& c->beam_->spantype == Span_req::STOP) {
        beam_->set_grouping(default_grouping, *current_grouping);
        pscore_->typeset_spanner(beam_, s->theline);
@@ -223,7 +233,7 @@ Simple_walker::process_requests()
        delete current_grouping;
        current_grouping =0;
     }
-    for (int i = 0; i < noteheads.sz(); i++) {
+    for (int i = 0; i < noteheads.size(); i++) {
        c->typeset_item(noteheads[i]);
     }
     noteheads.set_size(0);
@@ -235,13 +245,13 @@ Simple_walker::process_requests()
     if (stem_) {
        stem_ = 0;
     }
-    for (int i=0; i < c->slurs.sz(); i++) {
+    for (int i=0; i < c->slurs.size(); i++) {
        Slur_req *sl = c->slurs[i];
 
        if (sl->spantype == Span_req::STOP) {
-           int idx = find_slur(sl->elt->voice_);
+           int idx = find_slur(sl->elt_l_->voice_);
            if (idx < 0)
-               error("can't find slur to end");
+               error_t("can't find slur to end; ", c->when());
            
            pscore_->typeset_spanner(pending_slurs[idx],
                                     s->theline);
@@ -253,7 +263,7 @@ Simple_walker::process_requests()
 }
 
 Simple_walker::Simple_walker(Simple_staff*s)
-    : Staff_walker(s, s->theline->pscore_)
+    : Staff_walker(s, s->theline->pscore_l_)
 {
     stem_ = 0;
     beam_ =0;
@@ -285,13 +295,14 @@ Simple_walker::reset()
 {
     processed_clef =false;    
     processed_key = false;
+    processed_bar_priority = 0;
 }
 
 int
 Simple_walker::find_slur(const Voice *v)
 {
-    for (int i=0; i < pending_slur_reqs.sz(); i++) {
-       if (pending_slur_reqs[i]->elt->voice_ == v)
+    for (int i=0; i < pending_slur_reqs.size(); i++) {
+       if (pending_slur_reqs[i]->elt_l_->voice_ == v)
            return i;
     }
     return -1;
index 15a94cf8c30e2dc513da0372d894b7ddda156b04..e5dbf385ac739e8bf3e268f7c7ce4f7c9db6867d 100644 (file)
@@ -38,12 +38,12 @@ void
 Slur::set_default_dir()
 {
     int sumpos=0;
-    for (int i=0; i < encompass.sz(); i ++) {
+    for (int i=0; i < encompass.size(); i ++) {
        sumpos += encompass[i]->position;
     }
 
     /* should consult stems */
-    Real meanpos = sumpos/Real(encompass.sz());
+    Real meanpos = sumpos/Real(encompass.size());
     if (meanpos < 5)           // todo
        dir = -1;
     else
@@ -59,19 +59,19 @@ Slur::print()const
 void
 Slur::do_pre_processing()
 {
-    right  = encompass.last()->pcol_;
-    left = encompass[0]->pcol_;    
+    right  = encompass.last()->pcol_l_;
+    left = encompass[0]->pcol_l_;    
 }
 
 Spanner*
 Slur::do_break_at(PCol*l, PCol*r) const
 {
-    assert(l->line == r->line);
+    assert(l->line_l_ == r->line_l_);
     Slur*ret = new Slur(*this);
 
     ret->encompass.set_size(0);
-    for (int i =0; i < encompass.sz(); i++) {
-       if (encompass[i]->pcol_->line==l->line)
+    for (int i =0; i < encompass.size(); i++) {
+       if (encompass[i]->pcol_l_->line_l_==l->line_l_)
            ret->encompass.add(encompass[i]);
     }
     if (right != r)
@@ -93,32 +93,41 @@ Molecule*
 Slur::brew_molecule() const
 {
     Molecule*output = new Molecule;
-    assert(left->line == right->line);
+
     int minp=1000, maxp=-1000; // todo    
-    for (int i=0; i<encompass.sz(); i++) {
+    for (int i=0; i<encompass.size(); i++) {
        minp = encompass[i]->position <? minp;
        maxp = encompass[i]->position >? maxp;
     }
-    assert(encompass.sz()>0);  // todo
+    assert(encompass.size()>0);        // todo
     
     Notehead *lnote_p =encompass[0];
     Notehead *rnote_p =encompass.last();
-    int pos1 = lnote_p->position;
-    int pos2 = rnote_p->position;
-
-    int dy =  pos2-pos1;
+    int lpos_i = lnote_p->position;
+    int rpos_i = rnote_p->position;
+    Offset  left_off(lnote_p->x_dir, lpos_i + 2*dir);
+    Offset right_off(lnote_p->x_dir, rpos_i + 2*dir);
+    if (!lnote_p->extremal)
+       left_off += Offset(0.5, -dir);
+    if (!rnote_p->extremal)
+       right_off+= Offset(-0.5, -dir);
+    
+    int dy = right_off.y - left_off.y;
+    
     Real nw_f = paper()->note_width();
+    Real nh_f = paper()->internote();
     Real w = width().length();
-    w+= (-lnote_p->x_dir + rnote_p->x_dir)* nw_f ;
+    
+    w+= (right_off.x - left_off.x) * nw_f ;
     Real round_w = w;          // slur lookup rounds the slurwidth .
     
-    Symbol sl = paper()->lookup_->slur(dy , round_w, dir);
+    Symbol sl = paper()->lookup_p_->slur(dy , round_w, dir);
 
     Real error = w-round_w;
     
     Atom a(sl);
-    a.translate(Offset((lnote_p->x_dir + 0.5 )*nw_f + error/2,
-                      (pos2+2*dir) * paper()->internote()));
+    a.translate(Offset((left_off.x + 0.5 )*nw_f + error/2,
+                      left_off.y * nh_f));
     output->add(a);
     return output;
 }
index 825e878d8a8d8b11c39ea1270651a3b64e36b797..ef54dbe466b9ac4c7b1f83113672be9770f3cba6 100644 (file)
@@ -15,16 +15,18 @@ Staff::add(PointerList<Voice*> &l)
 }
 
 void
-Staff::process_commands(Moment l)
+Staff::truncate_cols(Moment l)
 {
-    if (staff_commands_)
-       staff_commands_->clean(l);
+    iter_bot(cols, i);
+    for (; i->when() > l; i=cols.bottom()) {
+       i.del();
+    }
 }
 
 Paperdef*
 Staff::paper() const
 {
-    return score_->paper_;
+    return score_l_->paper_p_;
 }
 
 void
@@ -32,7 +34,7 @@ Staff::clean_cols()
 {
     iter_top(cols,i);
     for(; i.ok(); ){
-       if (!i->score_column->used())
+       if (!i->score_column_l_->used())
            i.del();
        else
            i++;
@@ -42,18 +44,18 @@ Staff::clean_cols()
 Staff_column *
 Staff::get_col(Moment w, bool mus)
 {
-    Score_column* sc = score_->find_col(w,mus);
-    assert(sc->when == w);
+    Score_column* sc = score_l_->find_col(w,mus);
     
     iter_top(cols,i);
     for (; i.ok(); i++) {
-       if (*i->score_column > *sc) // too far
+
+       if (*i->score_column_l_ > *sc) // too far
            break;
-       if (sc == i->score_column)
+       if (sc == i->score_column_l_)
            return i;
     }
 
-    /* post: *sc > *->score_column || !i.ok() */
+    /* post: *sc > *->score_column_l_ || !i.ok() */
     Staff_column* newst = create_col(sc);
 
     if (!i.ok()) {
@@ -66,8 +68,6 @@ Staff::get_col(Moment w, bool mus)
        return newst;
     }
 
-//  ;  assert((i-1).ok())
-    // todo!
     
     // making a fix at 2:30 am, with several beers drunk.
     // but it works :-)
@@ -97,28 +97,24 @@ Staff::setup_staffcols()
            now += ve->duration;            
        }       
     }
+    set_time_descriptions();
+}
 
-    for (iter_top(*staff_commands_,cc); cc.ok(); cc++) {
-       Staff_column *sc=get_col(cc->tdescription_.when,false);
-       sc->s_commands = cc;
-       sc->tdescription_ = new Time_description(cc->tdescription_);
-    }
-
-    iter_top(*staff_commands_,cc);
+void
+Staff::set_time_descriptions()
+{
+    Time_description t(0,0);
     for (iter_top(cols,i); i.ok(); i++) {
-       while  ((cc+1).ok() && (cc+1)->when() < i->when())
-           cc++;
-
+       if (i->staff_commands_p_)
+           t = i->staff_commands_p_->tdescription_;
+       else if (i->tdescription_)
+           t = *i->tdescription_;
        if(!i->tdescription_) {
-           if (cc->tdescription_.when == i->when())
-               i->tdescription_ = new Time_description(cc->tdescription_);
-           else
-               i->tdescription_ = new Time_description(
-                   i->when() - cc->when() ,&cc->tdescription_);
+           i->tdescription_ = new Time_description(i->when() - t.when ,&t);
        }
     }
-}
 
+}
 void
 Staff::process()
 {
@@ -133,7 +129,7 @@ Staff::OK() const
 #ifndef NDEBUG
     cols.OK();
     voices.OK();
-    assert(score_);    
+    assert(score_l_);
 #endif    
 }
 
@@ -157,15 +153,12 @@ Staff::print() const
     for (iter_top(voices,i); i.ok(); i++) {
        i->print();     
     }
-    if (staff_commands_)
-       staff_commands_->print();
     mtor <<"}\n";
 #endif
 }
 
 Staff::Staff()
 {    
-    staff_commands_ = 0;
-    score_ =0;
-    pscore_=0;    
+    score_l_ =0;
+    pscore_l_ =0;    
 }
index f1588ebe2368c5ab356b047528bd3542b80cb6af..f99a3d9726678920242fc4fd52ff103a475463c1 100644 (file)
@@ -1,6 +1,7 @@
 #include "staffcommands.hh"
 #include "debug.hh"
 #include "parseconstruct.hh"
+#include "getcommand.hh"
 
 Moment
 Staff_commands_at::when()
@@ -22,10 +23,12 @@ Staff_commands_at::print() const
 void
 Staff_commands_at::OK()const
 {
+#ifndef NDEBUG
     iter_top(*this,i);
     for (; i.ok() && (i+1).ok(); i++)
        if (!i->isbreak() && !(i+1)->isbreak())
            assert(i->priority >= (i+1)->priority);
+#endif
 }
 
 Staff_commands_at::Staff_commands_at(Time_description m)
@@ -48,7 +51,7 @@ Staff_commands_at::is_breakable()
 void
 Staff_commands_at::set_breakable()
 {
-    assert(!is_breakable());
+    if (is_breakable()) return;
     
     Command k;
     k.code = BREAK_PRE;
@@ -123,9 +126,11 @@ Staff_commands_at::add(Command c)
        Command typeset;        // kut met peren
        typeset.code = TYPESET;
        typeset.args = c.args;
-       if (c.args[0] == "BAR") {
-           typeset.priority = 100;
+       if (c.args[0] == "NEWMEASURE") {
+           add(get_defaultbar_command());
+       } else if (c.args[0] == "BAR") {
            add(typeset);
+           c.code= NOP;        // no INTERPRET (BAR) commands
        } else if (c.args[0] == "KEY") {
            typeset.priority = 70;
            add(typeset);
@@ -145,8 +150,8 @@ Staff_commands_at::add(Command c)
        if (c.args[0] == "BAR") {
            set_breakable();
            encapsulate = true;
-           mid = c;
-           pre = c;
+           split_bar_command(pre,mid,post, c.args[1]);
+
            { /* every line a currentkey. */
                Command kc;
                kc.code =TYPESET;
@@ -198,73 +203,3 @@ Staff_commands_at::add(Command c)
     }
 }
 
-
-/****************************************************************/
-
-void
-Staff_commands::OK() const
-{
-#ifndef NDEBUG
-    for (iter_top(*this,i); i.ok() && (i+1).ok(); i++) {
-       assert(i->tdescription_.when <= (i+1)->tdescription_.when);
-       i->OK();
-    }
-#endif
-}
-
-void
-Staff_commands::print() const
-{
-#ifndef NPRINT
-    for (iter_top(*this,i); i.ok() ; i++) {
-       i->print();
-    }
-#endif
-}
-
-Staff_commands_at*
-Staff_commands::find(Moment w)
-{
-    PCursor<Staff_commands_at*> i(bottom());
-    for (; i.ok() ; i--) {
-       if (i->tdescription_.when == w)
-           return i;
-       if (i->tdescription_.when < w)
-           break;
-    }
-    return 0;
-}
-
-void
-Staff_commands::add(Staff_commands_at*p)
-{
-    PCursor<Staff_commands_at*> i(bottom());
-    for (; i.ok() ; i--) {
-       if (i->tdescription_.when < p->tdescription_.when)
-           break;
-    }
-    if (!i.ok()) 
-       i.insert(p);
-    else {
-       i.add(p);
-       i++;
-    }
-}
-
-void
-Staff_commands::clean(Moment l)
-{
-    PCursor<Staff_commands_at*> i(bottom());
-    for (; i->tdescription_.when > l; i=bottom()) {
-       remove(i);
-    }
-    
-    Staff_commands_at*p = find(l);
-    if (!p) {
-       p = new Staff_commands_at(Time_description(l - i->when(), &i->tdescription_));
-       add(p);
-    }
-    if (!p->is_breakable()) {
-       p->set_breakable();
-    }
-}
index bf76a9eb704304d24e5a16a1e1deff477100e667..d942732e7c264bc8c96c0513656e9630065125b7 100644 (file)
@@ -7,12 +7,23 @@
 String
 Staff_elem::TeXstring() const
 {
-    assert(output && !calc_children);
+    assert(!calc_children);
     Molecule m(*output);
     m.translate(offset_);      // ugh?
     return m.TeXstring();
 }
 
+Staff_elem::Staff_elem(Staff_elem const&s)
+    :    dependencies(s.dependencies)
+{
+    status = s.status;
+    assert(!s.output);
+    output = 0;
+    pstaff_l_ = s.pstaff_l_;
+    calc_children = false;
+    offset_ = Offset(0,0);
+}
+
 Staff_elem::~Staff_elem()
 {
    delete output;
@@ -60,7 +71,7 @@ Staff_elem::print()const
 Staff_elem::Staff_elem()
 {
     calc_children = false;
-    pstaff_=0;
+    pstaff_l_=0;
     offset_ = Offset(0,0);
     output = 0;
     status = ORPHAN;
@@ -70,8 +81,8 @@ Staff_elem::Staff_elem()
 Paperdef*
 Staff_elem::paper()  const
 {
-    assert(pstaff_);
-    return pstaff_->pscore_->paper_;
+    assert(pstaff_l_);
+    return pstaff_l_->pscore_l_->paper_l_;
 }
 
 void
@@ -89,7 +100,7 @@ Staff_elem::pre_processing()
 {
     if (status >= PRECALCED )
        return;
-    for (int i=0; i < dependencies.sz(); i++)
+    for (int i=0; i < dependencies.size(); i++)
        if (dependencies[i])
            dependencies[i]->pre_processing();
     if (!calc_children)
@@ -101,7 +112,7 @@ Staff_elem::post_processing()
 {
     if (status > POSTCALCED)
        return;
-    for (int i=0; i < dependencies.sz(); i++)
+    for (int i=0; i < dependencies.size(); i++)
        if (dependencies[i])
            dependencies[i]->post_processing();
     if (!calc_children)
@@ -114,7 +125,7 @@ Staff_elem::molecule_processing()
 {
     if (status >= OUTPUT)
        return;
-    for (int i=0; i < dependencies.sz(); i++)
+    for (int i=0; i < dependencies.size(); i++)
        if (dependencies[i])
            dependencies[i]->molecule_processing();
     if (!calc_children)
index 7bd534fb976eaa471fd1d1c460de8e208c95393c..1eacf8cb6527b2d57fcf5ebba5c2a72af4ced6c6 100644 (file)
@@ -26,11 +26,11 @@ Line_of_staff::TeXstring() const
     // the staff itself: eg lines, accolades
     s += "\\hbox{";
     {                          
-       ((PStaff*)pstaff_)->
-           brew_molecule(line_of_score_->pscore_->paper_->linewidth);
+       ((PStaff*)pstaff_l_)->
+           brew_molecule(line_of_score_l_->pscore_l_->paper_l_->linewidth);
 
-       s+=pstaff_->stafsym->TeXstring();
-       iter_top(line_of_score_->cols,cc);
+       s+=pstaff_l_->stafsym_p_->TeXstring();
+       iter_top(line_of_score_l_->cols,cc);
        Real lastpos=cc->hpos;
 
        // all items in the current line & staff.
@@ -45,12 +45,12 @@ Line_of_staff::TeXstring() const
            // now output the items.
 
            for (iter_top(cc->its,i); i.ok(); i++) {
-               if (i->pstaff_ == pstaff_)
+               if (i->pstaff_l_ == pstaff_l_)
                    s += i->TeXstring();
            }
            // spanners.
            for (iter_top(cc->starters,i); i.ok(); i++)
-               if (i->pstaff_ == pstaff_)
+               if (i->pstaff_l_ == pstaff_l_)
                    s += i->TeXstring();
        }
     }
@@ -60,19 +60,19 @@ Line_of_staff::TeXstring() const
 
 Line_of_staff::Line_of_staff(Line_of_score * sc, PStaff*st)
 {
-    line_of_score_=sc;
-    pstaff_=st;
+    line_of_score_l_=sc;
+    pstaff_l_=st;
 
     PCol *linestart = sc->cols.top();
     PCol *linestop = sc->cols.bottom();
     
-    for (iter_top(pstaff_->spans,i); i.ok(); i++) {
+    for (iter_top(pstaff_l_->spans,i); i.ok(); i++) {
 
        PCol *brokenstart = &max(*linestart, *i->left);
        PCol *brokenstop = &min(*linestop, *i->right);
        if ( *brokenstart < *brokenstop) {
            Spanner*span_p =i->broken_at(brokenstart,brokenstop);
-           line_of_score_->pscore_-> // higghl
+           line_of_score_l_->pscore_l_-> // higghl
                add_broken(span_p);
        }
     }
@@ -82,19 +82,19 @@ Line_of_staff::Line_of_staff(Line_of_score * sc, PStaff*st)
 Interval
 Line_of_staff::height() const
 {
-    Interval y = pstaff_->stafsym->extent().y;
-    iter_top(line_of_score_->cols,cc);
+    Interval y = pstaff_l_->stafsym_p_->extent().y;
+    iter_top(line_of_score_l_->cols,cc);
     
     // all items in the current line & staff.
     for (; cc.ok(); cc++) {
        for (iter_top(cc->its,i); i.ok(); i++) {
-           if (i->pstaff_ == pstaff_) 
+           if (i->pstaff_l_ == pstaff_l_) 
                y.unite(i->height());
            
        }
        // spanners.
        for (iter_top(cc->starters,i); i.ok(); i++)
-           if (i->pstaff_ == pstaff_) {
+           if (i->pstaff_l_ == pstaff_l_) {
                y.unite(i->height());
            }
     }
@@ -105,7 +105,7 @@ Line_of_staff::height() const
 void
 Line_of_staff::process()
 {
-    if (!pstaff_->stafsym)
-       pstaff_->brew_molecule(line_of_score_->pscore_->
-                              paper_->linewidth);
+    if (!pstaff_l_->stafsym_p_)
+       pstaff_l_->brew_molecule(line_of_score_l_->pscore_l_->
+                              paper_l_->linewidth);
 }
index 9ed22dfe47eceeee6a150d87c014e2705aaddf9a..46c04cbeadd944afee5f4118e5be90a0c8552784 100644 (file)
@@ -1,18 +1,30 @@
 #include "voice.hh"
 #include "timedescription.hh"
 #include "sccol.hh"
+#include "staffcommands.hh"
 #include "stcol.hh"
 
+void
+Staff_column::OK() const
+{
+#ifndef NDEBUG
+    if (tdescription_) {
+       assert(tdescription_->when == when());
+       assert(*tdescription_ == staff_commands_p_->tdescription_);
+    }
+    #endif
+}
+
 bool
 Staff_column::mus() const
 {
-    return score_column->musical;
+    return score_column_l_->musical_;
 }
 
 Moment
 Staff_column::when() const
 {
-    return score_column->when;
+    return score_column_l_->when();
 }
 
 void
@@ -20,17 +32,17 @@ Staff_column::add(Voice_element*ve)
 {
     Moment d= ve->duration;
     if (d){
-       score_column->add_duration(d);
+       score_column_l_->add_duration(d);
     }
        
     v_elts.add(ve);
 }
 
-Staff_column::Staff_column(Score_column*s)
+Staff_column::Staff_column(Score_column *s_l)
 {
-    score_column = s;
-    s_commands = 0;
-    tdescription_ = 0;
+    tdescription_ =0;
+    score_column_l_ = s_l;
+    staff_commands_p_ = 0;
 }
 
 Staff_column::~Staff_column()
index df250aa8d37d1e43cdb554009b7c44609d3b28a2..66b1aadb33501a338959a77a7386da1e1924bf44 100644 (file)
@@ -116,9 +116,11 @@ void
 Stem::set_noteheads()
 {
     heads.sort(Notehead::compare);
+    heads[0]->extremal = -1;
+    heads.last()->extremal = 1;
     int parity=1;
     int lastpos = heads[0]->position;
-    for (int i=1; i < heads.sz(); i ++) {
+    for (int i=1; i < heads.size(); i ++) {
        int dy =abs(lastpos- heads[i]->position);
        
        if (dy <= 1) {
@@ -146,7 +148,7 @@ Stem::width()const
     if (!print_flag || abs(flag) <= 4)
        return Interval(0,0);   // TODO!
     Paperdef*p= paper();
-    Interval r(p->lookup_->flag(flag).dim.x);
+    Interval r(p->lookup_p_->flag(flag).dim.x);
     r+= stem_xoffset;
     return r;
 }
@@ -154,20 +156,19 @@ Stem::width()const
 Molecule*
 Stem::brew_molecule()const return out;
 {
-    assert(pstaff_);
     assert(bot!=top);
  
     
     Paperdef *p =paper();
 
     Real dy = p->internote();
-    Symbol ss =p->lookup_->stem(bot*dy,top*dy);
+    Symbol ss =p->lookup_p_->stem(bot*dy,top*dy);
 
     
     out = new Molecule(Atom(ss));
 
     if (print_flag&&abs(flag) > 4){
-       Symbol fl = p->lookup_->flag(flag);
+       Symbol fl = p->lookup_p_->flag(flag);
        Molecule m(fl);
        if (flag < -4){         
            out->add_bottom(m);
@@ -183,7 +184,7 @@ Stem::brew_molecule()const return out;
 Real
 Stem::hpos()const
 {
-    return pcol_->hpos + stem_xoffset;
+    return pcol_l_->hpos + stem_xoffset;
 }
 
 
index 9e4f1d3ff69970b1fdedd16407381e341038b7a5..34afa0ee40822363772c591699a78650208cc22a 100644 (file)
@@ -4,6 +4,11 @@
 #include "sccol.hh"
 
 Staff_walker::~Staff_walker() {}
+Staff_walker::Staff_walker(Staff_walker const &s)
+    :PCursor<Staff_column*> (s)
+{
+    assert(false);
+}
 
 Staff_walker::Staff_walker(Staff * s, PScore*ps )
     : PCursor<Staff_column*> (s->cols)
@@ -23,8 +28,8 @@ void
 Staff_walker::process()
 {
     break_status = BREAK_END - BREAK_PRE;
-    if (ptr()->s_commands)
-       for (iter_top(*ptr()->s_commands,i); i.ok(); i++) {
+    if (ptr()->staff_commands_p_)
+       for (iter_top(*ptr()->staff_commands_p_,i); i.ok(); i++) {
            process_command(i);
     }
 
@@ -40,7 +45,7 @@ Staff_walker::process_command(Command*com)
     case BREAK_MIDDLE:
     case BREAK_POST:
     case BREAK_END:
-       (*this)->score_column->set_breakable();
+       (*this)->score_column_l_->set_breakable();
        break_status = com->code- BREAK_PRE;
        break;
     case INTERPRET:
index d9ffea7afbb565ae1d13bafd8d0dfebeb0bb1bed..01b235679b7016b5cd18932629b5135c6000ec97 100644 (file)
@@ -1,5 +1,5 @@
 #include "symbol.hh"
-#include "vray.hh"
+#include "varray.hh"
 
 
 Symbol::Symbol()
index 0a9c288bdedf7f9a04ccda8975b62f2be93a617f..128dd06258fbf958bf74b414d6d95150da0d2e0e 100644 (file)
@@ -8,13 +8,13 @@
 #include "scoreline.hh" 
 #include "staffline.hh"
 
-
+#include "pcursor.tcc"
 #include "plist.tcc"
 
 
 #define IPLC_instantiate(a) IPL_instantiate(a); PL_instantiate(const a)
 
-IPLC_instantiate(Stem*);
+
 IPLC_instantiate(Line_of_score);
 IPLC_instantiate(Line_of_staff);
 IPLC_instantiate(Item);
index da169d165740629a6d1943eb42bc2ccd08a63cbe..06b3a167c4c30c31797846ab4c8ecbf7251182b8 100644 (file)
@@ -8,7 +8,7 @@
 #include "spanner.hh"
 
 #include "plist.tcc"
-
+#include "pcursor.tcc"
 
 IPL_instantiate(Request);
 IPL_instantiate(Score_column);
index 0dba62b3d8192f3c5be4c8ee873856c17b5904d2..106260039aff918cdde3fd36a8252915fcb3b246 100644 (file)
@@ -10,7 +10,7 @@
 
 
 #include "plist.tcc"
-
+#include "pcursor.tcc"
 IPL_instantiate(Atom);
 IPL_instantiate(Command);
 IPL_instantiate(Atom);
index 372536c20aa31916d1e4cd9824dfbb29a06040d9..9a10c993ea023da5ff030dfd3dd93d6882e84cc3 100644 (file)
@@ -2,7 +2,7 @@
 #include "tex.hh"
 #include "symbol.hh"
 #include "const.hh"
-#include "vray.hh"
+#include "varray.hh"
 
 String
 vstrut(Real h)
@@ -22,20 +22,20 @@ substitute_arg(String& r, String arg)
 
 
 String
-substitute_args(String source, svec<String> args)    
+substitute_args(String source, Array<String> args)    
 {
     String retval (source);
-    for (int i = 0 ; i < args.sz(); i++)
+    for (int i = 0 ; i < args.size(); i++)
         substitute_arg(retval, args[i]);
     while (retval.pos('%'))
         substitute_arg(retval, "");
     return retval;
 }
 String
-substitute_args(String source, svec<Scalar> args)    
+substitute_args(String source, Array<Scalar> args)    
 {
-    svec<String> sv;
-    for (int i = 0 ; i < args.sz(); i++)
+    Array<String> sv;
+    for (int i = 0 ; i < args.size(); i++)
        sv.add(args[i]);
     
     return substitute_args(source, sv);
index 713bc1f4737ef6b2089ad305f3f4f7c776d077d6..652360eee871351fdd7e114b8840a3a04fad37fa 100644 (file)
@@ -18,7 +18,7 @@ Lookup::beam_element(int sidx, int widx, Real slope)
 {
     Symbol bs=(*symtables_)("beamslopes")->lookup("slope");
     
-    svec<String> args;
+    Array<String> args;
     args.add(sidx);
     args.add(widx);
     bs.tex = substitute_args(bs.tex,args);
@@ -51,7 +51,7 @@ Symbol
 Lookup::rule_symbol(Real height, Real width)
 {
     Symbol bs=(*symtables_)("beamslopes")->lookup("horizontal");    
-    svec<String> args;
+    Array<String> args;
     args.add(print_dimen(height));
     args.add(print_dimen(width));
     bs.tex = substitute_args(bs.tex,args);
index 58c666150c0bb2d9e0ebf12cdcd9b57872e9f443..26dee59a712d9b161617082f32c9b5fba208688e 100644 (file)
@@ -13,7 +13,7 @@ Text_def::Text_def()
 Atom
 Text_def::create(Paperdef*p) const
 {
-    return p->lookup_->text(style, text, -align);
+    return p->lookup_p_->text(style, text, -align);
 }
 
 void
index 459c15a06de8a2592e737210d289ba84e3d552d8..ce9b667aafdba0994d0de51bd16ec56dba970cd5 100644 (file)
@@ -1,23 +1,33 @@
 #include "timedescription.hh"
 #include "debug.hh"
+String
+Time_description::str()const
+{
+    String s( "Time_description { at ");
+    s+=when;
+    s+="\nmeter " + String(whole_per_measure/one_beat) +":" +(1/one_beat);
+    s+= "\nposition "+String( bars) + ":"+ whole_in_measure +"\n}\n";
+    return s;
+}
 
 void
 Time_description::print() const
 {    
-    mtor << "Time_description { at "<<when<<'\n'; 
-    mtor << "meter " << whole_per_measure << ":" << 1/one_beat 
-        << "\nposition "<< bars << ":" << whole_in_measure <<"\n}\n";
+    mtor << str();
 }
 void
 Time_description::OK() const
 {
+#ifdef NDEBUG
     assert(whole_in_measure < whole_per_measure && 0 <= whole_in_measure);
     assert(one_beat);
+#endif
 }
+
 Time_description::Time_description(Moment dt, Time_description const *prev)
 {
     if (prev) {
-       assert(dt >0);
+       assert(dt >0);
        *this = *prev;
        when += + dt;
        whole_in_measure += dt;
@@ -51,8 +61,24 @@ Time_description::setpartial(Moment p)
        error_t ("Partial measure has incorrect size", when);
     whole_in_measure = whole_per_measure - p;
 }
+
 Moment
 Time_description::barleft()
 {
-return    whole_per_measure-whole_in_measure;
+    return whole_per_measure-whole_in_measure;
+}
+
+int
+Time_description::compare(Time_description &t1, Time_description&t2)
+{
+    int i = sign(t1.when-t2.when);
+
+    if (!i) {
+       assert(t1.bars==t2.bars);
+       assert(t1.one_beat == t2.one_beat);
+       assert(t1.whole_in_measure == t2.whole_in_measure);
+       assert(t1.whole_per_measure == t2.whole_per_measure);
+    }
+
+    return i;
 }
index 9c474f81bb851a84f696231de45b8bdb2ce37836..f4372893afa62993b60ccb7a1faf5a2ddaa8996f 100644 (file)
@@ -4,7 +4,9 @@
 
 Voice::Voice(Voice const&src)
 {
-    PL_copy(elts, src.elts);
+    for (iter_top(src.elts, i); i.ok(); i++)
+       add(new Voice_element(**i));
+
     start = src.start;
 }
 
@@ -57,7 +59,7 @@ Voice_element::add(Request*r)
        assert (!duration);         
        duration = r->duration();
     }
-    r->elt = this;
+    r->elt_l_ = this;
     reqs.bottom().add(r);
 }
 
@@ -71,9 +73,8 @@ Voice_element::Voice_element()
 
 Voice_element::Voice_element(Voice_element const&src)
 {
-    duration=src.duration;
     voice_=src.voice_;
-    IPointerList__copy(Request*, reqs, src.reqs, clone());
+    for (iter_top(src.reqs, i); i.ok(); i++)
+       add(i->clone());
     group=src.group;
-//    assert(!granted_items.size() && !granted_spanners.size());
 }
index 230e4bb976a11fe9b79228e460b86487912df35e..0c3cac1186d1d1b3022aa209497fdaa18e7e0b15 100644 (file)
@@ -1,11 +1,10 @@
 #include "debug.hh"
 #include "lexer.hh"
+#include "moment.hh"
 
 ostream &warnout (cerr);
 ostream *mlog(&cerr);
 
-
-
 void
 warning(String s)
 {
@@ -25,9 +24,9 @@ error(String s)
 }
 
 void
-error_t(String s, Real r)
+error_t(const String& s, Moment r)
 {
-    String e=s+ "(t = " + r + ")";
+    String e=s+ "(t = " + String(r) + ")";
     error(e);
     exit(1);
 }
index ec6ac16395ef159d23a5167914abd9f15e061c91..d0bfd5b74fd907c336105e179b1bc2fe32840fc6 100644 (file)
@@ -9,25 +9,25 @@
    
     */
 
-svec<Col_configuration>
+Array<Col_configuration>
 Word_wrap::solve()
 {
     problem_OK();
     iter_top(pscore_.cols,curcol);
-    svec<Col_configuration> breaking;
-    svec<PCol *> breakpoints(find_breaks());
-    assert(breakpoints.sz()>=2);
-    for (int i=0 ; i < breakpoints.sz() -1; ) {
+    Array<Col_configuration> breaking;
+    Array<PCol *> breakpoints(find_breaks());
+    assert(breakpoints.size()>=2);
+    for (int i=0 ; i < breakpoints.size() -1; ) {
        Col_configuration minimum;
        Col_configuration current;
 
         // do  another line
-       PCol *post = breakpoints[i]->postbreak;
+       PCol *post = breakpoints[i]->postbreak_p_;
        current.add( post);
        curcol++;               // skip the breakable.
        i++;
 
-       while (i < breakpoints.sz()) {
+       while (i < breakpoints.size()) {
 
            // add another measure.
            while (breakpoints[i] != curcol.ptr()){
@@ -35,9 +35,9 @@ Word_wrap::solve()
                current.add(curcol);
                curcol++;
            }
-           current.add(breakpoints[i]->prebreak );
+           current.add(breakpoints[i]->prebreak_p_ );
            if (!feasible(current.cols)) {
-               if (!minimum.cols.sz())
+               if (!minimum.cols.size())
                    error("sorry, this measure is too long");
                break;
            }
diff --git a/titledefs.tex b/titledefs.tex
new file mode 100644 (file)
index 0000000..33cf813
--- /dev/null
@@ -0,0 +1,15 @@
+\def\thetitle{}
+\def\thecomposer{}
+\def\theinstrument{}
+\def\title#1{\def\thetitle{#1}}
+\def\composer#1{\def\thecomposer{#1}}
+\def\instrument#1{\def\theinstrument{#1}}
+
+\def\maketit{
+  \begin{center}
+    {\Large\bfseries\thetitle}\\
+    \vskip12pt
+    {\bfseries\theinstrument}\hfill{\scshape\thecomposer}
+  \end{center}
+  \bigskip
+  }
\ No newline at end of file