From d8018dfc750f1dee8e1ee78a5d5f51b06d4c8348 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 17 Apr 1997 12:59:14 +0200 Subject: [PATCH] release: 0.0.52 --- .version | 2 +- ANNOUNCE | 5 +- Documentation/CodingStyle.pod | 2 + Documentation/INSTALL.pod | 40 +++-- Documentation/Makefile | 4 +- Documentation/examples.pod | 7 + Documentation/language.pod | 253 +------------------------------ Documentation/lilypond.pod | 24 +-- Documentation/mudela.pod | 24 ++- INSTALL.text | 88 +++++------ NEWS | 15 +- TEST | 21 --- TODO | 33 ++-- bin/convert-mudela | 140 ++++++++++++++++- bin/make_website | 34 +++-- configure | 151 +++++++++++------- configure.in | 99 ++++++++---- flower/.version | 2 +- flower/NEWS | 3 + flower/include/interval.hh | 10 +- flower/include/interval.tcc | 19 ++- flower/interval.cc | 19 +++ flower/path.cc | 2 + init/register.ini | 1 + init/symbol.ini | 2 +- input/collisions.ly | 54 +++++++ input/kortjakje.ly | 1 + input/scsii-menuetto.ly | 6 +- input/standchen.ly | 122 ++++++++------- input/wohltemperirt.ly | 6 +- lib/source-file.cc | 11 +- lib/source.cc | 9 +- lib/warn.cc | 2 +- lily/.version | 2 +- lily/clef-item.cc | 12 +- lily/collision-reg.cc | 39 +++++ lily/collision.cc | 151 ++++++++++++++++++ lily/command-request.cc | 7 +- lily/dynamic-reg.cc | 5 +- lily/head-reg.cc | 10 -- lily/include/clef-item.hh | 14 +- lily/include/collision-reg.hh | 25 +++ lily/include/collision.hh | 25 +++ lily/include/command-request.hh | 5 +- lily/include/dynamic-reg.hh | 2 +- lily/include/head-reg.hh | 2 - lily/include/item.hh | 2 +- lily/include/lily-proto.hh | 3 + lily/include/note-column-reg.hh | 3 + lily/include/note-column.hh | 27 ++-- lily/include/notehead.hh | 1 + lily/include/paper-def.hh | 20 ++- lily/include/parseconstruct.hh | 1 + lily/include/register-group.hh | 2 +- lily/include/register.hh | 4 +- lily/include/script-reg.hh | 1 - lily/include/slur-reg.hh | 10 +- lily/include/staff-elem-info.hh | 10 +- lily/include/staff-elem.hh | 1 + lily/include/stem-beam-reg.hh | 2 +- lily/include/text-reg.hh | 2 +- lily/include/voice-regs.hh | 1 + lily/item.cc | 17 ++- lily/main.cc | 15 +- lily/my-lily-lexer.cc | 1 + lily/note-column-reg.cc | 16 ++ lily/note-column.cc | 25 +++ lily/note.cc | 13 +- lily/parser.y | 23 ++- lily/register-group.cc | 2 +- lily/script-reg.cc | 6 - lily/slur-reg.cc | 13 -- lily/staff-elem-info.cc | 12 -- lily/staff-elem.cc | 5 + lily/stem-beam-reg.cc | 8 +- lily/stem.cc | 3 +- lily/template5.cc | 21 ++- lily/text-reg.cc | 7 +- lily/voice-group-regs.cc | 7 +- make/Configure_variables.make.in | 1 + make/Makefile | 2 +- make/Targets.make | 7 +- make/Variables.make | 2 +- make/lilypond.spec | 40 +++++ make/lilypond.spec.in | 9 +- tex/Makefile | 8 +- 86 files changed, 1165 insertions(+), 698 deletions(-) delete mode 100644 TEST mode change 100644 => 100755 bin/convert-mudela create mode 100644 flower/interval.cc create mode 100644 input/collisions.ly create mode 100644 lily/collision-reg.cc create mode 100644 lily/collision.cc create mode 100644 lily/include/collision-reg.hh create mode 100644 lily/include/collision.hh create mode 100644 make/lilypond.spec diff --git a/.version b/.version index 0e2c17ca28..1457d1972e 100644 --- a/.version +++ b/.version @@ -1,6 +1,6 @@ TOPLEVEL_MAJOR_VERSION = 0 TOPLEVEL_MINOR_VERSION = 0 -TOPLEVEL_PATCH_LEVEL = 51 +TOPLEVEL_PATCH_LEVEL = 52 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf diff --git a/ANNOUNCE b/ANNOUNCE index 0b79200e5b..b4aa95f949 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -66,9 +66,8 @@ MIDI to Mudela conversion through the mi2mu program. Multiple staffs in one score. Each staff can have a different meters. Multiple voices within one staff; beams optionally shared between -voices. (well, more than 2 voices won't look pretty --yet.) Multiple -scores within one input file. Each score is output to a different -file. +voices. Multiple scores within one input file. Each score is output +to a different file. Beams, slurs, chords, super/subscripts (accents and text), triplets, general n-plet (triplet, quadruplets, etc.), lyrics, transposition diff --git a/Documentation/CodingStyle.pod b/Documentation/CodingStyle.pod index 468c63a260..9f13c7bbd3 100644 --- a/Documentation/CodingStyle.pod +++ b/Documentation/CodingStyle.pod @@ -81,6 +81,7 @@ http://www.zib.de/Visual/software/doc++/index.html /* C style comments for multiline comments. + They come before the thing to document. [...] */ @@ -247,6 +248,7 @@ use no, or pick less silly, abbrvs. =item * use non-ambiguous postfixes C + =back Macros, Cs and Cs are all uppercase, diff --git a/Documentation/INSTALL.pod b/Documentation/INSTALL.pod index 0d6c96e6eb..26343b17e0 100644 --- a/Documentation/INSTALL.pod +++ b/Documentation/INSTALL.pod @@ -22,6 +22,7 @@ For compilation you need. =over 5 =item * + Unix. GNU LilyPond is known to run on Linux, AIX, Digital Unix and Solaris @@ -29,21 +30,21 @@ If you have the Cygnus WIN32 port of the GNU utils, it will even work in Lose NT/95, but don't promise to support it. =item * + GNU C++ v2.7 or better, with libg++ installed. Version 2.7.2 or better recommended. I almost positive that it will not compile with AT&T CC. =item * -Bash. Most scripts will continue to work with a stock sh, but they -might generate (harmless) syntax errors -=item * GNU make. =item * + Flex (2.5.1 or better). =item * + Bison. =back @@ -53,9 +54,9 @@ Bison. =over 5 =item * -Perl. Some (mostly unimportant scripts) use Perl for trivial -operations. The documentation was created with the perl's Plain Old -Documentation. + +Perl. Most scripts are written in Perl. The documentation was created +with the perl's Plain Old Documentation. =item * (GNU) find @@ -81,10 +82,10 @@ This will install the following files: /usr/lib/texmf/texmf/tex/lilypond/* The TeX include directory is detected dynamically, but it can be -adjusted with B<--enable-texprefix>. The above assumes that you are root and -have the gnu -development tools, and your make is gnu make. If this is not the -case, you can adjust your environment variables to your taste: +adjusted with B<--enable-tex-prefix> and B<--enable-tex-dir>. The +above assumes that you are root and have the gnu development tools, +and your make is gnu make. If this is not the case, you can adjust +your environment variables to your taste: export CPPFLAGS="-I /home/me/my_include -DWEIRD_FOOBAR" configure @@ -96,7 +97,12 @@ B<--help>. If you are not root, you will probably have to make it with configure --prefix=/home/me_myself_and_I/ -Since GNU LilyPond currently is beta, You are advised to also use +If you want to install GNU LilyPond in F, and your TeX has +no default hooks for local stuff (mine is broken too), you can do: + + configure --prefix=/usr/local --enable-tex-prefix=/usr/lib/texmf + +Since GNU LilyPond currently is beta, you are advised to also use --enable-debug --enable-checking @@ -107,6 +113,8 @@ other options include: --enable-printing --enable-optimise --enable-profiling + --enable-tex-prefix + --enable-tex-dir The option B<--enable-optimise> is recommended for Real Life usage. @@ -144,7 +152,9 @@ Please refer to the man page for more information. =head1 REDHAT LINUX RedHat Linux users should be able to get a RPM. A spec file is in -F. +F. You should be able to create an rpm as a normal +user. Be sure you have a ~/.rpmrc, and edit the RPM-dir in +F =head1 WINDOZE @@ -163,16 +173,16 @@ to make GNU LilyPond under, brr, aargh, well, simply type: GNU LilyPond (pl 0.0.39) is known to compile on the following platforms: - * linux 2.0.28, g++ 2.7.2[.1] + * linux 2.0.x, g++ 2.7.2[.1] * aix 4.1, g++ 2.7.2 * windows-nt 4.0, cygnus gnu-win32 beta17.1 (~=g++ 2.7.2) * linux 2.0.28 X to doze, gcc-go32 (~=g++ 2.7.2) [exec. untested] =head1 AUTHORS - Han-Wen Nienhuys +Han-Wen Nienhuys - Jan Nieuwenhuizen +Jan Nieuwenhuizen Have fun! diff --git a/Documentation/Makefile b/Documentation/Makefile index dd61be8065..b9df442521 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -32,7 +32,7 @@ EXTRA_DISTFILES = lelie_icon.gif lelie_logo.gif # default: do-doc - echo $(TEXTFILES) $(OUTPODFILES) $(PODFILES) + true do-doc: $(TEXTFILES) html: $(HTMLFILES) @@ -56,6 +56,6 @@ localinstall: $(outdir)/lilypond.1 $(outdir)/mudela.5 $(INSTALL) -d $(mandir)/man1 $(INSTALL) -m 755 $(outdir)/lilypond.1 $(mandir)/man1 $(INSTALL) -m 755 $(outdir)/mudela.5 $(mandir)/man5 - + localuninstall: rm -f $(mandir)/man1/lilypond.1 diff --git a/Documentation/examples.pod b/Documentation/examples.pod index b00226cebc..2337c9bd58 100644 --- a/Documentation/examples.pod +++ b/Documentation/examples.pod @@ -23,6 +23,13 @@ Features: cadenza mode. Copyright: public domain +=head2 F + +Random counterpoint to demonstrate features. + +Features: \multivoice, collision resolution. + + =head2 F Ludwig van Beethoven (1770-1792), Opus 62 Ouverture zu Collins diff --git a/Documentation/language.pod b/Documentation/language.pod index 181c4dea1f..0961c0aeaa 100644 --- a/Documentation/language.pod +++ b/Documentation/language.pod @@ -1,79 +1,22 @@ - =head1 NAME language.pod -- state of the art mudela-vapourware. -=head1 SYNOPSIS - -(damn pod) - =head1 DESCRIPTION +[this document is slowly merged into the mudela doco, as the +implementation progresses. If you want to see our previous musings, +take out an old version of lilypond] + here are some thoughts on the language. Most of the examples are in pseudo current mudela. Some stuff gratuitously taken from your mails. + =head1 NOTE I dislike vapourware. That's why I oppose to concrete plans on how to do input for features we don't know how to produce on paper -=head1 AIM - -A musical notation that is relatively easy to comprehend to both -programmers and non programmers. The final aim is to be able to -express what can be expressed in sheet music. - -=over 5 - -=item * -play pieces - -=item * -typeset the pieces - -=back - -further requirements: - -=over 5 - -=item * -Possible to edit the layout without danger of changing the -original music. (fingerings, interpretation) - -=item * -Simple music manipulations, such as transposing, creating a -score for individual instruments as well as for the conductor, -extracting short pieces from a longer one, glueing several shorter -pieces into a single score. - -=back - -Pieces could be: - - -=over 5 - -=item * -Mahlerian orchestral score - -=item * -piano pieces - -=item * -pop songs (lyrics + chords) - -=item * -gregorian chant (?) - -=item * -bach multivoice organ music. - -=item * -short excerpts to be used in musicological publications. - -=back - =head1 REQUIREMENTS =head2 Parser output @@ -139,49 +82,6 @@ it will make things easier. =item * -\keyword, bo difference notes vs. notenames, - -=item * - -{} hierachical, nest., - -=item * - -<> chords, - -=item * - -drop staff (NOT)?, - -=item * - -melody = \melodic{ } vs. \melodic melody = { } - -=item * - -lexer mode switch by types: \lyric{ }, \melodic{ }, etc., - -=item * - -octaves: low 'C C c c' c'' high; 'c' == c === "c-klein", comment: a ' -' a . Which ' for which a? Now using a!'`. - -=over 4 - -=item * - -\meter{ 2/4 }, - -=item * - -\grouping{ 2*8 3*8 }, - -=item * - -\skip{ 2: 2*8 3*32 }, - -=item * - abbrev: [c2 c2]\noplet{1/2} (wat bout [c2 c2]1/2\noplet?), =item * @@ -204,16 +104,8 @@ drop \music, =item * -++ concat - -=item * - C<+> is merge -=item * - - \transpose{ \from c \to g \melodic{ c d e } } - \transpose{ \from c \to g melody } %!? =item * @@ -253,34 +145,6 @@ can be declared? Like the score now: This will only be readable if the Mudela-user rigidly uses hungarian, which he/she won't. -=head2 Backslash - -I like it. Let's keep it in the language if we need it, it's a -universally accepted escape sequence. - -=head2 Braces - -I like the idea of <> vs. {}. Not because I think it is more clear, -but I dislike the word "music", I can't seem to find the proper word -for what "music" currently does, so I'd like to flush it. - -I would like to point that both <> and {} are indicating a -hierarchy. I think, we should continue to allow them to nest. I still -have no preference what to use for what. - -=head2 Command syntax - -Braces on commands are here now, because the {} are the only nesting -braces. We need to avoid that, since the brace is overused as it -is. We don't like lisp that much. (the key is the only commands which -really needs {} now) - -How about - - \bar "some args", "some more"; - -(note the ; ), which is a mix of perl and TeX. - Of course \key should take a \notename. In fact, I think we should program the note intervals (which are now hardcoded for midi purposes) To allow adaptation to other scales. @@ -316,75 +180,6 @@ mudela to LilyPond. That I don't mind, but it hampers portability. Suppose some commercial systems want to read mudela too. -=head2 Lexer modes - -the $ and @ were quick hacks, which suck badly. Replacing it by a -mechanism that switches the lexer automatically would be better, but -it is still error prone, and it hurts uniformity. What I would like -best is unified syntax, but this seems impossible since lyrics could -clash with notenames. If possible it would simplify the parser, the -scanner, and the explanation of the language. - -What about: - - bes c d e f % notes - 'bes- sen sap % some lyric syllables - -We can make one of the ' ` " a lyric-indication, but then we would -have to change the octave indication, eg. - - _bes % lower - ^bes % higher - -or - - +bes % higher - -bes % lower - -And I am still not sure if it would be possible now, but I think this -is worthwile to investigate. Or we could replace @ by a -quote (take your pick) sign, which is a lot more intuitive. - -The big question remaining is: do we want to add any more modes than -lyric and note? - - -[LOOSE THOUGHT] - -Even looser ideas: we can take a look at the perl wagon. It has numerous -inputmodes. What about: - - lyric << ENDLYRIC - - bes- sen- sap - - ENDLYRIC - - music << ENDMUSIC - - c d e f g - - ENDMUSIC - - -[LOOSE THOUGHT] - -If we free up $ @ from their current meaning, $ and @ could be used to -signify other things. - -=head2 Concrete solution to lyric vs. note - -I think - - "lyric" - -is a valid lyric too. This implies that any bare string is checked if -it is a note. Now it prints an error if not, but I could change it to -assume it is a STRING (and can be reduced to lyric). Heck! I could -implement this tonight. We'd lose one mode! (after checking lexer -source) the only problem is preventing puctuation and the - and _ from -clashing with script symbols. - =head2 Command placement: @@ -412,16 +207,6 @@ LilyPond, before even considering a syntax. uhh? -=head2 Numbers - -The syntax of /, * and : has to be settled, we have - - - notes (1, 2, 4, 8 etc) - - meter 2*4 - - plet 2/3 - - multiple notes: 3*4 - - abbreviations (not implemented) c4/4 or c4*4 - =head2 Filtering This is a idea of mine: we could filter some request types from @@ -468,34 +253,6 @@ Just ideas: ++ concatenation of voices + merging of voices - -=head2 C++ OOP like input. - -I don't see the big win of this. - - score sc1= melody; - sc1.staff{\verse}; - sc1.staff{<\b1 \b2>} - sc1.paper=mypaperdef; - - -We're not doing a programming language. In this syntax the parser has -to lookup what sc1 means, decide if it should copied shallow/deep, -decide if has a staff block, switch the mode after it finds that staff -takes music. May be I'm just ranting, but it looks hairy to -me. Remember that at this stage we're just filling structs. - -In a distant future there might be a need for programming (are you -listening, Philip Glass?), but I think that would be something for -Mudela version 3. And I think using m4 (or something alike) would be -just as convenient. - -=head2 Transposition - -Has to be done. How about: - - \transpose { \from c \to g \music { ... }} - =head2 Quoting Difficult. Hmm... diff --git a/Documentation/lilypond.pod b/Documentation/lilypond.pod index cce5ba495e..555c0eeb0e 100644 --- a/Documentation/lilypond.pod +++ b/Documentation/lilypond.pod @@ -99,7 +99,7 @@ dynamics (both absolute and hairpin style) =item * multiple voices within one staff; beams optionally shared -between voices. (well, more than 2 voices won't look pretty --yet.) +between voices. Up to four voices is handled cleanly. =item * @@ -159,22 +159,24 @@ quality. If you're not discouraged; this is what I type in my xterm: This is what the output looks like over here: - GNU LilyPond 0.0.40 #0/FlowerLib 1.1.7 #2. Compile: Mar 11 1997, 22:58:47 (g++ 2.7.2) - Parsing ... [./init//symbol.ini[./init//dynamic.ini][./init//dutch.ini] - [./init//script.ini][./init//table_sixteen.ini]][./input/wohltemperirt.ly] - Setting up music ...Processing music ............ - Preprocessing ... - Calculating column positions ... [3][6][9] + hw:~/musix/spacer$ lilypond input/kortjakje.ly + GNU LilyPond 0.0.52 #1/FlowerLib 1.1.12 #1 + Parsing ... [/home/hw/share/lilypond/init//symbol.ini[ + + ][./input/kortjakje.ly] + + Setting up music ...Processing music ...[8][16][24][25] + Preprocessing ... + Calculating column positions ... [3][9][14][18][22][25] Postprocessing ... TeX output to lelie.out ... - midi output to lelie.midi ... hw:~/musix/spacer$ tex test This is TeX, Version 3.14159 (C version 6.1) - (test.tex + (/home/hw/lib/texmf/tex/lilypond/test.tex Hyphenation patterns for english, dutch, loaded. - (lilyponddefs.tex) (lelie.uit) [1] [2] ) - Output written on test.dvi (2 pages, 8420 bytes). + (/home/hw/lib/texmf/tex/lilypond/lilyponddefs.tex) (lelie.out) [1] ) + Output written on test.dvi (1 page, 9180 bytes). Transcript written on test.log. hw:~/musix/spacer$ xdvi test& diff --git a/Documentation/mudela.pod b/Documentation/mudela.pod index d8bfb8541a..f66180e238 100644 --- a/Documentation/mudela.pod +++ b/Documentation/mudela.pod @@ -5,7 +5,7 @@ Mudela - GNU LilyPond input format 0.1 =head1 DESCRIPTION This document describes the the GNU LilyPond input format, which is an -effective language for definining music. We call this language +effective language for defining music. We call this language (rather arrogantly) The Musical Definition Language (S). The first aim of Mudela is to define a piece of music, @@ -15,14 +15,15 @@ as from a musical performing point of view. =head1 Overview -The Musical Definition Language (Mudela) S, -has a logical structure, -making use of typing and naming (using identifiers), -that allows for flexible input, and definition reuse. +The Musical Definition Language (Mudela) S, has a logical +structure, making use of typing and naming (using identifiers), that +allows for flexible input, and definition reuse. -The below included for explanatory -purposes only (i.e., for a complete and up-to-date definition, see -F and F): +The below included for explanatory purposes only (i.e., for a complete +and up-to-date definition, see F and F): + +As a related note, you should take a look at the examples and the init +file, as this document does not cover every aspect of mudela yet. =head2 Files @@ -346,6 +347,13 @@ The duration of a chord equals the union of the durations of each of its elements. The C<\multivoice> is a construct which is explained below. +You can also glue two horizontal pieces music together with +concatenation operator: + + \horOne = \melodic { c c g g } + \horTwo = \melodic { a a g2 } + \twinkle = \melodic { \horOne ++ \horTwo } + =head2 Transposition You can transpose horizontal music in the following way: diff --git a/INSTALL.text b/INSTALL.text index 246247cbbd..78b8576cfa 100644 --- a/INSTALL.text +++ b/INSTALL.text @@ -23,29 +23,27 @@ IIIIMMMMPPPPOOOORRRRTTTTAAAANNNNTTTT PPPPRRRREEEERRRREEEEQQQQUUUUIIIISSSSIIIITTTTEEEESSSS For compilation you need. - +o Unix. GNU LilyPond is known to run on Linux, AIX, + +o Unix. GNU LilyPond is known to run on Linux, AIX, Digital Unix and Solaris + If you have the Cygnus WIN32 port of the GNU utils, it will even work in Lose NT/95, but don't promise to support it. - +o GNU C++ v2.7 or better, with libg++ installed. Version - 2.7.2 or better recommended. I almost positive that - it will not compile with AT&T CC. - - +o Bash. Most scripts will continue to work with a stock - sh, but they might generate (harmless) syntax errors + +o GNU C++ v2.7 or better, with libg++ installed. + Version 2.7.2 or better recommended. I almost + positive that it will not compile with AT&T CC. - +o GNU make. + +o GNU make. - +o Flex (2.5.1 or better). + +o Flex (2.5.1 or better). - +o Bison. + +o Bison. RRRREEEECCCCOOOOMMMMMMMMEEEENNNNDDDDEEEEDDDD - +o Perl. Some (mostly unimportant scripts) use Perl for - trivial operations. The documentation was created - with the perl's Plain Old Documentation. + +o Perl. Most scripts are written in Perl. The + documentation was created with the perl's Plain Old + Documentation. +o (GNU) find @@ -61,7 +59,9 @@ CCCCOOOONNNNFFFFIIIIGGGGUUUURRRRIIIINNNNGGGG a -14/Apr/97 LilyPond 0.0.51 1 + + +17/Apr/97 LilyPond 0.0.52 1 @@ -78,10 +78,11 @@ INSTALL(1) LilyPond documentation INSTALL(1) /usr/lib/texmf/texmf/tex/lilypond/* The TeX include directory is detected dynamically, but it - can be adjusted with --------eeeennnnaaaabbbblllleeee----tttteeeexxxxpppprrrreeeeffffiiiixxxx. The above assumes - that you are root and have the gnu development tools, and - your make is gnu make. If this is not the case, you can - adjust your environment variables to your taste: + can be adjusted with --------eeeennnnaaaabbbblllleeee----tttteeeexxxx----pppprrrreeeeffffiiiixxxx and --------eeeennnnaaaabbbblllleeee----tttteeeexxxx---- + ddddiiiirrrr. The above assumes that you are root and have the gnu + development tools, and your make is gnu make. If this is + not the case, you can adjust your environment variables to + your taste: export CPPFLAGS="-I /home/me/my_include -DWEIRD_FOOBAR" configure @@ -94,7 +95,13 @@ INSTALL(1) LilyPond documentation INSTALL(1) configure --prefix=/home/me_myself_and_I/ - Since GNU LilyPond currently is beta, You are advised to + If you want to install GNU LilyPond in _/_u_s_r_/_l_o_c_a_l, and + your TeX has no default hooks for local stuff (mine is + broken too), you can do: + + configure --prefix=/usr/local --enable-tex-prefix=/usr/lib/texmf + + Since GNU LilyPond currently is beta, you are advised to also use --enable-debug @@ -106,6 +113,8 @@ INSTALL(1) LilyPond documentation INSTALL(1) --enable-printing --enable-optimise --enable-profiling + --enable-tex-prefix + --enable-tex-dir The option --------eeeennnnaaaabbbblllleeee----ooooppppttttiiiimmmmiiiisssseeee is recommended for Real Life usage. @@ -115,27 +124,27 @@ INSTALL(1) LilyPond documentation INSTALL(1) make all everything will be compiled, but nothing will be - installed. The resulting binaries can be found in the - subdirectory _b_i_n_/. -RRRRUUUUNNNNNNNNIIIINNNNGGGG - GNU LilyPond does use a lot of resources. For operation - you need the following: - +o A fast computer (a full page of music typically takes 1 - minute on my 486/66, using the --------eeeennnnaaaabbbblllleeee----cccchhhheeeecccckkkkiiiinnnngggg +17/Apr/97 LilyPond 0.0.52 2 -14/Apr/97 LilyPond 0.0.51 2 +INSTALL(1) LilyPond documentation INSTALL(1) -INSTALL(1) LilyPond documentation INSTALL(1) + installed. The resulting binaries can be found in the + subdirectory _b_i_n_/. +RRRRUUUUNNNNNNNNIIIINNNNGGGG + GNU LilyPond does use a lot of resources. For operation + you need the following: + +o A fast computer (a full page of music typically takes 1 + minute on my 486/66, using the --------eeeennnnaaaabbbblllleeee----cccchhhheeeecccckkkkiiiinnnngggg compile. It's lot slower than most MusiXTeX preprocessors) @@ -147,7 +156,9 @@ INSTALL(1) LilyPond documentation INSTALL(1) RRRREEEEDDDDHHHHAAAATTTT LLLLIIIINNNNUUUUXXXX RedHat Linux users should be able to get a RPM. A spec - file is in _m_a_k_e_/_l_i_l_y_p_o_n_d_._s_p_e_c. + file is in _m_a_k_e_/_l_i_l_y_p_o_n_d_._s_p_e_c. You should be able to + create an rpm as a normal user. Be sure you have a + ~/.rpmrc, and edit the RPM-dir in _V_a_r_i_a_b_l_e_s_._m_a_k_e WWWWIIIINNNNDDDDOOOOZZZZEEEE Windows NT: @@ -165,16 +176,16 @@ PPPPLLLLAAAATTTTFFFFOOOORRRRMMMMSSSS GNU LilyPond (pl 0.0.39) is known to compile on the following platforms: - * linux 2.0.28, g++ 2.7.2[.1] + * linux 2.0.x, g++ 2.7.2[.1] * aix 4.1, g++ 2.7.2 * windows-nt 4.0, cygnus gnu-win32 beta17.1 (~=g++ 2.7.2) * linux 2.0.28 X to doze, gcc-go32 (~=g++ 2.7.2) [exec. untested] AAAAUUUUTTTTHHHHOOOORRRRSSSS - Han-Wen Nienhuys + Han-Wen Nienhuys - Jan Nieuwenhuizen + Jan Nieuwenhuizen Have fun! @@ -182,17 +193,6 @@ AAAAUUUUTTTTHHHHOOOORRRRSSSS - - - - - - - - - - - -14/Apr/97 LilyPond 0.0.51 3 +17/Apr/97 LilyPond 0.0.52 3 diff --git a/NEWS b/NEWS index cbcbe2102b..9e64e93bb6 100644 --- a/NEWS +++ b/NEWS @@ -1,11 +1,24 @@ +****** +pl 52 + - Buildroot RPM + - tex-prefix and tex-dir sep'd (here you are jan) + - convert-mudela framework + - Collision_register, Collision + - \hshift 1; input + - Features changed +pl 50.jcn1 + - LILYINCLUDE dir searched before DIR_DATADIR(?) + - lily reads from stdin again (but does not now when to stop) +****** pl 51 - transposition bugfix + doco - LilyPond -> GNU LilyPond - bugfixes for Staff_side and Note_column* - - wohltemperirt: 12 more bars + - wohltemperirt: complete ****** april 11 + pl 50 - merge rest / notehead. - Staff_side as a base class for most "staff-side" symbols. diff --git a/TEST b/TEST deleted file mode 100644 index 0200c36ea6..0000000000 --- a/TEST +++ /dev/null @@ -1,21 +0,0 @@ -Testing for 0.1 in 3 stages: - - 1. Announce "beta testers wanted" - to linux.dev.apps, gnu.announce, mutex - - Source only dist - - GOAL: bugfixes & doco updates - - create mailing list - - 2. Announce to LilyPond list, GNU "internal" list, RoseGarden -list ?, LDA, Mutex - - Source & binary dist too, beta release to fsf? - - GOAL: distribution & portability testing - - 3. Announce to COLA, gnu.announce - - Public release diff --git a/TODO b/TODO index 20b8e9aea5..805651b355 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -before 0.1 +IMPORTANT * update 20 pt table @@ -8,6 +8,11 @@ before 0.1 * script priority + * slur direction + + * problems with empty staff.->revise staff-column/score-walker. + + This is an assorted collection of stuff that will be done, might be done, or is an idea that I want to think about @@ -18,10 +23,6 @@ BUGS * hairpin width - * problems with empty staff. - - * help-lines - * help-lines for rests * [c8. c32 c32] @@ -30,8 +31,6 @@ BUGS * lilypond - -> crash - * \stem -1 < chord > rest - SEVERELY LACKING: * SPEED! @@ -66,6 +65,8 @@ INPUTLANGUAGE SMALLISH PROJECTS + * use rest size in Collision + * bugreport to doc++ devel: struct not in class hier; public virtual baseclasses @@ -116,11 +117,10 @@ SMALLISH PROJECTS * command priority into enum - * don't broadcast Staff_sym - * C meter iso 4/4 * textspanner: center position + * script-spacing * Brackets @@ -132,8 +132,6 @@ SMALLISH PROJECTS * configure idealspacing: arithmetic - * collision Request_register. - * add (good guess of) width to lyric items * midi output: eat-up dynamic, key/meter/tempo changes, and @@ -153,12 +151,12 @@ FUTURE * Reg_configure_request + * bring Collision::do_pre_processing to haircutter + * slurs per voicegroup. * slur parts as a script - * multiple scripst. - * mixed fontsizes * put scripts on bars @@ -171,7 +169,6 @@ FUTURE * MIDI repeat: make lily understand repeats - * better beamslope calculation: QLP for beams? * implement better breaking algorithm @@ -189,17 +186,19 @@ FUTURE * piano staff * vertical spanner + IDEAS + * scoping in Lexer? + * integrate Register/Midi stuff * create libmudela, or liblily_frontend - * Horizontal_align_item, Vertical_align_item. - - * move MIDI io to a ANSI C libmidi library. + * move MIDI stuff (including Quantization) to a ANSI C libmidi library. * use an embedded language: scheme, lisp, S-lang, Perl, GUILE, ? + for : - Items/Spanners - Registers diff --git a/bin/convert-mudela b/bin/convert-mudela old mode 100644 new mode 100755 index d64a7d75ac..ff7b4c2864 --- a/bin/convert-mudela +++ b/bin/convert-mudela @@ -1,3 +1,141 @@ #!/usr/bin/perl -w -print "todo\n!"; +=head1 NAME + +convert-mudela - convert mudela to newer versions + +=head1 SYNOPSIS + + convert-mudela --from=FROM_PATCHLEVEL --to=TO_PATCHLEVEL + +=head1 DESCRIPTION + +convert-mudela sequentially applies different mudela-conversions to +upgrade a Mudela input file from FROM_PATCHLEVEL to TO_PATCHLEVEL + +=head1 OPTIONS + +=over 4 + +=item B<--output> + +The output file to write + +=item B<--edit> + +Do an inline edit of the input file. override B<--output> + +=item B<--show-rules> + +shows all known conversions. + +=item B<--from>=FROM_PATCHLEVEL + +=item B<--to>=TO_PATCHLEVEL + +=back + +=cut + + +use Getopt::Long; +sub + version_string_conv +{ + my ($from_version, $to_version) = @_; + s/\version \"0.0.$from_version\"/\version \"0.0.$to_version\"/g; +} + +sub + conv_pl0_0_50_pl0_0_52 +{ + +} + +sub + usage +{ + print STDERR "Usage: convert-mudela --from=XX --to=XX\n"; + print STDERR "other options: --edit --output=FILE --show-rules\n"; + exit 2; +} + +my %minor_conversions = ("50" => \&no_conv, + "52" => \&conv_pl0_0_50_pl0_0_52); + +sub + show_rules +{ + print "Rules: ", join(", ", keys %minor_conversions), "\n"; + +} + +sub + do_conversion +{ + my ($from,$to) = @_; + + my @applicable_conversion; + my @mudela_levels; + + die "This is too old to convert " if $from < 50; + + foreach $a (sort keys %minor_conversions) { + if ($a > $from && $a <= $to ){ + push @applicable_conversion, $minor_conversions{$a}; + push @mudela_levels, $a; + } + } + + print STDERR "Applying following rules: ", join(", ", @mudela_levels) , "\n"; + + while () { + foreach $subroutine (@applicable_conversion) { + + &$subroutine; + + } + version_string_conv $from, $to; + print OUTLY; + } +} + + +sub + set_files +{ + $infile = "-"; + $outfile = "-"; + $outfile = $opt_output if (defined($opt_output)); + + if ($ARGV [0]) { + $infile = $ARGV[0]; + } + + if ($opt_edit && $infile ne "-") { + $opt_edit = 1; + rename $infile, "$infile~"; + $outfile = $infile; + $infile = "$infile~"; + } +} + +GetOptions ("output=s", "from=i", "to=i", "minor=i", "edit", "show-rules"); + +if ($opt_show_rules) { + show_rules ; + $opt_show_rules = 0; # to extinguish typo check. + exit 0; +} + +usage if (!defined($opt_from) || !defined($opt_to)); +local ( $infile,$outfile); +set_files; + +die "can't open \`$infile\'" unless open INLY,$infile ; +die "can't open \`$outfile\'" unless open OUTLY, ">$outfile"; + +do_conversion $opt_from, $opt_to; +close INLY; +close OUTLY; + diff --git a/bin/make_website b/bin/make_website index 411262ed4a..f7a1209029 100755 --- a/bin/make_website +++ b/bin/make_website @@ -1,8 +1,7 @@ #!/usr/bin/perl -w # stuff should be generated in out directory. -sub - set_hrefs +sub set_hrefs { while () { s#href=([A-Za-z.]+)#href=$base/$1#g; @@ -24,18 +23,16 @@ sub all_refs } local $base="lilypond/"; -local @examples=("wohltemperirt" ,"standchen", "scsii-menuetto", "rhythm", "martien"); +local @examples=("wohltemperirt" ,"standchen", "scsii-menuetto", "rhythm", "martien", "collisions"); -#mkdir "lilypond"; -sub - gen_html + +sub gen_html { print "generating HTML\n"; system "make -kC .. html"; } -sub - gen_examples +sub gen_examples { print "generating examples: \n"; foreach $a (@examples) { @@ -64,8 +61,7 @@ sub } -sub - gen_list +sub gen_list { print "generating HTML list\n"; open HTMLLIST, ">example_output.html"; @@ -85,14 +81,15 @@ sub print HTMLLIST ""; +
  • The output (PS)\n"; + + print HTMLLIST "
  • The output (MIDI)\n" + if ( -f $midif ); + print HTMLLIST ""; } close HTMLLIST; } -sub - copy_files +sub copy_files { print "copying files\n"; print `ln -s $depth/out ./docxx` if ( ! -x "docxx" ) ; @@ -101,6 +98,11 @@ sub system "cp ../lelie*gif ."; } +sub docxx_update +{ + system "make -C $depth doc++"; +} + sub do_tar { @@ -118,8 +120,10 @@ chomp($cwd = `pwd`); die "need to be in directory Documentation\n" if ( ! ($cwd =~ /Documentation$/)); chdir ("out"); + gen_html; gen_examples; gen_list; copy_files; +docxx_update; do_tar; diff --git a/configure b/configure index 437638ccfa..ee977f051b 100755 --- a/configure +++ b/configure @@ -22,7 +22,9 @@ ac_help="$ac_help ac_help="$ac_help enable-profiling compile with gprof support" ac_help="$ac_help - texprefix=DIR set the tex-directory to put the lilypond subdir in." + tex-prefix=DIR set the tex-directory to find TeX subdirectories." +ac_help="$ac_help + tex-dir=DIR set the directory to put LilyPond TeX files in." # Initialize some variables set by options. # The variables have the same names as the options, with @@ -545,6 +547,7 @@ debug_b=yes optimise_b=no profile_b=no #shared_b=no + # Check whether --enable-printing or --disable-printing was given. if test "${enable_printing+set}" = set; then enableval="$enable_printing" @@ -584,15 +587,24 @@ if test "${enable_profiling+set}" = set; then fi -# Check whether --enable-texprefix or --disable-texprefix was given. -if test "${enable_texprefix+set}" = set; then - enableval="$enable_texprefix" +# Check whether --enable-tex-prefix or --disable-tex-prefix was given. +if test "${enable_tex_prefix+set}" = set; then + enableval="$enable_tex_prefix" TEXPREFIX=$enableval else TEXPREFIX=auto fi - + +# Check whether --enable-tex-dir or --disable-tex-dir was given. +if test "${enable_tex_dir+set}" = set; then + enableval="$enable_tex_dir" + TEXDIR=$enableval +else + TEXDIR=auto +fi + + if test $profile_b = yes; then EXTRA_LIBES="-pg" DEFINES="$DEFINES -pg" @@ -612,6 +624,7 @@ fi if test $optimise_b = yes; then DEFINES="$DEFINES -O2 -DSTRING_UTILS_INLINED" fi + AUTOHEADER="This file was automatically generated by configure" CXXFLAGS=${CXXFLAGS:-""} # we don't want -g -O junk for ac_prog in $CCC c++ g++ gcc CC cxx cc++ @@ -619,7 +632,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:623: checking for $ac_word" >&5 +echo "configure:636: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -650,7 +663,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:654: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:667: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -660,11 +673,11 @@ ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $L cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -684,12 +697,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:688: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:701: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:693: checking whether we are using GNU C++" >&5 +echo "configure:706: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -698,7 +711,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:715: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -713,7 +726,7 @@ if test $ac_cv_prog_gxx = yes; then ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:717: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:730: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -743,7 +756,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:747: checking for $ac_word" >&5 +echo "configure:760: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -799,7 +812,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:803: checking for a BSD compatible install" >&5 +echo "configure:816: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -853,7 +866,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:857: checking for $ac_word" >&5 +echo "configure:870: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_FIND'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -884,8 +897,8 @@ test -n "$FIND" || FIND="error" if test FIND = error; then - echo "configure: warning: Couldn't find \`find'. Please use --enable-texprefix" 1>&2 -else + echo "configure: warning: Couldn't find \`find'. Please use --enable-tex-dir" 1>&2 +fi @@ -896,12 +909,13 @@ else + for ac_prog in bison do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:905: checking for $ac_word" >&5 +echo "configure:919: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -935,7 +949,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:939: checking for $ac_word" >&5 +echo "configure:953: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -969,7 +983,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:973: checking for $ac_word" >&5 +echo "configure:987: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1003,7 +1017,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1007: checking for $ac_word" >&5 +echo "configure:1021: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_PODMAN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1033,37 +1047,62 @@ done test -n "$PODMAN" || PODMAN="error" -if test $TEXPREFIX = auto ; then + +if test "x$TEXPREFIX" = xauto ; then + - # do something sensible if root hasn't specced dir yet attempts install - - echo $ac_n "checking TeX installation directory""... $ac_c" 1>&6 -echo "configure:1043: checking TeX installation directory" >&5 + echo $ac_n "checking TeX/MF root dir directory""... $ac_c" 1>&6 +echo "configure:1057: checking TeX/MF root dir directory" >&5 - ac_tmp_prefix=$prefix - test "x$ac_tmp_prefix" = xNONE && ac_tmp_prefix=$ac_default_prefix + find_root_prefix="$prefix" + - for texdir in $ac_tmp_prefix $ac_tmp_prefix/lib; do - if test -d $texdir/texmf; then - TEXTOP=$texdir/texmf - break - else - if test -d $texdir/tex; then - TEXTOP=$texdir/tex - break - fi + test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix" + find_texpostfix=""; + for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do + find_texprefix="$find_root_prefix$postfix" + if test -d $find_texprefix; then + find_texpostfix=$postfix + break; fi done - TEXPREFIX=$ac_tmp_prefix/lib/texmf/tex - if test x = "x$TEXTOP"; then - echo "configure: warning: Cannot determine a tex-directory. Please use --enable-texprefix" 1>&2 - else - TEXPREFIX=`$FIND $TEXTOP -type d -a -name tex -print |sort|head -1` + + if test "x$find_texpostfix" = x; then + find_texpostfix='/lib/texmf/tex' + echo "configure: warning: Cannot determine the TeX-directory. Please use --enable-tex-prefix" 1>&2 fi + + find_texprefix="$find_root_prefix/$find_texpostfix" + TEXPREFIX='${prefix}'/"$find_texpostfix" + + echo "$ac_t""$find_texprefix" 1>&6 + + +fi + +if test "x$TEXDIR" = xauto ; then + + + # do something sensible if root hasn't specced dir yet attempts install + test "x$find_texprefix" != x || find_texprefix="$TEXPREFIX" + + echo $ac_n "checking TeX tex input directory""... $ac_c" 1>&6 +echo "configure:1092: checking TeX tex input directory" >&5 + find_texdir=`(cd $find_texprefix; + $FIND -type d -a -name tex -print |sort|head -1|sed 's#^\./##')` + + + if test "x$find_texdir" = x; then + find_texdir="/tex"; + echo "configure: warning: Cannot determine the TeX-subdirectory. Please use --enable-tex-dir" 1>&2 + true fi + + TEXDIR="$TEXPREFIX/$find_texdir" + + echo "$ac_t""$find_texprefix/$find_texdir" 1>&6 - echo "$ac_t""$TEXPREFIX" 1>&6 fi @@ -1074,11 +1113,10 @@ else $MAKE -v| grep GNU > /dev/null if test "$?" = 1 then - echo "configure: warning: Please install *GNU* make" 1>&2 - fi -fi - - + echo "configure: warning: Please install *GNU* make" 1>&2 + fi +fi + if test $BISON = "error" then echo "configure: warning: can't find bison. Please install Bison (1.24 or better)" 1>&2 @@ -1102,7 +1140,7 @@ else fi echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 -echo "configure:1106: checking how to run the C++ preprocessor" >&5 +echo "configure:1144: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1115,12 +1153,12 @@ ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $L cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1162: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1140,17 +1178,17 @@ echo "$ac_t""$CXXCPP" 1>&6 ac_safe=`echo "FlexLexer.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for FlexLexer.h""... $ac_c" 1>&6 -echo "configure:1144: checking for FlexLexer.h" >&5 +echo "configure:1182: checking for FlexLexer.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1154: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1192: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1330,6 +1368,7 @@ s%@AUTOHEADER@%$AUTOHEADER%g s%@BISON@%$BISON%g s%@FLEX@%$FLEX%g s%@TEXPREFIX@%$TEXPREFIX%g +s%@TEXDIR@%$TEXDIR%g s%@EXTRA_LIBES@%$EXTRA_LIBES%g s%@MAKE@%$MAKE%g s%@PODMAN@%$PODMAN%g @@ -1552,7 +1591,7 @@ fi eval "DIR_DATADIR=$datadir" DIR_DATADIR="$DIR_DATADIR/lilypond" echo $ac_n "checking ""... $ac_c" 1>&6 -echo "configure:1556: checking " >&5 +echo "configure:1595: checking " >&5 cat << EOF > lib/out/config.hh diff --git a/configure.in b/configure.in index 17f737ab45..a2e61c2379 100644 --- a/configure.in +++ b/configure.in @@ -4,35 +4,56 @@ dnl Process this file with autoconf to produce a configure script. dnl should cache result. dnl should look in $prefix first. -AC_DEFUN(AC_TEX_SUBDIR, [ - - # do something sensible if root hasn't specced dir yet attempts install +AC_DEFUN(AC_TEX_PREFIX, [ + - AC_MSG_CHECKING(TeX installation directory) + AC_MSG_CHECKING(TeX/MF root dir directory) - ac_tmp_prefix=$prefix - test "x$ac_tmp_prefix" = xNONE && ac_tmp_prefix=$ac_default_prefix + find_root_prefix="$prefix" + - for texdir in $ac_tmp_prefix $ac_tmp_prefix/lib; do - if test -d $texdir/texmf; then - TEXTOP=$texdir/texmf - break - else - if test -d $texdir/tex; then - TEXTOP=$texdir/tex - break - fi + test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix" + find_texpostfix=""; + for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do + find_texprefix="$find_root_prefix$postfix" + if test -d $find_texprefix; then + find_texpostfix=$postfix + break; fi done - $1=$ac_tmp_prefix/lib/texmf/tex - if test x = "x$TEXTOP"; then - AC_MSG_WARN(Cannot determine a tex-directory. Please use --enable-texprefix) - else - $1=`$FIND $TEXTOP -type d -a -name tex -print |sort|head -1` + + if test "x$find_texpostfix" = x; then + find_texpostfix='/lib/texmf/tex' + AC_MSG_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix) fi + + find_texprefix="$find_root_prefix/$find_texpostfix" + $1='${prefix}'/"$find_texpostfix" + + AC_MSG_RESULT($find_texprefix) + +]) + +AC_DEFUN(AC_TEX_SUBDIR, [ + + # do something sensible if root hasn't specced dir yet attempts install + test "x$find_texprefix" != x || find_texprefix="$TEXPREFIX" + + AC_MSG_CHECKING(TeX tex input directory) + find_texdir=`(cd $find_texprefix; + $FIND -type d -a -name tex -print |sort|head -1|sed 's#^\./##')` + + + if test "x$find_texdir" = x; then + find_texdir="/tex"; + AC_MSG_WARN(Cannot determine the TeX-subdirectory. Please use --enable-tex-dir) + true fi + + $1="$TEXPREFIX/$find_texdir" + + AC_MSG_RESULT($find_texprefix/$find_texdir) - AC_MSG_RESULT($$1) ]) AC_INIT(flower/choleski.cc) @@ -45,6 +66,7 @@ debug_b=yes optimise_b=no profile_b=no #shared_b=no + AC_ARG_ENABLE(printing, [ enable-printing set debug printing], [printing_b=$enableval]) @@ -69,11 +91,16 @@ AC_ARG_ENABLE(profiling, [ enable-profiling compile with gprof support], [profile_b=$enableval]) -AC_ARG_ENABLE(texprefix, - [ texprefix=DIR set the tex-directory to put the lilypond subdir in.], +AC_ARG_ENABLE(tex-prefix, + [ tex-prefix=DIR set the tex-directory to find TeX subdirectories.], [TEXPREFIX=$enableval], [TEXPREFIX=auto] ) - + +AC_ARG_ENABLE(tex-dir, + [ tex-dir=DIR set the directory to put LilyPond TeX files in.], + [TEXDIR=$enableval], + [TEXDIR=auto] ) + if test $profile_b = yes; then EXTRA_LIBES="-pg" DEFINES="$DEFINES -pg" @@ -93,6 +120,7 @@ fi if test $optimise_b = yes; then DEFINES="$DEFINES -O2 -DSTRING_UTILS_INLINED" fi + dnl COMPILEINFO="$HOST $host $TARGET $target" AUTOHEADER="This file was automatically generated by configure" CXXFLAGS=${CXXFLAGS:-""} # we don't want -g -O junk @@ -103,8 +131,8 @@ AC_CHECK_PROGS(FIND, find, error) dnl should check out -print if test FIND = error; then - AC_MSG_WARN(Couldn't find \`find'. Please use --enable-texprefix) -else + AC_MSG_WARN(Couldn't find \`find'. Please use --enable-tex-dir) +fi AC_SUBST(CXX) AC_SUBST(DEFINES) @@ -113,6 +141,7 @@ AC_SUBST(AUTOHEADER) AC_SUBST(BISON) AC_SUBST(FLEX) AC_SUBST(TEXPREFIX) +AC_SUBST(TEXDIR) AC_SUBST(EXTRA_LIBES) AC_CHECK_PROGS(BISON, bison, error) @@ -120,8 +149,13 @@ AC_CHECK_PROGS(FLEX, flex, error) AC_CHECK_PROGS(MAKE, make, error) AC_CHECK_PROGS(PODMAN, pod2man, error) -if test $TEXPREFIX = auto ; then - AC_TEX_SUBDIR(TEXPREFIX) + +if test "x$TEXPREFIX" = xauto ; then + AC_TEX_PREFIX(TEXPREFIX) +fi + +if test "x$TEXDIR" = xauto ; then + AC_TEX_SUBDIR(TEXDIR) fi if test $MAKE = "error" @@ -131,11 +165,10 @@ else $MAKE -v| grep GNU > /dev/null if test "$?" = 1 then - AC_MSG_WARN(Please install *GNU* make) - fi -fi - - + AC_MSG_WARN(Please install *GNU* make) + fi +fi + if test $BISON = "error" then AC_MSG_WARN(can't find bison. Please install Bison (1.24 or better)) diff --git a/flower/.version b/flower/.version index 53a4af6a08..8b50ae31c5 100644 --- a/flower/.version +++ b/flower/.version @@ -1,6 +1,6 @@ MAJOR_VERSION = 1 MINOR_VERSION = 1 -PATCH_LEVEL = 11 +PATCH_LEVEL = 12 # 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 1f489e042f..d0c64e59dd 100644 --- a/flower/NEWS +++ b/flower/NEWS @@ -1,3 +1,6 @@ +pl 1.1.11.jcn1 + - No path search for "" and "-" + pl 1.1.11 - template<> class P - assoc elem() methods diff --git a/flower/include/interval.hh b/flower/include/interval.hh index 57f6a5607a..1c3c6588c0 100644 --- a/flower/include/interval.hh +++ b/flower/include/interval.hh @@ -12,9 +12,10 @@ #include "real.hh" -/** a T interval. - this represents the closed interval [left,right]. - No invariants. T must be a totally ordered ring +/** a T interval. this represents the closed interval [left,right]. + No invariants. T must be a totally ordered ring (with division, anyway ..) + At instantiation, the function infinity() has to be defined explicitely. + */ template struct Interval_t { @@ -22,6 +23,8 @@ struct Interval_t { /* ************** */ + static T infinity() ; + T center() { return (left + right) / T(2);} void translate(T t) { left += t; @@ -56,6 +59,7 @@ struct Interval_t { T length() const; void set_empty() ; bool empty_b() const { return left > right; } + bool contains_b(Interval_t const&) const; Interval_t() { set_empty(); } diff --git a/flower/include/interval.tcc b/flower/include/interval.tcc index 32eec44580..49be704608 100644 --- a/flower/include/interval.tcc +++ b/flower/include/interval.tcc @@ -20,6 +20,15 @@ _Interval__compare(const Interval_t&a,Interval_t const&b) return -2; } +template +bool +Interval_t::contains_b(Interval_t const& a)const +{ + int c_i= _Interval__compare( *this, a); + if (c_i == -2) + return false; + return c_i >= 0; +} template int @@ -31,18 +40,12 @@ Interval__compare(const Interval_t&a,Interval_t const&b) return i; } -#ifdef AIX -const Real INFTY = 1e8; // ARGh. AIX sucks -#else -const Real INFTY = HUGE_VAL; -#endif - template void Interval_t::set_empty() { - left = INFTY; - right = -INFTY; + left = (T) infinity(); + right = (T) -infinity(); } template diff --git a/flower/interval.cc b/flower/interval.cc new file mode 100644 index 0000000000..1db78d8dbf --- /dev/null +++ b/flower/interval.cc @@ -0,0 +1,19 @@ +/* + interval.cc -- instantiate Interval_t + + source file of the Flower Library + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "interval.hh" +#include "real.hh" +#include "interval.tcc" + +Interval__instantiate(Real); + +Real +Interval_t::infinity() +{ + return HUGE; +} diff --git a/flower/path.cc b/flower/path.cc index a0bbaca44f..3a2e5dfbc0 100644 --- a/flower/path.cc +++ b/flower/path.cc @@ -65,6 +65,8 @@ File_path::find(String nm)const { fdebug << "looking for " << nm ; + if ( !nm.length_i() || ( nm == "-" ) ) + return nm; for (int i=0; i < size(); i++) { String path = (*this)[i]; diff --git a/init/register.ini b/init/register.ini index e5822087ba..4168de973d 100644 --- a/init/register.ini +++ b/init/register.ini @@ -8,6 +8,7 @@ melodicregs = \inputregister { \inputregister {Meter_register} \inputregister {Local_key_register} \inputregister { Staff_sym_register } + \inputregister { Collision_register } \inputregister { Voice_group_registers \inputregister { Dynamic_register } diff --git a/init/symbol.ini b/init/symbol.ini index c707ec2e46..872133bd03 100644 --- a/init/symbol.ini +++ b/init/symbol.ini @@ -1,4 +1,4 @@ -\version "0.0.50"; +\version "0.0.52"; include "register.ini" include "dynamic.ini" diff --git a/input/collisions.ly b/input/collisions.ly new file mode 100644 index 0000000000..6cc9992383 --- /dev/null +++ b/input/collisions.ly @@ -0,0 +1,54 @@ +% test the Collision resolution + +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 } + { \stem 1; + g f e g ()g2 g2 } + + > +} + +three_voice = \melodic { + < \multivoice + { \stem 1; + g f e f g a g2 } + { \hshift 1; \stem 1; + e2 e2 e2 e2 } + { \stem -1; + c d e d c d es } + > +} + +rests = \melodic { + < \multivoice + { \stem 1;\duration "last"; + r8 r r r r r r r + [c' b a g] [f e d c] + } + { \stem -1; + [c8 d e f] [g a b c'] + r r r r r r r r r + } + > +} +\score{ + \staff{ melodicregs + \melodic { \$two_voice ++ \$two_voice_steminvert + ++ \$three_voice ++ \rests + } + } + \paper {} +% \midi { \tempo 4:80 } +} diff --git a/input/kortjakje.ly b/input/kortjakje.ly index 86797c682c..6386743fb3 100644 --- a/input/kortjakje.ly +++ b/input/kortjakje.ly @@ -8,6 +8,7 @@ % copyright: None % % declare melody (which will be in *one* staff ) for the lead voice +\version "0.0.52"; melodie = \melodic { % switch Lilypond in note-mode diff --git a/input/scsii-menuetto.ly b/input/scsii-menuetto.ly index 12183e79e7..353c436c1f 100644 --- a/input/scsii-menuetto.ly +++ b/input/scsii-menuetto.ly @@ -11,7 +11,7 @@ % The purpose of this file is to demonstrate features of LilyPond. % (there is an accompanying LaTeX file, scsii-menuetto.tex) % -\version "0.0.50"; +\version "0.0.52"; %% Stuff from MPP version % \lefttitle{Menuetto} % \tempo{Moderato} @@ -58,7 +58,7 @@ ii_menuetto = \melodic{ < [ e' g > d' cis'_"2" e' a( )g ] | %%11 < \multivoice - {\stem 1; a4(\stem 1;) d'4 cis'4-. } + {\stem 1; a4() d'4 cis'4-. } { \stem -1; f2 e4 } > | %%12 < [ g'^"4" d > f' e' f' d'^"3"( ) c' ] | @@ -66,7 +66,7 @@ ii_menuetto = \melodic{ \clef "alto"; < \multivoice { \stem 1; bes2 c'4 } - { \stem -1; g4(\stem -1;) f4 e4 }% ugh + { \stem -1; g4() f4 e4 }% ugh > | %%14 < [ a f > g a f ] < d'4-\upbow e4 'bes4 > | diff --git a/input/standchen.ly b/input/standchen.ly index 4514ff8788..3ef0773f38 100644 --- a/input/standchen.ly +++ b/input/standchen.ly @@ -134,10 +134,10 @@ melodie = \melodic{ [ e' \f( )dis' e' ]2/3 g'4.^> cis' | %%48 \textstyle "italic"; - < \multivoice { - \stem 1 ; fis2.( - | \stem -1 ; )f2. } - { \stem 1 ; d'2.( | \stem 1 ; )d'4 r4_"decresc." d'4 } > + < + { fis2.( \group "+1"; \stem -1; )f2. } + { d'2. ( \stem 1 ; )d'4 r4_"decresc." d'4 } + > \textstyle "roman"; | %%50 < bes2. e2. > | @@ -182,66 +182,67 @@ begeleiding = \melodic{ ''a r4 | %%5 \duration 8 ; - < \multivoice { \stem 1 ; [ 'f 'a d 'a d 'a ] } - { \stem -1 ; 'd2 r4 } > | -%%6 - < \multivoice { \stem 1 ; [ 'd 'e 'g 'e 'g 'e ] } - { \stem -1 ; ''bes2 r4 } > | -%%7 - < \multivoice { \stem 1 ; [ 'cis 'e 'g 'e 'g e ] } - { \stem -1 ; ''a2 r4 } > | - %%8 - < \multivoice { \stem 1 ; [ 'd 'a d 'a d 'a ] } - { \stem -1 ; 'd2 r4 } > | + < \multivoice { \stem 1 ; + [ 'f 'a d 'a d 'a ] + [ 'd 'e 'g 'e 'g 'e ] + [ 'cis 'e 'g 'e 'g e ] + [ 'd 'a d 'a d 'a ] + } + { \stem -1; + 'd2 r4 + ''bes2 r4 + ''a2 r4 + 'd2 r4 + } > %%9 [ 'a e g e g e ] | %%10 [ 'd 'a d 'a d 'a ] | %%11 - < \multivoice { \stem 1 ; [ 'f 'a d 'a d 'a ] } - { \stem -1 ; 'd2 r4 } > | -%%12 == 6 - < \multivoice { \stem 1 ; [ 'd 'e 'g 'e 'g 'e ] } - { \stem -1 ; ''bes2 r4 } > | -%13 - < \multivoice { [ 'e 'g 'bes 'g 'bes 'g ] } - { \stem -1 ; 'c2 r4 } > | -%%14 - < \multivoice { \stem 1 ; [ 'a c f c f c ] } - { \stem -1 ; 'f2 r4 } > | + < \multivoice + { \stem 1 ; + [ 'f 'a d 'a d 'a ] + [ 'd 'e 'g 'e 'g 'e ] + [ 'e 'g 'bes 'g 'bes 'g ] + [ 'a c f c f c ] + } { \stem -1; + 'd2 r4 + ''bes2 r4 + 'c2 r4 + 'f2 r4 } + > %%15 [ 'c 'g 'bes 'g 'bes 'g ] | %%16 [ ''f 'c 'f 'c 'f 'c ] | -%%17 - < \multivoice { \stem 1 ; [ ''a 'e 'g 'e 'g 'e ] } - { \stem -1 ; ''a2 r4 } > | -%%18 - < \multivoice { \stem 1 ; [ 'd 'a d 'a d 'a ] } - { \stem -1 ; 'd2 r4 } > | -%%19 - < \multivoice { \stem 1 ; [ ''bes 'f 'bes 'f 'bes 'f ] } - { \stem -1 ; ''bes2 r4 } > | -%%20 - < \multivoice { \stem 1 ; [ ''f 'c 'f 'c 'f 'c ] } - { \stem -1 ; ''f2 r4 } > | + < \multivoice + { \stem 1; + [ ''a 'e 'g 'e 'g 'e ][ 'd 'a d 'a d 'a ] + [ ''bes 'f 'bes 'f 'bes 'f ][ ''f 'c 'f 'c 'f 'c ] } + { \stem -1; + ''a2 r4 + 'd2 r4 + ''bes2 r4 + ''f2 r4 + } > %%21 < [ 'e 'c > 'g c 'g c 'g ] | %%22 [ 'f 'a c 'a 'f 'c ] | -%%23 - < \multivoice { \stem 1 ; [ ''a 'e 'g 'e 'g 'e ] } - { \stem -1 ; ''a2 r4 } > | -%%24 - < \multivoice { \stem 1 ; [ 'd 'fis 'a 'fis 'a 'fis ] } - { \stem -1 ; 'd2 r4 } > | -%%25 - < \multivoice { \stem 1 ; [ ''g 'd 'b 'd 'b 'd ] } - { \stem -1 ; ''g2 r4 } > | -%%26 - < \multivoice { \stem 1 ; [ 'd 'a d 'a d 'a ] } - { \stem -1 ; 'd2 r4 } > | -%%27 + < \multivoice { + \stem 1; + [ ''a 'e 'g 'e 'g 'e ] + [ 'd 'fis 'a 'fis 'a 'fis ] + [ ''g 'd 'b 'd 'b 'd ] + [ 'd 'a d 'a d 'a ] + } + {\stem -1; + ''a2 r4 + 'd2 r4 + ''g2 r4 + 'd2 r4 + } + > < [ 'cis ''a > 'e 'a 'e 'a 'e ] | %%28 [ 'd 'a d 'a d 'a ] | @@ -280,11 +281,15 @@ begeleiding = \melodic{ %%44 < [ 'd ''b > 'fis 'b 'fis 'b 'fis ] | %%45 - < \multivoice { \stem 1 ; [ ''g 'd 'b 'd 'b 'd ] } - { \stem -1 ; ''g2 r4 } > | -%%46 - < \multivoice { \stem 1 ; [ 'd 'a d 'a d 'a ] } - { \stem -1 ; 'd2 r4 } > | + < \multivoice { \stem 1; + [ ''g 'd 'b 'd 'b 'd ] + [ 'd 'a d 'a d 'a ] + } { + \stem -1; + ''g2 r4 + 'd2 r4 + } > + %%47 < [ 'cis ''a > 'e 'a 'e 'a 'e ] | %%48 @@ -444,7 +449,10 @@ tekstII = \lyric{ } \score{ - \staff{ lyricregs tekstI tekstII } + \staff{ lyricregs tekstI } +% sorry. Have to fix +% \staff{ lyricregs tekstII } + \staff{ melodicregs melodie } \staff{ melodicregs begeleiding } \paper{ diff --git a/input/wohltemperirt.ly b/input/wohltemperirt.ly index 45f6381820..3676e36eaf 100644 --- a/input/wohltemperirt.ly +++ b/input/wohltemperirt.ly @@ -2,7 +2,7 @@ % % Public Domain -- typed by by HWN % -\version "0.0.50"; +\version "0.0.52"; global = \melodic{ \meter 4/4 ; @@ -16,7 +16,7 @@ dux = \melodic { \duration \last ; \stem -1; - r8-"dux" + 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'] | @@ -60,7 +60,7 @@ comes = \melodic { \stem 1; r1 | r1 | - r8-"comes" [g16 fis] [g8 c] [es g16 f] [g8 a]| + 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( | diff --git a/lib/source-file.cc b/lib/source-file.cc index fe56cb3551..8f28f9b5f5 100644 --- a/lib/source-file.cc +++ b/lib/source-file.cc @@ -33,13 +33,15 @@ Source_file::Source_file( String filename_str ) istream_p_ = 0; open(); - map(); + if ( fildes_i_ > 0 ) + map(); } istream* Source_file::istream_l() { - assert( fildes_i_ ); + if ( !fildes_i_ ) + return &cin; if ( !istream_p_ ) { if ( size_off_ ) // can-t this be done without such a hack? istream_p_ = new istrstream( ch_C(), size_off_ ); @@ -165,6 +167,11 @@ Source_file::name_str() void Source_file::open() { + if ( !name_str_.length_i() || ( name_str_ == "-" ) ) { + fildes_i_ = 0; + return; + } + fildes_i_ = ::open( name_str_, O_RDONLY ); if ( fildes_i_ == -1 ) { diff --git a/lib/source.cc b/lib/source.cc index 3247c8d82c..8901c8f793 100644 --- a/lib/source.cc +++ b/lib/source.cc @@ -26,17 +26,18 @@ Sources::set_path(File_path *f_C) open a file @param file_str the file to be opened, name might be changed if it - is found in a search path. + is found in a search path. UGH! @return 0 if no file found */ Source_file* -Sources::get_file_l(String &file_str ) +Sources::get_file_l(String &file_str ) //UGH { if (path_C_){ - file_str = path_C_->find(file_str); - if (file_str== "") + String file_str_o = path_C_->find(file_str); + if ( ( file_str_o == "" ) && ( file_str != "" ) ) return 0; + file_str = file_str_o; } Source_file * f_p= (!binary_b_) ? new Source_file(file_str) : new Binary_source_file(file_str); diff --git a/lib/warn.cc b/lib/warn.cc index 51907b6a3b..9fdf7219a1 100644 --- a/lib/warn.cc +++ b/lib/warn.cc @@ -13,7 +13,7 @@ error(String s) void warning(String m) { - cerr << "warning" <lookup_l()->clef(t); diff --git a/lily/collision-reg.cc b/lily/collision-reg.cc new file mode 100644 index 0000000000..954b999a24 --- /dev/null +++ b/lily/collision-reg.cc @@ -0,0 +1,39 @@ +/* + collision-reg.cc -- implement Collision_register + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "note-column.hh" +#include "collision-reg.hh" +#include "collision.hh" + +void +Collision_register::acknowledge_element(Staff_elem_info i) +{ + if (!(i.elem_l_->name() == Note_column::static_name())) + return; + + if (!col_p_) + col_p_ = new Collision; + + col_p_->add((Note_column*)i.elem_l_); +} + +void +Collision_register::pre_move_processing() +{ + if (col_p_) { + typeset_element(col_p_); + col_p_ =0; + } +} +Collision_register::Collision_register() +{ + col_p_ =0; +} + +IMPLEMENT_STATIC_NAME(Collision_register); +ADD_THIS_REGISTER(Collision_register); diff --git a/lily/collision.cc b/lily/collision.cc new file mode 100644 index 0000000000..2fbb0d8018 --- /dev/null +++ b/lily/collision.cc @@ -0,0 +1,151 @@ +/* + collision.cc -- implement Collision + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ +#include "debug.hh" +#include "collision.hh" +#include "note-column.hh" +#include "notehead.hh" +#include "paper-def.hh" + +Collision::Collision() +{ +} + +void +Collision::add(Note_column* ncol_l) +{ + clash_l_arr_.push(ncol_l); + add_dependency(ncol_l); +} +static +int idx(int dir, bool h_shift_b) +{ + assert(abs (dir) == 1); + int j = dir > 0 ? 0 : 3; + if ( h_shift_b ) + j += dir; + return j; +} + +/** This complicated routine moves note columns around horizontally + (and rests vertically) to ensure that notes don't clash. + + This should be done better, probably. + + This routine is dedicated to Stine Randmael :-) + + */ +void +Collision::do_pre_processing() +{ + if (clash_l_arr_.size() <= 1) + return; + + /* + [stem up, stem up shifted, stem down shifted, stem down] + */ + Array clash_group_arr_a[4]; + + for (int i=0; i < clash_l_arr_.size(); i++) { + Note_column* c_l = clash_l_arr_[i]; + int d = (c_l->dir_i_); + + clash_group_arr_a[idx(d, c_l->h_shift_b_)].push(c_l); + } + + for (int j=0; j < 4; j++) { + if (clash_group_arr_a[j].size() > 1) { + warning("Too many clashing notecolumns. Ignoring them."); + return; + } + } + int d = 1; + do { + if (!clash_group_arr_a[idx(d, false)].size()){ + clash_group_arr_a[idx(d, false)] = clash_group_arr_a[idx(d, true)]; + clash_group_arr_a[idx(d, true)].set_size(0); + } + } while ((d *= -1) != 1); + + + Interval_t y_extent[4]; + Note_column * col_l_a[4]; + Real x_off [4]; + int y_off[4]; + bool rest_b_a[4]; + + for (int j =0 ; j < 4; j++) { + if (clash_group_arr_a[j].size()) + col_l_a[j] = clash_group_arr_a[j][0]; + else + col_l_a[j] = 0; + + if (col_l_a[j]) { + y_extent[j] = col_l_a[j]->head_positions_interval(); + } + + rest_b_a[j] = (col_l_a[j]) ? col_l_a[j]->rest_b_ : false; + x_off [j] = 0.0; + y_off[j] = 0; + } + + do { + x_off[idx(d, true)] = d*0.5; + } while ((d *= -1) != 1); + + do { + int i1 = idx(d, false); + int i2 = idx(d,true); + if (!intersection(y_extent[i1] , + y_extent[i2]).empty_b()) { + if (rest_b_a[i1]) { + y_off[i1] = -y_extent[i1][-d] + y_extent[1][d] + d*4; // ugh + y_extent[i1] += y_off[i1]; + } + } + } while ((d *= -1) != 1); + + do { + int i1 = idx(d, false); + int i2 = idx(-d,false); + + if (d*(y_extent[i1][-d] - y_extent[i2][d] )< 0&& rest_b_a[i1]) { + y_off[i1] = -y_extent[i1][-d] + y_extent[i2][d] +d* 4; // ugh + y_extent[i1] += y_off[i1]; + } + } while ((d *= -1) != 1); + + 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); + 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() <= 1 && col_l_a[idx(1,0)] && col_l_a[idx(-1,0)] + && !rest_b_a[idx(1,0)] && !rest_b_a[idx(-1,0)]) { + + Notehead * nu_l= col_l_a[idx(1,0)]->head_l_arr_[idx(1,0)]; + Notehead * nd_l = col_l_a[idx(-1,0)]->head_l_arr_[idx(1,0)]; + if (! (nu_l->balltype == nd_l->balltype && nu_l->dots == nd_l->dots)) { + x_off[idx(1,0)] -= 0.5; + x_off[1] -= 0.5; + x_off[2] += 0.5; + x_off[idx(-1,0)] += 0.5; + } + } + Real inter_f = paper()->internote(); + Real wid_f = paper()->note_width(); + for (int j=0; j < 4; j++) { + if (col_l_a[j]) + col_l_a[j]->translate(Offset(x_off[j] * wid_f, + y_off[j] * inter_f)); + + } +} +IMPLEMENT_STATIC_NAME(Collision); diff --git a/lily/command-request.cc b/lily/command-request.cc index 55ccf54c27..e4334f1d69 100644 --- a/lily/command-request.cc +++ b/lily/command-request.cc @@ -88,15 +88,10 @@ void Group_feature_req::do_print() const { #ifndef NPRINT - mtor << "stemdir " << stemdir_i_; + mtor << type_str_ << "=" << value_str_; #endif } -Group_feature_req::Group_feature_req() -{ - stemdir_i_ = 0; -} - IMPLEMENT_STATIC_NAME(Group_change_req); void diff --git a/lily/dynamic-reg.cc b/lily/dynamic-reg.cc index 59de609437..11a74756a7 100644 --- a/lily/dynamic-reg.cc +++ b/lily/dynamic-reg.cc @@ -117,9 +117,10 @@ Dynamic_register::acceptable_request_b(Request*r)const } void -Dynamic_register::set_feature(Features i) +Dynamic_register::set_feature(Feature i) { - dir_i_ = i.direction_i_; + if (i.type_ == "vdir") + dir_i_ = i.value_; } IMPLEMENT_STATIC_NAME(Dynamic_register); diff --git a/lily/head-reg.cc b/lily/head-reg.cc index fd84da6974..a0a5676a74 100644 --- a/lily/head-reg.cc +++ b/lily/head-reg.cc @@ -13,7 +13,6 @@ Notehead_register::Notehead_register() { note_p_ = 0; - set_feature(Features::dir(0)); post_move_processing(); } @@ -27,12 +26,6 @@ Notehead_register::try_request(Request *req_l) return true; } -void -Notehead_register::set_feature(Features d) -{ - if(d.direction_i_ || d.initialiser_b_) - dir_i_ = d.direction_i_; -} void Notehead_register::process_requests() @@ -63,9 +56,6 @@ void Notehead_register::pre_move_processing() { if (note_p_) { - if (dir_i_ && note_p_->rest_b_ ) { - note_p_->position +=4*dir_i_ ; - } typeset_element(note_p_); note_p_ = 0; } diff --git a/lily/include/clef-item.hh b/lily/include/clef-item.hh index 341204f8ea..d0e29994ef 100644 --- a/lily/include/clef-item.hh +++ b/lily/include/clef-item.hh @@ -9,21 +9,25 @@ #define CLEFITEM_HH #include "item.hh" - -struct Clef_item : Item { - String type; +/** + Set a clef in a staff. + */ +class Clef_item : public Item { +protected: + Molecule* brew_molecule_p()const; +public: + + String type_; int y_off; /// is this a change clef (smaller size)? bool change; - /* *************** */ NAME_MEMBERS(Clef_item); Clef_item(); void read(Clef_register const&); void read(String); - Molecule* brew_molecule_p()const; }; #endif // CLEFITEM_HH diff --git a/lily/include/collision-reg.hh b/lily/include/collision-reg.hh new file mode 100644 index 0000000000..31de018f46 --- /dev/null +++ b/lily/include/collision-reg.hh @@ -0,0 +1,25 @@ +/* + collision-reg.hh -- declare Collision_register + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef COLLISION_REG_HH +#define COLLISION_REG_HH + +#include "register.hh" + +class Collision_register : public Request_register { + Collision* col_p_; + +protected: + virtual void acknowledge_element(Staff_elem_info); + virtual void pre_move_processing(); +public: + Collision_register(); + NAME_MEMBERS(Collision_register); +}; +#endif // COLLISION_REG_HH diff --git a/lily/include/collision.hh b/lily/include/collision.hh new file mode 100644 index 0000000000..844496a855 --- /dev/null +++ b/lily/include/collision.hh @@ -0,0 +1,25 @@ +/* + collision.hh -- declare Collision + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef COLLISION_HH +#define COLLISION_HH +#include "lily-proto.hh" +#include "item.hh" + +class Collision : public Item { + Array clash_l_arr_; +protected: + virtual void do_pre_processing(); +public: + NAME_MEMBERS(Collision); + void add (Note_column*ncol_l); + Collision(); + +}; +#endif // COLLISION_HH diff --git a/lily/include/command-request.hh b/lily/include/command-request.hh index 3c257b67f1..9cf88dcafc 100644 --- a/lily/include/command-request.hh +++ b/lily/include/command-request.hh @@ -108,8 +108,9 @@ public: class Group_feature_req : public Command_req { public: - int stemdir_i_; - Group_feature_req(); + String type_str_; + String value_str_; + REQUESTMETHODS(Group_feature_req, groupfeature); }; diff --git a/lily/include/dynamic-reg.hh b/lily/include/dynamic-reg.hh index b0f8b1a437..c56805d07d 100644 --- a/lily/include/dynamic-reg.hh +++ b/lily/include/dynamic-reg.hh @@ -31,7 +31,7 @@ protected: virtual void pre_move_processing(); virtual void post_move_processing(); virtual bool acceptable_request_b(Request*) const; - virtual void set_feature(Features); + virtual void set_feature(Feature); }; #endif // DYNAMIC_REG_HH diff --git a/lily/include/head-reg.hh b/lily/include/head-reg.hh index 188db10a26..09941a0554 100644 --- a/lily/include/head-reg.hh +++ b/lily/include/head-reg.hh @@ -12,7 +12,6 @@ struct Notehead_register : Request_register { Notehead* note_p_; Rhythmic_req * note_req_l_; - int dir_i_; /* *************** */ Notehead_register(); @@ -20,7 +19,6 @@ struct Notehead_register : Request_register { virtual void process_requests(); virtual void pre_move_processing(); virtual void post_move_processing(); - void set_feature(Features); NAME_MEMBERS(Notehead_register); }; diff --git a/lily/include/item.hh b/lily/include/item.hh index 3a1efa36c7..cae928961f 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -25,7 +25,7 @@ public: virtual Item *item() { return this; } Item(); void do_print()const; - + Real hpos_f() const; NAME_MEMBERS(Item); }; diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index abe556db86..3864ace146 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -27,6 +27,7 @@ struct Decresc_req; struct Durational_req; struct Dynamic_req; struct Group_change_req; +struct Feature; struct Group_feature_req; struct Key_change_req; struct Lyric_req; @@ -35,6 +36,8 @@ struct Measure_grouping_req; struct Meter_change_req; struct Musical_req; struct Command_req; +struct Collision_register; +struct Collision; struct Note_req; struct Plet_req; struct Partial_measure_req; diff --git a/lily/include/note-column-reg.hh b/lily/include/note-column-reg.hh index 01a860911d..ddcbdae2f5 100644 --- a/lily/include/note-column-reg.hh +++ b/lily/include/note-column-reg.hh @@ -14,9 +14,12 @@ class Note_column_register :public Request_register { Note_column *ncol_p_; + bool h_shift_b_; + int dir_i_; /* *************** */ bool acceptable_elem_b(Staff_elem const*)const; protected: + virtual void set_feature(Feature); virtual void acknowledge_element(Staff_elem_info); virtual void pre_move_processing(); diff --git a/lily/include/note-column.hh b/lily/include/note-column.hh index b5d71798b3..b6562ed83b 100644 --- a/lily/include/note-column.hh +++ b/lily/include/note-column.hh @@ -10,28 +10,35 @@ #ifndef NOTE_COLUMN_HH #define NOTE_COLUMN_HH #include "item.hh" +#include "interval.hh" -/** - a struct for treating a group of noteheads (noteheads, stem, scripts ) - as a single entity. - */ +/** a struct for treating a group of noteheads (noteheads, stem + (chord) and scripts ) as a single entity. */ class Note_column : public Item { - Stem * stem_l_; - Array head_l_arr_; - Array