From 25d32ba5da151ed51e1d7c0db2a0520a7706ce3c Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 01:02:50 +0000 Subject: [PATCH] lilypond-1.3.149 --- Documentation/topdocs/WINDOWS.texi | 34 +- Documentation/user/tutorial.itely | 237 +------------- Documentation/windows/cygwin-installer.patch | 43 ++- flower/include/dictionary.hh | 9 +- flower/include/getopt-long.hh | 3 +- flower/include/libc-extension.hh | 2 +- flower/include/rational.hh | 5 +- flower/include/source-file.hh | 3 - flower/include/string.hh | 4 +- flower/include/virtual-methods.hh | 2 +- flower/rtti.cc | 2 +- flower/source-file.cc | 3 +- input/test/ct-jazz.ly | 21 ++ input/test/super-sub.ly | 27 ++ input/test/title.ly | 65 ++-- input/twinkle.ly | 8 +- lily/a2-engraver.cc | 2 +- lily/afm.cc | 2 +- lily/align-interface.cc | 4 - lily/include/grob-info.hh | 2 +- lily/include/lily-guile.hh | 5 +- lily/include/main.hh | 2 +- lily/include/moment.hh | 6 +- lily/include/paper-stream.hh | 8 +- lily/include/scm-hash.hh | 2 +- lily/lexer.ll | 1 + lily/lily-guile.cc | 10 + lily/main.cc | 5 +- lily/midi-stream.cc | 4 + lily/molecule.cc | 22 +- lily/music-constructor.cc | 4 +- lily/paper-stream.cc | 10 +- lily/property-iterator.cc | 4 +- lily/text-item.cc | 104 ++++-- lilypond-mode.el | 8 +- ly/german-chords.ly | 84 +++-- ly/params.ly | 8 + midi2ly/main.cc | 1 + ports/mutopia/GruberFX/GNUmakefile | 3 + ps/lily.ps | 8 +- ps/lilyponddefs.ps | 195 +++++++++++- scm/chord-name.scm | 315 ++++++++++++------- scm/font.scm | 21 +- scm/grob-property-description.scm | 10 +- scm/lily.scm | 8 + scm/ps.scm | 12 +- scripts/convert-ly.py | 7 + scripts/update-lily.py | 87 ++--- 48 files changed, 847 insertions(+), 585 deletions(-) create mode 100644 input/test/ct-jazz.ly create mode 100644 input/test/super-sub.ly create mode 100644 ports/mutopia/GruberFX/GNUmakefile diff --git a/Documentation/topdocs/WINDOWS.texi b/Documentation/topdocs/WINDOWS.texi index 8c79551a56..f3eff2dbfa 100644 --- a/Documentation/topdocs/WINDOWS.texi +++ b/Documentation/topdocs/WINDOWS.texi @@ -151,9 +151,41 @@ emacs-on-cygwin setup. * GUILE errors, simple guile test -* TEX errors, simple tex test +* (La)TEX errors, simple tex test + +] +@ignore + + guile -v + Guile 1.4.1 + + guile -e %load-path + ERROR: Wrong type to apply: ("/usr/share/guile/site" /usr/share/guile/1.4.1") + + + +Mats? + +Let's take this step by step. + +It should not be critical which MikTeX version you use. +Let's first verify that your MikTeX works as it should. +Open a DOS window. Run the commands +>> latex sample2e + Should produce some lines of output +>> yap sample2e + Should display a three page document. + +Next step; verify that the geometry package is in place. +Save the attached file to the directory where you run +your DOS window. Run the commands +>> latex geometrytest +>> yap geometrytest +This one you should get a single page document with some text +in each corner. ] +@end ignore diff --git a/Documentation/user/tutorial.itely b/Documentation/user/tutorial.itely index bc3a3475d2..5772357a91 100644 --- a/Documentation/user/tutorial.itely +++ b/Documentation/user/tutorial.itely @@ -1709,9 +1709,9 @@ conductor's score. \context Staff = corni < \property Staff.midiInstrument = #"french horn" \property Staff.instrument = #`(lines "Corno" - (rows "(E" ,text-flat ")")) + (columns "(E" ,text-flat ")")) \property Staff.instr = #`(lines "Cor." - (rows "(E" ,text-flat ")")) + (columns "(E" ,text-flat ")")) \property Staff.transposing = #3 \notes \key bes \major \context Voice=one \corno @@ -1885,10 +1885,10 @@ when they're different. @separate @example \property Staff.instrument = #`(lines "Corno" - (rows "(E" ,text-flat ")")) + (columns "(E" ,text-flat ")")) @end example The french horn has the most complex scheme markup name, made up of two -lines of text. The second line has two elements (rows), the @code{E} +lines of text. The second line has two elements (columns), the @code{E} and the flat sign @code{text-flat} that we defined before. @separate @@ -2223,234 +2223,5 @@ Type @samp{make help} to see possible targets. * Songs with additional verses:: @end menu - -So what does this look like? Well, here is an example: -@li lypond[veryverbatim, intertext="produces this music:"] -\score{ - \notes\relative c'{ - \time 5/8 - [e16( g b c a g][e a b d] | )e2 d,8 | - [e16( g b c a g][e a b d] | )b2 [a16( f] | - [e a b d] )e4 c8 | [es16( bes a as g es][d c b! )g] | - [f( a b d b a][f a b d] | )e2 - } -} -@end lilypond -If you are lucky, the above example show a nice feature of LilyPond -and La@TeX{}. Since LilyPond can output the music as @TeX{} graphics, -La@TeX{} can insert pagebreaks between the lines of music. - -Notice that there is no @code{\paper} statement in the example -above. Lilypond-book will insert some code for you that defines the -linewidth and the font to use. If you don't want to change the default, -there is no need to put an empty @code{\paper@{@}} inside the @code{\score}. -In the example above, something like this might be inserted before your code: -@example -\include "paper16.ly" -\paper@{ \paper_sixteen - linewidth = 390.\pt -@} -@end example -The actual values for linewidth will differ depending on papersize and -number of columns. Also, if you use a different fontsize for the -music, another file than @code{paper16.ly} should be included. - -If you want to make the music not so wide, you can insert a -@code{\paper} statement to set the linewidth: - -@li lypond[veryverbatim, intertext="produces this music:"] -\score{ - \notes\relative c'{ - \time 5/8 - [e16( g b c a g][e a b d] | )e2 d,8 | - [e16( g b c a g][e a b d] | )b2 [a16( f] | - [e a b d] )e4 c8 | [es16( bes a as g es][d c b! )g] | - [f( a b d b a][f a b d] | )e2 - } - \paper{linewidth = 10.\cm } -} -@end lilypond - -Very often, if you mix music and text, the music is often only a -few notes or at most a few bars. This music should be as short as -possible and not stretched to be aligned to the right margin. - -If you only write voice-contents in the lilypond block, @command{lilypond-book} -will set the @code{linewidth} variable to -1, so Lilypond -will make the music as short as possible but without breaking the -line. Here is a well know harmonic progression: -@li lypond[veryverbatim, intertext="produce a well known harmonic progression:"] - \context Voice { } -@end lilypond - -If you want to place music examples in the text, -@li lypond[eps] - \context Voice { } -@end lilypond -, you can use the @code{eps} option. This will create the music as -eps graphics and include it into the document with the -@code{\includegraphics} command. - -The code used look like this: -@example -@@li lypond[eps] - \context Voice @{ @} -@@end lilypond -@end example - -You can also use the @code{eps} option if the block is a complete -lilypond source. This 5 cm long empty line, -@li lypond[eps] -\score{ - \notes{s} - \paper{ linewidth = 5.\cm } -} -@end lilypond -was created with this code: -@example -@@li lypond[eps] -\score@{ - \notes@{s@} - \paper@{ linewidth = 5.\cm@} -@} -@@end lilypond -@end example - -To avoid that La@TeX{} places the music on a line of its one, there should -be no empty lines between the normal text and the lilypond -environment. - -You can also use @code{lilypondfile}, to include another file: -@example - @@li lypondfile[printfilename]@{foo.ly@} -@end example - -@subsection Fontsize options - -You can use all lilypond fontsizes in @command{lilypond-book}. The -default 16pt fontsize is probably to big to be included in the middle of -the text, 11pt or 13pt is probably better. - -The code can look like this: -@example -@@li lypond[13pt, eps] - -@@end lilypond -@end example - -The following options set the fontsize: -@itemize -@item @code{11pt} -@li lypond[11pt, eps] - \relative c'{ - r16 [c d e][f d e c] [g'8 c][b-\prall c] | - [d16 g, a b][c a b g][d'8 g f-\prall g] - } -@end lilypond -@item @code{13pt} -@li lypond[13pt, eps] - \relative c'{ - r16 [c d e][f d e c] [g'8 c][b-\prall c] | - [d16 g, a b][c a b g][d'8 g f-\prall g] - } -@end lilypond -@item @code{16pt} -@li lypond[16pt, eps] - \relative c'{ - r16 [c d e][f d e c] [g'8 c][b-\prall c] | - [d16 g, a b][c a b g][d'8 g f-\prall g] - } -@end lilypond -@item @code{20pt} -@li lypond[20pt, eps] - \relative c'{ - r16 [c d e][f d e c] [g'8 c][b-\prall c] | - [d16 g, a b][c a b g][d'8 g f-\prall g] - } -@end lilypond -@item @code{26pt} -@li lypond[26pt, eps] - \relative c'{ - r16 [c d e][f d e c] [g'8 c][b-\prall c] | - } -@end lilypond -@end itemize - - -@subsection More options - -@itemize -@item The @code{singleline} option sets @code{linewidth} to -1.0. -@item The @code{multiline} option sets @code{linewidth} to a value letting -the music be aligned to the right margin. The music can span several -lines. -@end itemize - -@subsection Just in case... -The options @code{fragment} and @code{nofragment} will override -@command{lilypond-book} when it scans the lilypond code to see if it is voice -contents or complete code. This might be useful if @command{lilypond-book} choose -wrong. - -Since there is no finder's fee which doubles every year, there is no -need to wait for the price money to grow. So send a bug report today -if you need this one of these options. - -@subsection Examples - -This was all options to @code{\begin}. The rest of the lilypond -document will show some ways you can use lilypond in -La@TeX{} documents. It will also act as a simple test-suite for -lilypond-book. You can place @code{eps} lilypond in and marginspars just -as any other included eps graphics. - -@li lypond -\score{ - \notes\relative c'{ - \time 12/8 - r4-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--] - [f16-.( )f-. dis8-- gis16-.( )gis-.] cis4.-\fermata | - - r4.-\fermata [cis,16 cis g'8 f16 f b8][g16 g f8 b16 b] dis4.-\fermata - } - \paper{linewidth = 7.\cm} -} -@end lilypond - - -To the right you can see some bars from the trumpet fanfara from the -beginning of the fantastic street opera ``Houdini the Great'', by the -Danish composer Andy Pape. The music is put inside a -@code{floatingfigure} environment, and the music will be aligned by -the right margin if you set floatingfigure width and lilypond linewidth -to the same value. The code looks like this: - -@li lypond[verbatim] -\score{ - \notes\relative c'{ - \time 12/8 - r4.-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--] - [f16-.( )f-. dis8-- gis16-.( )gis-.] cis8.-\fermata | - - r4.-\fermata [cis,16 cis g'8 f16 f b8] - [g16 g f8 b16 b] dis4.-\fermata - } - \paper{linewidth = 7.\cm } -} -@end lilypond - -If you have a lot of small music examples like this in the middle of -your text, you might get a nicer look by using ``double'' line -spacing. Put the @code{\linespread@{1.6@}} command into the preamble of -your document. Then the line spacing will not be increased between the -lines where you have music printed with the smallest font size. - -Lilypond-book does know about @code{\onecolumn} and @code{\twocolumn}. -So the music will be adjusted to the new linewidth: - -Verbatim environments will also ignore the page margins. That is -a feature of La@TeX{}. (But you usually put things inside a verbatim -environment when you don't want La@TeX{} to do any linebreaking) - @end ignore diff --git a/Documentation/windows/cygwin-installer.patch b/Documentation/windows/cygwin-installer.patch index 551e99db37..11bac9d269 100644 --- a/Documentation/windows/cygwin-installer.patch +++ b/Documentation/windows/cygwin-installer.patch @@ -1,8 +1,7 @@ -Only in .: LilyPond.ico diff -urN ../cinstall/Makefile.in ./Makefile.in --- ../cinstall/Makefile.in Thu Feb 8 05:55:22 2001 -+++ ./Makefile.in Tue Apr 10 19:20:14 2001 -@@ -130,11 +130,16 @@ ++++ ./Makefile.in Thu Apr 12 11:41:37 2001 +@@ -130,11 +130,15 @@ @chmod a-x $@ clean: @@ -12,10 +11,10 @@ diff -urN ../cinstall/Makefile.in ./Makefile.in + $(MAKE) -C zlib $@ realclean: clean - rm -f Makefile config.cache -+ rm -f *.d -+ rm -f inilex.c iniparse.c iniparse.h version.c config.log config.status *.d -+ +- rm -f Makefile config.cache ++ rm -f Makefile *.d ++ rm -f config.cache config.log config.status ++ rm -f inilex.c iniparse.c iniparse.h version.c + +distclean: realclean @@ -23,7 +22,7 @@ diff -urN ../cinstall/Makefile.in ./Makefile.in $(SHELL) $(updir1)/mkinstalldirs $(bindir) $(etcdir) diff -urN ../cinstall/desktop.cc ./desktop.cc --- ../cinstall/desktop.cc Sat Nov 11 05:55:16 2000 -+++ ./desktop.cc Tue Apr 10 19:15:01 2001 ++++ ./desktop.cc Thu Apr 12 11:39:52 2001 @@ -79,9 +79,7 @@ "done", "", @@ -110,7 +109,7 @@ diff -urN ../cinstall/desktop.cc ./desktop.cc diff -urN ../cinstall/ini.cc ./ini.cc --- ../cinstall/ini.cc Thu Oct 5 05:55:27 2000 -+++ ./ini.cc Sun Apr 8 21:52:03 2001 ++++ ./ini.cc Thu Apr 12 11:39:52 2001 @@ -174,7 +174,7 @@ { *nl = 0; @@ -122,7 +121,7 @@ diff -urN ../cinstall/ini.cc ./ini.cc diff -urN ../cinstall/msg.cc ./msg.cc --- ../cinstall/msg.cc Sat Aug 26 05:55:14 2000 -+++ ./msg.cc Sun Apr 8 21:51:56 2001 ++++ ./msg.cc Thu Apr 12 11:39:52 2001 @@ -44,7 +44,7 @@ vsprintf (buf, fmt, args); @@ -134,7 +133,7 @@ diff -urN ../cinstall/msg.cc ./msg.cc void diff -urN ../cinstall/res.rc ./res.rc --- ../cinstall/res.rc Wed Mar 7 18:13:31 2001 -+++ ./res.rc Sun Apr 8 19:48:40 2001 ++++ ./res.rc Fri Apr 13 16:06:40 2001 @@ -30,10 +30,10 @@ IDD_SOURCE DIALOG DISCARDABLE 0, 0, 215, 95 @@ -325,18 +324,19 @@ diff -urN ../cinstall/res.rc ./res.rc CYGWIN.ICON FILE DISCARDABLE "cygwin.ico" ///////////////////////////////////////////////////////////////////////////// -@@ -354,7 +355,7 @@ +@@ -354,7 +355,8 @@ BEGIN IDS_ROOT_SLASH "Warning: we recommend you do NOT use the root of your hard drive as the cygwin root. Proceed anyway?" IDS_ROOT_SPACE "You should not choose a root path that include spaces in directory names. Proceed anyway?" - IDS_MIRROR_LST "http://sources.redhat.com/cygwin/mirrors.lst" -+ IDS_MIRROR_LST "http://appel.lilypond.org/lilypond/gnu-windows/mirrors.lst" ++ // IDS_MIRROR_LST "http://appel.lilypond.org/lilypond/gnu-windows/mirrors.lst" ++ IDS_MIRROR_LST "http://www.lilypond.org/gnu-windows/mirrors.lst" IDS_DIALOG_FAILED "Unable to create Dialog Box" IDS_CYGWIN_FUNC_MISSING "Error: unable to find function `%s' in %s" IDS_DOWNLOAD_SHORT "Download error: %s too short (%d, wanted %d)" diff -urN ../cinstall/resource.h ./resource.h --- ../cinstall/resource.h Thu Mar 1 05:55:20 2001 -+++ ./resource.h Sun Apr 8 16:38:11 2001 ++++ ./resource.h Thu Apr 12 11:39:52 2001 @@ -47,11 +47,12 @@ #define IDB_SPIN 118 #define IDB_RTARROW 119 @@ -351,4 +351,17 @@ diff -urN ../cinstall/resource.h ./resource.h #define IDC_SOURCE_DOWNLOAD 1000 #define IDC_SOURCE_NETINST 1001 #define IDC_SOURCE_CWD 1002 -Common subdirectories: ../cinstall/zlib and ./zlib +diff -urN ../cinstall/zlib/Makefile.in ./zlib/Makefile.in +--- ../cinstall/zlib/Makefile.in Tue Aug 8 05:55:18 2000 ++++ ./zlib/Makefile.in Thu Apr 12 11:42:10 2001 +@@ -299,6 +299,10 @@ + + clean: clean-am + ++realclean: clean ++ rm -f Makefile *.d ++ rm -f config.cache config.log config.status ++ + distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + diff --git a/flower/include/dictionary.hh b/flower/include/dictionary.hh index 464bfa1323..701bc30d1d 100644 --- a/flower/include/dictionary.hh +++ b/flower/include/dictionary.hh @@ -19,7 +19,7 @@ unsigned int string_hash (String); -template +template struct Dict_initialiser { char *key_; @@ -30,8 +30,9 @@ struct Dict_initialiser /* interface to STL function. */ -template -class Dictionary : public map +#include "cons.hh" +template +class Dictionary : public std::map //map { public: Dictionary () @@ -46,7 +47,7 @@ public: } bool elem_b (String s) { - map::const_iterator ki (find (s)); + std::map::const_iterator ki (find (s)); return ki != end (); } diff --git a/flower/include/getopt-long.hh b/flower/include/getopt-long.hh index 887a1a3709..a0992c98e6 100644 --- a/flower/include/getopt-long.hh +++ b/flower/include/getopt-long.hh @@ -1,10 +1,9 @@ #ifndef GETOPT_LONG_HH #define GETOPT_LONG_HH +#include /* gcc 3.0 */ #include "string.hh" -class ostream; - /** a struct this for initialising the commandline options. */ diff --git a/flower/include/libc-extension.hh b/flower/include/libc-extension.hh index 5d63e995d5..bc76e9400b 100644 --- a/flower/include/libc-extension.hh +++ b/flower/include/libc-extension.hh @@ -21,7 +21,7 @@ char* strnupr (char* start_l, int n); #if !HAVE_MEMMEM // GNU extension. void *memmem (void const * haystack, int haystack_len, void const *needle, int needle_len); -#endif HAVE_MEMMEM +#endif /* HAVE_MEMMEM */ #if !HAVE_SNPRINTF // GNU extension. int snprintf (char *str, size_t n, char const *format, ...); diff --git a/flower/include/rational.hh b/flower/include/rational.hh index e095f58710..0b1d5d972d 100644 --- a/flower/include/rational.hh +++ b/flower/include/rational.hh @@ -10,11 +10,11 @@ #ifndef RATIONAL_HH #define RATIONAL_HH - #include "compare.hh" #include "arithmetic-operator.hh" #include "flower-proto.hh" -class String; +#include "string.hh" + /** Rational numbers. Included is support for + and - infinity. @@ -87,7 +87,6 @@ Rational::copy (Rational const&r) den_ = r.den_; } -class ostream; ostream & operator << (ostream &, Rational); diff --git a/flower/include/source-file.hh b/flower/include/source-file.hh index 7e590e01c0..7c039ca0ea 100644 --- a/flower/include/source-file.hh +++ b/flower/include/source-file.hh @@ -10,9 +10,6 @@ #include "string.hh" #include "interval.hh" -class istream; - - /** class for reading and mapping a file. diff --git a/flower/include/string.hh b/flower/include/string.hh index 5868d9313a..d64c8403f3 100644 --- a/flower/include/string.hh +++ b/flower/include/string.hh @@ -10,13 +10,11 @@ #ifndef STRING_HH #define STRING_HH - +#include /* gcc 3.0 */ #include "arithmetic-operator.hh" #include "flower-proto.hh" #include "string-handle.hh" -class ostream; - /** Intuitive string class. provides diff --git a/flower/include/virtual-methods.hh b/flower/include/virtual-methods.hh index e5516d8e70..45e6104127 100644 --- a/flower/include/virtual-methods.hh +++ b/flower/include/virtual-methods.hh @@ -15,7 +15,7 @@ #define classname(class_ptr) demangle_classname (typeid (* (class_ptr))) const char * -demangle_classname (type_info const &); +demangle_classname (std::type_info const &); /** diff --git a/flower/rtti.cc b/flower/rtti.cc index e942dfbc1b..fc278636a1 100644 --- a/flower/rtti.cc +++ b/flower/rtti.cc @@ -4,7 +4,7 @@ const char * -demangle_classname (type_info const &t) +demangle_classname (std::type_info const &t) { char const *s = t.name (); while (isdigit (*s)) diff --git a/flower/source-file.cc b/flower/source-file.cc index 4c5a4390fd..9d2b902e55 100644 --- a/flower/source-file.cc +++ b/flower/source-file.cc @@ -49,7 +49,8 @@ Source_file::istream_l () else { istream_p_ = new istrstream ("", 0); - istream_p_->set (ios::eofbit); + istream_p_->setstate (ios::eofbit); + // istream_p_->set (ios::eofbit); } } return istream_p_; diff --git a/input/test/ct-jazz.ly b/input/test/ct-jazz.ly new file mode 100644 index 0000000000..f4c7771b67 --- /dev/null +++ b/input/test/ct-jazz.ly @@ -0,0 +1,21 @@ +\header { + title="Chord Taxomony of LilyPond -- jazz" + subtitle="Amy's chord tests" +} +scheme = \chords { + c1 + c:4 + c:9 + bes:9^7 + c:11^7 + c:9+ + % TODO + } + +\score { + < + \property ChordNames.ChordName \set #'style = #'jazz + \context ChordNames \scheme + \context Staff \notes \transpose c'' \scheme + > +} diff --git a/input/test/super-sub.ly b/input/test/super-sub.ly new file mode 100644 index 0000000000..5d55806d8d --- /dev/null +++ b/input/test/super-sub.ly @@ -0,0 +1,27 @@ +\header { +texidoc="Test super/sub, raise and overstrike." +} + + + +\score { + \notes \relative a'' { + c^#'("bar") + c^#'(("bar")) + c^#'((("bar"))) + c^#'(bold "bar") + c^#'((bold) "bar") + c^#'(((bold)) "bar") + c^#'(bold ("bar")) + c^#'(bold "bar") + c^#'(columns "foe" ((raise . 3) "bar")) + c^#'(columns "foe" (((raise . 3) "bar"))) + c^#'(columns "foe" (((raise . 3)) "bar")) + c^#'(columns "foe" (super "12") (sub "3 4")) + c^#'(columns "foe" (super (overstrike "o") "/") (sub "x")) + c^#'(columns "foe" (overstrike "o") "/") + c^#'(columns "foe" ((bold roman overstrike) "o") "/") + c^#'(columns "foe" ((extent . (0 . 0)) "o") "/") + c^#'(columns "foo" (super "bar" (super "baz"))) + } +} \ No newline at end of file diff --git a/input/test/title.ly b/input/test/title.ly index 10c4939ffe..397d6c02ab 100644 --- a/input/test/title.ly +++ b/input/test/title.ly @@ -1,41 +1,38 @@ \version "1.3.146" -\header{ -filename = "title.ly" -title = "Title" -subtitle = "Subtitle" -composer= "Composer (xxxx-yyyy)" -arranger = "Arranger" -copyright = "public domain" -enteredby = "jcn" -source = "urtext" -instrument= "Instrument" +\header { + filename = "title.ly" + title = "Title" + subtitle = "Subtitle" + subsubtitle = "Subsubtitle" + composer = "Composer (xxxx-yyyy)" + arranger = "Arranger" + copyright = "public domain" + enteredby = "jcn" + source = "urtext" + instrument = "Instrument" } - - -\score{ - \notes - \relative c'{ - c' d e f f e d c \break - c d e f f e d c - } - \header{ - opus = "Opus 0" - piece = "Piece I" - override="Overdriven" - } +\score { + \context Staff \notes \relative c' { + \repeat unfold 10 { + c d e f f e d c \break + c d e f f e d c + } + } + \header { + opus = "Opus 0" + piece = "Piece I" + } } - -\score{ - \notes - \relative c' { - f' e d c c d e f \break - f e d c c d e f - } - \header{ - piece = "Piece II" - opus = "Opus 1" - } +\score { + \notes \relative c' { + f e d c c d e f \break + f e d c c d e f + } + \header { + opus = "Opus 1" + piece = "Piece II" + } } diff --git a/input/twinkle.ly b/input/twinkle.ly index c9cfc68f47..24f8e47a5f 100644 --- a/input/twinkle.ly +++ b/input/twinkle.ly @@ -141,11 +141,7 @@ textiii = \lyrics{ %} > > - \paper{ - gourlay_maxmeasures = 14.0 - } - \midi{ - \tempo 4 = 120 - } + \paper{ } + \midi{ \tempo 4 = 120 } } diff --git a/lily/a2-engraver.cc b/lily/a2-engraver.cc index f52b9f0387..09d10282d7 100644 --- a/lily/a2-engraver.cc +++ b/lily/a2-engraver.cc @@ -59,7 +59,7 @@ A2_engraver::create_grobs () announce_grob (text_p_, 0); Direction dir = UP; - SCM text; + SCM text = SCM_EOL; if (solo == SCM_BOOL_T) { state_ = SOLO; diff --git a/lily/afm.cc b/lily/afm.cc index 764b633cc1..aa569951ea 100644 --- a/lily/afm.cc +++ b/lily/afm.cc @@ -59,7 +59,7 @@ Adobe_font_metric::find_ascii_metric (int a , bool warn) const AFM_CharMetricInfo const * Adobe_font_metric::find_char_metric (String nm, bool warn) const { - map::const_iterator ai = name_to_metric_dict_.find (nm); + std::map::const_iterator ai = name_to_metric_dict_.find (nm); if (ai == name_to_metric_dict_.end ()) { diff --git a/lily/align-interface.cc b/lily/align-interface.cc index 0310b7c959..6f6321af68 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -13,10 +13,6 @@ #include "axis-group-interface.hh" #include "paper-def.hh" -/* - This callback is set in the children of the align element. It does - not compute anything, but a side effect of a->do_side_processing () - is that the elements are placed correctly. */ MAKE_SCHEME_CALLBACK (Align_interface,alignment_callback,2); SCM Align_interface::alignment_callback (SCM element_smob, SCM axis) diff --git a/lily/include/grob-info.hh b/lily/include/grob-info.hh index c8f57c20aa..4e00958060 100644 --- a/lily/include/grob-info.hh +++ b/lily/include/grob-info.hh @@ -20,7 +20,7 @@ */ struct Grob_info { Translator * origin_trans_l_; - friend Engraver; + friend class Engraver; public: Link_array origin_trans_l_arr (Translator*) const; Grob * elem_l_; diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index a14c160839..fecff2483d 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -65,6 +65,9 @@ void init_lily_guile (); bool isdir_b (SCM s); bool isaxis_b (SCM s); +bool ly_number_pair_p (SCM); +bool ly_axis_p (SCM); + /* these conversion functions also do a typecheck on the argument, and return a default value if S has the wrong type. @@ -88,7 +91,7 @@ void add_scm_init_func (void (*) ()); typedef SCM (*Scheme_function_unknown) (); -#if __GNUC_MINOR__ >= 96 +#if __GNUC__ > 2 || __GNUC_MINOR__ >= 96 typedef SCM (*Scheme_function_0) (); typedef SCM (*Scheme_function_1) (SCM); typedef SCM (*Scheme_function_2) (SCM,SCM); diff --git a/lily/include/main.hh b/lily/include/main.hh index bf3e931892..d85f19796d 100644 --- a/lily/include/main.hh +++ b/lily/include/main.hh @@ -38,7 +38,7 @@ extern File_path global_path; extern int score_count_global; extern Sources* source_global_l; -class ostream; +#include /* gcc 3.0 */ void print_lilypond_versions (ostream &os); #endif /* MAIN_HH */ diff --git a/lily/include/moment.hh b/lily/include/moment.hh index 7810f2063f..2583bb56ab 100644 --- a/lily/include/moment.hh +++ b/lily/include/moment.hh @@ -35,14 +35,14 @@ public: Moment * unsmob_moment (SCM); +#if 0 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, / ); -IMPLEMENT_ARITHMETIC_OPERATOR (Moment, + ); IMPLEMENT_ARITHMETIC_OPERATOR (Moment, * ); +IMPLEMENT_ARITHMETIC_OPERATOR (Moment, + ); IMPLEMENT_ARITHMETIC_OPERATOR (Moment, - ); IMPLEMENT_ARITHMETIC_OPERATOR (Moment, % ); - INSTANTIATE_COMPARE (Moment const&, Rational::compare); - +#endif #endif /* MOMENT_HH */ diff --git a/lily/include/paper-stream.hh b/lily/include/paper-stream.hh index 939f6522a5..0864b408dd 100644 --- a/lily/include/paper-stream.hh +++ b/lily/include/paper-stream.hh @@ -33,9 +33,13 @@ private: void break_line (); }; -class ostream; -#include +#include /* gcc 3.0 */ +#if __GNUC__ > 2 +ostream *open_file_stream (String filename, + std::ios_base::openmode mode=std::ios::out); +#else ostream *open_file_stream (String filename, int mode=ios::out); +#endif void close_file_stream (ostream *os); diff --git a/lily/include/scm-hash.hh b/lily/include/scm-hash.hh index 5215476963..c2169f3fdb 100644 --- a/lily/include/scm-hash.hh +++ b/lily/include/scm-hash.hh @@ -25,7 +25,7 @@ struct SCM_less } }; -typedef map Scm_stl_map; +typedef std::map Scm_stl_map; /** auto resizing hash table. diff --git a/lily/lexer.ll b/lily/lexer.ll index 7751f2b979..01a2cf6c70 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -24,6 +24,7 @@ #include #include +#include /* gcc 3.0 */ #include "score.hh" #include "lily-guile.hh" diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index b93e7cb30f..30ac299bf8 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -228,7 +228,17 @@ ly_isdir_p (SCM s) return SCM_BOOL_F; } +bool +ly_number_pair_p (SCM p) +{ + return gh_pair_p (p) && gh_number_p (gh_car (p)) && gh_number_p (gh_cdr (p)); +} +bool +ly_axis_p (SCM a) +{ + return gh_number_p (a) && (gh_scm2int (a) == 0 || gh_scm2int (a) == 1); +} typedef void (*Void_fptr) (); Array *scm_init_funcs_; diff --git a/lily/main.cc b/lily/main.cc index 513054c763..703655df75 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -411,7 +411,8 @@ main (int argc, char **argv) export GUILE_MAX_SEGMENT_SIZE=576000 may considerably decrease memory footprint (~*0.85), with a small - execution time penalty (~*1.10). */ + execution time penalty (~*1.10). However, if this 15% gain in memory + usage prevents swapping, the execution time falls drastically. */ sane_putenv ("GUILE_INIT_SEGMENT_SIZE_1", "4194304"); sane_putenv ("GUILE_MAX_SEGMENT_SIZE", "8388608"); @@ -431,7 +432,7 @@ main (int argc, char **argv) { String s = oparser_p_static->optional_argument_ch_C_; Path p = split_path (s); - if (p.ext.empty_b ()) + if (s != "-" && p.ext.empty_b ()) p.ext = format_to_ext (output_format_global); output_name_global = p.str (); } diff --git a/lily/midi-stream.cc b/lily/midi-stream.cc index a2e4d7d5d7..b353f92dc7 100644 --- a/lily/midi-stream.cc +++ b/lily/midi-stream.cc @@ -20,7 +20,11 @@ Midi_stream::Midi_stream (String filename) { filename_str_ = filename; +#if __GCC__ > 2 os_p_ = open_file_stream (filename, ios::out|ios::bin); +#else + os_p_ = open_file_stream (filename, ios::out|ios::binary); +#endif } Midi_stream::~Midi_stream () diff --git a/lily/molecule.cc b/lily/molecule.cc index 5f1ced7f49..7b440146ac 100644 --- a/lily/molecule.cc +++ b/lily/molecule.cc @@ -132,26 +132,12 @@ Molecule::add_at_edge (Axis a, Direction d, Molecule const &m, Real padding) add_molecule (toadd); } - - - -bool -number_pair_p (SCM p) -{ - return gh_pair_p (p) && gh_number_p (gh_car (p)) && gh_number_p (gh_cdr (p)); -} - -bool -axis_p (SCM a) -{ - return gh_number_p (a) && (gh_scm2int (a) == 0 || gh_scm2int (a) == 1); -} - +/* ly_? Thought we had the ly_ prefix for wrapping/adding to gh_ */ SCM Molecule::ly_set_molecule_extent_x (SCM mol, SCM axis, SCM np) { Molecule* m = unsmob_molecule (mol); - if (m && axis_p (axis) && number_pair_p (np)) + if (m && ly_axis_p (axis) && ly_number_pair_p (np)) { Interval iv = ly_scm2interval (np); m->dim_[Axis (gh_scm2int (axis))] = ly_scm2interval (np); @@ -166,7 +152,7 @@ Molecule::ly_get_molecule_extent (SCM mol, SCM axis) { Molecule *m = unsmob_molecule (mol); - if (!m || !axis_p (axis)) + if (!m || !ly_axis_p (axis)) { warning ("ly-get-molecule-extent: invalid arguments"); return ly_interval2scm (Interval (0,0)); @@ -185,7 +171,7 @@ Molecule::ly_molecule_combined_at_edge (SCM first, SCM axis, SCM direction, Molecule * m2 = unsmob_molecule (second); Molecule result; - if (!m1 || !m2 || !isdir_b (direction) || !axis_p (axis) || !gh_number_p (padding)) + if (!m1 || !m2 || !isdir_b (direction) || !ly_axis_p (axis) || !gh_number_p (padding)) { warning ("ly-combine-molecule-at-edge: invalid arguments"); Molecule r; diff --git a/lily/music-constructor.cc b/lily/music-constructor.cc index bd14326605..2615221615 100644 --- a/lily/music-constructor.cc +++ b/lily/music-constructor.cc @@ -11,13 +11,13 @@ #include "music-constructor.hh" typedef Music* (*Music_ctor) (); -static map *ctors_map_; +static std::map *ctors_map_; void add_music_ctor (String s, Music_ctor c) { if (!ctors_map_) - ctors_map_ = new map; + ctors_map_ = new std::map; (*ctors_map_)[s] = c; } diff --git a/lily/paper-stream.cc b/lily/paper-stream.cc index 8b805d15d4..ba3c9ee115 100644 --- a/lily/paper-stream.cc +++ b/lily/paper-stream.cc @@ -22,12 +22,17 @@ const int MAXLINELEN = 200; +#if __GNUC__ > 2 +ostream * +open_file_stream (String filename, std::ios_base::openmode mode) +#else ostream * open_file_stream (String filename, int mode) +#endif { ostream *os; if ((filename == "-")) - os = new ostream (cout._strbuf); + os = &cout; else { Path p = split_path (filename); @@ -50,7 +55,8 @@ close_file_stream (ostream *os) warning (_ ("Error syncing file (disk full?)")); exit_status_global = 1; } - delete os; + if (os != &cout) + delete os; os = 0; } diff --git a/lily/property-iterator.cc b/lily/property-iterator.cc index e38675d939..84c8486d0b 100644 --- a/lily/property-iterator.cc +++ b/lily/property-iterator.cc @@ -18,10 +18,10 @@ void Property_iterator::process (Moment m) { - SCM sym = music_l_->get_mus_property ("grob-property"); + SCM sym = music_l_->get_mus_property ("symbol"); if (gh_symbol_p (sym)) { - SCM val = music_l_->get_mus_property ("grob-value"); + SCM val = music_l_->get_mus_property ("value"); bool ok= true; if (val != SCM_EOL) ok = type_check_assignment (val, sym, ly_symbol2scm ("translation-type?")); diff --git a/lily/text-item.cc b/lily/text-item.cc index bb99b6f236..3e17134db4 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -38,15 +38,21 @@ Text_item::text2molecule (Grob *me, SCM text, SCM alist_chain) { if (gh_string_p (text)) return string2molecule (me, text, alist_chain); - - /* - ugh: gh_list_p () is linear. - */ - - else if (gh_list_p (text) && text != SCM_EOL && text != SCM_UNDEFINED) + else if (gh_pair_p (text)) { + /* urg, why not just do this in markup_text2molecule ? */ if (gh_string_p (gh_car (text))) - return string2molecule (me, gh_car (text), alist_chain); + return markup_text2molecule (me, + gh_append2 (gh_list (SCM_EOL, + SCM_UNDEFINED), + text), + alist_chain); + /* + Allow (faulty) texts that are in an extra list: + #'(("foo")) + */ + else if (scm_ilength (text) <= 1) + return text2molecule (me, gh_car (text), alist_chain); else return markup_text2molecule (me, text, alist_chain); } @@ -130,12 +136,12 @@ Text_item::markup_text2molecule (Grob *me, SCM markup_text, Real staff_space = Staff_symbol_referencer::staff_space (me); - Axis axis = X_AXIS; - /* - TODO: change ALIGN into AXIS. + Line mode is default. */ - SCM a = ly_assoc_chain (ly_symbol2scm ("align"), p); + Axis axis = X_AXIS; + + SCM a = ly_assoc_chain (ly_symbol2scm ("axis"), p); if (gh_pair_p (a) && isaxis_b (gh_cdr (a))) axis = (Axis)gh_scm2int (gh_cdr (a)); @@ -155,29 +161,85 @@ Text_item::markup_text2molecule (Grob *me, SCM markup_text, if (gh_pair_p (r) && gh_number_p (gh_cdr (r))) raise = gh_scm2double (gh_cdr (r)) * staff_space; - Offset o (0, (axis == Y_AXIS ? - kern[axis] : 0) + raise); - + Interval extent; + bool extent_b = false; + SCM e = ly_assoc_chain (ly_symbol2scm ("extent"), p); + if (gh_pair_p (e) && ly_number_pair_p (gh_cdr (e))) + { + extent = Interval (gh_scm2double (gh_cadr (e)) * staff_space, + gh_scm2double (gh_cddr (e)) * staff_space); + extent_b = true; + } + + Offset o (0, (axis == Y_AXIS ? - kern[axis] : 0)); + Molecule mol; while (gh_pair_p (text)) { + Molecule m = text2molecule (me, gh_car (text), p); - SCM m_p = SCM_EOL; + + /* + TODO: look at padding? + + Look ahead here for kern and raise. + + (cols "foo" ((raise . 1) "bar")) + (cols "foo" ((bold (raise . 1)) "bar")) + + When constructing the molecule for bar, all normal extra + properties found, such as bold, are used for the construction + of bar's molecule. But for kern or raise, it seems that we're + too late then, translating bar's molecule has no effect (or + maybe the effect of translating gets nullified when bar's + molecule is `added_to_edge' of the molecule for foo?) + + So, while constructing foo's molecule, we look ahead for the + raise of bar. The HEAD of the description of bar may be a + single property, or a list, so we must check that too. + */ + + SCM next_p = SCM_EOL; if (gh_pair_p (gh_car (text))) - m_p = gh_cons (gh_call2 (f, sheet, gh_caar (text)), alist_chain); - SCM m_k = ly_assoc_chain (ly_symbol2scm ("kern"), m_p); - Real m_kern = kern[axis]; - if (gh_pair_p (m_k) && gh_number_p (gh_cdr (m_k))) - m_kern = gh_scm2double (gh_cdr (m_k)) * staff_space; + next_p = gh_list (gh_call2 (f, sheet, gh_caar (text)), SCM_UNDEFINED); + SCM next_k = ly_assoc_chain (ly_symbol2scm ("kern"), next_p); + Real next_kern = kern[axis]; + if (gh_pair_p (next_k) && gh_number_p (gh_cdr (next_k))) + next_kern = gh_scm2double (gh_cdr (next_k)) * staff_space; + + SCM next_r = ly_assoc_chain (ly_symbol2scm ("raise"), next_p); + Real next_raise = 0; + if (gh_pair_p (next_r) && gh_number_p (gh_cdr (next_r))) + next_raise = gh_scm2double (gh_cdr (next_r)) * staff_space; + + o[Y_AXIS] = next_raise; if (!m.empty_b ()) { m.translate (o); if (axis == Y_AXIS && baseline_skip) - m_kern += baseline_skip - m.extent (Y_AXIS)[UP]; - mol.add_at_edge (axis, axis == X_AXIS ? RIGHT : DOWN, m, m_kern); + next_kern += baseline_skip - m.extent (Y_AXIS)[UP]; + mol.add_at_edge (axis, axis == X_AXIS ? RIGHT : DOWN, m, next_kern); } text = gh_cdr (text); } + + if (extent_b) + { +#if 0 + /* Hmm, we're not allowed to change a Molecule's extent? */ + mol.dim_[axis] = extent; + Molecule::ly_set_molecule_extent_x (mol.self_scm (), gh_int2scm (axis), + gh_cdr (e)); +#else + // burp: unpredictable names, these... + Box b = mol.extent_box (); + SCM expr = mol.get_expr (); + + b[axis] = extent; + mol = Molecule (b, expr); +#endif + } return mol; } diff --git a/lilypond-mode.el b/lilypond-mode.el index 177004d096..75da56aef6 100644 --- a/lilypond-mode.el +++ b/lilypond-mode.el @@ -249,6 +249,7 @@ Must be the car of an entry in `LilyPond-command-alist'." (LilyPond-command (LilyPond-command-query (LilyPond-master-file)) 'LilyPond-master-file)) +;; FIXME, this is broken (defun LilyPond-region-file (begin end) (let ( ;; (dir "/tmp/") @@ -298,7 +299,12 @@ Must be the car of an entry in `LilyPond-command-alist'." (defun LilyPond-shell-process (name buffer command) (let ((old (current-buffer))) (switch-to-buffer-other-window buffer) - (goto-char (point-max)) + ;; Hmm, if we goto the end of the buffer, we don't see + ;; the messages scroll by. I don't know how to fix this, + ;; so let's emty the buffer, then + ;;(goto-char (point-max)) + (erase-buffer) + (goto-char (point-min)) (start-process-shell-command name buffer command) (switch-to-buffer-other-window old))) diff --git a/ly/german-chords.ly b/ly/german-chords.ly index 2bdc143f30..41308cf087 100644 --- a/ly/german-chords.ly +++ b/ly/german-chords.ly @@ -1,4 +1,49 @@ -\version "1.3.146" +BABYL OPTIONS: -*- rmail -*- +Version: 5 +Labels: +Note: This is the header of an rmail file. +Note: If you are seeing it in rmail, +Note: it means the file has no messages in it. + +1,, +Return-Path: rz@daimi.au.dk +Delivery-Date: Fri, 13 Apr 2001 13:33:44 +0200 +Received: from localhost (localhost [127.0.0.1]) + by appel.lilypond.org (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id NAA02351 + for ; Fri, 13 Apr 2001 13:33:43 +0200 +X-XS4ALL-To: +Received: from pop.xs4all.nl + by localhost with POP3 (fetchmail-5.1.2) + for fred@localhost (single-drop); Fri, 13 Apr 2001 13:33:44 +0200 (CEST) +Received: from smtp5.xs4all.nl (smtp5.xs4all.nl [194.109.6.49]) + by maildrop7.xs4all.nl (8.11.1/8.11.1) with ESMTP id f3DBWCd93235 + for ; Fri, 13 Apr 2001 13:32:12 +0200 (CEST) + (envelope-from rz@daimi.au.dk) +Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164]) + by smtp5.xs4all.nl (8.9.3/8.9.3) with ESMTP id NAA10302 + for ; Fri, 13 Apr 2001 13:31:04 +0200 (CEST) +Received: from nightcrawler.daimi.au.dk ([130.225.18.95]) + by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) + id 14o1n2-0008Pp-00 + for ; Fri, 13 Apr 2001 07:31:00 -0400 +Received: from daimi.au.dk (localhost [127.0.0.1]) + by nightcrawler.daimi.au.dk (8.11.2/8.11.2) with ESMTP id f3DBUwX31324 + for ; Fri, 13 Apr 2001 13:30:58 +0200 +Sender: rz@daimi.au.dk +Message-ID: <3AD6E372.640DEE61@daimi.au.dk> +Date: Fri, 13 Apr 2001 13:30:58 +0200 +From: Rune Zedeler +X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.16-3 i686) +X-Accept-Language: en +MIME-Version: 1.0 +To: Jan Nieuwenhuizen +Subject: german-chords +Content-Type: multipart/mixed; + boundary="------------69CC07F348020448DD291CA8" +X-UIDL: 987161532.maildrop7.93237 + +*** EOOH *** +\version "1.3.148" % german-chords.ly: % german/norwegian/danish? @@ -9,32 +54,35 @@ #(define german-Bb #f) -#(define (pitch->chord-name-text-banter pitch additions) - (if (equal? (cdr pitch) '(6 -1)) - (if german-Bb - (cons "B" (accidental->text -1)) - '("B") - ) +#(define (pitch->chord-name-text-banter pitch steps) + (let ((dopitch (if (member (cdr pitch) '((6 -1) (6 -2))) + (list 7 (+ (if german-Bb 0 1) (caddr pitch))) + (cdr pitch) + ))) (cons - (list-ref '("C" "D" "E" "F" "G" "A" "H") (cadr pitch)) - (accidental->text (caddr pitch)) + (list-ref '("C" "D" "E" "F" "G" "A" "H" "B") (car dopitch)) + (accidental->text-super (cadr dopitch)) ) ) - ) + ) + #(define (pitch->note-name-text-banter pitch) - (if (equal? (cdr pitch) '(6 -1)) - '("b") - (cons + (let ((dopitch (if (member (cdr pitch) '((6 -1) (6 -2))) + (list 7 (+ 1 (caddr pitch))) + (cdr pitch) + ))) + (list (string-append - (list-ref '("c" "d" "e" "f" "g" "a" "h") (cadr pitch)) - (if (or (equal? (cadr pitch) 2) (equal? (cadr pitch) 5)) - (list-ref '( "ses" "s" "" "is" "isis") (+ 2 (caddr pitch))) - (list-ref '("eses" "es" "" "is" "isis") (+ 2 (caddr pitch))) + (list-ref '("c" "d" "e" "f" "g" "a" "h" "b") (car dopitch)) + (if (or (equal? (car dopitch) 2) (equal? (car dopitch) 5)) + (list-ref '( "ses" "s" "" "is" "isis") (+ 2 (cadr dopitch))) + (list-ref '("eses" "es" "" "is" "isis") (+ 2 (cadr dopitch))) ) ) - '() ) ) ) + + \ No newline at end of file diff --git a/ly/params.ly b/ly/params.ly index 92fdaa288c..13bab53ff6 100644 --- a/ly/params.ly +++ b/ly/params.ly @@ -1,8 +1,16 @@ \version "1.3.146" % JUNKME. +%% deprecated papersizename = \papersize +% ly2dvi now uses `papersize' internally (and on cmd line) +papersize = \papersize + +% FIXME +% direct PostScript line height for single line staffs +lineheight = 14 + paperfile = \papersize + ".ly" % paperfile = "a4.ly" diff --git a/midi2ly/main.cc b/midi2ly/main.cc index d48b8739f0..9cc78171d8 100644 --- a/midi2ly/main.cc +++ b/midi2ly/main.cc @@ -23,6 +23,7 @@ #include #endif +bool testing_level_global; // ugh String filename_str_g; diff --git a/ports/mutopia/GruberFX/GNUmakefile b/ports/mutopia/GruberFX/GNUmakefile new file mode 100644 index 0000000000..aa36317067 --- /dev/null +++ b/ports/mutopia/GruberFX/GNUmakefile @@ -0,0 +1,3 @@ + depth = ../../.. + include $(depth)/ports/ports.make + diff --git a/ps/lily.ps b/ps/lily.ps index b5406ca0ac..154fa206c0 100644 --- a/ps/lily.ps +++ b/ps/lily.ps @@ -1,6 +1,6 @@ %!PS-Adobe-1.0: lily.ps % -% +% Functions for direct and embedded PostScript % round cappings 1 setlinecap @@ -99,8 +99,10 @@ show } bind def -% simple, but does it work everywhere? -% explain ? --hwn +% Simple, but does it work everywhere? +% The filled circles are drawn by setting the linewidth +% to 2*radius and drawing a point. Is that (defined to be) +% a nice filled circle? /draw_ez_ball % ch letter_col ball_col font { % font diff --git a/ps/lilyponddefs.ps b/ps/lilyponddefs.ps index 5f9a9f1451..d4994a0e0f 100644 --- a/ps/lilyponddefs.ps +++ b/ps/lilyponddefs.ps @@ -1,15 +1,41 @@ %!PS-Adobe-1.0: lilyponddefs +% +% Functions for direct PostScript output % hmm % /setgray { 1 add } bind def -/stafflinethickness lilypondpaperstafflinethickness def -/staffheight lilypondpaperstaffheight def +/staff-line-thickness lilypondpaperstafflinethickness def +/staff-height lilypondpaperstaffheight def +/line-width lilypondpaperlinewidth def + +% FIXME: why isn't this set (by default) by lily? +% /text-height lilypondpapertextheight def + +/output-scale lilypondpaperoutputscale def +/paper-size { lilypondpaperpapersize } bind def + +% FIXME +% urg, read from paper block +% fixed base line skip value, for single line staffs +/base-line-skip lilypondpaperlineheight def + + +/init-paper { + gsave + .1 setlinewidth + clippath pathbbox newpath + /vsize exch def + /hsize exch def pop pop pop -/xoffset 30 def -/yoffset 700 def + %FIXME: + %vsize text-height sub 2 div /top-margin exch def + 144 2 div /top-margin exch def + hsize line-width sub 2 div /left-margin exch def + grestore +} bind def -/placebox +/place-box { /object exch def gsave @@ -24,7 +50,7 @@ % FIXME. translate to middle of box. % -/draw_box % breapth width depth height +/draw-box % breapth width depth height { /h exch def /d exch def @@ -43,26 +69,163 @@ grestore } bind def -/start_line +/start-line { + line-y top-margin sub base-line-skip lt { + showpage + /line-y vsize top-margin sub def + } if gsave - xoffset yoffset translate + line-x line-y translate } bind def -/stop_line +/stop-line { - /object exch def - 0 0 moveto pathbbox exch pop sub exch pop - object + /the-line exch def + 0 0 moveto the-line clippath pathbbox + stroke grestore - yoffset add /yoffset exch def - % urg... - yoffset lilypondpaperstaffheight 8 mul sub /yoffset exch def + exch 4 -1 roll + sub + 3 1 roll + exch sub + %pstack + % + % ugh: now we should have `width height' on stack, + % but it's probably just the width and height of last element + % (the last staff) + % How do we get all heights of all staffs in a line? + % + % output-scale div neg line-y add /line-y exch def + % + % discarding height... + pop + % + % discard width + pop + % use fixed base-line-skip for now + line-y base-line-skip output-scale mul sub /line-y exch def +} bind def + +% FIXME: font definitions should come from LilyPond +% built-in ps fonts are ugly +/huge-bold-font { + /Times-Bold findfont 20.7 scalefont setfont +} bind def + +/Large-bold-font { + /Times-Bold findfont 17.3 scalefont setfont +} bind def + +/large-bold-font { + /Times-Bold findfont 14.4 scalefont setfont +} bind def + +/large-font { + /Times-Roman findfont 14.4 scalefont setfont +} bind def + +/large-smallcaps-font { + % urg + /Helvetica findfont 14.4 scalefont setfont +} bind def + +/normal-font { + /Times-Roman findfont 12 scalefont setfont +} bind def + +/footnote-font { + /Times-Roman findfont 10 scalefont setfont +} bind def + +/get-text-dimensions % path .. width height +{ + dup true charpath pathbbox + newpath + line-x line-y moveto + exch 4 -1 roll + sub + 3 1 roll + exch sub +} bind def + +/set-centered +{ + line-x line-y moveto + get-text-dimensions + neg line-y add /line-y exch def + neg line-width add 2 div 0 rmoveto + show +} bind def + +/set-left +{ + line-x line-y moveto + get-text-dimensions + neg line-y add /line-y exch def + pop + show +} bind def + +/set-right +{ + line-x line-y moveto + get-text-dimensions + neg line-y add /line-y exch def + neg line-width add 0 rmoveto + show +} bind def + +/make-lilypond-title +{ + currentdict /lilypondtitle known { + huge-bold-font lilypondtitle set-centered + line-y 5 sub /line-y exch def + } if + currentdict /lilypondsubtitle known { + Large-bold-font lilypondsubtitle set-centered + line-y 5 sub /line-y exch def + } if + currentdict /lilypondsubsubtitle known { + large-bold-font lilypondsubsubtitle set-centered + } if + currentdict /lilypondcomposer known { + large-smallcaps-font lilypondcomposer set-right + } if + currentdict /lilypondopus known { + normal-font lilypondopus set-right + } if + currentdict /lilypondarranger known { + normal-font lilypondarranger set-right + } if + currentdict /lilypondinstrument known { + large-font lilypondinstrument set-centered + } if + currentdict /lilypondpiece known { + large-smallcaps-font lilypondpiece set-left + } if +} bind def + +/end-lilypond-output +{ + /line-y top-margin def + footnote-font lilypondtagline set-left + showpage } bind def /turnOnExperimentalFeatures { } bind def -stafflinethickness setlinewidth + +staff-line-thickness setlinewidth + +paper-size + +staff-height init-paper + +/line-x left-margin def +/line-y vsize top-margin sub def + +make-lilypond-title % see if we're there... % 10 setlinewidth 0 0 moveto 400 800 lineto stroke diff --git a/scm/chord-name.scm b/scm/chord-name.scm index 7599ef7e33..1e409e4bc7 100644 --- a/scm/chord-name.scm +++ b/scm/chord-name.scm @@ -23,11 +23,17 @@ ;; TODO ;; +;; * easier tweakability: +;; - split chord::names-alists up into logical bits, +;; such as chord::exceptions-delta, exceptions-oslash +;; - iso just the 'style parameter, use a list, eg: +;; \property ChordNames.ChordName \set +;; #'style = #'(jazz delta oslash german-tonic german-Bb) +;; ;; * fix FIXMEs +;; ;; * clean split/merge of bass/banter/american stuff -;; * handy, documented hooks for user-override of: -;; - tonic (chord) name -;; - +;; ;; * doc strings (define chord::names-alist-banter '()) @@ -55,46 +61,30 @@ chord::names-alist-banter)) ;;;;;;;;;; +(define simple-super +;; duh, no docstrings for +;; "No real superscript, just raised and small" + '((raise . 1) (font-relative-size . -1))) - -;; FIXME -(define (accidental->text acc) +(define (accidental->textp acc pos) (if (= acc 0) '() - (list '(music (font-relative-size . -2)) - (string-append "accidentals-" (number->string acc))))) + (list '(music (font-relative-size . -2)) + (list pos (string-append "accidentals-" (number->string acc)))))) +(define (accidental->text acc) (accidental->textp acc 'columns)) (define (accidental->text-super acc) - (if (= acc 0) - '() - (cons 'super (list (accidental->text acc))))) - -(define (accidental->text-sub acc) - (if (= acc 0) - '() - (cons sub (list accidental->text acc)))) - - -;; these look nice, but don't work together with current inner-name-jazz -;; (inner-name-jazz is a bit broken: apply append etc) -(define (xaccidental->textp acc pos) - (if (= acc 0) - '() - (list (list '(music (font-relative-size . -2)) - (list pos (string-append "accidentals-" (number->string acc)))))) -) - -(define (xaccidental->text acc) (accidental->textp acc 'rows)) -(define (xaccidental->text-super acc) (accidental->textp acc 'super)) -(define (xaccidental->text-sub acc) (accidental->textp acc 'sub)) + (accidental->textp acc '((raise . 0.6) (font-relative-size . -1)))) +(define (accidental->text-sub acc) (accidental->textp acc 'sub)) (define (pitch->note-name pitch) (cons (cadr pitch) (caddr pitch))) -;; FIXME: see german-chords.ly (define (pitch->text pitch) - (cons - (make-string 1 (integer->char (+ (modulo (+ (cadr pitch) 2) 7) 65))) + (text-append + (list + '(font-relative-size . 2) + (make-string 1 (integer->char (+ (modulo (+ (cadr pitch) 2) 7) 65)))) (accidental->text-super (caddr pitch)))) @@ -185,13 +175,15 @@ dirty '()))) -(define (chord::text-append l . r) +(define (text-append l . r) (if (not (chord::text? r)) l (if (not (chord::text? l)) r - (cons l r)))) - + (if (empty? (cdr r)) + (list 'columns l (car r)) + (text-append (list 'columns l (car r)) (cdr r)))))) + (define (chord::step tonic pitch) (- (pitch::note-pitch pitch) (pitch::note-pitch tonic))) @@ -216,13 +208,13 @@ (modulo (+ i 6) 7))))))))) (define (chord::additions steps) - " Return: +" Return: * any even step (2, 4, 6) * any uneven step that is chromatically altered, (where 7-- == -1, 7- == 0, 7 == +1) * highest step -and you need also: +?and jazz needs also: * TODO: any uneven step that's lower than an uneven step which is chromatically altered @@ -277,25 +269,25 @@ and you need also: (define (chord::additions->text-banter additions subtractions) (if (pair? additions) - (cons (apply append - (chord::text-cleanup - (list - (cons 'super (step->text-banter (car additions))) - (if (or (pair? (cdr additions)) - (pair? subtractions)) - '(super "/"))))) - (chord::additions->text-banter (cdr additions) subtractions)))) + (text-append + (let ((step (step->text-banter (car additions)))) + (if (or (pair? (cdr additions)) + (pair? subtractions)) + (text-append step "/") + step)) + (chord::additions->text-banter (cdr additions) subtractions)) + '())) (define (chord::subtractions->text-banter subtractions) (if (pair? subtractions) - (cons (apply append - (chord::text-cleanup - (list - '(super "no") - (cons 'super (step->text-banter (car subtractions))) - (if (pair? (cdr subtractions)) - '(super "/"))))) - (chord::subtractions->text-banter (cdr subtractions))))) + (text-append + '("no") + (let ((step (step->text-jazz (car subtractions)))) + (if (pair? (cdr subtractions)) + (text-append step "/") + step)) + (chord::subtractions->text-banter (cdr subtractions))) + '())) (define (chord::bass-and-inversion->text-banter bass-and-inversion) (if (and (pair? bass-and-inversion) @@ -322,15 +314,14 @@ and you need also: (sep-text (if (and (string-match "super" (format "~s" exception-part)) (or (pair? additions) (pair? subtractions))) - '((super "/")))) + (list simple-super "/"))) (adds-text (chord::additions->text-banter additions subtractions)) (subs-text (chord::subtractions->text-banter subtractions)) (b+i-text (chord::bass-and-inversion->text-banter bass-and-inversion))) - (apply append - (map chord::text-cleanup - (list - '(rows) tonic-text except-text sep-text adds-text subs-text - b+i-text))))) + (text-append + tonic-text except-text sep-text + (list (list simple-super) adds-text subs-text) + b+i-text))) (define (chord::name-banter tonic exception-part unmatched-steps bass-and-inversion steps) @@ -432,8 +423,6 @@ and you need also: '()))) (chord::name->text style (car pitches) steps bass-and-inversion))) - - ;;; ;;; American style ;;; @@ -476,13 +465,12 @@ and you need also: (((0 . 0) (2 . -1) (4 . 0) (6 . 0)) . ("m(maj7)")) ;jazz: the delta, see jazz-chords.ly ;;(((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (super ((font-family . math) "N")) - ;; ugh, kludge slashed o - ;; (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows ((raise . 1) "o") ((kern . -0.85) ((raise . 0.57) ((font-relative-size . -3) "/"))) "7")) ; slashed o - (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows ((raise . 1) "o") (((kern . -0.85) (raise . 1.1) (font-relative-size . -2)) "/") "7")) ; slashed o + ;; slashed o + (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (columns (super (overstrike "o") "/") "7")) (((0 . 0) (2 . 0) (4 . 1) (6 . -1)) . ("aug7")) - (((0 . 0) (2 . 0) (4 . -1) (6 . 0)) . (rows "maj7" ((font-relative-size . -2) ((raise . 0.2) (music (named "accidentals--1")))) "5")) - (((0 . 0) (2 . 0) (4 . -1) (6 . -1)) . (rows "7" ((font-relative-size . -2) ((raise . 0.2) (music (named "accidentals--1")))) "5")) + (((0 . 0) (2 . 0) (4 . -1) (6 . 0)) . (columns "maj7" ((font-relative-size . -2) ((raise . 0.2) (music (named "accidentals--1")))) "5")) + (((0 . 0) (2 . 0) (4 . -1) (6 . -1)) . (columns "7" ((font-relative-size . -2) ((raise . 0.2) (music (named "accidentals--1")))) "5")) (((0 . 0) (3 . 0) (4 . 0) (6 . -1)) . ("7sus4")) ;; Common ninth chords (((0 . 0) (2 . 0) (4 . 0) (5 . 0) (1 . 0)) . ("6/9")) ;; we don't want the '/no7' @@ -524,7 +512,7 @@ and you need also: ;; ;; This is getting out-of hand? Only exceptional chord names that ;; cannot be generated should be here. -;; Maybe we should have inner-jazz-name and inner-american-name functions; +;; Maybe we should have inner-name-jazz and inner-name-american functions; ;; ;; ;; @@ -548,31 +536,31 @@ and you need also: ;; minor chords ; minor sixth chord = m6 - (((0 . 0) (2 . -1) (4 . 0) (5 . 0)) . (rows("m")((raise . 0.5) "6"))) + (((0 . 0) (2 . -1) (4 . 0) (5 . 0)) . (columns("m")((raise . 0.5) "6"))) ;; minor major seventh chord = m triangle ;; shouldn't this be a filled black triange, like this: ? --jcn - ;;(((0 . 0) (2 . -1) (4 . 0) (6 . 0)) . (rows ("m") ((raise . 0.5)((font-family . math) "N")))) - (((0 . 0) (2 . -1) (4 . 0) (6 . 0)) . (rows ("m") ((raise . 0.5)((font-family . math) "M")))) + ;;(((0 . 0) (2 . -1) (4 . 0) (6 . 0)) . (columns ("m") ((raise . 0.5)((font-family . math) "N")))) + (((0 . 0) (2 . -1) (4 . 0) (6 . 0)) . (columns ("m") ((raise . 0.5)((font-family . math) "M")))) ; minor seventh chord = m7 - (((0 . 0) (2 . -1) (4 . 0) (6 . -1)) . (rows("m")((raise . 0.5) "7"))) + (((0 . 0) (2 . -1) (4 . 0) (6 . -1)) . (columns("m")((raise . 0.5) "7"))) ; minor sixth nine chord = m6/9 - (((0 . 0) (2 . -1) (4 . 0) (5 . 0) (1 . 0)) . (rows("m")((raise . 0.5) "6/9"))) + (((0 . 0) (2 . -1) (4 . 0) (5 . 0) (1 . 0)) . (columns("m")((raise . 0.5) "6/9"))) ; minor with added nine chord = madd9 - (((0 . 0) (2 . -1) (4 . 0) (1 . 0)) . (rows("m")((raise . 0.5) "add9"))) + (((0 . 0) (2 . -1) (4 . 0) (1 . 0)) . (columns("m")((raise . 0.5) "add9"))) ; minor ninth chord = m9 - (((0 . 0) (2 . -1) (4 . 0) (6 . -1) (1 . 0)) . (rows("m")((raise . 0.5) "9"))) + (((0 . 0) (2 . -1) (4 . 0) (6 . -1) (1 . 0)) . (columns("m")((raise . 0.5) "9"))) ;; dominant chords ; dominant seventh = 7 (((0 . 0) (2 . 0) (4 . 0) (6 . -1)) . (((raise . 0.5) "7"))) ; augmented dominant = +7 ;(((0 . 0) (2 . 0) (4 . +1) (6 . -1)) . (((raise . 0.5) "+7"))) ; +7 with both raised - (((0 . 0) (2 . 0) (4 . +1) (6 . -1)) . (rows("+")((raise . 0.5) "7"))) ; +7 with 7 raised - ;(((0 . 0) (2 . 0) (4 . +1) (6 . -1)) . (rows((raise . 0.5) "7(") + (((0 . 0) (2 . 0) (4 . +1) (6 . -1)) . (columns("+")((raise . 0.5) "7"))) ; +7 with 7 raised + ;(((0 . 0) (2 . 0) (4 . +1) (6 . -1)) . (columns((raise . 0.5) "7(") ; ((raise . 0.3)(music (named ("accidentals-1")))) ; ((raise . 0.5) "5)"))); 7(#5) ; dominant flat 5 = 7(b5) - (((0 . 0) (2 . 0) (4 . -1) (6 . -1)) . (rows((raise . 0.5) "7(") + (((0 . 0) (2 . 0) (4 . -1) (6 . -1)) . (columns((raise . 0.5) "7(") ((raise . 0.3)(music (named ("accidentals--1")))) ((raise . 0.5) "5)"))) ; dominant 9 = 7(9) @@ -638,7 +626,7 @@ and you need also: ;; half diminshed chords ;; half diminished seventh chord = slashed o ;; (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (((raise . 0.8) "/o"))) - (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows ((raise . 1) "o") (((kern . -0.85) (raise . 1.1) (font-relative-size . -2)) "/") "7")) ; slashed o + (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (columns (super (overstrike "o") "/") "7")) ; slashed o ; half diminished seventh chord with major 9 = slashed o cancelation 9 (((0 . 0) (2 . -1) (4 . -1) (6 . -1) (1 . 0)) . ( @@ -652,44 +640,135 @@ and you need also: chord::names-alist-american)) (define (step->text-alternate-jazz pitch) - (cons + (text-append (accidental->text (caddr pitch)) - (list (number->string (+ (cadr pitch) (if (= (car pitch) 0) 1 8)))))) + (number->string (+ (cadr pitch) (if (= (car pitch) 0) 1 8))))) (define (step->text-jazz pitch) (if (= (cadr pitch) 6) (case (caddr pitch) ;; sharp 7 only included for completeness? - ((-2) (cons (accidental->text -1) '("7"))) + ((-2) (text-append (accidental->text -1) '("7"))) ((-1) '("7")) ((0) '("maj7")) - ((1) (cons (accidental->text-super 1) '("7"))) - ((2) (cons (accidental->text-super 2) '("7")))) + ((1) (text-append (accidental->text-super 1) '("7"))) + ((2) (text-append (accidental->text-super 2) '("7")))) (step->text-alternate-jazz pitch))) -(define (chord::additions->text-jazz additions subtractions) +(define (xchord::additions->text-jazz additions subtractions) (if (pair? additions) - (cons (apply append - (chord::text-cleanup - (list - (cons 'super (step->text-jazz (car additions))) - (if (or (pair? (cdr additions)) - (pair? subtractions)) - '(super "/"))))) - (chord::additions->text-jazz (cdr additions) subtractions)) - '())) + (text-append + (let ((step (step->text-jazz (car additions)))) + (if (or (pair? (cdr additions)) + (pair? subtractions)) + (text-append step "/") + step)) + (chord::additions->text-jazz (cdr additions) subtractions)) + '())) + +(define (chord::>5? x) + (or (> (car x) 0) + (> (cadr x) 4))) + + +;; FIXME: +;; Perhaps all logic like this should be done earlier, +;; so that in this text-construction printing phase +;; we can just blindly create text from all additions. +;; +;; This depends maybe on the fact of code sharing, +;; in this layout, we can share the functions chord::additions +;; and chord::subtractions with banter. +(define (chord::additions->text-jazz additions subtractions) + (text-append + (chord::additions<=5->text-jazz (filter-out-list chord::>5? additions) + (filter-out-list chord::>5? subtractions)) + (chord::additions>5->text-jazz (filter-list chord::>5? additions) + (filter-list chord::>5? subtractions)))) + +;; FIXME +(define (chord::additions<=5->text-jazz additions subtractions) + (let ((sus (chord::sus-four-jazz additions))) + (if (pair? sus) + (text-append '("sus") (step->text-jazz (car sus))) + '()))) + +(define (chord::additions>5->text-jazz additions subtractions) + " +Compose text of all additions + * if there's a subtraction: + - add `add' + - list all up to highest + * list all steps that are below an chromatically altered step + " + (text-append + (if (not (empty? subtractions)) "add" '()) + (let ((radds (reverse additions))) + (reverse (chord::additions>5->text-jazz-helper + radds + subtractions + (if (or (empty? subtractions) (empty? radds)) + #f (car radds))))))) + +(define (chord::additions>5->text-jazz-helper additions subtractions list-step) + " +Create texts for all additions +If list-step != #f, list all steps down to 5 +If we encounter a chromatically altered step, turn on list-step +" + + (if list-step + (if (not (member list-step subtractions)) + (if (> 5 (cadr list-step)) + (cons (step->text-jazz list-step) + (chord::additions>5->text-jazz-helper + additions + subtractions + (chord::get-create-step additions + (- (cadr list-step) 2)))) + (step->text-jazz list-step)) + (chord::get-create-step additions (- (cadr list-step) 2))) + (if (pair? additions) + (let ((step (car additions))) + (cons (step->text-jazz step) + (chord::additions>5->text-jazz-helper + (cdr additions) + subtractions + (if (or (and (!= 6 (cadr step)) (!= 0 (caddr step))) + (and (= 6 (cadr step)) (!= -1 (caddr step)))) + (chord::get-create-step additions (- (cadr step) 2)) + #f)))) + '()))) + +(define (chord::sus-four-jazz chord-pitches) + "List of pitches that are step 2 or step 4" + (filter-list (lambda (x) + (and (= 0 (car x)) + (or (= 1 (cadr x)) (= 3 (cadr x))))) chord-pitches)) + +(define (chord::get-create-step steps n) + (let* ((i (if (< n 0) (+ n 7) n)) + (found (filter-list (lambda (x) (= i (cadr x))) steps))) + (if (empty? found) + (if (!= i 6) + (list 0 i 0) + (list 0 6 -1)) + (car found)))) + (define (chord::subtractions->text-jazz subtractions) (if (pair? subtractions) - (cons (apply append - (chord::text-cleanup - (list - '(super "omit") - (cons 'super (step->text-jazz (car subtractions))) - (if (pair? (cdr subtractions)) - '(super "/"))))) - (chord::subtractions->text-jazz (cdr subtractions))) - '())) + (text-append + (if (= 5 (cadr (car subtractions))) + (text-append + '("omit") + (let ((step (step->text-jazz (car subtractions)))) + (if (pair? (cdr subtractions)) + (text-append step "/") + step))) + '()) + (chord::subtractions->text-jazz (cdr subtractions))) + '())) ;; TODO: maybe merge with inner-name-banter @@ -697,23 +776,19 @@ and you need also: ;; additions, subtractions and bass or inversion into chord name (define (chord::inner-name-jazz tonic exception-part additions subtractions bass-and-inversion steps) - - ;; ugh - (apply - append - - (chord::text-cleanup - (list '(rows) - (pitch->chord-name-text-banter tonic steps) - exception-part - ;; why does list->string not work, format seems only hope... - (if (and (string-match "super" (format "~s" exception-part)) - (or (pair? additions) - (pair? subtractions))) - '((super "/"))) - (chord::additions->text-jazz additions subtractions) - (chord::subtractions->text-jazz subtractions) - (chord::bass-and-inversion->text-banter bass-and-inversion))))) + (text-append + (pitch->chord-name-text-banter tonic steps) + exception-part + ;; why does list->string not work, format seems only hope... + (if (and (string-match "super" (format "~s" exception-part)) + (or (pair? additions) + (pair? subtractions))) + (list simple-super "/")) + + (list `(,simple-super) + (chord::additions->text-jazz additions subtractions) + (chord::subtractions->text-jazz subtractions)) + (chord::bass-and-inversion->text-banter bass-and-inversion))) ;; Jazz style--basically similar to american with minor changes ;; diff --git a/scm/font.scm b/scm/font.scm index 8f456711cb..084a5039bf 100644 --- a/scm/font.scm +++ b/scm/font.scm @@ -208,13 +208,10 @@ (properties-to-font . ,Font_interface::properties_to_font_name) - ;; FIXME: this is a not-so-cool idea to use ALIGN - ;; RAISE, LOOKUP, since they are not proper elt-properties, - ;; and might interfere with them. (markup-to-properties . ,markup-to-properties) (abbreviation-alist - . ((rows . ((align . 0))) - (lines . ((align . 1))) + . ((columns . ((axis . 0))) + (lines . ((axis . 1))) (roman . ((font-family . roman))) (music . ((font-family . music) (lookup . name))) (finger . ((font-style . finger))) @@ -222,8 +219,9 @@ (upright . ((font-shape . upright))) (italic . ((font-shape . italic))) (named . ((lookup . name))) - (super . ((raise . 1) (font-relative-size . -1))) - (sub . ((raise . -1) (font-relative-size . -1))) + (overstrike . ((extent . (0 . 0)))) + (super . ((raise . 1) (font-relative-size . -1) (extent . (0 . 0)))) + (sub . ((raise . -1) (font-relative-size . -1) (extent . (0 . 0)))) (text . ((lookup . value))) ) ) @@ -330,7 +328,14 @@ and warn if the selected font is not unique. ;; (display "'\n") (if (pair? markup) - (if (and (symbol? (car markup)) (not (pair? (cdr markup)))) + ;; This is hairy. We want to allow: + ;; ((foo bar) "text") + ;; ((foo (bar . 1)) "text") + ;; ((foo . (0 . 1))) + + (if (and (symbol? (car markup)) + (or (not (pair? (cdr markup))) + (number? (cadr markup)))) (if (equal? '() (cdr markup)) (markup-to-properties sheet (car markup)) (list markup)) diff --git a/scm/grob-property-description.scm b/scm/grob-property-description.scm index 223ab00584..c84eb680ea 100644 --- a/scm/grob-property-description.scm +++ b/scm/grob-property-description.scm @@ -286,21 +286,21 @@ text: string | (head? text+) head: markup | (markup+) markup-item: property | abbrev property: (@var{key} . @var{value}) -abbrev: @code{rows lines roman music bold italic named super sub text} +abbrev: @code{columns lines roman music bold italic named super sub overstrike text} @code{finger volta timesig mmrest mark script large Large dynamic} @end example The following abbreviations are currently defined: @table @samp -@item rows -horizontal mode: set all text on one line (default) +@item columns + horizontal mode: set all text on one line (default) @item lines vertical mode: set every text on new line @item roman select roman font @item music - select feta font + select feta font, and lookup by character name @item bold select bold series @item italic @@ -313,6 +313,8 @@ horizontal mode: set all text on one line (default) superscript @item sub subscript +@item overstrike + the next text or character overstrikes this one @item finger select fingering number fontstyle @item volta diff --git a/scm/lily.scm b/scm/lily.scm index 75f2ab04e5..ecf2171ffc 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -81,6 +81,14 @@ (cons (car list) rest) rest)))) +(define (filter-out-list pred? list) + "return that part of LIST for which PRED is true." + (if (null? list) '() + (let* ((rest (filter-list pred? (cdr list)))) + (if (not (pred? (car list))) + (cons (car list) rest) + rest)))) + (define (uniqued-alist alist acc) (if (null? alist) acc (if (assoc (caar alist) acc) diff --git a/scm/ps.scm b/scm/ps.scm index 0f8011bf6d..70a115d8c6 100644 --- a/scm/ps.scm +++ b/scm/ps.scm @@ -102,13 +102,13 @@ " draw_repeat_slash")) (define (end-output) - "\nshowpage\n") + "\nend-lilypond-output\n") (define (experimental-on) "") (define (filledbox breapth width depth height) (string-append (numbers->string (list breapth width depth height)) - " draw_box" )) + " draw-box" )) ;; obsolete? (define (font-def i s) @@ -152,7 +152,7 @@ (define (placebox x y s) (string-append - (ly-number->string x) " " (ly-number->string y) " {" s "} placebox\n")) + (ly-number->string x) " " (ly-number->string y) " {" s "} place-box\n")) (define (bezier-sandwich l thick) (string-append @@ -161,16 +161,16 @@ " draw_bezier_sandwich")) (define (start-line height) - "\nstart_line { + "\nstart-line { lilypondpaperoutputscale lilypondpaperoutputscale scale ") (define (stem breapth width depth height) (string-append (numbers->string (list breapth width depth height)) - " draw_box" )) + " draw-box" )) (define (stop-line) - "}\nstop_line\n") + "}\nstop-line\n") (define (text s) (string-append "(" s ") show ")) diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index 7d35e1539f..b0f0dd6a9d 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -818,6 +818,13 @@ if 1: return str conversions.append (((1,3,147), conv, 'default-neutral-direction -> neutral-direction')) +if 1: + def conv (str): + str = re.sub ('\(align', '(axis', str) + str = re.sub ('\(row', '(columns', str) + return str + conversions.append (((1,3,148), conv, '(align -> (axis, (row -> columns')) + ################################ # END OF CONVERSIONS diff --git a/scripts/update-lily.py b/scripts/update-lily.py index 49b6c8170e..a5656196ae 100644 --- a/scripts/update-lily.py +++ b/scripts/update-lily.py @@ -9,21 +9,26 @@ ''' TODO: + + * use urllib iso ftplib + * more flexible build/ftp/patches/releases paths - * flexible build command - * show only? + + + show only: --command='echo "latest is: %n-%v"' ''' -import os +import ftplib import fnmatch +import getopt +import re +import operator +import os +import tempfile import stat import string -import re -import getopt import sys import __main__ -import operator -import tempfile try: import gettext @@ -262,29 +267,22 @@ def list_file (user, passwd, host, dir, file): list_ = list_file -# -# ugh: use ftp module. -# def list_ftp (user, passwd, host, dir, file): if user == 'None': user = 'anonymous' if passwd == 'None': passwd = program_name - command = ''' -open -u%s,%s -p21 %s -set passive-mode off -cd "%s" -ls -1 "%s" -''' % (user, passwd, host, dir, file) - temp = tempfile.mktemp (program_name) - f = open (temp, 'w') - f.write (command) - f.close () - p = os.popen ('lftp -f %s' % temp, 'r') - s = p.read () - status = p.close () - return string.split (s[:-1], '\n') + ftp = ftplib.FTP (host) + ftp.login (user, passwd) + ftp.set_pasv (1) + ftp.cwd (dir) + list = ftp.nlst (file) + try: + ftp.quit () + except: + ftp.close () + return list def split_url (url): m = re.match ('([^:/]*)(:)?(/*([^:]*):)?(/*([^@]*)@)?(//([^/]*))?(.*)/(.*)', @@ -334,20 +332,29 @@ def copy_ftp (user, passwd, host, dir, file): if passwd == 'None': passwd = program_name - command = ''' -open -u%s,%s -p21 %s -set passive-mode off -cd "%s" -get "%s" -''' % (user, passwd, host, dir, file) - temp = tempfile.mktemp (program_name) - f = open (temp, 'w') - f.write (command) - f.close () - p = os.popen ('lftp -f %s' % temp, 'r') - s = p.read () - status = p.close () + ftp = ftplib.FTP (host) + ftp.login (user, passwd) + ftp.set_pasv (1) + t = tempfile.mktemp (program_name) + try: + f = open (t, 'w') + ftp.retrbinary ('RETR %s/%s' % (dir, file), + lambda x, f=f: f.write (x)) + f.close () + # huh? Invalid cross-device link + # os.rename (t, file) + system ('mv %s %s' % (t, file)) + except: + os.remove (t) + raise 'Foo' + try: + ftp.quit () + except: + ftp.close () + return list + + def copy_url (url, dir): os.chdir (dir) s = "copy_%s ('%s', '%s', '%s', '%s', '%s')" % split_url (url) @@ -414,7 +421,8 @@ for opt in options: if 1: latest = find_latest (url) - if os.path.isdir ('%s/%s' % (build_root, latest)): + # if os.path.isdir ('%s/%s' % (build_root, latest)): + if os.path.exists ('%s/%s/index.html' % (build_root, latest)): progress (_ ("latest is: %s") % latest) progress (_ ("relax, %s is up to date" % package_name)) sys.exit (0) @@ -429,6 +437,7 @@ if 1: if not os.path.isdir (build_root): build_root = temp_dir + if not os.path.isdir (release_dir): release_dir = temp_dir setup_temp () @@ -447,7 +456,7 @@ if 1: progress (_ ("building %s...") % latest) os.chdir (build_root) - if build (latest): + if not build (latest): if previous and remove_previous_p: system ('rm -rf %s' % os.path.join (build_root, previous)) else: -- 2.39.5