]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.149
authorfred <fred>
Wed, 27 Mar 2002 01:02:50 +0000 (01:02 +0000)
committerfred <fred>
Wed, 27 Mar 2002 01:02:50 +0000 (01:02 +0000)
48 files changed:
Documentation/topdocs/WINDOWS.texi
Documentation/user/tutorial.itely
Documentation/windows/cygwin-installer.patch
flower/include/dictionary.hh
flower/include/getopt-long.hh
flower/include/libc-extension.hh
flower/include/rational.hh
flower/include/source-file.hh
flower/include/string.hh
flower/include/virtual-methods.hh
flower/rtti.cc
flower/source-file.cc
input/test/ct-jazz.ly [new file with mode: 0644]
input/test/super-sub.ly [new file with mode: 0644]
input/test/title.ly
input/twinkle.ly
lily/a2-engraver.cc
lily/afm.cc
lily/align-interface.cc
lily/include/grob-info.hh
lily/include/lily-guile.hh
lily/include/main.hh
lily/include/moment.hh
lily/include/paper-stream.hh
lily/include/scm-hash.hh
lily/lexer.ll
lily/lily-guile.cc
lily/main.cc
lily/midi-stream.cc
lily/molecule.cc
lily/music-constructor.cc
lily/paper-stream.cc
lily/property-iterator.cc
lily/text-item.cc
lilypond-mode.el
ly/german-chords.ly
ly/params.ly
midi2ly/main.cc
ports/mutopia/GruberFX/GNUmakefile [new file with mode: 0644]
ps/lily.ps
ps/lilyponddefs.ps
scm/chord-name.scm
scm/font.scm
scm/grob-property-description.scm
scm/lily.scm
scm/ps.scm
scripts/convert-ly.py
scripts/update-lily.py

index 8c79551a564849e7286bab7a12b131f071f95f72..f3eff2dbfaf2641a4f1c3d53846a754abdc14c8a 100644 (file)
@@ -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
 
 
index bc3a3475d23331ac4c73cb912712e70243104c40..5772357a910cbaaa3e01158e31d55f102d4725a7 100644 (file)
@@ -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 { <c' e g> <b d g> <c2 e g> }
-@end lilypond
-
-If you want to place music examples in the text,
-@li lypond[eps]
-  \context Voice {  <c' e g> <b d g> <c2 e g> }
-@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 @{ <c' e g> <b d g> <c2 e g> @}
-@@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]
-<c' e g>
-@@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
 
index 551e99db3722d0ea049120945f8382617bba5321..11bac9d2699c91abb90314a0272204de2a7212c0 100644 (file)
@@ -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
index 464bfa132336fff8066127f360f47440baea90df..701bc30d1dacb794d48bd02621045db825c2418b 100644 (file)
@@ -19,7 +19,7 @@
 
 unsigned int string_hash (String);
 
-template<class V>
+template <class V>
 struct Dict_initialiser
 {
   char *key_;
@@ -30,8 +30,9 @@ struct Dict_initialiser
 /*
   interface to STL function.
  */
-template<class V>
-class Dictionary : public map<String, V>
+#include "cons.hh"
+template <class V>
+class Dictionary : public std::map<String, V> //map<String, V>
 {
 public:
   Dictionary ()
@@ -46,7 +47,7 @@ public:
     }
   bool elem_b (String s)
   {
-    map<String,V>::const_iterator ki (find (s));
+    std::map<String,V>::const_iterator ki (find (s));
     return ki != end ();
   }
   
index 887a1a37096e039604f73cbc1cb5a28bbec6d89a..a0992c98e6f0e03ccfc7ff91f27061ff85bcce55 100644 (file)
@@ -1,10 +1,9 @@
 #ifndef GETOPT_LONG_HH
 #define GETOPT_LONG_HH
 
+#include <ostream.h> /* gcc 3.0 */
 #include "string.hh"
 
-class ostream;
-
 /**
   a struct this for initialising the commandline options.
  */
index 5d63e995d5046c7cda09962a045b407599dbfa24..bc76e9400bb27bfa31fca0d2fa820832ffa832c8 100644 (file)
@@ -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, ...);
index e095f5871092a82e234b7cf5cc06bf5da90aaf8d..0b1d5d972dbe7ca9953e28f0819143f94b1c67ae 100644 (file)
 #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);
 
index 7e590e01c0d041ccea6f3bbb58593a211324e096..7c039ca0ea00755c9bee2a2b557e6231a92e210c 100644 (file)
@@ -10,9 +10,6 @@
 #include "string.hh"
 #include "interval.hh"
 
-class istream;
-
-
 /**
   class for reading and mapping a file. 
 
index 5868d9313adfae07981fa2d72518a770ee48f9e3..d64c8403f3f9ab996cbc3ca3e63d55827871bbb6 100644 (file)
 #ifndef STRING_HH
 #define STRING_HH
 
-
+#include <iostream.h> /* gcc 3.0 */
 #include "arithmetic-operator.hh"
 #include "flower-proto.hh"
 #include "string-handle.hh"
 
-class ostream;
-
 /** 
  
   Intuitive string class. provides 
index e5516d8e7008d38255126acca8066f19694709e2..45e610412748cf5824703db2ec4b1295cf21bd7c 100644 (file)
@@ -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 &);
 
 /**
 
index e942dfbc1b29979a928d2c6793f20233974d4d1e..fc278636a1a0041645cf11822c39f094f7120ea3 100644 (file)
@@ -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))
index 4c5a4390fd0d4edef1028791877bc467dcede61e..9d2b902e55ebf5b92c852ebea7559de46755440a 100644 (file)
@@ -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 (file)
index 0000000..f4c7771
--- /dev/null
@@ -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 (file)
index 0000000..5d55806
--- /dev/null
@@ -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
index 10c4939ffec33763efe1f111a1ce89aa77e6f7f9..397d6c02abd2a854ce4ea0b87a4895e731b25a9c 100644 (file)
@@ -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" 
+  }
 }
 
index c9cfc68f476b476cd409082b3db46254b942d575..24f8e47a5f3762e3cf0eecc125899c31725b2969 100644 (file)
@@ -141,11 +141,7 @@ textiii =  \lyrics{
                                %}
                        >
        >
-       \paper{
-               gourlay_maxmeasures = 14.0
-       }
-       \midi{ 
-               \tempo 4 = 120 
-       }
+       \paper{ }
+       \midi{ \tempo 4 = 120 }
 }
 
index f52b9f03875d22bde03f4fa5c0c066a61c1b492b..09d10282d7bad4ec99aa9d40c94b9edfd9145e7c 100644 (file)
@@ -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;
index 764b633cc19aa77ee186564396672766ff3945c5..aa569951eaa63d986d837e8cd18a766d8ba70e56 100644 (file)
@@ -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<String,int>::const_iterator ai = name_to_metric_dict_.find (nm);
+  std::map<String,int>::const_iterator ai = name_to_metric_dict_.find (nm);
   
   if (ai == name_to_metric_dict_.end ())
     {
index 0310b7c959388e9e616b925357e3836eed1879a4..6f6321af680df9f7fa860101ead0906474c358db 100644 (file)
 #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)
index c8f57c20aad655e5cebb051a5d9d0163040d3493..4e00958060328f2c71cd7d0f6740141d9cb9822e 100644 (file)
@@ -20,7 +20,7 @@
   */
 struct Grob_info {
   Translator * origin_trans_l_;
-  friend Engraver;
+  friend class Engraver;
 public:
   Link_array<Translator> origin_trans_l_arr (Translator*) const; 
   Grob * elem_l_;
index a14c160839880c273a84be3b7beaab8690051ad8..fecff2483d6336cc66539bf7a06fbb4eddae999e 100644 (file)
@@ -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);     
index bf3e931892387c6772dc13058376f5858830932f..d85f19796d55a12908813b853e5b3ea019dce9f1 100644 (file)
@@ -38,7 +38,7 @@ extern File_path global_path;
 extern int score_count_global;
 extern Sources* source_global_l;
 
-class ostream;
+#include <iostream.h> /* gcc 3.0 */
 void print_lilypond_versions (ostream &os);
 
 #endif /* MAIN_HH */
index 7810f2063f1a7323ce1fe8e6c60c5f497c8961a3..2583bb56ab70feefda4595ec05ce88b5af4859ee 100644 (file)
@@ -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 */
 
index 939f6522a51eaccf63518ebe9dae708a90d87ffd..0864b408dd1f305600e593d5fa4f3fd11d1bab50 100644 (file)
@@ -33,9 +33,13 @@ private:
   void break_line ();
 };
 
-class ostream;
-#include <streambuf.h>
+#include <iostream.h> /* 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);
 
 
index 5215476963749460ed3201b81440538726e9c146..c2169f3fdb739d726f830038011be658ddb05c07 100644 (file)
@@ -25,7 +25,7 @@ struct SCM_less
   }
 };
 
-typedef map<SCM,SCM, SCM_less> Scm_stl_map;
+typedef std::map<SCM,SCM, SCM_less> Scm_stl_map;
 
 /**
    auto resizing hash table. 
index 7751f2b979bb0c468fd94194a1a73c18a0c1232d..01a2cf6c700edb794c01aa3ebb23eb20e235f842 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <stdio.h>
 #include <ctype.h>
+#include <iostream.h> /* gcc 3.0 */
 
 #include "score.hh"
 #include "lily-guile.hh"
index b93e7cb30f6c704bb56a8ca1ac06a8aa279d9a56..30ac299bf827fcffe1844d8739539b8019f02400 100644 (file)
@@ -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<Void_fptr> *scm_init_funcs_;
index 513054c763f8a4fa61bfd2c3776038d24a419a23..703655df754a453718218a72649f450fe7233b86 100644 (file)
@@ -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 ();
          }
index a2e4d7d5d76a5bf7fa5428628e42c2d28a6dd6c6..b353f92dc7af742d5aef3c44f088d9cc05254f1e 100644 (file)
 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 ()
index 5f1ced7f4975288518cf265a6b7d8a51b24909e8..7b440146acbe6de72bd7c1c232fe248f7d18fbec 100644 (file)
@@ -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;
index bd14326605244fe83fa218f1a771b58e4c709605..2615221615b801fe75b81e0a73b182ac64f721cd 100644 (file)
 #include "music-constructor.hh"
 typedef Music* (*Music_ctor) ();
 
-static map<String,Music_ctor> *ctors_map_;
+static std::map<String,Music_ctor> *ctors_map_;
 
 void
 add_music_ctor (String s,  Music_ctor c)
 {
   if (!ctors_map_)
-    ctors_map_ = new map<String, Music_ctor>;
+    ctors_map_ = new std::map<String, Music_ctor>;
   
  (*ctors_map_)[s] = c;
 }
index 8b805d15d452c121d12bb992767995669db97bc9..ba3c9ee11555880dc806fe16f87385f5a687d562 100644 (file)
 
 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;
 }  
 
index e38675d93924e00a0676d6b33d77c9deed8a9d37..84c8486d0b2086c5e469b35e2591d1edd937f7f7 100644 (file)
 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?"));
index bb99b6f236520a497f692337b32b31ffc3e6ce7b..3e17134db4e00bb0f8cfe56f9731e725758d9140 100644 (file)
@@ -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;
 }
 
index 177004d0966e50677b5a2b1a809374b9814d4e9e..75da56aef65f078da01f6ec8f174969c93147c74 100644 (file)
@@ -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)))
   
index 2bdc143f30284c9d7b59dea269ef06fcc78d9403..41308cf08741d8a23e93335f29e861b2dc114675 100644 (file)
@@ -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.
+\1f\f
+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 <fred@localhost>; Fri, 13 Apr 2001 13:33:43 +0200
+X-XS4ALL-To: <jantien@xs4all.nl>
+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 <jantien@xs4all.nl>; 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 <jantien@xs4all.nl>; 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 <janneke@gnu.org>; 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 <janneke@gnu.org>; 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 <rz@daimi.au.dk>
+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 <janneke@gnu.org>
+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?
 
 #(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)))
          )
        )
-       '()
      )
    )
  )
+
+\1f
\ No newline at end of file
index 92fdaa288c826e651310e20a1faa49531cac03ca..13bab53ff6bada530e5cbac9f123609fa8111841 100644 (file)
@@ -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"
index d48b8739f0dda517179ea8c3d983d9de942f5671..9cc78171d8027b62e0a2cad7702aeb7c1ad97698 100644 (file)
@@ -23,6 +23,7 @@
 #include <libintl.h>
 #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 (file)
index 0000000..aa36317
--- /dev/null
@@ -0,0 +1,3 @@
+ depth = ../../..
+ include $(depth)/ports/ports.make
index b5406ca0ac9089afe7a030e5ef7afe374e7b71d7..154fa206c0effa5275f6ca9deab6324ea1cc1d61 100644 (file)
@@ -1,6 +1,6 @@
 %!PS-Adobe-1.0: lily.ps 
 %
-%
+% Functions for direct and embedded PostScript
 
 % round cappings 
 1 setlinecap
        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
index 5f9a9f145118a0386580036e29199b1c839c5902..d4994a0e0f5757fd8fdc0b80f78273f218b73fb9 100644 (file)
@@ -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
        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
index 7599ef7e339ea0e4dc4464dd4a7fcb69b6dea761..1e409e4bc7d39a3dbe47302e38d9d6213ae0a6e0 100644 (file)
 
 ;; 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 '())
       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))))
 
 
          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)))
 
                (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
 ;;
index 8f456711cb70803794da56b5d55e83edc7f9f188..084a5039bf7a0ef1cbe05fd93d1d2a62565462fe 100644 (file)
     (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)))
        (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))
index 223ab005841f664b9c2869790e989f3d579c281a..c84eb680ea11f2eb7d4ee2e8cfb2be2fe4daa3df 100644 (file)
@@ -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
index 75f2ab04e5fb8470353b09c1e022aa42a131a25b..ecf2171ffc5e3fe50551dded44885cdf459e7986 100644 (file)
            (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)
index 0f8011bf6d858406ca0f47f7f9a363c417352bb0..70a115d8c63b856d98fa44093fd1ea51ceeda823 100644 (file)
     " 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)
 
   (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 
      " 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  "))
index 7d35e1539f24e7138f7fe5b8996f1b9274623cf6..b0f0dd6a9d3ab203dca83310f13e141b33cb5773 100644 (file)
@@ -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      
index 49b6c8170eb066bd3e51ca801938c5ce8f0a4504..a5656196aeeb736e7ab6e0c7809869548234b001 100644 (file)
@@ -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: