From: fred Date: Sun, 24 Mar 2002 20:04:28 +0000 (+0000) Subject: lilypond-0.1.39 X-Git-Tag: release/1.5.59~3509 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3d9d125c5f2373e817df6a413ed93a336c6a8854;p=lilypond.git lilypond-0.1.39 --- diff --git a/.dstreamrc b/.dstreamrc index 636a2a37df..69b2d30c72 100644 --- a/.dstreamrc +++ b/.dstreamrc @@ -13,6 +13,8 @@ InitLexer 1 Lexer 1 +walking 1 + # flower lib File_path 1 Matrix 1 diff --git a/ANNOUNCE b/ANNOUNCE index 9f7d6e2e37..6bdaf16333 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,45 +1,14 @@ -Keywords: midi notation music typesetting gnu -Subject: LilyPond 0.1 released - The GNU Project music typesetter - - BORN - - August 1, 1997 - - Lily - - (GNU LilyPond 0.1) - - daughter to Jan 'Janneke' Nieuwenhuizen and Han-Wen 'Wendy' Nienhuys - -Lily is a healthy, bouncing baby weighing 345 kilobytes - -Visiting hours: 24 hours a day at - - ftp://pcnov095.win.tue.nl/pub/lilypond/lilypond-0.1.0.tar.gz (Europe) - ftp://alpha.gnu.ai.mit.edu/gnu/lilypond-0.1.0.tar.gz (US) - -You can see some babyfood, diapers and pictures at - - http://www.stack.nl/~hanwen/lilypond/index.html - -You can send your congratulations to Janneke (jan@digicash.com) and -Wendy (hanwen@stack.nl) - +Keywords: midi notation music typesetting gnu font +Subject: LilyPond 0.2 released - The GNU Project music typesetter GNU LilyPond - The GNU Project Music Typesetter - ``WHAT IS GNU LilyPond?'' -Well Mike, GNU LilyPond is a program which converts music definition -files into visual or auditive output: it can typeset formatted sheet -music to a TeX file and (mechanical) performances to MIDI files. - - -We have been working very hard on this system for the past year, and -we finally think that it is ready to be used and hacked at by a larger -public than us. +GNU LilyPond is the GNU Project Music typesetter: it reads a music +definition file and outputs formatted sheet music to a TeX file or +(mechanical) performances to MIDI files. WHY ? @@ -48,48 +17,31 @@ We want to create tools to produce production quality scores and parts of public domain music. -BUT .. - -We haven't yet reached that goal: - -* The quality of the output isn't good enough yet due to some -unsophisticated algorithms - -* Some features haven't been implemented, due to lack of time; most of -them can be done quite simply +WHAT'S NEW -This is why we don't consider this software stable yet. It generally -does what it is supposed to, but we reserve the right to make -(incompatible) changes to the input format. We consider it -of BETA quality. +* LilyPond now includes a completely rewritten font: the Feta font. +We did our best to copy the best symbol designs available and We're +proud of the result. We hope you agree, so go check it out! +* More elegant output due to -WE WANT YOU! + * better spacing + * better breaking + * better font design + * PostScript output for variable symbols. -You can become a user, but we'd really appreciate it if you would start -hacking at Lily, and help us advance our project more quickly. +* Lots of bugfixes +* More robust, flexible, tweakable design -``YES, IT IS FANTASTIC! WHAT DO I NEED?'' +* Better MIDI importing -For compilation you need +* Easier to use due to better scripts and input format enhancements. - Unix. (windows32 is known to work, too) - GNU C++ v2.7 or better, with libg++ installed. - GNU make. - Flex (2.5.1 or better). - Bison. (1.25 or better) +* MusixTeX not needed anymore -For running you need - TeX - MusiXTeX fonts - -The MusiXTeX fonts are part of the MusiXTeX package version T.73, -available at any CTAN mirror, or http://www.gmd.de/Misc/Music/ - - -``WHAT CAN LILYPOND DO?'' +WHAT CAN LILYPOND DO? ASCII script input (mudela), with identifiers (for music reuse), customizable notenames. @@ -110,56 +62,14 @@ changes, cadenza-mode, key changes, repeat bars. Integration with LaTeX through Perl scripts. -``WHERE CAN I FIND MORE INFO?'' +MORE INFO Sources for this project are on ftp://pcnov095.win.tue.nl/pub/lilypond/ (Europe) - ftp://alpha.gnu.ai.mit.edu/gnu/ (US) + ftp://alpha.gnu.org/gnu/ (US) More detailed info and examples can be found on the webpage at http://www.stack.nl/~hanwen/lilypond/index.html - -THANK YOU, - -Thanks go out to Mats Bengtsson, Werner Lemberg and Richard Stallman -for comments and contributions. - - -**** NOTE - -LilyPond might have a minor bug if you use glibc-2; we will look into it -If you use glibc-2, please try 0.1.0 to see if it works and, download 0.1.1 -when it's available. - -LilyPond might exhibit a g++ bug on Solaris 1.5 (The stack frame gets corrupted -by a constructor) if you compile with -O2. We don't know workarounds. - - --- * --- - - We would like to dedicate this program to all the friends that we - met through music. - - - Those deserving special mention (in no particular order): -Esther, Marijke, Heike, Inge, Judith, Hannah, Auke, Ilse, Evelyn, -Maartje, Suzanne, Ilse (gee, again?) and last (but certainly not least) -Janneke! - - HWN - - That's a nice thought, Wendy. I've got a few too, to spread -the credits a bit (Again, no particular order) Michelle, Illushka, -Ruth, Eva, Fro/ydis, Monique, Noor, Sascha, Monique, Ilse, Monique, -Eva, Roos, Judith, Tim and, of course, Wendy! - - JCN - - -Of course, our other friends in the `Eindhovens Jongeren Ensemble' -(http://www.stack.nl/~hanwen/eje.html) cannot go unmentioned either. - - - --- * --- diff --git a/ANNOUNCE-0.1 b/ANNOUNCE-0.1 new file mode 100644 index 0000000000..9f7d6e2e37 --- /dev/null +++ b/ANNOUNCE-0.1 @@ -0,0 +1,165 @@ +Keywords: midi notation music typesetting gnu +Subject: LilyPond 0.1 released - The GNU Project music typesetter + + BORN + + August 1, 1997 + + Lily + + (GNU LilyPond 0.1) + + daughter to Jan 'Janneke' Nieuwenhuizen and Han-Wen 'Wendy' Nienhuys + +Lily is a healthy, bouncing baby weighing 345 kilobytes + +Visiting hours: 24 hours a day at + + ftp://pcnov095.win.tue.nl/pub/lilypond/lilypond-0.1.0.tar.gz (Europe) + ftp://alpha.gnu.ai.mit.edu/gnu/lilypond-0.1.0.tar.gz (US) + +You can see some babyfood, diapers and pictures at + + http://www.stack.nl/~hanwen/lilypond/index.html + +You can send your congratulations to Janneke (jan@digicash.com) and +Wendy (hanwen@stack.nl) + + +GNU LilyPond - The GNU Project Music Typesetter + + + +``WHAT IS GNU LilyPond?'' + +Well Mike, GNU LilyPond is a program which converts music definition +files into visual or auditive output: it can typeset formatted sheet +music to a TeX file and (mechanical) performances to MIDI files. + + +We have been working very hard on this system for the past year, and +we finally think that it is ready to be used and hacked at by a larger +public than us. + + +WHY ? + +We want to create tools to produce production quality scores and parts +of public domain music. + + +BUT .. + +We haven't yet reached that goal: + +* The quality of the output isn't good enough yet due to some +unsophisticated algorithms + +* Some features haven't been implemented, due to lack of time; most of +them can be done quite simply + +This is why we don't consider this software stable yet. It generally +does what it is supposed to, but we reserve the right to make +(incompatible) changes to the input format. We consider it +of BETA quality. + + +WE WANT YOU! + +You can become a user, but we'd really appreciate it if you would start +hacking at Lily, and help us advance our project more quickly. + + +``YES, IT IS FANTASTIC! WHAT DO I NEED?'' + +For compilation you need + + Unix. (windows32 is known to work, too) + GNU C++ v2.7 or better, with libg++ installed. + GNU make. + Flex (2.5.1 or better). + Bison. (1.25 or better) + +For running you need + + TeX + MusiXTeX fonts + +The MusiXTeX fonts are part of the MusiXTeX package version T.73, +available at any CTAN mirror, or http://www.gmd.de/Misc/Music/ + + +``WHAT CAN LILYPOND DO?'' + +ASCII script input (mudela), with identifiers (for music reuse), +customizable notenames. + +MIDI output lets you check if you have entered the correct notes. +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 (up to four handled graciously); +beams optionally shared between voices. Multiple scores within one +input file. Each score is output to a different file. + +Beams, slurs, chords, super/subscripts (accents and text), +general n-plet (triplet, quadruplets, etc.), lyrics, transposition, +dynamics (both absolute and hairpin style), clef changes, meter +changes, cadenza-mode, key changes, repeat bars. + +Integration with LaTeX through Perl scripts. + + +``WHERE CAN I FIND MORE INFO?'' + +Sources for this project are on + + ftp://pcnov095.win.tue.nl/pub/lilypond/ (Europe) + ftp://alpha.gnu.ai.mit.edu/gnu/ (US) + +More detailed info and examples can be found on the webpage at + + http://www.stack.nl/~hanwen/lilypond/index.html + + +THANK YOU, + +Thanks go out to Mats Bengtsson, Werner Lemberg and Richard Stallman +for comments and contributions. + + +**** NOTE + +LilyPond might have a minor bug if you use glibc-2; we will look into it +If you use glibc-2, please try 0.1.0 to see if it works and, download 0.1.1 +when it's available. + +LilyPond might exhibit a g++ bug on Solaris 1.5 (The stack frame gets corrupted +by a constructor) if you compile with -O2. We don't know workarounds. + + --- * --- + + We would like to dedicate this program to all the friends that we + met through music. + + + Those deserving special mention (in no particular order): +Esther, Marijke, Heike, Inge, Judith, Hannah, Auke, Ilse, Evelyn, +Maartje, Suzanne, Ilse (gee, again?) and last (but certainly not least) +Janneke! + + HWN + + That's a nice thought, Wendy. I've got a few too, to spread +the credits a bit (Again, no particular order) Michelle, Illushka, +Ruth, Eva, Fro/ydis, Monique, Noor, Sascha, Monique, Ilse, Monique, +Eva, Roos, Judith, Tim and, of course, Wendy! + + JCN + + +Of course, our other friends in the `Eindhovens Jongeren Ensemble' +(http://www.stack.nl/~hanwen/eje.html) cannot go unmentioned either. + + + --- * --- diff --git a/Documentation/AUTHORS.pod b/Documentation/AUTHORS.pod index c6fedeb9b0..e922f5c3d3 100644 --- a/Documentation/AUTHORS.pod +++ b/Documentation/AUTHORS.pod @@ -36,16 +36,19 @@ logs/longa/brevis etc TeX titling and lytodvi.sh +=item * Shay Rojanski + +Some mudela source. + =item * Werner Lemberg , -misc bugfixes, some -Beam and Stem code. +misc bugfixes, some Beam and Stem code. =item * Donald Ervin Knuth, http://www.cs.stanford.edu/~? mf/ital-*.mf (these were taken from the CM fonts) -=item * Alexandre Oliva , http://?.unicamp.br/ +=item * Alexandre Oliva , http://sunsite.unicamp.br/? testing @@ -61,6 +64,10 @@ Documentation/Vocab*, internationalization stuff Documentation/Vocab* +=item * David R. Linn , + +Mailing list maintenance. + =back Your name could be here! If you want to help, then take a look at the diff --git a/Documentation/INSTALL.pod b/Documentation/INSTALL.pod index b9580ea831..c15658f917 100644 --- a/Documentation/INSTALL.pod +++ b/Documentation/INSTALL.pod @@ -13,8 +13,7 @@ You do something which looks remotely like configure make make install - tar -C /usr/lib/texmf/fonts/source/ -zxf musixtex-T73.tgz 'mf/*' - + The detailed instructions follow here. =head1 PREREQUISITES @@ -63,29 +62,10 @@ TeX =item * -The MusixTeX fonts (I included those found in MusixTeX T.73). Beware, -the clef symbol seems to have changed its position in some versions, -(notably Egler's, a.k.a. OpusTeX). The MusixTeX fonts are included in -MusixTeX (T73 or better), which can be had from any CTAN site, e.g. at - -=over 4 - -=item ftp://ftp.shsu.edu/tex-archive/macros/musixtex/taupin - -=item ftp://ftp.tex.ac.uk/tex-archive/macros/musixtex/taupin - -=item ftp://ftp.dante.de/tex-archive/macros/musixtex/taupin +A PostScript printer and/or viewer (such as Ghostscript). =back -You only need the contents of the F subdirectory of the -package. The primary site of the Taupin version is -ftp://hprib.lps.u-psud.fr/pub/music_zips/musixtex.zip - -Andreas Egler's version of MusixTeX, now called OpusTeX, will also -work. Andreas moved some characters around in the fonts, so you have -to edit the definitions in tex/eglerdefs.tex (patch appreciated) - =head1 RECOMMENDED @@ -167,35 +147,35 @@ other options include: =over 4 -=item --enable-shared +=item B<--enable-shared> Make a shared library (gnu/linux, solaris (?) only ) -=item --enable-printing +=item B<--enable-printing> Enable debugging print routines (lilypond B<-d> option) -=item --enable-optimise +=item B<--enable-optimise> Set maximum optimisation: compile with B<-O2> -=item --enable-profiling +=item B<--enable-profiling> Compile with support for profiling -=item --enable-tex-prefix +=item B<--enable-tex-prefix> Set the directory where TeX and Metafont live -=item --enable-tex-dir +=item B<--enable-tex-dir> Set then directory TeX input is in (detected as a subdir of tex-prefix) -=item --enable-mf-dir +=item B<--enable-mf-dir> Set the directory mf input is in (idem) -=item --enable-out-dir +=item B<--enable-out-dir> Set the directory for machine generated output. @@ -248,17 +228,6 @@ If you have done a successful C, then a simple should do the trick. -Install the musixtex fonts in a directory which TeX and MF knows (if -you are root, look for a directory which contains the directories with -AMS and CM source (*.mf) files. Create a subdir lilypond or musixtex -and copy the fonts into that). Do not forget to rehash TeX (if -applicable) - -Example: my fonts are in F, and I -have a symlink pointing to that in -F. After I copied the -files, I ran "texhash" - =head1 CAVEATS =over 5 @@ -268,9 +237,9 @@ files, I ran "texhash" The -O2 option to gcc triggers a gcc bug on DEC Alpha in dstream.cc. You should turn off this flag for this file. -=item * +=item * -Perl5.003 and Perl5.004 use different syntax for pod2html: +Perl5.003 and Perl5.004 use different syntax for pod2html. =back @@ -279,8 +248,8 @@ Perl5.003 and Perl5.004 use different syntax for pod2html: This is what I type in my xterm: lilypond someinput.ly - tex lelie.tex - xdvi test& + tex someinput.tex + xdvi someinput& This is what the output looks like over here: @@ -292,11 +261,11 @@ This is what the output looks like over here: Preprocessing elements... Calculating column positions ... [14][25] Postprocessing elements... - TeX output to lelie.tex ... - Creating MIDI elements ...MIDI output to lelie.midi ... + TeX output to someinput.tex ... + Creating MIDI elements ...MIDI output to someinput.midi ... - hw:~/musix/spacer$ xdvi lelie& + hw:~/musix/spacer$ xdvi someinput& [1] 855 Check out the input files, some of them have comments @@ -305,15 +274,16 @@ 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. 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. You should be able to create an rpm as a +normal user. Be sure you have a F<~/.rpmrc>, and edit the RPM-dir in F. (If you create the RPM as a normal user the permissions will not be set correctly, unfortunately) =head1 DEBIAN GNU/LINUX -A Debian package is in the works +A Debian package is also available; contact Anthony Fok +. The build scripts are in the subdirectory debian/ =head1 WINDOWS NT/95 @@ -333,6 +303,52 @@ to unpack the distribution, make sure the B source tree is unpacked correctly, in particular the empty out directories (F, F et. al.) +=head1 MUSIXTEX + +Previous versions (before 0.1.39) used fonts from the TeX macro +package "MusixTeX". You can still use these, but they are not +supported. Since LilyPond's Feta font is much prettier, you'd be +stupid to use them, but anyway, here are the installation instructions +for those deprecated fonts. + + +[obsolete] I use the MusixTeX fonts those found in MusixTeX +T.73. Beware, the clef symbol seems to have changed its position in +some versions, (notably Egler's, a.k.a. OpusTeX). The MusixTeX fonts +are included in MusixTeX (T73 or better), which can be had from any +CTAN site, e.g. at + +=over 4 + +=item ftp://ftp.shsu.edu/tex-archive/macros/musixtex/taupin + +=item ftp://ftp.tex.ac.uk/tex-archive/macros/musixtex/taupin + +=item ftp://ftp.dante.de/tex-archive/macros/musixtex/taupin + +=back + +You only need the contents of the F subdirectory of the +package. The primary site of the Taupin version is +ftp://hprib.lps.u-psud.fr/pub/music_zips/musixtex.zip + +Install the musixtex fonts in a directory which TeX and MF knows (if +you are root, look for a directory which contains the directories with +AMS and CM source (*.mf) files. Create a subdir lilypond or musixtex +and copy the fonts into that). Do not forget to rehash TeX (if +applicable) + +Example: my fonts are in F, and I +have a symlink pointing to that in +F. After I copied the +files, I ran "texhash" + +Andreas Egler's version of MusixTeX, now called OpusTeX, will also +work. Andreas moved some characters around in the fonts, so you have +to edit the definitions in F. + + + =head1 AUTHORS Han-Wen Nienhuys diff --git a/Documentation/MANIFESTO.pod b/Documentation/MANIFESTO.pod index 9f28246c03..58847a4d84 100644 --- a/Documentation/MANIFESTO.pod +++ b/Documentation/MANIFESTO.pod @@ -47,9 +47,9 @@ Further considerations while doing the programming =item * -GNU LilyPond uses MusiXTeX fonts and TeX for its output. This is not a key -issue: in a future version, GNU LilyPond might bypass TeX, but at the moment -TeX is convenient for producing output. +GNU LilyPond uses TeX for its output. This is not a key issue: in a +future version, GNU LilyPond might bypass TeX, but at the moment TeX +is convenient for producing output. =item * diff --git a/Documentation/Rules.make b/Documentation/Rules.make index 3eaf8cd967..eac8dfc8f2 100644 --- a/Documentation/Rules.make +++ b/Documentation/Rules.make @@ -45,7 +45,7 @@ $(outdir)/%.gz: $(outdir)/% name-stem= $(notdir $(basename $<)) $(outdir)/%.dvi: $(depth)/input/%.ly $(depth)/VERSION (cd $(outdir); \ - lilypond -I. -o $(name-stem) ../$< ) + lilypond -I/ ../$< ) (cd $(outdir); \ if [ -f ../$(basename $< ).tex ]; \ then \ @@ -55,9 +55,11 @@ $(outdir)/%.dvi: $(depth)/input/%.ly $(depth)/VERSION fi) -# generate the pixmap at twice the size, then rescale (for antialiasing) + $(outdir)/%.gif: $(outdir)/%.ps - gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE $< -c quit |pnmscale 0.5| ppmtogif > $@ + sh $(depth)/bin/ps-to-gifs.sh $< + mv $(name-stem)-page*.gif $(outdir)/ + touch $@ $(outdir)/%.ly.txt: $(depth)/input/%.ly ln -f $< $@ diff --git a/Documentation/index.pod b/Documentation/index.pod index 3f862dc841..595170662b 100644 --- a/Documentation/index.pod +++ b/Documentation/index.pod @@ -46,7 +46,7 @@ top_of_NEWS =over 4 =item * - The announce of 0.1 is merge - - -=item * \extract{ \from 2:3*4 \to 5 oboe } -=back - - =head1 THOUGHTS @@ -101,14 +63,6 @@ As simple fix, we might do key declarations: -[LOOSE THOUGHT] - -We might drop this {} argument altogether, by merely enforcing -that each "statement" (music,score,staff,chord) takes a LIST as -argument, and use the {} to group lists. This is admittedly perl. This -is very sketchy. - - =head2 Requests I want to give the user some access to the internals. Technically, @@ -125,25 +79,6 @@ portability. Suppose some commercial systems want to read mudela too. =head2 Command placement: -Mats is an arduous fan of having the commands inside music. I am -not. I see the Mudela music as something which can be plugged into -different staffs, transposed, translated in time, copied, quoted, -etc. Encouraging "inline" commands would be bad since they hinder this -reuse of typed music. - -The way I figure it, the bad part is essentially counting -bars/wholes. Maybe we can get rid of it, by reinstalling the "mark" -commands. - -I definitely want to avoid complicated logic ("Hey there is another -bar request, should we merge this bar with another staff's", this kind -of "smartness" makes a lot M$ software inconsistent) inside LilyPond, -by making the input unambiguous in this respect. - -There is another complication: some symbols (bars) sometimes are -linked across staffs. I should first think of a way to do this in -LilyPond, before even considering a syntax. - =head2 Volta @@ -192,7 +127,6 @@ editions: Just ideas: || && ! filter syntax - + merging of voices =head2 Quoting diff --git a/Documentation/lilypond.pod b/Documentation/lilypond.pod index fdee220387..26a6664150 100644 --- a/Documentation/lilypond.pod +++ b/Documentation/lilypond.pod @@ -175,7 +175,7 @@ compile/configure options please). Send a description of the bug itself. =item * -Send it to bug-gnu-music@vuse.vanderbilt.edu. +Send it to bug-gnu-music@gnu.org. =back @@ -256,29 +256,29 @@ mailing list have been setup: =over 4 -=item info-gnu-music@vuse.vanderbilt.edu +=item info-gnu-music@gnu.org For information on the GNU Music project, to subscribe: send mail with -subject "subscribe" to info-gnu-music-request@vuse.vanderbilt.edu +subject "subscribe" to info-gnu-music-request@gnu.org -=item help-gnu-music@vuse.vanderbilt.edu +=item help-gnu-music@gnu.org For help with programs from the GNU music project. To subscribe: send mail with subject "subscribe" to -help-gnu-music-request@vuse.vanderbilt.edu +help-gnu-music-request@gnu.org -=item bug-gnu-music@vuse.vanderbilt.edu +=item bug-gnu-music@gnu.org If you have bugreports, you should send them to this list. If you want to read all bugreports, you should subscribe to this list. To subscribe: send mail with subject "subscribe" to -bug-gnu-music-request@vuse.vanderbilt.edu +bug-gnu-music-request@gnu.org -=item gnu-music-discuss@vuse.vanderbilt.edu, +=item gnu-music-discuss@gnu.org, For discussions concerning the GNU Music project, to subscribe: send mail with subject "subscribe" to -gnu-music-discuss-request@vuse.vanderbilt.edu, +gnu-music-discuss-request@gnu.org, =back diff --git a/Documentation/links.pod b/Documentation/links.pod index dc1d9d8004..26a0026b5c 100644 --- a/Documentation/links.pod +++ b/Documentation/links.pod @@ -65,13 +65,13 @@ The following newsgroups all contain material relevant to LilyPond =over 4 -=item news:comp.music.research +=item news://comp.music.research -=item news:rec.music.compose +=item news://rec.music.compose -=item news:gnu.announce +=item news://gnu.announce -=item news:comp.os.linux.announce +=item news://comp.os.linux.announce =back @@ -82,30 +82,30 @@ mailing list have been setup: =over 4 -=item info-gnu-music@vuse.vanderbilt.edu +=item info-gnu-music@gnu.org A moderated list for information on the GNU Music project, to subscribe: send mail with subject "subscribe" to -info-gnu-music-request@vuse.vanderbilt.edu +info-gnu-music-request@gnu.org -=item help-gnu-music@vuse.vanderbilt.edu +=item help-gnu-music@gnu.org For help with programs from the GNU music project. To subscribe: send mail with subject "subscribe" to -help-gnu-music-request@vuse.vanderbilt.edu +help-gnu-music-request@gnu.org -=item bug-gnu-music@vuse.vanderbilt.edu +=item bug-gnu-music@gnu.org If you have bugreports, you should send them to this list. If you want to read all bugreports, you should subscribe to this list. To subscribe: send mail with subject "subscribe" to -bug-gnu-music-request@vuse.vanderbilt.edu +bug-gnu-music-request@gnu.org -=item gnu-music-discuss@vuse.vanderbilt.edu, +=item gnu-music-discuss@gnu.org, For discussions concerning the GNU Music project, to subscribe: send mail with subject "subscribe" to -gnu-music-discuss-request@vuse.vanderbilt.edu +gnu-music-discuss-request@gnu.org =back diff --git a/Documentation/mutopia.pod b/Documentation/mutopia.pod index 783d5bd74a..ed95d6ff0b 100644 --- a/Documentation/mutopia.pod +++ b/Documentation/mutopia.pod @@ -50,11 +50,11 @@ Just as an aside, the LilyPond package includes the following music: J.S. Bach, Das Wohltemperierte Clavier I: C major Prelude & Fugue, C minor fugue. Solo cello suites: suite II, menuetto (alto version). -=item * +=item * F. Schubert, St\"andchen (Serenade) "Leise flehen meine Lieder" -=item * +=item * Tarquinio Merula, La Gallina a 2 violini diff --git a/NEWS b/NEWS index 650f5ba4db..bb0e37a02d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,45 @@ +pl 39 + - 0.2 ANNOUNCE sketch + - unix style paths for LILYINCLUDE env + - show all output pages on website + - ps-to-gifs.sh + - bf: wtk1-fugue2 + - python make-website + - higher brace resolution + - phased out musixtex stuff + - bf: rhythm.ly + - PS slurs + - PS beams + - Bow units + - turn on PS by default + - turn off barnumbers by default. + - bf: halfbeam size. + - bf: -M bug + - stafflinethick in PS (crescendi) + - continued (de)crescendi (in PS) + - bf: spurious beam reqs + - handle unfeasible spacing cleanly. + - ML-address change + - output naming: default to basename[-serialnumber].{midi,tex} + - bf: clef width + +pl 39.jcn2 + - make-examples.sh + - leftright repeat sign + repeatbar dims + - smaller minimum sized rod at end of bar + - bf: spacing.ly + - less space at begin of bar + - experimental whitespace fixes at begin and end of bar + - added to beams.ly + - open-up beam spacing for mult > 3 + - fixed hang/sit to overlap iso aligne with staffline + - fixed inter beam spacing, paper*.ly + - scsii-menuetto.ly fixes + - init/property.ly + - property settings for beam quantiseing and damping + - provisionary multiple-beam fix + +****** pl 38 - bf: \> \! \ff (crescendo overlap) - misc feta-fixes, flageolet sign. diff --git a/TODO b/TODO index 02e8452ce5..a9b64f1dd9 100644 --- a/TODO +++ b/TODO @@ -7,20 +7,16 @@ Most of the items are marked in the code as well, with full explanation. grep for TODO and ugh/ugr 0.2: - * -M bug - * unended beam: [c4 + * beam quanting - * continued hairpins + * disable spaces in TeX stuff * height of dyns. - * output naming: - - default to basename[-serialnumber].{midi,tex} - * handle ^C for tmp/file creation. - * PS for beams. + * WWW mirror/archive for the mailing lists. * dots & rest collisions. @@ -32,18 +28,12 @@ grep for TODO and ugh/ugr * documentation - * spurious "Junk beam" warnings - - * standchen: warning: Excentric column (Meter dims?) - * naming Mozarella, Madeira, Muella? * versioning for Feta * bf: abbrevs over whole note - * bf: wtk1-fug2 ending - STUFF * give Items/Spanners access to unbroken originals @@ -71,7 +61,10 @@ STUFF - MIDI instrument - staff title - * optimal pagebreaking. + * page handling: + - papersizes + - PS output + - optimal pagebreaking. * put errorlevel in Input class @@ -79,6 +72,8 @@ STUFF 3RD PARTY BUGS: + * xdvi: PS magnifying glass. + * Rational infty(HUGE_VAL) on glibc / w32 * Fix profiling. gprof bugreport? @@ -93,14 +88,11 @@ PROJECTS * Spring_spacer: - write a faster Spring_spacer (without matrices if possible) - - use straight QP to find minimal "fitting force" + - use straight LP to find minimal "fitting force" - relate energybound to linelen unitspace fontsize etc. - used fixed point fp * \header - - write perl/python script for handling it into databases - - write TeX macros to generate titles - - adapt make-website to use \header info. - output header info to MIDI too. @@ -297,8 +289,6 @@ SMALLISH PROJECTS * adaptive accidental spacing. - * unix style paths for LILYINCLUDE env - * handle EOF graciously in error messages. * caching Item/spanner dimensions. diff --git a/VERSION b/VERSION index 1cd375d593..1cb7a136d9 100644 --- a/VERSION +++ b/VERSION @@ -1,6 +1,6 @@ TOPLEVEL_MAJOR_VERSION = 0 TOPLEVEL_MINOR_VERSION = 1 -TOPLEVEL_PATCH_LEVEL = 38 +TOPLEVEL_PATCH_LEVEL = 39 TOPLEVEL_MY_PATCH_LEVEL = # use the above to send patches, always empty for released version: diff --git a/bin/clean-diaper.sh b/bin/clean-diaper.sh index dc25ffeaca..e02b17ddf9 100644 --- a/bin/clean-diaper.sh +++ b/bin/clean-diaper.sh @@ -1,14 +1,17 @@ #!/bin/sh # unclobber current dir. -rm -vf *.aux *.log `grep -li "^% Creator: GNU LilyPond" *.out` *.orig *~ +rm -vf *.aux *.log *.orig *~ +rm -vf `grep -li "^% Creator: GNU LilyPond" *.out *.tex` rm -vf `grep -li "Creator: mi2mu" *.midi.ly` +rm -vf `grep -li "%Creator: dvipsk" *.ps` rm -vf `grep -li "Creator: GNU LilyPond" *.midi` rm -vf `grep -li "Creator: ly2dvi" *.tex` rm -vf `find -name 'core'` rm -vf `find -name *.orig` rm -vf `find -name *.rej` + # docxx mess rm -vf *dvi rm -vf *.class HIER*.html dxxgifs.tex gifs.db icon?.gif logo.gif down.gif \ diff --git a/bin/lilypython.py b/bin/lilypython.py index fb6f1a51f5..5b68b97739 100644 --- a/bin/lilypython.py +++ b/bin/lilypython.py @@ -117,6 +117,7 @@ class Lilydirs: return v + lilydirs = Lilydirs() if __name__ == '__main__': @@ -127,3 +128,56 @@ if __name__ == '__main__': print version_tuple_to_str(pv), prev_version(pv), next_version(pv) print version_tuple_to_str((0,1,1,'')) print mv, version_str_to_tuple(mv) + + + +def dump_file(f, s): + i = open(f, 'w') + i.write(s) + i.close () + +def gulp_file(f): + i = open(f) + i.seek (0, 2) + len = i.tell () + i.seek (0,0) + return i.read (len) + + +header_regex = regex.compile('\\header[ \t\n]*{\([^}]*\)}') +header_entry_regex = regex.compile('[\n\t ]*\([^\n\t ]+\)[\n\t ]*=[\n \t]*\([^;]+\)[\n \t]*;') + +# +# FIXME breaks on multiple strings. +# +def read_mudela_header (fn): + s = gulp_file(fn) + s = regsub.gsub('%.*$', '', s) + s = regsub.gsub('\n', ' ', s) + + dict = {} + if header_regex.search(s) <> -1: + h = header_regex.group(1) + else: + return dict + + while regex.search('=', h) <> -1: + + if header_entry_regex.search (h) == -1: + + raise 'format error' + + h = regsub.sub(header_entry_regex, '', h) + left = header_entry_regex.group(1) + right = header_entry_regex.group(2) + + right = regsub.gsub('\([^\\]\)\"', '\\1', right) + right = regsub.gsub('^"', '', right) + left = regsub.gsub('\([^\\]\)\"', '', left) + left = regsub.gsub('^"', '', left) + + dict[left] = right + + return dict + + diff --git a/bin/make-examples.sh b/bin/make-examples.sh new file mode 100644 index 0000000000..620a28a7dd --- /dev/null +++ b/bin/make-examples.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# make-examples + +examples="twinkle-pop wtk1-fugue2 standchen-16 standchen-20 wtk1-prelude1 toccata-fuga-E scsii-menuetto cadenza gallina twinkle collisions font font20 scales rhythm multi spacing beams stem" +pss=$(echo $examples | sed "s/[^ ][^ ]*/out\\/&.ps/g") + +# cd ~/lelie/current/Documentation/out +cd ~/lelie/current/input +make -C ../Documentation $pss diff --git a/bin/make-website.py b/bin/make-website.py new file mode 100644 index 0000000000..52bc149378 --- /dev/null +++ b/bin/make-website.py @@ -0,0 +1,261 @@ +#!@PYTHON@ +# +# make-website.py -- implement The lilypond WWW site +# +# source file of the GNU LilyPond music typesetter +# +# (c) 1997 Han-Wen Nienhuys +# + +""" + stupid script to generate WWW site. + + The WWW site is my test-suite for LilyPond, I usually don't + distribute versions that fail to complete this script """ + +from lilypython import * +import __main__ +import glob + +depth = '' +makewebsite_id = ""; +id_str = "make-website 0.6"; +tar = "tar"; +make = "make"; +mailaddress = "unknown" +fullname = "unknown" +footstr = "" +lilyversion= '' + +def set_vars(): + __main__.lilyversion = version_tuple_to_str(lilydirs.version_tuple()) + os.environ["TEXINPUTS"] = os.environ["TEXINPUTS"] + ":%s/input/:" % depth; + os.environ["LILYINCLUDE"] = "%s/input/" % depth; + os.environ["LILYTOP"] = depth; + __main__.mailaddress= os.environ['MAILADDRESS'] + pw = pwd.getpwuid (os.getuid()); + + __main__.fullname= pw[4]; + +backstr = '\n
Please take me back to the index\n\ +of LilyPond -- The GNU Project Music typesetter\n\ +
\n\ +This page was built using %s from lilypond-%s by

\n\ +


%s ><%s>
\n\ +

' + + +def footstr(index): + return backstr % (index, id_str, lilyversion, fullname, mailaddress, mailaddress) + + + +# do something, check return status +def my_system(cmds): + for cmd in cmds: + ignoreret=0; + if cmd[0] == '-': + ignoreret = 1 + cmd = cmd[1:] + + ret = os.system (cmd) + if ret: + if ignoreret: + sys.stderr.write( "ignoring failed command \`%s\' (status %d)\n" % (cmd, ret)) + else: + sys.stderr.write( 'make-website: failed on command %s (status %d)\n' % (cmd, ret)) + sys.exit (2) + +base="lilypond/"; + +examples=["twinkle-pop", + "wtk1-fugue2", + "standchen-16", + "standchen-20", + "wtk1-prelude1", + "toccata-fuga-E", + "scsii-menuetto", + "cadenza", + "gallina", + "twinkle", + "collisions", + "font", + "font20", + #"scales", + "rhythm", + "multi"] + +def gen_html(): + print 'generating HTML' + my_system (["make -kC .. html"]); + + +def gen_examples(): + print 'generating examples:\n' + list = map(lambda x: 'out/%s.ps.gz out/%s.gif out/%s.ly.txt' % (x,x,x), examples) + my_system (['make -C .. ' + join(' ', list)]) + +texstuff = ["mudela-man", "mudela-course"] + +def gen_manuals(): + print 'generating TeX doco manuals' + list = open('tex_manuals.html', 'w') + list.write( "PostScript Manuals\n" + "

LilyPond manuals (in PostScript)

" + "
    \n") + todo='' + for stuff in texstuff: + todo = todo + ' out/' + stuff + '.ps.gz' + list.write("
  • %s.ps.gz" % (stuff, stuff)) + list.write('
') + list.close () + + my_system (['make -C .. ' + todo]) + +def file_exist_b(name): + try: + f = open(name) + except IOError: + return 0 + f.close () + return 1 + +def gen_list(): + print "generating HTML list\n"; + list = open('example_output.html', 'w') + list.write ('Rendered Examples\n' + 'These example files are taken from the LilyPond distribution.\n' + 'LilyPond currently only outputs TeX and MIDI. The pictures and\n' + 'PostScript files were generated using TeX, Ghostscript and some\n' + 'graphics tools. The papersize used for these examples is A4. The GIF\n' + 'files have been scaled to eliminate aliasing.\n'); + + for ex in examples: + header = read_mudela_header(ex + '.ly.txt') + def read_dict(s, default, h =header): + try: + ret = h[s] + except KeyError: + ret = default + return ret + head = read_dict('title', ex) + composer = read_dict('composer', '') + desc = read_dict('description', '') + list.write('
') + list.write('

example file: %s

' % head); + if composer <> '': + list.write('

%s

\n' % composer) + if desc <> '': + list.write('%s

' % desc) + list.write ('

    ') + def list_item(filename, desc, l = list): + if file_exist_b(filename): + l.write ('
  • %s\n' % (filename, desc)) + + list_item(ex + '.ly.txt', 'The input') + for pageno in range(1,10): + f = ex + '-page%d.gif' % pageno + if not file_exist_b (f): + break + list_item(f, 'The output (picture, page %d)' % pageno) + list_item(ex + '.ps.gz', 'The output (gzipped PostScript)') + list_item(ex + '.midi', 'The output (MIDI)') + list.write ("
"); + + list.write( ""); + list.close() + +def copy_files(): + print "copying files\n" + +# my_system ("ln -s depth/out ./docxx" ) + my_system([ "cp %s/TODO ./TODO.txt" % depth, + "cp %s/ANNOUNCE-0.1 ./ANNOUNCE.txt" % depth, + "cp %s/NEWS ./NEWS.txt" % depth, + "cp %s/DEDICATION ./DEDICATION.txt" % depth]); + my_system([ "make -C .. gifs"]); + +def docxx_update(): + print 'docxx.. \n' + banner= open('/tmp/lilybanner.html', 'w'); + banner.write (footstr('../index.html')) + banner.close () + my_system(['BANNEROPT=\"-B /tmp/lilybanner.html\" %s/bin/out/make-docxx' % depth]); +# os.unlink( "/tmp/lilybanner.html"); + +def get_glob(exts): + result = [] + for a in exts: + result = result + glob.glob1('./', '*.' + a) + + return result + +def join(inter, list): + return reduce (lambda x,y, i=inter: x + i + y, list) + +def do_tar(): + print "tarring.\n"; + list = get_glob( ['html', 'gif', 'ps.gz' , 'txt', 'midi']) + files = join (' ', list) + print files + my_system( ['-tar zvhcf website.tar.gz ' + files + ' docxx/*']) + + +def identify(): + print 'This is %s\n' % id_str + +def clean_tmp(): + my_system(['rm -f /tmp/gs*']) + +def get_top_of_NEWS(): + i = open('NEWS.txt') + lines = i.readlines() + i.close () + s = '' + for l in lines: + if regex.search('^\*\*\*\*\*\*', l) <> -1: + return s; + s = s + l + return s + +def edit_index(): + s = gulp_file('index.html') + s = regsub.sub ('top_of_NEWS', '\n' + get_top_of_NEWS () + '\n', s) + dump_file ('index.html', s) + +def edit_html(): + files = get_glob(['html']) + for f in files: + + s = gulp_file(f) + if regex.search(makewebsite_id, s) <> -1: + continue; + + s = regsub.sub ('', footstr('index.html') + makewebsite_id + '', s) + s = regsub.sub('\(.*\)$', + 'LilyPond WWW: \\1', s) + dump_file (f,s) + +def main(): + identify(); + + os.chdir (lilydirs.topdir + 'Documentation/out') + __main__.depth = "../../"; + + set_vars(); + gen_html(); + copy_files(); + gen_examples(); + gen_list(); + gen_manuals(); + #set_images(); + edit_html(); + edit_index(); + docxx_update() + do_tar() + clean_tmp(); + + +main() + + diff --git a/bin/mudela-book.pl b/bin/mudela-book.pl index 9aec75cb60..37206c3c81 100644 --- a/bin/mudela-book.pl +++ b/bin/mudela-book.pl @@ -34,9 +34,13 @@ sub gen_mufile return "$outdir/$outname$mudcount.ly"; } +sub gen_texbase +{ + return "$outname$mudcount.tex"; +} sub gen_texfile { - return "$outdir/$outname$mudcount.tex"; + return "$outdir/" . gen_texbase; } sub close_mudela @@ -64,7 +68,7 @@ sub close_mudela if ( ! -f gen_texfile) { my_system "lilypond ". gen_mufile; - rename "lelie.tex", gen_texfile; + rename gen_texbase, gen_texfile; } print BOOK "\\preexample\\input " . gen_texfile . "\n\\postexample\n"; diff --git a/bin/ps-to-gifs.sh b/bin/ps-to-gifs.sh new file mode 100644 index 0000000000..dc51988675 --- /dev/null +++ b/bin/ps-to-gifs.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +usage() +{ + echo 'ps-to-gifs.sh FILE.ps' + exit 2; +} + +case $# in +1) + FILE=`basename $1 .ps` + ;; +*) + usage + ;; +esac + +# generate the pixmap at twice the size, then rescale (for antialiasing) +cat $1 | gs -q -sDEVICE=ppmraw \ + -sOutputFile="|pnmscale 0.5|ppmtogif > $FILE-page%d.gif" \ + -r200 -dNOPAUSE - -c quit + + + diff --git a/configure.in b/configure.in index ee5bc6a4f7..a971abbae7 100644 --- a/configure.in +++ b/configure.in @@ -63,7 +63,7 @@ AC_ARG_ENABLE(tex-dir, [TEXDIR=auto] ) AC_ARG_ENABLE(mf-dir, - [ mf-dir=DIR set the directory to put LilyPond MetaFont files in. (obsolete)], + [ mf-dir=DIR set the directory to put LilyPond MetaFont files in. ], [MFDIR=$enableval], [MFDIR=auto]) diff --git a/debian/Makefile b/debian/Makefile index 6bb008a5cd..7f35925fb6 100644 --- a/debian/Makefile +++ b/debian/Makefile @@ -15,5 +15,5 @@ include ./$(depth)/make/Rules.make # -EXTRA_DISTFILES = README.debian TODO changelog control copyright \ +EXTRA_DISTFILES = README.Debian TODO changelog control copyright \ info.ex menu.ex postinst postinst.old.sh postrm preinst rules watch diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000000..ba5d98e908 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,22 @@ +lilypond for DEBIAN +------------------- + +Starting with version 0.1.12, LilyPond comes with some new MF fonts. +These fonts are not currently listed in /usr/lib/texmf/fontname/special.map +(from the teTeX package), therefore the fonts will be created in a +non-standard directory somewhere under /var/spool/texmf. The problem is +usually only aesthetic. TeTeX can create and find the *.tfm and *.pk files +without any problems. + +However, if you experience any font problems (such as the note heads +not showing up, characters in the wrong places, error messages from +TeX), especially after upgrading to a new version of LilyPond, you may +need to delete the relevant *.tfm and *.pk files under the directory +/var/spool/texmf. You may also file a bug report about this if you +like. + +LilyPond is still in active development, and many things may still change. +When it is stablized in the future, these new fonts will probably be +added into the standard special.map file. + +Anthony Fok , Thu, 23 Oct 1997 16:59:32 -0600 diff --git a/flower/NEWS b/flower/NEWS index 5610f02a09..f7db23a49c 100644 --- a/flower/NEWS +++ b/flower/NEWS @@ -1,3 +1,7 @@ +pl 33 + - String naming + - unix style paths + pl 32 - Assoc::clear - bf: Assoc[PreviouslyUsedAndDeletedKey] = foo diff --git a/flower/VERSION b/flower/VERSION index 942ef52905..636df4b25f 100644 --- a/flower/VERSION +++ b/flower/VERSION @@ -1,6 +1,6 @@ MAJOR_VERSION = 1 MINOR_VERSION = 1 -PATCH_LEVEL = 32 +PATCH_LEVEL = 33 # use to send patches, always empty for released version: MY_PATCH_LEVEL = # include separator: "-1" or ".a" # diff --git a/flower/dstream.cc b/flower/dstream.cc index 4d7ec7e7a9..f22365bf55 100644 --- a/flower/dstream.cc +++ b/flower/dstream.cc @@ -71,7 +71,7 @@ Dstream::identify_as (String name) } bool -Dstream::silence (String s) +Dstream::silent_b (String s) const { if (!silent_assoc_p_->elt_b (s)) return false; diff --git a/flower/include/dstream.hh b/flower/include/dstream.hh index 4d14ae34ec..752b78bca4 100644 --- a/flower/include/dstream.hh +++ b/flower/include/dstream.hh @@ -42,7 +42,7 @@ class Dstream Assoc *silent_assoc_p_; public: void clear_silence(); - bool silence (String); + bool silent_b (String) const; /** if rcfile == 0, then do not read any rc file. diff --git a/flower/include/path.hh b/flower/include/path.hh index 1f3a5eb97a..caa6bbb752 100644 --- a/flower/include/path.hh +++ b/flower/include/path.hh @@ -26,12 +26,13 @@ class File_path : private Array { public: - /// locate a file in the search path - String find (String nm) const; + /// locate a file in the search path + String find (String nm) const; - /// add to end of path. - Array::push; - void add (String str) { push (str); } + /// add to end of path. + Array::push; + void add (String str) { push (str); } + void parse_path (String); }; /** split a path into its components. diff --git a/flower/include/string.hh b/flower/include/string.hh index 91342a1de3..067ea3358e 100644 --- a/flower/include/string.hh +++ b/flower/include/string.hh @@ -130,7 +130,7 @@ public: /// return a piece starting at index_i (first char = index_i 0), length n - String mid_str (int index_i, int n) const; + String cut (int index_i, int n) const; /// cut out a middle piece, return remainder String nomid_str (int index_i, int n) const; @@ -141,10 +141,14 @@ public: /// index of rightmost c int index_last_i (char c) const; - /// index of rightmost element of string + /// index of rightmost element of string (???) int index_last_i (char const* string) const; + /// index of leftmost #c# int index_i (char c) const; + + + /// index of leftmost occurance of STRING int index_i (String) const; int index_any_i (String) const; diff --git a/flower/path.cc b/flower/path.cc index b69d85d77a..a499d0abf4 100644 --- a/flower/path.cc +++ b/flower/path.cc @@ -5,8 +5,12 @@ #include "path.hh" #include "flower-debug.hh" +#ifndef DIRSEP +#define DIRSEP '/' +#endif + #ifndef PATHSEP -#define PATHSEP '/' +#define PATHSEP ':' #endif /** @@ -15,40 +19,58 @@ */ void split_path (String path, - String &drive, String &dirs, String &filebase, String &extension) + String &drive, String &dirs, String &filebase, String &extension) { // peel off components, one by one. int di = path.index_i (':'); if (di >= 0) - { - drive = path.left_str (di + 1); - path = path.right_str (path.len() - di -1); - } + { + drive = path.left_str (di + 1); + path = path.right_str (path.len() - di -1); + } else - drive = ""; + drive = ""; - di = path.index_last_i (PATHSEP); + di = path.index_last_i (DIRSEP); if (di >=0) - { - dirs = path.left_str (di + 1); - path = path.right_str (path.len()-di -1); - } + { + dirs = path.left_str (di + 1); + path = path.right_str (path.len()-di -1); + } else - dirs = ""; + dirs = ""; di = path.index_last_i ('.'); if (di >= 0) - { - filebase = path.left_str (di); - extension =path.right_str (path.len()-di); - } + { + filebase = path.left_str (di); + extension =path.right_str (path.len()-di); + } else - { - extension = ""; - filebase = path; - } + { + extension = ""; + filebase = path; + } } +void +File_path::parse_path (String p) +{ + int l; + + while ( (l = p.length_i ()) ) + { + int i = p.index_i(PATHSEP); + if (i <0) + i = l; + add (p.left_str(i)); + p = p.right_str (l- i - 1); + } +} + + + + /** find a file. It will search in the current dir, in the construction-arg, and in any other added path, in this order. @@ -59,25 +81,24 @@ File_path::find (String nm) const { fdebug << _("looking for ") << nm << ": "; if (!nm.length_i() || (nm == "-") ) - return nm; + return nm; for (int i=0; i < size(); i++) { + String path = elem(i); + if (path.length_i() ) + path += "/"; - String path = elem(i); - if (path.length_i() ) - path += "/"; + path += nm; - path += nm; - - fdebug << path << "? "; - FILE *f = fopen (path.ch_C(), "r"); // ugh! - if (f) - { - fdebug << _("found\n"); - fclose (f); - return path; - } - } + fdebug << path << "? "; + FILE *f = fopen (path.ch_C(), "r"); // ugh! + if (f) + { + fdebug << _("found\n"); + fclose (f); + return path; + } + } fdebug << "\n"; return ""; } diff --git a/flower/string-convert.cc b/flower/string-convert.cc index ab7c6ab3e6..a8f6619048 100644 --- a/flower/string-convert.cc +++ b/flower/string-convert.cc @@ -31,8 +31,8 @@ String_convert::bin2hex_str (String bin_str) Byte const* byte_C = bin_str.byte_C(); for (int i = 0; i < bin_str.length_i(); i++) { - str += (char)nibble2hex_byte (*byte_C >> 4); - str += (char)nibble2hex_byte (*byte_C++); + str += (char)nibble2hex_byte (*byte_C >> 4); + str += (char)nibble2hex_byte (*byte_C++); } return str; } @@ -51,8 +51,8 @@ String_convert::bin2_u (String bin_str) unsigned result_u = 0; for (int i = 0; i < bin_str.length_i(); i++) { - result_u <<= 8; - result_u += (Byte)bin_str[ i ]; + result_u <<= 8; + result_u += (Byte)bin_str[ i ]; } return result_u; } @@ -62,7 +62,7 @@ int String_convert::dec2_i (String dec_str) { if (!dec_str.length_i()) - return 0; + return 0; long l = 0; int conv = sscanf (dec_str.ch_C(), "%ld", &l); @@ -76,7 +76,7 @@ String_convert::i64_str (I64 i64, char const* fmt) { char buffer[STRING_BUFFER_LEN]; snprintf (buffer, STRING_BUFFER_LEN, - (fmt ? fmt : "%Ld"), i64); // assume radix 10 + (fmt ? fmt : "%Ld"), i64); // assume radix 10 return String (buffer); } @@ -85,7 +85,7 @@ double String_convert::dec2_f (String dec_str) { if (!dec_str.length_i()) - return 0; + return 0; double d = 0; int conv = sscanf (dec_str.ch_C(), "%lf", &d); assert (conv); @@ -96,7 +96,7 @@ int String_convert::hex2bin_i (String hex_str, String& bin_str_r) { if (hex_str.length_i() % 2) - hex_str = "0" + hex_str; + hex_str = "0" + hex_str; bin_str_r = ""; Byte const* byte_C= hex_str.byte_C(); @@ -106,7 +106,7 @@ String_convert::hex2bin_i (String hex_str, String& bin_str_r) int high_i = hex2nibble_i (*byte_C++); int low_i = hex2nibble_i (*byte_C++); if (high_i < 0 || low_i < 0) - return 1; // illegal char + return 1; // illegal char bin_str_r += String ((char)(high_i << 4 | low_i), 1 ); i += 2; } @@ -117,8 +117,8 @@ String String_convert::hex2bin_str (String hex_str) { String str; -// silly, asserts should alway be "on"! -// assert (!hex2bin_i (hex_str, str) ); + // silly, asserts should alway be "on"! + // assert (!hex2bin_i (hex_str, str) ); int error_i = hex2bin_i (hex_str, str); assert (!error_i); return str; @@ -128,11 +128,11 @@ int String_convert::hex2nibble_i (Byte byte) { if (byte >= '0' && byte <= '9') - return byte - '0'; + return byte - '0'; if (byte >= 'A' && byte <= 'F') - return byte - 'A' + 10; + return byte - 'A' + 10; if (byte >= 'a' && byte <= 'f') - return byte - 'a' + 10; + return byte - 'a' + 10; return -1; } @@ -142,7 +142,7 @@ String_convert::i2dec_str (int i, int length_i, char ch) { char fill_ch = ch; if (fill_ch) - fill_ch = '0'; + fill_ch = '0'; // ugh String dec_str (i); @@ -158,13 +158,13 @@ String_convert::u2hex_str (unsigned u, int length_i, char fill_ch) { String str; if (!u) - str = "0"; + str = "0"; #if 1 // both go... while (u) { - str = String ((char)((u % 16)["0123456789abcdef"] ) ) + str; - u /= 16; + str = String ((char)((u % 16)["0123456789abcdef"] ) ) + str; + u /= 16; } #else str += int_str (u, "%x"); // hmm. %lx vs. %x -> portability? @@ -172,7 +172,7 @@ String_convert::u2hex_str (unsigned u, int length_i, char fill_ch) str = String (fill_ch, length_i - str.length_i()) + str; while ((str.length_i() > length_i) && (str[ 0 ] == 'f' ) ) - str = str.mid_str (2, INT_MAX); + str = str.cut (2, INT_MAX); return str; } @@ -187,9 +187,9 @@ Byte String_convert::nibble2hex_byte (Byte byte) { if ((byte & 0x0f) <= 9 ) - return (byte & 0x0f) + '0'; + return (byte & 0x0f) + '0'; else - return (byte & 0x0f) - 10 + 'a'; + return (byte & 0x0f) - 10 + 'a'; } /** Convert an integer to a string @@ -202,7 +202,7 @@ String_convert::int_str (int i, char const* fmt) { char buffer[STRING_BUFFER_LEN]; snprintf (buffer, STRING_BUFFER_LEN, - (fmt ? fmt : "%d"), i); // assume radix 10 + (fmt ? fmt : "%d"), i); // assume radix 10 return String (buffer); } @@ -245,12 +245,12 @@ String_convert::rational_str (Rational r) String s = n; if (r.denominator() != 1) { - char * d = Itoa (r.denominator()); - s += String ('/') + String (d); - //delete d; + char * d = Itoa (r.denominator()); + s += String ('/') + String (d); + //delete d; } -/* delete n; - */ + /* delete n; + */ return s; } diff --git a/flower/string.cc b/flower/string.cc index 74ae9a7865..2076a2a19b 100644 --- a/flower/string.cc +++ b/flower/string.cc @@ -34,10 +34,10 @@ void String::print_on (ostream& os) const { if (!strh_.is_binary_bo()) - os << ch_C(); + os << ch_C(); else - for (int i = 0; i < length_i(); i++) - os << (Byte)(*this)[ i ]; + for (int i = 0; i < length_i(); i++) + os << (Byte)(*this)[ i ]; } /* @@ -153,7 +153,7 @@ String::compare_i (String const& s1, String const& s2) Byte const* p1 = s1.byte_C(); Byte const* p2 = s2.byte_C(); if (p1 == p2) - return 0; + return 0; int i1 = s1.length_i(); int i2 = s2.length_i(); @@ -167,12 +167,12 @@ int String::index_last_i (char const c) const { if (!length_i()) - return -1; + return -1; char const* me = strh_.ch_C(); char const* p = memrchr (me, length_i(), c); if (p) - return p - me; + return p - me; return -1; } @@ -182,17 +182,17 @@ String::index_last_i (char const* string) const // UGK! assert (false); // broken int length = strlen (string); // ugrh if (!length_i() || !length) - return -1; + return -1; int next_i = index_i (string); if (next_i == -1) - return -1; + return -1; int index_i = 0; while (next_i >= 0) { - index_i += next_i; - next_i = right_str (length_i() - index_i - length).index_i (string ); + index_i += next_i; + next_i = right_str (length_i() - index_i - length).index_i (string ); } return index_i; } @@ -211,7 +211,7 @@ String::index_i (char c) const char const* me = strh_.ch_C(); char const* p = (char const *) memchr (me,c, length_i()); if (p) - return p - me; + return p - me; return -1; } @@ -226,12 +226,12 @@ String::index_i (String searchfor) const { char const* me = strh_.ch_C(); char const* p = (char const *) memmem ( - me, length_i(), searchfor.ch_C(), searchfor.length_i ()); + me, length_i(), searchfor.ch_C(), searchfor.length_i ()); if (p) - return p - me; + return p - me; else - return -1; + return -1; } /** find chars of a set. @@ -244,16 +244,16 @@ String::index_any_i (String set) const { int n = length_i(); if (!n) - return -1; + return -1; void const * me_l = (void const *) strh_.ch_C(); for (int i=0; i < set.length_i(); i++) { - char * found=(char*) memchr (me_l, set[i], n ); - if (found) - { - return found - me_l; - } + char * found=(char*) memchr (me_l, set[i], n ); + if (found) + { + return found - me_l; + } } return -1; } @@ -262,11 +262,11 @@ String String::left_str (int n) const { if (n >= length_i()) - return *this; + return *this; String retval; if (n < 1) - return retval; + return retval; retval = *this; retval.strh_.trunc (n); @@ -277,10 +277,10 @@ String String::right_str (int n) const { if (n > length_i()) - return *this; + return *this; if (n < 1) - return ""; + return ""; return String (strh_.byte_C() + length_i() - n, n); } @@ -291,34 +291,31 @@ String::nomid_str (int index_i, int n) const { if (index_i < 0) { - n += index_i; - index_i = 0; + n += index_i; + index_i = 0; } if (n <= 0) - return *this; + return *this; return - left_str (index_i) + - right_str (length_i() - index_i - n) ; + left_str (index_i) + + right_str (length_i() - index_i - n) ; } -/* - proposal: change to "cut()" - */ String -String::mid_str (int index_i, int n) const +String::cut (int index_i, int n) const { if (index_i <0) { - n += index_i; - index_i=0; + n += index_i; + index_i=0; } if (!length_i() || (index_i < 0) || (index_i >= length_i () ) || (n < 1 ) ) - return String(); + return String(); if ((n > length_i()) || (index_i + n > length_i () ) ) - n = length_i() - index_i; + n = length_i() - index_i; return String (byte_C() + index_i, n); } diff --git a/init/engraver.ly b/init/engraver.ly index eebafed3fd..e8869c0de9 100644 --- a/init/engraver.ly +++ b/init/engraver.ly @@ -81,8 +81,8 @@ Score = \translator { \type Score_engraver; \consists "Timing_engraver"; - \consists "Bar_column_engraver"; - \consists "Bar_number_engraver"; + %\consists "Bar_column_engraver"; + %\consists "Bar_number_engraver"; \consists "Span_score_bar_engraver"; \consists "Score_priority_engraver"; diff --git a/init/lily-init.ly b/init/lily-init.ly index c1753b3263..b47910ac69 100644 --- a/init/lily-init.ly +++ b/init/lily-init.ly @@ -16,7 +16,6 @@ Wordwrap = 0.0 \include "paper16.ly" \include "paper20.ly" - default_paper = \paper{ \paper_sixteen } @@ -29,21 +28,8 @@ left = -1 right = 1 up = 1 down = -1 +% zillie spellink? center=0 - -stemup = { - \skip 1*0; - % Stupid hack to make < { \stemup } > work - \property Voice.ydirection = \up - } -stemboth= { - \skip 1*0; - \property Voice.ydirection = \center -} -stemdown = { - \skip 1*0; - \property Voice.ydirection = \down -} - +\include "property.ly" diff --git a/init/paper16.ly b/init/paper16.ly index 854324b424..98ee62688d 100644 --- a/init/paper16.ly +++ b/init/paper16.ly @@ -26,8 +26,13 @@ paper_sixteen = \paper { arithmetic_basicspace = 2.; arithmetic_multiplier = 4.8\pt; - % - interbeam = 2.667\pt; + % three beams span two interlines, including stafflines: + % 2 interbeam + beam_thickness = 2 interline - staffline_thickness + % ( beam_thickness = 0.48 interline for now...) + % interbeam = interline - (beam_thickness + staffline_thickness) / 2 + % interbeam = 2.84; + % ugh: interline *in fact* is rule_thickness + "interline"? + interbeam = 3.14; gourlay_energybound = 100000.; gourlay_maxmeasures = 14.; diff --git a/init/paper20.ly b/init/paper20.ly index fdfee8404b..e4bd6bfb00 100644 --- a/init/paper20.ly +++ b/init/paper20.ly @@ -19,7 +19,14 @@ paper_twenty = \paper { arithmetic_multiplier = 6.\pt; % - interbeam = 3.333\pt; + % three beams span two interlines, including stafflines: + % 2 interbeam + beam_thickness = 2 interline - staffline_thickness + % ( beam_thickness = 0.48 interline for now...) + % interbeam = interline - (beam_thickness + staffline_thickness) / 2 + % interbeam = 3.6; + % ugh: interline *in fact* is rule_thickness + "interline"? + interbeam = 3.9; + gourlay_energybound = 100000.; gourlay_maxmeasures = 12.; diff --git a/init/property.ly b/init/property.ly new file mode 100644 index 0000000000..4faeb4c6b5 --- /dev/null +++ b/init/property.ly @@ -0,0 +1,94 @@ +% property.ly +% list of properties that lily recognises +% and some shorthands (ugh) + +%{ + +PROPERTIES + +name value effect shorthand + +[Voice] +ydirection -1 force stem down \stemdown +ydirection 0 stem direction free \stemboth +ydirection 1 force stem up \stemup + +[Score?] +beamslopedamping 0 no damping \beamslopeproportional +beamslopedamping 1 damping1) \beamslopedamped +beamslopedamping 100000 zero slope \beamslopezero + +[Score?] +beamquantisation 0 no quantisations \beamposfree +beamquantisation 1 quantise pos and slope \beamposnormal +beamquantisation 2 quantise avoide wedge2) \beampostraditional + + +[Staff?] +instrument ascii midi instrument table lookup + + +1) after beam slope damping table suggested in [Wanske] +2) [Wanske] as well as [Ross] suggests that beams sloped upward must not + start sitting on a staffline, and beams sloped downward must not hang + from a staffline (similar for beam-ends). This would create a wedge + that is traditionally being avoided because it could easily be filled-up + with ink. + However, avoiding these wedges restricts the freedom of beams quite a lot + while they don't seem to be a problem in modern printing. + In no piece of sheetmusic engraved after 1953 (Baerenreiter) i've seen + these wedges being avoided. + +%} + +%hmm, (these) abbrevs suck, imo +% i guess they're meant as some form of doco +% that's what i use them for... +% should compile a list with recognised properties! +stemup = { + \skip 1*0; + % Stupid hack to make < { \stemup } > work + \property Voice.ydirection = \up + } +stemboth= { + \skip 1*0; + \property Voice.ydirection = \center +} +stemdown = { + \skip 1*0; + \property Voice.ydirection = \down +} + +% ugh, cluttering global namespace... +none=0 +free=0 +normal=1 +traditional=2 +infinity=10000 + +beamslopeproportional = { + \property Score.beamslopedamping = \none +} + +beamslopedamped = { + \property Score.beamslopedamping = \normal +} + +beamslopezero = { + \property Score.beamslopedamping = \infinity +} + +% this sucks, you'd want to pass an array, at least +% (or embedded code: you still can't dictate the slope / stemlength) +beamposfree = { + \property Score.beamquantisation = \none +} + +beamposnormal = { + \property Score.beamquantisation = \normal +} + +beampostraditional = { + \property Score.beamquantisation = \traditional +} + diff --git a/init/script.ly b/init/script.ly index 3ccbb82b2e..8db8016258 100644 --- a/init/script.ly +++ b/init/script.ly @@ -51,4 +51,6 @@ rftoe = \script { "ftoe" 0 0 1 0 0 } back = \script { "back" 0 -1 -1 0 0 } front = \script { "front" 0 -1 1 0 0 } -trill =\script { "trill" 0 0 1 0 0 } +trill =\script { "trill" 0 0 1 0 + 2000 % be above text. +} diff --git a/init/table20.ly b/init/table20.ly index 7015bf914a..6742e05630 100644 --- a/init/table20.ly +++ b/init/table20.ly @@ -51,12 +51,12 @@ table_twenty = "empty" "\emptybar" "" "" 0.0\pt 0.0\pt 0.0\pt 16.0\pt "|" "\maatstreep{%}" 0.0\pt 0.64\pt 0.0\pt 20.0\pt - "||" "\doublebar{%}" 0.0\pt 4.0\pt 0.0\pt 20.0\pt - "|." "\finishbar{%}" 0.0\pt 2.0\pt 0.0\pt 20.0\pt + "||" "\doublebar{%}" 0.0\pt 5.0\pt 0.0\pt 20.0\pt + "|." "\finishbar{%}" -5.0\pt 0.0\pt 0.0\pt 20.0\pt ".|" "\startbar{%}" 0.0\pt 4.0\pt 0.0\pt 20.0\pt - ":|" "\repeatbar" -8.0\pt 0.0\pt 0.0\pt 20.0\pt - "|:" "\startrepeat" 0.0\pt 8.0\pt 0.0\pt 20.0\pt - ":|:" "\repeatbarstartrepeat" 0.0\pt 16.0\pt 0.0\pt 20.0\pt + ":|" "\repeatbar" -10.0\pt 0.0\pt 0.0\pt 20.0\pt + "|:" "\startrepeat" 0.0\pt 10.0\pt 0.0\pt 20.0\pt + ":|:" "\repeatbarstartrepeat" 0.0\pt 20.0\pt 0.0\pt 20.0\pt } "meters" = \table { diff --git a/input/beams.ly b/input/beams.ly index 6e897a8475..64db731f8e 100644 --- a/input/beams.ly +++ b/input/beams.ly @@ -10,7 +10,7 @@ TestedFeatures = "beams and beamflags"; \version "0.1.7"; \score{ - \melodic \multi 3 < + \melodic { \multi 3 < { \octave c'; \meter 8/4; \duration8; @@ -23,6 +23,7 @@ TestedFeatures = "beams and beamflags"; \stemup [c c'' a' f'] \duration128; \stemup [c c'' a' f'] + r32 \duration 8; \stemup ['g 'g 'g 'g] @@ -34,9 +35,10 @@ TestedFeatures = "beams and beamflags"; \stemup ['g 'g 'g 'g] \duration 128; \stemup ['g 'g 'g 'g] + r32 } - { \octave c'; + { \octave c'; \meter 8/4; \duration8; \stemdown [a' 'a c e] @@ -48,6 +50,7 @@ TestedFeatures = "beams and beamflags"; \stemdown [a' 'a c e] \duration128; \stemdown [a' 'a c e] + r32 \octave c; \duration 8; @@ -60,7 +63,34 @@ TestedFeatures = "beams and beamflags"; \stemdown [d'' d'' d'' d''] \duration 128; \stemdown [d'' d'' d'' d''] + r32 + + } > + + {\duration "last"; + % ugh, "duration mode" + + [g8 g] [a a] [b b] [c' c'] + + [g16 g ] [a a] [b b] [c' c'] + [g32 g] [a a] [b b] [c' c'] + + [g64 g ] [c' c' ] + } + { + \transpose d { + \octave c'''; + | [g8 g] [a a] [b b] [c' c'] + [g16 g ] [a a] [b b] [c' c'] + [g32 g] [a a] [b b] [c' c'] + [g64 g] + [c' c'] + } } - >} + } + \paper{ + gourlay_maxmeasures = 1.; + } +} diff --git a/input/collisions.ly b/input/collisions.ly index 861ec2d936..cf6c5ad39d 100644 --- a/input/collisions.ly +++ b/input/collisions.ly @@ -81,6 +81,7 @@ restsII = \melodic { \two_voice_steminvert \three_voice \rests + % UGH ! bug! %\restsII } diff --git a/input/font.ly b/input/font.ly index 1ba29f30b2..f1f1e8a006 100644 --- a/input/font.ly +++ b/input/font.ly @@ -1,10 +1,10 @@ \header{ -title= "The Feta font"; +title= "The Feta Font"; subtitle = "proofsheet"; -enteredby = "jcn"; +enteredby = "jcn & hwn"; copyright = "public domain"; -TestedFeatures = "This file tests the Feta music-font" - "(Feta definitively is not an abbreviation of Font-En-TjA)"; +description = "This file tests the Feta music font"; +% "(Feta definitively is not an abbreviation of Font-En-TjA)"; } \version "0.1.7"; diff --git a/input/font20.ly b/input/font20.ly index a0c2192c45..c83989e8e0 100644 --- a/input/font20.ly +++ b/input/font20.ly @@ -1,7 +1,16 @@ +% "This file is a stub to fool make-website" + \header{ -TestedFeatures = "This file is a stub to fool make-website" - "this will display the 20pt version of the proofsheet"; +title= "The Feta font"; +subtitle = "proofsheet"; +enteredby = "jcn"; +copyright = "public domain"; +description = "This file tests the Feta music-font"; +TestedFeatures = + "(Feta definitively is not an abbreviation of Font-En-TjA)"; } + + diff --git a/input/rhythm.ly b/input/rhythm.ly index 897770ad63..8b6ecb031a 100644 --- a/input/rhythm.ly +++ b/input/rhythm.ly @@ -61,20 +61,21 @@ yanother = Score = \translator { \type Score_engraver; - \consists "Bar_align_engraver"; - \consists "Clef_align_engraver"; - \consists "Key_align_engraver"; - \consists "Meter_align_engraver"; - \consists "Score_horizontal_align_engraver"; - \consists "Vertical_align_engraver"; + %\consists "Timing_engraver"; + %\consists "Bar_column_engraver"; + %\consists "Bar_number_engraver"; + \consists "Span_score_bar_engraver"; + \consists "Score_priority_engraver"; + \consists "Priority_horizontal_align_engraver"; + \consists "Vertical_align_engraver"; \accepts "Staff_group"; \accepts "Staff"; \accepts "Lyrics"; \accepts "Grandstaff"; - } +} %% add Timing_engraver to the staff Staff = \translator { diff --git a/input/scsii-menuetto.ly b/input/scsii-menuetto.ly index 889c56e124..febd0720e6 100644 --- a/input/scsii-menuetto.ly +++ b/input/scsii-menuetto.ly @@ -28,6 +28,7 @@ copyright = "public domain"; % % because piece is set very tightly IImenuetto = \melodic{ + \property Voice.beamslopedamping = \infinity \clef"alto"; \property Staff.instrument = cello \meter 3/4; @@ -39,13 +40,15 @@ IImenuetto = \melodic{ %%2 \textstyle "finger"; % ugh. - < [ bes8^"1" e8 c8_"2"_"4" > - a8 bes8-. g8-. ] a4-.^"4" | + < [ bes8^"1"( e8 c8_"2"_"4" > + )a8 bes8-. g8-. ] a4-.^"4" | %%3 + \property Voice.beamslopedamping = \normal < d4 'bes4-. > g4-. [ f8-. e8-. ] | + \property Voice.beamslopedamping = \infinity %%4 - < [ f8 'a > e8 d8 cis8-. 'b8-. 'a8-. ] + < [ f8( 'a > e8 )d8 cis8-. 'b8-. 'a8-. ] %%5 < a2 f2 d2 > bes!4-. | %%6 @@ -61,16 +64,21 @@ IImenuetto = \melodic{ %%9 \clef "violin"; < e'2 a2 \f > + \property Voice.beamslopedamping = \normal [ d'8( e'16 )f'16 ] | + \property Voice.beamslopedamping = \infinity %%10 - < [ e'8 g8 > d' cis'_"2" e' a () g8 ] | + < [ e'8( g8 > d' cis'_"2" )e' a () g8 ] | %%11 \multi 2 < {\stemup a4() d'4 cis'4-. } { \stemdown f2 e4 } > | \stemboth %%12 - < [ g'8^"4" d8 > f' e' f' d'^"3"() c' ] | + % oeps: slur gets attached at d8 iso g'8! +% < [ g'8^"4"( d8 > f' e' )f' d'^"3"() c' ] | + % wrong still... + < { [ g'8^"4"( f' e' )f' d'^"3"() c' ] } { [ d8 ] } > | %%13 \clef "alto"; \multi 2 < @@ -85,9 +93,9 @@ IImenuetto = \melodic{ %%16 [ f( e8 )f a8-. g8-. bes8-. ] | %%17 - < a2^"0" fis2_"3" > bes4 | + < a2^"0"^\trill fis2_"3" > bes4 | %%18 - < { [ c'8 () bes8 c' a8 ] } es8 > fis4 | + < { [ c'8 () bes8 c' a8 ] } es8 > fis4^\trill | %%19 < d'4-\downbow g4 'bes4 > < c'4-\upbow g4 c4 > < [ bes8 d8 > a8 ] | %%20 @@ -101,7 +109,9 @@ IImenuetto = \melodic{ %%22 < { [ g8 () f8 g8 e8 ] } cis8 > < f4 d4 > | %%23 - [ 'g8 g8 ] < e4. 'a4. > d8-\upbow | + \property Voice.beamslopedamping = \normal + [ 'g8 g8 ] < e4.^\trill 'a4. > d8-\upbow | + \property Voice.beamslopedamping = \infinity %%24 \textstyle "roman"; % ugh < d2.^"fine" 'a2. 'd2._"3 mins."> diff --git a/input/spacing.ly b/input/spacing.ly new file mode 100644 index 0000000000..10bb206640 --- /dev/null +++ b/input/spacing.ly @@ -0,0 +1,70 @@ +\header{ +title= "Spacing"; +subtitle = "proofsheet"; +enteredby = "jcn"; +copyright = "public domain"; +TestedFeatures = "This file tests various spacings"; +} + +\version "0.1.7"; + +multipart = \melodic{ + \multi 3 < + { + c4 + c + c c + } + { + [c8 c] + [c c] + [c c] [c c] + } + { + [2/3 c8 c c]1/1 + [2/3 c c c]1/1 + [2/3c c c]1/1 [2/3c c c]1/1 + } + { + [2/4 c8 c c c]1/1 + [2/4 c c c c]1/1 + [2/4c c c c]1/1 [2/4c c c c]1/1 + } + { + [2/5 c8 c c c c]1/1 + [2/5 c c c c c]1/1 + [2/5c c c c c]1/1 [2/5c c c c c]1/1 + } + { + [2/6c8 c c c c c]1/1 + [2/6c c c c c c]1/1 + [2/6c c c c c c]1/1 [2/6c c c c c c]1/1 + } + { + [2/7c8 c c c c c c]1/1 + [2/7c c c c c c c]1/1 + [2/7c c c c c c c]1/1 [2/7c c c c c c c]1/1 + } + > + } + +singlepart = \melodic{ + c4 d e f + c4 d e [f8 f] + c4 d e f8 [f16 f] + c4 d e f8 f16 [f32 f] + c4 d e f8 f16 f32 [f64 f] + c4 c4 c4 c4 + + } + + \score{ + \melodic { + \singlepart + \multipart + } + \paper { +% linewidth= 18.\cm; +% gourlay_maxmeasures = 4.0 + } +} diff --git a/input/standchen-16.ly b/input/standchen-16.ly index 412c202ca2..d8966dfbde 100644 --- a/input/standchen-16.ly +++ b/input/standchen-16.ly @@ -5,6 +5,7 @@ opus = "D. 957 No. 4"; composer = "Franz Schubert (1797-1828)" "Text by Ludwig Rellstab (1799-1860)"; enteredby = "JCN"; +description = "A schubert song in 16 pt"; copyright = "public domain"; } diff --git a/input/standchen-20.ly b/input/standchen-20.ly index cb13ab64d6..ba4a3a043a 100644 --- a/input/standchen-20.ly +++ b/input/standchen-20.ly @@ -6,6 +6,7 @@ composer = "Franz Schubert (1797-1828)" "Text by Ludwig Rellstab (1799-1860)"; enteredby = "JCN"; copyright = "public domain"; +description = "A schubert song in 20 pt"; } \version "0.1.7"; diff --git a/input/standchen-20.tex b/input/standchen-20.tex index f7af3f5151..9d0f09b67d 100644 --- a/input/standchen-20.tex +++ b/input/standchen-20.tex @@ -3,7 +3,7 @@ % % UGH UGH -\advance\oddsidemargin-25mm +\advance\oddsidemargin-30mm \evensidemargin\oddsidemargin \advance\textwidth30mm \addtolength{\textheight}{20mm} diff --git a/input/standchen.ly b/input/standchen.ly index b2a00d2996..739d06d3be 100644 --- a/input/standchen.ly +++ b/input/standchen.ly @@ -493,8 +493,9 @@ themusic = \paper{ \paper_twenty % 20pt music uses whole pagewidth - % ja Vette Pech. Koop maar aan A4 printer - linewidth= 185.\mm; + % ja Vette Pech. Koop maar een A3 printer + % huh? [jcn] + linewidth= 195.\mm; arithmetic_multiplier = 7.\pt; gourlay_maxmeasures = 9.; diff --git a/input/toccata-fuga-E.ly b/input/toccata-fuga-E.ly index 0d5cb37007..1bb3e31ba6 100644 --- a/input/toccata-fuga-E.ly +++ b/input/toccata-fuga-E.ly @@ -1,8 +1,8 @@ \header{ filename = "toccata-fuga-E.ly"; title = "toccata and fuga in E-major "; -opus = "BWV 566" - "toccata 3 bar excerpt" +opus = "BWV 566"; +description = "toccata 3 bar excerpt, " "2nd fuga transposed subject --- 4 bar excerpt"; composer = "Johann Sebastian Bach (1685-1750)"; diff --git a/input/wtk1-fugue2.ly b/input/wtk1-fugue2.ly index 3c9e2f9391..50a2166a00 100644 --- a/input/wtk1-fugue2.ly +++ b/input/wtk1-fugue2.ly @@ -21,7 +21,7 @@ global = \melodic { \meter 4/4; % should be \meter C \keyCminor - \skip 1*32; + \skip 1*31; \bar "|."; | } diff --git a/lib/binary-source-file.cc b/lib/binary-source-file.cc index 306ca97855..111ee743e6 100644 --- a/lib/binary-source-file.cc +++ b/lib/binary-source-file.cc @@ -39,11 +39,11 @@ Binary_source_file::error_str(char const* pos_ch_c_l) const String pre_str((Byte const*)begin_ch_c_l, pos_ch_c_l - begin_ch_c_l); pre_str = String_convert::bin2hex_str(pre_str); for (int i = 2; i < pre_str.length_i(); i += 3) - pre_str = pre_str.left_str(i) + " " + pre_str.mid_str(i, INT_MAX); + pre_str = pre_str.left_str(i) + " " + pre_str.cut(i, INT_MAX); String post_str((Byte const*)pos_ch_c_l, end_ch_c_l - pos_ch_c_l); post_str = String_convert::bin2hex_str(post_str); for (int i = 2; i < post_str.length_i(); i += 3) - post_str = post_str.left_str(i) + " " + post_str.mid_str(i, INT_MAX); + post_str = post_str.left_str(i) + " " + post_str.cut(i, INT_MAX); String str = pre_str + String('\n') diff --git a/lib/source-file.cc b/lib/source-file.cc index 8ad4784259..66a13de2bb 100644 --- a/lib/source-file.cc +++ b/lib/source-file.cc @@ -111,7 +111,7 @@ Source_file::error_str(char const* pos_ch_C) const String str = line_str.left_str(pos_ch_C - begin_ch_C) + String('\n') + String(' ', error_col_i) - + line_str.mid_str(pos_ch_C - begin_ch_C, INT_MAX); // String::mid should take 0 arg.. + + line_str.cut(pos_ch_C - begin_ch_C, INT_MAX); // String::mid should take 0 arg.. return str; } diff --git a/lily/VERSION b/lily/VERSION index 45c0a9da44..15ba649ddb 100644 --- a/lily/VERSION +++ b/lily/VERSION @@ -1,4 +1,4 @@ MAJOR_VERSION = 0 MINOR_VERSION = 1 -PATCH_LEVEL = 38 +PATCH_LEVEL = 39 MY_PATCH_LEVEL = diff --git a/lily/atom.cc b/lily/atom.cc index 090cad2b19..68d85f8e0e 100644 --- a/lily/atom.cc +++ b/lily/atom.cc @@ -56,28 +56,39 @@ Atom::str() const + dim_.y ().str () + "))"; } -String -Atom::TeX_string() const -{ - String tex_str = tex_; - Offset off = off_; +bool +Atom::check_infinity_b ()const +{ + bool ridiculous = false; +#ifndef NDEBUG + /* infinity checks. */ for (int a = X_AXIS; a < NO_AXES; a++) { Axis ax = (Axis)a; - if (abs (off[ax]) >= 100 CM) + if (abs (off_[ax]) >= 100 CM) { warning (_("ridiculous dimension ") + axis_name_str (ax) + ", " - +print_dimen(off[ax])); - off[ax] = 0.0; - tex_str += "\errormark"; + +print_dimen(off_[ax])); + ((Atom*)this)->off_[ax] = 0.0; + ridiculous = true; } } - // whugh.. Hard coded... +#endif + return ridiculous; +} +String +Atom::TeX_string() const +{ + String tex_str = tex_; + if (check_infinity_b ()) + tex_str += "\errormark"; + + // whugh.. Hard coded... String s ("\\placebox{"); - s += print_dimen (off[Y_AXIS])+"}{"; - s += print_dimen (off[X_AXIS]) + "}{"; + s += print_dimen (off_[Y_AXIS])+"}{"; + s += print_dimen (off_[X_AXIS]) + "}{"; s += tex_str + "}"; return s; } @@ -86,10 +97,12 @@ void Atom::translate_axis (Real r, Axis a) { off_[a] += r; + check_infinity_b (); } void Atom::translate (Offset o) { off_ += o; + check_infinity_b (); } diff --git a/lily/axis.cc b/lily/axis.cc index 8689e1c1fe..ff8566988d 100644 --- a/lily/axis.cc +++ b/lily/axis.cc @@ -14,7 +14,7 @@ String axis_name_str (Axis a) { - return String (a + 'x'); + return String (char(a + 'x')); } /* diff --git a/lily/beam-grav.cc b/lily/beam-grav.cc index c86597b17e..2d931e150f 100644 --- a/lily/beam-grav.cc +++ b/lily/beam-grav.cc @@ -50,26 +50,37 @@ Beam_engraver::do_try_request(Request*r) void Beam_engraver::do_process_requests() { - if ( !beam_p_ && span_reqs_drul_[LEFT]) { - current_grouping_p_ = new Rhythmic_grouping; - beam_p_ = new Beam; - if (span_reqs_drul_[LEFT]->nplet) - { - plet_spanner_p_ = new Text_spanner(); - Text_def *defp = new Text_def; - plet_spanner_p_->set_support (beam_p_); - - // ugh - plet_spanner_p_->set_bounds (LEFT, get_staff_info ().command_pcol_l ()); + if ( !beam_p_ && span_reqs_drul_[LEFT]) + { + current_grouping_p_ = new Rhythmic_grouping; + beam_p_ = new Beam; + if (span_reqs_drul_[LEFT]->nplet) + { + plet_spanner_p_ = new Text_spanner; + Text_def *defp = new Text_def; + plet_spanner_p_->set_support (beam_p_); - defp->align_i_ = 0; - defp->text_str_ = span_reqs_drul_[LEFT]->nplet; - defp->style_str_="italic"; - plet_spanner_p_->spec_p_ = defp; - announce_element (Score_elem_info(plet_spanner_p_,0)); - } - announce_element (Score_elem_info (beam_p_, span_reqs_drul_[LEFT])); - } + defp->align_i_ = 0; + defp->text_str_ = span_reqs_drul_[LEFT]->nplet; + defp->style_str_="italic"; + plet_spanner_p_->spec_p_ = defp; + announce_element (Score_elem_info(plet_spanner_p_,0)); + } + + Scalar prop = get_property ("beamslopedamping"); + if (prop.isnum_b ()) + { + beam_p_->damping_i_ = prop; + } + + prop = get_property ("beamquantisaton"); + if (prop.isnum_b ()) + { + beam_p_->quantisation_ = (Beam::Quantise)(int)prop; + } + + announce_element (Score_elem_info (beam_p_, span_reqs_drul_[LEFT])); + } } void diff --git a/lily/beam.cc b/lily/beam.cc index bde4ae2711..450c12db14 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -34,18 +34,29 @@ IMPLEMENT_IS_TYPE_B1 (Beam, Spanner); -const int MINIMUM_STEMLEN = 5; +// ugh, hardcoded +const int MINIMUM_STEMLEN[] = { + 0, // just in case + 5, + 4, + 3, + 2, + 2, +}; Beam::Beam () { - slope_f = 0; - left_y = 0.0; + slope_f_ = 0; + left_y_ = 0.0; + damping_i_ = 1; + quantisation_ = NORMAL; + multiple_i_ = 0; } void Beam::add (Stem*s) { - stems.push (s); + stems_.push (s); s->add_dependency (this); s->beam_l_ = this; @@ -60,16 +71,16 @@ Beam::brew_molecule_p () const { Molecule *mol_p = new Molecule; Real inter_f = paper ()->internote_f (); - Real x0 = stems[0]->hpos_f (); - for (int j=0; j hpos_f (); + for (int j=0; j 0)? stems[j-1] : 0; - Stem * next = (j < stems.size ()-1) ? stems[j+1] :0; + Stem *i = stems_[j]; + Stem * prev = (j > 0)? stems_[j-1] : 0; + Stem * next = (j < stems_.size ()-1) ? stems_[j+1] :0; Molecule sb = stem_beams (i, next, prev); Real x = i->hpos_f ()-x0; - sb.translate (Offset (x, (x * slope_f + left_y)* inter_f)); + sb.translate (Offset (x, (x * slope_f_ + left_y_)* inter_f)); mol_p->add (sb); } mol_p->translate_axis (x0 - spanned_drul_[LEFT]->absolute_coordinate (X_AXIS), X_AXIS); @@ -80,7 +91,7 @@ Offset Beam::center () const { Real w= (paper ()->note_width () + width ().length ())/2.0; - return Offset (w, (left_y + w* slope_f)*paper ()->internote_f ()); + return Offset (w, (left_y_ + w* slope_f_)*paper ()->internote_f ()); } void @@ -94,7 +105,7 @@ void Beam::do_print () const { #ifndef NPRINT - DOUT << "slope_f " <is_type_b (Stem::static_name ())) - stems.substitute ((Stem*)o->item (), n? (Stem*) n->item ():0); + stems_.substitute ((Stem*)o->item (), n? (Stem*) n->item ():0); } Interval Beam::do_width () const { - return Interval (stems[0]->hpos_f (), - stems.top ()->hpos_f ()); + return Interval (stems_[0]->hpos_f (), + stems_.top ()->hpos_f ()); } void @@ -135,9 +146,9 @@ Beam::set_default_dir () count[UP] = count[DOWN] = 0; Direction d = DOWN; - for (int i=0; i dir_ ? (1 + d * s->dir_)/2 : s->get_center_distance (Direction (-d)); @@ -155,29 +166,30 @@ Beam::set_default_dir () count[d] = 1; } while ((d *= -1) != DOWN); - /* the following relation is equal to - up / up_count > down / down_count - */ - dir_ = (total[UP] * count[DOWN] > total[DOWN] * count[UP]) ? UP : DOWN; + /* + + [Ross] states that the majority of the notes dictates the + direction (and not the mean of "center distance") + */ + dir_ = (total[UP] > total[DOWN]) ? UP : DOWN; - for (int i=0; i dir_ = dir_; } } /* should use minimum energy formulation (cf linespacing) - */ void Beam::solve_slope () { Array sinfo; - for (int j=0; j set_default_extents (); if (i->invisible_b ()) @@ -187,11 +199,11 @@ Beam::solve_slope () sinfo.push (info); } if (! sinfo.size ()) - slope_f = left_y = 0; + slope_f_ = left_y_ = 0; else if (sinfo.size () == 1) { - slope_f = 0; - left_y = sinfo[0].idealy_f_; + slope_f_ = 0; + left_y_ = sinfo[0].idealy_f_; } else { @@ -204,37 +216,38 @@ Beam::solve_slope () l.input.push (Offset (sinfo[i].x, sinfo[i].idealy_f_)); } - l.minimise (slope_f, left_y); + l.minimise (slope_f_, left_y_); } Real dy = 0.0; for (int i=0; i < sinfo.size (); i++) { - Real y = sinfo[i].x * slope_f + left_y; + Real y = sinfo[i].x * slope_f_ + left_y_; Real my = sinfo[i].miny_f_; if (my - y > dy) dy = my -y; } - left_y += dy; - left_y *= dir_; + left_y_ += dy; + left_y_ *= dir_; - slope_f *= dir_; + slope_f_ *= dir_; /* - This neat trick is by Werner Lemberg, damped = tanh (slope_f) corresponds + This neat trick is by Werner Lemberg, damped = tanh (slope_f_) corresponds with some tables in [Wanske] */ - slope_f = 0.6 * tanh (slope_f); + if (damping_i_) + slope_f_ = 0.6 * tanh (slope_f_) / damping_i_; quantise_yspan (); // y-values traditionally use internote dimension: therefore slope = (y/in)/x // but mf and beam-lookup use PT dimension for y (as used for x-values) // ugh --- there goes our simplified but careful quantisation - Real sl = slope_f * paper ()->internote_f (); - paper ()->lookup_l ()->beam (sl, 20 PT); - slope_f = sl / paper ()->internote_f (); + Real sl = slope_f_ * paper ()->internote_f (); + paper ()->lookup_l ()->beam (sl, 20 PT, 1 PT); + slope_f_ = sl / paper ()->internote_f (); } void @@ -242,12 +255,16 @@ Beam::quantise_yspan () { /* [Ross] (simplification of) - Try to set slope_f complying with y-span of: + Try to set slope_f_ complying with y-span of: - zero - beam_thickness / 2 + staffline_thickness / 2 - beam_thickness + staffline_thickness + n * interline */ + + if (!quantisation_) + return; + Real interline_f = paper ()->interline_f (); Real internote_f = interline_f / 2; Real staffline_thickness = paper ()->rule_thickness (); @@ -260,9 +277,9 @@ Beam::quantise_yspan () beam_thickness + staffline_thickness }; - Real xspan_f = stems.top ()->hpos_f () - stems[0]->hpos_f (); + Real xspan_f = stems_.top ()->hpos_f () - stems_[0]->hpos_f (); // y-values traditionally use internote dimension: therefore slope = (y/in)/x - Real yspan_f = xspan_f * abs (slope_f * internote_f); + Real yspan_f = xspan_f * abs (slope_f_ * internote_f); int yspan_i = (int)(yspan_f / interline_f); Real q = (yspan_f / interline_f - yspan_i) * interline_f; int i = 0; @@ -281,7 +298,7 @@ Beam::quantise_yspan () yspan_f = (Real)yspan_i * interline_f + q; // y-values traditionally use internote dimension: therefore slope = (y/in)/x - slope_f = yspan_f / xspan_f / internote_f * sign (slope_f); + slope_f_ = yspan_f / xspan_f / internote_f * sign (slope_f_); } void @@ -292,6 +309,9 @@ Beam::quantise_left_y (Beam::Pos pos, bool extend_b) if extend then stems must not get shorter */ + if (!quantisation_) + return; + Real interline_f = paper ()->interline_f (); Real internote_f = interline_f / 2; Real staffline_thickness = paper ()->rule_thickness (); @@ -299,11 +319,11 @@ Beam::quantise_left_y (Beam::Pos pos, bool extend_b) const int QUANTS = 6; Real qy[QUANTS] = { - -staffline_thickness, + 0, beam_thickness / 2, - beam_thickness + staffline_thickness / 2, + beam_thickness, interline_f / 2 + beam_thickness / 2 + staffline_thickness / 2, - interline_f - staffline_thickness, + interline_f, interline_f + beam_thickness / 2, }; /* @@ -322,7 +342,7 @@ Beam::quantise_left_y (Beam::Pos pos, bool extend_b) }; // y-values traditionally use internote dimension - Real y = left_y * internote_f; + Real y = left_y_ * internote_f; int y_i = (int)floor(y / interline_f); y = (y / interline_f - y_i) * interline_f; @@ -362,34 +382,37 @@ Beam::quantise_left_y (Beam::Pos pos, bool extend_b) Real lower_y = (qy[lower_i] + interline_f * y_i) / internote_f; if (extend_b) - left_y = (dir_ > 0 ? upper_y : lower_y); + left_y_ = (dir_ > 0 ? upper_y : lower_y); else - left_y = (upper_y - left_y < y - lower_y ? upper_y : lower_y); + left_y_ = (upper_y - left_y_ < y - lower_y ? upper_y : lower_y); } void Beam::set_stemlens () { - Real x0 = stems[0]->hpos_f (); + Real x0 = stems_[0]->hpos_f (); Real dy = 0; Real interline_f = paper ()->interline_f (); Real internote_f = interline_f / 2; Real staffline_thickness = paper ()->rule_thickness (); Real beam_thickness = 0.48 * (interline_f - staffline_thickness); - Real xspan_f = stems.top ()->hpos_f () - stems[0]->hpos_f (); + Real interbeam_f = paper ()->interbeam_f (); + if (multiple_i_ > 3) + interbeam_f += 2.0 * staffline_thickness / 4; + Real xspan_f = stems_.top ()->hpos_f () - stems_[0]->hpos_f (); /* ugh, y values are in "internote" dimension */ - Real yspan_f = xspan_f * abs (slope_f * internote_f); + Real yspan_f = xspan_f * abs (slope_f_ * internote_f); int yspan_i = (int)(yspan_f / interline_f); Pos left_pos = NONE; - if (yspan_f < staffline_thickness / 2) + if ((yspan_f < staffline_thickness / 2) || (quantisation_ == NORMAL)) left_pos = (Pos)(STRADDLE | SIT | HANG); else - left_pos = (Pos) (sign (slope_f) > 0 ? STRADDLE | HANG + left_pos = (Pos) (sign (slope_f_) > 0 ? STRADDLE | HANG : SIT | STRADDLE); /* @@ -400,25 +423,29 @@ Beam::set_stemlens () if (q < interline_f / 3 - beam_thickness / 2) left_pos = (Pos) (left_pos | INTER); - if (stems[0]->beams_right_i_ > 1) - left_pos = (Pos)(left_pos & (STRADDLE | INTER)); + if (multiple_i_ > 1) + left_pos = (Pos) (dir_ > 0 ? HANG : SIT); // ugh, rounding problems! const Real EPSILON = interline_f / 10; do { - left_y += dy * dir_; + left_y_ += dy * dir_; quantise_left_y (left_pos, dy); dy = 0; - for (int j=0; j < stems.size (); j++) + for (int j=0; j < stems_.size (); j++) { - Stem *s = stems[j]; + Stem *s = stems_[j]; Real x = s->hpos_f () - x0; - s->set_stemend (left_y + slope_f * x); + s->set_stemend (left_y_ + slope_f_ * x); Real y = s->stem_length_f (); - if (y < MINIMUM_STEMLEN) - dy = dy >? (MINIMUM_STEMLEN - y); + int mult = max (stems_[j]->beams_left_i_, stems_[j]->beams_right_i_); + if (mult > 1) + // dim(y) = internote + y -= (mult - 1) * interbeam_f / internote_f; + if (y < MINIMUM_STEMLEN[mult]) + dy = dy >? (MINIMUM_STEMLEN[mult] - y); } } while (abs (dy) > EPSILON); } @@ -428,16 +455,16 @@ Beam::set_grouping (Rhythmic_grouping def, Rhythmic_grouping cur) { def.OK (); cur.OK (); - assert (cur.children.size () == stems.size ()); + assert (cur.children.size () == stems_.size ()); cur.split (def); Array b; { Array flags; - for (int j=0; j flag_i_ - 2; assert (f>0); @@ -447,14 +474,15 @@ Beam::set_grouping (Rhythmic_grouping def, Rhythmic_grouping cur) b= cur.generate_beams (flags, fi); b.insert (0,0); b.push (0); - assert (stems.size () == b.size ()/2); + assert (stems_.size () == b.size ()/2); } - for (int j=0, i=0; i < b.size () && j beams_left_i_ = b[i]; s->beams_right_i_ = b[i+1]; + multiple_i_ = multiple_i_ >? (b[i] >? b[i+1]); } } @@ -466,11 +494,18 @@ 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_f ()*2; - Real dy = paper ()->interbeam_f (); - Real stemdx = paper ()->rule_thickness (); - Real sl = slope_f*paper ()->internote_f (); - paper ()->lookup_l ()->beam (sl, 20 PT); + + Real staffline_thickness = paper ()->rule_thickness (); + Real interbeam_f = paper ()->interbeam_f (); + Real internote_f =paper ()->internote_f (); + Real interline_f = 2 * internote_f; + Real beamheight_f = 0.48 * (interline_f - staffline_thickness); + if (multiple_i_ > 3) + interbeam_f += 2.0 * staffline_thickness / 4; + Real dy = interbeam_f; + Real stemdx = staffline_thickness; + Real sl = slope_f_* internote_f; + paper ()->lookup_l ()->beam (sl, 20 PT, 1 PT); Molecule leftbeams; Molecule rightbeams; @@ -480,10 +515,10 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const { int lhalfs= lhalfs = here->beams_left_i_ - prev->beams_right_i_ ; int lwholebeams= here->beams_left_i_ beams_right_i_ ; - Real w = (here->hpos_f () - prev->hpos_f ())/4; + Real w = (here->hpos_f () - prev->hpos_f ())/4 note_width ();; Atom a; if (lhalfs) // generates warnings if not - a = paper ()->lookup_l ()->beam (sl, w); + a = paper ()->lookup_l ()->beam (sl, w, beamheight_f); a.translate (Offset (-w, -w * sl)); for (int j = 0; j < lhalfs; j++) { @@ -499,8 +534,8 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const int rwholebeams = here->beams_right_i_ beams_left_i_; Real w = next->hpos_f () - here->hpos_f (); - Atom a = paper ()->lookup_l ()->beam (sl, w + stemdx); - + Atom a = paper ()->lookup_l ()->beam (sl, w + stemdx, beamheight_f); + a.translate_axis( - stemdx/2, X_AXIS); int j = 0; Real gap_f = 0; if (here->beam_gap_i_) @@ -515,7 +550,7 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const // TODO: notehead widths differ for different types gap_f = paper ()->note_width () / 2; w -= 2 * gap_f; - a = paper ()->lookup_l ()->beam (sl, w + stemdx); + a = paper ()->lookup_l ()->beam (sl, w + stemdx, beamheight_f); } for (; j < rwholebeams; j++) @@ -525,9 +560,9 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const rightbeams.add (b); } - w /= 4; + w = w/4 note_width (); if (rhalfs) - a = paper ()->lookup_l ()->beam (sl, w); + a = paper ()->lookup_l ()->beam (sl, w, beamheight_f); for (; j < rwholebeams + rhalfs; j++) { @@ -538,5 +573,12 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const } leftbeams.add (rightbeams); + + /* + Does beam quanting think of the asymetry of beams? + Refpoint is on bottom of symbol. (FIXTHAT) --hwn. + */ + if (experimental_features_global_b && dir_ < 0) + leftbeams.translate_axis (-beamheight_f, Y_AXIS); return leftbeams; } diff --git a/lily/bow.cc b/lily/bow.cc index 918d4c503a..1f75bba5de 100644 --- a/lily/bow.cc +++ b/lily/bow.cc @@ -13,7 +13,7 @@ Bow::Bow() { - pos_i_drul_[LEFT] = pos_i_drul_[RIGHT] = 0; + dy_f_drul_[LEFT] = dy_f_drul_[RIGHT] = 0; dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0; } @@ -21,11 +21,11 @@ Bow::Bow() Offset Bow::center() const { - int dy = pos_i_drul_[RIGHT]-pos_i_drul_[LEFT]; + Real dy = dy_f_drul_[RIGHT]-dy_f_drul_[LEFT]; Real w = width().length (); - return Offset (w/2,dy * paper()->internote_f ()); + return Offset (w/2,dy ); } @@ -35,19 +35,20 @@ Bow::brew_molecule_p() const Molecule*output = new Molecule; Real w = width().length (); - int dy = pos_i_drul_[RIGHT] - pos_i_drul_[LEFT]; + Real dy_f = dy_f_drul_[RIGHT] - dy_f_drul_[LEFT]; Real nw_f = paper()->note_width (); Real nh_f = paper()->internote_f (); - w+= (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]) * nw_f ; + w+= (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]); Real round_w = w; // slur lookup rounds the slurwidth . - Atom a = paper()->lookup_l ()->slur (dy , round_w, dir_); + Atom a = paper()->lookup_l ()->slur (dy_f, round_w, dir_); Real error = w-round_w; - a.translate (Offset ((dx_f_drul_[LEFT] + 0.5)*nw_f + error/2, - pos_i_drul_[LEFT] * nh_f)); + a.translate (Offset ((dx_f_drul_[LEFT] + 0.5*nw_f) + + error/2, + dy_f_drul_[LEFT])); output->add (a); return output; } diff --git a/lily/colhpos.cc b/lily/colhpos.cc index 62cc881bde..a220298777 100644 --- a/lily/colhpos.cc +++ b/lily/colhpos.cc @@ -51,11 +51,17 @@ Col_hpositions::OK() const } void -Col_hpositions::stupid_solution() +Col_hpositions::set_stupid_solution(Vector v) { energy_f_ = infinity_f; ugh_b_ = true; - config = spacer_l_->default_solution(); + config = v; +} + +void +Col_hpositions::stupid_solution() +{ + set_stupid_solution (spacer_l_->default_solution()); } void diff --git a/lily/crescendo.cc b/lily/crescendo.cc index ffe6648c53..22920506ec 100644 --- a/lily/crescendo.cc +++ b/lily/crescendo.cc @@ -12,11 +12,12 @@ #include "lookup.hh" #include "paper-def.hh" #include "debug.hh" +#include "score-column.hh" Crescendo::Crescendo() { grow_dir_ =0; - dir_ = DOWN ; + dir_ = DOWN; dyn_b_drul_[LEFT] = dyn_b_drul_[RIGHT] =false; } @@ -47,7 +48,16 @@ Crescendo::get_symbol() const w_dim = 0; } - return Atom (paper()->lookup_l ()->hairpin (w_dim, grow_dir_ < 0)); + Drul_array broken; + Direction d = LEFT; + do { + Score_column* s = (Score_column* )spanned_drul_[d] ; // UGH + broken[d] = (!s->musical_b()); + } while ((d *= -1) != LEFT); + + + bool continued = broken[(Direction)-grow_dir_]; + return Atom (paper()->lookup_l ()->hairpin (w_dim, grow_dir_ < 0, continued)); } Molecule* diff --git a/lily/include/atom.hh b/lily/include/atom.hh index 22b4cec972..4b76e4018c 100644 --- a/lily/include/atom.hh +++ b/lily/include/atom.hh @@ -15,10 +15,11 @@ /// a symbol which can be translated, and freely copied -struct Atom { +class Atom { + Offset off_; +public: String tex_; Box dim_; - Offset off_; String str() const; // for printing. Atom (String, Box); @@ -29,5 +30,6 @@ struct Atom { Box extent() const; void print() const; String TeX_string() const; + bool check_infinity_b () const; }; #endif diff --git a/lily/include/beam.hh b/lily/include/beam.hh index 130df73d5d..1b9710034c 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -10,22 +10,30 @@ #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 */ +/** 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 */ class Beam: public Directional_spanner { public: enum Pos { NONE, SIT = 1, STRADDLE = 2, HANG = 4, INTER = 8 }; + // ugh, silly C++ + enum Quantise { NUN, NORMAL, TRADITIONAL }; - Link_array stems; + Link_array stems_; /// the slope of the beam in posns / point (dimension) - Real slope_f; + Real slope_f_; /// position of leftmost end of beam - Real left_y; - + Real left_y_; + /// should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams + int damping_i_; + /// should beam pos / slope be quantised? 0: no, 1: yes, 2: traditional + Quantise quantisation_; + /// maximum number of beams (for opening-up of beam-spacing) + int multiple_i_; + - /* *************** */ DECLARE_MY_RUNTIME_TYPEINFO; Beam(); void add (Stem*); diff --git a/lily/include/bow.hh b/lily/include/bow.hh index 1ef139c60e..5583156743 100644 --- a/lily/include/bow.hh +++ b/lily/include/bow.hh @@ -17,9 +17,9 @@ */ class Bow : public Directional_spanner { protected: - Drul_array pos_i_drul_; + Drul_array dy_f_drul_; Drul_array dx_f_drul_; - + Molecule*brew_molecule_p() const; public: Bow(); diff --git a/lily/include/colhpos.hh b/lily/include/colhpos.hh index 56f70c8506..3c42dd98cb 100644 --- a/lily/include/colhpos.hh +++ b/lily/include/colhpos.hh @@ -13,25 +13,26 @@ typedef Array Line_of_cols; struct Col_hpositions { - Line_spacer * spacer_l_; - bool ugh_b_; - Line_of_cols error_col_l_arr_; - Line_of_cols cols; - Array config; - Real energy_f_; - bool satisfies_constraints_b_; - - /* ************** */ - void OK() const; - ~Col_hpositions(); - void solve_line(); - void approximate_solve_line(); - /** generate a solution with no regard to idealspacings or - constraints. should always work */ - void stupid_solution(); - Col_hpositions(); - void add (Paper_column*c); - void print() const; + Line_spacer * spacer_l_; + bool ugh_b_; + Line_of_cols error_col_l_arr_; + Line_of_cols cols; + Array config; + Real energy_f_; + bool satisfies_constraints_b_; + + /* ************** */ + void OK() const; + ~Col_hpositions(); + void solve_line(); + void approximate_solve_line(); + /** generate a solution with no regard to idealspacings or + constraints. should always work */ + void stupid_solution(); + void set_stupid_solution (Vector); + Col_hpositions(); + void add (Paper_column*c); + void print() const; }; diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index 31f496a4b4..39dc5ae9b0 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -32,7 +32,9 @@ struct Lookup { Atom beam_element (int,int,Real=0) const; /// round slope to closest TeXslope - Atom beam (Real&,Real) const; + Atom beam (Real&,Real, Real) const; + Atom ps_beam (Real, Real, Real)const; + Atom tex_beam (Real&, Real) const; Atom streepje (int type) const; @@ -48,13 +50,15 @@ struct Lookup { Atom bar (String, Real height) const; Atom dots () const; - Atom slur (int dy, Real &dx, Direction dir) const; + Atom slur (Real &dy, Real &dx, Direction dir) const; + Atom tex_slur (int dy, Real &dx, Direction dir) const; + Atom ps_slur (Real dy, Real dx, Real dir) const; Atom half_slur (int dy, Real &dx, Direction dir, int xpart) const; Atom half_slur_middlepart (Real &dx, Direction dir) const; Atom big_slur (int dy, Real &dx, Direction dir) const; Atom text (String style, String text, int align = 1) const; Atom script (String idx) const; - Atom hairpin (Real & width, bool decresc) const; + Atom hairpin (Real & width, bool decresc, bool continued) const; Atom dynamic (String) const; }; diff --git a/lily/include/main.hh b/lily/include/main.hh index 13f3c8fb7b..1a95d9d203 100644 --- a/lily/include/main.hh +++ b/lily/include/main.hh @@ -18,12 +18,13 @@ void set_default_output (String s); String find_file (String); String get_version_str(); String get_version_number_str(); -extern Sources* source_l_g; -extern bool only_midi; +extern Sources* source_global_l; +extern bool no_paper_global_b; extern int exit_status_i_; extern bool experimental_features_global_b; extern bool postscript_global_b; -extern String default_out_fn; - +extern String default_outname_base_global; +extern String default_outname_suffix_global; +extern int default_count_global; #endif diff --git a/lily/include/midi-def.hh b/lily/include/midi-def.hh index dbdcead0ff..9d58a1b311 100644 --- a/lily/include/midi-def.hh +++ b/lily/include/midi-def.hh @@ -20,6 +20,7 @@ definitions for midi output. Rather empty */ class Midi_def : public Music_output_def { + static int default_count_i_; public: VIRTUAL_COPY_CONS(Midi_def, Music_output_def); DECLARE_MY_RUNTIME_TYPEINFO; @@ -34,6 +35,7 @@ public: int get_tempo_i (Moment moment); void print() const; void set_tempo (Moment moment, int count_per_minute_i); + virtual int get_next_default_count () const; }; #endif // MIDI_DEF_HH diff --git a/lily/include/music-output-def.hh b/lily/include/music-output-def.hh index 26dacffa31..2c8fa3093a 100644 --- a/lily/include/music-output-def.hh +++ b/lily/include/music-output-def.hh @@ -37,6 +37,7 @@ public: void assign_translator (String, Translator*); String outfile_str_; Translator * find_translator_l (String) const; + virtual int get_next_default_count () const; }; #endif // Music_output_DEF_HH diff --git a/lily/include/paper-def.hh b/lily/include/paper-def.hh index 826918fa2f..162bb656e6 100644 --- a/lily/include/paper-def.hh +++ b/lily/include/paper-def.hh @@ -35,7 +35,7 @@ class Paper_def : public Music_output_def { Lookup *lookup_p_; Dictionary *real_vars_p_; - + static int default_count_i_; protected: VIRTUAL_COPY_CONS(Paper_def,Music_output_def); public: @@ -83,6 +83,7 @@ public: Real geometric_spacing(Moment) const; Real arithmetic_constant(Moment minimal_mom) const; Real arithmetic_spacing( Moment mom,Real constant) const; + virtual int get_next_default_count () const; String TeX_output_settings_str () const; }; diff --git a/lily/include/spring-spacer.hh b/lily/include/spring-spacer.hh index f5a40b63da..7d30e4493a 100644 --- a/lily/include/spring-spacer.hh +++ b/lily/include/spring-spacer.hh @@ -56,9 +56,6 @@ class Spring_spacer : public Line_spacer { /// generate an (nonoptimal) solution Vector find_initial_solution() const; - /// check if problem is too tight - bool check_feasible() const; - /// does #this# contain the column #w#? bool contains (Paper_column const *w); diff --git a/lily/include/text-spanner.hh b/lily/include/text-spanner.hh index c5c9cae052..9a6665625a 100644 --- a/lily/include/text-spanner.hh +++ b/lily/include/text-spanner.hh @@ -15,23 +15,24 @@ triplets, eentweetjes, ottava, etc. */ class Text_spanner : public Spanner { public: - Directional_spanner * support_span_l_; - General_script_def * spec_p_; - Offset text_off_; - DECLARE_MY_RUNTIME_TYPEINFO; + Directional_spanner * support_span_l_; + General_script_def * spec_p_; + Offset text_off_; + DECLARE_MY_RUNTIME_TYPEINFO; - void set_support (Directional_spanner*); - Text_spanner(); - Text_spanner (Text_spanner const&); + void set_support (Directional_spanner*); + Text_spanner(); + Text_spanner (Text_spanner const&); protected: - SCORE_ELEM_CLONE(Text_spanner); - ~Text_spanner(); - virtual void do_substitute_dependency (Score_elem*,Score_elem*); - virtual void do_pre_processing(); - virtual void do_post_processing(); - virtual Interval height() const ; - virtual Molecule* brew_molecule_p() const; - virtual void do_print() const; + SCORE_ELEM_CLONE(Text_spanner); + ~Text_spanner(); + virtual void do_add_processing (); + virtual void do_substitute_dependency (Score_elem*,Score_elem*); + virtual void do_pre_processing(); + virtual void do_post_processing(); + virtual Interval height() const ; + virtual Molecule* brew_molecule_p() const; + virtual void do_print() const; }; #endif // TEXTSPANNER_HH diff --git a/lily/lexer.l b/lily/lexer.l index 840e2b31ce..f2d6c9214e 100644 --- a/lily/lexer.l +++ b/lily/lexer.l @@ -132,7 +132,7 @@ ESCAPED [nt\\'"] String s (YYText ()+1); s = s.left_str (s.length_i ()-1); DOUT << "#include `" << s << "\'\n"; - new_input (s,source_l_g); + new_input (s,source_global_l); yy_pop_state (); } \"[^"]* { // backup rule diff --git a/lily/lookup.cc b/lily/lookup.cc index 319b038bad..a4dc393ec0 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -8,7 +8,7 @@ TODO This doth suck. We should have PS output, and read spacing info from TFMs - Glissando, bracket + Glissando, */ @@ -157,7 +157,7 @@ Lookup::streepje (int type) const } Atom -Lookup::hairpin (Real &wid, bool decresc) const +Lookup::hairpin (Real &wid, bool decresc, bool continued) const { bool embedded_b = postscript_global_b; String embed; @@ -167,7 +167,8 @@ Lookup::hairpin (Real &wid, bool decresc) const Real height = 2 PT; embed = "\\embeddedps{\n" ; embed += String (wid) + " " - + String (height) + + String (height) + " " + + String (continued ? height/2 : 0) + + " draw_" + String(decresc ? "de" : "") + "cresc}\n"; ret.tex_ = embed; } @@ -237,7 +238,7 @@ Lookup::vbrace (Real &y) const Interval ydims = brace.dim_[Y_AXIS]; Real min_y = ydims[LEFT]; Real max_y = ydims[RIGHT]; - Real step = 2.0 PT; + Real step = 1.0 PT; if (y < min_y) { diff --git a/lily/main.cc b/lily/main.cc index 897c84daaa..4bed727ec5 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -21,10 +21,11 @@ #include "my-lily-parser.hh" static bool version_ignore_b = false; -Sources* source_l_g = 0; -bool only_midi = false; +Sources* source_global_l = 0; +bool no_paper_global_b = false; + bool experimental_features_global_b = false; -bool postscript_global_b = false; +bool postscript_global_b = true; int exit_status_i_; void destill_inname (String &name_str_r); @@ -37,8 +38,8 @@ Long_option_init theopts[] = { {0, "debug", 'd'}, {1, "init", 'i'}, {1, "include", 'I'}, - {0, "midi", 'M'}, - {0, "postscript", 'p'}, + {0, "no-midi", 'M'}, + {0, "no-postscript", 'P'}, {0, "ignore-version", 'V'}, {0,0,0} }; @@ -47,7 +48,7 @@ void usage() { cout << - _("Usage: lilypond [options] [mudela-file]\n" + _("Usage: lilypond [options] [mudela-files]\n" "Typeset and or produce midi output from mudela-file or stdin\n" "\n" "Options:\n" @@ -58,9 +59,9 @@ usage() " -w, --warranty show warranty and copyright\n" " -o, --output=FILE set FILE as default output\n" " -t, --test switch on experimental features\n" - " -M, --midi produce midi output only\n" + " -M, --no-paper produce midi output only\n" " -V, --ignore-version ignore mudela version\n" - " -p, --postscript try to use PostScript\n" + " -P, --no-postscript don't use PostScript\n" "\n" "GNU LilyPond was compiled with the following settings:\n") #ifdef NDEBUG @@ -87,7 +88,7 @@ notice() cout << _("\n" "GNU LilyPond -- The GNU Project music typesetter.\n" - "Copyright 1996,97 by\n" + "Copyright 1996, 97, 98 by\n" " Han-Wen Nienhuys \n" " Jan Nieuwenhuizen \n" "\n" @@ -124,13 +125,22 @@ do_one_file (String init_str, String file_str) } Sources sources; - source_l_g = &sources; - source_l_g->set_path (&path); + source_global_l = &sources; + source_global_l->set_path (&path); { - My_lily_parser parser (source_l_g); + My_lily_parser parser (source_global_l); parser.set_version_check (version_ignore_b); parser.parse_file (init_str, file_str); - + + if (file_str.length_i() && file_str[0] != '-') + { + String a,b,c,d; + split_path (file_str, a, b, c, d); + default_outname_base_global = c; + } + else + default_outname_base_global = "lelie"; + if (parser.error_level_i_) { exit_status_i_ = 1; @@ -139,28 +149,33 @@ do_one_file (String init_str, String file_str) do_scores(); clear_scores (); } - source_l_g = 0; + source_global_l = 0; +} + +void +identify () +{ + cout << get_version_str() << endl; } int main (int argc, char **argv) { + identify (); debug_init(); // should be first // must override (come before) "/usr/local/share/lilypond"! - char const * env_l=getenv ("LILYINCLUDE"); - if (env_l) - { - path.add (env_l); - } + char const *env_sz = getenv ("LILYINCLUDE"); + if (env_sz) + path.parse_path (env_sz); + path.add (""); path.add (String (DIR_DATADIR) + "/init/"); path.push (DIR_DATADIR); Getopt_long oparser (argc, argv,theopts); - cout << get_version_str() << endl; String init_str ("lily-init.ly"); while (Long_option_init const * opt = oparser()) @@ -171,7 +186,7 @@ main (int argc, char **argv) experimental_features_global_b = true; break; case 'o': - set_default_output (oparser.optional_argument_ch_C_); + default_outname_base_global = oparser.optional_argument_ch_C_; break; case 'w': notice(); @@ -190,14 +205,14 @@ main (int argc, char **argv) case 'V': version_ignore_b = true; break; - case 'p': - postscript_global_b = true; + case 'P': + postscript_global_b = false; break; case 'd': set_debug (true); break; case 'M': - only_midi = true; + no_paper_global_b = true; break; default: assert (false); diff --git a/lily/midi-def.cc b/lily/midi-def.cc index 1415298439..480e0a7969 100644 --- a/lily/midi-def.cc +++ b/lily/midi-def.cc @@ -23,7 +23,6 @@ Midi_def::Midi_def() { - outfile_str_ = ""; // ugh set_tempo (Moment (1, 4), 60); } @@ -61,12 +60,19 @@ void Midi_def::print() const { #ifndef NPRINT + Music_output_def::print (); DOUT << "Midi {"; DOUT << "4/min: " << Real (60) / (whole_in_seconds_mom_ * 4); - DOUT << "out: " << outfile_str_; DOUT << "}\n"; #endif } IMPLEMENT_IS_TYPE_B1(Midi_def, Music_output_def); + +int Midi_def::default_count_i_=0; +int +Midi_def::get_next_default_count () const +{ + return default_count_i_++; +} diff --git a/lily/midi-stream.cc b/lily/midi-stream.cc index 6d2cb2699a..34833fb24b 100644 --- a/lily/midi-stream.cc +++ b/lily/midi-stream.cc @@ -36,12 +36,12 @@ Midi_stream::~Midi_stream() Midi_stream& Midi_stream::operator <<(String str) { - if (check_debug && !monitor->silence("Midistrings")) + if (check_debug && !monitor->silent_b("Midistrings")) str = String_convert::bin2hex_str (str); *os_p_ << str; - if (check_debug && !monitor->silence("Midistrings")) + if (check_debug && !monitor->silent_b ("Midistrings")) *os_p_ << "\n"; return *this; @@ -52,7 +52,7 @@ Midi_stream::operator <<(Midi_item const& mitem_c_r) { // *this << mitem_c_r.str(); mitem_c_r.output (this); - if (check_debug && !monitor->silence("Midistrings")) + if (check_debug && !monitor->silent_b("Midistrings")) *os_p_ << "\n"; return *this; } diff --git a/lily/music-output-def.cc b/lily/music-output-def.cc index 0c93fb55ab..297584d539 100644 --- a/lily/music-output-def.cc +++ b/lily/music-output-def.cc @@ -11,6 +11,12 @@ #include "global-translator.hh" #include "dictionary-iter.hh" +int +Music_output_def::get_next_default_count () const +{ + return 0; +} + IMPLEMENT_IS_TYPE_B(Music_output_def); Music_output_def::Music_output_def () @@ -25,6 +31,7 @@ Music_output_def::~Music_output_def () Music_output_def::Music_output_def (Music_output_def const &s) { + outfile_str_ = s.outfile_str_; for (Dictionary_iter i (s.translator_p_dict_); i.ok (); i++) assign_translator (i.key (), i.val ()->clone ()); } @@ -58,6 +65,7 @@ Music_output_def::assign_translator (String s, Translator*t) { t->type_str_ = s; t->output_def_l_ = this; + if (translator_p_dict_.elt_b (s)) delete translator_p_dict_[s]; translator_p_dict_[s] = t; @@ -72,5 +80,6 @@ Music_output_def::print () const DOUT << i.key () << " = "; i.val ()->print (); } + DOUT << "output: " << outfile_str_; #endif } diff --git a/lily/musical-request.cc b/lily/musical-request.cc index d247215876..0e3dd06ce8 100644 --- a/lily/musical-request.cc +++ b/lily/musical-request.cc @@ -298,7 +298,7 @@ bool Span_req:: do_equal_b (Request*r) const { Span_req * s = r->span(); - return spantype - s->spantype; + return spantype == s->spantype; } Span_req::Span_req() diff --git a/lily/my-lily-parser.cc b/lily/my-lily-parser.cc index e323034c0e..1c1f31860b 100644 --- a/lily/my-lily-parser.cc +++ b/lily/my-lily-parser.cc @@ -57,8 +57,8 @@ My_lily_parser::set_debug() String s = ""; if (init_parse_b_) s = "Init"; - set_yydebug (!monitor->silence (s+"Parser") && check_debug); - lexer_p_->set_debug (!monitor->silence (s+"Lexer") && check_debug); + set_yydebug (!monitor->silent_b (s+"Parser") && check_debug); + lexer_p_->set_debug (!monitor->silent_b (s+"Lexer") && check_debug); #endif } @@ -70,7 +70,7 @@ My_lily_parser::print_declarations() if (init_parse_b_) s = "Init"; - if (!monitor->silence (s+"Declarations") && check_debug) + if (!monitor->silent_b (s+"Declarations") && check_debug) { lexer_p_->print_declarations (init_parse_b_); } diff --git a/lily/p-score.cc b/lily/p-score.cc index 4ca78c5993..d38fb8f2c0 100644 --- a/lily/p-score.cc +++ b/lily/p-score.cc @@ -192,8 +192,15 @@ Paper_score::tex_output () // output String outname = paper_l_->outfile_str_ ; if (outname.empty_b ()) - outname = default_out_str_+ ".tex"; - + { + outname = default_outname_base_global; + int def = paper_l_->get_next_default_count (); + if (def) + { + outname += "-" + String(def); + } + outname += ".tex"; + } *mlog << _("TeX output to ") << outname << " ...\n"; Tex_stream tex_out (outname); diff --git a/lily/paper-def.cc b/lily/paper-def.cc index 0f9ee0f4d0..052f0c48d9 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -38,7 +38,6 @@ Paper_def::Paper_def (Paper_def const&s) lookup_p_ = s.lookup_p_? new Lookup (*s.lookup_p_) : 0; lookup_p_->paper_l_ = this; real_vars_p_ = new Dictionary (*s.real_vars_p_); - outfile_str_ = s.outfile_str_; } void @@ -143,7 +142,6 @@ Paper_def::print() const #ifndef NPRINT Music_output_def::print (); DOUT << "Paper {"; - DOUT << "out: " <print(); for (Assoc_iter i (*real_vars_p_); i.ok(); i++) { @@ -165,10 +163,17 @@ IMPLEMENT_IS_TYPE_B1(Paper_def, Music_output_def); String Paper_def::TeX_output_settings_str () const { - String s("\n "); s += lookup_p_->texsetting + "%(Tex id)\n"; for (Assoc_iter i (*real_vars_p_); i.ok(); i++) s += String ("\\def\\mudelapaper") + i.key () + "{" + i.val () + "}\n"; return s; } + +int Paper_def::default_count_i_ = 0; + +int +Paper_def::get_next_default_count () const +{ + return default_count_i_ ++; +} diff --git a/lily/performance.cc b/lily/performance.cc index 8d05ec325d..aaf926965f 100644 --- a/lily/performance.cc +++ b/lily/performance.cc @@ -115,8 +115,18 @@ Performance::process() String out=midi_l_->outfile_str_; if (out.empty_b ()) - out = default_out_str_ + ".midi"; - + { + + out = default_outname_base_global; + int def = midi_l_->get_next_default_count (); + if (def) + { + out += "-" + String(def); + } + + out += ".midi"; + } + Midi_stream midi_stream (out); *mlog << _("MIDI output to ") << out<< " ..." << endl; diff --git a/lily/score-grav.cc b/lily/score-grav.cc index e624ac88fe..03947306a1 100644 --- a/lily/score-grav.cc +++ b/lily/score-grav.cc @@ -131,16 +131,20 @@ Score_engraver::typeset_all() Spanner *s = elem_p->spanner (); pscore_p_->typeset_unbroken_spanner (s); - /* + + + /* do something sensible if spanner not spanned on 2 items. */ Direction d = LEFT; do { if (!s->spanned_drul_[d]) - s->set_bounds(d, command_column_l_); + { + s->set_bounds(d, command_column_l_); + warning ("Unbound spanner"); + } } while ((d *= -1) != LEFT); - } else { diff --git a/lily/score.cc b/lily/score.cc index 135ebf9821..a32773e433 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -17,8 +17,9 @@ #include "global-translator.hh" #include "header.hh" #include "cpu-timer.hh" +#include "main.hh" +#include "paper-def.hh" -extern String default_out_fn; Score::Score() { @@ -75,11 +76,14 @@ Score::run_translator (Music_output_def *odef_l) { w = iter->next_moment(); DOUT << "proccing: " << w <<"\n"; - iter->print(); + if (!monitor->silent_b ("walking")) + iter->print(); } + trans_p->modify_next (w); trans_p->prepare (w); - trans_p->print(); + if (!monitor->silent_b ("walking")) + trans_p->print(); iter->process_and_next (w); trans_p->process(); @@ -100,7 +104,6 @@ Score::run_translator (Music_output_def *odef_l) output->header_l_ = header_p_; - output->default_out_str_ = default_out_fn; output->origin_str_ = location_str(); *mlog << endl; @@ -116,12 +119,16 @@ Score::process() print(); for (int i=0; i < def_p_arr_.size (); i++) - run_translator (def_p_arr_[i]); + { + if (no_paper_global_b + && def_p_arr_[i]->is_type_b (Paper_def::static_name ())) + continue; + run_translator (def_p_arr_[i]); + } } - void Score::print() const { diff --git a/lily/scores.cc b/lily/scores.cc index edb4bbec80..a5081a25b3 100644 --- a/lily/scores.cc +++ b/lily/scores.cc @@ -15,7 +15,10 @@ #include "parray.hh" static Link_array global_score_array; -String default_out_fn = "lelie"; +String default_outname_suffix_global = ""; +String default_outname_base_global = "lelie"; +int default_count_global; + void do_scores() @@ -26,6 +29,7 @@ do_scores() if (!is_p->header_p_) is_p->header_p_ = new Header; + is_p->header_p_->lily_id_str_ = "Lily was here, " + get_version_number_str(); if (is_p->errorlevel_i_) @@ -56,8 +60,3 @@ add_score (Score * s) global_score_array.push (s); } -void -set_default_output (String s) -{ - default_out_fn = s; -} diff --git a/lily/slur.cc b/lily/slur.cc index 2597c5e032..c7be481d4c 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -100,13 +100,13 @@ Slur::do_post_processing() if (extrema[d] != spanned_drul_[d]) { dx_f_drul_[d] = -d - *(spanned_drul_[d]->width ().length ()/nw_f -0.5); + *(spanned_drul_[d]->width ().length () -0.5*nw_f); } else if (extrema[d]->stem_l_ && !extrema[d]->stem_l_->transparent_b_) - pos_i_drul_[d] = (int)rint (extrema[d]->stem_l_->height()[dir_]/inter_f); + dy_f_drul_[d] = (int)rint (extrema[d]->stem_l_->height()[dir_]); else - pos_i_drul_[d] = (int)rint (extrema[d]->head_positions_interval()[dir_]); - pos_i_drul_[d] += dir_; + dy_f_drul_[d] = (int)rint (extrema[d]->head_positions_interval()[dir_])* inter_f; + dy_f_drul_[d] += dir_ * inter_f; } while ((d *= -1) != LEFT); } diff --git a/lily/spring-spacer.cc b/lily/spring-spacer.cc index 6ae908c2af..3439557f2c 100644 --- a/lily/spring-spacer.cc +++ b/lily/spring-spacer.cc @@ -20,7 +20,7 @@ #include "paper-def.hh" #include "dimen.hh" #include "colhpos.hh" - +#include "main.hh" // experimental_fietsers Vector Spring_spacer::default_solution() const @@ -175,14 +175,8 @@ Spring_spacer::check_constraints (Vector v) const return true; } -bool -Spring_spacer::check_feasible() const -{ - Vector sol (try_initial_solution()); - return check_constraints (sol); -} - -/// generate a solution which obeys the min distances and fixed positions +/// try to generate a solution which obeys the min distances and fixed +/// positions Vector Spring_spacer::try_initial_solution() const { @@ -198,10 +192,7 @@ Spring_spacer::try_initial_solution() const { Real r =initsol (i-1) + cols[i-1].width_[RIGHT]; if (initsol (i) < r) - { - warning (_("overriding fixed position")); initsol (i) =r; - } } } @@ -220,14 +211,6 @@ Spring_spacer::try_initial_solution() const -Vector -Spring_spacer::find_initial_solution() const -{ - Vector v (try_initial_solution()); - assert (check_constraints (v)); - return v; -} - // generate the matrices void Spring_spacer::make_matrices (Matrix &quad, Vector &lin, Real &c) const @@ -259,8 +242,6 @@ Spring_spacer::set_fixed_cols (Mixed_qp &qp) const for (int j=0; j < cols.size(); j++) if (cols[j].fixed()) qp.add_fixed_var (j,cols[j].fixed_position()); - - } // put the constraints into the LP problem @@ -306,6 +287,7 @@ Spring_spacer::lower_bound_solution (Col_hpositions*positions) const start.fill (0.0); Vector solution_vec (lp.solve (start)); + DOUT << "Lower bound sol: " << solution_vec; positions->energy_f_ = calculate_energy_f (solution_vec); positions->config = solution_vec; positions->satisfies_constraints_b_ = check_constraints (solution_vec); @@ -314,26 +296,32 @@ Spring_spacer::lower_bound_solution (Col_hpositions*positions) const void Spring_spacer::solve (Col_hpositions*positions) const { - assert (check_feasible()); + Vector solution_try (try_initial_solution()); + + if (check_constraints (solution_try)) + { + Mixed_qp lp (cols.size()); + make_matrices (lp.quad,lp.lin, lp.const_term); + make_constraints (lp); + set_fixed_cols (lp); - Mixed_qp lp (cols.size()); - make_matrices (lp.quad,lp.lin, lp.const_term); - make_constraints (lp); - set_fixed_cols (lp); - Vector start=find_initial_solution(); - Vector solution_vec (lp.solve (start)); + Vector solution_vec (lp.solve (solution_try)); - positions->satisfies_constraints_b_ = check_constraints (solution_vec); - if (!positions->satisfies_constraints_b_) + positions->satisfies_constraints_b_ = check_constraints (solution_vec); + if (!positions->satisfies_constraints_b_) + { + WARN << _("solution doesn't satisfy constraints.\n") ; + } + position_loose_cols (solution_vec); + positions->energy_f_ = calculate_energy_f (solution_vec); + positions->config = solution_vec; + positions->error_col_l_arr_ = error_pcol_l_arr(); + } + else { - WARN << _("solution doesn't satisfy constraints.\n") ; + positions->set_stupid_solution (solution_try); } - position_loose_cols (solution_vec); - positions->energy_f_ = calculate_energy_f (solution_vec); - positions->config = solution_vec; - positions->error_col_l_arr_ = error_pcol_l_arr(); - } /** @@ -445,8 +433,10 @@ Spring_spacer::get_ruling_durations(Array &shortest_playing_arr, Array &context_shortest_arr) { for (int i=0; i < cols.size(); i++) - scol_l (i)->preprocess(); - + { + scol_l (i)->preprocess(); + scol_l (i)->print (); + } int start_context_i=0; Moment context_shortest = infinity_mom; context_shortest_arr.set_size(cols.size()); @@ -467,6 +457,7 @@ Spring_spacer::get_ruling_durations(Array &shortest_playing_arr, { context_shortest = context_shortest durations[0]; } + // ji was j, but triggered ICE for (int ji=i+1; ji --;) { @@ -517,23 +508,26 @@ Spring_spacer::calc_idealspacing() Array context_shortest_arr; get_ruling_durations(shortest_playing_arr, context_shortest_arr); + Real interline_f = paper_l ()->interline_f (); Array ideal_arr_; Array hooke_arr_; - for (int i=0; i < cols.size(); i++){ + for (int i=0; i < cols.size() - 1; i++){ ideal_arr_.push (-1.0); hooke_arr_.push (1.0); } + /* + First do all non-musical columns + */ for (int i=0; i < cols.size(); i++) { - if (!scol_l (i)->musical_b()) + if (!scol_l (i)->musical_b() && i+1 < cols.size()) { Real symbol_distance =cols[i].width_[RIGHT] + 2 PT; Real durational_distance = 0; - if (i+1 < cols.size()) - { + Moment delta_t = scol_l (i+1)->when() - scol_l (i)->when () ; Real k= paper_l()->arithmetic_constant(context_shortest_arr[i]); @@ -543,12 +537,16 @@ Spring_spacer::calc_idealspacing() if (delta_t) durational_distance = paper_l()->duration_to_dist (delta_t,k); symbol_distance += -cols[i+1].width_[LEFT]; - } + ideal_arr_[i] = symbol_distance >? durational_distance; - hooke_arr_[i] = 2.0; + hooke_arr_[i] = 1; //2.0; } } + + /* + Then musicals + */ for (int i=0; i < cols.size(); i++) { if (scol_l (i)->musical_b()) @@ -572,25 +570,71 @@ Spring_spacer::calc_idealspacing() Real dist = paper_l()->duration_to_dist (shortest_playing_len, k); dist *= delta_t / shortest_playing_len; - /* all sorts of ugliness to avoid running into bars/clefs, but not taking - extra space if this is not needed */ - if (!scol_l (i+1)->musical_b()) + /* + According to [Ross] and [Wanske], and from what i've seen: + + * whitespace at the begin of the bar should be fixed at + (about) one interline. + [Ross]: + when spacing gets real tight, a smaller fixed value may be + used, so that there are two discrete amounts of whitespace + possible at the begin of a bar; but this is not implemented + right now. + + * whitespace at the end of the bar is the normal amount of + "hinterfleish" that would have been used, had there been + yet another note in the bar. + [Ross]: + some editors argue that the bar line should not take any + space, not to hinder the flow of music spaced around a bar + line. + [Ross] and [Wanske] do not suggest this, however. Further, + it introduces some spacing problems and think that it is ugly + too. + [jcn] + */ + + /* + first musical column of bar + */ + if (i && scol_l (i - 1)->breakable_b_) { - Real minimum_dist = - cols[i+1].width_[LEFT] + 2 PT + cols[i].width_[RIGHT]; - if (ideal_arr_[i+1] + minimum_dist < dist) - { - ideal_arr_[i] = dist - ideal_arr_[i+1]; - // hooke_arr_[i+1] =1.0; - } else { - ideal_arr_[i] = minimum_dist; - } - - } else - ideal_arr_[i] = dist; + // fixed: probably should set minimum (rod/spring)? + cols[i-1].width_[RIGHT] += interline_f; + // should adjust dist too? + ideal_arr_[i-1] = ideal_arr_[i-1] >? interline_f; + } + + /* + last musical column of bar + */ + if (i + 1 < cols.size () && scol_l(i+1)->breakable_b_) + { + // hmm, how bout? + dist = dist >? interline_f; + + /* + uhuh, this code looks fine, already? + someone was junking this last "hinterfleisch" whitespace?! + + but this seems to be fixed now :-) + */ + // set minimum rod + cols[i].width_[RIGHT] += interline_f; + } + + // ugh, do we need this? + if (i < cols.size () - 1 && !scol_l (i + 1)->musical_b ()) + { + Real minimum = -cols[i + 1].width_[LEFT] + cols[i].width_[RIGHT] + + interline_f / 2; + dist = dist >? minimum; + } + ideal_arr_[i] = dist; } } - for (int i=0; i < ideal_arr_.size()-1; i++) + for (int i=0; i < ideal_arr_.size(); i++) { assert (ideal_arr_[i] >=0 && hooke_arr_[i] >=0); connect (i, i+1, ideal_arr_[i], hooke_arr_[i]); diff --git a/lily/stem.cc b/lily/stem.cc index 9bdfd99f80..92e5ca0c51 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -269,21 +269,22 @@ Stem::abbrev_mol () const { Real dy = paper ()->interbeam_f (); Real w = 1.5 * paper ()->lookup_l ()->ball (2).dim_.x ().length (); - Real beamdy = paper ()->interline_f () / 2; + Real interline_f = paper ()->interline_f (); + Real beamdy = interline_f/2; int beams_i = 0; Real slope_f = paper ()->internote_f () / 4; if (beam_l_) { // huh? - slope_f = 2 * beam_l_->slope_f; + slope_f = 2 * beam_l_->slope_f_; // ugh, rather calc from Abbreviation_req beams_i = beams_right_i_ >? beams_left_i_; } - paper ()->lookup_l ()->beam (slope_f, 20 PT); + paper ()->lookup_l ()->beam (slope_f, 20 PT, 1 PT); Molecule beams; - Atom a (paper ()->lookup_l ()->beam (slope_f, w)); + Atom a (paper ()->lookup_l ()->beam (slope_f, w, .48 * interline_f)); a.translate (Offset(- w / 2, stem_end_f () - (w / 2 * slope_f))); // ugh diff --git a/lily/tex-beam.cc b/lily/tex-beam.cc index 4380e8911f..d756461a6f 100644 --- a/lily/tex-beam.cc +++ b/lily/tex-beam.cc @@ -19,6 +19,7 @@ #include "debug.hh" #include "lookup.hh" #include "misc.hh" +#include "main.hh" Atom Lookup::beam_element (int sidx, int widx, Real slope) const @@ -51,8 +52,31 @@ Lookup::rule_symbol (Real height, Real width) const return bs; } +Atom +Lookup::beam(Real &slope, Real width, Real y_thick) const +{ + if (postscript_global_b) + { + return ps_beam (slope, width, y_thick); + } + else + return tex_beam(slope, width); +} + +Atom +Lookup::ps_beam (Real slope, Real width, Real y_thickness)const +{ + Atom ret; + String ps(String (width) + " "+ String(slope) + + " " + String(y_thickness) + " draw_beam"); + ret.tex_ = String("\\embeddedps{" + ps + "}"); + ret.dim_[X_AXIS] = Interval(0, width); + ret.dim_[Y_AXIS] = Interval(0, slope * width + y_thickness); + return ret; +} + Atom -Lookup::beam (Real &slope, Real width) const +Lookup::tex_beam (Real &slope, Real width) const { const Real MAX_SLOPE = 0.6; const Real SLOPES = 20.0; diff --git a/lily/tex-slur.cc b/lily/tex-slur.cc index cee16dbeb8..eb140c4768 100644 --- a/lily/tex-slur.cc +++ b/lily/tex-slur.cc @@ -134,50 +134,34 @@ Lookup::half_slur (int dy, Real &dx, Direction dir, int xpart) const } Atom -Lookup::slur (int dy , Real &dx, Direction dir) const +Lookup::ps_slur (Real dy , Real dx, Real dir) const { - assert (abs (dir) <= 1); - if (dx < 0) - { - warning (_("Negative slur/tie length: ") + print_dimen (dx)); - dx = 4.0 PT; - } + String ps = "\\embeddedps{\n"; + + ps += String_convert::double_str (dx) + " " + + String_convert::double_str (dy) + " " + + String_convert::double_str (dir) + + " draw_slur}"; + + String mf = "\\embeddedmf{\n"; + mf += "input feta-sleur;\n"; + mf += "draw_slur((0,0),"; + mf += "(" + String_convert::double_str (dx) + "," + + String_convert::double_str (dy) + "),"; + mf += String_convert::double_str (dir) + ");\n"; + mf += "end.\n"; + mf += "}\n"; Atom s; - s.dim_[X_AXIS] = Interval (0, dx); - s.dim_[Y_AXIS] = Interval (min (0, dy), max (0, dy)); - - // duh - // let's try the embedded stuff - - /* bool embedded_b = experimental_features_global_b; - // embedded stuff still sucks for slurs - */ - bool embedded_b = false; - String embed; - if (embedded_b) - { - Real fdy = dy*paper_l_->internote_f (); - Real fdx = dx; - String ps = "\\embeddedps{\n"; - // ugh, how bout " /draw_slur { ... } def " - ps += String_convert::double_str (fdx) + " " - + String_convert::double_str (fdy) + " " - + String_convert::double_str (dir) + - " draw_slur}"; - - String mf = "\\embeddedmf{\n"; - mf += "input feta-sleur;\n"; - mf += "draw_slur((0,0),"; - mf += "(" + String_convert::double_str (fdx) + "," - + String_convert::double_str (fdy) + "),"; - mf += String_convert::double_str (dir) + ");\n"; - mf += "end.\n"; - mf += "}\n"; - - embed = ps + mf; - } + s.tex_ = ps + mf; + return s; +} +Atom +Lookup::tex_slur (int dy , Real &dx, Direction dir) const +{ + assert (abs (dir) <= 1); + Atom s; Direction y_sign = (Direction) sign (dy); bool large = abs (dy) > 8; @@ -192,11 +176,6 @@ Lookup::slur (int dy , Real &dx, Direction dir) const if (large) { s = big_slur (dy, dx, dir); - if (embedded_b) - { - s.tex_ = "\\embeddedtex{\n" + s.tex_ + "\n}\n"; - s.tex_ += embed; - } return s; } Real orig_dx = dx; @@ -243,12 +222,6 @@ Lookup::slur (int dy , Real &dx, Direction dir) const assert (idx < 256); f+=String ("{") + String (idx) + "}"; s.tex_ = f; - if (embedded_b) - { - s.tex_ = "\\embeddedtex{\n" + s.tex_ + "\n}\n"; - s.tex_ += embed; - } - s.translate_axis (dx/2, X_AXIS); return s; } @@ -288,3 +261,30 @@ Lookup::big_slur (int dy , Real &dx, Direction dir) const s.dim_ = mol.extent(); return s; } + + +Atom +Lookup::slur (Real &dy_f , Real &dx, Direction dir) const +{ + if (dx < 0) + { + warning (_("Negative slur/tie length: ") + print_dimen (dx)); + dx = 4.0 PT; + } + Atom s; + + if (postscript_global_b) + s = ps_slur (dy_f, dx, dir); + else + { + Real nh = paper_l_->internote_f (); + int dy_i = (int) rint(dy_f / nh); + + s = tex_slur (dy_i, dx, dir); + dy_f = dy_i * nh; + } + + s.dim_[X_AXIS] = Interval (0, dx); + s.dim_[Y_AXIS] = Interval (0 ? dy_f); + return s; +} diff --git a/lily/text-spanner.cc b/lily/text-spanner.cc index c23bb7e645..f100b72ae7 100644 --- a/lily/text-spanner.cc +++ b/lily/text-spanner.cc @@ -19,11 +19,17 @@ void Text_spanner::set_support (Directional_spanner*d) { if (support_span_l_) - remove_dependency (support_span_l_); + remove_dependency (support_span_l_); support_span_l_ =d; add_dependency (d); } +void +Text_spanner::do_add_processing () +{ + set_bounds (LEFT, support_span_l_->spanned_drul_[LEFT]); + set_bounds (RIGHT, support_span_l_->spanned_drul_[RIGHT]); +} Text_spanner::Text_spanner() { diff --git a/lily/tie.cc b/lily/tie.cc index 9418bfb997..a181bedde3 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -61,13 +61,16 @@ void Tie::do_post_processing() { Real nw_f = paper()->note_width (); + Real space_f = paper()->interline_f (); assert (head_l_drul_[LEFT] || head_l_drul_[RIGHT]); Direction d = LEFT; do { - pos_i_drul_[d] = (head_l_drul_[d])? - head_l_drul_[d]->position_i_ : head_l_drul_[(Direction)-d]->position_i_; + dy_f_drul_[d] = + .5 *space_f * (head_l_drul_[d] + ? head_l_drul_[d]->position_i_ + : head_l_drul_[(Direction)-d]->position_i_); } while ((d *= -1) != LEFT); @@ -75,16 +78,16 @@ Tie::do_post_processing() { if (head_l_drul_[d] && head_l_drul_[d]->extremal_i_) { - pos_i_drul_[d] += 2*dir_; - dx_f_drul_[d] += d * 0.25; + dy_f_drul_[d] += dir_ * space_f; + dx_f_drul_[d] += d * 0.25 * nw_f; } else if (head_l_drul_[d]) - dx_f_drul_[d] += d*0.5; + dx_f_drul_[d] += d*0.5 * nw_f; else { - pos_i_drul_[d] = pos_i_drul_[(Direction) -d]; - dx_f_drul_[d] = -d - *(spanned_drul_[d]->width ().length ()/nw_f -0.5); + dy_f_drul_[d] = dy_f_drul_[(Direction) -d]; + dx_f_drul_[d] = -d *(spanned_drul_[d]->width ().length () + -0.5* nw_f); } } while ((d *= -1) != LEFT); diff --git a/make/Toplevel.make.in b/make/Toplevel.make.in index 9493966c26..83ed45bd66 100644 --- a/make/Toplevel.make.in +++ b/make/Toplevel.make.in @@ -34,7 +34,7 @@ SUBDIRS = bin flower lib lily mf mi2mu debian\ # list of distribution files: # SCRIPTS = configure configure.in install-sh aclocal.m4 -README_FILES = BUGS DEDICATION ANNOUNCE COPYING ONEWS NEWS README TODO \ +README_FILES = BUGS DEDICATION ANNOUNCE-0.1 ANNOUNCE COPYING ONEWS NEWS README TODO \ INSTALL.text AUTHORS.text EXTRA_DISTFILES = .dstreamrc mudela-mode.el VERSION $(README_FILES) $(SCRIPTS) $(SYMLINKS) diff --git a/make/lilypond.lsm.in b/make/lilypond.lsm.in index b98fc8e244..603ef5272d 100644 --- a/make/lilypond.lsm.in +++ b/make/lilypond.lsm.in @@ -9,13 +9,14 @@ Description: LilyPond is the GNU Project music typesetter. The program MIDI file. Features include multiple staffs, meters, clefs, keys, lyrics, versatile input-language, cadenzas, beams, slurs, triplets. -Keywords: music notation typesetting midi + It includes a nice font of musical symbols. +Keywords: music notation typesetting midi fonts Author: hanwen@stack.nl (Han-Wen Nienhuys) jan@digicash.com (Jan Nieuwenhuizen) Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys) Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert - 460k lilypond-@TOPLEVEL_VERSION@.tar.gz + 470k lilypond-@TOPLEVEL_VERSION@.tar.gz Original-site: pcnov095.win.tue.nl /pub/lilypond/development/ - 460k lilypond-@TOPLEVEL_VERSION@.tar.gz + 470k lilypond-@TOPLEVEL_VERSION@.tar.gz Copying-policy: GPL End diff --git a/make/lilypond.spec.in b/make/lilypond.spec.in index 0ac1082b11..9f9ac9b447 100644 --- a/make/lilypond.spec.in +++ b/make/lilypond.spec.in @@ -19,8 +19,6 @@ MIDI file. Features include multiple staffs, meters, clefs, keys, lyrics, versatile input-language, cadenzas, beams, slurs, triplets. -[you need the musixtex fonts to use LilyPond] - %prep %setup %build diff --git a/mf/TODO b/mf/TODO index ffeed55f44..b1e9c59a82 100644 --- a/mf/TODO +++ b/mf/TODO @@ -1,6 +1,6 @@ - - design macro for penstroke with rounded endings - design decent macro for bulbed endings + - printer dependencies. - y-refpoint for rests should be the 4th staffline (gclef: b') - versioning - lo-res fixes. diff --git a/mf/feta-autometric.mf b/mf/feta-autometric.mf new file mode 100644 index 0000000000..3b1b798684 --- /dev/null +++ b/mf/feta-autometric.mf @@ -0,0 +1,126 @@ +% +% autometric.mf -- administrative MF routines +% +% source file of the Feta (Font-En-Tja) pretty-but-neat music font +% +% (c) 1997 Han-Wen Nienhuys +% Jan Nieuwenhuizen +% +% these macros help create ascii logging output +% to automate generation of lily tables and tex backend +% The output should be parsed by the mf-to-table script + +% font or database? +def fet_beginfont(expr name,size) = + font_identifier:=name&decimal size; + font_size size; + message "@{font@:"&name&"@:"&decimal size&"@}"; + message ""; + enddef; + +def fet_endfont(expr name) = + message "@{tnof@:"&name&"@}"; + message ""; + enddef; + +% group or table? +def fet_begingroup(expr name) = + message "@{group@:"&name&"@}"; + message ""; + begingroup +enddef; + +def fet_endgroup(expr name) = + endgroup; + message "@{puorg@:"&name&"@}"; + message ""; +enddef; + +def autometric_output_char= + message "@{char@:"&charnamestr&"@:"&decimal charcode&"@:"&decimal charbp&"@:"&decimal charwd&"@:"&decimal chardp&"@:"&decimal charht&"@:"&idstr&"@:"&texstr&"@}"; +enddef; + +def hround_pixels(expr sharped) = hround(sharped * hppp) enddef; +def vround_pixels(expr sharped) = vround(sharped * vppp) enddef; + + + +def tand(expr alpha) = + (sind alpha/cosd alpha) + enddef; + +%breapth, width, depth, height +% breapth x-depth +def set_char_box(expr b_sharp, w_sharp, d_sharp,h_sharp) = + save scharbp, scharht, scharwd, schardp; + + % some paranoia if someone calls set_char_box(charwd, charbp, .. ) + scharbp := b_sharp; + scharht := h_sharp; + schardp := d_sharp; + scharwd := w_sharp; + + charbp := scharbp; + charht := scharht; + chardp := schardp; + charwd := scharwd; + + w := hround(w_sharp *hppp); + b := hround(b_sharp *hppp); + h := hround(h_sharp *vppp); + d := hround(d_sharp *vppp); +enddef; + +def no_dimen_beginchar(expr c) = + begingroup + charcode := if known c: byte c else: 0; fi; + charic := 0; + clearxy; + clearit; + clearpen; + scantokens extra_beginchar; +enddef; + +code:=-1; + +% starts just as plain mf's beginchar: +% charcode, +% and then adds: +% charname see below +% id index in lily's table +% texstr name of tex macro in lily's table and tex backend + +% the dims are uninitialised; you should use set_char_box manually. +def fet_beginchar(expr name, id_lit, texstr_lit) = + save texstr, idstr, charnamestr; + save charbp; + save w,b,h,d; + string texstr, idstr, charnamestr; + texstr := texstr_lit; + charnamestr := name; + idstr := id_lit; + + no_dimen_beginchar(incr code) name; + enddef; + + +def makebox_with_breapth(text r) = + for y = -d, 0, h: r((-b, y),(w,y)); endfor + for x = -b, 0, w: r((x, -d),(x, h)); endfor +enddef; + +% +% override plain endchar. We want a different box. +% +def breapth_endchar = + scantokens extra_endchar; + if proofing > 0: makebox_with_breapth(proofrule); fi + chardx := 10*(w + b); + shipit; + endgroup +enddef; + +def fet_endchar= + autometric_output_char; + breapth_endchar; + enddef; diff --git a/mf/feta-beugel.mf b/mf/feta-beugel.mf index df625dc0c3..7acd135471 100644 --- a/mf/feta-beugel.mf +++ b/mf/feta-beugel.mf @@ -39,6 +39,6 @@ endchar; enddef; -for h := 2 staffsize# step 2 pt# until (6 * staffsize#): +for h := 2 staffsize# step 1 pt# until (6 * staffsize#): draw_brace(h, interline# ); endfor diff --git a/mf/feta-din10.mf b/mf/feta-din10.mf index af28aa0f13..63ed200622 100644 --- a/mf/feta-din10.mf +++ b/mf/feta-din10.mf @@ -112,12 +112,12 @@ flare#:=52/36pt#; % diameter of bulbs or breadth of terminals mode_setup; font_setup; -input autometric; +input feta-autometric; fet_beginfont("feta-din", 10); num=-1; xbar:=u; -input ital-f; +input feta-ital-f; bar#:=17/36pt#; % lowercase bar thickness slant:=.38; % tilt ratio $(\Delta x/\Delta y)$ @@ -125,14 +125,14 @@ stem#:=58/36pt#; % lowercase stem breadth font_setup; xbar:=.4u; -input ital-f; +input feta-ital-f; stem#:=54/36pt#; % lowercase stem breadth hair#:=12/36pt#; % lowercase hairline breadth vair#:=7/36pt#; % vertical diameter of hairlines font_setup; -input ital-p; +input feta-ital-p; slant:=.28; % tilt ratio $(\Delta x/\Delta y)$ %stem#:=38/36pt#; % lowercase stem breadth @@ -162,10 +162,10 @@ x_height#:=135/36pt#; % height of lowercase without ascenders font_setup; -input ital-m; -input ital-r; -input ital-s; -input ital-z; +input feta-ital-m; +input feta-ital-r; +input feta-ital-s; +input feta-ital-z; font_slant slant; font_x_height x_height#; diff --git a/mf/feta-ital-f.mf b/mf/feta-ital-f.mf new file mode 100644 index 0000000000..70faefa106 --- /dev/null +++ b/mf/feta-ital-f.mf @@ -0,0 +1,39 @@ +% ital-f.mf +% from itall.mf +% +% Computer Modern Italic lower case: +% This lowercase italic alphabet was prepared by D. E. Knuth in December, 1979, +% inspired by the Monotype faces used in {\sl The Art of Computer Programming}. +% The programs were revised for the new \MF\ conventions in 1985. + +% Character codes \0141 through \0172 are generated. +% not + +% cmchar "Italic letter f"; +% beginchar("f",max(1.5u#,stem#)+max(3.5u#,2flare#),asc_height#,desc_depth#); +\"Dynamic letter f"; +beginchar(incr num,max(1.5u#,stem#)+max(3.5u#,2flare#),asc_height#,desc_depth#); +italcorr asc_height#*slant+.75u#; +adjust_fit(if monospace:u#,u# else: 0,0 fi); pickup fine.nib; +numeric theta; z88=(.5w-.5u,h); z89=(.5w+.5u,-d); theta=angle(z88-z89); +pos0(flare,0); pos1(hair,0); pos2(vair,90); +pos3(.5[hair,stem],180); pos4(stem,theta+90); +pos5(stem,theta-90); pos6(.5[hair,stem],0); +pos7(vair,-90); pos8(hair,-180); pos9(flare,-180); +rt x1r=hround(w+.25u); lft x8r=hround-.35u; x2=.6[x1,x4]; x7=.6[x8,x5]; +y9-.5flare=vround -.85d; y2-y0=y9-y7; top y2r=h+oo; bot y7r=-d-oo; +% y4=.25[x_height,h]; y5=.5[-d,y4]; +y4=x_height-.5bar; y5=y4; +z4=whatever[z88,z89]; z5=whatever[z88,z89]; +x3=.8[x2+x4-x88,x88]; x6=.8[x7+x5-x89,x89]; y3=.8[y4,y2]; y6=.8[y5,y7]; +bulb(2,1,0); bulb(7,8,9); % bulbs +filldraw stroke z2e{left}...z3e...{z89-z88}z4e; % upper arc +filldraw z4r--z5l--z5r--z4l--cycle; % stem +filldraw stroke z5e{z89-z88}...z6e...{left}z7e; % lower arc +pickup crisp.nib; pos20(bar,90); pos21(bar,90); +top y20r=top y21r=x_height; +%lft x20=lft x4r-.5stem-u; rt x21=rt x4l+.5stem+1.5u; +lft x20=lft x4r-.5stem-xbar; rt x21=rt x4l+.5stem+1.5xbar; +filldraw stroke z20e--z21e; % crossbar +math_fit(desc_depth#*slant+u#,x_height#*slant); +penlabels(0,1,2,3,4,5,6,7,8,9,20,21,88,89); endchar; diff --git a/mf/feta-ital-m.mf b/mf/feta-ital-m.mf new file mode 100644 index 0000000000..5c39492c75 --- /dev/null +++ b/mf/feta-ital-m.mf @@ -0,0 +1,36 @@ +% ital-m.mf +% from itall.mf +% +% Computer Modern Italic lower case: +% This lowercase italic alphabet was prepared by D. E. Knuth in December, 1979, +% inspired by the Monotype faces used in {\sl The Art of Computer Programming}. +% The programs were revised for the new \MF\ conventions in 1985. + +% Character codes \0141 through \0172 are generated. +% not + +% cmchar "Italic letter m"; +% beginchar("m",15u#,x_height#,0); +\"Dynamic letter m"; +% beginchar(incr num,15u#,x_height#,0); +beginchar(incr num,12u#,x_height#,0); +italcorr 1/3x_height#*slant+.5hair#+.5u#; +adjust_fit(if monospace:-1.5u#,-2u# else: 0,0 fi); pickup fine.nib; +numeric shaved_stem; shaved_stem=mfudged.stem; +save stem; stem=shaved_stem; +pos2(stem,0); x1=x2; +if monospace: pos1(stem,0); lft x1l=hround(2.5u-.5stem); top y1=h; +else: x0=0; lft x2l=hround(2.5u-.5stem); + hook_in(0,a,1); fi % opening hook +y2-.5stem=-oo; filldraw circ_stroke z2e--z1e; % left stem +x4+.5stem=hround(.5w+.5stem); ital_arch(2,3,4); % left arch +pos5(stem,0); y5=y2; x5=x4; +filldraw circ_stroke z5e--z4e; % middle stem +x7+.5stem=hround(w-2.5u+.5stem); +x8=x7-.25u; ital_arch(5,6,7); % right arch +if monospace: pos9(vair,90); x9=good.x .5[x8,w]; bot y9l=0; y8=1/3h; + pos8(stem,0); filldraw stroke z8e{-u,-x_height}...{right}z9e; % terminal +else: x9=w; hook_out(8,b,9)(skewed); fi % closing hook +filldraw stroke z7e{down}..{-u,-x_height}z8e; % right stem +math_fit(-2/3x_height#*slant+.5hair#+.5u#,ic#); +penlabels(0,a,1,2,3,4,5,6,7,8,9); endchar; diff --git a/mf/feta-ital-p.mf b/mf/feta-ital-p.mf new file mode 100644 index 0000000000..c9e0cdc888 --- /dev/null +++ b/mf/feta-ital-p.mf @@ -0,0 +1,29 @@ +% ital-p.mf +% from itall.mf +% +% Computer Modern Italic lower case: +% This lowercase italic alphabet was prepared by D. E. Knuth in December, 1979, +% inspired by the Monotype faces used in {\sl The Art of Computer Programming}. +% The programs were revised for the new \MF\ conventions in 1985. + +% Character codes \0141 through \0172 are generated. +% not + +% cmchar "Italic letter p"; +% beginchar("p",9u#,x_height#,desc_depth#); +\"Dynamic letter p"; +beginchar(incr num,9u#,x_height#,desc_depth#); +italcorr .7x_height#*slant+.5curve#-u# if math_fitting:-.5u# fi; +adjust_fit(0,0); pickup fine.nib; +x0=0; x2-.5stem=hround(2.5u-.5stem); hook_in(0,1,2); % opening hook +pos4(hair,-180); pos5(vair,-90); pos6(curve,0); pos7(vair,90); +x4=x2; rt x6r=hround(w-1.5u+.5curve); x5=x7=.5[x4,x6]; +bot y5r=-oo; top y7r=h+oo; y4=y6=.5[y5,y7]; +filldraw stroke super_arc.e(4,5) & pulled_arc.e(5,6) + & pulled_arc.e(6,7) & super_arc.e(7,4); % bowl +pickup tiny.nib; pos2'(stem,0); pos3(stem,0); +z2=z2'; x3=x2; bot y3=-d; filldraw stroke z2'e--z3e; % stem +dish_serif(3,2',a,1/3,.75jut,b,1/3,jut); % serif +math_fit(-min(2/3x_height#*slant-.5hair#-.5u#, + 2u#-.5stem#-desc_depth#*slant),ic#); +penlabels(0,1,2,3,4,5,6,7); endchar; diff --git a/mf/feta-ital-r.mf b/mf/feta-ital-r.mf new file mode 100644 index 0000000000..607774e2be --- /dev/null +++ b/mf/feta-ital-r.mf @@ -0,0 +1,26 @@ +% ital-r.mf +% from itall.mf +% +% Computer Modern Italic lower case: +% This lowercase italic alphabet was prepared by D. E. Knuth in December, 1979, +% inspired by the Monotype faces used in {\sl The Art of Computer Programming}. +% The programs were revised for the new \MF\ conventions in 1985. + +% Character codes \0141 through \0172 are generated. +% not + +% cmchar "Italic letter r"; +% beginchar("r",5.5u#+max(1.75u#,flare#),x_height#,0); +\"Dynamic letter r"; +beginchar(incr num,5.5u#+max(1.75u#,flare#),x_height#,0); +italcorr x_height#*slant; +adjust_fit(if monospace:.25u#,.5u# else: 0,0 fi); pickup fine.nib; +x0=0; x2=x3; pos3(stem,0); lft x3l=hround(2.5u-.5stem); y3-.5stem=-oo; +hook_in(0,1,2); % opening hook +filldraw circ_stroke z3e--z2e; % left stem +pos3'(hair,180); z3'=z3; pos4(vair,90); pos5(hair,0); pos6(flare,0); +x4=w-.5u-max(1.75u,flare); rt x5r=hround(r-.5u); top y4r=h+oo; +filldraw stroke z3'e{up}...z4e{right}; % link +y6+.5flare=vround(bot y4l-.03x_height); bulb(4,5,6); % bulb +math_fit(-2/3x_height#*slant+.5hair#+.5u#,ic#-.5u#); +penlabels(0,1,2,3,4,5,6); endchar; diff --git a/mf/feta-ital-s.mf b/mf/feta-ital-s.mf new file mode 100644 index 0000000000..60af94b6e5 --- /dev/null +++ b/mf/feta-ital-s.mf @@ -0,0 +1,34 @@ +% ital-s.mf +% from itall.mf +% +% Computer Modern Italic lower case: +% This lowercase italic alphabet was prepared by D. E. Knuth in December, 1979, +% inspired by the Monotype faces used in {\sl The Art of Computer Programming}. +% The programs were revised for the new \MF\ conventions in 1985. + +% Character codes \0141 through \0172 are generated. +% not + +% cmchar "Italic letter s"; +% beginchar("s",5.25u#+max(1.75u#,flare#),x_height#,0); +\"Dynamic letter s"; +beginchar(incr num,5.25u#+max(1.75u#,flare#),x_height#,0); +italcorr x_height#*slant-.5u#; +adjust_fit(0,0); pickup fine.nib; +numeric theta; theta=90-angle(40u,h); slope:=-h/40u; % angle at middle +pos2(vair,-90); pos0(max(fine.breadth,ess),theta); pos7(vair,-90); +x2l=x0=x7=.5w; top y2l=h+oo; bot y7r=-oo; +y0-.5ess=y7l+.55(y2r-y7l-ess); +lft x3l=hround u-eps; rt x6r=hround(w-.5u)+eps; +x3r-x3l=x6r-x6l=hround .5[vair,ess]-fine; +ellipse_set(2l,3l,4l,0l); ellipse_set(2r,3r,4r,0r); y3=y3r; +ellipse_set(7l,6l,5l,0l); ellipse_set(7r,6r,5r,0r); y6=y6r; +interim superness:=more_super; +filldraw stroke super_arc.e(2,3) & z3e{down} + ..z4e---z5e..z6e{down} & super_arc.e(6,7); % main stroke +pos1(hair,0); pos10(hround .75[hair,flare],0); +pos2'(vair,90); z2'=z2; +pos8(hair,-180); pos9(flare,-180); +rt x10r=hround(w-u)+2eps; lft x9r=hround .5u-2eps; y10=.78h; y9=.25h; +bulb(2',1,10); bulb(7,8,9); % bulbs +math_fit(0,ic#); penlabels(0,1,2,3,4,5,6,7,8,9,10); endchar; diff --git a/mf/feta-ital-z.mf b/mf/feta-ital-z.mf new file mode 100644 index 0000000000..6c0f517aed --- /dev/null +++ b/mf/feta-ital-z.mf @@ -0,0 +1,29 @@ +% ital-z.mf +% from itall.mf +% +% Computer Modern Italic lower case: +% This lowercase italic alphabet was prepared by D. E. Knuth in December, 1979, +% inspired by the Monotype faces used in {\sl The Art of Computer Programming}. +% The programs were revised for the new \MF\ conventions in 1985. + +% Character codes \0141 through \0172 are generated. +%not + +% cmchar "Italic letter z"; +% beginchar("z",5.5u#+max(1.5u#,stem#),x_height#,0); +\"Dynamic letter z"; +beginchar(incr num,5.5u#+max(1.5u#,stem#),x_height#,0); +italcorr x_height#*slant+.5hair#; +adjust_fit(if monospace:.5u#,.5u# else: 0,0 fi); pickup fine.nib; +pos1(hair,0); pos2(stem,-90); pos3(vair,-90); pos4(hair,0); +lft x1l=hround(u-.5hair); x2=2.5u; x3=w-2u; rt x4r=hround(w-.5u); +top y1=.78h; top y2l=top y4=h+oo; y3=.825h; +pos5(hair,0); pos6(vair,-90); pos7(stem,-90); pos8(hair,0); +x5=x1; x6=2.5u; x7=w-2u; x8+.5hair=hround(w+.5hair-eps); +bot y5=bot y7r=-oo; y6=.175h; bot y8=.31h; +pair p; p=(z4-z5) yscaled 2; +filldraw stroke z1e{up}...z2e{right}..z3e{right}...{p}z4e; % upper bar +filldraw stroke z5e{p}...z6e{right}..{right}z7e...{up}z8e; % lower bar +filldraw stroke z5e{p}..{p}z4e; % diagonal +math_fit(0,1/3x_height#*slant+.5hair#+.5u#); +penlabels(1,2,3,4,5,6,7,8); endchar; diff --git a/mf/feta-klef.mf b/mf/feta-klef.mf index 3d78d804f4..d65822695e 100644 --- a/mf/feta-klef.mf +++ b/mf/feta-klef.mf @@ -215,7 +215,7 @@ def draw_gclef (expr exact_center, reduction)= set_char_box( left_space# + - -xpart exact_center + 1.1 * breapth_factor* reduced_il#, + -xpart exact_center + 1.0 * breapth_factor* reduced_il#, right_space# + xpart exact_center + .66 breapth_factor* reduced_il#, -ypart exact_center + 3 * reduced_il#, diff --git a/mf/feta-nummer-generic.mf b/mf/feta-nummer-generic.mf index 141dd70dd0..fca2c215cc 100644 --- a/mf/feta-nummer-generic.mf +++ b/mf/feta-nummer-generic.mf @@ -3,7 +3,7 @@ test:=0; -input autometric; +input feta-autometric; fet_beginfont("feta-nummer", size); mode_setup; diff --git a/mf/feta-schrift.mf b/mf/feta-schrift.mf index cec0283fcd..9cc309f3fb 100644 --- a/mf/feta-schrift.mf +++ b/mf/feta-schrift.mf @@ -372,7 +372,7 @@ fet_beginchar("Trill (`tr')","trill","trill") slant = .2; local_copy(transform)(currenttransform); - currenttransform := currenttransform slanted slant; + currenttransform := currenttransform slanted slant shifted (- interline, 0) ; y1 = ascender; x1l = 0; @@ -438,7 +438,7 @@ fet_beginchar("Trill (`tr')","trill","trill") --- z9r{up} .. z8r{left} .. z7r{z5-z7} -- cycle; fill r_p; - set_char_box(0,2 interline#, 0,ascender#); + set_char_box(interline# , interline#, 0,ascender#); penpos11(1/4 r_fatness, -20); diff --git a/mf/feta-test16.mf b/mf/feta-test16.mf index c561ed1d72..c7c8db872b 100644 --- a/mf/feta-test16.mf +++ b/mf/feta-test16.mf @@ -4,7 +4,7 @@ % font_identifier:="font-en-tja16"; % font_size 16pt#; -input autometric; +input feta-autometric; fet_beginfont("feta-test", 16); staffsize#:=16pt#; test:=1; diff --git a/mf/feta-test20.mf b/mf/feta-test20.mf index 4c1a4f80b7..b70e54a4f6 100644 --- a/mf/feta-test20.mf +++ b/mf/feta-test20.mf @@ -4,7 +4,7 @@ % font_identifier:="font-en-tja20"; % font_size 20pt#; -input autometric; +input feta-autometric; fet_beginfont("feta-test", 20); staffsize#:=20pt#; test:=1; diff --git a/mf/feta16.mf b/mf/feta16.mf index fa359d51c0..bcc8c41c7f 100644 --- a/mf/feta16.mf +++ b/mf/feta16.mf @@ -4,7 +4,7 @@ % font_identifier:="font-en-tja16"; % font_size 16pt#; -input autometric; +input feta-autometric; fet_beginfont("feta", 16); staffsize#:=16pt#; test:=0; diff --git a/mf/feta20.mf b/mf/feta20.mf index 5364504155..f4cbfaa95f 100644 --- a/mf/feta20.mf +++ b/mf/feta20.mf @@ -3,7 +3,7 @@ staffsize#:=20pt#; -input autometric; +input feta-autometric; fet_beginfont("feta", 20); % AFBLIJVEN! Gebruik feta-test16/20, anders verneuk je de distributie. diff --git a/mi2mu/TODO b/mi2mu/TODO index e522176955..2f0b77f11e 100644 --- a/mi2mu/TODO +++ b/mi2mu/TODO @@ -6,6 +6,8 @@ grep for TODO and ugh/ugr IMPORTANT + * if multiple channels per track: output each to separate voice + * get rid of (last few?) midi-specifics in mudela-* * find / remove trend (tempo) of mudela columns diff --git a/mi2mu/main.cc b/mi2mu/main.cc index 28cf48688a..623fc816e0 100644 --- a/mi2mu/main.cc +++ b/mi2mu/main.cc @@ -135,7 +135,7 @@ main (int argc_i, char* argv_sz_a[]) int i = str.index_i (':'); i = (i >=0 ? i : str.length_i ()); key.accidentals_i_ = String_convert::dec2_i (str.left_str (i)); - key.minor_i_ = (int)(bool)String_convert::dec2_i (str.mid_str (i + 1,1)); + key.minor_i_ = (int)(bool)String_convert::dec2_i (str.cut (i + 1,1)); break; } case 'n': diff --git a/mi2mu/mudela-stream.cc b/mi2mu/mudela-stream.cc index 73b231d168..ed1350645b 100644 --- a/mi2mu/mudela-stream.cc +++ b/mi2mu/mudela-stream.cc @@ -46,7 +46,7 @@ Mudela_stream::operator << (String str) if (!i) i = str.length_i(); String word = str.left_str (i); - str = str.mid_str (i, str.length_i()); + str = str.cut (i, str.length_i()); output_wrapped (word); } return *this; diff --git a/tex/fetdefs.tex b/tex/fetdefs.tex index 2a6385abf4..ab31cb344f 100644 --- a/tex/fetdefs.tex +++ b/tex/fetdefs.tex @@ -8,8 +8,10 @@ \font\dynfont=feta-din10 scaled \magstep1 \font\bracefont=feta-braces16 \font\fingerfont=feta-nummer4 + \interlinedist=4pt } \def\fettwentydefs{ + \interlinedist=5pt \font\fontentja=feta20 \font\vetfont=feta-beams20 \font\fetanummer=feta-nummer10 @@ -18,6 +20,9 @@ \font\fingerfont=feta-nummer5 } +\def\sixteenfonts{\fetsixteendefs\cmrsixteen} +\def\twentyfonts{\fettwentydefs\cmrtwenty} + \def\fetdef#1#2{\def#1{% \hbox{\fetchar{#2}}}} @@ -35,9 +40,9 @@ % oeps: \meter 12/8; \def\generalmeter#1#2{% \vbox to 0pt{\vss% - \hbox to0.45\balkheight{\hss\fetanummer #1\hss}% + \hbox to0.45\staffheight{\hss\fetanummer #1\hss}% \nointerlineskip% - \hbox to0.45\balkheight{\hss\fetanummer #2\hss}% + \hbox to0.45\staffheight{\hss\fetanummer #2\hss}% \vss}} \def\pianobrace#1{{\bracefont\char #1}} @@ -67,109 +72,7 @@ -% -% WARNING: don't leave blank lines in the PS-code; they are -% transformed into \par -% - - -\def\turnOnPostScript{ -\def\embeddedps##1{ - % - % This sets CTM so that you get to the currentpoint - % by executing a 0 0 moveto - \special{ps: @beginspecial @setspecial ##1 @endspecial} -} -\special{ps: -/draw_decresc - { - /ht exch def - /wd exch def -% - 0 ht moveto - wd ht neg rlineto - wd neg ht neg rlineto - stroke - } - def - /draw_cresc - { - /ht exch def - /wd exch def -% - 0 0 moveto - wd ht rmoveto - wd neg ht neg rlineto - wd ht neg rlineto - stroke - } - def -} -} - -\def\turnOnExperimentalFeatures{ -% draw a slur in embedded postscript -\special{ps: -/xbow 1 3 div def -/ybow 1 4 div def -/thin 0.2 def -/thick thin 5 mul def -/draw_slur { - % up or down? - /dir exch def -% -% for mo*tex shift -% exch -% 1 copy /dx exch def -% exch -% - % calc angle alpha - 2 copy exch atan /alpha exch def - % calc len(gth) - 2 exp exch 2 exp add sqrt /len exch def -% - % add and calc z2, z3 - len xbow mul - len ybow mul dir mul - 1 xbow sub len mul - len ybow mul dir mul -% - % add z4, z1 - len 0 - 0 0 -% - % add and calc z5..z8 - 8 copy - thin dir mul sub - 8 2 roll - thin dir mul sub - 8 2 roll - thick dir mul sub - 8 2 roll - thick dir mul sub -% - % reverse order, must be cycle - 8 6 roll - 6 2 roll - 4 2 roll - 8 6 roll -% - % set z1..z4 - 16 8 roll -% - alpha rotate -% silly mo*tex convention -% dx 2 div -1 mul 0 translate - % draw z1..z4 - moveto curveto - % draw z5..z8 - lineto curveto - % cycle - 0 0 lineto - fill -} def } -} - +\input lily-ps-defs \def\embeddedtex#1{#1} \def\embeddedmf#1{ @@ -196,7 +99,7 @@ % dat heb je handig gedaan, lieverd! \nometafont %\nopostscript -%\notex +\notex \def\EndLilyPondOutput{ \storeembedcount diff --git a/tex/lily-ps-defs.tex b/tex/lily-ps-defs.tex new file mode 100644 index 0000000000..9b0ed425a5 --- /dev/null +++ b/tex/lily-ps-defs.tex @@ -0,0 +1,148 @@ +% +% WARNING: don't leave blank lines in the PS-code; they are +% transformed into \par +% + +% +% Should put in a lily-ps.ps header? +% +% + +% +% header info (macros/defs, etc) should go into a \special{! ... }, +% note the ! sign. See dvips.info for details. +% + +% Use of +% /foo { operatorname } bind def +% +% ``compiles'' operatorname binding in the body of foo, making +% the code faster, and more reliable (less flexible) + + +% transplant a TeX dimension into the PS output. +\def\PSsetTeXdimen#1{\expandafter\special{! /#1 (\the\csname #1\endcsname) deftexdimen}} + +\def\turnOnPostScript{ +\def\embeddedps##1{% + % This sets CTM so that you get to the currentpoint + % by executing a 0 0 moveto + \special{ps: @beginspecial @setspecial ##1 @endspecial} +} + +% +% width, slope, height +% +\special{! % round cappings +1 setlinecap +/draw_beam +{ + /beam_thick exch def + /beam_slope exch def + /beam_wd exch def + beam_slope beam_wd mul /beam_ht exch def + 0 0 moveto + beam_wd beam_ht rlineto + 0 beam_thick rlineto + 0 beam_thick lineto + closepath fill +} bind def +% PS helper: convert (0.2pt) to the token 0.2 +/settexdimen { /thestring exch def + thestring 0 thestring length 2 sub + getinterval + token + pop exch pop } +def +% +/deftexdimen { + settexdimen + def +} def +} + + +\PSsetTeXdimen{staffrulethickness} +\PSsetTeXdimen{staffheight} +\special{! % +/draw_decresc + { + staffrulethickness setlinewidth + /cresc_cont exch def + /cresc_ht exch def + /cresc_wd exch def +% + cresc_wd cresc_cont moveto + 0 cresc_ht lineto + stroke + cresc_wd cresc_cont neg moveto + 0 cresc_ht neg lineto + stroke + } + bind def + /draw_cresc + { + /cresc_cont exch def + /cresc_ht exch def + /cresc_wd exch def +% + 0 cresc_cont moveto + cresc_wd cresc_ht lineto + stroke + 0 cresc_cont neg moveto + cresc_wd cresc_ht neg lineto + stroke + } + bind def + /lily_distance { + 1 copy mul exch 1 copy mul add sqrt + } bind def + staffheight 2 div + /slurhtlimit exch def + /slurratio 0.3333 def + % + % (b*ratio)/(1 + b / htlimit) + /getslurcontrol + { + slurhtlimit 90 div /slur_alpha exch def + slurratio 60 div slur_alpha div /slur_beta exch def + slur_beta mul 1 atan slur_alpha mul + } bind def + staffrulethickness 1.5 mul /slur_thick exch def + /draw_slur + { + staffrulethickness setlinewidth + 0 0 moveto + /slur_dir exch def + /slur_dy exch def + /slur_dx exch def + slur_dy slur_dx lily_distance /slur_b exch def + slur_b getslurcontrol + slur_dir mul /slur_ht exch def + slur_b getslurcontrol /slur_indent exch def +% + slur_dy slur_dx atan rotate + slur_indent slur_ht + slur_b slur_indent sub slur_ht + slur_b 0 + % pstack + rcurveto + % + slur_indent neg slur_ht slur_dir slur_thick mul sub + slur_indent slur_b sub slur_ht slur_dir slur_thick mul sub + slur_b neg 0 + rcurveto + % + gsave + fill + grestore + stroke + } bind def}} + + + + +\def\turnOnExperimentalFeatures{ +% draw a slur in embedded postscript +\special{ps: +}} diff --git a/tex/lilyponddefs.tex b/tex/lilyponddefs.tex index 3e2300989e..02116e998c 100644 --- a/tex/lilyponddefs.tex +++ b/tex/lilyponddefs.tex @@ -53,7 +53,7 @@ \newdimen\interlinedist \newdimen\stemthickness \newcount\n -\newdimen\balkheight +\newdimen\staffheight \newdimen\notewidth \newdimen\noteheight \newdimen\staffrulethickness @@ -64,20 +64,32 @@ % set fonts and primary dimensions % ugh \def\musixtwentydefs{ - \balkheight=20pt + \staffheight=20pt \notewidth=7.15pt \noteheight=5pt - \musixtwentyfonts - \font\textmusic=cmmi12 + \twentyfonts \musixcalc } +\def\cmrtwenty{ + \font\meterfont=cmbx15 + \font\italicfont=cmti10 + \font\musicmathfont=cmsy10 + \font\normaltextfont=cmr10 %\textfont is a primitive + \font\smalltextfont=cmr8 +} +\def\cmrsixteen{ + \font\smalltextfont=cmr6 + \font\normaltextfont=cmr8 %\textfont is a primitive + \font\meterfont=cmbx12 + \font\italicfont=cmti8 + \font\textmusic=cmmi10 +} \def\musixsixteendefs{ - \balkheight=16pt + \staffheight=16pt \notewidth=5.93pt \noteheight=4pt - \musixsixteenfonts - \font\textmusic=cmmi10 + \sixteenfonts \musixcalc } @@ -96,9 +108,8 @@ % this has to be synced with the font definition \def\musixcalc{ - \interlinedist=\fontdimen5\musicfnt \smallspace=.3\interlinedist - \interstaffrule=\balkheight + \interstaffrule=\staffheight \divide\interstaffrule by 4 % [D.K.Roush & J.S.Gourlay] say this should be 0.072 @@ -115,19 +126,20 @@ % stacked horizontal lines \input dyndefs +\input fetdefs -\input taupindefs +%\input taupindefs %\input eglerdefs \def\emptybar{} -\def\defaultthinbar{\thinbar{\balkheight}} -\def\defaultthickbar{\thickbar{\balkheight}} +\def\defaultthinbar{\thinbar{\staffheight}} +\def\defaultthickbar{\thickbar{\staffheight}} %? what-s wrong with rightalign? \def\repeatstopbar{\hss\rightalign{\repeatcolon\hskip2\smallspace\defaultthinbar\hskip\smallspace\defaultthickbar}} \def\repeatstartbar{\hbox{\defaultthickbar\kern\smallspace\defaultthinbar\kern2\smallspace\repeatcolon}} -\def\repeatstopstart{\hbox{\repeatcolon\kern2\smallspace\defaultthinbar\kern\smallspace\defaultthickbar\kern\smallspace\defaultthickbar\kern\smallspace\defaultthinbar\kern2\smallspace\repeatcolon}} +\def\repeatstopstart{\hbox{\repeatcolon\kern2\smallspace\defaultthickbar\kern\smallspace\defaultthickbar\kern2\smallspace\repeatcolon}} %compatibility \def\repeatbar{\repeatstopbar} diff --git a/tex/taupindefs.tex b/tex/taupindefs.tex index 582c4dcd90..a6aa7c70fb 100644 --- a/tex/taupindefs.tex +++ b/tex/taupindefs.tex @@ -1,7 +1,5 @@ \def\musixtwentyfonts{ - \font\normaltextfont=cmr10 %\textfont is a primitive - \font\smalltextfont=cmr8 - \font\meterfont=cmbx15 + \font\dynfont=cmbxti10 scaled \magstep2 \font\slurufont=xslu20 \font\slurdfont=xsld20 \font\slurhfont=xslz20 @@ -10,9 +8,6 @@ \font\hslurhfont=xslhz20 \font\musicfnt=musix20 \font\musicdraw=musixsps - \font\italicfont=cmti10 - \font\dynfont=cmbxti10 scaled \magstep2 - \font\musicmathfont=cmsy10 \fettwentydefs } @@ -20,8 +15,6 @@ \def\musixsixteenfonts{ \font\normaltextfont=cmr8 %\textfont is a primitive \font\smalltextfont=cmr6 - \font\meterfont=cmbx12 - \font\italicfont=cmti8 \font\slurufont=xslu16 \font\slurdfont=xsld16 \font\slurhfont=xslz20 % sigh @@ -136,4 +129,3 @@ % \musicfnt\char\count0}} -\input fetdefs