]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of git://git.sv.gnu.org/lilypond
authorNicolas Sceaux <nicolas.sceaux@free.fr>
Mon, 1 Jan 2007 11:57:18 +0000 (12:57 +0100)
committerNicolas Sceaux <nicolas.sceaux@free.fr>
Mon, 1 Jan 2007 11:57:18 +0000 (12:57 +0100)
72 files changed:
.gitignore
Documentation/fr/user/tutorial.itely
Documentation/topdocs/NEWS.tely
Documentation/topdocs/README.texi
Documentation/user/advanced-notation.itely
Documentation/user/basic-notation.itely
Documentation/user/instrument-notation.itely
Documentation/user/introduction.itely
Documentation/user/lilypond-book.itely
Documentation/user/tutorial.itely
GNUmakefile.in
THANKS
VERSION
buildscripts/mf-to-table.py
flower/include/rational.hh
flower/include/yaffut-parameters.hh [new file with mode: 0644]
flower/include/yaffut.hh [new file with mode: 0644]
flower/test-file-name.cc [new file with mode: 0644]
flower/test-file-path.cc [new file with mode: 0644]
flower/test-file.cc [deleted file]
flower/test-std.cc
input/regression/accidental-ancient.ly [new file with mode: 0644]
input/regression/key-clefs.ly
input/regression/markup-scheme.ly
input/regression/spacing-folded-clef-cross-staff.ly [new file with mode: 0644]
input/regression/spacing-loose-grace-linebreak.ly [new file with mode: 0644]
input/test/ancient-accidentals.ly [deleted file]
input/test/ancient-font.ly
input/test/makam.ly [new file with mode: 0644]
lily/accidental-engraver.cc
lily/accidental.cc
lily/ambitus-engraver.cc
lily/enclosing-bracket.cc
lily/general-scheme.cc
lily/horizontal-bracket.cc
lily/key-engraver.cc
lily/key-signature-interface.cc
lily/lily-parser-scheme.cc
lily/note-column.cc
lily/note-spacing-engraver.cc
lily/parser.yy
lily/pitch.cc
lily/pitched-trill-engraver.cc
lily/separating-line-group-engraver.cc
lily/slur-scoring.cc
lily/spaceable-grob.cc
lily/spacing-determine-loose-columns.cc
lily/spacing-loose-columns.cc
lily/stem.cc
ly/engraver-init.ly
make/doclang-targets.make
make/lilypond-vars.make
mf/GNUmakefile
mf/feta-test-generic.mf
mf/feta-toevallig.mf
mf/feta.tex [deleted file]
python/convertrules.py
scm/chord-name.scm
scm/define-grob-interfaces.scm
scm/define-grob-properties.scm
scm/define-grobs.scm
scm/define-markup-commands.scm
scm/framework-ps.scm
scm/lily.scm
scm/output-lib.scm
scm/output-ps.scm
scripts/lilypond-book.py
stepmake/stepmake/generic-rules.make
stepmake/stepmake/metafont-rules.make
stepmake/stepmake/metafont-targets.make
stepmake/stepmake/metafont-vars.make
stepmake/stepmake/test-vars.make

index 1dcb043399485731133ba5fd21a9cac4280a041f..1f6b89a514ae8e4c8aadf570a168892d31d88e20 100644 (file)
@@ -1,25 +1,39 @@
+*-
 *-midi.ly
 *-systems.tex
 *-systems.texi
+*.600pk
 *.afm
 *.aux
 *.eps
+*.gcda
+*.gcno
+*.gcov
 *.log
 *.midi
 *.orig
+*.patch
+*.pats
 *.pdf
 *.ps
 *.pyc
 *.rej
+*.signature
 *.svg
 *.tfm
 *~
+*~*
+.\#*
 .dotest
 .gdbinit
 .htaccess
+/*.html
+/*.ly
+/*.png
 /.sconf_temp
 /.sconsign.dblite
 /GNUmakefile
+/local.make
 /scons.cache
 /x
 ?.*
@@ -27,6 +41,7 @@ AUTHORS.txt
 INSTALL.txt
 TAGS
 \#*
+\#.*
 a.out
 aclocal.m4
 autom4te.cache
@@ -41,7 +56,3 @@ lily-[0-9a-f][0-9a-f][0-9a-f]*
 out-scons
 tags
 test-output-distance
-*.gcov
-*.gcda
-*.gcno
-*.600pk
index b8869424a5eca992624f868327d3c4bdc8343018..5f7e7138b774d883bdc7fa1c4eed2fd9dd256a2c 100644 (file)
@@ -1,5 +1,14 @@
 @c -*- coding: utf-8; mode: texinfo; documentlanguage: fr -*-
 @c This file is part of lilypond.tely
+@c
+@c Translation of GIT committish: 829be449be664ea765ed43f5d56b50b41e43b397
+@c
+@c When revising a translation, copy the HEAD committish of the
+@c version that you are working on.  Use
+@c
+@c   git-rev-list HEAD | head -1
+@c
+@c to discover that.
 
 @c TODO:
 @c   * more details about running lilypond; error messages,
index 3a59f03536ecd9c55e0eaab8272af9a022a16e23..df38af90cc7a0338e9c00b17b62bff603aafa9a1 100644 (file)
@@ -66,6 +66,15 @@ which scares away people.
 
 @end ignore
 
+
+@item Alterations (such as a sharp and flat) may now be arbitrary
+fractions. This allows some forms of microtonal music.  For example,
+Turkish makam music uses 1/9th tone alterations.
+
+@lilypondfile{makam.ly}
+
+
+
 @item Tie directions may be set with @code{^~} and @code{_~}
 
 @item Tablature now supports harmonics and slides,
index 2d6e26b99ee0c8e6ab5335ea56d7ffe5a53d3f30..e0e7a16503bb6fcad54a7bda00e0cddbdd33a0e8 100644 (file)
@@ -32,12 +32,12 @@ For compiling and running LilyPond see the installation instructions.
 These instructions can be found when you unpack lilypond, as
 @file{lilypond-x.y.z/INSTALL.txt}. They are also available on the web
 at
-@uref{http://lilypond.org/doc/v2.1/Documentation/topdocs/out-www/INSTALL.html}.
+@uref{http://lilypond.org/doc/v2.10/Documentation/topdocs/INSTALL.html}.
 
 @section Documentation
 
 The documentation is available online at
-@uref{http://www.lilypond.org/doc/}.
+@uref{http://lilypond.org/doc/}.
 
 You can also build it locally: follow the instructions under `Building
 documentation' in the installation instructions.
index ad05abff27afb49a2a901632efe8f90c08fc4ffe..1c19f5c0a76f2d028a4bfb6eaed386a17082c530 100644 (file)
@@ -842,6 +842,20 @@ You may use @code{format-mark-barnumbers}, @code{format-mark-box-barnumbers},
 and @code{format-mark-circle-barnumbers} to get bar numbers instead of
 incremented numbers or letters.
 
+Other styles of rehearsal mark can be specified manually
+
+@example
+\mark "A1"
+@end example
+
+@noindent
+@code{Score.markFormatter} does not affect marks specified in this manner.
+However, it is possible to apply a @code{\markup} to the string.
+
+@example
+\mark \markup@{ \box A1 @}
+@end example
+
 @cindex segno
 @cindex coda
 @cindex D.S al Fine
@@ -887,6 +901,8 @@ appears at that point in the music.
 
 @seealso
 
+This manual: @ref{Text marks}.
+
 Program reference: @internalsref{RehearsalMark}.
 
 Init files: @file{scm/@/translation@/-functions@/.scm} contains the
index 342fe01ae708f0f26e5f9670f50e34c3ea602269..aeeb5ed9d4cb5d9ca4f2deaa58eb6596e9dad886 100644 (file)
@@ -1140,6 +1140,10 @@ Similarly, you can merge half note heads with eighth notes, by setting
 c8 c4. } \\ { c2 c2 } >>
 @end lilypond
 
+@noindent
+@code{merge-differently-headed} and @code{merge-differently-dotted}
+only apply to opposing stem directions (ie. Voice 1 & 2).
+
 LilyPond also vertically shifts rests that are opposite of a stem,
 for example
 
index e7e1b1aa899a9d1e2d46f6fe0ab1be620edb7694..d4da68346bf4af46db633947a0f89da0db8a242d 100644 (file)
@@ -2526,9 +2526,9 @@ overview over all available note head styles.
 @cindex accidentals
 
 
-Use the @code{style} property of grob @internalsref{Accidental} to
-select ancient accidentals.   Supported styles are
-@code{mensural}, @code{vaticana}, @code{hufnagel}, and @code{medicaea}.
+Use the @code{glyph-name-alist} property of grob
+@internalsref{Accidental} and @internalsref{KeySignature} to select
+ancient accidentals. 
 
 @lilypond[quote,ragged-right,staffsize=26]
 \score {
@@ -2575,7 +2575,7 @@ different style, as demonstrated in
 @inputfileref{input/@/test,ancient@/-accidentals@/.ly}.
 
 Similarly to local accidentals, the style of the key signature can be
-controlled by the @code{style} property of the
+controlled by the @code{glyph-name-alist} property of the
 @internalsref{KeySignature} grob.
 
 @seealso
index 016b606603cca19a1292901780edf1f8f1c4d45c..ce38bab3a546d260489afa98b76e5b432a1640a3 100644 (file)
@@ -792,7 +792,7 @@ is a handy reference of the most common LilyPond commands.
 
 @item
 The
-@emph{@ref{Command index}}
+@emph{@ref{LilyPond command index}}
 is an index of all LilyPond @code{\commands}.
 
 @item
index 587df0ee4071f58fd57f4d99ff2537e5d19b51d8..571bdbc199f3c1eeab5607e7d6f2c67b49a35f0a 100644 (file)
@@ -35,11 +35,12 @@ This procedure may be applied to La@TeX{}, HTML, Texinfo or DocBook documents.
 * Integrating LaTeX and music::  
 * Integrating Texinfo and music::  
 * Integrating HTML and music::  
-* Integrating DocBook and music::
+* Integrating DocBook and music::  
 * Music fragment options::      
 * Invoking lilypond-book::      
 * Filename extensions::         
 * Many quotes of a large score::  
+* Inserting LilyPond output into OpenOffice.org::  
 * Inserting LilyPond output into other programs::  
 @end menu
 
@@ -775,6 +776,17 @@ cd out
 ...
 @end example
 
+@itemx --padding=@var{amount}
+Pad EPS boxes by this much. @var{amount} is measured in milimeters,
+and is 3.0 by default.  This option should be used if the lines of
+music stick out of the right margin.
+
+The width of a tightly clipped systems can vary, due to notation
+elements that stick into the left margin, such as bar numbers and
+instrument names. This option will shorten each line and move each 
+line to the right by the same amount.
+
+
 @item -P @var{process}
 @itemx --process=@var{command}
 Process LilyPond snippets using @var{command}.  The default command is
@@ -837,16 +849,13 @@ If you need to quote many fragments of a large score, you can also use
 the clip systems feature, see @ref{Extracting fragments of notation}.
 
 
-@ignore 
-@n ode Inserting LilyPond output into OpenOffice.org
-@s ection Inserting LilyPond output into OpenOffice.org
+@node Inserting LilyPond output into OpenOffice.org
+@section Inserting LilyPond output into OpenOffice.org
 
-@c index OpenOffice.org
+@cindex OpenOffice.org
 
 LilyPond notation can be added to OpenOffice.org with
-@u ref{http://@/ooolilypond@/.sourceforge@/.net@/,OOoLilyPond}
-
-@end ignore
+@uref{http://@/ooolilypond@/.sourceforge@/.net@/,OOoLilyPond}
 
 
 @node Inserting LilyPond output into other programs
index f5a3d076b511120b32c3b4777f0ecd09fc7cf707..33e147d4328b478386802b9118acecbe5b67da1b 100644 (file)
@@ -1,5 +1,14 @@
 @c -*- coding: utf-8; mode: texinfo; -*-
 @c This file is part of lilypond.tely
+@c
+@c Translation of GIT committish: <FILL-IN-HEAD-COMMITTISH>
+@c
+@c When revising a translation, copy the HEAD committish of the
+@c version that you are working on.  Use
+@c
+@c   git-rev-list HEAD | head -1
+@c
+@c to discover that.
 
 @c TODO:
 @c   * more details about running lilypond; error messages,
@@ -86,7 +95,11 @@ c' d' e' f' g' a' b' c''
 @end lilypond
 
 @emph{Warning:}  Every piece of LilyPond input needs to have
-@{curly braces@} placed around the input.  Don't forget them!
+@{curly braces@} placed around the input.  The braces should be
+also be surrounded by a space unless
+they are at the beginning or end of a line to avoid ambiguities.  These
+may be omitted in examples in this manual, but don't forget them in
+your own music!
 
 @cindex Case sensitive
 In addition, LilyPond input is case sensitive.  @code{ @{ c d e @} } is
@@ -180,8 +193,10 @@ available package for viewing and printing PDF and PostScript files.}
 @section Second steps
 
 @emph{Remember:} Every piece of LilyPond input needs to
-have @{curly braces@} placed
-around the input.  For the rest of this manual, most examples will
+have @{curly braces@} placed around the input.
+The braces should be surrounded by a space unless
+they are at the beginning or end of a line to avoid ambiguities.
+For the rest of this manual, most examples will
 omit these braces, but don't forget them in your own music!
 
 @c will be removed once the tutorial either explains \relative or
index 2815b0c756f58e53f1bfe14eab42d9a06636c326..7fa0e1e7cc24097e267fc039115ffb544e615820 100644 (file)
@@ -212,7 +212,7 @@ test-clean:
 test:
 ## no aa-scaling, no PDF
        $(MAKE) -C input/regression/ out=test LILYPOND_BOOK_LILYPOND_FLAGS="--backend=eps --formats=ps,png $(LILYPOND_JOBS) -dinclude-eps-fonts -dgs-load-fonts --header=texidoc -I $(top-src-dir)/input/manual -dcheck-internal-types -ddump-signatures -danti-alias-factor=1" LILYPOND_BOOK_VERBOSE= out-test/collated-files.html 
-       @find input ly -name '*.ly' |grep -v 'out.*/' | xargs grep '\\version' -L | sed 's/^/**** Missing version: /g' 
+       @find input ly -name '*.ly' -print |grep -v 'out.*/' | xargs grep '\\version' -L | grep -v "standard input" |sed 's/^/**** Missing version: /g' 
 
 
 
diff --git a/THANKS b/THANKS
index 0f0504bc43ad4354af830146370163757e1d2ac5..d74eb3abd76457f51c997ccf44a905a47a6980ce 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -1,4 +1,4 @@
-Release 2.10
+Release 2.11
 ************
 
 
@@ -26,6 +26,7 @@ Bertalan Fodor
 Benjamin Drung
 Cameron Horsburgh
 Carl Sorensen
+Christian Hitz
 David Bobroff
 Eduardo Vieira
 Jay Anderson
diff --git a/VERSION b/VERSION
index 745aac957eb232c783b7714172556aec11b14a63..1a4814ec831a666491908bd9d33d400f8bad5995 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=11
-PATCH_LEVEL=6
+PATCH_LEVEL=7
 MY_PATCH_LEVEL=
 
index e8984600aed2cf6607bc9878eff48f7a657a40c4..c94d402e79876c0cd48489ab6b9af2d482ddb3b5 100644 (file)
@@ -256,4 +256,5 @@ for filenm in files:
     if depfile_nm:
         write_deps (open (depfile_nm, 'wb'), deps,
               [base + '.log', base + '.dvi', base + '.pfa',
-              base + '.pfb', texfile_nm])
+               depfile_nm,
+               base + '.pfb', texfile_nm])
index ac1a6d12fc1e0ae01eccc2bb3d9d6ed65cfd83b1..511b8c2460bdd279187e7b45af4c2e86e52065d3 100644 (file)
@@ -11,8 +11,6 @@
 
 #include "std-string.hh"
 
-#include "std-string.hh"
-
 /**
    Rational numbers.  Included is support for + and - infinity.
 */
diff --git a/flower/include/yaffut-parameters.hh b/flower/include/yaffut-parameters.hh
new file mode 100644 (file)
index 0000000..9a569f9
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef __YAFFUT_PARAMETERS_H__
+#define __YAFFUT_PARAMETERS_H__
+
+#include "yaffut.hh"
+
+namespace yaffut {
+template <typename Suite, typename ParameterOne, typename Case>
+struct TestOne: public ITest, public Suite
+{
+  ParameterOne const parameter_one_;
+  //static Registrator<Suite, Case> s_Registrator;
+  TestOne(ParameterOne p)
+  : Suite(p)
+  , parameter_one_ (p)
+  {
+    Registrator<Suite, Case>* r = &Test<Suite, Case>::s_Registrator;
+    r = 0;
+  }
+};
+
+#define TEST_STRING(Suite, Case, String)\
+  namespace { \
+      struct Case: public yaffut::TestOne<Suite, std::string, Case>{ Case(); };        \
+  } \
+  template struct yaffut::TestOne<Suite, std::string, Case>; Case::Case() \
+    : yaffut::TestOne<Suite, std::string, Case> (String)
+
+}
+
+#endif // __YAFFUT_PARAMETERS_H__
diff --git a/flower/include/yaffut.hh b/flower/include/yaffut.hh
new file mode 100644 (file)
index 0000000..91a3521
--- /dev/null
@@ -0,0 +1,359 @@
+// Copyright 2006 Rutger E.W. van Beusekom.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef __YAFFUT_H__
+#define __YAFFUT_H__
+
+#include <cxxabi.h>
+
+#include <cmath>
+#include <iostream>
+#include <map>
+#include <memory>
+#include <sstream>
+#include <stdexcept>
+
+#define YAFFUT_STRINGIZE(x) YAFFUT_STRINGIZE_(x)
+#define YAFFUT_STRINGIZE_(x) #x
+
+#define __YAFFUT_AT__ __FILE__ ":" YAFFUT_STRINGIZE(__LINE__)": "
+#ifndef __AT__
+#define __AT__ __YAFFUT_AT__
+#endif
+
+#define YAFFUT_EQUAL(e,a) \
+  yaffut::equal (e ,a , __YAFFUT_AT__, "EQUAL(" #e " == " #a ") failed ")
+#ifndef EQUAL
+#define EQUAL YAFFUT_EQUAL
+#endif
+
+#define YAFFUT_UNEQUAL(e,a) \
+  yaffut::unequal (e, a, __YAFFUT_AT__, "UNEQUAL(" #e " != " #a ") failed ")
+#ifndef UNEQUAL
+#define UNEQUAL YAFFUT_UNEQUAL
+#endif
+
+#define YAFFUT_CHECK(e) \
+  yaffut::check (e, __YAFFUT_AT__, "CHECK(" #e ") failed ")
+#ifndef CHECK
+#define CHECK YAFFUT_CHECK
+#endif
+
+#define YAFFUT_FAIL(s) yaffut::fail (s, __YAFFUT_AT__);
+#ifndef FAIL
+#define FAIL YAFFUT_FAIL
+#endif
+
+#define YAFFUT_ASSERT_THROW(s, e) \
+  try \
+  { \
+    s; \
+    throw yaffut::failure (__YAFFUT_AT__,  #s " failed to throw"); \
+  } \
+  catch(const e&){}
+#ifndef ASSERT_THROW
+#define ASSERT_THROW YAFFUT_ASSERT_THROW
+#endif
+
+namespace yaffut {
+
+template <typename T>
+std::string demangle()
+{
+  size_t sz;
+  int status;
+  char* ptr = abi::__cxa_demangle(typeid(T).name(), 0, &sz, &status);
+  std::string name(ptr ? ptr : "", ptr ? strlen(ptr) : 0);
+  if(ptr){ free(ptr); }
+  std::string::size_type pos = name.rfind("::");
+  if(pos != std::string::npos)
+  {
+    name = name.substr(pos + 2);
+  }  
+  return name;
+}
+
+struct ITest
+{
+  virtual ~ITest(){}
+};
+
+class Factory
+{
+public:
+  typedef ITest* (*Create_t) ();
+private:
+  typedef std::map<std::string, Create_t> Tests_t;
+  Tests_t m_Tests;
+  size_t m_fail;
+  size_t m_pass;
+private:
+  Factory(){}
+  ~Factory(){}
+  static bool EqualsSuiteName (std::string const &name, std::string const& s)
+  {
+    return name.find (':') >= name.length () - 2
+      && s.substr (0, name.length ()) == name;
+  }
+public:
+  static Factory& Instance()
+  {
+    static Factory instance;
+    return instance;
+  }
+  void Register(const std::string& name, Create_t create)
+  {
+    m_Tests[name] = create;
+  }
+  size_t Fail () { return m_fail; }
+  void List(const std::string& name)
+  {
+    for(Tests_t::const_iterator it = m_Tests.begin(); it != m_Tests.end(); ++it)
+    {
+      if(name.empty () || it->first == name
+        || EqualsSuiteName (name, it->first))
+       std::cout << it->first << std::endl;
+    }
+  }
+  void Run(const std::string& name)
+  {
+    for(Tests_t::const_iterator it = m_Tests.begin(); it != m_Tests.end(); ++it)
+    {
+      if("All" == name || it->first == name
+        || EqualsSuiteName (name, it->first))
+      {
+        try
+        {
+          std::cout << std::endl << it->first << ' ' << std::flush;
+          {
+            std::auto_ptr<ITest> test(it->second());
+          }
+          std::cout << "[OK]" << std::flush;
+          ++m_pass;
+        }
+        catch(const std::exception& e)
+        {
+          std::cout << "[FAIL]\n" << e.what() << std::flush;
+          ++m_fail;
+        }
+        catch(...)
+        {
+          std::cout << "[FAIL]\nunknown exception" << std::flush;
+          ++m_fail;
+        }
+      }
+    }
+  }
+  void Report ()
+  {
+    const size_t size = m_Tests.size();
+    std::cout << std::endl;
+    std::cout << "[TOTAL](" << m_pass + m_fail << '/' << size << ")" << std::endl;
+    std::cout << "[OK](" << m_pass << '/' << size << ")" << std::endl;
+    if (m_fail)
+      std::cout << "[FAIL](" << m_fail << '/' << size << ")" << std::endl;
+  }
+  int Main (int argc, const char* argv[])
+  {
+    if(argc > 1
+       && (std::string(argv[1]) == "-h" || std::string(argv[1]) == "--help"))
+    {
+      std::cout << "Yaffut - Yet Another Framework For Unit Testing.\n\n"
+       "Usage: yaffut [OPTION] [Suite:|Suite::Test]...\n\n"
+       "Options:\n"
+       "  -h, --help  show this help\n"
+       "  -l, --list  list test cases" << std::endl;
+      return 0;
+    }
+    if(argc > 1
+       && (std::string(argv[1]) == "-l" || std::string(argv[1]) == "--list"))
+    {
+      Factory::Instance().List(argc > 2 ? argv[2] : "");
+      return 0;
+    }
+
+    const char* all[] = {"All"};
+    const char** test = all;
+    int num = 1;
+    if(1 < argc)
+    {
+      test = argv;
+      num = argc;
+    }
+    
+    for(int i = 0; i < num; ++i)
+    {
+      try
+      {
+       Factory::Instance().Run(test[i]);
+      }
+      catch(const std::exception& e)
+      {
+       std::clog << e.what() << std::endl;
+      }
+    }
+
+    Factory::Instance().Report ();
+    return Factory::Instance().Fail ();
+  }
+};
+
+class failure: public std::exception
+{
+  std::string failure_;
+public:
+  template <typename Expected, typename Actual>
+  failure(const Expected& e, Actual& a, const char* at = "", const char* expr = "")
+  {
+    std::ostringstream os;
+    os << at << expr << "\nexpected: "
+       << "(" << demangle<Expected>() << ") " << e
+       << " != actual: " << "(" << demangle<Actual>() << ") " << a;
+    failure_ = os.str();
+  }
+  failure(const char* at = "", const char* expr = "")
+  {
+    std::ostringstream os;
+    os << at << expr;
+    failure_ = os.str();
+  }
+  virtual ~failure() throw() {}
+  virtual const char* what() const throw() { return failure_.c_str(); }
+};
+
+template <typename Suite, typename Case>
+struct Registrator
+{
+  Registrator()
+  {
+    Factory::Instance().Register(TestName(), Create);
+  }
+  const std::string& TestName()
+  {
+    static const std::string name(demangle<Suite>() + "::" + demangle<Case>());
+    return name;
+  }
+  static ITest* Create()
+  {
+    return new Case;
+  }
+};
+
+template <typename Suite, typename Case>
+struct Test: public ITest, public Suite
+{
+  static Registrator<Suite, Case> s_Registrator;
+  Test()
+  : Suite()
+  {
+    Registrator<Suite, Case>* r = &s_Registrator;
+    r = 0;
+  }
+  template <typename E, typename T>
+  void assert_throw(void(T::*mf)(), const char* at)
+  {
+    try
+    {
+      (dynamic_cast<T*> (this)->*mf)();
+      throw yaffut::failure (at, "statement failed to throw");
+    }
+    catch(const E&){}
+  }
+};
+
+template <typename Suite, typename Case>
+Registrator<Suite, Case> Test<Suite, Case>::s_Registrator;
+
+template <typename Expected, typename Actual>
+void equal(const Expected& e, const Actual& a, const char* at = "", const char* expr = "")
+{
+  if(e != a)
+  {
+    throw failure(e, a, at, expr);
+  }
+}
+inline void equal(double e, double a, const char* at = "", const char* expr = "")
+{
+  double max = std::abs(std::max(e, a));
+  max = max < 1.0 ? 1.0 : max;
+  if(std::abs(e - a) > std::numeric_limits<double>::epsilon() * max)
+  {
+    throw failure(e, a, at, expr);
+  }
+}
+inline void check(bool b, const char* at = "", const char* expr = "")
+{ 
+  if(!b)
+  {
+    throw failure(at, expr);
+  }
+}
+
+template <typename Expected, typename Actual>
+void unequal(const Expected& e, const Actual& a, const char* at = "", const char* expr = "")
+{
+  if(e == a)
+  {
+    throw failure(e, a, at, expr);
+  }
+}
+inline void unequal(double e, double a, const char* at = "", const char* expr = "")
+{
+  double max = std::abs(std::max(e, a));
+  max = max < 1.0 ? 1.0 : max;
+  if(std::abs(e - a) <= std::numeric_limits<double>::epsilon() * max)
+  {
+    throw failure(e, a, at, expr);
+  }
+}
+
+template <typename T>
+void fail(const T& expr, const char* at = "")
+{
+  std::ostringstream os;
+  os << expr;
+  throw failure(at, os.str().c_str());
+}
+
+template <typename E>
+void assert_throw(void(*pf)(), const char* at = "")
+{
+  try
+  {
+    (*pf)();
+    throw failure (at, " statement failed to throw");
+  }
+  catch(const E&){}
+}
+
+//define catch-all suite
+struct Suite {};
+
+}
+
+//and for those who prefer macro obscurity over more typing
+#define TEST(Suite, Case)\
+  namespace { struct Case: public yaffut::Test<Suite, Case>{ Case(); }; } \
+  template struct yaffut::Test<Suite, Case>; Case::Case()
+
+#define FUNC(Case)\
+  namespace { struct Case: public yaffut::Test<yaffut::Suite, Case>{ Case(); }; } \
+  template struct yaffut::Test<yaffut::Suite, Case>; Case::Case()
+
+#ifdef YAFFUT_MAIN
+
+#include <iostream>
+
+int main(int argc, const char* argv[])
+{
+  std::cout << "pid(" << getpid() << ")" << std::endl;
+  return yaffut::Factory::Instance().Main (argc, argv);
+};
+
+#endif /* YAFFUT_MAIN */
+
+#define yaffut_main(argc, argv) yaffut::Factory::Instance().Main (argc, argv)
+
+#endif
diff --git a/flower/test-file-name.cc b/flower/test-file-name.cc
new file mode 100644 (file)
index 0000000..0bd427b
--- /dev/null
@@ -0,0 +1,31 @@
+#include "file-name.hh"
+
+#include "yaffut-parameters.hh"
+
+using namespace std;
+
+string slashify (string file_name);
+
+TEST_STRING (File_name, Mingw_slashify, "foe.ly")
+{
+  string s = slashify (to_string ());
+  EQUAL (parameter_one_, s);
+}
+
+TEST_STRING (File_name, Mingw_slashify_2, "/tmp/x.ly")
+{
+  string s = slashify (to_string ());
+  EQUAL (parameter_one_, s);
+}
+
+TEST_STRING (File_name, Mingw_slashify_3, "c:/tmp/x.ly")
+{
+  string s = slashify (to_string ());
+  EQUAL (parameter_one_, s);
+}
+
+TEST_STRING (File_name, Mingw_slashify_4, "\\tmp\\x.ly")
+{
+  string s = slashify (to_string ());
+  EQUAL ("/tmp/x.ly", s);
+}
diff --git a/flower/test-file-path.cc b/flower/test-file-path.cc
new file mode 100644 (file)
index 0000000..053d237
--- /dev/null
@@ -0,0 +1,19 @@
+#include "file-path.hh"
+
+#include "yaffut.hh"
+#include "config.hh"
+
+TEST (File_path, Find)
+{
+  char const *extensions[] = {"ly", "", 0};
+  string file = "init";
+  char cwd[PATH_MAX];
+  getcwd (cwd, PATH_MAX);
+  string ly_dir = string (getenv ("top-src-dir")) + "/ly";
+  parse_path (string (1, PATHSEP) + ly_dir);
+  string file_name = find (file, extensions);
+  EQUAL (file_name.substr (file_name.rfind ('/')), "/init.ly");
+  file = "init.ly";
+  file_name = find (file, extensions);
+  EQUAL (file_name, ly_dir + "/init.ly");
+}
diff --git a/flower/test-file.cc b/flower/test-file.cc
deleted file mode 100644 (file)
index 177676f..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#define HAVE_BOOST_LAMBDA 1
-#include "std-vector.hh"
-
-#include <unistd.h>
-#include <iostream>
-
-#include <boost/test/auto_unit_test.hpp>
-#include <boost/test/floating_point_comparison.hpp>
-
-using namespace std;
-using boost::unit_test::test_suite;
-
-#include "file-name.hh"
-string slashify (string file_name);
-
-// FIXME
-//BOOST_AUTO_UNIT_TEST (mingw_slashify)
-void mingw_slashify ()
-{
-  File_name f = string ("foe.ly");
-  string s = slashify (f.to_string ());
-  cout << s << endl;
-  BOOST_CHECK_EQUAL (s, "foe.ly");
-  f = string ("/tmp/x.ly");
-  s = slashify (f.to_string ());
-  cout << s << endl;
-  BOOST_CHECK_EQUAL (s, "/tmp/x.ly");
-  f = string ("c:/tmp/x.ly");
-  s = slashify (f.to_string ());
-  cout << s << endl;
-  BOOST_CHECK_EQUAL (s, "c:/tmp/x.ly");
-  f = string ("\\tmp\\x.ly");
-  s = slashify (f.to_string ());
-  cout << s << endl;
-  BOOST_CHECK_EQUAL (s, "/tmp/x.ly");
-}
-
-#include "config.hh"
-#include "file-path.hh"
-
-// FIXME
-//BOOST_AUTO_UNIT_TEST (mingw_slashify)
-void file_find ()
-{
-  char const *extensions[] = {"ly", "", 0};
-  string file = "init";
-  File_path path;
-  char cwd[PATH_MAX];
-  getcwd (cwd, PATH_MAX);
-  string ly_dir = string (getenv ("top-src-dir")) + "/ly";
-  cout << ly_dir << endl;
-  path.parse_path (string (1, PATHSEP) + ly_dir);
-  string file_name = path.find (file, extensions);
-  cout << file_name << endl;
-  BOOST_CHECK_EQUAL (file_name.substr (file_name.rfind ('/')), "/init.ly");
-  file = "init.ly";
-  file_name = path.find (file, extensions);
-  cout << file_name << endl;
-  BOOST_CHECK_EQUAL (file_name, ly_dir + "/init.ly");
-  
-}
index ed317f7f631a13c4850ed307118a859bb2d7c276..1c1a71fa3a058f3e91a388cedc749010c6b39a14 100644 (file)
@@ -9,16 +9,14 @@
 
 #include <iostream>
 
-#include <boost/test/auto_unit_test.hpp>
-#include <boost/test/floating_point_comparison.hpp>
+#define YAFFUT_MAIN
+#include "yaffut.hh"
 
 #if !STD_VECTOR
 #define vector flower_vector
 #endif
 
 using namespace std;
-using boost::unit_test::test_suite;
-using namespace boost::unit_test;
 
 template<typename T>
 void
@@ -40,24 +38,24 @@ print (Link_array<T> v)
 }
 #endif
 
-BOOST_AUTO_UNIT_TEST (vector_erase)
+FUNC (vector_erase)
 {
   vector<int> v;
   v.push_back (0);
   v.push_back (1);
-  BOOST_CHECK_EQUAL (v.size (), vsize (2));
+  EQUAL (v.size (), vsize (2));
   v.erase (v.begin () + 1);
-  BOOST_CHECK_EQUAL (v.size (), vsize (1));
-  BOOST_CHECK_EQUAL (v.back (), 0);
+  EQUAL (v.size (), vsize (1));
+  EQUAL (v.back (), 0);
 
   v.push_back (1);
-  BOOST_CHECK_EQUAL (v.size (), vsize (2));
+  EQUAL (v.size (), vsize (2));
   v.erase (v.begin () + 0);
-  BOOST_CHECK_EQUAL (v.size (), vsize (1));
-  BOOST_CHECK_EQUAL (v.back (), 1);
+  EQUAL (v.size (), vsize (1));
+  EQUAL (v.back (), 1);
 }
 
-BOOST_AUTO_UNIT_TEST (vector_slice)
+FUNC (vector_slice)
 {
   vector<int> v;
   v.push_back (0);
@@ -65,18 +63,18 @@ BOOST_AUTO_UNIT_TEST (vector_slice)
   v.push_back (2);
   v.push_back (3);
 #if VECTOR_SLICE
-  BOOST_CHECK_EQUAL (v.slice (0, 0).size (), vsize (0));
-  BOOST_CHECK_EQUAL (v.slice (0, v.size ()).size (), v.size ());
-  BOOST_CHECK_EQUAL (v.slice (1, 2).size (), vsize (1));
+  EQUAL (v.slice (0, 0).size (), vsize (0));
+  EQUAL (v.slice (0, v.size ()).size (), v.size ());
+  EQUAL (v.slice (1, 2).size (), vsize (1));
 #else
-  BOOST_CHECK_EQUAL (vector<int> (v.begin (), v.begin ()).size (), vsize (0));
-  BOOST_CHECK_EQUAL (vector<int> (v.begin (), v.end ()).size (), v.size ());
-  BOOST_CHECK_EQUAL (vector<int> (v.begin () + 1, v.begin () + 2).size (),
+  EQUAL (vector<int> (v.begin (), v.begin ()).size (), vsize (0));
+  EQUAL (vector<int> (v.begin (), v.end ()).size (), v.size ());
+  EQUAL (vector<int> (v.begin () + 1, v.begin () + 2).size (),
                     vsize (1));
 #endif
 }
 
-BOOST_AUTO_UNIT_TEST (vector_sorting)
+FUNC (vector_sorting)
 {
   vector<int> v;
   v.push_back (2);
@@ -88,12 +86,12 @@ BOOST_AUTO_UNIT_TEST (vector_sorting)
   //sort (v.begin (), v.end ());
   vector_sort (v, less<int> ());
 #endif
-  BOOST_CHECK_EQUAL (v[0], 0);
-  BOOST_CHECK_EQUAL (v[1], 1);
-  BOOST_CHECK_EQUAL (v[2], 2);
+  EQUAL (v[0], 0);
+  EQUAL (v[1], 1);
+  EQUAL (v[2], 2);
 }
 
-BOOST_AUTO_UNIT_TEST (vector_insert)
+FUNC (vector_insert)
 {
   vector<int> v;
   v.push_back (0);
@@ -102,23 +100,23 @@ BOOST_AUTO_UNIT_TEST (vector_insert)
 #else
   v.insert (v.begin (), 1);
 #endif  
-  BOOST_CHECK_EQUAL (v[0], 1);
+  EQUAL (v[0], 1);
 #if VECTOR_INSERT
   v.insert (2, v.size ());
 #else
   v.insert (v.end (), 2);
 #endif  
-  BOOST_CHECK_EQUAL (v.back (), 2);
+  EQUAL (v.back (), 2);
   vector<int> u;
   u.insert (u.begin (), v.begin (), v.end ());
-  BOOST_CHECK_EQUAL (u.size (), v.size ());
+  EQUAL (u.size (), v.size ());
   u.clear ();
   u.insert (u.end (), v.begin (), v.end ());
-  BOOST_CHECK_EQUAL (u.size (), v.size ());
+  EQUAL (u.size (), v.size ());
   u.clear ();
 }
 
-BOOST_AUTO_UNIT_TEST (parray_concat)
+FUNC (parray_concat)
 {
 #if !STD_VECTOR
   Link_array<int> u, v;
@@ -132,14 +130,14 @@ BOOST_AUTO_UNIT_TEST (parray_concat)
   v.push_back (&a[3]);
   v.push_back (&a[4]);
   concat (u, v);
-  BOOST_CHECK_EQUAL (u[0], &a[0]);
-  BOOST_CHECK_EQUAL (u[1], &a[1]);
-  BOOST_CHECK_EQUAL (u[2], &a[2]);
-  BOOST_CHECK_EQUAL (u[3], &a[3]);
-  BOOST_CHECK_EQUAL (u[4], &a[4]);
-  BOOST_CHECK_EQUAL (u.size (), vsize (5));
+  EQUAL (u[0], &a[0]);
+  EQUAL (u[1], &a[1]);
+  EQUAL (u[2], &a[2]);
+  EQUAL (u[3], &a[3]);
+  EQUAL (u[4], &a[4]);
+  EQUAL (u.size (), vsize (5));
   concat (u, v);
-  BOOST_CHECK_EQUAL (u.size (), vsize (7));
+  EQUAL (u.size (), vsize (7));
 
   u.clear ();
   v.clear ();
@@ -149,15 +147,15 @@ BOOST_AUTO_UNIT_TEST (parray_concat)
   v.push_back (&a[3]);
   v.push_back (&a[4]);
   concat (u, v);
-  BOOST_CHECK_EQUAL (u[0], &a[0]);
-  BOOST_CHECK_EQUAL (u[1], &a[1]);
-  BOOST_CHECK_EQUAL (u[2], &a[2]);
-  BOOST_CHECK_EQUAL (u[3], &a[3]);
-  BOOST_CHECK_EQUAL (u[4], &a[4]);
-  BOOST_CHECK_EQUAL (u.size (), vsize (5));
+  EQUAL (u[0], &a[0]);
+  EQUAL (u[1], &a[1]);
+  EQUAL (u[2], &a[2]);
+  EQUAL (u[3], &a[3]);
+  EQUAL (u[4], &a[4]);
+  EQUAL (u.size (), vsize (5));
 }
 
-BOOST_AUTO_UNIT_TEST (parray_uniq)
+FUNC (parray_uniq)
 {
   vector<int> v;
   v.push_back (0);
@@ -165,76 +163,15 @@ BOOST_AUTO_UNIT_TEST (parray_uniq)
   v.push_back (0);
   vector_sort (v, less<int> ());
   uniq (v);
-  BOOST_CHECK_EQUAL (v.size (), vsize (2));
+  EQUAL (v.size (), vsize (2));
 }
 
-BOOST_AUTO_UNIT_TEST (vector_search)
+FUNC (vector_search)
 {
   vector<int> v;
   v.push_back (0);
   v.push_back (1);
   v.push_back (2);
   vsize i = binary_search (v, 1, less<int> ());
-  BOOST_CHECK_EQUAL (i, vsize (1));
-}
-
-#if 0
-#include "file-name.hh"
-string slashify (string file_name);
-
-BOOST_AUTO_UNIT_TEST (mingw_slashify)
-{
-  File_name f = string ("foe.ly");
-  string s = slashify (f.to_string ());
-  cout << s << endl;
-  BOOST_CHECK_EQUAL (s, "foe.ly");
-  f = string ("/tmp/x.ly");
-  s = slashify (f.to_string ());
-  cout << s << endl;
-  BOOST_CHECK_EQUAL (s, "/tmp/x.ly");
-  f = string ("c:/tmp/x.ly");
-  s = slashify (f.to_string ());
-  cout << s << endl;
-  BOOST_CHECK_EQUAL (s, "c:/tmp/x.ly");
-  f = string ("\\tmp\\x.ly");
-  s = slashify (f.to_string ());
-  cout << s << endl;
-  BOOST_CHECK_EQUAL (s, "/tmp/x.ly");
-}
-#endif
-
-void mingw_slashify ();
-void file_find ();
-
-#include <boost/test/results_reporter.hpp>
-#include <boost/test/framework.hpp>
-#include <boost/test/detail/unit_test_parameters.hpp>
-
-test_suite*
-init_unit_test_suite (int, char**)
-{
-  vsize i = 0;
-  vsize j = 0;
-  vector<int> v;
-  binary_search (v, 1, less<int> (), i, j);
-  //binary_search_bounds (v, 1, &default_compare, 0, 0);
-  
-  //Link_array<char> w;
-  vector<char*> w;
-  binary_search (w, (char*)1, less<char*> (), i, j);
-  
-  test_suite *test = BOOST_TEST_SUITE("Flower");
-
-
-  test->add (BOOST_TEST_CASE (vector_erase));
-  test->add (BOOST_TEST_CASE (vector_slice));
-  test->add (BOOST_TEST_CASE (vector_sorting));
-  test->add (BOOST_TEST_CASE (vector_insert));
-  test->add (BOOST_TEST_CASE (parray_concat));
-  test->add (BOOST_TEST_CASE (parray_uniq));
-  test->add (BOOST_TEST_CASE (vector_search));
-  test->add (BOOST_TEST_CASE (mingw_slashify));
-  test->add (BOOST_TEST_CASE (file_find));
-
-  return test;
+  EQUAL (i, vsize (1));
 }
diff --git a/input/regression/accidental-ancient.ly b/input/regression/accidental-ancient.ly
new file mode 100644 (file)
index 0000000..879f81c
--- /dev/null
@@ -0,0 +1,26 @@
+
+\header {
+texidoc = "@cindex Ancient Accidentals
+Accidentals are available in different ancient styles, which all
+are collected here.
+"
+}
+
+\version "2.11.6"
+
+\relative c'' {
+      \time 3/4
+      cis^\markup { \typewriter default } c ces  
+
+      \override Staff.Accidental #'glyph-name-alist = #alteration-hufnagel-glyph-name-alist
+      cis^\markup { \typewriter hufnagel } c ces  
+
+      \override Staff.Accidental #'glyph-name-alist = #alteration-medicaea-glyph-name-alist
+      cis^\markup { \typewriter medicaea } c ces  
+
+      \override Staff.Accidental #'glyph-name-alist = #alteration-vaticana-glyph-name-alist
+      cis^\markup { \typewriter vaticana } c ces  
+
+      \override Staff.Accidental #'glyph-name-alist = #alteration-mensural-glyph-name-alist
+      cis^\markup { \typewriter mensural } c ces  
+}
index 000f090827a090935102d8d0fef8f23305daf8c2..8d68529ea1a232cfe803d1691492c18dacd32a3d 100644 (file)
   \clef violin
   \key cis \major cis1  \key ces \major ces
   \clef soprano
-  \key cis \major cis \key ces \major ces
+  \key cis \major cis \key ces \major ces \break
   \clef mezzosoprano
   \key cis \major cis \key ces \major ces
   \clef alto
-  \key cis \major cis \key ces \major ces
+  \key cis \major cis \break \key ces \major ces 
   \clef tenor
-  \key cis \major cis \key ces \major ces
+  \key cis \major cis \key ces \major ces \break
   \clef baritone
   \key cis \major cis \key ces \major ces
   \clef bass
index e82b4b0ba372671647894d40f32bd592dbe10fd4..af1b4f912185e211a76db2c3fcc89d9c491c3050 100644 (file)
@@ -25,7 +25,7 @@ For maintenance reasons, we don't excercise the entire markup command set.
 
 
 
-\version "2.10.0"
+\version "2.11.5"
 
 {
   \fatText
@@ -39,7 +39,7 @@ For maintenance reasons, we don't excercise the entire markup command set.
     \override #'(font-encoding . fetaMusic) {
       \lookup #"noteheads-0"
     }
-    \musicglyph #"accidentals.-1"
+    \musicglyph #"accidentals.mirroredflat"
     \combine "X" "+"   
     \combine "o" "/"
     \box \column { \line { "string 1" } \line { "string 2" } }
@@ -62,7 +62,7 @@ For maintenance reasons, we don't excercise the entire markup command set.
        #:hspace 2.0
        #:override '(font-encoding . fetaMusic) #:line (#:lookup "noteheads-0" 
                                                      )
-       #:musicglyph "accidentals.-1"
+       #:musicglyph "accidentals.mirroredflat"
        #:combine "X" "+"   
        #:combine "o" "/"
        #:box #:column ("string 1" "string 2")
diff --git a/input/regression/spacing-folded-clef-cross-staff.ly b/input/regression/spacing-folded-clef-cross-staff.ly
new file mode 100644 (file)
index 0000000..8616fd8
--- /dev/null
@@ -0,0 +1,22 @@
+\version "2.10.7"
+\header {
+    texidoc = "Clefs are also folded under cross staff constructs."
+}
+
+\layout { ragged-right = ##t}
+
+\context PianoStaff <<
+  \new Staff = "up"
+  \relative c'' <<
+    {
+      \stemDown
+      f16[ \change Staff = down \stemUp
+      \clef treble g,]
+
+    } \\
+  >>
+  \new Staff = "down" {
+    \time 3/8 \clef bass s8
+  }
+>>
+
diff --git a/input/regression/spacing-loose-grace-linebreak.ly b/input/regression/spacing-loose-grace-linebreak.ly
new file mode 100644 (file)
index 0000000..e9fab41
--- /dev/null
@@ -0,0 +1,39 @@
+\header{
+  texidoc = "If a floating grace spacing section attaches to a note
+across a line break, it gets attached to the end of line."
+}
+
+
+\version "2.10.7"
+
+\new Score \with {
+  \override SpacingSpanner #'strict-grace-spacing = ##t
+  \override PaperColumn #'used = ##t 
+} <<
+
+  \new Staff <<
+
+    \new Voice {
+      \time 6/4    s2
+      s2 \bar "" \break
+      s2
+    }
+
+    \new Voice {
+      b'4
+      \afterGrace c''4 {b'16}
+      s4
+      s4
+      c''4
+    }
+    \new Voice {
+      c'4
+      c'8.
+      r16
+      c'4
+      c'4
+      c'4
+    }
+  >>
+>>
+
diff --git a/input/test/ancient-accidentals.ly b/input/test/ancient-accidentals.ly
deleted file mode 100644 (file)
index 10c5ab7..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-
-\header {
-texidoc = "@cindex Ancient Accidentals
-Accidentals are available in different ancient styles, which all
-are collected here.
-"
-}
-
-\version "2.10.0"
-
-\relative c'' {
-      \time 5/4
-      \override Staff.Accidental  #'style = #'default
-      cisis^\markup { \typewriter default } cis c ces ceses 
-      \override Staff.Accidental  #'style = #'hufnagel
-      cisis^\markup { \typewriter hufnagel } cis c ces ceses 
-      \override Staff.Accidental  #'style = #'medicaea
-      cisis^\markup { \typewriter medicaea } cis c ces ceses 
-      \override Staff.Accidental  #'style = #'vaticana
-      cisis^\markup { \typewriter vaticana } cis c ces ceses 
-      \override Staff.Accidental  #'style = #'mensural
-      cisis^\markup { \typewriter mensural } cis c ces ceses 
-}
index baaf9eb93cfdace94a02d763ec8aac22b5ba62bf..6ac44816938579f82f67ac5c4173a73b6e146252 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.10.0"
+\version "2.11.6"
 % TODO: split ancient-font into seperate files; possibly in
 % different locations.
 \header {
@@ -17,8 +17,8 @@ upperStaff = \new GregorianStaff =  "upperStaff" <<
     \override Staff.StaffSymbol  #'line-count = #4
 
      \transpose c c {
-       \override Staff.KeySignature  #'style = #'vaticana
-       \override Staff.Accidental  #'style = #'vaticana
+       \override Staff.KeySignature #'glyph-name-alist = #alteration-vaticana-glyph-name-alist
+       \override Staff.Accidental #'glyph-name-alist = #alteration-vaticana-glyph-name-alist
        \override NoteHead  #'style = #'vaticana.punctum
        \key es \major
        \clef "vaticana-fa2"
@@ -58,8 +58,8 @@ upperStaff = \new GregorianStaff =  "upperStaff" <<
        \override NoteHead  #'style = #'vaticana.cephalicus
        es f
 
-       \override Staff.KeySignature  #'style = #'medicaea
-       \override Staff.Accidental  #'style = #'medicaea
+       \override Staff.KeySignature #'glyph-name-alist = #alteration-medicaea-glyph-name-alist
+       \override Staff.Accidental #'glyph-name-alist = #alteration-medicaea-glyph-name-alist
        \override Staff.Custos  #'style = #'medicaea
        \override NoteHead  #'style = #'medicaea.punctum
        \clef "medicaea-fa2"
@@ -81,8 +81,8 @@ upperStaff = \new GregorianStaff =  "upperStaff" <<
        \override NoteHead  #'style = #'medicaea.rvirga
        e! des! ces!
 
-       \override Staff.KeySignature  #'style = #'hufnagel
-       \override Staff.Accidental  #'style = #'hufnagel
+       \override Staff.KeySignature #'glyph-name-alist = #alteration-hufnagel-glyph-name-alist
+       \override Staff.Accidental #'glyph-name-alist = #alteration-hufnagel-glyph-name-alist
        \override Staff.Custos  #'style = #'hufnagel
        \override NoteHead  #'style = #'hufnagel.punctum
        \clef "hufnagel-fa2"
@@ -258,8 +258,8 @@ lowerStaff = \new MensuralStaff =  "lowerStaff" <<
            \accepts MensuralVoice
            \consists Custos_engraver
            \override TimeSignature #'style = #'mensural
-           \override KeySignature #'style = #'mensural
-           \override Accidental #'style = #'mensural
+           \override KeySignature #'glyph-name-alist = #alteration-mensural-glyph-name-alist
+           \override Accidental #'glyph-name-alist = #alteration-mensural-glyph-name-alist
            \override Custos #'style = #'mensural
            \override Custos #'neutral-position = #3
            \override Custos #'neutral-direction = #down
@@ -276,8 +276,8 @@ lowerStaff = \new MensuralStaff =  "lowerStaff" <<
            \remove Time_signature_engraver
            \override StaffSymbol #'thickness = #2.0
            \override StaffSymbol #'line-count = #4
-           \override KeySignature #'style = #'vaticana
-           \override Accidental #'style = #'vaticana
+           \override KeySignature #'glyph-name-alist = #alteration-vaticana-glyph-name-alist
+           \override Accidental #'glyph-name-alist = #alteration-vaticana-glyph-name-alist
            \override Custos #'style = #'vaticana
            \override Custos #'neutral-position = #4
            \override Custos #'neutral-direction = #down
diff --git a/input/test/makam.ly b/input/test/makam.ly
new file mode 100644 (file)
index 0000000..53dd69c
--- /dev/null
@@ -0,0 +1,153 @@
+\header {
+
+  texidoc = "Makam is Turkish type of melody that uses 1/9 tone
+  microtonal alterations."
+
+}
+
+
+\version "2.11.6"
+
+%{
+
+Define 1/9 alterations.
+
+%}
+
+
+#(define-public KOMA 1/9)
+#(define-public BAKIYE 4/9)
+#(define-public KUCUK 5/9)
+#(define-public BUYUKMUCENNEB 8/9)
+
+%{
+
+Define pitch names
+
+%}
+
+makamPitchNames = #`(
+  (c . ,(ly:make-pitch -1 0 NATURAL))
+  (d . ,(ly:make-pitch -1 1 NATURAL))
+  (e . ,(ly:make-pitch -1 2 NATURAL))
+  (f . ,(ly:make-pitch -1 3 NATURAL))
+  (g . ,(ly:make-pitch -1 4 NATURAL))
+  (a . ,(ly:make-pitch -1 5 NATURAL))
+  (b . ,(ly:make-pitch -1 6 NATURAL))
+  
+  (cc . ,(ly:make-pitch -1 0 KOMA))
+  (dc . ,(ly:make-pitch -1 1 KOMA))
+  (ec . ,(ly:make-pitch -1 2 KOMA))
+  (fc . ,(ly:make-pitch -1 3 KOMA))
+  (gc . ,(ly:make-pitch -1 4 KOMA))
+  (ac . ,(ly:make-pitch -1 5 KOMA))
+  (bc . ,(ly:make-pitch -1 6 KOMA))
+
+  (cb . ,(ly:make-pitch -1 0 BAKIYE))
+  (db . ,(ly:make-pitch -1 1 BAKIYE))
+  (eb . ,(ly:make-pitch -1 2 BAKIYE))
+  (fb . ,(ly:make-pitch -1 3 BAKIYE))
+  (gb . ,(ly:make-pitch -1 4 BAKIYE))
+  (ab . ,(ly:make-pitch -1 5 BAKIYE))
+  (bb . ,(ly:make-pitch -1 6 BAKIYE))
+
+  (ck . ,(ly:make-pitch -1 0 KUCUK))
+  (dk . ,(ly:make-pitch -1 1 KUCUK))
+  (ek . ,(ly:make-pitch -1 2 KUCUK))
+  (fk . ,(ly:make-pitch -1 3 KUCUK))
+  (gk . ,(ly:make-pitch -1 4 KUCUK))
+  (ak . ,(ly:make-pitch -1 5 KUCUK))
+  (bk . ,(ly:make-pitch -1 6 KUCUK))
+
+  (cbm . ,(ly:make-pitch -1 0 BUYUKMUCENNEB))
+  (dbm . ,(ly:make-pitch -1 1 BUYUKMUCENNEB))
+  (ebm . ,(ly:make-pitch -1 2 BUYUKMUCENNEB))
+  (fbm . ,(ly:make-pitch -1 3 BUYUKMUCENNEB))
+  (gbm . ,(ly:make-pitch -1 4 BUYUKMUCENNEB))
+  (abm . ,(ly:make-pitch -1 5 BUYUKMUCENNEB))
+  (bbm . ,(ly:make-pitch -1 6 BUYUKMUCENNEB))
+
+  ;; f for flat.
+  (cfc . ,(ly:make-pitch -1 0 (- KOMA)))
+  (dfc . ,(ly:make-pitch -1 1 (- KOMA)))
+  (efc . ,(ly:make-pitch -1 2 (- KOMA)))
+  (ffc . ,(ly:make-pitch -1 3 (- KOMA)))
+  (gfc . ,(ly:make-pitch -1 4 (- KOMA)))
+  (afc . ,(ly:make-pitch -1 5 (- KOMA)))
+  (bfc . ,(ly:make-pitch -1 6 (- KOMA)))
+  
+  (cfb . ,(ly:make-pitch -1 0 (- BAKIYE)))
+  (dfb . ,(ly:make-pitch -1 1 (- BAKIYE)))
+  (efb . ,(ly:make-pitch -1 2 (- BAKIYE)))
+  (ffb . ,(ly:make-pitch -1 3 (- BAKIYE)))
+  (gfb . ,(ly:make-pitch -1 4 (- BAKIYE)))
+  (afb . ,(ly:make-pitch -1 5 (- BAKIYE)))
+  (bfb . ,(ly:make-pitch -1 6 (- BAKIYE)))
+
+  (cfk . ,(ly:make-pitch -1 0 (- KUCUK)))
+  (dfk . ,(ly:make-pitch -1 1 (- KUCUK)))
+  (efk . ,(ly:make-pitch -1 2 (- KUCUK)))
+  (ffk . ,(ly:make-pitch -1 3 (- KUCUK)))
+  (gfk . ,(ly:make-pitch -1 4 (- KUCUK)))
+  (afk . ,(ly:make-pitch -1 5 (- KUCUK)))
+  (bfk . ,(ly:make-pitch -1 6 (- KUCUK)))
+
+  (cfbm . ,(ly:make-pitch -1 0 (- BUYUKMUCENNEB)))
+  (dfbm . ,(ly:make-pitch -1 1 (- BUYUKMUCENNEB)))
+  (efbm . ,(ly:make-pitch -1 2 (- BUYUKMUCENNEB)))
+  (ffbm . ,(ly:make-pitch -1 3 (- BUYUKMUCENNEB)))
+  (gfbm . ,(ly:make-pitch -1 4 (- BUYUKMUCENNEB)))
+  (afbm . ,(ly:make-pitch -1 5 (- BUYUKMUCENNEB)))
+  (bfbm . ,(ly:make-pitch -1 6 (- BUYUKMUCENNEB)))
+
+)
+
+
+%% set pitch names.
+pitchnames = \makamPitchNames 
+#(ly:parser-set-note-names parser makamPitchNames)
+
+\paper
+{
+  ragged-right = ##t
+}
+
+\relative {
+
+  %{ define alteration <-> symbol mapping. The following glyphs are available.
+
+  accidentals.sharp 
+  accidentals.sharp.slashslash.stem 
+  accidentals.sharp.slashslashslash.stemstem 
+  accidentals.sharp.slashslashslash.stem 
+  accidentals.sharp.slashslash.stemstemstem 
+  accidentals.natural 
+  accidentals.flat 
+  accidentals.flat.slash 
+  accidentals.flat.slashslash 
+  accidentals.mirroredflat.flat 
+  accidentals.mirroredflat 
+  accidentals.flatflat 
+  accidentals.flatflat.slash 
+  accidentals.doublesharp 
+
+  %}
+
+  
+  \override Accidental #'glyph-name-alist = #'((1 . "accidentals.doublesharp")
+       (8/9 . "accidentals.sharp.slashslashslash.stemstem")
+       (5/9 . "accidentals.sharp.slashslashslash.stem")
+       (4/9 . "accidentals.sharp")
+       (1/9 . "accidentals.sharp.slashslash.stem")
+       (0 . "accidentals.natural")
+       (-1/9 . "accidentals.mirroredflat")
+       (-4/9 . "accidentals.flat.slash")
+       (-5/9 . "accidentals.flat")
+       (-8/9 . "accidentals.flat.slashslash")
+       (-1 . "accidentals.flatflat")
+       )
+
+  
+  
+  c cc db fk gbm gfc gfb efk dfbm
+}
index 502aeaea9fd602cd654f790827c56eab8d6629b9..bbb217d73cfee1a23d459435ed5213bcc06fa8b0 100644 (file)
@@ -368,8 +368,6 @@ Accidental_engraver::create_accidental (Accidental_entry *entry,
 {
   Stream_event *note = entry->melodic_;
   Grob *support = entry->head_;
-  Pitch *pitch = unsmob_pitch (note->get_property ("pitch"));
-
   bool as_suggestion = to_boolean (entry->origin_->get_property ("suggestAccidentals"));
   Grob *a = 0;
   if (as_suggestion)
@@ -383,7 +381,6 @@ Accidental_engraver::create_accidental (Accidental_entry *entry,
        a->set_property ("restore-first", SCM_BOOL_T);
     }
 
-  a->set_property ("alteration",  scm_from_int (pitch->get_alteration () * Rational (4)));
   entry->accidental_ = a;
 }
 
@@ -596,8 +593,8 @@ ADD_TRANSLATOR (Accidental_engraver,
 
                /* grobs */
                "Accidental "
-               "AccidentalCautionary"
-               "AccidentalSuggestion",
+               "AccidentalCautionary "
+               "AccidentalSuggestion ",
 
                /* props */
                "autoAccidentals "
index f6672e815b7d4f1469e447a462cbd8f774776d64..a54a87efbc3c31e6cf07f1af9902038122439d10 100644 (file)
@@ -65,53 +65,48 @@ Accidental_interface::accurate_boxes (Grob *me, Grob **common)
       && !to_boolean (me->get_property ("restore-first"))
       && !parens)
     {
-      int acc = scm_to_int (me->get_property ("alteration"));
-      switch (acc)
+      Rational alteration = ly_scm2rational (me->get_property ("alteration"));
+      if (alteration == FLAT_ALTERATION)
        {
-       case FLAT:
-         {
-           Box stem = b;
-           Box bulb = b;
+         Box stem = b;
+         Box bulb = b;
 
-           /*
-             we could make the stem thinner, but that places the flats
-             really close.
-           */
-           stem[X_AXIS][RIGHT] *= .5;
-
-           /*
-             To prevent vertical alignment for 6ths
-           */
-           stem[Y_AXIS] *= 1.1;
-           bulb[Y_AXIS][UP] *= .35;
-
-           boxes.push_back (bulb);
-           boxes.push_back (stem);
-         }
-         break;
-       case NATURAL:
-         {
-           Box lstem = b;
-           Box rstem = b;
-           Box belly = b;
-
-           lstem[Y_AXIS] *= 1.1;
-           rstem[Y_AXIS] *= 1.1;
+         /*
+           we could make the stem thinner, but that places the flats
+           really close.
+         */
+         stem[X_AXIS][RIGHT] *= .5;
 
-           belly[Y_AXIS] *= 0.75;
-           lstem[X_AXIS][RIGHT] *= .33;
-           rstem[X_AXIS][LEFT] = rstem[X_AXIS].linear_combination (1.0 / 3.0);
-           lstem[Y_AXIS][DOWN] = belly[Y_AXIS][DOWN];
-           rstem[Y_AXIS][UP] = belly[Y_AXIS][UP];
-           boxes.push_back (belly);
-           boxes.push_back (lstem);
-           boxes.push_back (rstem);
-         }
-         break;
          /*
-           TODO: add support for, double flat.
+           To prevent vertical alignment for 6ths
          */
+         stem[Y_AXIS] *= 1.1;
+         bulb[Y_AXIS][UP] *= .35;
+
+         boxes.push_back (bulb);
+         boxes.push_back (stem);
+       }
+      else if (alteration == NATURAL_ALTERATION)
+       {
+         Box lstem = b;
+         Box rstem = b;
+         Box belly = b;
+
+         lstem[Y_AXIS] *= 1.1;
+         rstem[Y_AXIS] *= 1.1;
+
+         belly[Y_AXIS] *= 0.75;
+         lstem[X_AXIS][RIGHT] *= .33;
+         rstem[X_AXIS][LEFT] = rstem[X_AXIS].linear_combination (1.0 / 3.0);
+         lstem[Y_AXIS][DOWN] = belly[Y_AXIS][DOWN];
+         rstem[Y_AXIS][UP] = belly[Y_AXIS][UP];
+         boxes.push_back (belly);
+         boxes.push_back (lstem);
+         boxes.push_back (rstem);
        }
+      /*
+       TODO: add support for, double flat.
+      */
     }
 
   if (!boxes.size ())
@@ -126,131 +121,45 @@ Accidental_interface::accurate_boxes (Grob *me, Grob **common)
   return boxes;
 }
 
-/*
- * Some styles do not provide all flavours of accidentals, e.g. there
- * is currently no sharp accidental in vaticana style.  In these cases
- * this function falls back to one of the other styles.
- */
-
-/*
-  todo: this sort of stuff in Scheme. --hwn.
-*/
-string
-Accidental_interface::get_fontcharname (string style, int alteration)
-{
-  if (alteration == DOUBLE_FLAT
-      || alteration == DOUBLE_SHARP)
-    return to_string (alteration);
-
-  if (style == "hufnagel")
-    switch (alteration)
-      {
-      case FLAT: return "hufnagel-1";
-      case 0: return "vaticana0";
-      case SHARP: return "mensural1";
-      }
-  if (style == "medicaea")
-    switch (alteration)
-      {
-      case FLAT: return "medicaea-1";
-      case 0: return "vaticana0";
-      case SHARP: return "mensural1";
-      }
-  if (style == "vaticana")
-    switch (alteration)
-      {
-      case FLAT: return "vaticana-1";
-      case 0: return "vaticana0";
-      case SHARP: return "mensural1";
-      }
-  if (style == "mensural")
-    switch (alteration)
-      {
-      case FLAT: return "mensural-1";
-      case 0: return "vaticana0";
-      case SHARP: return "mensural1";
-      }
-
-  if (style == "neomensural")
-    style = ""; // currently same as default
-  if (style == "default")
-    style = "";
-  
-  return style + to_string (alteration);
-}
-
 MAKE_SCHEME_CALLBACK (Accidental_interface, print, 1);
 SCM
 Accidental_interface::print (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  bool parens = to_boolean (me->get_property ("parenthesized"));
-
-  SCM scm_style = me->get_property ("style");
-  string style;
-  if (scm_is_symbol (scm_style))
-    style = ly_symbol2string (scm_style);
-  else
-    /*
-      preferably no name for the default style.
-    */
-    style = "";
 
   Font_metric *fm = Font_interface::get_default_font (me);
 
-  SCM stencils = me->get_property ("stencils");
-  if (!scm_is_pair (stencils)
-      || !unsmob_stencil (scm_car (stencils)))
-    return SCM_EOL;
+  SCM alist = me->get_property ("glyph-name-alist");
+  SCM alt = me->get_property ("alteration");
+  SCM glyph_name = ly_assoc_get (alt, alist, SCM_BOOL_F);
+  
+  if (!scm_is_string (glyph_name))
+    {
+      me->warning (_f ("Could not find glyph-name for alteration %s",
+                      ly_scm2rational (alt).to_string ().c_str ()));
+      return SCM_EOL;
+    }
   
-  Stencil mol (*unsmob_stencil (scm_car (stencils)));
+  Stencil mol (fm->find_by_name (scm_i_string_chars (glyph_name)));
   if (to_boolean (me->get_property ("restore-first")))
     {
-      string font_char = get_fontcharname (style, 0);
-      Stencil acc (fm->find_by_name ("accidentals." + font_char));
+      /*
+       this isn't correct for ancient accidentals, but they don't
+       use double flats/sharps anyway.
+       */
+      Stencil acc (fm->find_by_name ("accidentals.natural"));
 
       if (acc.is_empty ())
-       me->warning (_f ("accidental `%s' not found", font_char));
+       me->warning (_ ("natural alteration glyph not found"));
       else
        mol.add_at_edge (X_AXIS, LEFT, acc, 0.1, 0);
     }
   
-  if (parens)
+  if (to_boolean (me->get_property ("parenthesized")))
     mol = parenthesize (me, mol);
 
   return mol.smobbed_copy ();
 }
-  
-MAKE_SCHEME_CALLBACK (Accidental_interface, calc_stencils, 1);
-SCM
-Accidental_interface::calc_stencils (SCM smob)
-{
-  Grob *me = unsmob_grob (smob);
-
-  SCM scm_style = me->get_property ("style");
-  string style;
-  if (scm_is_symbol (scm_style))
-    style = ly_symbol2string (scm_style);
-  else
-    /*
-      preferably no name for the default style.
-    */
-    style = "";
-
-
-  Font_metric *fm = Font_interface::get_default_font (me);
-  SCM acc = me->get_property ("alteration");
-  if (scm_is_number (acc))
-    {
-      string font_char = get_fontcharname (style, scm_to_int (acc));
-      
-      Stencil acc_stencil (fm->find_by_name ("accidentals." + font_char));
-
-      return scm_list_1 (acc_stencil.smobbed_copy ());
-    }
-  else
-    return SCM_EOL;
-}
 
   
 ADD_INTERFACE (Accidental_interface,
@@ -260,8 +169,8 @@ ADD_INTERFACE (Accidental_interface,
               "alteration "
               "avoid-slur "
               "forced "
-              "style "
               "parenthesized "
               "restore-first "
+              "glyph-name-alist "
               "tie "
               );
index ab2897f16de90b09d30af7bdfc6df0e388776345..8606e4c9c11a82adce857c2af1851bead944d442 100644 (file)
@@ -158,7 +158,7 @@ Ambitus_engraver::finalize ()
            }
          else
            {
-             accidentals_[d]->set_property ("alteration", scm_from_int (int (Real (Rational (4) * p.get_alteration ()))));
+             accidentals_[d]->set_property ("alteration", ly_rational2scm (p.get_alteration ()));
            }
        }
       while (flip (&d) != DOWN);
index 60e98f0944e9131c89023620f53d8a30bdbf5b62..e647fcae868f01465c466c5f594dea77cdd922d1 100644 (file)
@@ -85,7 +85,11 @@ Enclosing_bracket::print (SCM grob)
 
   Grob *common_x = common_refpoint_of_array (elements, me, X_AXIS); 
   Interval xext = Axis_group_interface::relative_group_extent (elements, common_x, X_AXIS);
-
+  if (xext.is_empty ())
+    {
+      me->programming_error ("elements have no X extent.");
+      xext = Interval (0, 0);
+    }
 
   Stencil left_br = Horizontal_bracket::make_enclosing_bracket (me, me, elements,
                                                                Y_AXIS, LEFT);
index 1cb51a10ff27b34cea174434eee275511b1fa529..5e161474dc312fbebb1b8c7a5a1e02cbbc999841 100644 (file)
@@ -135,12 +135,12 @@ LY_DEFINE (ly_assoc_get, "ly:assoc-get",
           "(or #f if not specified).")
 {
   SCM handle = scm_assoc (key, alist);
-
+  if (scm_is_pair (handle))
+    return scm_cdr (handle);
+  
   if (default_value == SCM_UNDEFINED)
     default_value = SCM_BOOL_F;
 
-  if (scm_is_pair (handle))
-    return scm_cdr (handle);
   return default_value;
 }
 
index d2b016b49625419ee6a4a7c1005242e7842aaa13..99cdd8a5e76bac137be65798ad377cb415aeb69d 100644 (file)
@@ -72,19 +72,25 @@ Horizontal_bracket::make_enclosing_bracket (Grob *me, Grob *refpoint,
   Grob *common = common_refpoint_of_array (grobs, refpoint, a);
   Interval ext = Axis_group_interface::relative_group_extent (grobs, common, a);
 
-  Stencil b = make_bracket (me, ext.length(), a, dir);
-  b.translate_axis (ext[LEFT] - refpoint->relative_coordinate (common, a), a);
+  if (ext.is_empty ())
+    {
+      me->programming_error ("Can't enclose empty extents with bracket");
+      return Stencil ();
+    }
+  else
+    {
+      Stencil b = make_bracket (me, ext.length(), a, dir);
+      b.translate_axis (ext[LEFT] - refpoint->relative_coordinate (common, a), a);
 
-  return b;
+      return b;
+    }
 }
 
-
 /*
   TODO:
 
   Support texts on the brackets?
 */
-
 MAKE_SCHEME_CALLBACK (Horizontal_bracket, print, 1);
 SCM
 Horizontal_bracket::print (SCM smob)
index 8bd0d1305fc89936907e4246b6a9c3b5878ec4db..b3e9d4bd98b7c06b0deadcc89bc45ee27f847a61 100644 (file)
@@ -53,23 +53,6 @@ Key_engraver::Key_engraver ()
 }
 
 
-SCM
-make_qt_key (SCM rat_key)
-{
-  SCM qt_key = SCM_EOL;
-  SCM *tail = &qt_key;
-      
-  for (SCM s = rat_key; scm_is_pair (s); s = scm_cdr (s))
-    {
-      *tail = scm_cons (scm_cons (scm_caar (s),
-                                 scm_from_int (Rational (4)* ly_scm2rational (scm_cdar (s)))),
-                       SCM_EOL);
-      tail =  SCM_CDRLOC (*tail);
-    }
-
-  return qt_key;
-}
-
 void
 Key_engraver::create_key (bool is_default)
 {
@@ -110,14 +93,13 @@ Key_engraver::create_key (bool is_default)
                                         key_event_
                                         ? key_event_->self_scm () : SCM_EOL);
              
-             cancellation_->set_property ("alteration-alist", make_qt_key (restore));
+             cancellation_->set_property ("alteration-alist", restore);
              cancellation_->set_property ("c0-position",
                                           get_property ("middleCPosition"));
            }
        }
 
-
-      item_->set_property ("alteration-alist", make_qt_key (key));
+      item_->set_property ("alteration-alist", key);
     }
 
   if (!is_default)
index d6513efd84b1b6ad96ea0bb83d3c305c46f23e23..bea2aafbc7f7c20216e513a47d5c5b0426ca94a3 100644 (file)
 #include "lookup.hh"
 #include "output-def.hh"
 #include "staff-symbol-referencer.hh"
+#include "rational.hh"
 
 struct Key_signature_interface
 {
   DECLARE_SCHEME_CALLBACK (print, (SCM));
-
   DECLARE_GROB_INTERFACE();
 };
 
-/*
-  FIXME: too much hardcoding here.
-*/
-const int FLAT_TOP_PITCH = 2; /* fes, ges, as and bes typeset in lower octave */
-const int SHARP_TOP_PITCH = 4; /*  ais and bis typeset in lower octave */
-
-/*
-  TODO: look this up. I'm not sure where the naturals ought to go.
-
-  COMMENT: Current implementation does not use the NATURAL_TOP_PITCH for anything,
-           always typesets naturals in the same place as the thing they cancel. -rz
-*/
-const int NATURAL_TOP_PITCH = 4;
-
-/*
-  FIXME: key-item should just get a list of (position, acc), and leave
-  the thinking to other parties.
-
-  - TODO: put this in Scheme
-
-  TODO: can  we do without c0pos? it's partly musical.
-*/
-int
-alteration_pos (SCM what, int alter, int c0p)
-{
-  if (scm_is_pair (what))
-    return scm_to_int (scm_car (what)) * 7 + scm_to_int (scm_cdr (what)) + c0p;
-
-  int p = scm_to_int (what);
-
-  // Find the c in the range -4 through 2
-  int from_bottom_pos = c0p + 4;
-  from_bottom_pos = from_bottom_pos % 7;
-  from_bottom_pos = (from_bottom_pos + 7) % 7; // Precaution to get positive.
-  int c0 = from_bottom_pos - 4;
-
-  if ((alter < 0 && ((p > FLAT_TOP_PITCH) || (p + c0 > 4)) && (p + c0 > 1))
-      || (alter > 0 && ((p > SHARP_TOP_PITCH) || (p + c0 > 5)) && (p + c0 > 2))
-      || (alter == 0 && ((p > NATURAL_TOP_PITCH) || (p + c0 > 5)) && (p + c0 > 2)))
-    {
-      p -= 7; /* Typeset below c_position */
-    }
-
-  /* Provide for the four cases in which there's a glitch
-     it's a hack, but probably not worth
-     the effort of finding a nicer solution.
-     --dl. */
-  if (c0 == 2 && alter > 0 && p == 3)
-    p -= 7;
-  if (c0==-3 && alter > 0 && p ==-1)
-    p += 7;
-  if (c0==-4 && alter < 0 && p ==-1)
-    p += 7;
-  if (c0==-2 && alter < 0 && p ==-3)
-    p += 7;
-
-  return p + c0;
-}
 
 /*
   TODO
@@ -101,13 +43,9 @@ Key_signature_interface::print (SCM smob)
   else
     style = "";
 
-  SCM newas = me->get_property ("alteration-alist");
   Stencil mol;
 
   SCM c0s = me->get_property ("c0-position");
-  int c0p = 0;
-  if (scm_is_number (c0s))
-    c0p = scm_to_int (c0s);
 
   bool is_cancellation = me->internal_has_interface
     (ly_symbol2scm ("key-cancellation-interface"));
@@ -119,22 +57,33 @@ Key_signature_interface::print (SCM smob)
 
   int last_pos = -1000;
   Font_metric *fm = Font_interface::get_default_font (me);
-  for (SCM s = newas; scm_is_pair (s); s = scm_cdr (s))
+  SCM alist = me->get_property ("glyph-name-alist");
+
+  for (SCM s = me->get_property ("alteration-alist"); scm_is_pair (s); s = scm_cdr (s))
     {
-      int alteration = scm_to_int (scm_cdar (s));
-      string font_char
-       = Accidental_interface::get_fontcharname (style,
-                                                 is_cancellation
-                                                 ? 0
-                                                 : alteration);
-      Stencil acc (fm->find_by_name ("accidentals." + font_char));
+      SCM alt = is_cancellation
+       ? scm_from_int (0)
+       : scm_cdar (s);
+
+      SCM glyph_name = ly_assoc_get (alt, alist, SCM_BOOL_F);
+      if (!scm_is_string (glyph_name))
+       {
+         me->warning (_f ("No glyph found for alteration: %s",
+                          ly_scm2rational (alt).to_string ().c_str ()));
+         continue;
+       }
+      
+      Stencil acc (fm->find_by_name (ly_scm2string (glyph_name)));
 
       if (acc.is_empty ())
-       me->warning (_f ("accidental `%s' not found", font_char));
+       me->warning (_ ("alteration not found"));
       else
        {
          SCM what = scm_caar (s);
-         int pos = alteration_pos (what, alteration, c0p);
+
+         SCM proc = ly_lily_module_constant ("key-signature-interface::alteration-position");
+
+         int pos = scm_to_int (scm_call_3 (proc, what, scm_cdar (s), c0s));
          acc.translate_axis (pos * inter, Y_AXIS);
 
          /*
@@ -161,7 +110,8 @@ Key_signature_interface::print (SCM smob)
 ADD_INTERFACE (Key_signature_interface,
               "A group of accidentals, to be printed as signature sign.",
 
+              "alteration-alist "
               "c0-position "
+              "glyph-name-alist "
               "style "
-              "alteration-alist "
               );
index 37dbc7a8966f274f6ac6f9f4449ca337e9ab6127..305359c3f57905180cf374740c39e0c64dadb27a 100644 (file)
@@ -8,12 +8,13 @@
 
 #include <unistd.h>
 
+#include "lily-parser.hh"
+
 #include "file-name-map.hh"
 #include "file-name.hh"
 #include "file-path.hh"
 #include "international.hh"
 #include "lily-lexer.hh"
-#include "lily-parser.hh"
 #include "ly-module.hh"
 #include "main.hh"
 #include "program-option.hh"
@@ -165,7 +166,7 @@ LY_DEFINE (ly_parse_string, "ly:parse-string",
 
 LY_DEFINE (ly_parser_lexer, "ly:parser-lexer",
           1, 0, 0, (SCM parser_smob),
-          "Return the lexer for PARSER_SMOB.")
+          "Return the lexer for @var{parser-smob}.")
 {
   Lily_parser *parser = unsmob_lily_parser (parser_smob);
   return parser->lexer_->self_scm ();
@@ -173,7 +174,7 @@ LY_DEFINE (ly_parser_lexer, "ly:parser-lexer",
 
 LY_DEFINE (ly_parser_clone, "ly:parser-clone",
           1, 0, 0, (SCM parser_smob),
-          "Return a clone of PARSER_SMOB.")
+          "Return a clone of @var{parser-smob}.")
 {
   Lily_parser *parser = unsmob_lily_parser (parser_smob);
   Lily_parser *clone = new Lily_parser (*parser);
@@ -183,7 +184,7 @@ LY_DEFINE (ly_parser_clone, "ly:parser-clone",
 
 LY_DEFINE (ly_parser_define, "ly:parser-define!",
           3, 0, 0, (SCM parser_smob, SCM symbol, SCM val),
-          "Bind SYMBOL to VAL in PARSER_SMOB's module.")
+          "Bind @var{symbol} to @var{val} in @var{parser-smob}'s module.")
 {
   Lily_parser *parser = unsmob_lily_parser (parser_smob);
   SCM_ASSERT_TYPE (scm_is_symbol (symbol), symbol, SCM_ARG2, __FUNCTION__, "symbol");
@@ -195,7 +196,7 @@ LY_DEFINE (ly_parser_define, "ly:parser-define!",
 
 LY_DEFINE (ly_parser_lookup, "ly:parser-lookup",
           2, 0, 0, (SCM parser_smob, SCM symbol),
-          "Lookup @var{symbol} in @var{parser_smob}'s module.  "
+          "Lookup @var{symbol} in @var{parser-smob}'s module.  "
           "Undefined is '().")
 {
   Lily_parser *parser = unsmob_lily_parser (parser_smob);
@@ -212,7 +213,7 @@ LY_DEFINE (ly_parser_lookup, "ly:parser-lookup",
 
 LY_DEFINE (ly_parser_parse_string, "ly:parser-parse-string",
           2, 0, 0, (SCM parser_smob, SCM ly_code),
-          "Parse the string LY_CODE with PARSER_SMOB."
+          "Parse the string @code{ly-code} with @code{parser-smob}."
           "Upon failure, throw @code{ly-file-failed} key.")
 {
   Lily_parser *parser = unsmob_lily_parser (parser_smob);
index ca85f08e123f47d180da89f445441c4c0ad86d26..fbb838523eeb9beab87c8a8606844a11882806e1 100644 (file)
@@ -191,7 +191,6 @@ ADD_INTERFACE (Note_column,
               "Stem and noteheads combined",
 
               /* properties */
-              "accidentals "
               "arpeggio "
               "force-hshift "
               "horizontal-shift "
index 33c459cb133d42330fbbcb10945f109183e0929e..7b5f2ad7bd33c4f261dde5d08604da7e38373aec 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "engraver.hh"
 
+#include "context.hh"
 #include "item.hh"
 #include "pointer-group-interface.hh"
 
 class Note_spacing_engraver : public Engraver
 {
   Grob *last_spacing_;
+  Context *last_spacing_parent_context_;
+  
   Grob *spacing_;
 
   void add_spacing_item (Grob *);
-
   TRANSLATOR_DECLARATIONS (Note_spacing_engraver);
 protected:
 
   DECLARE_ACKNOWLEDGER (rhythmic_grob);
   DECLARE_ACKNOWLEDGER (note_column);
   void stop_translation_timestep ();
+  virtual void finalize ();
+  virtual void derived_mark () const;
 };
 
+void
+Note_spacing_engraver::derived_mark () const
+{
+  if (last_spacing_parent_context_)
+    scm_gc_mark (last_spacing_parent_context_->self_scm ());
+}
+
 Note_spacing_engraver::Note_spacing_engraver ()
 {
+  last_spacing_parent_context_ = 0;
   last_spacing_ = 0;
   spacing_ = 0;
 }
@@ -43,7 +55,6 @@ Note_spacing_engraver::add_spacing_item (Grob *g)
       spacing_ = make_item ("NoteSpacing", g->self_scm ());
     }
   
-  
   if (spacing_)
     {
       Pointer_group_interface::add_grob (spacing_,
@@ -51,11 +62,9 @@ Note_spacing_engraver::add_spacing_item (Grob *g)
                                         g);
 
       if (last_spacing_)
-       {
-         Pointer_group_interface::add_grob (last_spacing_,
-                                            ly_symbol2scm ("right-items"),
-                                            g);
-       }
+       Pointer_group_interface::add_grob (last_spacing_,
+                                          ly_symbol2scm ("right-items"),
+                                          g);
     }
 }
 
@@ -72,14 +81,43 @@ Note_spacing_engraver::acknowledge_rhythmic_grob (Grob_info gi)
   add_spacing_item (gi.grob ());
 }
 
+void
+Note_spacing_engraver::finalize ()
+{
+  if (last_spacing_
+      && last_spacing_parent_context_
+      && last_spacing_parent_context_ == context ()->get_parent_context ())
+    {
+      SCM ccol = get_property ("currentCommandColumn");
+      Grob *column = unsmob_grob (ccol);
+      
+      Pointer_group_interface::add_grob (last_spacing_,
+                                        ly_symbol2scm ("right-items"),
+                                        column);
+    }
+}
+
 void
 Note_spacing_engraver::stop_translation_timestep ()
 {
+  if (last_spacing_
+      && last_spacing_parent_context_
+      && last_spacing_parent_context_ == context ()->get_parent_context ())
+    {
+      Grob *sep = unsmob_grob (get_property ("breakableSeparationItem"));
+      if (sep)
+       Pointer_group_interface::add_grob (last_spacing_,
+                                          ly_symbol2scm ("right-items"),
+                                          sep);
+    }
+  
   if (spacing_)
     {
       last_spacing_ = spacing_;
+      last_spacing_parent_context_ = context ()->get_parent_context ();
       spacing_ = 0;
     }
+
 }
 
 ADD_ACKNOWLEDGER (Note_spacing_engraver, note_column);
index ebb322d7731ef9009e247d1df953896b9b71afa5..7ea90f93da1d03fcf3fca901dcec1a6f0615537c 100644 (file)
@@ -350,6 +350,7 @@ If we give names, Bison complains.
 %type <scm> absolute_pitch
 %type <scm> assignment_id
 %type <scm> bare_number
+%type <scm> unsigned_number
 %type <scm> bass_figure
 %type <scm> figured_bass_modification
 %type <scm> br_bass_figure
@@ -854,9 +855,9 @@ alternative_music:
 
 
 repeated_music:
-       REPEAT simple_string bare_unsigned music alternative_music
+       REPEAT simple_string unsigned_number music alternative_music
        {
-               $$ = MAKE_SYNTAX ("repeat", @$, $2, scm_int2num ($3), $4, $5);
+               $$ = MAKE_SYNTAX ("repeat", @$, $2, $3, $4, $5);
        }
        ;
 
@@ -975,7 +976,7 @@ prefix_composite_music:
        generic_prefix_music_scm {
                $$ = run_music_function (PARSER, $1);
        }
-       | CONTEXT    simple_string optional_id optional_context_mod music {
+       | CONTEXT simple_string optional_id optional_context_mod music {
                $$ = MAKE_SYNTAX ("context-specification", @$, $2, $3, $5, $4, SCM_BOOL_F);
        }
        | NEWCONTEXT simple_string optional_id optional_context_mod music {
@@ -1609,7 +1610,7 @@ direction_reqd_event:
 octave_check:
        /**/ { $$ = SCM_EOL; }
        | '='  { $$ = scm_from_int (0); }
-       | '=' sub_quotes { $$ = scm_from_int ($2); }
+       | '=' sub_quotes { $$ = scm_from_int (-$2); }
        | '=' sup_quotes { $$ = scm_from_int ($2); }
        ;
 
@@ -2134,6 +2135,14 @@ bare_unsigned:
        }
        ;
 
+unsigned_number:
+       bare_unsigned  { $$ = scm_from_int ($1); }
+       | NUMBER_IDENTIFIER {
+               $$ = $1;
+       }
+       ;
+       
+
 exclamations:
                { $$ = 0; }
        | exclamations '!'      { $$ ++; }
index 880dc79edfdb4339ab99dba99d54d11338a32f92..da3a8a01dd6f4c2f12100799137da6a19cd7f3a3 100644 (file)
@@ -168,10 +168,10 @@ Pitch::to_string () const
 {
   int n = (notename_ + 2) % scale_->step_tones_.size ();
   string s = ::to_string (char (n + 'a'));
-      Rational qtones = alteration_ * Rational (4,1);
-      int qt = int (rint (Real (qtones)));
+  Rational qtones = alteration_ * Rational (4,1);
+  int qt = int (rint (Real (qtones)));
       
-      s += string (accname[qt + 4]);
+  s += string (accname[qt + 4]);
   if (octave_ >= 0)
     {
       int o = octave_ + 1;
@@ -302,7 +302,9 @@ Pitch::transposed (Pitch d) const
   return p;
 }
 
+Rational NATURAL_ALTERATION (0);
 Rational FLAT_ALTERATION (-1, 2);
+Rational DOUBLE_FLAT_ALTERATION (-1);
 Rational SHARP_ALTERATION (1, 2);
 
 Pitch
index 811decb67d8b0b265b7f5ad48cf890ab5d08a014..2816aa655ef43431aa393ddded48524d1c00a178 100644 (file)
@@ -110,8 +110,7 @@ Pitched_trill_engraver::make_trill (Stream_event *ev)
       trill_accidental_ = make_item ("TrillPitchAccidental", ev->self_scm ());
 
       // fixme: naming -> alterations
-      trill_accidental_->set_property ("alteration", scm_from_int (Rational (4) 
-                                                                  * p->get_alteration ()));
+      trill_accidental_->set_property ("alteration", ly_rational2scm (p->get_alteration ()));
       Side_position_interface::add_support (trill_accidental_, trill_head_);
       
       trill_head_->set_object ("accidental-grob", trill_accidental_->self_scm ());
index b2aeb9b2ab4e72fe492f84114cb1cd1e06cb59a2..d98221e6481de00c3030508162f4770579f3c397 100644 (file)
@@ -93,13 +93,6 @@ Separating_line_group_engraver::finalize ()
   sep_span_->set_bound (RIGHT, unsmob_grob (ccol));
   sep_span_ = 0;
 
-  for (vsize i = 0; i < last_spacings_.note_spacings_.size (); i++)
-    {
-      Pointer_group_interface::add_grob (last_spacings_.note_spacings_[i],
-                                        ly_symbol2scm ("right-items"),
-                                        column);
-    }
-
   if (last_spacings_.staff_spacing_
       && last_spacings_.staff_spacing_->get_column () == column)
     last_spacings_.staff_spacing_->suicide ();
@@ -146,14 +139,8 @@ Separating_line_group_engraver::acknowledge_item (Grob_info i)
          Pointer_group_interface::add_grob (it, ly_symbol2scm ("left-items"),
                                             break_item_);
 
-         if (int i = last_spacings_.note_spacings_.size ())
-           {
-             for (; i--;)
-               Pointer_group_interface::add_grob (last_spacings_.note_spacings_[i],
-                                                  ly_symbol2scm ("right-items"),
-                                                  break_item_);
-           }
-         else if (last_spacings_.staff_spacing_)
+         if (!last_spacings_.note_spacings_.size ()
+             && last_spacings_.staff_spacing_)
            {
              SCM ri = last_spacings_.staff_spacing_->get_object ("right-items");
              Grob_array *ga = unsmob_grob_array (ri);
index 8752d704a0ab1895e4da2ad434bf5c5aaa9b099e..bccee086c57491ec90024ff865f21d1fa9c2d29c 100644 (file)
@@ -784,26 +784,20 @@ Slur_score_state::get_extra_encompass_infos () const
            {
              penalty = parameters_.accidental_collision_;
 
-             SCM alt = g->get_property ("alteration");
+             Rational alt = ly_scm2rational (g->get_property ("alteration"));
              SCM scm_style = g->get_property ("style");
              if (!scm_is_symbol (scm_style)
                  && !to_boolean (g->get_property ("parenthesized"))
                  && !to_boolean (g->get_property ("restore-first")))
                {
                  /* End copy accidental.cc */
-                 switch (scm_to_int (alt))
-                   {
-                   case FLAT:
-                   case DOUBLE_FLAT:
-                     xp = LEFT;
-                     break;
-                   case SHARP:
-                     xp = 0.5 * dir_;
-                     break;
-                   case NATURAL:
-                     xp = -dir_;
-                     break;
-                   }
+                 if (alt == FLAT_ALTERATION
+                     || alt == DOUBLE_FLAT_ALTERATION)
+                   xp = LEFT;
+                 else if (alt == SHARP_ALTERATION)
+                   xp = 0.5 * dir_;
+                 else if (alt == NATURAL_ALTERATION)
+                   xp = -dir_;
                }
            }
 
index 679c2bcb195651dc1954d371c59830d7d447b887..7d86ebf9195ac73a7356e1f187a2807430be2fca 100644 (file)
@@ -132,5 +132,7 @@ ADD_INTERFACE (Spaceable_grob,
               "measure-length "
               "minimum-distances "
               "right-neighbors "
-              "spacing-wishes");
+              "spacing-wishes "
+
+              );
 
index 8f6355b26e024aea3f2e2991662a2435b1b1dc78..052e0d766bf441c64d1d7c71ec0c539be3864c9c 100644 (file)
@@ -39,7 +39,7 @@ is_loose_column (Grob *l, Grob *col, Grob *r, Spacing_options const *options)
   
 
   if ((options->float_nonmusical_columns_
-       ||options->float_grace_columns_)
+       || options->float_grace_columns_)
       && Paper_column::when_mom (col).grace_part_)
     {
       return true;
@@ -104,9 +104,6 @@ is_loose_column (Grob *l, Grob *col, Grob *r, Spacing_options const *options)
     return false;
 
   /*
-    A rather hairy check, but we really only want to move around
-    clefs. (anything else?)
-
     in any case, we don't want to move bar lines.
   */
   extract_grob_set (col, "elements", elts);
@@ -120,9 +117,6 @@ is_loose_column (Grob *l, Grob *col, Grob *r, Spacing_options const *options)
            {
              Grob *h = gelts[j];
 
-             /*
-               ugh. -- fix staff-bar name?
-             */
              if (h && h->get_property ("break-align-symbol") == ly_symbol2scm ("staff-bar"))
                return false;
            }
@@ -234,8 +228,20 @@ Spacing_spanner::prune_loose_columns (Grob *me, vector<Grob*> *cols,
            }
          else
            {
+             Grob *min_item = 0;
+             int min_rank = INT_MAX;
+             for (vsize j = 0; j < right_items.size (); j ++)
+               {
+                 int rank = dynamic_cast<Item*> (right_items[j])->get_column ()->get_rank ();
+                 if (rank < min_rank)
+                   {
+                     min_item = right_items[j];
+                     min_rank = rank;
+                   }
+               }
+             
              c->set_object ("between-cols", scm_cons (lns,
-                                                      right_items[0]->self_scm ()));
+                                                      min_item->self_scm ()));
 
              /*
                Set distance constraints for loose columns
@@ -264,7 +270,7 @@ Spacing_spanner::set_explicit_neighbor_columns (vector<Grob*> const &cols)
     {
       SCM right_neighbors = Grob_array::make_array ();
       Grob_array *rn_arr = unsmob_grob_array (right_neighbors);
-      int min_rank = 100000;   // inf.
+      int min_rank = INT_MAX;
 
       extract_grob_set (cols[i], "spacing-wishes", wishes);
       for (vsize k = wishes.size (); k--;)
@@ -338,8 +344,6 @@ Spacing_spanner::set_implicit_neighbor_columns (vector<Grob*> const &cols)
       if (!Paper_column::is_breakable (it) && !Paper_column::is_musical (it))
        continue;
 
-      // it->breakable || it->musical
-
       /*
        sloppy with typing left/right-neighbors should take list, but paper-column found instead.
       */
index 94bc552e6f799ed47c3b8d9ad9b8668077ea6c43..069ff0e231001d87c423fefeba70c5de82c15912 100644 (file)
@@ -66,9 +66,20 @@ set_loose_columns (System *which, Column_x_positions const *posns)
          loose = right = re->get_column ();
        }
 
-      if (!right->get_system ())
+      if (right->get_system ())
+       ; /* do nothing */
+      else if (right->find_prebroken_piece (LEFT)
+              && right->find_prebroken_piece (LEFT)->get_system () == which)
        right = right->find_prebroken_piece (LEFT);
-
+      else if (Paper_column::get_rank (which->get_bound (RIGHT)) < Paper_column::get_rank (right))
+       
+       right = which->get_bound (RIGHT);
+      else
+       {
+         clique.back ()->programming_error ("Loose column does not have right side to attach to.");
+         right = which->get_bound (RIGHT);
+       }
+      
       Grob *common = right->common_refpoint (left, X_AXIS);
 
       clique.push_back (right);
index fc21f2d6b9597929ee24dd4c888d1a1f7824d027..77185b3bdc9bc07e2c8539a4c97953a01b90a618 100644 (file)
@@ -154,7 +154,7 @@ Stem::last_head (Grob *me)
 Drul_array<Grob *>
 Stem::extremal_heads (Grob *me)
 {
-  const int inf = 1000000;
+  const int inf = INT_MAX;
   Drul_array<int> extpos;
   extpos[DOWN] = inf;
   extpos[UP] = -inf;
index fc0b867e82754dade0f96effd64658363be008f2..063b9b44f9a708c0743031f2df59858c1d28a669 100644 (file)
@@ -782,7 +782,7 @@ AncientRemoveEmptyStaffContext = \context {
 
   %% Select vaticana style font.
   \override KeySignature #'style = #'vaticana
-  \override Accidental #'style = #'vaticana
+  \override Accidental #'glyph-name-alist = #alteration-vaticana-glyph-name-alist
   \override Custos #'style = #'vaticana
   \override Custos #'neutral-position = #3
   \override Custos #'neutral-direction = #DOWN
@@ -793,7 +793,7 @@ AncientRemoveEmptyStaffContext = \context {
   \Voice
   \name "GregorianTranscriptionVoice"
   \alias "Voice"
-
+  
   %% Removing ligature bracket engraver without replacing it by some
   %% other ligature engraver would cause a "Junking event: `LigatureEvent'"
   %% warning for every "\[" and "\]".  Therefore, we make the grob
@@ -885,7 +885,7 @@ AncientRemoveEmptyStaffContext = \context {
   %% Select mensural style font.
   \override TimeSignature #'style = #'mensural
   \override KeySignature #'style = #'mensural
-  \override Accidental #'style = #'mensural
+  \override Accidental #'glyph-name-alist = #alteration-mensural-glyph-name-alist
   \override Custos #'style = #'mensural
   \override Custos #'neutral-position = #3
   \override Custos #'neutral-direction = #DOWN
index 6d46749eefd32a6667e675fffcab45e00b5ed592..b0cb5d4305436e4a0c8c50cb46a43a6e1295ca42 100644 (file)
@@ -29,8 +29,10 @@ png-ln:
        mkdir -p $(outdir)/lilypond
        # makeinfo is broken, it MUST have PNGs in output dir
        # symlinking PNGs...
-       $(foreach i, $(shell find $(depth)/Documentation/user/$(outdir) -maxdepth 1 -name '*.png'), ln -sf ../$(i) $(i:$(depth)/Documentation/user/$(outdir)/%.png=$(outdir)/%.png) &&) true
-       $(foreach i, $(shell find $(depth)/Documentation/user/$(outdir)/lilypond -name '*.png'), ln -sf ../../$(i) $(i:$(depth)/Documentation/user/$(outdir)/%.png=$(outdir)/%.png) &&) true
+
+## cmd too long FIXME / JUNKME.
+## $(foreach i, $(shell find $(depth)/Documentation/user/$(outdir) -maxdepth 1 -name '*.png'), ln -sf ../$(i) $(i:$(depth)/Documentation/user/$(outdir)/%.png=$(outdir)/%.png) &&) true
+##     $(foreach i, $(shell find $(depth)/Documentation/user/$(outdir)/lilypond -name '*.png'), ln -sf ../../$(i) $(i:$(depth)/Documentation/user/$(outdir)/%.png=$(outdir)/%.png) &&) true
 
 # Links referred to by Documentation index
 # BROKEN: the following makes broken symlinks
index 1e60313993a7872e6083194d1ac41d3e7616a265..6c158329815a06c18b5fafb435999102a5b39aca 100644 (file)
@@ -22,14 +22,14 @@ the-script-dir=$(wildcard $(script-dir))
 ABC2LY = $(script-dir)/abc2ly.py
 CONVERT_LY = $(script-dir)/convert-ly.py
 LILYPOND_BOOK = $(script-dir)/lilypond-book.py
-LILYPOND_BOOK_INCLUDES = -I $(src-dir)/ -I $(outdir) -I $(input-dir) -I $(input-dir)/regression/ -I $(input-dir)/manual/ -I $(input-dir)/tutorial/ -I $(top-build-dir)/mf/$(outconfbase)/  -I $(top-build-dir)/mf/out/
+LILYPOND_BOOK_INCLUDES = -I $(src-dir)/ -I $(outdir) -I $(input-dir) -I $(input-dir)/regression/ -I $(input-dir)/manual/ -I $(input-dir)/tutorial/ -I $(top-build-dir)/mf/$(outconfbase)/  -I $(top-build-dir)/mf/out/ -I $(input-dir)/test/ 
 
 ## override from cmd line to speed up. 
 ANTI_ALIAS_FACTOR=2
 LILYPOND_JOBS=$(if $(CPU_COUNT),-djob-count=$(CPU_COUNT),)
 LILYPOND_BOOK_LILYPOND_FLAGS=--backend=eps --formats=ps,png,pdf $(LILYPOND_JOBS) -dinclude-eps-fonts -dgs-load-fonts --header=texidoc -I $(top-src-dir)/input/manual -dcheck-internal-types -ddump-signatures -danti-alias-factor=$(ANTI_ALIAS_FACTOR)
 LILYPOND_BOOK_VERBOSE = --verbose
-LILYPOND_BOOK_FLAGS = --process="$(LILYPOND_BINARY) $(LILYPOND_BOOK_LILYPOND_FLAGS)"  $(LILYPOND_BOOK_VERBOSE)
+LILYPOND_BOOK_FLAGS = --process="$(LILYPOND_BINARY) $(LILYPOND_BOOK_LILYPOND_FLAGS)" $(LILYPOND_BOOK_VERBOSE)
 TEXINPUTS=$(top-src-dir)/tex/::
 export TEXINPUTS
 
index 866bfbbad9f0f992f82ffbbbf21a1f040b616b9b..1492d1790b11ed6b2cf09be839b0d050c5db2e50 100644 (file)
@@ -6,10 +6,9 @@ LOCALSTEPMAKE_TEMPLATES=lilypond
 include $(depth)/make/stepmake.make
 
 
-# hangs on feta23
 MFTRACE_FLAGS=  --simplify
 
-EXTRA_DIST_FILES += README feta.tex
+EXTRA_DIST_FILES += README 
 
 # We don't use $(MF_FILES), because there's more .mf cruft here
 FETA_MF_FILES = $(call src-wildcard,feta[0-9]*.mf)\
@@ -36,11 +35,8 @@ NCSB_INSTALL_DIR=$(local_lilypond_datadir)/fonts/otf
 
 LOG_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.log)
 LISP_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.lisp)
-TEXTABLES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tex)
-ENC_FILES = $(TEXTABLES:.tex=.enc)
-TFM_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tfm)\
- $(SAUTER_FONTS:%=$(outdir)/%.tfm)
-
+ENC_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.enc)
+TFM_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tfm)
 
 ENCODING_FILE=$(findstring $(<F:.mf=.enc), $(FETA_MF_FILES:.mf=.enc))
 MFTRACE_FLAGS=$(if $(ENCODING_FILE),--encoding $(outdir)/$(ENCODING_FILE),) --no-afm
@@ -98,12 +94,12 @@ $(outdir)/aybabtu.subfonts:
 $(PE_SCRIPTS): $(buildscript-dir)/gen-emmentaler-scripts.py
        $(PYTHON) $< --dir=$(outdir)
 
-ALL_FONTS = $(FETA_FONTS) $(SAUTER_FONTS)
+ALL_FONTS = $(FETA_FONTS)
 PFA_FILES = $(ALL_FONTS:%=$(outdir)/%.pfa)
 
 # Make tfm files first, log files last,
 # so that normally log files aren't made twice
-ALL_GEN_FILES= $(TFM_FILES) $(TEXTABLES) $(TFM_FILES) $(LOG_FILES) $(ENC_FILES) $(LISP_FILES) $(OTF_TABLES) $(NCSB_OTFS) $(PFA_FILES) $(OTF_FILES) $(SVG_FILES) 
+ALL_GEN_FILES=$(LOG_FILES) $(ENC_FILES) $(LISP_FILES) $(OTF_TABLES) $(NCSB_OTFS) $(PFA_FILES) $(OTF_FILES) $(SVG_FILES) 
 
 #PRE_INSTALL=$(MAKE) "$(ALL_GEN_FILES)"
 
@@ -112,15 +108,9 @@ INSTALLATION_FILES=$(MF_FILES)
 
 INSTALLATION_OUT_SUFFIXES=1 2 3 4 5 6
 
-INSTALLATION_OUT_DIR1=$(local_lilypond_datadir)/tex
-INSTALLATION_OUT_FILES1=$(TEXTABLES)
-
 INSTALLATION_OUT_DIR2=$(local_lilypond_datadir)/fonts/otf
 INSTALLATION_OUT_FILES2=$(OTF_FILES) $(NCSB_OTFS)
 
-INSTALLATION_OUT_DIR3=$(local_lilypond_datadir)/fonts/tfm
-INSTALLATION_OUT_FILES3=$(TFM_FILES)
-
 INSTALLATION_OUT_DIR4=$(local_lilypond_datadir)/fonts/svg
 INSTALLATION_OUT_FILES4=$(SVG_FILES)
 
@@ -141,7 +131,7 @@ tree-regen:
 
 ##
 ## todo: this also depends on .tfm, FIXME.
-$(outdir)/%.lisp $(outdir)/%.otf-gtable $(outdir)/%.enc  $(outdir)/%.tex $(outdir)/%.dep: $(outdir)/%.log $(outdir)/%.tfm
+$(outdir)/%.lisp $(outdir)/%.otf-gtable $(outdir)/%.enc  $(outdir)/%.tex $(outdir)/%.dep: $(outdir)/%.log
        $(PYTHON) $(buildscript-dir)/mf-to-table.py --global-lisp=$(outdir)/$(<F:.log=.otf-gtable) --lisp=$(outdir)/$(<F:.log=.lisp) --outdir=$(outdir) --dep $(outdir)/$(<F:.log=.dep) --enc $(outdir)/$(<F:.log=.enc) --tex $(outdir)/$(<F:.log=.tex) $<
 
 local-clean:
index 552731486d58724e5f50f2f0a1bd19fcc35d307a..1ade03f2c354ad142a0616ac673b9fd9ccbe1b49 100644 (file)
@@ -4,9 +4,9 @@
 %
 
 %input feta-eindelijk;
-%input feta-toevallig;
+input feta-toevallig;
 %input feta-puntje;
-input feta-bolletjes;  
+%input feta-bolletjes; 
 %input feta-arrow;     
 %input feta-schrift;   
 %input feta-schrift;
index f473e236f0493fe3a9c1b876e609b36aa4677fd7..9b69c5f0a0902e2e2479f2a35d1f8a1283d98577 100644 (file)
@@ -1,12 +1,26 @@
 %
 % feta-toevallig.mf -- implement Accidentals
 %
-% source file of the Feta (Font-En-Tja) music font
-%
 % (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 %
 
 
+%
+% also show in other configuration wrt staff lines.
+%
+def draw_shifted_too =
+if test > 0:
+       fet_beginchar ("shifted too", "");
+               set_char_box (0, 0,0,0);
+               currentpicture := remember_pic;
+
+               draw_staff (-2, 2, 0.5);
+       fet_endchar;
+fi;
+enddef;
+
+
+
 %
 % Accidentals from various sources, notably
 %
 %
 
 
+%
+% Naming for microtonal
+%
+%  BASES SLASHES STEMS
+%  
+%  mirroredflat.flat.slashslash
+%
+
+% standard sharp:
+%  sharp.slashslash.stemstem
+%  sharp.slashslash.stem
+
+
 fet_begingroup ("accidentals");
 
 
 save remember_pic;
 picture remember_pic;
 
+save sharp_beamheight;
+sharp_beamheight# := 0.3 staff_space# + stafflinethickness#;
 
 %
 % The beams of most sharps have horizontal endings (as if drawn with
@@ -29,28 +58,27 @@ picture remember_pic;
 %
 
 def draw_meta_sharp (expr width, offset) =
-       save beamheight, beamwidth, beamslope;
+       save beamwidth, beamslope;
        save ne, nw_dist;
        pair ne, nw_dist;
 
        beamwidth := width;
 
-       beamheight# := 0.3 staff_space# + stafflinethickness#;
-       define_whole_vertical_blacker_pixels (beamheight);
+       define_whole_vertical_blacker_pixels (sharp_beamheight);
 
        clearxy;
 
-       beamslope = beamheight / beamwidth;
+       beamslope = sharp_beamheight / beamwidth;
 
        pickup pencircle scaled 2 blot_diameter;
 
        rt x2 - lft x1 = beamwidth;
-       y2 - y1 = beamheight;
+       y2 - y1 = sharp_beamheight;
        .5 [z1, z3] = (.5 w, offset);
        x3 = x2;
-       top y2 - bot y3 = beamheight;
+       top y2 - bot y3 = sharp_beamheight;
        x4 = x1;
-       top y1 - bot y4 = beamheight;
+       top y1 - bot y4 = sharp_beamheight;
 
        ne = unitvector (z2 - z1);
        nw_dist = (ne rotated 90) * blot_diameter;
@@ -69,7 +97,7 @@ def draw_meta_sharp (expr width, offset) =
 enddef;
 
 
-fet_beginchar ("Sharp", "2");
+fet_beginchar ("Sharp", "sharp");
        save stem, stemx, stemwidth;
        save outer_space, interbeam;
 
@@ -110,21 +138,9 @@ fet_beginchar ("Sharp", "2");
        draw_staff (-2, 2, 0);
 fet_endchar;
 
+draw_shifted_too;
 
-if test > 0:
-       fet_beginchar ("Sharp", "2");
-
-               set_char_box (0, 1.1 staff_space#,
-                             1.5 staff_space#, 1.5 staff_space#);
-
-               currentpicture := remember_pic;
-
-               draw_staff (-2, 2, 0.5);
-       fet_endchar;
-fi;
-
-
-fet_beginchar ("1/2 Sharp", "1");
+fet_beginchar ("1/2 Sharp", "sharp.slashslash.stem");
        save stem, stemwidth;
        save outer_space, interbeam;
 
@@ -160,21 +176,100 @@ fet_beginchar ("1/2 Sharp", "1");
        draw_staff (-2, 2, 0);
 fet_endchar;
 
+draw_shifted_too;
 
-if test > 0:
-       fet_beginchar ("1/2 Sharp", "1");
+fet_beginchar ("Sharp (3 beams)", "sharp.slashslashslash.stemstem");
+       save stem, stemx, stemwidth;
+       save outer_space, interbeam;
+       save sharp_beamheight;
 
-               set_char_box (0, 0.7 staff_space#,
-                             1.5 staff_space#, 1.5 staff_space#);
+       sharp_beamheight# := 0.22 staff_space# + stafflinethickness#;
 
-               currentpicture := remember_pic;
 
-               draw_staff (-2, 2, 0.5);
-       fet_endchar;
-fi;
+       stemwidth# := stafflinethickness# + .05 staff_space#;
+       define_whole_blacker_pixels (stemwidth);
 
+       interbeam := 1.2 staff_space_rounded;
+
+       set_char_box (0, 1.1 staff_space#,
+                     1.5 staff_space#, 1.5 staff_space#);
 
-fet_beginchar ("3/4 Sharp", "3");
+       stem := 7 / 16 * w;
+       stemx := hround stem;
+       outer_space := hround ((w - stemx - stemwidth) / 2);
+
+       w := 2 outer_space + stemx + stemwidth;
+       d := d - feta_space_shift;
+
+       draw_meta_sharp (.88 w, -.5 interbeam);
+       draw_meta_sharp (w, 0);
+       draw_meta_sharp (.88 w, -.5 interbeam + vround interbeam);
+
+       pickup pencircle scaled stemwidth;
+
+       lft x5 = lft x6 = outer_space;
+       lft x7 = lft x8 = outer_space + stemx;
+       bot y5 = -d;
+       top y6 = vround (1.5 staff_space - stem * beamslope);
+       bot y7 = -top y6 + feta_space_shift;
+       top y8 = h;
+
+       labels (5, 6, 7, 8);    
+
+       draw_gridline (z5, z6, stemwidth);
+       draw_gridline (z7, z8, stemwidth);
+
+       remember_pic := currentpicture;
+
+       draw_staff (-2, 2, 0);
+fet_endchar;
+
+draw_shifted_too;
+
+fet_beginchar ("1/2 Sharp (3 beams)", "sharp.slashslashslash.stem");
+       save stem, stemx, stemwidth;
+       save outer_space, interbeam;
+       save sharp_beamheight;
+
+       sharp_beamheight# := 0.22 staff_space# + stafflinethickness#;
+
+       stemwidth# := stafflinethickness# + .05 staff_space#;
+       define_whole_blacker_pixels (stemwidth);
+
+       interbeam := 1.2 staff_space_rounded;
+
+       set_char_box (0, 0.95 staff_space#,
+                     1.3 staff_space#, 1.3 staff_space#);
+
+       stem := 7 / 16 * w;
+       outer_space := hround ((w - stemwidth) / 2);
+       w := 2 outer_space + stemwidth;
+       d := d - feta_space_shift;
+
+       draw_meta_sharp (.8 w, -.5 interbeam);
+       draw_meta_sharp (w, 0);
+       draw_meta_sharp (.8 w, -.5 interbeam + vround interbeam);
+
+       pickup pencircle scaled stemwidth;
+
+       lft x5 = lft x6 = outer_space;
+       top y6 = vround (1.5 staff_space - .5 stem);
+       bot y5 = -top y6 + feta_space_shift;
+       labels (5, 6);
+
+
+       draw_gridline (z5, z6, stemwidth);
+
+
+       remember_pic := currentpicture;
+
+       draw_staff (-2, 2, 0);
+fet_endchar;
+
+draw_shifted_too;
+
+
+fet_beginchar ("3/4 Sharp", "sharp.slashslash.stemstemstem");
        save stem, stemx, stemwidth;
        save outer_space, interbeam;
 
@@ -219,25 +314,15 @@ fet_beginchar ("3/4 Sharp", "3");
        draw_staff (-2, 2, 0);
 fet_endchar;
 
+draw_shifted_too;
 
-if test > 0:
-       fet_beginchar ("3/4 Sharp", "3");
-
-               set_char_box (0, 1.6 staff_space#,
-                             1.5 staff_space#, 1.5 staff_space#);
-
-               currentpicture := remember_pic;
-
-               draw_staff (-2, 2, 0.5);
-       fet_endchar;
-fi;
 
 
 %
 % The stems of the natural are brushed (at least, in Barenreiter SCS)
 %
 
-fet_beginchar ("Natural", "0");
+fet_beginchar ("Natural", "natural");
        save stemwidth, top_stem_thick;
        save ne, pat_top, pat_bottom;
        pair ne;
@@ -324,17 +409,7 @@ fet_beginchar ("Natural", "0");
        draw_staff (-2, 2, 0);
 fet_endchar;
 
-
-if test > 0:
-       fet_beginchar ("Natural", "0");
-               set_char_box (0, 2/3 staff_space#,
-                             1.5 staff_space#, 1.5 staff_space#);
-
-               currentpicture := remember_pic;
-
-               draw_staff (-2, 2, 0.5);
-       fet_endchar;
-fi;
+draw_shifted_too;
 
 
 %
@@ -455,7 +530,7 @@ enddef;
 % unfortunately, 600dpi is not enough to show the brush of the stem.
 %
 
-fet_beginchar ("Flat", "-2");
+fet_beginchar ("Flat", "flat");
        set_char_box (1.2 stafflinethickness#, .8 staff_space#,
                      0.6 staff_space#, 1.9 staff_space#);
 
@@ -467,20 +542,74 @@ fet_beginchar ("Flat", "-2");
        draw_staff (-2, 2, 0);
 fet_endchar;
 
+draw_shifted_too;
 
-if test > 0:
-       fet_beginchar ("Flat", "-2");
-               set_char_box (1.2 stafflinethickness#, .8 staff_space#,
-                             0.6 staff_space#, 1.9 staff_space#);
+fet_beginchar ("Flat (slashed)", "flat.slash");
+       set_char_box (1.2 stafflinethickness#, .8 staff_space#,
+                     0.6 staff_space#, 1.9 staff_space#);
 
-               currentpicture := remember_pic;
+       draw_meta_flat (0, w, 0.31 staff_space);
+       clearxy;
+       save slope, slash_width;
+       slope = 0.5;
+       slash_width = w;
+       z1 = (0, h / 2);
+       z2 = z1 - (slash_width, slash_width * slope)/2;
+       z3 = z1 + (slash_width, slash_width * slope)/2;
+
+       pickup pencircle scaled 1.5 stafflinethickness;
+       draw  z2 .. z3;
+       labels (1, 2, 3);
+       remember_pic := currentpicture;
 
-               draw_staff (-2, 2, 0.5);
-       fet_endchar;
-fi;
+       draw_staff (-2, 2, 0);
+fet_endchar;
+
+fet_beginchar ("Flat (slashed twice)", "flat.slashslash");
+       set_char_box (1.2 stafflinethickness#, .8 staff_space#,
+                     0.6 staff_space#, 1.9 staff_space#);
+
+       draw_meta_flat (0, w, 0.31 staff_space);
+       clearxy;
+       save slope, slash_width;
+
+       slope = 0.5;
+       slash_width = w;
+       pickup pencircle scaled 1.5 stafflinethickness;
+
+       z1 = (0, 5/12 h);
+       z2 = (0, 2/3 h);
+       draw z1 - (slash_width, slash_width * slope)/2
+               .. z1 + (slash_width, slash_width * slope)/2;
+       draw z2 - (slash_width, slash_width * slope)/2
+               .. z2 + (slash_width, slash_width * slope)/2;
+       labels (1, 2);
+       remember_pic := currentpicture;
+
+       draw_staff (-2, 2, 0);
+fet_endchar;
+
+fet_beginchar ("Flatflat (mirrored)", "mirroredflat.flat");
+       set_char_box (0, 1.6 staff_space#, 
+                     0.6 staff_space#, 1.9 staff_space#);
 
+       draw_meta_flat (0, w/2, 0.31 staff_space);
+       currentpicture := currentpicture xscaled -1;
+       draw_meta_flat (0, w/2, 0.31 staff_space);
+
+       currentpicture := currentpicture shifted (w/2,0);
+       penlabels (range 0 thru 11);
 
-fet_beginchar ("Semi flat", "-1");
+       remember_pic := currentpicture;
+
+       draw_staff (-2, 2, 0);
+fet_endchar;
+
+draw_shifted_too;
+
+
+
+fet_beginchar ("Semi flat", "mirroredflat");
        set_char_box (1.2 stafflinethickness#, .8 staff_space#,
                      0.6 staff_space#, 1.9 staff_space#);
 
@@ -489,7 +618,7 @@ fet_beginchar ("Semi flat", "-1");
 fet_endchar;
 
 
-fet_beginchar ("Double Flat", "-4");
+fet_beginchar ("Double Flat", "flatflat");
        save left_wid, overlap, right_wid;
 
        left_wid = .7;
@@ -505,7 +634,7 @@ fet_beginchar ("Double Flat", "-4");
 fet_endchar;
 
 
-fet_beginchar ("3/4 Flat", "-3");
+fet_beginchar ("3/4 Flat", "flatflat.slash");
        save left_wid, overlap, right_wid;
 
        left_wid = .7;
@@ -549,27 +678,9 @@ fet_beginchar ("3/4 Flat", "-3");
        draw_staff (-2, 2, 0);
 fet_endchar;
 
+draw_shifted_too;
 
-if test > 0:
-       fet_beginchar ("3/4 Flat", "-3");
-               save left_wid, overlap, right_wid;
-
-               left_wid = .7;
-               right_wid = .8;
-               overlap = .05;
-
-               set_char_box (1.2 stafflinethickness#,
-                             (left_wid + right_wid - overlap) * staff_space#,
-                             .6 staff_space#, 1.9 staff_space#);
-
-               currentpicture := remember_pic;
-
-               draw_staff (-2, 2, 0.5);
-       fet_endchar;
-fi;
-
-
-fet_beginchar ("Double Sharp", "4");
+fet_beginchar ("Double Sharp", "doublesharp");
        save klaverblad, klaversteel;
        save pat;
        path pat;
@@ -622,18 +733,7 @@ fet_beginchar ("Double Sharp", "4");
        draw_staff (-2, 2, 0);
 fet_endchar;
 
-
-if test > 0:
-       fet_beginchar ("Double Sharp", "4");
-               set_char_box (0, staff_space#,
-                             .5 staff_space#, .5 staff_space#);
-
-               currentpicture := remember_pic;
-
-               draw_staff (-2, 2, 0.5);
-       fet_endchar;
-fi;
-
+draw_shifted_too;
 
 def draw_paren =
        save leftindent;
@@ -671,17 +771,7 @@ fet_beginchar ("Right Parenthesis", "rightparen");
        draw_staff (-2, 2, 0);
 fet_endchar;
 
-
-if test > 0:
-       fet_beginchar ("Right Parenthesis", "rightparen");
-               draw_paren;
-               penlabels (1, 2, 3);
-
-               remember_pic := currentpicture;
-
-               draw_staff (-2, 2, 0.5);
-       fet_endchar;
-fi;
+draw_shifted_too;
 
 
 fet_beginchar ("Left Parenthesis", "leftparen");
@@ -692,5 +782,4 @@ fet_beginchar ("Left Parenthesis", "leftparen");
        set_char_box (charwd, charbp, chardp, charht);
 fet_endchar;
 
-
 fet_endgroup ("accidentals");
diff --git a/mf/feta.tex b/mf/feta.tex
deleted file mode 100644 (file)
index bd47bfd..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-% display all feta chars in a pretty picture
-% GNU LilyPond
-% (c) 1998--2006 Jan Nieuwenhuizen <janneke@gnu.org>
-%
-% urg: fool ls-latex
-\def\urg{
-\title{The Feta font}
-\author{JCN}
-\begin{document}
-}
-
-
-\parindent0pt
-\nopagenumbers
-\newcount\n
-\newcount\i
-
-\font\fetatwenty = feta20
-\font\fetanumber = feta-nummer12
-\font\fetafinger = feta-nummer5
-\font\fetadyn = feta-din10 scaled \magstep 2
-\font\titlefont = cmbx12 scaled \magstep 4
-\font\subtitle = cmr9
-
-\def\lilyfooter{Lily was here}
-\def\setchar#1#2{\hbox to\charwidth{\hss{#1\char#2}\hss}}
-
-\def\charsperline{6}
-\def\charheight{55pt}
-\def\charwidth{60pt}
-
-\def\listfont#1#2#3{
-        \n=#2
-        \advance\n by-1
-        \advance\n by-\charsperline
-        \loop\ifnum\n<#3
-        \advance\n by\charsperline
-        \i=0
-        {\vbox to\charheight{\vss\centerline{
-        {\loop\ifnum\i<\charsperline
-        \advance\i by1
-        \advance\n by1
-        {\setchar{#1}{\number\n}}
-        \repeat}}}}\repeat}
-
-\def\title#1{\centerline{\titlefont #1}}
-\def\author#1{\centerline{#1}}
-
-\title{FETA}
-
-\centerline{\subtitle (definitely not an abbreviation for Font-En-Tja)}
-
-\author{Han-Wen Nienhuys and Jan Nieuwenhuizen}
-
-
-\vskip5mm
-
-\listfont{\fetatwenty}{0}{105}
-% urg
-\vskip-\charheight
-\listfont{\fetanumber}{48}{58}
-\vskip-\charheight
-\listfont{\fetafinger}{48}{58}
-\vskip-\charheight
-\listfont{\fetadyn}{0}{6}
-\vskip-\charheight
-
-\lilyfooter
-
-\bye
index 165e0a52d8ecfbce4aacc87358256f400929d619..d6b89e777d67c0252de6873d77f56176d4999b99 100644 (file)
@@ -2892,13 +2892,38 @@ def conv (str):
                    "AccidentalCautionary #'font-size = #-2", str)
     str = re.sub ("Accidental\s*#'cautionary-style\s*=\s*#'parentheses",
                    "AccidentalCautionary #'parenthesized = ##t", str)
-
     str = re.sub ("([A-Za-z]+)\s*#'cautionary-style\s*=\s*#'parentheses",
                    r"\1 #'parenthesized = ##t", str)
     str = re.sub ("([A-Za-z]+)\s*#'cautionary-style\s*=\s*#'smaller",
                    r"\1 #'font-size = #-2", str)
-
+    
     return str
 
-conversions.append (((2, 11, 5), conv, """ly:clone-parser -> ly:parser-clone"""))
+conversions.append (((2, 11, 5), conv, """deprecate cautionary-style. Use AccidentalCautionary properties"""))
+
+                    
 
+
+def conv (str):
+    
+    def sub_acc_name (m):
+        idx = int (m.group (1).replace ('M','-'))
+        
+        return ["accidentals.doublesharp",
+                "accidentals.sharp.slashslash.stemstemstem",
+                "accidentals.sharp",
+                "accidentals.sharp.slashslash.stem",
+                "accidentals.natural",
+                "accidentals.mirroredflat",
+                "accidentals.flat",
+                "accidentals.mirroredflat.flat",
+                "accidentals.flatflat"][4-idx]
+
+    str = re.sub (r"accidentals[.](M?[-0-9]+)",
+                  sub_acc_name, str) 
+    str = re.sub (r"(KeySignature|Accidental[A-Za-z]*)\s*#'style\s*=\s*#'([a-z]+)",
+                  r"\1 #'glyph-name-alist = #alteration-\2-glyph-name-alist", str)
+            
+    return str
+
+conversions.append (((2, 11, 6), conv, """Rename accidental glyphs, use glyph-name-alist."""))
index 33f82c95018c7324839f72d2efb2aedaea673e27..c941d50bda8d2acd3cf032ad397c8d728c441c6a 100644 (file)
@@ -21,8 +21,7 @@
        0.3
        0.6)
     (make-musicglyph-markup
-     (format "accidentals.~a"
-            (inexact->exact (* 4 alteration)))))))
+     (assoc-get alteration standard-alteration-glyph-name-alist "")))))
   
 (define (accidental->markup alteration)
   "Return accidental markup for ALTERATION."
index fe584ad40dca4cc6cdbcfe1a74aa3570fc34dbe9..49367101724cc0ad4ba1eaa41a5da37c8b9d352d 100644 (file)
 (ly:add-interface
  'trill-pitch-accidental-interface
  "An accidental for trill pitch"
- '(accidentals))
+ '()
+ )
 
 (ly:add-interface
  'rhythmic-grob-interface
index 7ae1a0e4fe3d42e9ef0b573c63563496851f1753..9451952dcb6462c8853d41b8d8ae959928737dd7 100644 (file)
@@ -186,6 +186,7 @@ typeset. Valid choices depend on the function that is reading this
 property.")
      (gap ,ly:dimension? "Size of a gap in a variable symbol.")
      (gap-count ,integer? "Number of gapped beams for tremolo.")
+     (glyph-name-alist ,list? "Alist of key-string pairs.")
      (grow-direction ,ly:dir? "Crescendo or decrescendo?")
      (hair-thickness ,number? "Thickness of the thin line in a bar line.")
      (head-direction ,ly:dir? "Are the note heads left or right in a semitie?")
@@ -246,10 +247,14 @@ multimeasure rest.")
 note heads in collisions, even if they have different note heads. The
 smaller of the two heads will be rendered invisible. This used
 polyphonic guitar notation. The value of this setting is used by
-@internalsref{note-collision-interface} .")
+@internalsref{note-collision-interface} .
+merge-differently-headed only applies to opposing stem dirs
+(ie. Voice 1 & 2).")
      (merge-differently-dotted ,boolean? "Merge note heads in
 collisions, even if they have a different number of dots. This normal
-notation for some types of polyphonic music. ")
+notation for some types of polyphonic music.
+merge-differently-dotted only applies to opposing stem dirs
+(ie. Voice 1 & 2).")
      (minimum-length-fraction ,number? "Minimum length of ledger line as fraction of note head size.")
      (minimum-distance ,ly:dimension? "Minimum distance between rest
 and notes or beam.")
index 6080fb021b1939c369318b67ddb1e839d824ead1..c4246b6589e5097c0626314e37b5f0338edc63ef 100644 (file)
@@ -20,8 +20,9 @@
     (Accidental
      . (
        (avoid-slur . inside)
+       (glyph-name-alist . ,standard-alteration-glyph-name-alist)
+       (alteration . ,accidental-interface::calc-alteration) 
        (stencil . ,ly:accidental-interface::print)
-       (stencils . ,ly:accidental-interface::calc-stencils)
        (after-line-breaking
         . ,ly:accidental-interface::after-line-breaking)
        (meta . ((class . Item)
@@ -31,8 +32,9 @@
      . (
        (avoid-slur . inside)
        (parenthesized . #t)
+       (glyph-name-alist . ,standard-alteration-glyph-name-alist)
+       (alteration . ,accidental-interface::calc-alteration) 
        (stencil . ,ly:accidental-interface::print)
-       (stencils . ,ly:accidental-interface::calc-stencils)
        (after-line-breaking
         . ,ly:accidental-interface::after-line-breaking)
        (meta . ((class . Item)
                        ,(ly:make-simple-closure (list ly:self-alignment-interface::x-aligned-on-self)))))
        (self-alignment-X . ,CENTER)
        (font-size . -2)
+       (glyph-name-alist . ,standard-alteration-glyph-name-alist)
+       (alteration . ,accidental-interface::calc-alteration)
        (Y-offset . ,ly:side-position-interface::y-aligned-side)
        (direction . ,UP)
        (staff-padding . 0.25)
        (outside-staff-priority . 0)
        (script-priority . 0)
-       (stencils . ,ly:accidental-interface::calc-stencils)
        (side-axis . ,X)
        (meta . ((class . Item)
                 (interfaces . (side-position-interface
        (X-offset . ,ly:side-position-interface::x-aligned-side)
        (direction . ,LEFT)
        (stencil . ,ly:accidental-interface::print)
-       (stencils . ,ly:accidental-interface::calc-stencils)
-       
+       (glyph-name-alist . ,standard-alteration-glyph-name-alist)      
        (after-line-breaking . ,ly:accidental-interface::after-line-breaking)
        (side-axis . ,X)
        (meta . ((class . Item)
     (KeyCancellation
      . (
        (stencil . ,ly:key-signature-interface::print)
+       (glyph-name-alist . ,cancellation-glyph-name-alist)
        (space-alist . (
                        (time-signature . (extra-space . 1.25))
                        (staff-bar . (extra-space . 0.6))
      . (
        (stencil . ,ly:key-signature-interface::print)
        (avoid-slur . inside)
+       (glyph-name-alist . ,standard-alteration-glyph-name-alist)
        (space-alist . (
                        (time-signature . (extra-space . 1.15))
                        (staff-bar . (extra-space . 1.1))
        (font-size . -4)
        (side-axis . ,X)
        (stencil . ,ly:accidental-interface::print)
-       (stencils . ,ly:accidental-interface::calc-stencils)
+       (glyph-name-alist . ,standard-alteration-glyph-name-alist)
        (meta . ((class . Item)
                 (interfaces . (item-interface
                                trill-pitch-accidental-interface
index 191b24422f826fc56bf319545b0cc781ad51d264..436d2c23781b33ab1133e3f9a0f1d77cdf159ca0 100644 (file)
@@ -1032,39 +1032,40 @@ recommend font for this is bold and italic"
 (define-builtin-markup-command (doublesharp layout props) ()
   "Draw a double sharp symbol."
 
-  (interpret-markup layout props (markup #:musicglyph "accidentals.4")))
+  (interpret-markup layout props (markup #:musicglyph (assoc-get 1 standard-alteration-glyph-name-alist ""))))
 
 (define-builtin-markup-command (sesquisharp layout props) ()
   "Draw a 3/2 sharp symbol."
-  (interpret-markup layout props (markup #:musicglyph "accidentals.3")))
+  (interpret-markup layout props (markup #:musicglyph (assoc-get 3/4 standard-alteration-glyph-name-alist ""))))
+                                        
 
 (define-builtin-markup-command (sharp layout props) ()
   "Draw a sharp symbol."
-  (interpret-markup layout props (markup #:musicglyph "accidentals.2")))
+  (interpret-markup layout props (markup #:musicglyph (assoc-get 1/2 standard-alteration-glyph-name-alist ""))))
 
 (define-builtin-markup-command (semisharp layout props) ()
   "Draw a semi sharp symbol."
-  (interpret-markup layout props (markup #:musicglyph "accidentals.1")))
+  (interpret-markup layout props (markup #:musicglyph (assoc-get 1/4 standard-alteration-glyph-name-alist ""))))
 
 (define-builtin-markup-command (natural layout props) ()
   "Draw a natural symbol."
-  (interpret-markup layout props (markup #:musicglyph "accidentals.0")))
+  (interpret-markup layout props (markup #:musicglyph (assoc-get 0 standard-alteration-glyph-name-alist ""))))
 
 (define-builtin-markup-command (semiflat layout props) ()
   "Draw a semiflat."
-  (interpret-markup layout props (markup #:musicglyph "accidentals.M1")))
+  (interpret-markup layout props (markup #:musicglyph (assoc-get -1/4 standard-alteration-glyph-name-alist ""))))
 
 (define-builtin-markup-command (flat layout props) ()
   "Draw a flat symbol."
-  (interpret-markup layout props (markup #:musicglyph "accidentals.M2")))
+  (interpret-markup layout props (markup #:musicglyph (assoc-get -1/2 standard-alteration-glyph-name-alist ""))))
 
 (define-builtin-markup-command (sesquiflat layout props) ()
   "Draw a 3/2 flat symbol."
-  (interpret-markup layout props (markup #:musicglyph "accidentals.M3")))
+  (interpret-markup layout props (markup #:musicglyph (assoc-get -3/4 standard-alteration-glyph-name-alist ""))))
 
 (define-builtin-markup-command (doubleflat layout props) ()
   "Draw a double flat symbol."
-  (interpret-markup layout props (markup #:musicglyph "accidentals.M4")))
+  (interpret-markup layout props (markup #:musicglyph (assoc-get -1 standard-alteration-glyph-name-alist ""))))
 
 (define-builtin-markup-command (with-color layout props color arg) (color? markup?)
   "Draw @var{arg} in color specified by @var{color}"
@@ -1098,7 +1099,7 @@ recommend font for this is bold and italic"
 
 (define-builtin-markup-command (musicglyph layout props glyph-name) (string?)
   "This is converted to a musical symbol, e.g. @code{\\musicglyph
-#\"accidentals.0\"} will select the natural sign from the music font.
+#\"accidentals.natural\"} will select the natural sign from the music font.
 See @usermanref{The Feta font} for  a complete listing of the possible glyphs."
   (ly:font-get-glyph
    (ly:paper-get-font layout (cons '((font-encoding . fetaMusic))
@@ -1167,30 +1168,42 @@ figured bass notation"
        (num-x (interval-widen (ly:stencil-extent number-stencil X)
                              (* mag 0.2)))
        (num-y (ly:stencil-extent number-stencil Y))
-       (slash-stencil 
-       (ly:make-stencil
-        `(draw-line
-          ,thickness
-          ,(car num-x) ,(- (interval-center num-y) dy)
-          ,(cdr num-x) ,(+ (interval-center num-y) dy))
-        num-x num-y
-        )))
-
-    (ly:stencil-add number-stencil
-                   (cond
-                    ((= num 5) (ly:stencil-translate slash-stencil
-                                                     ;;(cons (* mag -0.05) (* mag 0.42))
-                                                     (cons (* mag -0.00) (* mag -0.07))
-
-                                                     ))
-                    ((= num 7) (ly:stencil-translate slash-stencil
-                                                     ;;(cons (* mag -0.05) (* mag 0.42))
-                                                     (cons (* mag -0.00) (* mag -0.15))
-
-                                                     ))
-                    
-                    (else slash-stencil)))
-    ))
+       (is-sane (and (interval-sane? num-x) (interval-sane? num-y)))
+       
+       (slash-stencil
+       (if is-sane
+           (ly:make-stencil
+            `(draw-line
+              ,thickness
+              ,(car num-x) ,(- (interval-center num-y) dy)
+              ,(cdr num-x) ,(+ (interval-center num-y) dy))
+            num-x num-y)
+           #f)))
+
+    (set! slash-stencil
+         (cond
+          ((not (ly:stencil? slash-stencil)) #f)
+          ((= num 5) (ly:stencil-translate slash-stencil
+                                           ;;(cons (* mag -0.05) (* mag 0.42))
+                                           (cons (* mag -0.00) (* mag -0.07))
+
+                                           ))
+          ((= num 7) (ly:stencil-translate slash-stencil
+                                           ;;(cons (* mag -0.05) (* mag 0.42))
+                                           (cons (* mag -0.00) (* mag -0.15))
+
+                                           ))
+          
+          (else slash-stencil)))
+
+    (if slash-stencil
+       (set! number-stencil
+             (ly:stencil-add number-stencil slash-stencil))
+       
+       (ly:warning "invalid number for slashed digit ~a" num))
+
+
+    number-stencil))
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; the note command.
index 23d0f10dfc1ebc00074b507b6df9c0136a609147..5ea57cc7fc570e56d643082ae86ebf1bc0733c53 100644 (file)
   (let*
       ((xext (ly:stencil-extent dump-me X))
        (yext (ly:stencil-extent dump-me Y))
-       (left-overshoot (ly:get-option 'eps-box-padding))
+       (padding (ly:get-option 'eps-box-padding))
+       (left-overshoot (if (number? padding)
+                          (* -1 padding (ly:output-def-lookup paper 'mm))
+                          #f))
        (bbox
        (map
         (lambda (x)
index 7f73a3dfde450fd001649cb109fce4dab437bd92..bd6a95be446af7e8eca09ce7d145dad1d7465261 100644 (file)
@@ -29,18 +29,21 @@ ensure that all refs to parsed objects are dead.  This is an internal option, an
              (debug-skylines #f "debug skylines")
              (delete-intermediate-files #f
                                         "delete unusable PostScript files")
-             (dump-signatures #f "dump output signatures of each system")
+             (dump-profile #f "dump timing information for each file")
              (dump-tweaks #f "dump page layout and tweaks for each score having the tweak-key layout property set.")
+             (dump-signatures #f "dump output signatures of each system")
+             
+             (eps-box-padding #f "Pad EPS bounding box left edge by this much to guarantee alignment between systems")
+
              (gs-load-fonts #f
                            "load fonts via Ghostscript.")
+             (gui #f "running from gui; redirect stderr to log file")
+
              (include-book-title-preview #t "include book-titles in preview images.")
              (include-eps-fonts #t "Include fonts in separate-system EPS files.")
              (job-count #f "Process in parallel") 
-
-             (eps-box-padding #f "Pad EPS bounding box left edge by this much to guarantee alignment between systems")
-
-             (gui #f "running from gui; redirect stderr to log file")
              (log-file #f "redirect output to log FILE.log")
+
              (old-relative #f
                            "relative for simultaneous music works
 similar to chord syntax")
@@ -348,6 +351,33 @@ The syntax is the same as `define*-public'."
        (,symbol? . "symbol")
        (,vector? . "vector")))
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; timing
+
+(define (profile-measurements)
+  (let* ((t (times))
+        (stats (gc-stats)))
+
+    (list
+     (- (+ (tms:utime t)
+          (tms:stime t))
+       (ly:assoc-get 'gc-time-taken stats))
+
+     ;; difficult to put memory amount stats into here.
+     
+     )))
+
+(define (dump-profile name last this)
+  (let*
+      ((outname (format "~a.profile" (basename name ".ly")))
+       (diff (map (lambda (y) (apply - y)) (zip this last))))
+    
+    (display diff)
+    (ly:progress "\nWriting timing to ~a..." outname)
+    (format (open-file outname "w")
+           "time: ~a"
+           (car diff))))
+
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; debug mem leaks
@@ -540,19 +570,20 @@ The syntax is the same as `define*-public'."
        ))
   
   (let* ((failed '())
-        (first #t)
+        (start-measurements #f)
         (handler (lambda (key failed-file)
                    (set! failed (append (list failed-file) failed)))))
 
     (for-each
      (lambda (x)
 
-       ;; We don't carry info across file boundaries
-       (if first
-          (set! first #f)
-          (gc))
-       
+       (gc)
+       (set! start-measurements (profile-measurements))
        (lilypond-file handler x)
+       (if (ly:get-option 'dump-profile)
+          (dump-profile x start-measurements (profile-measurements)))
+       
+       
        (ly:clear-anonymous-modules)
        (if (ly:get-option 'debug-gc)
           (dump-gc-protects)
index 37f965d94ff7e877827df9520987c04778ae4d52..19f3c613459ad8f0f3aef8e5e5a00d1f1801984d 100644 (file)
@@ -303,16 +303,120 @@ centered, X==1 is at the right, X == -1 is at the left."
 (define-public darkmagenta '(0.5 0.0 0.5))
 (define-public darkyellow  '(0.5 0.5 0.0))
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; key signature
+
+
+(define-public (key-signature-interface::alteration-position step alter c0-position)
+  ;; TODO: memoize - this is mostly constant.
+  
+  ;; fes, ges, as and bes typeset in lower octave
+  (define FLAT_TOP_PITCH 2)
+  
+  ;; ais and bis typeset in lower octave
+  (define SHARP_TOP_PITCH 4)
+
+  (if (pair? step)
+      (+ (cdr step) (* (car step) 7)  c0-position)
+      (let*
+         ((from-bottom-pos (modulo (+ 4 49 c0-position)  7))
+          (p step)
+          (c0 (- from-bottom-pos  4)))
+       
+       (if
+        (or (and (< alter 0) (or (> p FLAT_TOP_PITCH) (> (+ p c0) 4)) (> (+ p c0) 1))
+            (and (> alter 0) (or (> p SHARP_TOP_PITCH) (> (+ p c0) 5)) (> (+ p c0) 2))
+            )
+
+        ;; Typeset below c_position 
+        (set! p (- p 7)))
+
+       ;; Provide for the four cases in which there's a glitch
+       ;; it's a hack, but probably not worth
+       ;; the effort of finding a nicer solution.
+       ;; --dl. 
+       (cond
+        ((and (= c0 2) (= p 3) (> alter 0))
+         (set! p (- p 7)))
+        ((and (= c0 -3) (= p -1) (> alter 0))
+         (set! p (+ p 7)))
+        ((and (= c0 -4) (= p -1) (< alter 0))
+         (set! p (+ p 7)))
+        ((and (= c0 -2) (= p -3) (< alter 0))
+         (set! p (+ p 7))))
+
+       (+ c0 p))))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; accidentals
+
+(define-public (accidental-interface::calc-alteration grob)
+  (ly:pitch-alteration  (ly:event-property (event-cause grob) 'pitch)))
+
+
+(define-public cancellation-glyph-name-alist
+  '((0 . "accidentals.natural")))
+
+(define-public standard-alteration-glyph-name-alist
+     '(
+       ;; ordered for optimal performance.
+       (0 . "accidentals.natural")
+       (-1/2 . "accidentals.flat")
+       (1/2 . "accidentals.sharp")
+
+       (1 . "accidentals.doublesharp")
+       (-1 . "accidentals.flatflat")
+       
+       (3/4 . "accidentals.sharp.slashslash.stemstemstem")
+       (1/4 . "accidentals.sharp.slashslash.stem")
+       (-1/4 . "accidentals.mirroredflat")
+       (-3/4 . "accidentals.mirroredflat.flat")
+       ))
+
+(define-public makam-alteration-glyph-name-alist
+     '((1 . "accidentals.doublesharp")
+       (8/9 . "accidentals.sharp.slashslashslash.stemstem")
+       (5/9 . "accidentals.sharp.slashslashslash.stem")
+       (4/9 . "accidentals.sharp")
+       (1/9 . "accidentals.sharp.slashslash.stem")
+       (0 . "accidentals.natural")
+       (-1/9 . "accidentals.mirroredflat")
+       (-4/9 . "accidentals.flat.slash")
+       (-5/9 . "accidentals.flat")
+       (-8/9 . "accidentals.flat.slashslash")
+       (-1 . "accidentals.flatflat")
+       ))
+  
+(define-public alteration-hufnagel-glyph-name-alist
+   '((1/2 . "accidentals.hufnagel-1")
+     (0 . "accidentals.vaticana0")
+     (-1/2 . "accidentals.mensural1")))
+
+(define-public alteration-medicaea-glyph-name-alist
+   '((1/2 . "accidentals.medicaea-1")
+     (0 . "accidentals.vaticana0")
+     (-1/2 . "accidentals.mensural1")))
+
+(define-public alteration-vaticana-glyph-name-alist
+   '((1/2 . "accidentals.vaticana-1")
+     (0 . "accidentals.vaticana0")
+     (-1/2 . "accidentals.mensural1")))
+
+(define-public alteration-mensural-glyph-name-alist
+   '((1/2 . "accidentals.mensural-1")
+     (0 . "accidentals.vaticana0")
+     (-1/2 . "accidentals.mensural1")))
+
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; * Pitch Trill Heads
 ;; * Parentheses
 
 (define-public (parentheses-item::calc-parenthesis-stencils grob)
-  (let* (
-        (font (ly:grob-default-font grob))
+  (let* ((font (ly:grob-default-font grob))
         (lp (ly:font-get-glyph font "accidentals.leftparen"))
-        (rp (ly:font-get-glyph font "accidentals.rightparen"))
-        )
+        (rp (ly:font-get-glyph font "accidentals.rightparen")))
 
     (list lp rp)))
 
index a50f82d639da8dfd80e8e15be14d738e9d6a4643..9a65b0c5e56729714378bf9cefba074b1367abc4 100644 (file)
   (/ (round (* 10000 num)) 10000))
 
 (define (str4 num)
-  (format #f "~f" (round4 num)))
+  (if (or (nan? num) (inf? num))
+      (begin
+       (ly:warning (_ "Found infinity or nan in output. Substituting 0.0"))
+       "0.0")
+      (format #f "~f" (round4 num))))
 
 (define (number-pair->string4 numpair)
-  (format #f "~f ~f" (round4 (car numpair)) (round4 (cdr numpair))))
+  (string-append (str4 (car numpair))
+                " "
+                (str4 (cdr numpair))))
 
 (define (numbers->string4 numlist)
   (string-join (map str4 numlist) " "))
index 472101b8b53338edd2d542bcd60c0feee1ea9e57..89a974879e22128165354704774a373f07ef384a 100644 (file)
@@ -80,7 +80,6 @@ _ ("Process LilyPond snippets in hybrid HTML, LaTeX, texinfo or DocBook document
 authors = ('Jan Nieuwenhuizen <janneke@gnu.org>',
       'Han-Wen Nienhuys <hanwen@xs4all.nl>')
 
-    
 ################################################################
 def exit (i):
     if global_options.verbose:
@@ -139,11 +138,19 @@ def get_option_parser ():
                   metavar=_ ("DIR"),
                   action='append', dest='include_path',
                   default=[os.path.abspath (os.getcwd ())])
+
+    p.add_option ('--left-padding', 
+                  metavar=_("PAD"),
+                  dest="padding_mm",
+                  help="Pad left side of music to align music inspite of uneven bar numbers. (in mm)",
+                  type="float",
+                  default=3.0)
     
     p.add_option ("-o", '--output', help=_ ("write output to DIR"),
                   metavar=_ ("DIR"),
                   action='store', dest='output_name',
                   default='')
+    
     p.add_option ('-P', '--process', metavar=_ ("COMMAND"),
                   help = _ ("process ly_files using COMMAND FILE..."),
                   action='store', 
@@ -698,6 +705,8 @@ PREAMBLE_LY = '''%%%% Generated by %(program_name)s
   #(define dump-extents #t)
   %(font_dump_setting)s
   %(paper_string)s
+  force-assignment = #""
+  line-width = #(- line-width (* mm  %(padding_mm)f))
 }
 
 \layout {
@@ -1052,7 +1061,7 @@ class Lilypond_snippet (Snippet):
                       '\n  ') % vars ()
         preamble_string = string.join (compose_dict[PREAMBLE],
                        '\n  ') % override
-        
+        padding_mm = global_options.padding_mm
         font_dump_setting = ''
         if FONTLOAD in self.option_dict:
             font_dump_setting = '#(define-public force-eps-font-include #t)\n'
@@ -1762,6 +1771,22 @@ def do_options ():
         
     return args
 
+def psfonts_warning (options, basename):
+    if options.format in (TEXINFO, LATEX):
+        psfonts_file = os.path.join (options.output_name, basename + '.psfonts')
+        output = os.path.join (options.output_name, basename +  '.dvi' )
+
+        if not options.create_pdf:
+            if not options.psfonts:
+                warning (_ ("option --psfonts not used"))
+                warning (_ ("processing with dvips will have no fonts"))
+            else:
+                progress ('\n')
+                progress (_ ("DVIPS usage:"))
+                progress ('\n')
+                progress ("    dvips -h %(psfonts_file)s %(output)s" % vars ())
+                progress ('\n')
+
 def main ():
     # FIXME: 85 lines of `main' macramee??
     files = do_options ()
@@ -1790,15 +1815,16 @@ def main ():
     if global_options.format in (TEXINFO, LATEX):
         ## prevent PDF from being switched on by default.
         global_options.process_cmd += ' --formats=eps '
-        
-    if (global_options.format in (TEXINFO, LATEX)
-        and global_options.create_pdf):
-        global_options.process_cmd += "--pdf -dinclude-eps-fonts -dgs-load-fonts "
+        if global_options.create_pdf:
+            global_options.process_cmd += "--pdf -dinclude-eps-fonts -dgs-load-fonts "
     
     if global_options.verbose:
         global_options.process_cmd += " --verbose "
 
-    global_options.process_cmd += " -dread-file-list -deps-box-padding=-3 "
+    if global_options.padding_mm:
+        global_options.process_cmd += " -deps-box-padding=%f " % global_options.padding_mm
+        
+    global_options.process_cmd += " -dread-file-list "
 
     identify ()
 
@@ -1822,19 +1848,7 @@ def main ():
     except Compile_error:
         exit (1)
 
-    if global_options.format in (TEXINFO, LATEX):
-        psfonts_file = os.path.join (global_options.output_name, basename + '.psfonts')
-        output = os.path.join (global_options.output_name, basename +  '.dvi' )
-        
-        if not global_options.psfonts and not global_options.create_pdf:
-            warning (_ ("option --psfonts not used"))
-            warning (_ ("processing with dvips will have no fonts"))
-        else:
-            progress ('\n')
-            progress (_ ("DVIPS usage:"))
-            progress ('\n')
-            progress ("    dvips -h %(psfonts_file)s %(output)s" % vars ())
-            progress ('\n')
+    psfonts_warning (global_options, basename)
 
     inputs = note_input_file ('')
     inputs.pop ()
index 1a19a4dc88d3d30934169b236c864e4222d81bea..2500d80d41c05b2dbc8b44b39dd769d410ffc534 100644 (file)
@@ -1,9 +1,6 @@
 $(outdir)/%: %.m4
        $(M4) $< > $@
 
-%.dep:
-       touch $@
-
 %.gz: %
        gzip -c9 $< > $@
 
index 2ccf2f7b2c3319998a4cfe823c63179d9003223b..b33bd10be6919f7db261dfb56714e1fa2ff04769 100644 (file)
@@ -1,4 +1,3 @@
-
 # Don't remove $(outdir)/.log's.  Logs are a target!
 
 # we want to see botched results as well.
@@ -8,25 +7,11 @@ $(outdir)/%.dvi: %.mf
        mv $(basename $<).dvi $(outdir)
        rm $(basename $<).*gf
 
-# This is not metafont, this is feta-specific
-$(outdir)/%.log: %.mf
-       MFINPUTS=$(src-dir) $(METAFONT) "\mode:=$(MFMODE); nonstopmode; input $<;"
-       mv $(@F) $@
-       rm $(basename $(@F)).*gf
-
-$(outdir)/%.tfm $(outdir)%.log: %.mf
+$(outdir)/%.tfm $(outdir)/%.log: %.mf
        MFINPUTS=$(src-dir) $(METAFONT) "\mode:=$(MFMODE); nonstopmode; input $<;"
 # Let's keep this log output, it saves another mf run.
        mv $(basename $(@F)).log $(basename $(@F)).tfm $(outdir)
-       rm $(basename $(@F)).*gf
-
-$(outdir)/%.$(XPM_RESOLUTION)gf: %.mf
-       MFINPUTS=$(src-dir) $(METAFONT) "\\mode=$(XPM_MODE); \\input $<"
-# Let's keep this log output, it saves another mf run.
-       mv $(@F) $(basename $(@F)).log $(basename $(@F)).tfm $(outdir)
-
-$(outdir)/%.$(XPM_RESOLUTION)pk: $(outdir)/%.$(XPM_RESOLUTION)gf
-       gftopk $< $@
+       rm -f $(basename $(@F)).*gf  $(basename $(@F)).*pk
 
 
 MFTRACE_FORMATS = pfa pfb svg
@@ -36,7 +21,3 @@ $(outdir)/%.pfb $(outdir)/%.svg $(outdir)/%.pfa: %.mf
        -mv $(basename $(@F)).pfa $(outdir)
        -mv $(basename $(@F)).pfb $(outdir)
        -mv $(basename $(@F)).svg $(outdir)
-
-#%.afm:
-#      $(SHELL) $(depth)/buildscripts/tfmtoafm.sh $(shell basename $@ .afm)
-#      mv $@ $@.in
index 616e5868a7fb99cfef7eda4c9ea82486326d6f28..dfaf2c18ce1cb77b261cc65efd189df519cf5688 100644 (file)
@@ -3,10 +3,5 @@ tfm: $(TFM_FILES)
 
 dvi: $(DVI_FILES)
 
-pks: $(addprefix $(outdir)/, $(XPM_FONTS:%=%.$(XPM_RESOLUTION)pk))
-
-xpms: $(addprefix $(outdir)/, $(XPM_FONTS:%=%.afm)) pks
-       $(foreach i, $(XPM_FONTS), $(SHELL) $(depth)/buildscripts/mf-to-xpms.sh $(i) && ) true
-
 pfb: $(PFB_FILES)
 
index c1636f1c9f936616723736bdad9b53a611be2fa4..db3722edcdec36c466c13841493f1c46c25eb53e 100644 (file)
@@ -7,14 +7,5 @@ MF_LOG_FILES = $(addprefix $(outdir)/, $(FONT_FILES:.mf=.log))
 DVI_FILES += $(MF_DVI_FILES)
 TFM_FILES += $(MF_TFM_FILES)
 
-# XPM_MODE=sun
-# XPM_RESOLUTION=85
-
-# XPM_MODE=declarge
-# XPM_RESOLUTION=100
-
-XPM_MODE=ibmvga
-XPM_RESOLUTION=110
-
 
 
index 97a1c6b443b1e9993caeebd08cf10e2e8737f389..ffd57d480be07b1c7288ae29dca4297304009563 100644 (file)
@@ -4,4 +4,4 @@ O_FILES := $(filter-out $(outdir)/test%, $(O_FILES))
 TEST_EXECUTABLE = $(outdir)/test-$(NAME)
 TEST_MODULE_LIBES =$(addprefix $(outdir)/../, $(addsuffix /$(outbase)/library.a, $(TEST_MODULE_LIBS)))
 
-TEST_LOADLIBES = $(TEST_MODULE_LIBES) $(LOADLIBES) -lboost_unit_test_framework
+TEST_LOADLIBES = $(TEST_MODULE_LIBES) $(LOADLIBES)