From 04f01c7e890bd4f1b358378e5911fb7c117c3802 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 26 May 1997 11:57:09 +0200 Subject: [PATCH] release: 0.0.65 --- .version | 4 +- AUTHORS.text | 22 +- Documentation/AUTHORS.pod | 19 +- Documentation/INSTALL.pod | 29 ++ Documentation/faq.pod | 15 + Documentation/gnu-music.pod | 60 +-- Documentation/lilygut.pod | 22 +- Documentation/lilyliterature.pod | 6 + Documentation/lilypond.pod | 49 +-- INSTALL.text | 74 +++- NEWS | 48 ++- README | 12 +- TODO | 112 +++--- bin/clearlily | 6 +- bin/genheader | 2 +- bin/make_website | 33 +- configure | 6 + configure.in | 6 + flower/.version | 2 +- flower/NEWS | 6 + flower/directed-graph.cc | 152 +++++++ flower/include/directed-graph.hh | 51 +++ flower/include/fproto.hh | 2 + flower/include/interval.hh | 2 +- flower/include/interval.tcc | 2 +- flower/include/matrix-storage.hh | 2 +- flower/include/matrix.hh | 10 +- flower/include/parray.hh | 36 +- flower/include/path.hh | 3 - flower/include/plist.hh | 13 +- flower/include/plist.tcc | 3 +- .../{class-name.hh => virtual-methods.hh} | 4 + flower/interval.cc | 2 +- flower/path.cc | 11 +- flower/string-convert.cc | 5 +- init/register.ini | 2 +- init/table_sixteen.ini | 4 +- input/collisions.ly | 33 +- input/keys.ly | 15 +- input/rhythm.ly | 1 + input/wohltemperirt.ly | 325 ++++++++------- lib/duration-convert.cc | 13 +- lib/include/proto.hh | 158 +------- lib/include/source.hh | 6 +- lib/source.cc | 7 +- lily/.version | 2 +- lily/Makefile | 12 +- lily/Stable.make | 4 +- lily/bar-reg.cc | 3 +- lily/bar.cc | 2 +- lily/beam.cc | 110 ++--- lily/bow.cc | 7 +- lily/break.cc | 4 +- lily/calcideal.cc | 2 +- lily/clef-item.cc | 4 +- lily/clef-reg.cc | 2 +- lily/collision-reg.cc | 2 +- lily/collision.cc | 37 +- lily/command-request.cc | 2 +- lily/complex-staff.cc | 20 - lily/complex-walker.cc | 22 +- lily/crescendo.cc | 13 +- lily/dimen.cc | 2 +- lily/dynamic-reg.cc | 2 +- lily/elem-group.cc | 93 +++++ lily/global-regs.cc | 2 +- lily/grouping.cc | 2 +- lily/head-reg.cc | 22 +- lily/idealspacing.cc | 3 +- lily/identifier.cc | 2 +- lily/include/bar-reg.hh | 2 +- lily/include/bar.hh | 2 +- lily/include/beam.hh | 32 +- lily/include/bow.hh | 5 +- lily/include/break.hh | 4 +- lily/include/clef-reg.hh | 2 +- lily/include/colhpos.hh | 4 +- lily/include/collision-reg.hh | 2 +- lily/include/collision.hh | 5 +- lily/include/command-request.hh | 2 +- lily/include/complex-staff.hh | 25 -- lily/include/complex-walker.hh | 7 +- lily/include/crescendo.hh | 12 +- lily/include/debug.hh | 2 +- lily/include/directional-spanner.hh | 11 +- lily/include/dynamic-reg.hh | 2 +- lily/include/elem-group.hh | 37 ++ lily/include/glob.hh | 2 +- lily/include/grouping.hh | 2 +- lily/include/head-reg.hh | 10 +- lily/include/idealspacing.hh | 4 +- lily/include/identifier.hh | 4 +- lily/include/identparent.hh | 1 - lily/include/input-music.hh | 4 +- lily/include/input-register.hh | 4 +- lily/include/input-score.hh | 6 +- lily/include/input-staff.hh | 2 +- lily/include/item.hh | 19 +- lily/include/key-item.hh | 2 +- lily/include/key-reg.hh | 2 +- lily/include/keyword.hh | 2 +- lily/include/leastsquares.hh | 2 +- lily/include/lily-proto.hh | 160 ++++++-- lily/include/linespace.hh | 2 +- lily/include/local-key-item.hh | 13 +- lily/include/local-key-reg.hh | 4 +- lily/include/lookup.hh | 9 +- lily/include/lyric-register.hh | 7 +- lily/include/main.hh | 2 +- lily/include/meter-reg.hh | 2 +- lily/include/midi-def.hh | 6 +- lily/include/midi-item.hh | 4 +- lily/include/midi-output.hh | 2 +- lily/include/midi-stream.hh | 2 +- lily/include/midi-walker.hh | 2 +- lily/include/misc.hh | 2 +- lily/include/molecule.hh | 6 +- lily/include/musical-request.hh | 2 +- lily/include/my-lily-lexer.hh | 4 +- lily/include/my-lily-parser.hh | 6 +- lily/include/note-column-reg.hh | 2 +- lily/include/note-column.hh | 10 +- lily/include/{notehead.hh => note-head.hh} | 10 +- lily/include/notename-table.hh | 2 +- lily/include/notename.hh | 2 +- lily/include/offset.hh | 2 +- lily/include/p-col.hh | 8 +- lily/include/p-score.hh | 64 ++- lily/include/p-staff.hh | 25 -- lily/include/paper-def.hh | 8 +- lily/include/parseconstruct.hh | 4 +- lily/include/pulk-voice.hh | 4 +- lily/include/pulk-voices.hh | 4 +- lily/include/qlp.hh | 2 +- lily/include/qlpsolve.hh | 2 +- lily/include/register-group.hh | 6 +- lily/include/register.hh | 4 +- lily/include/reqtodo.hh | 83 ---- lily/include/request-column.hh | 2 +- lily/include/request.hh | 8 +- lily/include/rest-collision-reg.hh | 2 +- lily/include/rest-collision.hh | 7 +- lily/include/rest-column.hh | 8 +- lily/include/score-column.hh | 4 +- ...{staff-elem-info.hh => score-elem-info.hh} | 4 +- lily/include/{staff-elem.hh => score-elem.hh} | 84 ++-- lily/include/score-walker.hh | 4 +- lily/include/score.hh | 4 +- lily/include/scoreline.hh | 49 ++- lily/include/script-column.hh | 20 +- lily/include/script-def.hh | 2 +- lily/include/script-reg.hh | 2 +- lily/include/script.hh | 2 +- lily/include/slur.hh | 23 +- lily/include/spanner-elem-group.hh | 25 ++ lily/include/spanner.hh | 30 +- lily/include/staff-info.hh | 2 +- lily/include/staff-regs.hh | 2 +- lily/include/staff-side.hh | 17 +- lily/include/staff-sym-reg.hh | 2 +- lily/include/staff-sym.hh | 5 +- lily/include/staff-walker.hh | 2 +- lily/include/staff.hh | 16 +- lily/include/staffeleminfo.hh | 4 +- lily/include/staffline.hh | 25 +- lily/include/stem-beam-reg.hh | 2 +- lily/include/stem.hh | 13 +- lily/include/super-elem.hh | 32 ++ lily/include/swallow-reg.hh | 2 +- lily/include/symbol.hh | 2 +- lily/include/tex.hh | 14 +- lily/include/text-def.hh | 4 +- lily/include/text-item.hh | 2 +- lily/include/text-reg.hh | 2 +- lily/include/text-spanner.hh | 18 +- lily/include/tie-reg.hh | 2 +- lily/include/tie.hh | 18 +- lily/include/time-description.hh | 2 +- lily/include/vertical-brace.hh | 20 - lily/include/vertical-spanner.hh | 24 -- lily/include/voice-element.hh | 4 +- lily/include/voice-group-regs.hh | 2 +- lily/include/voice-regs.hh | 2 +- lily/include/voice.hh | 2 +- lily/include/walk-regs.hh | 29 +- lily/input-register.cc | 2 +- lily/input-score.cc | 2 +- lily/input-staff.cc | 5 +- lily/item.cc | 4 +- lily/key-item.cc | 2 +- lily/key-reg.cc | 2 +- lily/key.cc | 2 +- lily/lexer.l | 7 +- lily/lexerinit.cc | 2 +- lily/local-key-item.cc | 19 +- lily/local-key-reg.cc | 2 +- lily/lookup.cc | 13 +- lily/lyric-register.cc | 2 +- lily/main.cc | 13 +- lily/meter-reg.cc | 2 +- lily/midi-def.cc | 2 +- lily/midi-item.cc | 2 +- lily/midi-output.cc | 2 +- lily/midi-stream.cc | 2 +- lily/midi-walker.cc | 2 +- lily/molecule.cc | 6 +- lily/musical-request.cc | 2 +- lily/my-lily-lexer.cc | 2 +- lily/my-lily-parser.cc | 2 +- lily/note-column-reg.cc | 12 +- lily/note-column.cc | 23 +- lily/notehead.cc | 18 +- lily/notename-table.cc | 2 +- lily/p-col.cc | 8 +- lily/p-score.cc | 203 +++++----- lily/p-staff.cc | 14 - lily/paper-def.cc | 8 +- lily/parser.y | 2 +- lily/pulk-voice.cc | 2 +- lily/pulk-voices.cc | 2 +- lily/qlpsolve.cc | 2 +- lily/register-group.cc | 2 +- lily/register.cc | 5 +- lily/request-column.cc | 2 +- lily/rest-collision-reg.cc | 2 +- lily/rest-collision.cc | 11 +- lily/rest-column.cc | 16 +- lily/score-column.cc | 2 +- ...{staff-elem-info.cc => score-elem-info.cc} | 6 +- lily/score-elem.cc | 377 ++++++++++++++++++ lily/score-walker.cc | 2 +- lily/score.cc | 3 +- lily/scoreline.cc | 149 +++++-- lily/script-column.cc | 42 +- lily/script.cc | 5 +- lily/slur.cc | 31 +- lily/spanner-elem-group.cc | 38 ++ lily/spanner.cc | 99 ++++- lily/staff-column.cc | 26 +- lily/staff-elem.cc | 245 ------------ lily/staff-info.cc | 2 +- lily/staff-regs.cc | 2 +- lily/staff-side.cc | 41 +- lily/staff-sym-reg.cc | 2 +- lily/staff-sym.cc | 11 +- lily/staff-walker.cc | 2 +- lily/staff.cc | 37 +- lily/staffline.cc | 111 +----- lily/stem-beam-reg.cc | 11 +- lily/stem.cc | 44 +- lily/super-elem.cc | 55 +++ lily/swallow-reg.cc | 2 +- lily/symtable.cc | 9 +- lily/template1.cc | 13 +- lily/template2.cc | 2 +- lily/template4.cc | 2 +- lily/template7.cc | 2 +- lily/tex-beam.cc | 2 +- lily/tex-slur.cc | 10 +- lily/tex-stream.cc | 10 +- lily/tex.cc | 2 + lily/text-item.cc | 5 +- lily/text-spanner.cc | 24 +- lily/tie-reg.cc | 10 +- lily/tie.cc | 39 +- lily/time-description.cc | 2 +- lily/vertical-brace.cc | 9 - lily/vertical-spanner.cc | 17 - lily/voice-element.cc | 2 +- lily/voice-group-regs.cc | 2 +- lily/voice-regs.cc | 2 +- lily/voice.cc | 2 +- lily/walk-regs.cc | 28 +- lily/warn.cc | 2 +- lily/wordwrap.cc | 10 +- make/Targets.make | 4 + make/lilypond.lsm | 6 +- make/lilypond.spec | 11 +- make/lilypond.spec.in | 7 +- mi2mu/.version | 2 +- mi2mu/Makefile | 3 +- mi2mu/TODO | 160 ++++++++ mi2mu/include/mi2mu-proto.hh | 28 ++ mi2mu/include/mi2mu.hh | 1 + mi2mu/main.cc | 3 +- mi2mu/midi-event.cc | 19 +- mi2mu/midi-lexer.l | 9 + mi2mu/midi-parser.y | 1 - mi2mu/midi-score.cc | 3 + mi2mu/midi-track.cc | 6 +- mi2mu/template.cc | 2 +- 291 files changed, 3183 insertions(+), 2089 deletions(-) create mode 100644 flower/directed-graph.cc create mode 100644 flower/include/directed-graph.hh rename flower/include/{class-name.hh => virtual-methods.hh} (88%) delete mode 100644 lily/complex-staff.cc create mode 100644 lily/elem-group.cc delete mode 100644 lily/include/complex-staff.hh create mode 100644 lily/include/elem-group.hh delete mode 100644 lily/include/identparent.hh rename lily/include/{notehead.hh => note-head.hh} (78%) delete mode 100644 lily/include/p-staff.hh delete mode 100644 lily/include/reqtodo.hh rename lily/include/{staff-elem-info.hh => score-elem-info.hh} (83%) rename lily/include/{staff-elem.hh => score-elem.hh} (62%) create mode 100644 lily/include/spanner-elem-group.hh create mode 100644 lily/include/super-elem.hh delete mode 100644 lily/include/vertical-brace.hh delete mode 100644 lily/include/vertical-spanner.hh delete mode 100644 lily/p-staff.cc rename lily/{staff-elem-info.cc => score-elem-info.cc} (70%) create mode 100644 lily/score-elem.cc create mode 100644 lily/spanner-elem-group.cc delete mode 100644 lily/staff-elem.cc create mode 100644 lily/super-elem.cc delete mode 100644 lily/vertical-brace.cc delete mode 100644 lily/vertical-spanner.cc create mode 100644 mi2mu/TODO create mode 100644 mi2mu/include/mi2mu-proto.hh diff --git a/.version b/.version index 4615332859..fa58dc3090 100644 --- a/.version +++ b/.version @@ -1,7 +1,7 @@ TOPLEVEL_MAJOR_VERSION = 0 TOPLEVEL_MINOR_VERSION = 0 -TOPLEVEL_PATCH_LEVEL = 64 +TOPLEVEL_PATCH_LEVEL = 65 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf -TOPLEVEL_MY_PATCH_LEVEL = +TOPLEVEL_MY_PATCH_LEVEL = diff --git a/AUTHORS.text b/AUTHORS.text index f1f13beaa9..e516153369 100644 --- a/AUTHORS.text +++ b/AUTHORS.text @@ -5,11 +5,13 @@ AUTHORS(1) LilyPond documentation AUTHORS(1) NNNNAAAAMMMMEEEE - AUTHORS - who did what on LilyPond? + AUTHORS - who did what on GNU LilyPond? DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN - This file lists authors of LilyPond, and what they wrote. + This file lists authors of GNU LilyPond, and what they + wrote. +AAAAUUUUTTTTHHHHOOOORRRRSSSS +o Han-Wen Nienhuys Main author, all files files except mentioned below @@ -17,15 +19,18 @@ DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN +o Jan Nieuwenhuizen lily/midi-*, mi2mu/*, parts flower/string*.cc, - make/*.make, parts of Documentation/mudela.pod, - lib/*source-file*, lib/duration.cc, lib/source, - flower/*{list,cursor}*, + make/*.make, */Makefile parts of + Documentation/mudela.pod, lib/*source-file*, + lib/duration.cc, lib/source, flower/*{list,cursor}*, and corresponding header files. +CCCCOOOONNNNTTTTRRRRIIIIBBBBUUUUTTTTOOOORRRRSSSS +o Mats Bengtsson , parts of clef- reg.cc, clef-item.cc testing, general comments. + +o Werner Lemberg , misc + bugfixes. @@ -56,11 +61,6 @@ DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN - - - - - -6/May/97 LilyPond 0.0.62 1 +19/May/97 LilyPond 0.0.65 1 diff --git a/Documentation/AUTHORS.pod b/Documentation/AUTHORS.pod index c7bc53d52d..7f343d780e 100644 --- a/Documentation/AUTHORS.pod +++ b/Documentation/AUTHORS.pod @@ -1,10 +1,12 @@ =head1 NAME -AUTHORS - who did what on LilyPond? +AUTHORS - who did what on GNU LilyPond? =head1 DESCRIPTION -This file lists authors of LilyPond, and what they wrote. +This file lists authors of GNU LilyPond, and what they wrote. + +=head1 AUTHORS =over 4 @@ -18,15 +20,26 @@ Main author, all files files except mentioned below Jan Nieuwenhuizen -lily/midi-*, mi2mu/*, parts flower/string*.cc, make/*.make, +lily/midi-*, mi2mu/*, parts flower/string*.cc, make/*.make, */Makefile parts of Documentation/mudela.pod, lib/*source-file*, lib/duration.cc, lib/source, flower/*{list,cursor}*, and corresponding header files. +=back + +=head1 CONTRIBUTORS + +=over 4 + =item * Mats Bengtsson , parts of clef-reg.cc, clef-item.cc testing, general comments. +=item * + +Werner Lemberg , misc bugfixes. + =back + diff --git a/Documentation/INSTALL.pod b/Documentation/INSTALL.pod index ef26b32fd3..cd096c7818 100644 --- a/Documentation/INSTALL.pod +++ b/Documentation/INSTALL.pod @@ -215,6 +215,35 @@ clef symbol has changed position in recent versions of MusixTeX) =back +At this time, GNU LilyPond output looks nice, but is not of production +quality. If you're not discouraged; this is what I type in my xterm: + + lilypond someinput.ly + tex lelie.tex + xdvi test& + +This is what the output looks like over here: + + hw:~/musix/spacer$ GNU LilyPond 0.0.60 #8/FlowerLib 1.1.14 #2 + Parsing ... [./input/kortjakje.ly[lots of stuff]] + Setting up requests...Processing requests ...[8][16][24][25] + Preprocessing elements... + Calculating column positions ... [3][7][12][16][20][25] + Postprocessing elements... + TeX output to lelie.tex ... + + hw:~/musix/spacer$ tex lelie + This is TeX, Version 3.14159 (C version 6.1) + (lelie.tex + Hyphenation patterns for english, dutch, german, loaded. + (/home/hw/lib/texmf/tex/lilypond/lilyponddefs.tex) [1] ) + Output written on lelie.dvi (1 page, 8944 bytes). + Transcript written on lelie.log. + + hw:~/musix/spacer$ xdvi lelie& + [1] 855 + +Check out the input files, some of them have comments Please refer to the man page for more information. =head1 REDHAT LINUX diff --git a/Documentation/faq.pod b/Documentation/faq.pod index 87a162c9c6..395a411fa2 100644 --- a/Documentation/faq.pod +++ b/Documentation/faq.pod @@ -120,6 +120,21 @@ A: The entry point is in main(). Good luck. :-) Seriously, read, reread and reread lilygut and CodingStyle, and just start anywhere. +Anywhere? Well, most of the comment doco are in the header files, so +your best bet would be C. Some of the most +important data-structures are to be found in: + + - p-col.hh + - *request.hh + - register.hh + - score-elem.hh + - input-music.hh + - linespace.hh + - item.hh + - spanner.hh + - voice.hh + + Q: Why GPL? A: Yes. diff --git a/Documentation/gnu-music.pod b/Documentation/gnu-music.pod index cdd1ea3b70..994dadac54 100644 --- a/Documentation/gnu-music.pod +++ b/Documentation/gnu-music.pod @@ -21,37 +21,39 @@ and possibly for - arranging - performing -Music publishers make lots of money out of selling which sheet music -essentially free (composed by people long dead). Publishers have two -arguments for doing this: high prices are there to guarantee diversity -(keeping lots of stock is expensive), and to encourage new work being -composed. +Music publishers make lots of money out of selling sheet music which +is in the public domain (the composers died a long time ago). It is +usually prohibited to xerox the sheet music. Publishers have two +arguments for not allowing this: high prices are there to guarantee +diversity (keeping lots of stock is expensive), and to encourage new +work being composed. LilyPond addresses the first issue: storing mudelas takes up almost no space at all. Other systems should address the other issue: encouraging laymen to take up composing, in the same way that GNU tools have created a whole new generation of programmers. +The public deserves to get public domain music for free (zero cents). -The public deserves free non-copyrighted music. - -The public deserves free tools for composing and printing +The public deserves free tools for composing and printing. =head1 REQUIREMENTS +Emacs and TeX serve as useful examples of what programs by the GMP +should be. + =over 4 =item * high-quality -(cf Emacs), from engraving point of view +(cf TeX), from engraving point of view =item * high-quality -from software point of view: like all GNU software, it +(cf Emacs) from software point of view: like all GNU software, it should have no limits, be fast, etc. - =item * tweakable Printed music has a lot of styles, and special symbols. It may be @@ -61,9 +63,9 @@ Emacs and TeX =item * easy to use. -That is, for technical users (that can read a -manual). The learning curve should be as easy as possible but not at -the expense of comfort of use. +That is, for technical users (that can read a manual). The learning +curve should be as easy as possible but not at the expense of comfort +of use and power. =back @@ -71,6 +73,13 @@ the expense of comfort of use. =over 4 +=item A set of music fonts + +Preferably in Metafont, suited to both screen display and use on paper + +The copyright heritage of Musixtex is unclear. + + =item A typesetting engine. A system with rules on how to set properties of items to be printed @@ -86,7 +95,7 @@ cooperate with the typesetting engine =item An ASCII language -In development, LilyPond has a language. See over there for goals. +In development, LilyPond has a language. (See over there for goals) Having an ASCII format which enables urtext, and easy sharing (via mail and news forums) encourages cooperation and exchange of music. @@ -98,7 +107,8 @@ Maybe to be merged with the display system. The natural way to enter composed music is singing or playing it. The GMP should have module which can take keyboard input or microphone -input and convert it to computer data. (the second one would be difficult) +input and convert it to computer data. (microphone input would be +difficult) =item sequencing @@ -128,16 +138,20 @@ project: the Free Music Project. =item * -A noninteractive typesetter, suited for batch jobs, and -typesetting existing music. This would couple the ASCII language, the -printing engine and the typesetting engine +A noninteractive typesetter, suited for batch jobs, and typesetting +existing music. This would couple the ASCII language, the printing +engine and the typesetting engine LilyPond is currently representing this section. =item * -A GUI for composing. This would combine the display engine, the -input system, the typesetting engine +A GUI for composing. This would combine the display engine, the input +system and the typesetting engine. + +=item * + +Libraries for reading, writing various audio/music/notation formats. =back @@ -151,11 +165,11 @@ recognizing input. =item * -gather moderate number of test users and hackers +Gather a moderate number of test users and hackers =item * -a website on GMP +A website on GMP =item * diff --git a/Documentation/lilygut.pod b/Documentation/lilygut.pod index 9bd3013c12..3278492c6b 100644 --- a/Documentation/lilygut.pod +++ b/Documentation/lilygut.pod @@ -62,11 +62,12 @@ natural form for processing music. =item Processing: Requests are processed and used to create elements (like balls, stems, -slurs etc). This is done by a hierarchy of brokers, which swallow -requests, broadcast them and couple different elements. +slurs etc). This is done by a hierarchy of "brokers" (called +Register), which swallow requests, broadcast them and couple different +elements. In this step data-structures for the next steps are created and filled -with data: PScore, PCol, PStaff +with data: PScore, PCol. =item Preprocessing @@ -75,8 +76,15 @@ Some dependencies are resolved, such as the direction of stems, beams, =item Calculation: This step uses structures which have names starting with 'P'. -linebreaks and horizontal positions of PCols are determined. Line_of_* -generated. +linebreaks and horizontal positions of PCols are determined. + +Through some magical interactions with Line_of_score and Super_elem +(check out the source) the "lines" are produced. + +All other spanners can figure across which lines they are spread. If +applicable, they break themselves into pieces. After this, each piece +works (or, if there are no pieces) the spanner throws out any +dependencies which are in the wrong line. =item Postprocesing: @@ -321,9 +329,9 @@ In music symbols depend on each other: the stems of a beam should point in the same direction as the beam itself, so the stems of a beam depend on the beam. In the same way do scripts depend on the direction of the stem. To reflect this, LilyPond has the notion of dependency. -It works in the same fashion that make uses to build programs: before +It works in the same fashion that C uses to build programs: before a stem is calculated, its dependencies (the beam) should be -calculated. Before a slur is calculated, its dependencies (stems) +calculated. Before a slur is calculated, its dependencies (stems, noteheads) should be calculated. =head1 BREAKING diff --git a/Documentation/lilyliterature.pod b/Documentation/lilyliterature.pod index 5ca92764bb..98f71e631e 100644 --- a/Documentation/lilyliterature.pod +++ b/Documentation/lilyliterature.pod @@ -5,6 +5,8 @@ Lily literature -- reading on music engraving =head1 DESCRIPTION A list of resources on music printing/writing and engraving. +Please note that don't have access to most material (except a library +copy of Chlapik) =head2 References @@ -40,6 +42,10 @@ New York. [This is as close to the ``standard'' reference work for music notation issues as one is likely to get.] +The University of Colorado Music Engraving page. +http://www.cc.colorado.edu/cgi-bin/mfs/01/Dept/Musicpress/Welcome.html + +More on GNU Music: http://www.u-bordeaux.fr/~strandh =head2 Further reading diff --git a/Documentation/lilypond.pod b/Documentation/lilypond.pod index dcbaab0d00..46b2fcc581 100644 --- a/Documentation/lilypond.pod +++ b/Documentation/lilypond.pod @@ -148,36 +148,6 @@ coding C++ =head1 EXAMPLES -At this time, GNU LilyPond output looks nice, but is not of production -quality. If you're not discouraged; this is what I type in my xterm: - - lilypond someinput.ly - tex lelie.tex - xdvi test& - -This is what the output looks like over here: - - hw:~/musix/spacer$ GNU LilyPond 0.0.60 #8/FlowerLib 1.1.14 #2 - Parsing ... [./input/kortjakje.ly[lots of stuff]] - Setting up requests...Processing requests ...[8][16][24][25] - Preprocessing elements... - Calculating column positions ... [3][7][12][16][20][25] - Postprocessing elements... - TeX output to lelie.tex ... - - hw:~/musix/spacer$ tex lelie - This is TeX, Version 3.14159 (C version 6.1) - (lelie.tex - Hyphenation patterns for english, dutch, german, loaded. - (/home/hw/lib/texmf/tex/lilypond/lilyponddefs.tex) [1] ) - Output written on lelie.dvi (1 page, 8944 bytes). - Transcript written on lelie.log. - - hw:~/musix/spacer$ xdvi lelie& - [1] 855 - -Check out the input files, some of them have comments - =head1 PROBLEMS @@ -212,14 +182,14 @@ trace is : Than it would help if you send a dump of the Interval and the Item -(use: C or use GNU LilyPond C methods). +(use: C or use LilyPond C methods). =back -Bug reports should be directed to +Bug reports should be directed to: bug-gnu-music@vuse.vanderbilt.edu. In any case, they should contain a -description of the problem, an small input file which reproduces it -(if applicable), lilypond version and a description of the platform. +description of the problem, a small input file which reproduces it (if +applicable), the lilypond version and a description of the platform. =head1 FILES @@ -266,10 +236,9 @@ project. For more information on the GNU Music project, =item http://www.stack.nl/~hanwen/lilypond/index.html -GNU LilyPond has her own webpage at -This webpage contains -the MIDI, GIF and PS files for some standard music files. It also has -the complete LilyPond documentation +GNU LilyPond has her own webpage. This webpage contains the MIDI, GIF +and PS files for some standard music files. It also has the complete +LilyPond documentation =back @@ -308,8 +277,12 @@ For discussions concerning the GNU Music project, to subscribe: send mail with subject "subscribe" to gnu-music-discuss-request@vuse.vanderbilt.edu, + =back +Announces of new versions will be sent to info-gnu-music and +gnu-music-discuss. + =head1 REMARKS GNU LilyPond has no connection with the music package Rosegarden, other diff --git a/INSTALL.text b/INSTALL.text index 2db81c4b0e..8de884cd99 100644 --- a/INSTALL.text +++ b/INSTALL.text @@ -61,7 +61,7 @@ CCCCOOOONNNNFFFFIIIIGGGGUUUURRRRIIIINNNNGGGG a -16/May/97 LilyPond 0.0.64 1 +26/May/97 LilyPond 0.0.65 1 @@ -127,7 +127,7 @@ INSTALL(1) LilyPond documentation INSTALL(1) -16/May/97 LilyPond 0.0.64 2 +26/May/97 LilyPond 0.0.65 2 @@ -193,7 +193,7 @@ RRRRUUUUNNNNNNNNIIIINNNNGGGG -16/May/97 LilyPond 0.0.64 3 +26/May/97 LilyPond 0.0.65 3 @@ -215,6 +215,36 @@ INSTALL(1) LilyPond documentation INSTALL(1) T.59). Beware, the clef symbol has changed position in recent versions of MusixTeX) + At this time, GNU LilyPond output looks nice, but is not + of production quality. If you're not discouraged; this is + what I type in my xterm: + + lilypond someinput.ly + tex lelie.tex + xdvi test& + + This is what the output looks like over here: + + hw:~/musix/spacer$ GNU LilyPond 0.0.60 #8/FlowerLib 1.1.14 #2 + Parsing ... [./input/kortjakje.ly[lots of stuff]] + Setting up requests...Processing requests ...[8][16][24][25] + Preprocessing elements... + Calculating column positions ... [3][7][12][16][20][25] + Postprocessing elements... + TeX output to lelie.tex ... + + hw:~/musix/spacer$ tex lelie + This is TeX, Version 3.14159 (C version 6.1) + (lelie.tex + Hyphenation patterns for english, dutch, german, loaded. + (/home/hw/lib/texmf/tex/lilypond/lilyponddefs.tex) [1] ) + Output written on lelie.dvi (1 page, 8944 bytes). + Transcript written on lelie.log. + + hw:~/musix/spacer$ xdvi lelie& + [1] 855 + + Check out the input files, some of them have comments Please refer to the man page for more information. RRRREEEEDDDDHHHHAAAATTTT LLLLIIIINNNNUUUUXXXX @@ -226,6 +256,18 @@ RRRREEEEDDDDHHHHAAAATTTT LLLLIIIINNNNUUUUXXXX WWWWIIIINNNNDDDDOOOOZZZZEEEE Windows NT: + + + +26/May/97 LilyPond 0.0.65 4 + + + + + +INSTALL(1) LilyPond documentation INSTALL(1) + + you need the cygnus win32 gnu port development stuff; have a look at http://www.cygnus.com/gnu-win32. @@ -259,6 +301,30 @@ AAAAUUUUTTTTHHHHOOOORRRRSSSS -16/May/97 LilyPond 0.0.64 4 + + + + + + + + + + + + + + + + + + + + + + + + +26/May/97 LilyPond 0.0.65 5 diff --git a/NEWS b/NEWS index 5a66e820a8..a77e57c09e 100644 --- a/NEWS +++ b/NEWS @@ -1,16 +1,57 @@ +pl 65 + - bf pathfind /root/file + - massive Score_elem rewrite: + * group_element_i_ count + * support for removing an individual Score_elem cleanly. + * moved dep stuff into class Directed_graph_node + * Score_elems can be copied and deleted freely. + * junk PStaff + * Spanner_elem_group + * Line_of_{score,staff} now are Score_elems + * clean dep handling upon deletion + * delete unbroken spanners + * added a break_processing round. + * Super_elem + - junk Complex_staff, + - clean {lily}?proto.hh + - Element_group + - Score_elem now as virtual base class everywhere + - naming: Staff_elem -> Score_elem + - bf: make in toplevel dir + - bf: broken tie y-pos + - bf: sharing 4th, 8th and 16th noteheads + - bf: overlapping chords. <\multivoice c d > + +pl 64.wl + - new stem direction code + - bfs: wohltemperirt.ly (thanks, Werner) + - bf: stem direction + +pl 63.jcn2 + - doze compile + +pl 63.jcn1 + - bf: mi2mu mudela commands + - bf: mi2mu tracks + - mi2mu quantify tuning + - mi2mu TODO + +********* +may 16 pl 64 - exe's now built in out/ - toplevel Makefile dep from make/Toplevel.make.in - - make_website: add version fokoter + - make_website: add version footer - make_website: bf dist *.txt - bf: fix loose bars : \meter 4/4; c1. - Staff_elem -> Score_elem - bf - vbrace lookup - - stop if barchecks failed - resync barcheck ******* + +may 15 pl 63 - bf: segfault during MIDI output with mi2mu output. - kludge: parse error beyond eof @@ -23,6 +64,7 @@ pl 63 pl 61.jcn4 - mi2mu -p -s16 fugua2.midi getting better! + plus factor 2 mi2mu speedup (fugue2.midi 5.50user) - bf: Duration_convert quantify threshold down - bf: (on quantify): tcols quantified; no silly voices @@ -39,6 +81,7 @@ pl 61.jcn2 - mi2mu parsing speedup: backup rules for midi-lexer.l - bf: zero denominator ********** +may 14 pl 62 - make clean bf: remove lex & yacc files too - added kludge in case measure too long @@ -57,7 +100,6 @@ pl 60.jcn1 ********** -may 14 pl 61 - scales.ly bugfix: dimensions default to ((0,0), (0,0)) - naming: PointerList->Pointer_list diff --git a/README b/README index 1dc3546a4c..34e2bac6d2 100644 --- a/README +++ b/README @@ -30,12 +30,14 @@ criticism, comments, bugreports, patches, etc. Please send e-mail to the mailing lists - info-gnu-music-request@vuse.vanderbilt.edu - help-gnu-music-request@vuse.vanderbilt.edu - bug-gnu-music-request@vuse.vanderbilt.edu - gnu-music-discuss-request@vuse.vanderbilt.edu, + info-gnu-music@vuse.vanderbilt.edu + help-gnu-music@vuse.vanderbilt.edu + bug-gnu-music@vuse.vanderbilt.edu + gnu-music-discuss@vuse.vanderbilt.edu, + +See the man page on what to use for what. Or you can send it directly +to us: hanwen@stack.nl, jan@digicash.com. -(or directly to us: hanwen@stack.nl, jan@digicash.com) diff --git a/TODO b/TODO index 9bbc6f491a..9e657cd02c 100644 --- a/TODO +++ b/TODO @@ -8,11 +8,16 @@ grep for TODO and ugh/ugr IMPORTANT + * add mi2mu example output (.midi.ly and .gif) to website - * faq about mi2mu midi t1. + * piano staff - * update 20 pt table + * decent spacing + + * implement better breaking algorithm + * update 20 pt table + * use Hungarian throughout code * decent TeX page layout @@ -24,7 +29,6 @@ IMPORTANT * a Hands on tutorial [HKN] PROJECTS - * Output class, handles : (smallish) - help text /(c) notice? - version line @@ -44,6 +48,11 @@ PROJECTS - MusixTeX output possible? (would have to be done before break calc.) - NIFF ? - PostScript output (esp. Beams, Slurs, etc) + - Move PScore, Items, Spanners etc. into libmutype.a + + + * separate Score_elem settings in user-settable (properties + .. ) and non-user-settable part. * TeX spanners , use texbeam.cc as an example (smallish) - Glissando @@ -57,7 +66,8 @@ PROJECTS - general shaving - use plet grouping - abbreviations [c2 c2]1/2 - - separate visual from rhythmic info + - separate visual from rhythmic info even more + - beams over bars * Redo MIDI output to use Registers: (Difficult) - remember more horizontal info than melodics: @@ -66,26 +76,44 @@ PROJECTS - slurs - dynamics etc. + * Redo font support + - use GSharp fonts? - rename mf fonts to avoid conflicts with musixtex - check (c) issues - use own fonts/update musixtex fonts/find older (c)-less fonts - hack up mf sources for decent spacing info (and then read AFM/TFM directly, for text too) + + * lines: + - Ledger lines, should be separate item: Ledger_lines, Ledger_lines_reg + - set different line sizes / thicknesses + - stem down too far right + - beam stem showthrough, inter beam sizes (french vs german style) + + * Collisions + - bring Collision::do_pre_processing to haircutter + - left/right note balls should be handled by Collision: + < \multivoice { \stem 1; } { } > + + * Keys: + - merge key{item} & localkey{item}? + - do conventional keys (C G A, F B E, a e fis, d as des, etc ), + besides lists of flats/sharps, possibly via declaration + - key transposition. + - key undo: \key bes; .. . \key; should print natural + - special key: \key 'b bes bis'; + - spacing, national styles? + PARSER * Duration -> Musical_duration, typedef Rational Duration? ********************** HKN buglist: -\bar || ook dunne streepjes? Sluit de balk niet af! (soms met de -ruimte van een hele maat erachter (bij unmatching staffs) - noten staan vaak te dicht aan de rechterkant van de maatstreep. -optie om nummers/markers boven maatstrepen te zetten - tekst staat erg ver van notenbalken af waarom geen ; achter dingen in \paper? (\textwidth 180\mm) @@ -94,30 +122,15 @@ waarom geen ; achter dingen in \paper? (\textwidth 180\mm) Onduidelijk wanneer wel en geen \ voor een woord. Maak liever verplichte regels -implementeren versieringen door duration *0 ofzo? (geeft nu assertion, -zie duration0.ly) - -Triolen enzo: het zou handig zijn als je het cijfer "3" ook _tussen_ -twee noten kon plaatsen. Dat is bijvoorbeeld nodig in -c4*2/3 c8*2/3 - ----------------\ -\bar "||" \meter 6/8; op het eind van de regel staat door elkaar -gedrukt. **************** BUGS - - * mi2mu nonexist.midi + * spurious Weird stem size warnings * staccato dot positions. * stacked scripts. - * key transposition. - - * help-lines for rests - * lilypond - -> crash * chlapik balk ruimte @@ -130,6 +143,7 @@ SEVERELY LACKING: * grace notes + FURTHER FOR ORCHESTRAL SCORE: * multibar rests @@ -142,14 +156,16 @@ FURTHER FOR ORCHESTRAL SCORE: INPUTLANGUAGE + * should have \require{package.ly} to read req'd packages. + * relative mode for pitch entering + * bracket (bracketplets) + * \duration 8; e*2/3 * configure pitch_byte - * special key. - * figured bass? * rest name configurable @@ -158,9 +174,18 @@ INPUTLANGUAGE * subtime with Subtle_reqs +PROJECTS + + * Do RTTI i.s.o. static_name(), name() and request-junk. + + * add remove() methods to all items/spanners. + SMALLISH PROJECTS - * Help_line, Help_line_reg + * handle do_substitute_dependency in more derived classes. + + * replace member access by get()/set() methods, to enable + future embedded code. * --fast/--draft: leave out constraints @@ -181,10 +206,8 @@ SMALLISH PROJECTS * adaptive accidental spacing. - * score_elem invible_b_ flag + * Score_elem invible_b_ flag - * key undo - * unix style paths for LILYINCLUDE env * indentable stream as baseclass for TeX stream, lily stream, Dstream. @@ -193,8 +216,6 @@ SMALLISH PROJECTS * caching Item/spanner dimensions. - * key transposition - * centered whole rest * caching breakpoints / saving them. @@ -202,12 +223,11 @@ SMALLISH PROJECTS * use dstream feature in mi2mu * qtor, btor, mtor-> tor( QUIET_ver ), tor( DEBUG_ver ), etc. - * use tors feature in lily + - use tors feature in lily (?) - * declare notenametab? + * declare symtab - * do conventional keys (C G A, F B E, a e fis, d as des, etc ), - besides lists of flats/sharps + * declare notenametab? * midi esp.: use I32 iso int where 32 bits are needed (or assumed...) @@ -222,7 +242,7 @@ SMALLISH PROJECTS * Decent TeX titledefs (\tempo, \metron, etc. ) - * C meter iso 4/4 + * C meter iso 4/4, idem for alla breve, etc. * textspanner: center position @@ -243,6 +263,8 @@ SMALLISH PROJECTS DOC + * Score_elem structure. + * all errors * config of TeX macros @@ -257,8 +279,6 @@ FUTURE * Reg_configure_request - * bring Collision::do_pre_processing to haircutter - * slur parts as a script * mixed fontsizes @@ -271,14 +291,10 @@ FUTURE * better beamslope calculation: QLP for beams? - * implement better breaking algorithm - * Text_crescendo * clean solution for staffsize in items. - * merge key{item} & localkey{item}? - * revise calcideal * volta @@ -288,6 +304,7 @@ FUTURE * vertical spanner IDEAS + * derive PCol from Score_elem? * scoping in Lexer: do general id- assignments in mudela. @@ -298,8 +315,8 @@ IDEAS * move MIDI stuff (including Quantization) to a ANSI C libmidi library. * use an embedded language: Python - for : - - Items/Spanners + for: + - Score_elems - Registers - Complex mudela? @@ -308,6 +325,7 @@ IDEAS * merge Atom and Symbol? * merge common code of Item, Atom/Molecule + * Spacing_request for manually adjusting spacing * Staff_group, Score_request_register. @@ -315,6 +333,8 @@ IDEAS * Meters/bars should be aligned, which is difficult if we get different keychanges in different staffs. + * Horizontal_align item for meter,bar etc. + * caching breakpoints * #c <-> cis diff --git a/bin/clearlily b/bin/clearlily index 983454dad3..22a4ea6df3 100755 --- a/bin/clearlily +++ b/bin/clearlily @@ -1,8 +1,10 @@ #!/bin/sh # unclobber current dir. -rm -vf *.aux *.log `grep -li "^% Creator: LilyPond" *.out` *.orig *~ - +rm -vf *.aux *.log `grep -li "^% Creator: GNU LilyPond" *.out` *.orig *~ +rm -vf `grep -li "Creator: mi2mu" *.midi.ly` +rm -vf `grep -li "Creator: GNU LilyPond" *.midi` # docxx mess +rm -vf *dvi rm -vf *.class HIER*.html dxxgifs.tex gifs.db icon?.gif logo.gif down.gif \ aindex.html index.html diff --git a/bin/genheader b/bin/genheader index 1f56088f93..911b038f6d 100755 --- a/bin/genheader +++ b/bin/genheader @@ -24,7 +24,7 @@ sub my $what="implement "; $what = "declare " if ($hh_b); my ($PROJECT, $cwd); - $PROJECT = "the LilyPond music typesetter"; + $PROJECT = "the GNU LilyPond music typesetter"; chop($cwd = `pwd`); $PROJECT= "the Flower Library" if ($cwd =~ /flower/); diff --git a/bin/make_website b/bin/make_website index 9586d88598..ce8c6bb793 100755 --- a/bin/make_website +++ b/bin/make_website @@ -34,13 +34,13 @@ sub set_html_footer my $username=$pw[6]; $footstr = - "\n
- + "\n
Please take me back to the index\n
+ This page was generated by make_website from lilypond-$lily_version by


$username <$MAILADRESS>

" . `date` . " -

\n"; +

"; } @@ -57,26 +57,6 @@ sub my_system } } -sub set_hrefs -{ - while () { - s#href=([A-Za-z.]+)#href=$base/$1#g; - print HTMLOUT $_; - } -} - -sub all_refs -{ - print "resetting refs.\n"; - - foreach $a (<*.html>) - { - rename $a, "$a~"; - open HTMLIN, "$a~"; - open HTMLOUT, ">$a"; - set_hrefs; - } -} local $base="lilypond/"; local @examples=("wohltemperirt" ,"standchen", "scsii-menuetto", "rhythm", "collisions"); @@ -175,9 +155,10 @@ sub edit_html } close H; - - - $file =~ s/$sep/$footstr$sep/g ; + + my $subst = $footstr; + $subst .= $back if (! $a =~ /index.html/ ); + $file =~ s/$sep/$subst$sep/g ; open H, ">$a"; print H $mw_id; diff --git a/configure b/configure index 73ea61d323..9db40e5757 100755 --- a/configure +++ b/configure @@ -1649,6 +1649,8 @@ sed 's/TOPLEVEL_//g' < .version > lily/.version (cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh ) +$MAKE -f make/Toplevel.make.in Makefile + cat << END Finished configuring. For making everything, do: @@ -1663,6 +1665,10 @@ assuming that \`make' is GNU make, of course. If you want to make site-wide extensions to the makefiles, please use make/out/Site.make + +If you can't find a toplevel makefile, please execute + + make -f make/Toplevel.make.in Makefile # GNU make, of course END diff --git a/configure.in b/configure.in index 95a848b476..81a99752dd 100644 --- a/configure.in +++ b/configure.in @@ -255,6 +255,8 @@ sed 's/TOPLEVEL_//g' < .version > lily/.version (cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh ) +$MAKE -f make/Toplevel.make.in Makefile + cat << END Finished configuring. For making everything, do: @@ -269,6 +271,10 @@ assuming that \`make' is GNU make, of course. If you want to make site-wide extensions to the makefiles, please use make/out/Site.make + +If you can't find a toplevel makefile, please execute + + make -f make/Toplevel.make.in Makefile # GNU make, of course END diff --git a/flower/.version b/flower/.version index c07a4a1e4e..1234aa46c7 100644 --- a/flower/.version +++ b/flower/.version @@ -1,6 +1,6 @@ MAJOR_VERSION = 1 MINOR_VERSION = 1 -PATCH_LEVEL = 17 +PATCH_LEVEL = 18 # use to send patches, always empty for released version: MY_PATCH_LEVEL = # include separator: "-1" or ".a" # diff --git a/flower/NEWS b/flower/NEWS index 9c330b8005..23867797db 100644 --- a/flower/NEWS +++ b/flower/NEWS @@ -1,5 +1,11 @@ version 1.1: +pl 18 + - Path::find("/usr/..") fix + - Directed_graph_node + - some Link_array extensions + - Pointer_list::junk() + pl 17 - naming: Pointer->Link, IPointer->Pointer pl 16 diff --git a/flower/directed-graph.cc b/flower/directed-graph.cc new file mode 100644 index 0000000000..c47285c71d --- /dev/null +++ b/flower/directed-graph.cc @@ -0,0 +1,152 @@ +/* + edge_out.cc -- implement Directed_graph_node + + source file FlowerLib + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "directed-graph.hh" + +#ifdef PARANOID // these checks eat huge amounts of time. +#define PARANOID_OK() OK() +#else +#define PARANOID_OK() +#endif + + +Link_array const & +Directed_graph_node::get_in_edge_arr() const +{ + return edge_in_l_arr_; +} + +Link_array const & +Directed_graph_node::get_out_edge_arr()const +{ + return edge_out_l_arr_; +} + +/** + Should not copy deps automatically + */ +Directed_graph_node::Directed_graph_node(Directed_graph_node const&) +{ +} + +void +Directed_graph_node::copy_edges_out(Directed_graph_node const &s) +{ + for(int i=0; i < s.edge_out_l_arr_.size(); i++) + add(s.edge_out_l_arr_[i]); +} + +void +Directed_graph_node::OK() const +{ +#ifndef NDEBUG + for (int i=0; i < edge_out_l_arr_.size(); i++) { + assert(edge_out_l_arr_[i]-> + edge_in_l_arr_.find_l(this)); + } + for (int i=0; i < edge_in_l_arr_.size(); i++) + assert(edge_in_l_arr_[i]->contains_b( this)); +#endif +} + +bool +Directed_graph_node::contains_b(const Directed_graph_node *d)const +{ + return edge_out_l_arr_.find_l((Directed_graph_node*)d); +} + +void +Directed_graph_node::remove_edge_out_idx(int i) +{ + PARANOID_OK(); + Directed_graph_node * d_l = edge_out_l_arr_.get(i); + + int j = d_l->edge_in_l_arr_.find_i(this); + assert(j>=0); + d_l->edge_in_l_arr_.del(j); + PARANOID_OK(); +} + +void +Directed_graph_node::remove_edge_in(Directed_graph_node *d_l) +{ + PARANOID_OK(); + d_l->remove_edge_out(this); + PARANOID_OK(); +} + +void +Directed_graph_node::remove_edge_out (Directed_graph_node *d_l) +{ + PARANOID_OK(); + for (int i=0; i < edge_out_l_arr_.size(); ) { + if (edge_out_l_arr_[i]== d_l) + remove_edge_out_idx(i); + else + i++; + } + PARANOID_OK(); +} +bool +Directed_graph_node::linked_b()const +{ + return edge_out_l_arr_.size() || edge_in_l_arr_.size(); +} + +void +Directed_graph_node::junk_links() +{ + edge_in_l_arr_.set_size(0); + edge_out_l_arr_.set_size(0); +} + + +void +Directed_graph_node::unlink() +{ +#ifdef PARANOID + PARANOID_OK(); + + Link_array t = edge_out_l_arr_; + t.concat(edge_in_l_arr_); +#endif + + while ( edge_out_l_arr_.size() ) + remove_edge_out_idx(0); + + while (edge_in_l_arr_.size() ) + remove_edge_in(edge_in_l_arr_[0]); + +#ifdef PARANOID + for (int i =0; i < t.size(); i++) + t[i]->OK(); +#endif +} + +Directed_graph_node::~Directed_graph_node() +{ + assert(!linked_b()); +} + + +void +Directed_graph_node::add(Directed_graph_node* dep_l) +{ + PARANOID_OK(); + if (!dep_l) + return ; + dep_l->edge_in_l_arr_.push(this); + edge_out_l_arr_.push(dep_l); + PARANOID_OK(); +} + + +Directed_graph_node::Directed_graph_node() +{ +} + diff --git a/flower/include/directed-graph.hh b/flower/include/directed-graph.hh new file mode 100644 index 0000000000..73f8a926e5 --- /dev/null +++ b/flower/include/directed-graph.hh @@ -0,0 +1,51 @@ +/* + edge_out.hh -- declare Directed_graph_node + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef DEPENDENCY_HH +#define DEPENDENCY_HH + +#include "parray.hh" + +/** + Class to handle two-sided connections between nodes (the Dependencies) + */ +class Directed_graph_node { + Link_arrayedge_out_l_arr_; + /// targets + Link_array edge_in_l_arr_; + +public: + + /** remove i-th edge_out (and exactly one ref to me in the edge_out) + */ + void remove_edge_out_idx(int i); + void copy_edges_out(Directed_graph_node const&); + bool linked_b() const; + void unlink(); + void junk_links(); + void add(Directed_graph_node*); + void remove_edge_in(Directed_graph_node *); + void remove_edge_out(Directed_graph_node*); + bool contains_b(Directed_graph_node const*) const; + + Directed_graph_node(Directed_graph_node const &); + void OK()const; + Directed_graph_node(); + + ~Directed_graph_node(); + + /** + ensure that no edge_out exists doubly. + */ + void uniq(); + Link_array const& get_out_edge_arr() const; + Link_array const& get_in_edge_arr() const; +}; + +#endif // DEPENDENCY_HH diff --git a/flower/include/fproto.hh b/flower/include/fproto.hh index d5bf68034b..8b7bb35798 100644 --- a/flower/include/fproto.hh +++ b/flower/include/fproto.hh @@ -37,6 +37,8 @@ typedef Interval_t Interval; struct Choleski_decomposition; struct Long_option_init; +struct File_path; +struct Directed_graph_node; struct Getopt_long; struct Matrix; struct String_data; diff --git a/flower/include/interval.hh b/flower/include/interval.hh index ec39f0d7e2..bf4e4cc0e7 100644 --- a/flower/include/interval.hh +++ b/flower/include/interval.hh @@ -75,7 +75,7 @@ struct Interval_t { Interval_t &operator *=(T r) { left *= r; right *= r; - if (r <0) { + if (r < T(0)) { T t = left; left = right; right = t; diff --git a/flower/include/interval.tcc b/flower/include/interval.tcc index 49be704608..ab2eb95ec3 100644 --- a/flower/include/interval.tcc +++ b/flower/include/interval.tcc @@ -98,7 +98,7 @@ Interval_t::str() const return "[empty]"; String s("["); - return s + left + "," + right +"]"; + return s + String( left ) + String( "," ) + String( right ) + String( "]" ); } template diff --git a/flower/include/matrix-storage.hh b/flower/include/matrix-storage.hh index 8e34d604f4..933cdbbb6e 100644 --- a/flower/include/matrix-storage.hh +++ b/flower/include/matrix-storage.hh @@ -12,7 +12,7 @@ #include "varray.hh" #include "real.hh" -#include "class-name.hh" +#include "virtual-methods.hh" /** diff --git a/flower/include/matrix.hh b/flower/include/matrix.hh index 18ec1e33e9..df013e0849 100644 --- a/flower/include/matrix.hh +++ b/flower/include/matrix.hh @@ -1,7 +1,15 @@ +/* + matrix.hh -- declare Matrix + + source file of the Flower Library + + (c) 1996,1997 Han-Wen Nienhuys +*/ + + #ifndef MATRIX_HH #define MATRIX_HH - #include "matrix-storage.hh" #include "vector.hh" diff --git a/flower/include/parray.hh b/flower/include/parray.hh index e003d46223..1e7404ee55 100644 --- a/flower/include/parray.hh +++ b/flower/include/parray.hh @@ -16,19 +16,47 @@ an array of pointers. TODO - should init to 0. + should init to 0. Derive from Array? */ template -class Link_array : public Array +class Link_array : public Array { + static default_compare(T *const& p1, T *const&p2) { + /* can't do p1 -p2, since T might be an incomplete type */ + if (p1 < p2) + return -1 ; + if (p2 < p1) + return 1; + return 0; + } public: - int find_i (T t) const{ + void substitute(T *old, T*new_l) + { + int i; + while ((i = find_i(old)) >=0) + if (new_l) + elem(i) =new_l; + else + del(i); + } + void default_sort() { + sort(default_compare); + } + void uniq() { + Link_array l_arr; + for (int i=0; i < size(); i++) + if (!i || elem(i-1) != elem(i)) + l_arr.push(elem(i)); + *this = l_arr; + } + + int find_i (T const * t) const { for (int i=0; i < size(); i++) if (elem(i) == t) return i; return -1; } - T find_l(T t)const + T *find_l(T const *t)const { int i = find_i(t); if (i >= 0) diff --git a/flower/include/path.hh b/flower/include/path.hh index 12f0ce4cb6..d41dc2ba1c 100644 --- a/flower/include/path.hh +++ b/flower/include/path.hh @@ -29,9 +29,6 @@ public: /// locate a file in the search path String find(String nm)const; - /// construct using prefix. Normally argv[0]. - File_path(String); - /// add to end of path. Array::push; void add(String str) { push(str); } diff --git a/flower/include/plist.hh b/flower/include/plist.hh index 469a8d444a..4c9d71dba5 100644 --- a/flower/include/plist.hh +++ b/flower/include/plist.hh @@ -33,23 +33,30 @@ class Link_list : public List Link_list() {} }; -/** Link_list which deletes pointers given to it. +/** + + Link_list which deletes pointers given to it. + NOTE: The copy constructor doesn't do what you'd want: Since T might have a virtual ctor, we don't try to do a - new T(*cursor) + new T(**cursor) You have to copy this yourself, or use the macro Link_list__copy + TODO + operator =() */ template class Pointer_list : public Link_list { + public: + void junk(); Pointer_list(Pointer_list const &) { set_empty(); } Pointer_list() { } - ~Pointer_list(); + ~Pointer_list() { junk(); } }; #define Pointer_list__copy(T, to, from, op) \ diff --git a/flower/include/plist.tcc b/flower/include/plist.tcc index 2f75d08adf..ba4a0f20b0 100644 --- a/flower/include/plist.tcc +++ b/flower/include/plist.tcc @@ -6,7 +6,8 @@ template class Pointer_list template -Pointer_list::~Pointer_list() +void +Pointer_list::junk() { PCursor c( *this ); while (c.ok()) { diff --git a/flower/include/class-name.hh b/flower/include/virtual-methods.hh similarity index 88% rename from flower/include/class-name.hh rename to flower/include/virtual-methods.hh index 14ebf4c927..e5c807e8a9 100644 --- a/flower/include/class-name.hh +++ b/flower/include/virtual-methods.hh @@ -21,5 +21,9 @@ int a_stupid_nonexistent_function_to_allow_the_semicolon_come_out() #define IMPLEMENT_STATIC_NAME(c)\ char const *c::static_name() { return #c; } + +#define VIRTUAL_COPY_CONS(T, R)\ + virtual R *clone() const { return new T(*this); } \ + #endif // CLASS-NAME_HH diff --git a/flower/interval.cc b/flower/interval.cc index 1db78d8dbf..12152d6227 100644 --- a/flower/interval.cc +++ b/flower/interval.cc @@ -15,5 +15,5 @@ Interval__instantiate(Real); Real Interval_t::infinity() { - return HUGE; + return HUGE_VAL; } diff --git a/flower/path.cc b/flower/path.cc index 3a2e5dfbc0..bd6a6660d2 100644 --- a/flower/path.cc +++ b/flower/path.cc @@ -49,13 +49,6 @@ split_path(String path, } } -File_path::File_path(String pref) -{ - add("."); - add(pref); -} - - /** find a file. It will search in the current dir, in the construction-arg, and in any other added path, in this order. @@ -64,13 +57,13 @@ String File_path::find(String nm)const { - fdebug << "looking for " << nm ; + fdebug << "looking for " << nm << ": "; if ( !nm.length_i() || ( nm == "-" ) ) return nm; for (int i=0; i < size(); i++) { String path = (*this)[i]; - path+= "/"+nm; + path+= String(path.length_i()? "/":"")+nm; fdebug << path << "? "; FILE *f = fopen(path, "r"); // ugh! diff --git a/flower/string-convert.cc b/flower/string-convert.cc index 4c6069ba51..feb793369f 100644 --- a/flower/string-convert.cc +++ b/flower/string-convert.cc @@ -246,6 +246,7 @@ String_convert::rational_str(Rational r) String String_convert::pointer_str(void const *l) { - I64 i64 = (I64)l; - return String_convert::i64_str(i64, "0x%0Lx"); + char buffer[STRING_BUFFER_LEN]; + snprintf(buffer, STRING_BUFFER_LEN, "%p", l ); // assume radix 10 + return String(buffer); } diff --git a/init/register.ini b/init/register.ini index 154800fdc7..703b092e65 100644 --- a/init/register.ini +++ b/init/register.ini @@ -19,7 +19,7 @@ melodicregs = \inputregister { \inputregister { Note_column_register } \inputregister { Slur_register } \inputregister { Voice_registers - \inputregister { Notehead_register } + \inputregister { Note_head_register } \inputregister { Tie_register } } } diff --git a/init/table_sixteen.ini b/init/table_sixteen.ini index b9670bb8fd..18cc2b5680 100644 --- a/init/table_sixteen.ini +++ b/init/table_sixteen.ini @@ -92,8 +92,8 @@ table_sixteen= } "streepjes" = \table { - "toplines" "\toplines{%}" -3\pt 9\pt 0\pt 0\pt - "botlines" "\botlines{%}" -3\pt 9\pt 0\pt 0\pt + "toplines" "\toplines{%}" -1\pt 7\pt 0\pt 0\pt + "botlines" "\botlines{%}" -1\pt 7\pt 0\pt 0\pt } "bars" = \table { diff --git a/input/collisions.ly b/input/collisions.ly index d37dab705c..14df3bc58f 100644 --- a/input/collisions.ly +++ b/input/collisions.ly @@ -13,41 +13,42 @@ EndMudelaHeader \version "0.0.57"; -two_voice_steminvert = \melodic { - < \multivoice - { \octave c'; \stem 1; - c d e f~ g2 g a } - { \stem -1; - g f e g ~ g2 g2 } - - > -} two_voice = \melodic { < \multivoice - { \octave c'; \stem -1; - c d e f g2~ g a } + { \octave c'; \stem -1;\duration "last"; + c4 d e f g2~ g4 a [c8 d e f] c2| } { \stem 1; - g f e g ~ g2 g2 } + g4 f e g ~ g2 g2 c4 g4 g2 } > } +two_voice_steminvert = \melodic { + < \multivoice + { \octave c'; \stem 1; +% the f and g on 4th beat are exceptionally ugh. + c4 d e f g2 g4 a | } + { \stem -1; + g4 f e g g2 g2 } + + > +} three_voice = \melodic { < \multivoice { \stem 1; - g f e f g a g2 } + g4 f e f g a g2 } { \hshift 1; \stem 1; e2 e2 e2 e2 } { \stem -1; - c d e d c d es } + c4 d e d c d es } > } rests = \melodic { < \multivoice - { \stem 1;\duration "last"; - r8 r r r r r r r + { \stem 1; + | r8 r r r r r r r [c' b a g] [f e d c] } { \stem -1; diff --git a/input/keys.ly b/input/keys.ly index c215a574af..f46fc86f3a 100644 --- a/input/keys.ly +++ b/input/keys.ly @@ -7,20 +7,27 @@ entered-by: copyright: - Tested Features: local key, key + Tested Features: local key, key, forced accidentals EndMudelaHeader %} \version "0.0.57"; blah = \melodic{ - \duration 4; + \duration "last"; \meter 4/4; \octave c'; - cis c cis cis | + \key bes es as; + [cis8 d e f] [e! a b cis'] | + es e f e a a' a a' | + \clef "bass"; \octave c; [es16 c' b a] [g f es d] [c d es d] [c Bes As G] | + +\clef "violin"; + \key ; + cis4 c cis cis | cis dis2 ~ | \meter 2/4 ; - dis dis ~ | c cis~ | c + dis4 dis ~ | c cis~ | c } \score{ diff --git a/input/rhythm.ly b/input/rhythm.ly index fe236e4dca..042d9cddc0 100644 --- a/input/rhythm.ly +++ b/input/rhythm.ly @@ -24,6 +24,7 @@ ritme = \staff { melodicregs \melodic{ %\octave ; \partial 8; + \octave c'; \meter 4/4; c8 | diff --git a/input/wohltemperirt.ly b/input/wohltemperirt.ly index 291ef663b4..6b15eaae4c 100644 --- a/input/wohltemperirt.ly +++ b/input/wohltemperirt.ly @@ -1,160 +1,207 @@ %{ title: Das Wohltemperirte Clavier I, Fuga II (c-minor) - description: + description: following Henle's Urtext composer(s): JS Bach entered-by: HWN - copyright:Public Domain + corrected-by: Werner Lemberg (tested with pl 64; 1997-05-17) + copyright: Public Domain + + Tested Features: stem direction, multivoice, forced accidentals. + + Remarks: the stem direction algorithm is severely broken (look at the + bass dux) with pl64. + - Tested Features:stem direction, multivoice. %} \version "0.0.57"; -global = \melodic{ - \meter 4/4 ; - \key bes es as; -} + % should add \need{dutch.ini} for + % correct parsing of note names + +global = + \melodic { + \meter 4/4; % should be \meter C + \key bes es as; + } -dux = \melodic { - \clef "violin"; - \octave c' ; - \duration \last ; - - \stem -1; - r8 - [c'16 b] [c'8 g] [as c'16 b] [c'8 d'] | - [g c'16 b] [c'8 d'] [f16 g] as4 [g16 f] | - [es c' b a] [ g f es d] [c8 es' d' c'] | - [bes a bes c'] [fis g a fis] | - g4 r16 [c d es] [f g as8~] [as16 d es f ]| - [g a bes8(] [)bes16 es f g ] [as g f es] [d8 c'16 b]| - c'4 r4 r8 [f' es' d'] - r8 [as g f] [g f16 es] [f8 d] | - g4 r8 b [c' c'16 b] [c'8 g] | -%% 10 - as4 r8 a [bes bes16 a] [bes8 f] | - g4 r8 g [as as g f] | % should jump staff - \octave c; - r8 [as bes c'] r8 [as16 g] [as8 f8] | - [bes8 c bes as ] [bes g f es] | - [f des' c' bes ] [c' as g f] | - [g8 %jump! - \octave c'; - g16 fis] [g8 c] [es g16 fis] [g8 a] | - [d g16 fis] [g8 a] [c16 d] es4 [d16 c] | - 'bes8 r8 r16 [d e fis ] [g a bes8( ] [)bes16 e f g] | - [a bes c'8(] [)c'16 fis16 g a ] [bes8 es16 d] [es8 'g] | - ['as f16 e] [f8 'a8] ['bes g16 f] [g8 'b] | -% 20 - [c16 f es d] [c Bes As G] [F8 as g f] | - [es d es f] [B c d B] | - c4 r8 e8 [f f16 e] [f8 c] | - d4 r8 d8 [es8 es16 d] [es8 Bes] | - c2 ~ [c8 d16 es][ f es f d] | - B8 r8 r B c r r es | - d r r f~ f r r f | - [es as g f] [es d es f] | - [B c d B] [B c] r c | - [f16 d es c]~ [c8 B] c4 r8 e | - f4 r8 [f es16 d] [es8 | +dux = + \melodic { + \clef "violin"; + \octave c'; + \duration \last; + \stem -1; + r8 [c'16 b] [c'8 g] [as c'16 b] [c'8 d'] | + [g c'16 b] [c'8 d'] [f16 g] as4 [g16 f] | + [es c' b a] [g f! es d] [c8 es' d' c'] | + [bes a bes c'] [fis g a fis] | +%% 5 + g4 r16 [c d es] [f g as8~] [as16 d es f]| + [g a bes8~] [bes16 es f g] [as g f es] [d8 c'16 b]| + c'4 r4 r8 [f' es' d'] + r8 [as g f] [g f16 es] [f8 d] | + g4 r8 b [c' c'16 b] [c'8 g] | +%% 10 + as4 r8 a [bes bes16 a] [bes8 f] | + g4 r8 g [as as g f] | + \octave c; r8 [as bes c'] r8 [as16 g] [as8 f8] | + [bes8 c' bes as] [bes g f es] | + [f des' c' bes] [c' as g f] | +%% 15 + g8 \octave c'; [g16 fis] [g8 c] [es g16 fis] [g8 a] | +% [d g16 fis] [g8 a] [c16 d] es4 [d16 c] | + [d g16 fis] [g8 a] [c16 d] es4 [d16 c] | + % wouldn't it be better if I can write + % `a' instead of `a!' here to get really + % an `a natural'? Processing this melody + % alone (only having `a') would yield a + % different result! (WL) +%% I don't understand the complaint. The ! makes no difference in output. HWN + + 'bes8 r8 r16 [d e fis] [g a bes8~] [bes16 e f g] | + [a bes c'8~] [c'16 fis16 g a] [bes8 es!16 d] [es8 'g] | + ['as f16 es] [f8 'a8] ['bes g16 f] [g8 'b] | +%% 20 + [c16 f es d] [c Bes! As G] [F8 as g f] | + [es d es f] [B c d B] | + c4 r8 e8 [f f16 e] [f8 c] | + d4 r8 d8 [es8 es16 d] [es8 Bes] | + c2 ~ [c8 d16 es][ f es f d] | +%% 25 + B8 r8 r B c r r es | + d r r f~ f r r f | + [es as g f] [es d es f] | + [B c d B] [B c] r c | + [f16 d es c]~ [c8 B] c4 r8 e | +%% 30 + f4 r8 f [f es16 d] [es8 | +% f4 r8 [f es16 d] [es8 | + % bug! if you say + % f4 r8 ... + % the chord overlaps. WL +%% confirmed. added to TODO. HWN r r | -} + } + -comes = \melodic { - \octave c'' ; - \stem 1; - r1 | - r1 | - r8 [g16 fis] [g8 c] [es g16 f] [g8 a]| - [d8 g16 fis] [g8 a] [c16 d] es4 [d16 c] | - ['bes8 es16 d] [es8 'g8] ['as f16 es] [f8 'a] - ['bes8 g16 f] [g8 'b] [c8 d16 es] f4( | - [) f8 es16 d] [c16 'bes 'as 'g] ['f8 as g f] - [es d es f] ['b c d 'b] | - [c g16 fis] [g8 d] es4 r8 e8 | +comes = + \melodic { + \octave c''; + \stem 1; + r1 | + r1 | + r8 [g16 fis] [g8 c] [es g16 fis] [g8 a] | + [d8 g16 fis] [g8 a] [c16 d] es4 [d16 c] | +%% 5 + ['bes8 es16 d] [es8 'g8] ['as f16 es] [f8 'a] + ['bes8 g16 f] [g8 'b] [c8 d16 es] f4~ | + [f8 es16 d] [c16 'bes 'as 'g] ['f8 as g f] + [es d es f] ['b c d 'b] | + [c g16 fis] [g8 d] es4 r8 e8 | %% 10 - [f f16 e] [f8 c8] d4 r8 d | - [es8 es16 d] [es8 'bes] [c es16 d] [es8 f] | - ['bes es16 d] [es8 f] ['as16 'bes] c4 ['bes16 'as] | - [G16 Es F G] [As Bes c d] [es d c d] [es f g a] | - [bes F G As] [Bes c d e] [f es d es] [ f g a b] | - [c'8 b16 a] [g f e d] [c8 es d c] | - [Bes A Bes c] [Fis G A Fis] | - [G8 d16 c] d8 r8 r8 [e16 d] e8 r8 | - r [fis16 e] fis8 r r [G16 F] G8 r8 | - r8 [A16 G] A8 r r [B16 A] B8 r | + [f f16 e] [f8 c8] d4 r8 d | + [es8 es16 d] [es8 'bes] [c es16 d] [es8 f] | + ['bes es16 d] [es8 f] ['as16 'bes] c4 ['bes16 'as] | + [G16 Es F G] [As Bes c d] [es d c d] [es f g a] | + [bes F G As] [Bes c d e] [f es d es] [ f g a b] | +%% 15 + [c'8 b16 a] [g f es d] [c8 es d c] | + [Bes A Bes c] [Fis! G A Fis] | + % see comment above about forced acc. + [G8 d16 c] d8 r8 r8 [e16 d] e8 r8 | + r [fis16 e] fis8 r r [G16 F] G8 r8 | + r8 [A16 G] A8 r r [B16 A] B8 r | %% 20 - r8 [c16 'b] [c8 'g] [As c16 'c] [c8 d] | - [G c16 B] [c8 d] [F16 G] As4 [G16 F] | - [Es8 c16 B] [c8 G] As4 r8 A | - [Bes8 Bes16 A] [Bes8 F8] g4 r8 G(| - )[G As16 Bes] [c B c As] F2( | - )[F8 d16 c] [d8 F] [Es es16 d] [es8 G] | - [F f16 es] [f8 As] [G16 f es d] [c B A G] | - [c8 f es d] r [As G f] | - [G F16 Es] [F8 D] [As G] r A | - [B c] [F16 Es D C] [C8 c16 B] [c8 G]| - [As c16 B] [c8 d] [G8 c16 B] [c8 d] | - [F16 G] As4 [G16 F] E2 | - -} + r8 [c16 'b] [c8 'g] [As c16 'b] [c8 d] | + [G c16 B] [c8 d] [F16 G] As4 [G16 F] | + [Es8 c16 B] [c8 G] As4 r8 A | + [Bes8 Bes16 A] [Bes8 F8] 'g4 r8 G~ | + [G As16 Bes] [c B c As] F2~ | +%% 25 + [F8 d16 c] [d8 F] [Es es16 d] [es8 G] | + [F f16 es] [f8 As] [G16 f es d] [c B A G] | + [c8 f es d] r [As G F] | + [G F16 Es] [F8 D] [As G] r A | + [B c] [F16 Es D C] C8 [c16 B] [c8 G] | +%% 30 + [As c16 B] [c8 [G8 c16 B] [c8 d] | + [F16 G] As4 [G16 F] E2 | + } + +bassdux = + \melodic { + \clef "bass"; + + \octave c'; + r1 | + r | + r | + r | +%% 5 + r | + r1 | + r8 [c16 B] [c8 G] [As c16 B] [c8 d] | + [G c16 B] [c8 d] [F16 G] As4 [G16 F] | + \octave c; [es c' b a] [g f es d] [c d es d] [c Bes! As! G] | + % I think we shouldn't need to force + % accidents here because they are in + % another octave range. WL + +%% I don't understand the complaint. Accidentals are valid for one octave range +%% only. Without ! (and printed flat), this still is valid. HWN -bassdux = \melodic { - \clef "bass"; - \octave c' ; - r1 | - r | - r | - r | - r | - r1 | - r8 [c16 B] [c8 G] [As c16 B] [c8 d] | - [G c16 B] [c8 d] [F16 G] As4 [G16 F] | - \octave c; - [es c' b a] [g f es d] [c d es d] [c Bes As G] | %% 10 - [F bes as g ] [f es d c] [Bes c d c ] [Bes As G F]| - [Es as g f] [es des c Bes] [As8 c' bes as] | - [g8 f g as] [d es f d] | - [es as g f] [g es d c] | - [d bes as g] [as f es d] | - es8 r8 r4 r8 [c Bes A] | - r [es d c] [d c16 Bes] [c8 d] | - [G8 bes16 a] [bes8 d] [es c'16 bes] [c'8 e] | - [f d'16 c'] [d'8 fis] g4 r16 [G A B] | - [c16 d es8]~ [es16 A Bes c] [d es f8]~ [f16 'b c d]| -%%20 - es8 r r e [f F Es D] | - r [As G F] [G F16 Es] [F8 G] | - [c16 d es d] [c Bes As G] [F bes as g] [f es d c] | - [Bes c d c] [Bes As G F] [Es As g f ] [es d c Bes] | - [As Bes c Bes] [As G F Es] [D g f es ] [d c B A] | - g4 r4 r16 [G A B] [c d es f] | - [g f as g] [f es d c] [B8 c16 B] [c8 G] | - [As c16 B] [c8 d] [G c16 B] [c8 d] | - [F16 G] As4 [G16 F] Es4 r8 es | - [d c g G] - < \multivoice - { \stem 1; c2 ~ |c1~ | c1 } - { \stem -1; C2~ |C1~ | C1 } - > + [F bes as g] [f es d c] [Bes c d c] [Bes As G F] | + [Es as g f] [es des c Bes] [As8 c' bes as] | + [g8 f g as] [d es f d] | + [es as g f] [g es d c] | + [d bes as g] [as f es d!] | +%% 15 + es8 r8 r4 r8 [c Bes A] | + r [es d c] [d c16 Bes] [c8 d] | + [G8 bes16 a] [bes8 d] [es c'16 bes] [c'8 e] | + [f d'16 c'] [d'8 fis] g4 r16 [G A B] | + [c16 d es8~] [es16 A Bes c] [d es f8~] [f16 'b c d] | +%% 20 + es8 r r e [f F Es! D] | % see comment above about octave range + r [As G F] [G F16 Es] [F8 G] | + [c16 d es d] [c Bes As G] [F bes as g] [f es d c] | + [Bes c d c] [Bes As G F] [Es as g f] [es d c Bes] | + [As Bes c Bes] [As G F Es] [D g f es] [d c B A] | +%% 25 + g4 r4 r16 [G A B] [c d es f] | + [g f as g] [f es d c] [B8 c16 B] [c8 G] | + [As c16 B] [c8 d] [G c16 B] [c8 d] | + [F16 G] As4 [G16 F] Es4 r8 es | + [d c g G] +%% 30 + < \multivoice + { \stem 1; c2~ | c1~ | c1 } + { \stem -1; C2~ | C1~ | C1 } + > + } -} % every "melody" declared in a staff has its own "voicegroup" -trebstaf = \staff{ - \inputregister{ melodicregs} - global dux comes -} - -\score{ - trebstaf - \staff{ \inputregister{ melodicregs} - bassdux global - } - \paper{} - \midi{ - \tempo 4:84 - } +trebstaf = + \staff { + \inputregister{melodicregs} + global dux comes + } + + +\score { + trebstaf + \staff { + \inputregister{melodicregs} + global bassdux + } + \paper{} + \midi { + \tempo 4:84 + } } +% EOF + + diff --git a/lib/duration-convert.cc b/lib/duration-convert.cc index 1b738507af..4a46bf9e64 100644 --- a/lib/duration-convert.cc +++ b/lib/duration-convert.cc @@ -121,18 +121,23 @@ Duration_convert::mom2standardised_dur( Moment mom ) for ( int i = 0; i < dur_array_s.size() - 1; i++ ) { Moment lower_mom = dur2_mom( dur_array_s[ i ] ); if ( mom <= lower_mom ) { - // all arbitrary, but 1/4 will get rid of the noise... -// if ( i || ( mom / lower_mom > Moment( 3, 4 ) ) ) -//kinda ok if ( i || ( mom / lower_mom > Moment( 2, 4 ) ) ) - if ( i || ( mom / lower_mom > Moment( 2, 6 ) ) ) + // all arbitrary, but 3/4 will get rid of the noise... + // kinda ok + if ( i || ( mom / lower_mom > Moment( 3, 4 ) ) ) return dur_array_s[ i ]; else return Duration( 0 ); } Moment upper_mom = dur2_mom( dur_array_s[ i + 1 ] ); +#if 0 // % deviation of upper/lower from mom, perhaps it's better to use if ( ( mom < upper_mom ) && ( ( mom - lower_mom ) / mom < ( upper_mom - mom ) / mom ) ) +#else // % deviation of mom from lower/upper? + if ( ( mom < upper_mom ) + && ( ( mom - lower_mom ) / lower_mom + < ( upper_mom - mom ) / upper_mom ) ) +#endif return dur_array_s[ i ]; } // return dur_array_s[ dur_array_s.length_i() ]; diff --git a/lib/include/proto.hh b/lib/include/proto.hh index ab93a5472f..17a7b341a8 100644 --- a/lib/include/proto.hh +++ b/lib/include/proto.hh @@ -10,164 +10,8 @@ #include "fproto.hh" #include "real.hh" - -struct Absolute_dynamic_req; -struct Accidental; -struct Atom; -struct Bar; -struct Bar_register; -struct Barcheck_req; -struct Bar_req; -struct Beam; -struct Beam_req; -struct Blank_req; -struct Box; -struct Bracket_req; -struct Cadenza_req; -struct Chord; -struct Clef_change_req; -struct Clef_register; -struct Clef_item; -struct Col_hpositions; -struct Colinfo; -struct Complex_music; -struct Complex_staff; -struct Complex_walker; -struct Crescendo ; -struct Cresc_req; -struct Directional_spanner; -struct Decresc_req; struct Duration; struct Duration_iterator; -struct Durational_req; -struct Dynamic; -struct Dynamic_req; -struct Group_change_req; -struct Group_feature_req; -struct Idealspacing; -struct Identifier; -struct Input; -struct Input_register; -struct Input_file; -struct Input_music; -struct Input_score; -struct Input_staff; -struct Item; -struct Key; -struct Key_register; -struct Key_change_req; -struct Key_item; -struct Keyword; -struct Keyword_table; -struct Lily_stream; -struct Line_of_score; -struct Line_of_staff; -struct Linestaff; -struct Local_key; -struct Local_key_register; -struct Local_key_item; -struct Lookup; -struct Lyric_item; -struct Lyric_req; -struct Melodic_req; -struct Measure_grouping_req; -struct Meter_change_req; -struct Meter; -struct Meter_register; -struct Midi_def; -struct Midi_duration; -struct Midi_event; -struct Midi_header; -struct Midi_item; -struct Midi_key; -struct Midi_note; -struct Midi_output; -struct Midi_pitch; -struct Midi_staff; -struct Midi_stream; -struct Midi_tempo; -struct Midi_time; -struct Midi_track; -struct Midi_voice; -struct Midi_walker; -struct Mixed_qp; -struct My_midi_lexer; -struct My_midi_parser; -struct Midi_event; -struct Midi_score; -struct Midi_track; -struct Molecule; -struct Musical_req; -struct Music_general_chord; -struct Music_voice; -struct Command_req; -struct Note_req; -struct Notehead; -struct Notehead_register; -struct Offset; -struct Output; -struct PCol; -struct Plet_req; -struct Plet; -struct PScore; -struct PStaff; -struct Paper_def; -struct Partial_measure_req; -struct Rational; -struct Register_group_register; -struct Request; -struct Request_register; -struct Rest; -struct Rest_req; -struct Rhythmic_grouping; -struct Rhythmic_grouping_req; -struct Rhythmic_req; -struct Score; -struct Score_column; -struct Score_walker; -struct Script_def; -struct Script; -struct Script_register; -struct Script_req; -struct Simple_music; -struct Skip_req; -struct Slur; -struct Slur_register; -struct Slur_req; -struct Sources; struct Source_file; -struct Spacing_req ; -struct Span_req; -struct Span_dynamic_req; -struct Spanner; -struct Subtle_req; -struct Staff; -struct Staff_column; -struct Staff_symbol; -struct Staff_walker; -struct Stem; -struct Stem_req; -struct Stem_beam_register; -struct String; -struct Symbol; -struct Symtable; -struct Symtables; -struct Tex_stream; -struct Terminate_voice_req; -struct Text_item ; -struct Text_def; -struct Text_gob; -struct Text_register; -struct Text_req; -struct Timing_req; -struct Time_description; -struct Track_column; -struct Voice; -struct Voice_element; -struct Voice_group_registers; -struct Voice_list; -struct Voice_registers; -struct Voicegroup; -struct Walker_registers; -typedef Rational Moment; +struct Sources; #endif // PROTO_HH diff --git a/lib/include/source.hh b/lib/include/source.hh index 99e15e56f5..bc4a859c0a 100644 --- a/lib/include/source.hh +++ b/lib/include/source.hh @@ -5,21 +5,19 @@ #ifndef SOURCE_HH #define SOURCE_HH -#include "source-file.hh" #include "plist.hh" -#include "path.hh" class Sources { public: Source_file * get_file_l( String &filename ); - Source_file* sourcefile_l( char const* ch_c_l ); + Source_file* sourcefile_l( char const* ch_C ); void set_path(File_path*p_C); Sources(); void set_binary(bool); private: const File_path * path_C_; void add( Source_file* sourcefile_p ); - Pointer_list sourcefile_p_iplist_; + Pointer_list sourcefile_p_list_; bool binary_b_ ; }; diff --git a/lib/source.cc b/lib/source.cc index 8901c8f793..6be3ca42fc 100644 --- a/lib/source.cc +++ b/lib/source.cc @@ -1,5 +1,5 @@ /* - source.cc -- implement Source + source.cc -- implement Sources source file of the LilyPond music typesetter @@ -15,6 +15,7 @@ #include "plist.hh" #include "source-file.hh" #include "source.hh" +#include "path.hh" void Sources::set_path(File_path *f_C) @@ -54,7 +55,7 @@ Sources::Sources() void Sources::add( Source_file* sourcefile_p ) { - sourcefile_p_iplist_.bottom().add( sourcefile_p ); + sourcefile_p_list_.bottom().add( sourcefile_p ); } /** @@ -65,7 +66,7 @@ Sources::add( Source_file* sourcefile_p ) Source_file* Sources::sourcefile_l( char const* ch_C ) { - PCursor sourcefile_l_pcur( sourcefile_p_iplist_.top() ); + PCursor sourcefile_l_pcur( sourcefile_p_list_.top() ); for ( ; sourcefile_l_pcur.ok(); sourcefile_l_pcur++ ) if ( sourcefile_l_pcur->in_b( ch_C ) ) return *sourcefile_l_pcur; diff --git a/lily/.version b/lily/.version index a01151100b..b7c968121e 100644 --- a/lily/.version +++ b/lily/.version @@ -1,6 +1,6 @@ MAJOR_VERSION = 0 MINOR_VERSION = 0 -PATCH_LEVEL = 64 +PATCH_LEVEL = 65 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf diff --git a/lily/Makefile b/lily/Makefile index 08088271ff..23145c0b40 100644 --- a/lily/Makefile +++ b/lily/Makefile @@ -16,7 +16,6 @@ depth = .. # include Stable.make include ./$(depth)/make/Variables.make -include ./$(depth)/make/Files.make include .version # @@ -48,6 +47,7 @@ MODULE_LIBES= -llily -lflower # default: $(EXECUTABLE) # +include ./$(depth)/make/Files.make # generic targets and rules: # @@ -61,16 +61,6 @@ $(outdir)/lexer.cc: $(outdir)/parser.hh # -# list of depend files: -# -DEPFILES = $(wildcard $(depdir)/*.dep) -# - -# auto dependencies: -# --include /dev/null $(DEPFILES) -# - localclean: rm -f $(outdir)/parser.* $(outdir)/lexer.cc diff --git a/lily/Stable.make b/lily/Stable.make index e7eee4cd6b..f32586508f 100644 --- a/lily/Stable.make +++ b/lily/Stable.make @@ -4,8 +4,8 @@ stablecc=command-request.cc musical-request.cc bar.cc boxes.cc \ item.cc keyword.cc leastsquares.cc \ lookup.cc molecule.cc meter.cc\ - paper-def.cc parser.cc lexer.cc p-staff.cc qlp.cc qlpsolve.cc\ + paper-def.cc parser.cc lexer.cc qlp.cc qlpsolve.cc\ template1.cc template2.cc template3.cc template4.cc\ template5.cc template6.cc version.cc tex-stream.cc tex.cc\ - voice.cc spanner.cc \ + voice.cc \ voice-element.cc identifier.cc note.cc\ diff --git a/lily/bar-reg.cc b/lily/bar-reg.cc index 4dd6199ce1..c66a33bdb4 100644 --- a/lily/bar-reg.cc +++ b/lily/bar-reg.cc @@ -1,7 +1,7 @@ /* bar-reg.cc -- implement Bar_register - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -9,7 +9,6 @@ #include "bar-reg.hh" #include "bar.hh" #include "command-request.hh" -//#include "score-column.hh" #include "time-description.hh" Bar_register::Bar_register() diff --git a/lily/bar.cc b/lily/bar.cc index 96071ad385..8a6891b330 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -1,7 +1,7 @@ /* bar.cc -- implement Bar - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/beam.cc b/lily/beam.cc index 7052fae9fb..e838f90ea0 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -1,14 +1,14 @@ /* beam.cc -- implement Beam - source file of the LilyPond music typesetter + source file of the GNU GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys TODO Less hairy code. Better slope calculations. - knee ([\stem 1; c8 \stem -1; c8] + knee: ([\stem 1; c8 \stem -1; c8] */ @@ -50,15 +50,21 @@ Stem_info::Stem_info(Stem const *s) assert(miny <= idealy); } + /* *************** */ +void +Beam::do_break_at(PCol*l, PCol*r) +{ + assert (l->line_l_ == r->line_l_); +} + + Offset Beam::center()const { - assert(status >= POSTCALCED); - Real w=(paper()->note_width() + width().length())/2.0; - return Offset(w, (left_pos + w* slope)*paper()->internote()); + return Offset(w, (left_pos + w* slope)*paper()->internote_f()); } @@ -71,7 +77,7 @@ Beam::Beam() void Beam::add(Stem*s) { - stems.bottom().add(s); + stems.push(s); s->add_dependency(this); s->print_flag_b_ = false; } @@ -79,16 +85,21 @@ Beam::add(Stem*s) void Beam::set_default_dir() { - int dirs[2]; - dirs[0]=0; dirs[1] =0; - for (iter_top(stems,i); i.ok(); i++) { - int d = i->get_default_dir(); - dirs[(d+1)/2] ++; - } - dir_i_ = (dirs[0] > dirs[1]) ? -1 : 1; - for (iter_top(stems,i); i.ok(); i++) { - i->dir_i_ = dir_i_; + int dirs_single = 0, dirs_chord = 0; + for (int i=0; i chord_b()) + dirs_chord += sl->get_default_dir(); + else + dirs_single += sl->get_center_distance(); } + dirs_single = -sign(dirs_single); + dir_i_ = (dirs_single + dirs_chord > 0) ? 1 : -1; + + for (int i=0; i dir_i_ = dir_i_; + } } /* @@ -98,7 +109,9 @@ void Beam::solve_slope() { Array sinfo; - for (iter_top(stems,i); i.ok(); i++) { + for (int j=0; j set_default_extents(); if (i->invisible_b()) continue; @@ -127,17 +140,18 @@ Beam::solve_slope() slope *= dir_i_; // ugh - Real sl = slope*paper()->internote(); + Real sl = slope*paper()->internote_f(); paper()->lookup_l()->beam(sl, 20 PT); - slope = sl /paper()->internote(); + slope = sl /paper()->internote_f(); } void Beam::set_stemlens() { - iter_top(stems,s); - Real x0 = s->hpos_f(); - for (; s.ok() ; s++) { + Real x0 = stems[0]->hpos_f(); + for (int j=0; j hpos_f()-x0; s->set_stemend(left_pos + slope * x); } @@ -162,9 +176,10 @@ Beam::set_grouping(Rhythmic_grouping def, Rhythmic_grouping cur) Array b; { - iter_top(stems,s); Array flags; - for (; s.ok(); s++) { + for (int j=0; j flag_i_))-2; assert(f>0); flags.push(f); @@ -176,28 +191,18 @@ Beam::set_grouping(Rhythmic_grouping def, Rhythmic_grouping cur) assert(stems.size() == b.size()/2); } - iter_top(stems,s); - for (int i=0; i < b.size() && s.ok(); i+=2, s++) { + for (int j=0, i=0; i < b.size() && j beams_left_i_ = b[i]; s->beams_right_i_ = b[i+1]; } } - -// todo. -Spanner * -Beam::do_break_at( PCol *, PCol *) const -{ - Beam *beam_p= new Beam(*this); - - return beam_p; -} - void Beam::do_pre_processing() { - left_col_l_ = (*stems.top()) ->pcol_l_; - right_col_l_ = (*stems.bottom())->pcol_l_; + left_col_l_ = stems[0] ->pcol_l_; + right_col_l_ = stems.top()->pcol_l_; assert(stems.size()>1); if (!dir_i_) set_default_dir(); @@ -208,9 +213,8 @@ Beam::do_pre_processing() Interval Beam::do_width() const { - Beam * me = (Beam*) this; // ugh - return Interval( (*me->stems.top()) ->hpos_f(), - (*me->stems.bottom()) ->hpos_f() ); + return Interval( stems[0]->hpos_f(), + stems.top()->hpos_f() ); } /* @@ -221,9 +225,9 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const { assert( !next || next->hpos_f() > here->hpos_f() ); assert( !prev || prev->hpos_f() < here->hpos_f() ); - Real dy=paper()->internote()*2; + Real dy=paper()->internote_f()*2; Real stemdx = paper()->rule_thickness(); - Real sl = slope*paper()->internote(); + Real sl = slope*paper()->internote_f(); paper()->lookup_l()->beam(sl, 20 PT); Molecule leftbeams; @@ -280,15 +284,13 @@ Molecule* Beam::brew_molecule_p() const { Molecule *out=0; - Real inter=paper()->internote(); + Real inter=paper()->internote_f(); out = new Molecule; - Real x0 = stems.top()->hpos_f(); - - for (iter_top(stems,i); i.ok(); i++) { - PCursor p(i-1); - PCursor n(i+1); - Stem * prev = p.ok() ? p.ptr() : 0; - Stem * next = n.ok() ? n.ptr() : 0; + Real x0 = stems[0]->hpos_f(); + for (int j=0; j 0)? stems[j-1] : 0; + Stem * next = (j < stems.size()-1) ? stems[j+1] :0; Molecule sb = stem_beams(i, next, prev); Real x = i->hpos_f()-x0; @@ -310,7 +312,11 @@ Beam::do_print()const #endif } -Beam::~Beam() +void +Beam::do_substitute_dependency(Score_elem*o,Score_elem*n) { - + int i; + while ((i=stems.find_i((Stem*)o->item())) >=0) + if (n) stems[i] = (Stem*) n->item(); + else stems.del(i); } diff --git a/lily/bow.cc b/lily/bow.cc index 5e463408e1..2de418ebdf 100644 --- a/lily/bow.cc +++ b/lily/bow.cc @@ -1,7 +1,7 @@ /* bow.cc -- implement Bow - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -24,9 +24,10 @@ Bow::center() const Real w = width().length(); - return Offset(w/2,dy * paper()->internote()); + return Offset(w/2,dy * paper()->internote_f()); } + Molecule* Bow::brew_molecule_p() const { @@ -36,7 +37,7 @@ Bow::brew_molecule_p() const int dy = right_pos_i_ - left_pos_i_; Real nw_f = paper()->note_width(); - Real nh_f = paper()->internote(); + Real nh_f = paper()->internote_f(); w+= (right_dx_f_ - left_dx_f_) * nw_f ; diff --git a/lily/break.cc b/lily/break.cc index 8a9a426657..1513046a91 100644 --- a/lily/break.cc +++ b/lily/break.cc @@ -1,7 +1,7 @@ /* break.cc -- implement Break_algorithm - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1996, 1997 Han-Wen Nienhuys */ @@ -13,7 +13,7 @@ #include "debug.hh" #include "scoreline.hh" #include "p-score.hh" - +#include "p-col.hh" /// return all breakable columns Line_of_cols diff --git a/lily/calcideal.cc b/lily/calcideal.cc index af654d15bd..11c1aa2d2c 100644 --- a/lily/calcideal.cc +++ b/lily/calcideal.cc @@ -1,7 +1,7 @@ /* calcideal.cc -- implement Score::calc_idealspacing() - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/clef-item.cc b/lily/clef-item.cc index 48e63b7f3b..055b282b2e 100644 --- a/lily/clef-item.cc +++ b/lily/clef-item.cc @@ -1,7 +1,7 @@ /* clef-item.cc -- implement Clef_item - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -48,7 +48,7 @@ Clef_item::brew_molecule_p()const t += "_change"; Symbol s = paper()->lookup_l()->clef(t); Molecule*output = new Molecule(Atom(s)); - output->translate(Offset(0, paper()->internote() * y_off)); + output->translate(Offset(0, paper()->internote_f() * y_off)); return output; } diff --git a/lily/clef-reg.cc b/lily/clef-reg.cc index 63e4a505fc..9f1d5fa9c7 100644 --- a/lily/clef-reg.cc +++ b/lily/clef-reg.cc @@ -1,7 +1,7 @@ /* clef.cc -- implement Clef_register - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys , Mats Bengtsson diff --git a/lily/collision-reg.cc b/lily/collision-reg.cc index 6b9da77062..73582d5d90 100644 --- a/lily/collision-reg.cc +++ b/lily/collision-reg.cc @@ -1,7 +1,7 @@ /* collision-reg.cc -- implement Collision_register - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/collision.cc b/lily/collision.cc index 7e1f0988d7..8f43ee4233 100644 --- a/lily/collision.cc +++ b/lily/collision.cc @@ -1,14 +1,14 @@ /* collision.cc -- implement Collision - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ #include "debug.hh" #include "collision.hh" #include "note-column.hh" -#include "notehead.hh" +#include "note-head.hh" #include "paper-def.hh" Collision::Collision() @@ -21,7 +21,9 @@ Collision::add(Note_column* ncol_l) clash_l_arr_.push(ncol_l); add_dependency(ncol_l); } - +/** + should derive of Array. + */ static int idx(int dir, bool h_shift_b) { @@ -105,26 +107,28 @@ Collision::do_pre_processing() // y_extent: smallest y-pos noteball interval containing all balls // 4 (0..3) groups: stem up/down; shift on/off; - Interval_t middle( y_extent[0].min(), y_extent[3].max()); - Interval_t open_middle( y_extent[3].max()+1, y_extent[0].min()-1); + Interval_t middle( y_extent[idx(-1,0)].max(), + y_extent[idx(1,0)].min() ); + Interval_t open_middle( y_extent[idx(-1,0)].max()+1, y_extent[idx(1,0)].min()-1); do{ if (!open_middle.contains_b(y_extent[idx(d,true)])) x_off[idx(d, true)] = d *1.0 ; } while ((d *= -1) != 1); - if (!middle.empty_b() && - middle.length() <= 2 && col_l_a[idx(1,0)] && col_l_a[idx(-1,0)]) { + if (!middle.empty_b() + && middle.length() < 2 && col_l_a[idx(1,0)] && col_l_a[idx(-1,0)]) { // reproduction of bugfix at 3am ? - Notehead * nu_l= col_l_a[idx(1,0)]->head_l_arr_[0]; - Notehead * nd_l = col_l_a[idx(-1,0)]->head_l_arr_.top(); - if (! (nu_l->balltype_i_ == nd_l->balltype_i_ && nu_l->dots_i_ == nd_l->dots_i_)) { + Note_head * nu_l= col_l_a[idx(1,0)]->head_l_arr_[0]; + Note_head * nd_l = col_l_a[idx(-1,0)]->head_l_arr_.top(); + if (! (nu_l->balltype_i_ == nd_l->balltype_i_ && nu_l->dots_i_ == nd_l->dots_i_ && middle.length() == 0 )) { x_off[idx(1,0)] -= 0.5; - x_off[1] -= 0.5; - x_off[2] += 0.5; + x_off[idx(1,1)] -= 0.5; + x_off[idx(-1,1)] += 0.5; x_off[idx(-1,0)] += 0.5; } + } - Real inter_f = paper()->internote(); + Real inter_f = paper()->internote_f(); Real wid_f = paper()->note_width(); for (int j=0; j < 4; j++) { if (col_l_a[j]) @@ -135,3 +139,10 @@ Collision::do_pre_processing() } IMPLEMENT_STATIC_NAME(Collision); + +void +Collision::do_substitute_dependency(Score_elem*o_l,Score_elem*n_l) +{ + clash_l_arr_.substitute((Note_column*)o_l->item(), + (Note_column*)(n_l?n_l->item():0)); +} diff --git a/lily/command-request.cc b/lily/command-request.cc index e4334f1d69..83cb258ffb 100644 --- a/lily/command-request.cc +++ b/lily/command-request.cc @@ -1,7 +1,7 @@ /* commandrequest.cc -- implement Nonmusical reqs - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/complex-staff.cc b/lily/complex-staff.cc deleted file mode 100644 index 57d2fc0861..0000000000 --- a/lily/complex-staff.cc +++ /dev/null @@ -1,20 +0,0 @@ -#include "complex-staff.hh" -#include "complex-walker.hh" -#include "p-score.hh" - -/** Aside from putting fields right - */ -void -Complex_staff::set_output(PScore* pscore_l ) -{ - pstaff_l_ = new PStaff(pscore_l); - pscore_l_ = pscore_l; - pscore_l_->add(pstaff_l_); -} - - -Staff_walker * -Complex_staff::get_walker_p() -{ - return new Complex_walker(this); -} diff --git a/lily/complex-walker.cc b/lily/complex-walker.cc index 1e1ac452d7..d32d9db2eb 100644 --- a/lily/complex-walker.cc +++ b/lily/complex-walker.cc @@ -1,18 +1,20 @@ /* complex-walker.cc -- implement Complex_walker - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ - +#include "score.hh" #include "staff-column.hh" #include "voice.hh" #include "p-score.hh" -#include "complex-staff.hh" #include "debug.hh" #include "complex-walker.hh" #include "walk-regs.hh" +#include "score-elem.hh" +#include "staff.hh" +#include "staffline.hh" void Complex_walker::do_post_move() @@ -72,14 +74,15 @@ Complex_walker::typeset_element(Score_elem *elem_p) { if (!elem_p) return; + staff_l_->staff_line_l_->add_element(elem_p); if (elem_p->spanner()) - pscore_l_->typeset_spanner(elem_p->spanner(), staff()->pstaff_l_); + pscore_l_->typeset_unbroken_spanner(elem_p->spanner()); else ptr()->typeset_musical_item(elem_p->item()); } -Complex_walker::Complex_walker(Complex_staff*s) - : Staff_walker(s, s->pstaff_l_->pscore_l_) +Complex_walker::Complex_walker(Staff*s) + : Staff_walker(s, s->score_l_->pscore_p_) { walk_regs_p_ = new Walker_registers(this); do_post_move(); @@ -88,12 +91,7 @@ Complex_walker::Complex_walker(Complex_staff*s) Complex_walker::~Complex_walker() { -} - -Complex_staff* -Complex_walker::staff() -{ - return (Complex_staff*) staff_l_; + delete walk_regs_p_; } diff --git a/lily/crescendo.cc b/lily/crescendo.cc index f520106c19..98317f85e2 100644 --- a/lily/crescendo.cc +++ b/lily/crescendo.cc @@ -1,10 +1,11 @@ /* crescendo.cc -- implement Crescendo - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ + #include "dimen.hh" #include "crescendo.hh" #include "lookup.hh" @@ -12,18 +13,12 @@ #include "debug.hh" Crescendo::Crescendo() - : Staff_side(this) { grow_dir_i_ =0; dir_i_ = -1 ; left_dyn_b_ = right_dyn_b_ =false; } -Spanner* -Crescendo::do_break_at(PCol*, PCol*)const -{ - return new Crescendo(*this); -} Molecule* @@ -44,7 +39,7 @@ Crescendo::brew_molecule_p() const } if (w_dim < 0) { - error("Crescendo too small"); + warning("Crescendo too small"); w_dim = 0; } Real lookup_wid = w_dim * 0.9; // make it slightly smaller. @@ -53,7 +48,7 @@ Crescendo::brew_molecule_p() const m_p->add(Atom(s)); int pos = get_position_i(s.dim.y); m_p->translate(Offset(x_off_dim + 0.05 * w_dim, - pos * paper()->internote())); + pos * paper()->internote_f())); return m_p; } diff --git a/lily/dimen.cc b/lily/dimen.cc index 9e5fc2cea0..e609836a46 100644 --- a/lily/dimen.cc +++ b/lily/dimen.cc @@ -33,7 +33,7 @@ convert_dimen(Real quant, String unit) String print_dimen(Real r) { - String s(r); + String s(r, "%.3f"); s += "pt "; return s; } diff --git a/lily/dynamic-reg.cc b/lily/dynamic-reg.cc index 20ffe5cfe3..94b887432a 100644 --- a/lily/dynamic-reg.cc +++ b/lily/dynamic-reg.cc @@ -1,7 +1,7 @@ /* dynamic-reg.cc -- implement Dynamic_register - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/elem-group.cc b/lily/elem-group.cc new file mode 100644 index 0000000000..e4a012d3f3 --- /dev/null +++ b/lily/elem-group.cc @@ -0,0 +1,93 @@ +/* + elem-group.cc -- implement Element_group + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "elem-group.hh" +#include "interval.hh" +#include "item.hh" +#include "debug.hh" + +Interval +Element_group::do_height()const +{ + Interval r; + for (int i=0; i < elem_l_arr_.size(); i++) + r.unite(elem_l_arr_[i]->height()); + return r; +} + +Interval +Element_group::do_width()const +{ + Interval r; + for (int i=0; i < elem_l_arr_.size(); i++) + if (elem_l_arr_[i]->item()) // makes no at preprocessing for spanners. + r.unite(elem_l_arr_[i]->width()); + return r; +} + +void +Element_group::add_element(Score_elem*i_l) +{ + i_l->group_element_i_ ++; + + assert(! elem_l_arr_.find_l(i_l)); + elem_l_arr_.push(i_l); + add_dependency(i_l); +} + +void +Element_group::translate(Offset o) +{ + for (int i=0; i < elem_l_arr_.size(); i++) + elem_l_arr_[i]->translate(o); +} + +IMPLEMENT_STATIC_NAME(Element_group); + +void +Element_group::do_print() const +{ +#ifndef NPRINT + for (int i=0; i < elem_l_arr_.size(); i++) + mtor << elem_l_arr_[i]->name() << ' '; +#endif +} + +void +Element_group::do_substitute_dependency(Score_elem* old, Score_elem *new_l) +{ + int i; + + while ((i=elem_l_arr_.find_i(old))>=0) { + + old->group_element_i_--; + if (new_l){ + new_l->group_element_i_ ++; + elem_l_arr_[i] = new_l; + }else { + elem_l_arr_.del(i); + } + } + +} + +String +Element_group::TeX_string()const +{ + return ""; +} + +Element_group::Element_group(Element_group const&s) + :elem_l_arr_(s.elem_l_arr_) +{ + for (int i=0; i < elem_l_arr_.size(); i++) + elem_l_arr_[i]->group_element_i_ ++; +} + +Element_group::Element_group() +{} diff --git a/lily/global-regs.cc b/lily/global-regs.cc index 3451ca5270..f05f98c6aa 100644 --- a/lily/global-regs.cc +++ b/lily/global-regs.cc @@ -1,7 +1,7 @@ /* global-regs.cc -- implement - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/grouping.cc b/lily/grouping.cc index b44a9d90e4..9d466b912f 100644 --- a/lily/grouping.cc +++ b/lily/grouping.cc @@ -1,7 +1,7 @@ /* grouping.cc -- implement Rhythmic_grouping - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/head-reg.cc b/lily/head-reg.cc index 562dbea654..b704f1803e 100644 --- a/lily/head-reg.cc +++ b/lily/head-reg.cc @@ -1,23 +1,23 @@ /* - headreg.cc -- part of LilyPond + headreg.cc -- part of GNU LilyPond (c) 1997 Han-Wen Nienhuys */ -#include "notehead.hh" +#include "note-head.hh" #include "head-reg.hh" #include "paper-def.hh" #include "complex-walker.hh" #include "musical-request.hh" -Notehead_register::Notehead_register() +Note_head_register::Note_head_register() { note_p_ = 0; post_move_processing(); } bool -Notehead_register::try_request(Request *req_l) +Note_head_register::try_request(Request *req_l) { if (req_l->note() || req_l->rest()) note_req_l_=req_l->rhythmic(); @@ -28,12 +28,12 @@ Notehead_register::try_request(Request *req_l) } void -Notehead_register::process_requests() +Note_head_register::process_requests() { if (!note_req_l_) return; - Notehead*n_p = new Notehead(8); // ugh + Note_head*n_p = new Note_head(8); // ugh note_p_ = n_p; n_p->set_rhythmic(note_req_l_->rhythmic()); @@ -45,7 +45,7 @@ Notehead_register::process_requests() if (note_req_l_->rhythmic()->duration_.type_i_ <= 2) note_p_->translate( Offset(0, - 6 * paper()->internote())); + 6 * paper()->internote_f())); } Score_elem_info itinf(note_p_,note_req_l_); @@ -53,7 +53,7 @@ Notehead_register::process_requests() } void -Notehead_register::pre_move_processing() +Note_head_register::pre_move_processing() { if (note_p_) { typeset_element(note_p_); @@ -61,10 +61,10 @@ Notehead_register::pre_move_processing() } } void -Notehead_register::post_move_processing() +Note_head_register::post_move_processing() { note_req_l_ = 0; } -IMPLEMENT_STATIC_NAME(Notehead_register); -ADD_THIS_REGISTER(Notehead_register); +IMPLEMENT_STATIC_NAME(Note_head_register); +ADD_THIS_REGISTER(Note_head_register); diff --git a/lily/idealspacing.cc b/lily/idealspacing.cc index 8437aabe22..f1ff3691d5 100644 --- a/lily/idealspacing.cc +++ b/lily/idealspacing.cc @@ -1,7 +1,6 @@ #include "idealspacing.hh" #include "p-col.hh" #include "p-score.hh" -#include "p-staff.hh" #include "debug.hh" void @@ -10,7 +9,7 @@ Idealspacing::print() const #ifndef NPRINT mtor << "idealspacing {" ; mtor << "distance "<rank() << " right " << right->rank() << "}\n"; + mtor << "left " << left->rank_i() << " right " << right->rank_i() << "}\n"; #endif } diff --git a/lily/identifier.cc b/lily/identifier.cc index 72224f92f9..9829e40a42 100644 --- a/lily/identifier.cc +++ b/lily/identifier.cc @@ -1,7 +1,7 @@ /* identifier.cc -- implement identifier and derived classes - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/include/bar-reg.hh b/lily/include/bar-reg.hh index c73e5d1f4f..5879cb948b 100644 --- a/lily/include/bar-reg.hh +++ b/lily/include/bar-reg.hh @@ -1,7 +1,7 @@ /* bar-reg.hh -- declare Bar_register - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/include/bar.hh b/lily/include/bar.hh index 733cd26237..ea23bd07bc 100644 --- a/lily/include/bar.hh +++ b/lily/include/bar.hh @@ -1,5 +1,5 @@ /* - bar.hh -- part of LilyPond + bar.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ diff --git a/lily/include/beam.hh b/lily/include/beam.hh index a898628d35..d9c7a0a9b0 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -1,20 +1,21 @@ /* - beam.hh -- part of LilyPond + beam.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ #ifndef BEAM_HH #define BEAM_HH -#include "proto.hh" +#include "lily-proto.hh" #include "directional-spanner.hh" #include "plist.hh" /** a beam connects multiple stems Beam adjusts the stems its owns to make sure that they reach the beam and that point in the correct direction */ -struct Beam: public Directional_spanner { - Link_list stems; +class Beam: public Directional_spanner { +public: + Link_array stems; /// the slope of the beam in posns / point (dimension) Real slope; @@ -23,23 +24,24 @@ struct Beam: public Directional_spanner { /* *************** */ -NAME_MEMBERS(Beam); - - virtual Interval do_width()const; - Offset center() const; - Spanner *do_break_at(PCol *, PCol *) const; + NAME_MEMBERS(Beam); Beam(); void add(Stem*); - void set_default_dir(); - void do_pre_processing(); - void do_post_processing(); - - void do_print() const; void set_grouping(Rhythmic_grouping def, Rhythmic_grouping current); void set_stemlens(); - ~Beam(); + SPANNER_CLONE(Beam) +protected: + virtual Interval do_width()const; + virtual Offset center() const; + virtual void do_break_at(PCol *, PCol *); + virtual void set_default_dir(); + virtual void do_pre_processing(); + virtual void do_post_processing(); + virtual void do_substitute_dependency(Score_elem*, Score_elem*); + + virtual void do_print() const; private: Molecule stem_beams(Stem *here, Stem *next, Stem *prev)const; diff --git a/lily/include/bow.hh b/lily/include/bow.hh index 903bbdb635..76330c079c 100644 --- a/lily/include/bow.hh +++ b/lily/include/bow.hh @@ -1,7 +1,7 @@ /* bow.hh -- declare Bow - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -12,7 +12,8 @@ #include "directional-spanner.hh" /** - base class for anything that looks like a slur. + Base class for anything that looks like a slur. + Anybody with a better name? */ class Bow : public Directional_spanner { protected: diff --git a/lily/include/break.hh b/lily/include/break.hh index 343903313f..85b5ef0145 100644 --- a/lily/include/break.hh +++ b/lily/include/break.hh @@ -1,7 +1,7 @@ /* break.hh -- declare Break_algorithm - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1996, 1997 Han-Wen Nienhuys */ @@ -10,7 +10,7 @@ #ifndef BREAK_HH #define BREAK_HH #include "varray.hh" -#include "proto.hh" +#include "lily-proto.hh" #include "colhpos.hh" /** Class representation of an algorithm which decides where to put diff --git a/lily/include/clef-reg.hh b/lily/include/clef-reg.hh index a9f3426a12..28cbd4643c 100644 --- a/lily/include/clef-reg.hh +++ b/lily/include/clef-reg.hh @@ -1,5 +1,5 @@ /* - clef.hh -- part of LilyPond + clef.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ diff --git a/lily/include/colhpos.hh b/lily/include/colhpos.hh index c62b70e654..a1407366ea 100644 --- a/lily/include/colhpos.hh +++ b/lily/include/colhpos.hh @@ -1,5 +1,5 @@ /* - colhpos.hh -- part of LilyPond + colhpos.hh -- part of GNU LilyPond (c) 1997 Han-Wen Nienhuys */ @@ -7,7 +7,7 @@ #ifndef COLHPOS_HH #define COLHPOS_HH #include "varray.hh" -#include "proto.hh" +#include "lily-proto.hh" typedef Array Line_of_cols; diff --git a/lily/include/collision-reg.hh b/lily/include/collision-reg.hh index 0dd8a66fca..b0b3b6dc8a 100644 --- a/lily/include/collision-reg.hh +++ b/lily/include/collision-reg.hh @@ -1,7 +1,7 @@ /* collision-reg.hh -- declare Collision_register - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/include/collision.hh b/lily/include/collision.hh index 9f28738e21..be8d6bd506 100644 --- a/lily/include/collision.hh +++ b/lily/include/collision.hh @@ -1,7 +1,7 @@ /* collision.hh -- declare Collision - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -19,9 +19,10 @@ */ class Collision : public Item { protected: + virtual void do_substitute_dependency(Score_elem*,Score_elem*); virtual void do_pre_processing(); public: - Array clash_l_arr_; + Link_array clash_l_arr_; NAME_MEMBERS(Collision); void add (Note_column*ncol_l); Collision(); diff --git a/lily/include/command-request.hh b/lily/include/command-request.hh index 9cf88dcafc..d1b99f9a6c 100644 --- a/lily/include/command-request.hh +++ b/lily/include/command-request.hh @@ -1,7 +1,7 @@ /* command-request.hh -- declare Non musical requests - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/include/complex-staff.hh b/lily/include/complex-staff.hh deleted file mode 100644 index 0a37e3a5f7..0000000000 --- a/lily/include/complex-staff.hh +++ /dev/null @@ -1,25 +0,0 @@ -/* - complex-staff.hh -- declare Complex_staff - - (c) 1996,1997 Han-Wen Nienhuys -*/ - -#ifndef COMPLEXSTAF_HH -#define COMPLEXSTAF_HH - - -#include "key.hh" -#include "staff.hh" -#include "staff-walker.hh" - -/// -struct Complex_staff : Staff { - - /* *************** */ - - virtual void set_output(PScore *); - virtual Staff_walker *get_walker_p(); -}; - -#endif // COMPLEXSTAF_HH - diff --git a/lily/include/complex-walker.hh b/lily/include/complex-walker.hh index 44f445f069..cc16eef1b3 100644 --- a/lily/include/complex-walker.hh +++ b/lily/include/complex-walker.hh @@ -7,9 +7,9 @@ #ifndef COMPLEXWALKER_HH #define COMPLEXWALKER_HH -#include "proto.hh" +#include "lily-proto.hh" #include "staff-walker.hh" -#include "staff-elem-info.hh" +#include "score-elem-info.hh" /** A staff walker which uses registers to decide what to print @@ -33,10 +33,9 @@ public: virtual void do_post_move(); virtual void do_pre_move(); - Complex_walker(Complex_staff*); + Complex_walker(Staff*); ~Complex_walker(); - Complex_staff *staff(); private: }; diff --git a/lily/include/crescendo.hh b/lily/include/crescendo.hh index 915094e1dc..72ff2c1d1b 100644 --- a/lily/include/crescendo.hh +++ b/lily/include/crescendo.hh @@ -1,7 +1,7 @@ /* crescendo.hh -- declare Crescendo - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -16,7 +16,6 @@ The hairpin symbol. (cresc) */ class Crescendo : public Spanner , public Staff_side { - public: int grow_dir_i_; @@ -26,10 +25,13 @@ public: /// if there is a dynamic at the end, make the sign smaller. bool left_dyn_b_; Crescendo(); -private: - Spanner* do_break_at( PCol*, PCol*) const; - Molecule*brew_molecule_p()const; +protected: + SPANNER_CLONE(Crescendo) + virtual Molecule*brew_molecule_p()const; NAME_MEMBERS(Crescendo); + +private: + }; #endif // CRESCENDO_HH diff --git a/lily/include/debug.hh b/lily/include/debug.hh index 00f0a38e82..18055e067f 100644 --- a/lily/include/debug.hh +++ b/lily/include/debug.hh @@ -9,7 +9,7 @@ #include #include "dstream.hh" #include "real.hh" -#include "proto.hh" +#include "lily-proto.hh" #include "warn.hh" void error_t(const String& s, Time_description const & t_tdes); diff --git a/lily/include/directional-spanner.hh b/lily/include/directional-spanner.hh index eb96e87240..abff328b59 100644 --- a/lily/include/directional-spanner.hh +++ b/lily/include/directional-spanner.hh @@ -1,5 +1,5 @@ /* - directional-spanner.hh -- part of LilyPond + directional-spanner.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ @@ -10,17 +10,18 @@ #include "spanner.hh" /// a spanner which can be pointing "up" or "down" -struct Directional_spanner : Spanner{ +class Directional_spanner : public Spanner{ +public: /// -1 below heads, +1 above heads. int dir_i_; - + Directional_spanner(); + /// offset of "center" relative to left-column/0-pos of staff virtual Offset center() const=0; virtual void set_default_dir(); +protected: virtual void do_pre_processing(); - Directional_spanner(); - }; #endif // DIRECTIONALSPANNER_HH diff --git a/lily/include/dynamic-reg.hh b/lily/include/dynamic-reg.hh index cf23d007c3..17f769053c 100644 --- a/lily/include/dynamic-reg.hh +++ b/lily/include/dynamic-reg.hh @@ -1,7 +1,7 @@ /* dynamic-reg.hh -- declare Dynamic_register - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/include/elem-group.hh b/lily/include/elem-group.hh new file mode 100644 index 0000000000..0e544adbc0 --- /dev/null +++ b/lily/include/elem-group.hh @@ -0,0 +1,37 @@ +/* + elem-group.hh -- declare Element_group + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef ELEM_GROUP_HH +#define ELEM_GROUP_HH +#include "score-elem.hh" + +/** A class to treat a group of elements as a single entity. The + dimensions are the unions of the dimensions of what it contains. + Translation means translating the contents. + */ +class Element_group : virtual Score_elem{ +protected: + Link_array elem_l_arr_; + virtual void do_substitute_dependency(Score_elem* old, Score_elem* new_l); + virtual Interval do_height()const; + virtual Interval do_width()const; + virtual void do_print() const ; + virtual Element_group* elem_group() { return this; } + + +public: + Element_group(); + Element_group(Element_group const&); + NAME_MEMBERS(Element_group); + virtual void translate(Offset); + virtual void add_element(Score_elem*); + virtual String TeX_string()const; +}; + +#endif // ELEM_GROUP_HH diff --git a/lily/include/glob.hh b/lily/include/glob.hh index 7b8bb557d4..3bb2fe7601 100644 --- a/lily/include/glob.hh +++ b/lily/include/glob.hh @@ -4,6 +4,6 @@ #include #include "real.hh" -#include "proto.hh" +#include "lily-proto.hh" #include "const.hh" #endif diff --git a/lily/include/grouping.hh b/lily/include/grouping.hh index e4395b1f7a..428978249e 100644 --- a/lily/include/grouping.hh +++ b/lily/include/grouping.hh @@ -1,5 +1,5 @@ /* - grouping.hh -- part of LilyPond + grouping.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ diff --git a/lily/include/head-reg.hh b/lily/include/head-reg.hh index 09941a0554..5e47743db1 100644 --- a/lily/include/head-reg.hh +++ b/lily/include/head-reg.hh @@ -1,5 +1,5 @@ /* - headreg.hh -- part of LilyPond + headreg.hh -- part of GNU LilyPond (c) 1997 Han-Wen Nienhuys */ @@ -9,17 +9,17 @@ #define HEADREG_HH #include "register.hh" -struct Notehead_register : Request_register { - Notehead* note_p_; +struct Note_head_register : Request_register { + Note_head* note_p_; Rhythmic_req * note_req_l_; /* *************** */ - Notehead_register(); + Note_head_register(); virtual bool try_request(Request *req_l) ; virtual void process_requests(); virtual void pre_move_processing(); virtual void post_move_processing(); - NAME_MEMBERS(Notehead_register); + NAME_MEMBERS(Note_head_register); }; diff --git a/lily/include/idealspacing.hh b/lily/include/idealspacing.hh index 6b6f40c01a..72124521c0 100644 --- a/lily/include/idealspacing.hh +++ b/lily/include/idealspacing.hh @@ -1,12 +1,12 @@ /* - idealspacing.hh -- part of LilyPond + idealspacing.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ #ifndef IDEALSPACING_HH #define IDEALSPACING_HH -#include "proto.hh" +#include "lily-proto.hh" /// ideal spacing between two columns struct Idealspacing { diff --git a/lily/include/identifier.hh b/lily/include/identifier.hh index 49c7b954db..1a413cfef4 100644 --- a/lily/include/identifier.hh +++ b/lily/include/identifier.hh @@ -1,5 +1,5 @@ /* - identifier.hh -- part of LilyPond + identifier.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ @@ -7,7 +7,7 @@ #ifndef IDENTIFIER_HH #define IDENTIFIER_HH -#include "proto.hh" +#include "lily-proto.hh" #include "string.hh" #include "input.hh" diff --git a/lily/include/identparent.hh b/lily/include/identparent.hh deleted file mode 100644 index 09c7cfafd0..0000000000 --- a/lily/include/identparent.hh +++ /dev/null @@ -1 +0,0 @@ -#error diff --git a/lily/include/input-music.hh b/lily/include/input-music.hh index df490367b4..52fb654352 100644 --- a/lily/include/input-music.hh +++ b/lily/include/input-music.hh @@ -1,5 +1,5 @@ /* - input-music.hh -- part of LilyPond + input-music.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ @@ -8,7 +8,7 @@ #define INPUTMUSIC_HH #include "plist.hh" -#include "proto.hh" +#include "lily-proto.hh" #include "voice.hh" #include "moment.hh" diff --git a/lily/include/input-register.hh b/lily/include/input-register.hh index 2ba2c8c2e3..74cfa7acf5 100644 --- a/lily/include/input-register.hh +++ b/lily/include/input-register.hh @@ -1,7 +1,7 @@ /* input-register.hh -- declare Input_register - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -12,7 +12,7 @@ #include "plist.hh" #include "string.hh" -#include "proto.hh" +#include "lily-proto.hh" #include "input.hh" struct Input_register : Input { diff --git a/lily/include/input-score.hh b/lily/include/input-score.hh index da3db47208..436e5e0947 100644 --- a/lily/include/input-score.hh +++ b/lily/include/input-score.hh @@ -1,7 +1,7 @@ /* - input-score.hh -- declare + input-score.hh -- declare Input_score - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -11,7 +11,7 @@ #define INPUTSCORE_HH #include "varray.hh" -#include "proto.hh" +#include "lily-proto.hh" #include "plist.hh" #include "string.hh" #include "input.hh" diff --git a/lily/include/input-staff.hh b/lily/include/input-staff.hh index edc2991924..4cf819876f 100644 --- a/lily/include/input-staff.hh +++ b/lily/include/input-staff.hh @@ -10,7 +10,7 @@ #include "string.hh" #include "plist.hh" #include "varray.hh" -#include "proto.hh" +#include "lily-proto.hh" #include "input.hh" class Input_staff:public Input { diff --git a/lily/include/item.hh b/lily/include/item.hh index f61a2f2765..3c030d122c 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -1,7 +1,7 @@ /* item.hh -- declare Item - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -11,7 +11,7 @@ #include "glob.hh" #include "boxes.hh" #include "string.hh" -#include "staff-elem.hh" +#include "score-elem.hh" /** a horizontally fixed size element of the score @@ -28,21 +28,16 @@ public: /// indirection to the column it is in PCol * pcol_l_; - /* *************** */ virtual Item *item() { return this; } Item(); - void do_print()const; Real hpos_f() const; NAME_MEMBERS(Item); - /** - - @return the line where this is in; - - PRE - Breaking calc has to be finished - */ - Line_of_score * line_l() const; + virtual Line_of_score * line_l() const; +protected: + virtual void do_print()const; + }; + #endif diff --git a/lily/include/key-item.hh b/lily/include/key-item.hh index e56af8e682..1e2207beab 100644 --- a/lily/include/key-item.hh +++ b/lily/include/key-item.hh @@ -1,5 +1,5 @@ /* - key-item.hh -- part of LilyPond + key-item.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ diff --git a/lily/include/key-reg.hh b/lily/include/key-reg.hh index c674ca55a2..b6e21224d9 100644 --- a/lily/include/key-reg.hh +++ b/lily/include/key-reg.hh @@ -1,7 +1,7 @@ /* key-reg.hh -- declare Key_register - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/include/keyword.hh b/lily/include/keyword.hh index 88ab9ffbe0..a38935b398 100644 --- a/lily/include/keyword.hh +++ b/lily/include/keyword.hh @@ -1,5 +1,5 @@ /* - keyword.hh -- part of LilyPond + keyword.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ diff --git a/lily/include/leastsquares.hh b/lily/include/leastsquares.hh index 35b1e1d34b..2e5c970fe5 100644 --- a/lily/include/leastsquares.hh +++ b/lily/include/leastsquares.hh @@ -1,5 +1,5 @@ /* - leastsquare.hh -- part of LilyPond + leastsquare.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index 7cffaced16..7df7542482 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -1,76 +1,180 @@ /* lily-proto.hh -- declare class names. - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ - #ifndef LILY_PROTO_HH #define LILY_PROTO_HH #include "proto.hh" -struct My_lily_lexer; -struct My_lily_parser; -struct Notename_table; +struct My_lily_lexer; struct Absolute_dynamic_req; -struct Barcheck_req; +struct Accidental; +struct Atom; +struct Bar; +struct Bar_register; struct Bar_req; +struct Barcheck_req; +struct Beam; struct Beam_req; struct Blank_req; +struct Box; struct Bracket_req; struct Cadenza_req; +struct Chord; struct Clef_change_req; +struct Clef_item; +struct Clef_register; +struct Col_hpositions; +struct Colinfo; +struct Collision; +struct Collision_register; +struct Command_req; +struct Complex_music; +struct Complex_walker; struct Cresc_req; +struct Crescendo ; struct Decresc_req; +struct Directional_spanner; struct Durational_req; +struct Dynamic; struct Dynamic_req; -struct Group_change_req; +struct Element_group; struct Feature; +struct Group_change_req; struct Group_feature_req; +struct Idealspacing; +struct Identifier; +struct Input; +struct Input_file; +struct Input_music; +struct Input_register; +struct Input_score; +struct Input_staff; +struct Item; +struct Key; struct Key_change_req; +struct Key_item; +struct Key_register; +struct Keyword; +struct Keyword_table; +struct Lily_stream; +struct Line_of_score; +struct Line_of_staff; +struct Linestaff; +struct Local_key; +struct Local_key_item; +struct Local_key_register; +struct Lookup; +struct Lyric_item; struct Lyric_req; -struct Melodic_req; struct Measure_grouping_req; +struct Melodic_req; +struct Meter; struct Meter_change_req; +struct Meter_register; +struct Midi_def; +struct Midi_duration; +struct Midi_header; +struct Midi_item; +struct Midi_output; +struct Midi_pitch; +struct Midi_score; +struct Midi_staff; +struct Midi_stream; +struct Midi_track; +struct Midi_walker; +struct Mixed_qp; +struct Molecule; +struct Music_general_chord; +struct Music_voice; struct Musical_req; -struct Command_req; -struct Collision_register; -struct Collision; +struct My_lily_parser; +struct Note_column; +struct Note_column_register; struct Note_req; -struct Pulk_voices; -struct Pulk_voice; -struct Plet_req; +struct Note_head; +struct Note_head_register; +struct Notename_table; +struct Offset; +struct Output; +struct PCol; +struct PScore; +struct Paper_def; struct Partial_measure_req; +struct Plet; +struct Plet_req; +struct Pulk_voice; +struct Pulk_voices; +struct Rational; +struct Register_group_register; +struct Request; struct Request_column; +struct Request_register; +struct Rest; +struct Rest_collision; +struct Rest_collision_register; +struct Rest_column; struct Rest_req; +struct Rhythmic_grouping; struct Rhythmic_grouping_req; struct Rhythmic_req; +struct Score; +struct Score_column; struct Score_elem; struct Score_elem_info; +struct Score_walker; +struct Script; +struct Script_column; +struct Script_def; +struct Script_register; struct Script_req; +struct Simple_music; struct Skip_req; +struct Slur; +struct Slur_register; struct Slur_req; struct Spacing_req ; -struct Span_req; struct Span_dynamic_req; -struct Subtle_req; +struct Span_req; +struct Spanner; +struct Staff; +struct Staff_column; +struct Staff_side; +struct Staff_symbol; +struct Staff_walker; +struct Stem; +struct Stem_beam_register; struct Stem_req; -struct Tie_req; -struct Tie; -struct Tie_register; +struct String; +struct Subtle_req; +struct Symbol; +struct Symtable; +struct Symtables; +struct Super_elem; struct Terminate_voice_req; +struct Tex_stream; +struct Text_def; +struct Text_gob; +struct Text_item ; +struct Text_register; struct Text_req; +struct Tie; +struct Tie_register; +struct Tie_req; +struct Time_description; struct Timing_req; -struct Note_column_register; -struct Note_column; -struct Staff_side; -struct Staff_symbol; -struct Script_column; -struct Rest_column; -struct Rest_collision_register; -struct Rest_collision; -struct Vertical_spanner; struct Vertical_brace; +struct Vertical_spanner; +struct Voice; +struct Voice_element; +struct Voice_group_registers; +struct Voice_list; +struct Voice_registers; +struct Voicegroup; +struct Walker_registers; +typedef Rational Moment; #endif // LILY_PROTO_HH diff --git a/lily/include/linespace.hh b/lily/include/linespace.hh index bd8685383a..97e4caf70c 100644 --- a/lily/include/linespace.hh +++ b/lily/include/linespace.hh @@ -1,7 +1,7 @@ /* linespace.hh -- declare Colinfo, Spacing_problem - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1996,1997 Han-Wen Nienhuys */ diff --git a/lily/include/local-key-item.hh b/lily/include/local-key-item.hh index 2371277bb0..24f48e3115 100644 --- a/lily/include/local-key-item.hh +++ b/lily/include/local-key-item.hh @@ -1,5 +1,5 @@ /* - local-key-item.hh -- part of LilyPond + local-key-item.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ @@ -18,11 +18,14 @@ struct Local_acc { /** Accidentals which can be different for each octave. + + TODO: + update item if Items are removed */ struct Local_key_item : Item { NAME_MEMBERS(Local_key_item); Array accs; - Array support_items_; + Link_array support_items_; int c0_position; /* *************** */ @@ -31,8 +34,10 @@ struct Local_key_item : Item { void add(Item*); void add(int oct, int pitch, int acc); void add(Melodic_req*); - void do_pre_processing(); - Molecule* brew_molecule_p()const; +public: + virtual void do_pre_processing(); + virtual void do_substitute_dependency(Score_elem*,Score_elem*); + virtual Molecule* brew_molecule_p()const; }; #endif // LOCALKEYITEM_HH diff --git a/lily/include/local-key-reg.hh b/lily/include/local-key-reg.hh index b7197d2743..e127801917 100644 --- a/lily/include/local-key-reg.hh +++ b/lily/include/local-key-reg.hh @@ -17,8 +17,8 @@ struct Local_key_register : Request_register { Key const *key_C_; Array mel_l_arr_; Array support_l_arr_; - Link_array forced_l_arr_; - Link_array tied_l_arr_; + Link_array forced_l_arr_; + Link_array tied_l_arr_; /* *************** */ virtual void process_requests(); virtual void acknowledge_element(Score_elem_info); diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index 42a2e03819..0a0921efce 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -1,6 +1,11 @@ /* - lilypond, (c) 1996,97 Han-Wen Nienhuys + lookup.hh -- declare Lookup + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys */ + #ifndef LOOKUPSYMS_HH #define LOOKUPSYMS_HH @@ -15,7 +20,7 @@ struct Lookup { /* *************** */ void add(String, Symtable*); void print()const; - Real internote()const; + Real internote_f()const; Symbol linestaff(int n, Real w)const; Symbol fill(Box b)const; diff --git a/lily/include/lyric-register.hh b/lily/include/lyric-register.hh index f9f43bea26..304bf5c6cf 100644 --- a/lily/include/lyric-register.hh +++ b/lily/include/lyric-register.hh @@ -1,7 +1,7 @@ /* - lyric-register.hh -- declare + lyric-register.hh -- declare Lyric_register - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -12,7 +12,8 @@ #include "register.hh" #include "varray.hh" -#include "proto.hh" +#include "lily-proto.hh" + class Lyric_register : public Request_register { Array lreq_arr_; virtual bool acceptable_request_b(Request*); diff --git a/lily/include/main.hh b/lily/include/main.hh index 10fc7c3f47..334777183d 100644 --- a/lily/include/main.hh +++ b/lily/include/main.hh @@ -1,6 +1,6 @@ #ifndef MAIN_HH #define MAIN_HH -#include "proto.hh" +#include "lily-proto.hh" void debug_init(); void set_debug(bool); diff --git a/lily/include/meter-reg.hh b/lily/include/meter-reg.hh index 6ebe18c282..300c72da9f 100644 --- a/lily/include/meter-reg.hh +++ b/lily/include/meter-reg.hh @@ -1,7 +1,7 @@ /* meter-reg.hh -- declare Meter_register - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/include/midi-def.hh b/lily/include/midi-def.hh index 1e04e5df4c..9673783d25 100644 --- a/lily/include/midi-def.hh +++ b/lily/include/midi-def.hh @@ -1,7 +1,7 @@ /* - midi-def.hh -- declare + midi-def.hh -- declare Midi_def - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Jan Nieuwenhuizen */ @@ -9,7 +9,7 @@ #ifndef MIDIDEF_HH #define MIDIDEF_HH -#include "proto.hh" +#include "lily-proto.hh" #include "real.hh" #include "string.hh" #include "moment.hh" diff --git a/lily/include/midi-item.hh b/lily/include/midi-item.hh index 1aaf181d27..2467318e46 100644 --- a/lily/include/midi-item.hh +++ b/lily/include/midi-item.hh @@ -1,12 +1,12 @@ // -// midiitem.hh -- part of LilyPond +// midiitem.hh -- part of GNU LilyPond // // copyright 1997 Jan Nieuwenhuizen #ifndef MIDI_ITEM_HH #define MIDI_ITEM_HH #include "string.hh" -#include "proto.hh" +#include "lily-proto.hh" struct Midi_item { /* *************** */ diff --git a/lily/include/midi-output.hh b/lily/include/midi-output.hh index 86ffab2a05..575842ebbd 100644 --- a/lily/include/midi-output.hh +++ b/lily/include/midi-output.hh @@ -1,7 +1,7 @@ /* midioutput.hh -- declare Midi_output - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/include/midi-stream.hh b/lily/include/midi-stream.hh index 2444384838..c18cb9c4e9 100644 --- a/lily/include/midi-stream.hh +++ b/lily/include/midi-stream.hh @@ -1,5 +1,5 @@ // -// midistream.hh -- part of LilyPond +// midistream.hh -- part of GNU LilyPond // // copyright 1997 Jan Nieuwenhuizen diff --git a/lily/include/midi-walker.hh b/lily/include/midi-walker.hh index 30ad18fe90..2eac3747d6 100644 --- a/lily/include/midi-walker.hh +++ b/lily/include/midi-walker.hh @@ -7,7 +7,7 @@ #ifndef MIDIWALKER_HH #define MIDIWALKER_HH -#include "proto.hh" +#include "lily-proto.hh" #include "grouping.hh" #include "staff-walker.hh" #include "pcursor.hh" diff --git a/lily/include/misc.hh b/lily/include/misc.hh index 00b742076e..8ba5e10b78 100644 --- a/lily/include/misc.hh +++ b/lily/include/misc.hh @@ -1,7 +1,7 @@ #ifndef MISC_HH #define MISC_HH -#include "proto.hh" +#include "lily-proto.hh" #include "real.hh" #include "moment.hh" #include "scalar.hh" diff --git a/lily/include/molecule.hh b/lily/include/molecule.hh index 3904acb4bf..0ccb399a03 100644 --- a/lily/include/molecule.hh +++ b/lily/include/molecule.hh @@ -1,7 +1,7 @@ #ifndef MOLECULE_HH #define MOLECULE_HH -#include "proto.hh" +#include "lily-proto.hh" #include "plist.hh" #include "boxes.hh" #include "symbol.hh" @@ -23,7 +23,7 @@ struct Atom { void print() const; - String TeXstring() const; + String TeX_string() const; }; @@ -47,7 +47,7 @@ struct Molecule { /// how big is #this#? Box extent() const; - String TeXstring() const; + String TeX_string() const; Molecule(const Molecule&s); void print() const; diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh index 721b2ff51c..ae4a935939 100644 --- a/lily/include/musical-request.hh +++ b/lily/include/musical-request.hh @@ -1,7 +1,7 @@ /* musical-request.hh -- declare Musical requests - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/include/my-lily-lexer.hh b/lily/include/my-lily-lexer.hh index f69b7e0fb4..b214366e7e 100644 --- a/lily/include/my-lily-lexer.hh +++ b/lily/include/my-lily-lexer.hh @@ -1,7 +1,7 @@ /* lexer.hh -- declare My_lily_lexer - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -12,7 +12,7 @@ #include #include "lily-proto.hh" -#include "proto.hh" +#include "lily-proto.hh" #include "fproto.hh" #include "varray.hh" #include "string.hh" diff --git a/lily/include/my-lily-parser.hh b/lily/include/my-lily-parser.hh index 6fef2311ff..feb3301b00 100644 --- a/lily/include/my-lily-parser.hh +++ b/lily/include/my-lily-parser.hh @@ -1,7 +1,7 @@ /* my-lily-parser.hh -- declare My_lily_parser - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -9,12 +9,12 @@ #ifndef MY_LILY_PARSER_HH #define MY_LILY_PARSER_HH -#include "proto.hh" +#include "lily-proto.hh" #include "duration.hh" #include "string.hh" #include "varray.hh" #include "lily-proto.hh" -#include "proto.hh" +#include "lily-proto.hh" #include "duration.hh" #include "string.hh" #include "varray.hh" diff --git a/lily/include/note-column-reg.hh b/lily/include/note-column-reg.hh index d33dddf962..7925621e65 100644 --- a/lily/include/note-column-reg.hh +++ b/lily/include/note-column-reg.hh @@ -1,7 +1,7 @@ /* note-column-reg.hh -- declare Note_column_register - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/include/note-column.hh b/lily/include/note-column.hh index b5af018528..32b1a18e11 100644 --- a/lily/include/note-column.hh +++ b/lily/include/note-column.hh @@ -1,7 +1,7 @@ /* note-column.hh -- declare Note_column - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -15,14 +15,16 @@ /** a struct for treating a group of noteheads (noteheads, stem (chord) and scripts ) as a single entity. */ class Note_column : public Script_column { - void do_pre_processing(); +protected: + virtual void do_pre_processing(); + virtual void do_substitute_dependency(Score_elem*,Score_elem*); public: /// link to the stem. For setting default direction Stem * stem_l_; bool h_shift_b_; - Array head_l_arr_; + Link_array head_l_arr_; Interval_t head_positions_interval()const; /** The relative position of the "voice" containing this @@ -33,7 +35,7 @@ public: NAME_MEMBERS(Note_column); Note_column(); - void add(Notehead *); + void add(Note_head *); void add(Stem *); void sort(); void add(Script* s) { Script_column::add(s);} diff --git a/lily/include/notehead.hh b/lily/include/note-head.hh similarity index 78% rename from lily/include/notehead.hh rename to lily/include/note-head.hh index e28c387a28..4a1bf349eb 100644 --- a/lily/include/notehead.hh +++ b/lily/include/note-head.hh @@ -1,5 +1,5 @@ /* - notehead.hh -- part of LilyPond + note-head.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ @@ -18,9 +18,9 @@ */ -class Notehead : public Item { +class Note_head : public Item { public: - NAME_MEMBERS(Notehead); + NAME_MEMBERS(Note_head); bool rest_b_; int position_i_; @@ -41,8 +41,8 @@ public: /** position of top line (5 linestaff: 8) */ - Notehead(int staff_size); - static int compare(Notehead * const &a, Notehead *const &b) ; + Note_head(int staff_size); + static int compare(Note_head * const &a, Note_head *const &b) ; protected: virtual void do_print()const; virtual Molecule* brew_molecule_p()const; diff --git a/lily/include/notename-table.hh b/lily/include/notename-table.hh index 4e357a2593..082dda366b 100644 --- a/lily/include/notename-table.hh +++ b/lily/include/notename-table.hh @@ -1,7 +1,7 @@ /* notename-table.hh -- declare - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/include/notename.hh b/lily/include/notename.hh index 7aa8397af8..e0125e1a0b 100644 --- a/lily/include/notename.hh +++ b/lily/include/notename.hh @@ -1,5 +1,5 @@ /* - notename.hh -- part of LilyPond + notename.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ diff --git a/lily/include/offset.hh b/lily/include/offset.hh index e0b62bba76..bd5b269532 100644 --- a/lily/include/offset.hh +++ b/lily/include/offset.hh @@ -1,5 +1,5 @@ /* - offset.hh -- part of LilyPond + offset.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ diff --git a/lily/include/p-col.hh b/lily/include/p-col.hh index 71b5887c98..11d1cc8cc0 100644 --- a/lily/include/p-col.hh +++ b/lily/include/p-col.hh @@ -22,8 +22,8 @@ class PCol { public: - Link_list its; - Link_list stoppers, starters; + Link_list its; + Link_list stoppers, starters; /** prebreak is put before end of line. if broken here, then (*this) column is discarded, and prebreak @@ -39,7 +39,7 @@ public: PCol *daddy_l_; /// if lines are broken then this column is in #line# - Line_of_score const *line_l_; + Line_of_score *line_l_; /** if lines are broken then this column x-coord #hpos# if not known, then hpos == -1.(ugh?) */ @@ -52,7 +52,7 @@ public: /* *************** */ /// which one (left =0) - int rank() const; + int rank_i() const; /// does this column have items bool used_b() const; diff --git a/lily/include/p-score.hh b/lily/include/p-score.hh index 1e283faf9e..5490345729 100644 --- a/lily/include/p-score.hh +++ b/lily/include/p-score.hh @@ -1,7 +1,7 @@ /* p-score.hh -- declare PScore - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1996,1997 Han-Wen Nienhuys */ @@ -11,42 +11,33 @@ #define P_SCORE_HH #include "colhpos.hh" -#include "varray.hh" +#include "parray.hh" #include "lily-proto.hh" -#include "p-col.hh" -#include "p-staff.hh" +#include "plist.hh" +/** all stuff which goes onto paper. notes, signs, symbols in a score + #PScore# contains the items, the columns. + + */ -/** all stuff which goes onto paper. notes, signs, symbols in a score can be grouped in two ways: - horizontally (staffwise), and vertically (columns). #PScore# - contains the items, the columns and the staffs. - */ - -struct PScore { +class PScore { +public: Paper_def *paper_l_; - + /// the columns, ordered left to right Pointer_list cols; /// the idealspacings, no particular order Pointer_list suz; - /// the staffs ordered top to bottom - Pointer_list staffs; - - /// all symbols in score. No particular order. - Pointer_list its; - - /// if broken, the different lines - Pointer_list lines; - /// crescs etc; no particular order Pointer_list spanners; - /// broken spanners - Pointer_list broken_spans; + /// other elements + Pointer_list elem_p_list_; + + Super_elem *super_elem_l_; - Pointer_list vspan_p_list_; /* *************** */ /* CONSTRUCTION */ @@ -54,30 +45,22 @@ struct PScore { /// add a line to the broken stuff. Positions given in #config# void set_breaking(Array const &); - void add(PStaff *); - - /** add an item. add the item in specified containers. If breakstatus is set properly, add it to the {pre,post}break of the pcol. */ - void typeset_item(Item *item_p, PCol *pcol_l,PStaff*pstaf_l,int breakstatus=1); + void typeset_item(Item *item_p, PCol *pcol_l,int breakstatus=1); - /// add a Spanner - void typeset_spanner(Spanner*, PStaff*); - /// add to bottom of pcols void add(PCol*); - void add_broken(Spanner*); - /* INSPECTION */ - Array select_items(PStaff*, PCol*); - - /** - @return argument as a cursor of the list - */ + /** + @return argument as a cursor of the list + */ PCursor find_col(PCol const *)const; + Link_array col_range(PCol *left_l, PCol *right_l) const; + /* MAIN ROUTINES */ void process(); @@ -98,6 +81,13 @@ struct PScore { /* STANDARD ROUTINES */ void OK()const; void print() const; + ~PScore(); + void typeset_element(Score_elem*); + void typeset_broken_spanner(Spanner*); + /// add a Spanner + void typeset_unbroken_spanner(Spanner*); + + private: /// before calc_breaking void preprocess(); diff --git a/lily/include/p-staff.hh b/lily/include/p-staff.hh deleted file mode 100644 index c4236c874e..0000000000 --- a/lily/include/p-staff.hh +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef PSTAFF_HH -#define PSTAFF_HH - -#include "proto.hh" -#include "plist.hh" -#include "item.hh" -#include "symbol.hh" - -/// items grouped horizontally -struct PStaff { - PScore * pscore_l_; - - - Link_list spans; - Link_list its; - - /* *************** */ - void add(Item*i); - PStaff(PScore*); - -private: - PStaff(PStaff const&); -}; - -#endif diff --git a/lily/include/paper-def.hh b/lily/include/paper-def.hh index 9eb94245d5..1c067669e9 100644 --- a/lily/include/paper-def.hh +++ b/lily/include/paper-def.hh @@ -1,7 +1,7 @@ /* paper-def.hh -- declare Paper_def - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1996,1997 Han-Wen Nienhuys */ @@ -9,7 +9,7 @@ paper-def.hh -- declare Paper_def #ifndef PAPER_DEF_HH #define PAPER_DEF_HH -#include "proto.hh" +#include "lily-proto.hh" #include "real.hh" #include "string.hh" #include "moment.hh" @@ -51,9 +51,9 @@ public: /** The distance between lines */ - Real interline()const; + Real interline_f()const; /// half the distance between lines - Real internote()const; + Real internote_f()const; /// thickness of the standard line Real rule_thickness()const; diff --git a/lily/include/parseconstruct.hh b/lily/include/parseconstruct.hh index 711f555865..4bab4e9083 100644 --- a/lily/include/parseconstruct.hh +++ b/lily/include/parseconstruct.hh @@ -1,5 +1,5 @@ /* - parseconstruct.hh -- part of LilyPond + parseconstruct.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ @@ -7,7 +7,7 @@ #ifndef PARSECONSTRUCT_HH #define PARSECONSTRUCT_HH -#include "proto.hh" +#include "lily-proto.hh" String * get_scriptdef(char c); Request* get_script_req(char); diff --git a/lily/include/pulk-voice.hh b/lily/include/pulk-voice.hh index 9d26d9798a..085a0a3ff6 100644 --- a/lily/include/pulk-voice.hh +++ b/lily/include/pulk-voice.hh @@ -1,7 +1,7 @@ /* pulk-voice.hh -- declare Pulk_voice - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -10,7 +10,7 @@ #ifndef PULK_VOICE_HH #define PULK_VOICE_HH -#include "proto.hh" +#include "lily-proto.hh" #include "lily-proto.hh" #include "moment.hh" #include "priorities.hh" diff --git a/lily/include/pulk-voices.hh b/lily/include/pulk-voices.hh index 9f01f4419e..fd388d143e 100644 --- a/lily/include/pulk-voices.hh +++ b/lily/include/pulk-voices.hh @@ -1,7 +1,7 @@ /* pulk-voices.hh -- declare Pulk_voices - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys @@ -16,7 +16,7 @@ #include "pqueue.hh" #include "plist.hh" #include "moment.hh" -#include "proto.hh" +#include "lily-proto.hh" #include "lily-proto.hh" #include "voice.hh" #include "time-description.hh" diff --git a/lily/include/qlp.hh b/lily/include/qlp.hh index ccfba72bb8..3c026581eb 100644 --- a/lily/include/qlp.hh +++ b/lily/include/qlp.hh @@ -1,7 +1,7 @@ /* qlp.hh -- declare Ineq_constrained_qp, Mixed_qp - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/include/qlpsolve.hh b/lily/include/qlpsolve.hh index 3423951452..c7a54b1eca 100644 --- a/lily/include/qlpsolve.hh +++ b/lily/include/qlpsolve.hh @@ -1,7 +1,7 @@ /* qlpsolve.hh -- declare Active_constraints, Inactive_iter - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/include/register-group.hh b/lily/include/register-group.hh index 2e13b51248..5e91ae4621 100644 --- a/lily/include/register-group.hh +++ b/lily/include/register-group.hh @@ -1,7 +1,7 @@ /* - registergroup.hh -- declare + registergroup.hh -- declare Register_group_register - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -12,7 +12,7 @@ #include "plist.hh" -#include "staff-elem-info.hh" +#include "score-elem-info.hh" #include "register.hh" /** diff --git a/lily/include/register.hh b/lily/include/register.hh index dee7c512c8..641d033112 100644 --- a/lily/include/register.hh +++ b/lily/include/register.hh @@ -1,7 +1,7 @@ /* register.hh -- declare Request_register - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1996, 1997 Han-Wen Nienhuys */ @@ -13,7 +13,7 @@ #include "lily-proto.hh" #include "varray.hh" #include "request.hh" -#include "staff-elem-info.hh" +#include "score-elem-info.hh" #include "staff-info.hh" /** diff --git a/lily/include/reqtodo.hh b/lily/include/reqtodo.hh deleted file mode 100644 index eaed606453..0000000000 --- a/lily/include/reqtodo.hh +++ /dev/null @@ -1,83 +0,0 @@ -#if 0 - - - -/**Draw a (Guitar) chord above or below this ``note''. -Why a request? -Because everything else is done in requests. -*/ -struct Chord : Request { - // don't know how this looks. -}; - - -/// for absolute dynamics -enum Loudness { - FFF, FF, F, MF, MP, P, PP, PPP -} ; - - -/** -Start/stop a bracket at this note. if #nplet# is set, the staff will -try to put an appropriate number over the bracket -*/ -struct Bracket_req : Span_req { - int nplet; // print a number over the beam. -}; - -struct Subtle_req { - Moment subtime; -}; - - -/** helper in the hierarchy. Each dynamic is bound to one note ( a - crescendo spanning multiple notes is thought to be made of two - "dynamics": a start and a stop). Dynamic changes can occur in a - smaller time than the length of its note, therefore fore each - Dynamic request carries a time, measured from the start of its - note. - - This subfield would come in handy, if mpp96 was adapted for midi - support. - - Dynamic should have been derived from request, but I don't want to - fuss with virtual baseclasses. */ - -struct Dynamic:Subtle_req { - -}; -/// do a crescendo -struct Cresc_req : Span_req, Dynamic { - -}; - -/// do a decrescendo -struct Decresc_req : Span_req, Dynamic { - -}; - -/// do a dynamic like "fff" or "mp" -struct Absdynamic_req : Request, Dynamic { - Loudness loudness; -}; - -struct Grace_req : Subtle_req { - -}; - -struct Grace_turn_req : Grace_turn { - -}; - -struct Grace_note : Melodic_req { - -}; - -struct Grace_notes { - -}; - -struct Glissando_req : Span_req { - -}; -#endif diff --git a/lily/include/request-column.hh b/lily/include/request-column.hh index 19876c9e37..82377cf3df 100644 --- a/lily/include/request-column.hh +++ b/lily/include/request-column.hh @@ -1,7 +1,7 @@ /* request-column.hh -- declare Request_column - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/include/request.hh b/lily/include/request.hh index c3e0deb846..f045b36204 100644 --- a/lily/include/request.hh +++ b/lily/include/request.hh @@ -1,19 +1,19 @@ /* request.hh -- declare Request baseclasses. - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ #ifndef REQUEST_HH #define REQUEST_HH -// LilyPond's second egg of columbus! +// GNU LilyPond's second egg of columbus! #include "glob.hh" #include "string.hh" #include "moment.hh" -#include "class-name.hh" +#include "virtual-methods.hh" #include "input.hh" /** @@ -65,7 +65,7 @@ protected: #define REQUESTMETHODS(T,accessor) \ virtual T * accessor() { return this;}\ NAME_MEMBERS(T);\ -virtual Request *clone() const { return new T(*this); } \ +VIRTUAL_COPY_CONS(T, Request)\ virtual void do_print() const #endif diff --git a/lily/include/rest-collision-reg.hh b/lily/include/rest-collision-reg.hh index a572ee6449..39b0b2d10e 100644 --- a/lily/include/rest-collision-reg.hh +++ b/lily/include/rest-collision-reg.hh @@ -1,7 +1,7 @@ /* rest-collision-reg.hh -- declare Rest_collision_register - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/include/rest-collision.hh b/lily/include/rest-collision.hh index 31a1c8504b..d470e4178e 100644 --- a/lily/include/rest-collision.hh +++ b/lily/include/rest-collision.hh @@ -1,7 +1,7 @@ /* rest-collision.hh -- declare Rest_collision - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -14,13 +14,14 @@ #include "item.hh" class Rest_collision : public Item { - Array rest_l_arr_; - Array ncol_l_arr_; + Link_array rest_l_arr_; + Link_array ncol_l_arr_; public: void add(Rest_column*); void add(Collision*); NAME_MEMBERS(Rest_collision); protected: virtual void do_post_processing(); + virtual void do_substitute_dependency(Score_elem*,Score_elem*); }; #endif // REST_COLLISION_HH diff --git a/lily/include/rest-column.hh b/lily/include/rest-column.hh index a753c61d93..803e00a294 100644 --- a/lily/include/rest-column.hh +++ b/lily/include/rest-column.hh @@ -1,7 +1,7 @@ /* rest-column.hh -- declare Rest_column - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -17,13 +17,15 @@ only produce one rest. */ class Rest_column : public Script_column { - Array head_l_arr_; + Link_array head_l_arr_; public: int dir_i_; - void add(Notehead *); + void add(Note_head *); NAME_MEMBERS(Rest_column); void translate_y(Real dy); Rest_column(); +protected: + virtual void do_substitute_dependency(Score_elem*, Score_elem*); }; #endif // REST_COLUMN_HH diff --git a/lily/include/score-column.hh b/lily/include/score-column.hh index 9f2e33c6b5..4d6fc17af7 100644 --- a/lily/include/score-column.hh +++ b/lily/include/score-column.hh @@ -1,12 +1,12 @@ /* - sccol.hh -- part of LilyPond + sccol.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ #ifndef SCCOL_HH #define SCCOL_HH -#include "proto.hh" +#include "lily-proto.hh" #include "varray.hh" #include "moment.hh" diff --git a/lily/include/staff-elem-info.hh b/lily/include/score-elem-info.hh similarity index 83% rename from lily/include/staff-elem-info.hh rename to lily/include/score-elem-info.hh index 7d5955a2a7..b4d4fb748a 100644 --- a/lily/include/staff-elem-info.hh +++ b/lily/include/score-elem-info.hh @@ -1,7 +1,7 @@ /* - staff-elem-info.hh -- declare Score_elem_info + score-elem-info.hh -- declare Score_elem_info - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ diff --git a/lily/include/staff-elem.hh b/lily/include/score-elem.hh similarity index 62% rename from lily/include/staff-elem.hh rename to lily/include/score-elem.hh index fa459f9e76..463c8e2352 100644 --- a/lily/include/staff-elem.hh +++ b/lily/include/score-elem.hh @@ -1,26 +1,29 @@ /* - staff-elem.hh -- part of LilyPond + score-elem.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ #ifndef STAFFELEM_HH #define STAFFELEM_HH -#include "varray.hh" -#include "proto.hh" + +#include "parray.hh" +#include "lily-proto.hh" #include "offset.hh" #include "molecule.hh" -#include "class-name.hh" +#include "virtual-methods.hh" +#include "directed-graph.hh" /** Both Spanner and Item are Score_elem's. Most Score_elem's depend on other Score_elem's, eg, Beam needs to know and set direction of Stem. So the Beam has to be calculated *before* Stem. This is - accomplished with the dependencies field of struct Score_elem. + accomplished with the dependencies fields of struct Score_elem, + which are implemented in the Directed_graph_node class: all elements + form an acyclic graph. - (elem) - */ -class Score_elem { + (elem) */ +class Score_elem : private Directed_graph_node { /// member: the symbols Molecule *output; // should scrap, and use temp var? @@ -31,57 +34,76 @@ class Score_elem { NULL. */ Offset offset_; - Array dependancy_l_arr_; -public: + enum Status { ORPHAN, // not yet added to pstaff VIRGIN, // added to pstaff PRECALCING, PRECALCED, // calcs before spacing done + BREAKING, + BROKEN, POSTCALCING, // busy calculating. This is used to trap cyclic deps. POSTCALCED, // after spacing calcs done - VERTICALCING, // height determined - VERTICALCED, OUTPUT, // molecule has been output + DELMARKED, // mark for 'unclean' deletion DELETED, // to catch malloc mistakes. } status; - - /// the pstaff it is in - PStaff *pstaff_l_; - /* *************** */ + + Score_elem* dependency(int) const; + Score_elem* dependent(int) const; + int dependent_size() const; + int dependency_size() const; +public: + PScore *pscore_l_; + int group_element_i_; + Score_elem(Score_elem const&); - String TeXstring () const ; + virtual String TeX_string () const ; virtual void print() const; - virtual Interval width() const; - virtual Interval height() const; + Paper_def *paper() const; + virtual ~Score_elem(); Score_elem(); NAME_MEMBERS(Score_elem); - - /** + virtual bool is_type_b(const char *); + + Interval width() const; + Interval height() const; + /** translate the symbol. The symbol does not have to be created yet. - Overridable, since this staff-elem might act as a pseudo-list. + Overridable, since this score-elem might act as a pseudo-list. */ virtual void translate(Offset); Offset offset()const; + void add_processing(); + void OK() const; void pre_processing(); + void break_processing(); + void post_processing(); void molecule_processing(); - - virtual Spanner* spanner() { return 0; } - virtual Item * item() { return 0; } + + void unlink(); + void unlink_all(); + void remove_dependency(Score_elem*); /** add a dependency. It may be the 0 pointer, in which case, it is ignored. */ void add_dependency(Score_elem* ); - void substitute_dependency(Score_elem* old, Score_elem * newdep); + + virtual Spanner* spanner() { return 0; } + virtual Element_group* elem_group() { return 0; } + virtual Item * item() { return 0; } + virtual Line_of_score * line_l() const; protected: + virtual Interval do_height()const; virtual Interval do_width()const; + /// do printing of derived info. virtual void do_print() const {} /// generate the molecule @@ -91,13 +113,13 @@ protected: /// do calculations before determining horizontal spacing virtual void do_pre_processing(); + /// do calculations after determining horizontal spacing virtual void do_post_processing(); - - /// do calculations after height of spanners/items is determined. - virtual void do_verticalcing(); - Array dependant_l_arr_; - + + virtual void do_substitute_dependency(Score_elem * , Score_elem *); + virtual void do_break_processing(); + virtual void handle_broken_dependencies(); }; diff --git a/lily/include/score-walker.hh b/lily/include/score-walker.hh index fc4a554f45..ca19c0f942 100644 --- a/lily/include/score-walker.hh +++ b/lily/include/score-walker.hh @@ -1,7 +1,7 @@ /* score-walker.hh -- declare Score_walker - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys @@ -12,7 +12,7 @@ #ifndef SCOREWALKER_HH #define SCOREWALKER_HH #include "pcursor.hh" -#include "proto.hh" +#include "lily-proto.hh" #include "varray.hh" diff --git a/lily/include/score.hh b/lily/include/score.hh index da38be4b41..3641468837 100644 --- a/lily/include/score.hh +++ b/lily/include/score.hh @@ -1,7 +1,7 @@ /* score.hh -- declare Score - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -11,7 +11,7 @@ #define SCORE_HH #include "varray.hh" -#include "proto.hh" +#include "lily-proto.hh" #include "plist.hh" #include "moment.hh" #include "assoc.hh" diff --git a/lily/include/scoreline.hh b/lily/include/scoreline.hh index 15c10f31cf..688d95b564 100644 --- a/lily/include/scoreline.hh +++ b/lily/include/scoreline.hh @@ -1,33 +1,44 @@ + /* - scoreline.hh -- part of LilyPond + scoreline.hh -- part of GNU LilyPond (c) 1996,97 Han-Wen Nienhuys */ #ifndef SCORELINE_HH #define SCORELINE_HH -#include "proto.hh" -#include "plist.hh" -#include "varray.hh" -/// the columns of a score that form one line. -struct -Line_of_score { - Link_list cols; +#include "colhpos.hh" +#include "spanner-elem-group.hh" +/// the columns of a score that form one line. +class Line_of_score : public Spanner_elem_group { +public: + Link_array line_arr_; + Link_array cols; bool error_mark_b_; - // need to store height of each staff. - Pointer_list staffs; - PScore * pscore_l_; // needed to generate staffs - + virtual String TeX_string() const; + /* *************** */ - void process() ; - Line_of_score(Array sv, PScore *); - - String TeXstring() const; - - // is #c# contained in #*this#? - bool element(PCol const *c); + NAME_MEMBERS(Line_of_score); + Line_of_score(); + + void add_line(Spanner_elem_group *); + + /// is #c# contained in #*this#? + bool contains_b(PCol const *c)const; + + Link_array get_lines()const; + void set_breaking(Array const&); + +protected: + virtual void break_into_pieces(); + virtual void do_substitute_dependency(Score_elem*,Score_elem*); + virtual void do_pre_processing(); + virtual void do_post_processing(); + + + SPANNER_CLONE(Line_of_score) }; #endif diff --git a/lily/include/script-column.hh b/lily/include/script-column.hh index f6adf9ffcb..22564d4805 100644 --- a/lily/include/script-column.hh +++ b/lily/include/script-column.hh @@ -1,7 +1,7 @@ /* script-column.hh -- declare Script_column - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ @@ -10,22 +10,22 @@ #ifndef SCRIPT_COLUMN_HH #define SCRIPT_COLUMN_HH +#include "elem-group.hh" #include "item.hh" /** a struct for treating a group of noteheads (noteheads, stem (chord) and scripts ) as a single entity. */ -class Script_column : public Item { +class Script_column : public Item, public Element_group { + protected: - virtual Interval do_height()const; - virtual Interval do_width()const; - virtual void do_print() const ; - virtual void do_pre_processing(); + virtual void do_print() const; + virtual void do_substitute_dependency(Score_elem*, Score_elem*); + virtual void do_pre_processing() ; public: - Array