]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.1
authorfred <fred>
Tue, 26 Mar 2002 22:42:53 +0000 (22:42 +0000)
committerfred <fred>
Tue, 26 Mar 2002 22:42:53 +0000 (22:42 +0000)
30 files changed:
Documentation/GNUmakefile
Documentation/misc/GNUmakefile
Documentation/ntweb/GNUmakefile
Documentation/programmer/hacking.texi
Documentation/topdocs/INSTALL.texi
Documentation/topdocs/README.texi
Documentation/topdocs/index.tely
buildscripts/genheader.py
flower/include/rational.hh
flower/include/scalar.hh
lily/lexer.ll
midi2ly/include/midi-parser.hh
midi2ly/include/midi-track-parser.hh
midi2ly/include/mudela-column.hh
midi2ly/include/mudela-item.hh
midi2ly/include/mudela-score.hh
midi2ly/include/mudela-staff.hh
midi2ly/include/mudela-stream.hh
midi2ly/midi-score-parser.cc
midi2ly/midi-track-parser.cc
midi2ly/mudela-column.cc
midi2ly/mudela-item.cc
midi2ly/mudela-score.cc
midi2ly/mudela-staff.cc
midi2ly/mudela-stream.cc
midi2ly/mudela-voice.cc
scripts/convert-mudela.py
scripts/mup2ly.py
stepmake/stepmake/texinfo-rules.make
stepmake/stepmake/yolily-topdoc-targets.make

index b3fda3a8218aafd20d75470be342b133b64533f3..dd49ab04a38767ced6b5093a668505c7259e2c39 100644 (file)
@@ -9,7 +9,7 @@ EXTRA_DIST_FILES =
 
 include $(depth)/make/stepmake.make 
 
-default: do-doc
+default: local-doc
 
 local-WWW: copy-for-me
 
index d9b79c0e6ecf49e678ccfdf7205c249e1ccac3d6..003590955bb2f06eb1583a4fd4d755a0b48eed40 100644 (file)
@@ -9,7 +9,7 @@ EXTRA_DIST_FILES = $(TEXTS)
 
 include $(depth)/make/stepmake.make 
 
-default: do-doc
+default: local-doc
 
 local-WWW: $(addprefix $(outdir)/, $(addsuffix .txt, $(TEXTS)))
 
index 2fbe79809f65f21a827265a3d2416dbad9446456..c6d91915f536e814fa18300b29a99e86f0f6ad6a 100644 (file)
@@ -9,7 +9,7 @@ EXTRA_DIST_FILES = $(PLAIN_FILES)
 
 include $(depth)/make/stepmake.make 
 
-default: do-doc dist-plain
+default: local-doc dist-plain
 
 $(outdir)/%.texi: %.texi
        m4 -DTOPLEVEL_VERSION=$(TOPLEVEL_VERSION) < $< > $@ 
index 233c8002162497126c53b0a6a97a700a560106c3..da36f2f0efc24e020030c3efe7999f20c481388d 100644 (file)
@@ -59,13 +59,18 @@ are only three translations so far.
 
 @unnumberedsubsec Hackers
 
-
 There are lots of possibilities of improving the program itself. There are
 both small projects and big ones. Most of them are listed in the TODO
 file.  A interesting and very big project is writing a GUI frontend to
 LilyPond.
 
 
+@unnumberedsubsec Website designers
+
+The current website for LilyPond is neat and simple, but it is not very
+pretty.  We would like to have a website with pretty pictures, one that
+looks appealing to new users.
+
 
 @chapter LilyPond internals
 
index 440404cb13267526dfd50b95bbbd622cc752d9c3..1e40606d897364adb112e6c0e05ab490d19c319f 100644 (file)
@@ -126,7 +126,8 @@ documentation on-line documentation. It is made by entering @example
   make website
  
 @end example 
-This does require a fully functioning
+This does require a  functioning  LilyPond. The binary doesn't have to
+be installed. 
 
 If you want to auto-generate Lily's website, you'll need some additional
 conversion tools.
index 8f76f1f67347842dbc1d496dfcd9780ffd457b7e..f31af066a1042910aa365f2a7b94ecd28e4fd903 100644 (file)
@@ -60,7 +60,7 @@ using @example
 @section Comments
 
 LilyPond is a long way from finished and polished.  We do appreciate
-criticism, comments, bugreports, patches, etc.
+criticism, comments, bugreports, patches, etc., but please,
 @example 
 
           Please send your e-mail to one of the MAILING LISTS
index 6078fa1349b5b98ab296d686416cab510a897e0b..e0044f32844f1e3045b031616dea0908f229f23a 100644 (file)
@@ -6,7 +6,7 @@
 @top
 
 
-@unnumbered LilyPond -- The @uref{http://www.fsf.org/gnu/gnu-history.html,GNU Project} Music Typesetter
+@unnumbered LilyPond -- The GNU Project Music Typesetter
 
 
 @html
@@ -22,17 +22,16 @@ using a high level description file as input.  LilyPond is part of
 the GNU Project.
 
 
-@c @center
+
+@unnumberedsec Sheet music
+    
+
+
 @quotation
 @mudela[fragment]
        \relative c'' { \key es; r8 [c16 b] [c8 g] [as c16 b] [c8 d] | g,4 }
 @end mudela 
 @end quotation
-@c @end center
-
-
-@unnumberedsec Sheet music
-    
 
 @itemize @bullet
 
index 2f57d1a9582dbdd317a6aa07bbaccac4d99d1064..bfe64c9be67e191c8599a4b9ac98cfcad7059e27 100644 (file)
@@ -15,134 +15,159 @@ import getopt
 import time
 
 class My_options:
-    def __init__(self):
-       self.commentify = None
-       self.add_hdr_def = 0
-       self.classname = ''
+       def __init__(self):
+               self.commentify = None
+               self.add_hdr_def = 0
+               self.classname = ''
 
 my_options = My_options()
 
 
 def name():
-       return os.environ['USERNAME']
+               return os.environ['USERNAME']
 
 # field 4 of passwd is also used for finger info (phone no.,  office etc)
 #   return pwd.getpwuid(os.getuid())[4]
 
 def c_commentify(str):
-    return  '/* ' + re.sub('^','  ', str) + '\n */';
+       return  '/* ' + re.sub('^','  ', str) + '\n */';
 
 def sh_commentify(str):
-    return re.sub('^', '# ', str)
+       return re.sub('^', '# ', str)
 
 def tex_commentify(str):
-    return re.sub('^', '% ', str)
+       return re.sub('^', '% ', str)
 
 def project_str():
-    cwd = os.getcwd()
-    if re.search('flower', cwd):
-       PROJECT = "the Flower Library"
-    elif re.search('mf$', cwd):
-       PROJECT = "the Feta (defintively not an abbreviation for Font-En-Tja) music font"
-    else:
-       PROJECT = "the GNU LilyPond music typesetter"
-    return PROJECT
+       cwd = os.getcwd()
+       if re.search('flower', cwd):
+               PROJECT = "the Flower Library"
+       elif re.search('mf$', cwd):
+               PROJECT = "the Feta (defintively not an abbreviation for Font-En-Tja) music font"
+       else:
+               PROJECT = "the GNU LilyPond music typesetter"
+       return PROJECT
 
 def head_str(filename):
-    if my_options.add_hdr_def:
-       what = "declare " 
-    else:
-       what=" implement "
-
-       
-    mailaddres = ''
-    try:
-           mailaddres = '<%s>' % os.environ['MAILADDRESS']
-    except KeyError:
-           pass
-    headstr = '\n%s -- %s\n\nsource file of %s\n\n(c) %d %s %s\n' \
-             %(filename, what, project_str(),
-               time.localtime (time.time ())[0], name(), mailaddres)
-    return headstr
+       if my_options.add_hdr_def:
+               what = "declare " 
+       else:
+               what=" implement "
+
+               
+       mailaddres = ''
+       try:
+                       mailaddres = '<%s>' % os.environ['MAILADDRESS']
+       except KeyError:
+                       pass
+       headstr = '\n%s -- %s\n\nsource file of %s\n\n(c) %d %s %s\n' \
+                         %(filename, what, project_str(),
+                               time.localtime (time.time ())[0], name(), mailaddres)
+       return headstr
 
 
 def c_include(filename):
-    startdef= filename;
-    trans = string.maketrans( string.lowercase + '-.', string.uppercase + '__')
-    startdef = string.translate(filename, trans)
+       startdef= filename;
+       trans = string.maketrans( string.lowercase + '-.', string.uppercase + '__')
+       startdef = string.translate(filename, trans)
+
+   
+       headstr = "\n\n#ifndef %s\n#define %s\n" % (startdef, startdef)
+       terminatestr = "#endif /* %s */\n"  % (startdef);
+
+       return headstr+ '\n\n'+ terminatestr;
+
+
+def icc_include (filename):
+       startdef= filename;
+       trans = string.maketrans( string.lowercase + '-.', string.uppercase + '__')
+       startdef = string.translate(filename, trans)
 
    
-    headstr = "\n\n#ifndef %s\n#define %s\n" % (startdef, startdef)
-    terminatestr = "#endif /* %s */\n"  % (startdef);
+       headstr = "\n\n#ifndef %s\n#define %s\n" % (startdef, startdef)
+       headstr = headstr + r"""
+#ifndef INLINE
+#define INLINE inline
+#define LOCAL_INLINE_DEF
+#endif
+"""
+       terminatestr = "#endif /* %s */\n"  % (startdef);
+
+       terminatestr = r"""
+#ifdef LOCAL_INLINE_DEF
+#undef LOCAL_INLINE_DEF
+#undef INLINE
+#endif
+""" + terminatestr
+       return headstr+ '\n\n'+ terminatestr;
 
-    return headstr+ '\n\n'+ terminatestr;
 
 
 def help ():
-    sys.stdout.write ("Usage: genheader [options] FILENAME\n"
-                + "Generate file with header FILENAME\n\n"
-                + "Options:\n"
-                + "  -h, --header           generate header\n"
-                + "  --help                 print this help\n"
-                + "  -p, --package=DIR      specify package\n"
-                     )
-    
-    sys.exit (0)
+       sys.stdout.write ("Usage: genheader [options] FILENAME\n"
+                                + "Generate file with header FILENAME\n\n"
+                                + "Options:\n"
+                                + "  -h, --header                 generate header\n"
+                                + "  --help                             print this help\n"
+                                + "  -p, --package=DIR   specify package\n"
+                                         )
+       
+       sys.exit (0)
 
 
 (options, files) = getopt.getopt(sys.argv[1:], 'tcshp:', ['class', 'package=', 'help']) 
 
 for opt in options:
-    o = opt[0]
-    a = opt[1]
-    if o == '-c':
-       my_options.commentify = c_commentify
-    elif o == '-t':
-       my_options.commentify = tex_commentify
-    elif o == '-s':
-       my_options.commentify = sh_commentify
-    elif o == '-h' or o == '--header':
-       my_options.add_hdr_def = 1
-    elif o == '--class':
-       my_options.classname = a
-    elif o == '--help':
-       help ()
+       o = opt[0]
+       a = opt[1]
+       if o == '-c':
+               my_options.commentify = c_commentify
+       elif o == '-t':
+               my_options.commentify = tex_commentify
+       elif o == '-s':
+               my_options.commentify = sh_commentify
+       elif o == '-h' or o == '--header':
+               my_options.add_hdr_def = 1
+       elif o == '--class':
+               my_options.classname = a
+       elif o == '--help':
+                       help ()
 
 # FIXME:  should create xxx.cc and include/xxx.hh, with implement/declare Xxx
 # in  one run
 if my_options.classname:
-    pass
-       
+       pass
+               
 def do_file(nm):
-    s = my_options.commentify(head_str(nm)) 
-    if my_options.add_hdr_def:
-       s = s + c_include(nm)
-    return s
+       s = my_options.commentify(head_str(nm)) 
+       if my_options.add_hdr_def:
+               s = s + c_include(nm)
+       return s
 
 
 def extension(ext,nm):
-    ext = '\\.' + ext
-    return re.search(ext, nm) <> None
+       ext = '\\.' + ext
+       return re.search(ext, nm) <> None
 
 def c_extension(nm):
-    return extension('hh',nm) or extension('cc',nm) \
-          or extension('icc', nm) or extension('tcc',nm)
+       return extension('hh',nm) or extension('cc',nm) \
+                  or extension('icc', nm) or extension('tcc',nm)
 
 def select_commentification(nm):
-    if c_extension (nm):
-       return c_commentify
-    elif extension('py',nm) or extension('pl',nm) or extension('sh',nm):
-       return  sh_commentify
-    elif extension('mf',nm) or extension('tex',nm) or extension('ly',nm):
-       return tex_commentify
-    else:
-       sys.stderr.write ('unknown extension for file %s\n' % nm)
-       raise 'help'
+       if c_extension (nm):
+               return c_commentify
+       elif extension('py',nm) or extension('pl',nm) or extension('sh',nm):
+               return  sh_commentify
+       elif extension('mf',nm) or extension('tex',nm) or extension('ly',nm):
+               return tex_commentify
+       else:
+               sys.stderr.write ('unknown extension for file %s\n' % nm)
+               raise 'help'
 
 for nm in files:
-    if extension('hh', nm) or extension('icc', nm) or  extension('tcc', nm): 
-       my_options.add_hdr_def = 1
-    if my_options.commentify == None:
-       my_options.commentify = select_commentification(nm)
-    print do_file(nm)
+       if extension('hh', nm) or extension('icc', nm) or  extension('tcc', nm): 
+               my_options.add_hdr_def = 1
+       if my_options.commentify == None:
+               my_options.commentify = select_commentification(nm)
+       print do_file(nm)
 
index b1187ec6924770f10b2c813609f42394782fa521..e0ca9834d1ce318b86aa719e9f3ae3db170efe96 100644 (file)
@@ -91,4 +91,6 @@ class ostream;
 ostream &
 operator << (ostream &,  Rational);
 
+const Rational infinity_rat = INT_MAX;
+
 #endif // RATIONAL_HH
index 1960e53d5614776bdddc2a66d5142bf8391c6c13..88905d62c967d90564b1d4a833d0ad3bc0556cd2 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "string.hh"
 #include "real.hh"
+#include "protected-scm.hh"
 
 #error
 /// Perl -like scalar type.
index 7d2d699eadd2dce9d8cbd34bfa4ae0025f11674e..8d95d0e42e6bb7a20f6d17d6421df038f12b3dbf 100644 (file)
@@ -333,7 +333,7 @@ HYPHEN              --
                if (c == '{' &&  c == '}') // brace open is for not confusing dumb tools.
                        here_input ().warning (
                                "Brace found at end of lyric. Did you forget a space?");
-               yylval.scm = ly_ch_C_to_scm (YYText());
+               yylval.scm = ly_ch_C_to_scm (s.ch_C ());
 
                DEBUG_OUT << "lyric : `" << s << "'\n";
                return STRING;
index 529fdf268d21d24bdba2fee64069ad3574ef6fe4..25fb357f64b42d00b5ff9ff233387f291479ca94 100644 (file)
@@ -36,7 +36,7 @@
 #endif
 
 #include "proto.hh"
-#include "moment.hh"
+#include "rational.hh"
 #include "midi2ly-proto.hh"
 
 struct Midi_parser_info
@@ -50,7 +50,7 @@ struct Midi_parser_info
   Byte const* end_byte_L_;
   Source_file* source_l_;
   Mudela_score* score_l_;
-  Moment bar_mom_;
+  Rational bar_mom_;
 };
 
 #include "string.hh"
index 27eb83d2240bc2c2f96a796f677b37317de5e7da..4dd95fe82da7ac0c2fe9e370156196f255cfeebc 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "proto.hh"
 #include "cons.hh"
-#include "moment.hh"
+#include "rational.hh"
 #include "midi2ly-proto.hh"
 #include "midi-parser.hh"
 
@@ -23,7 +23,7 @@ public:
   Midi_track_parser (Midi_parser_info* info_l, int i);
   ~Midi_track_parser ();
 
-  Moment at_mom ();
+  Rational at_mom ();
   Mudela_staff* parse (Mudela_column* col_l);
 
 private:
@@ -34,7 +34,7 @@ private:
   Mudela_item* parse_event (Mudela_column* col_l);
   void parse_header ();
 
-  Moment at_mom_;
+  Rational at_mom_;
   Byte running_byte_;
   Cons_list<Mudela_note> open_note_l_list_;
   Mudela_staff* mudela_staff_p_;
index cd549a1b37fb69c3bcdfb5ec198fdabd93f0a220..6c348afbc4ebbd320f242f682a3245414ce4ecd7 100644 (file)
@@ -8,20 +8,20 @@
 
 #include "proto.hh"
 #include "midi2ly-proto.hh"
-#include "moment.hh"
+#include "rational.hh"
 #include "cons.hh"
 
 /// (mudela_column)
 class Mudela_column 
 {
 public:
-    Mudela_column (Mudela_score* mudela_score_l, Moment mom);
+    Mudela_column (Mudela_score* mudela_score_l, Rational mom);
 
     void add_item (Mudela_item* mudela_item_l);
-    Moment at_mom ();
+    Rational at_mom ();
 
     Cons_list<Mudela_item> mudela_item_l_list_;
-    Moment at_mom_;
+    Rational at_mom_;
     Mudela_score* mudela_score_l_;
 };
 
index e6150e4a045211bdd062b58a04dc53a31eb40d17..02c726b317b008f8824f3db778175c5a7a507b04 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "midi2ly-proto.hh"
 #include "string.hh"
-#include "moment.hh"
+#include "rational.hh"
 #include "duration.hh"
 
 // should these:
@@ -24,8 +24,8 @@ public:
   Mudela_item (Mudela_column* mudela_column_l);
   virtual ~Mudela_item ();
     
-  virtual Moment at_mom ();
-  virtual Moment duration_mom ();
+  virtual Rational at_mom ();
+  virtual Rational duration_mom ();
   void output (Mudela_stream& mudela_stream_r);
   virtual String str () = 0;
 
@@ -55,7 +55,7 @@ public:
   int den_i ();
   int num_i ();
   virtual String str ();
-  Moment bar_mom ();
+  Rational bar_mom ();
 
 private:
   Real sync_f_;
@@ -71,7 +71,7 @@ public:
   Mudela_note (Mudela_column* mudela_column_l, int channel_i, int pitch_i, int dyn_i);
 
   Duration duration ();
-  virtual Moment duration_mom ();
+  virtual Rational duration_mom ();
   virtual String str ();
     
   //    int const c0_pitch_i_c_ = 60; // huh?
@@ -86,14 +86,14 @@ public:
 class Mudela_skip : public Mudela_item 
 {
 public:
-  Mudela_skip (Mudela_column* mudela_column_l, Moment skip_mom);
+  Mudela_skip (Mudela_column* mudela_column_l, Rational skip_mom);
 
   Duration duration ();
-  virtual Moment duration_mom ();
+  virtual Rational duration_mom ();
   virtual String str ();
 
 private:
-  Moment mom_;
+  Rational mom_;
 };
 
 
@@ -102,13 +102,13 @@ class Mudela_tempo : public Mudela_item
 public:
   Mudela_tempo (int useconds_per_4_i);
 
-  int get_tempo_i (Moment moment);
+  int get_tempo_i (Rational rational);
   virtual String str ();
   int useconds_per_4_i ();
 
 private:
   int useconds_per_4_i_;
-  Moment seconds_per_1_mom_;
+  Rational seconds_per_1_mom_;
 };
 
 class Mudela_text : public Mudela_item 
index b5fa1db9720588fde47eb04fc3381aa4a1019bbd..2a8006a5cd9634477a4480e1a487c4203bf8b487 100644 (file)
@@ -20,8 +20,8 @@ public:
   void add_item (Mudela_item* mudela_item_p);
   void add_staff (Mudela_staff* mudela_staff_p);
 
-  Mudela_column* find_column_l (Moment mom);
-  Mudela_column* get_column_l (Moment mom);
+  Mudela_column* find_column_l (Rational mom);
+  Mudela_column* get_column_l (Rational mom);
 
   void output (String filename_str);
   void process ();
index 2367fec7015a1c24d62bda1ff42abaac22dcdac1..6f51077d571b1615c55cc6260284daedebc2b25c 100644 (file)
@@ -33,7 +33,7 @@ public:
   int number_i_;
 
 private:
-  void output_mudela_begin_bar (Mudela_stream& mudela_stream_r, Moment now_mom, int bar_i);
+  void output_mudela_begin_bar (Mudela_stream& mudela_stream_r, Rational now_mom, int bar_i);
 
   Cons_list<Mudela_voice> mudela_voice_p_list_;
   Cons_list<Mudela_item> mudela_item_p_list_;
index 0ba47e8173437d7aa3d6c87314d474d107db267d..04ddbd86e9d72d4704fda6fa5a9f3f5d92b685ed 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "midi2ly-proto.hh"
 #include "string.hh"
-#include "scalar.hh"
+//#include "scalar.hh"
 
 /// Lily output
 class Mudela_stream {
@@ -18,7 +18,8 @@ public:
     Mudela_stream (String filename_str);
     ~Mudela_stream();
 
-    Mudela_stream& operator << (Scalar s);
+    Mudela_stream& operator << (char c);
+    Mudela_stream& operator << (String s);
     Mudela_stream& operator << (Mudela_item& mudela_item_r);
 
 private:
index 33fb76b4b3d4f8e5a6e56a9c74d00ff2c3df8ea2..3370edcd15ffaa0a82accf5998e61c64422339e1 100644 (file)
@@ -6,7 +6,7 @@
   (c)  1997--1998 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
-#include "moment.hh"
+#include "rational.hh"
 #include "source-file.hh"
 #include "source.hh"
 #include "midi2ly-global.hh"
@@ -65,7 +65,7 @@ int
 Midi_score_parser::find_earliest_i (Link_array<Midi_track_parser>& tracks)
 {
   int earliest_i = 0;
-  Moment earliest_mom = infinity_mom;
+  Rational earliest_mom = infinity_rat;
   for (int i = 0; i < tracks.size(); i++)
     {
       if ( tracks [i]->at_mom () < earliest_mom )
@@ -82,7 +82,7 @@ Midi_score_parser::parse_score ()
 {
   int current_bar_i = 0;
   Mudela_time_signature m4 (4, 2, 24, 8);
-  Moment bar4_mom = m4.bar_mom ();
+  Rational bar4_mom = m4.bar_mom ();
 
   Mudela_score* score_p = new Mudela_score( 1, 1, 1 );
   info_l_->score_l_ = score_p;
@@ -96,7 +96,7 @@ Midi_score_parser::parse_score ()
   while (tracks.size ())
     {
       int i = find_earliest_i (tracks);
-      Moment at_mom = tracks [i]->at_mom ();
+      Rational at_mom = tracks [i]->at_mom ();
       Mudela_column* column_l = score_p->get_column_l (at_mom);
       Mudela_staff* staff_p = tracks [i]->parse (column_l);
       if ( staff_p )
index 21442a4ef308bd4e17a4cda41f2aa0ba91921504..69c7ed080e1bf7ecb145110c7fe5acc8281d6532 100644 (file)
@@ -31,7 +31,7 @@ Midi_track_parser::~Midi_track_parser ()
   delete track_info_p_;
 }
 
-Moment
+Rational
 Midi_track_parser::at_mom ()
 {
   return at_mom_;
@@ -85,7 +85,7 @@ Midi_track_parser::note_end_all (Mudela_column* col_l)
 Mudela_staff*
 Midi_track_parser::parse (Mudela_column* col_l)
 {
-  Moment mom = at_mom ();
+  Rational mom = at_mom ();
   while (!eot () && (mom == at_mom ()))
     {
       Mudela_item* p = parse_event (col_l);
@@ -110,7 +110,7 @@ Midi_track_parser::parse_delta_time ()
   if (eot ())
     return;
   int delta_i = get_var_i ();
-  at_mom_ += Moment (delta_i, info_l_->division_1_i_);
+  at_mom_ += Rational (delta_i, info_l_->division_1_i_);
 }
 
 Mudela_item*
index 833b351f81fe5ec67e905f61696b20295f796f26..e45e985c0efc4ef2ec1df91e2217f6a9fa8c4b03 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "mudela-column.hh"
 
-Mudela_column::Mudela_column (Mudela_score* mudela_score_l, Moment mom)
+Mudela_column::Mudela_column (Mudela_score* mudela_score_l, Rational mom)
 {
   mudela_score_l_ = mudela_score_l;
   at_mom_ = mom;
@@ -17,7 +17,7 @@ Mudela_column::add_item (Mudela_item* mudela_item_l)
    mudela_item_l_list_.append (new Cons<Mudela_item> (mudela_item_l, 0));
 }
 
-Moment
+Rational
 Mudela_column::at_mom()
 {
   return at_mom_;
index 1aa6105f09cad4358b4ba2b88cac81df03f36378..7c427c9ff4316f47e94297961d076e15c0d2f39e 100644 (file)
@@ -21,16 +21,16 @@ Mudela_item::~Mudela_item ()
 {
 }
 
-Moment
+Rational
 Mudela_item::at_mom ()
 {
   return mudela_column_l_->at_mom ();
 }
 
-Moment
+Rational
 Mudela_item::duration_mom ()
 {
-  return Moment (0);
+  return Rational (0);
 }
 
 void
@@ -163,12 +163,12 @@ Mudela_time_signature::Mudela_time_signature (int num_i, int den_i, int clocks_4
   clocks_1_i_ = clocks_4_i * 4;
 }
 
-Moment
+Rational
 Mudela_time_signature::bar_mom ()
 {
   Duration d;
   d.durlog_i_ = den_i_;
-  return Moment (num_i_) * Duration_convert::dur2_mom (d);
+  return Rational (num_i_) * Duration_convert::dur2_mom (d);
 }
 
 int
@@ -227,11 +227,11 @@ Duration
 Mudela_note::duration ()
 {
   assert (end_column_l_);
-  Moment mom = end_column_l_->at_mom () - at_mom ();
+  Rational mom = end_column_l_->at_mom () - at_mom ();
   return Duration_convert::mom2_dur (mom);
 }
 
-Moment
+Rational
 Mudela_note::duration_mom ()
 {
   assert (end_column_l_);
@@ -281,7 +281,7 @@ Mudela_note::str ()
   return str + " ";
 }
 
-Mudela_skip::Mudela_skip (Mudela_column* mudela_column_l, Moment skip_mom)
+Mudela_skip::Mudela_skip (Mudela_column* mudela_column_l, Rational skip_mom)
   : Mudela_item (mudela_column_l)
 {
   mom_ = skip_mom;
@@ -293,7 +293,7 @@ Mudela_skip::duration ()
   return Duration_convert::mom2_dur (mom_);
 }
 
-Moment
+Rational
 Mudela_skip::duration_mom ()
 {
   return Duration_convert::dur2_mom (duration ());
@@ -319,14 +319,14 @@ Mudela_tempo::Mudela_tempo (int useconds_per_4_i)
   : Mudela_item (0)
 {
   useconds_per_4_i_ = useconds_per_4_i;
-  seconds_per_1_mom_ = Moment(useconds_per_4_i_ *4, 1e6);
+  seconds_per_1_mom_ = Rational(useconds_per_4_i_ *4, 1e6);
 }
 
 String
 Mudela_tempo::str ()
 {
   String str = "\\tempo 4=";
-  str += to_str (get_tempo_i (Moment (1, 4)));
+  str += to_str (get_tempo_i (Rational (1, 4)));
   str += ";\n";
   return str;
 }
@@ -338,10 +338,10 @@ Mudela_tempo::useconds_per_4_i ()
 }
 
 int
-Mudela_tempo::get_tempo_i (Moment moment)
+Mudela_tempo::get_tempo_i (Rational rational)
 {
-  Moment m1 = Moment (60) / moment;
-  Moment m2 = seconds_per_1_mom_;
+  Rational m1 = Rational (60) / rational;
+  Rational m2 = seconds_per_1_mom_;
   return m1 / m2;
 }
 
index 1d3d0f5ca4c1df711233ff9cef92f017a33e55cd..8a142c8449ed3e1fd196aaa5e42d63352624df53 100644 (file)
@@ -4,7 +4,7 @@
 // copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
 
 #include <assert.h>
-#include "moment.hh"
+#include "rational.hh"
 #include "duration.hh"
 #include "duration-convert.hh"
 #include "midi2ly-global.hh"
@@ -27,7 +27,7 @@ Mudela_score::Mudela_score (int format_i, int tracks_i, int tempo_i)
   format_i_ = format_i;
   tracks_i_ = tracks_i;
   tempo_i_ = tempo_i;
-  column_l_array_.push (new Mudela_column (this, Moment (0)));
+  column_l_array_.push (new Mudela_column (this, Rational (0)));
   //  mudela_key_l_ = &key_c;
   mudela_key_l_ = 0;
   mudela_time_signature_l_ = &time_sig_4;
@@ -52,14 +52,14 @@ Mudela_score::add_staff (Mudela_staff* mudela_staff_p)
 }
 
 Mudela_column*
-Mudela_score::find_column_l (Moment mom)
+Mudela_score::find_column_l (Rational mom)
 {
   int upper_i = max (0, column_l_array_.size () - 1);
   int lower_i = 0;
   int i = 0; //upper_i;
   while (1)
     {
-      Moment i_mom = column_l_array_ [i]->at_mom ();
+      Rational i_mom = column_l_array_ [i]->at_mom ();
       if (i_mom == mom)
        return column_l_array_ [i];
       if (mom < i_mom)
@@ -81,7 +81,7 @@ Mudela_score::find_column_l (Moment mom)
 }
 
 Mudela_column*
-Mudela_score::get_column_l (Moment mom)
+Mudela_score::get_column_l (Rational mom)
 {
   int i;
   Mudela_column *c=0;
@@ -131,7 +131,7 @@ Mudela_score::output (String filename_str)
           && (i->car_ == mudela_staff_p_list_.head_->car_))
        continue;
       mudela_stream << "\\context Staff = \"" << i->car_->id_str () << "\" ";
-      mudela_stream << String ("\\" +  i->car_->id_str ()) << "\n";
+      mudela_stream << String ("\\" +  i->car_->id_str ()) << '\n';
     }
   if (mudela_staff_p_list_.size_i () > 1)
     mudela_stream << ">\n";
@@ -190,15 +190,15 @@ Mudela_score::quantify_columns ()
   LOGOUT (NORMAL_ver) << '\n' << _ ("Quantifying columns...") << endl;
   
   int current_bar_i = 0;
-  Moment bar_mom = mudela_time_signature_l_->bar_mom ();
+  Rational bar_mom = mudela_time_signature_l_->bar_mom ();
   
   int n = 5 >? Duration_convert::no_smaller_than_i_s;
   n = Duration_convert::type2_i (n);
-  Moment s = Moment (1, n);
+  Rational s = Rational (1, n);
   for (int i = 0; i < column_l_array_.size (); i++)
     {
       column_l_array_ [i]->at_mom_ =
-       s * Moment ( (int) ( (column_l_array_ [i]->at_mom ()) / s));
+       s * Rational ( (int) ( (column_l_array_ [i]->at_mom ()) / s));
   
       int bar_i = (int) (column_l_array_ [i]->at_mom () / bar_mom) + 1;
       if (bar_i > current_bar_i)
@@ -226,12 +226,12 @@ Mudela_score::settle_columns ()
   
   int start_i = 0;
   int end_i = 0;
-  Moment start_mom = 0;
+  Rational start_mom = 0;
 
   Duration smallest_dur;
   smallest_dur.durlog_i_ =  6;
-  Moment const noise_mom = Duration_convert::dur2_mom (smallest_dur)
-    / Moment (2);
+  Rational const noise_mom = Duration_convert::dur2_mom (smallest_dur)
+    / Rational (2);
   for (int i = 0; i < n; i++)
     {
       if (!start_i)
index 6440d180b94de64e817f7a1d4d630c941f0c47a6..6f561cdb152372bdfe432b9f512d3d7836bc55fd 100644 (file)
@@ -5,7 +5,7 @@
 
 #include <assert.h>
 #include <ctype.h>
-#include "moment.hh"
+#include "rational.hh"
 #include "duration-convert.hh"
 #include "string-convert.hh"
 #include "midi2ly-proto.hh"
@@ -52,15 +52,15 @@ Mudela_staff::eat_voice (Cons_list<Mudela_item>& items)
   Mudela_voice* voice_p = new Mudela_voice (this);
   mudela_voice_p_list_.append (new Killing_cons<Mudela_voice> (voice_p, 0));
 
-  //    Moment mom = items.top ()->at_mom ();
-  Moment mom = 0;
+  //    Rational mom = items.top ()->at_mom ();
+  Rational mom = 0;
 
   for (Cons<Mudela_item>** pp = &items.head_; *pp;)
     {
       Cons<Mudela_item>* i = *pp;
       if (i->car_->at_mom () > mom)
        {
-         Moment dur = i->car_->at_mom () - mom;
+         Rational dur = i->car_->at_mom () - mom;
          // ugh, need score
          Mudela_column* start = mudela_score_l_g->find_column_l (mom);
          voice_p->add_item (new Mudela_skip (start, dur));
@@ -170,7 +170,7 @@ Mudela_staff::output (Mudela_stream& mudela_stream_r)
 
       trackbody += "\\"  + voicename + "\n";
 
-      mudela_stream_r << "\n";
+      mudela_stream_r << '\n';
       i->car_->output (mudela_stream_r);
       c++;      
     }
@@ -184,10 +184,10 @@ Mudela_staff::output (Mudela_stream& mudela_stream_r)
 }
 
 void
-Mudela_staff::output_mudela_begin_bar (Mudela_stream& mudela_stream_r, Moment now_mom, int bar_i)
+Mudela_staff::output_mudela_begin_bar (Mudela_stream& mudela_stream_r, Rational now_mom, int bar_i)
 {
-  Moment bar_mom = mudela_time_signature_l_->bar_mom ();
-  Moment into_bar_mom = now_mom - Moment (bar_i - 1) * bar_mom;
+  Rational bar_mom = mudela_time_signature_l_->bar_mom ();
+  Rational into_bar_mom = now_mom - Rational (bar_i - 1) * bar_mom;
   if (bar_i > 1)
     {
       if (!into_bar_mom)
@@ -202,10 +202,10 @@ Mudela_staff::output_mudela_begin_bar (Mudela_stream& mudela_stream_r, Moment no
 
 #if 0 // not used for now
 void
-Mudela_staff::output_mudela_rest (Mudela_stream& mudela_stream_r, Moment begin_mom, Moment end_mom)
+Mudela_staff::output_mudela_rest (Mudela_stream& mudela_stream_r, Rational begin_mom, Rational end_mom)
 {
-  Moment bar_mom = mudela_time_signature_l_->bar_mom ();
-  Moment now_mom = begin_mom;
+  Rational bar_mom = mudela_time_signature_l_->bar_mom ();
+  Rational now_mom = begin_mom;
 
   int begin_bar_i = (int) (now_mom / bar_mom) + 1;
   int end_bar_i = (int) (end_mom / bar_mom) + 1;
@@ -220,15 +220,15 @@ Mudela_staff::output_mudela_rest (Mudela_stream& mudela_stream_r, Moment begin_m
   int bar_i = (int) (now_mom / bar_mom) + 1;
 
   //fill current bar
-  Moment begin_bar_mom = Moment (begin_bar_i - 1) * bar_mom;
+  Rational begin_bar_mom = Rational (begin_bar_i - 1) * bar_mom;
   if (now_mom > begin_bar_mom)
     {
       int next_bar_i = (int) (now_mom / bar_mom) + 2;
-      Moment next_bar_mom = Moment (next_bar_i - 1) * bar_mom;
+      Rational next_bar_mom = Rational (next_bar_i - 1) * bar_mom;
       assert (next_bar_mom <= end_mom);
 
-      Moment remain_mom = next_bar_mom - now_mom;
-      if (remain_mom > Moment (0))
+      Rational remain_mom = next_bar_mom - now_mom;
+      if (remain_mom > Rational (0))
        {
          output_mudela_rest_remain (mudela_stream_r, remain_mom);
          now_mom += remain_mom;
@@ -259,8 +259,8 @@ Mudela_staff::output_mudela_rest (Mudela_stream& mudela_stream_r, Moment begin_m
 
   //    bar_i = check_end_bar_i (now_mom, bar_i);
 
-  Moment remain_mom = end_mom - Moment (end_bar_i - 1) * bar_mom;
-  if (remain_mom > Moment (0))
+  Rational remain_mom = end_mom - Rational (end_bar_i - 1) * bar_mom;
+  if (remain_mom > Rational (0))
     {
       output_mudela_rest_remain (mudela_stream_r, remain_mom);
       now_mom += remain_mom;
@@ -269,7 +269,7 @@ Mudela_staff::output_mudela_rest (Mudela_stream& mudela_stream_r, Moment begin_m
 }
 
 void
-Mudela_staff::output_mudela_rest_remain (Mudela_stream& mudela_stream_r, Moment mom)
+Mudela_staff::output_mudela_rest_remain (Mudela_stream& mudela_stream_r, Rational mom)
 {
   if (Duration_convert::no_quantify_b_s)
     {
index f5fbfd0f8cb05f8a0fe4c36cbacb853bce726e82..1ec52fc4a11d157453d1cebdc6e4f8ff8aa73eb0 100644 (file)
@@ -30,7 +30,7 @@ Mudela_stream::Mudela_stream (String filename_str)
   header();
 }
 
-Mudela_stream::~Mudela_stream()
+Mudela_stream::~Mudela_stream ()
 {
   delete os_p_;
   if  (indent_i_)
@@ -38,7 +38,14 @@ Mudela_stream::~Mudela_stream()
 }
 
 Mudela_stream&
-Mudela_stream::operator << (Scalar s)
+Mudela_stream::operator << (char c)
+{
+  *this << to_str (c);
+  return *this;
+}
+
+Mudela_stream&
+Mudela_stream::operator << (String s)
 {
   static String word_sep_str = "{} \t\n";
   while  (s.length_i())
index 65691d073c4c5436c318f2a86daa61c7a61e0b25..4d5ec74abebe0269c6a6f2b577653e9033bb2821 100644 (file)
@@ -67,17 +67,17 @@ Mudela_voice::output (Mudela_stream& mudela_stream_r)
   mudela_stream_r << get_clef () << '\n';
   
   int current_bar_i = 0;
-  Moment bar_mom = mudela_staff_l_->mudela_time_signature_l_->bar_mom ();
+  Rational bar_mom = mudela_staff_l_->mudela_time_signature_l_->bar_mom ();
 
   for (Cons<Mudela_item>* i = mudela_item_l_list_.head_; i; i = i->next_)
     {
-      Moment at_mom = i->car_->mudela_column_l_->at_mom ();
+      Rational at_mom = i->car_->mudela_column_l_->at_mom ();
       int bar_i = (int) (at_mom / bar_mom) + 1;
       if (bar_i > current_bar_i) 
        {
          if (current_bar_i) 
            {
-             if (at_mom == Moment (bar_i - 1) * bar_mom)
+             if (at_mom == Rational (bar_i - 1) * bar_mom)
                mudela_stream_r << "|";
              mudela_stream_r << "\n% ";
              mudela_stream_r << String_convert::i2dec_str (bar_i, 0, ' ');
index 097642bf97b3be67e2649cd7b23cc821b1db5c73..b23b0e6cdd31fe117ba1cc546829daccc27991cc 100644 (file)
@@ -112,7 +112,7 @@ def show_rules (file):
 ############################
                
 if 1:                                  # need new a namespace
-       def conv (lines):
+       def conv (str):
                if re.search ('\\\\octave', str):
                        sys.stderr.write ('\nNot smart enough to convert \\octave')
                        raise FatalConversionError()
@@ -124,10 +124,10 @@ if 1:                                     # need new a namespace
 
 
 if 1:                                  # need new a namespace
-       def conv (lines):
-               x = re.sub ('\\\\textstyle([^;]+);',
+       def conv (str):
+               str = re.sub ('\\\\textstyle([^;]+);',
                                         '\\\\property Lyrics . textstyle = \\1', str)
-               x = re.sub ('\\\\key([^;]+);', '\\\\accidentals \\1;', str)
+               str = re.sub ('\\\\key([^;]+);', '\\\\accidentals \\1;', str)
                        
                return str
 
@@ -136,9 +136,9 @@ if 1:                                       # need new a namespace
 
 
 if 1:
-       def conv (lines):
-               x = re.sub ('\\\\musical_pitch', '\\\\musicalpitch',str)
-               x = re.sub ('\\\\meter', '\\\\time',str)
+       def conv (str):
+               str = re.sub ('\\\\musical_pitch', '\\\\musicalpitch',str)
+               str = re.sub ('\\\\meter', '\\\\time',str)
                        
                return str
 
@@ -147,7 +147,7 @@ if 1:
                 '\\meter -> \\time'))
 
 if 1:
-       def conv (lines):
+       def conv (str):
                return lines
 
        conversions.append (
@@ -155,10 +155,10 @@ if 1:
 
 
 if 1:
-       def conv (lines):
-               x = re.sub ('\\\\accidentals', '\\\\keysignature',str)
-               x = re.sub ('specialaccidentals *= *1', 'keyoctaviation = 0',str)
-               x = re.sub ('specialaccidentals *= *0', 'keyoctaviation = 1',str)
+       def conv (str):
+               str = re.sub ('\\\\accidentals', '\\\\keysignature',str)
+               str = re.sub ('specialaccidentals *= *1', 'keyoctaviation = 0',str)
+               str = re.sub ('specialaccidentals *= *0', 'keyoctaviation = 1',str)
                        
                return str
 
@@ -167,7 +167,7 @@ if 1:
                 'specialaccidentals -> keyoctaviation'))
 
 if 1:
-       def conv(lines):
+       def conv(str):
                if re.search ('\\\\header', lines):
                        sys.stderr.write ('\nNot smart enough to convert to new \\header format')
                return lines
@@ -175,33 +175,33 @@ if 1:
        conversions.append ((1,0,2), conv, '\\header { key = concat + with + operator }')
 
 if 1:
-       def conv(lines):
-               x =  re.sub ('\\\\melodic', '\\\\notes',str)
+       def conv(str):
+               str =  re.sub ('\\\\melodic', '\\\\notes',str)
                        
                return str
        
        conversions.append ((1,0,3), conv, '\\melodic -> \\notes')
 
 if 1:
-       def conv(lines):
-               x =  re.sub ('default_paper *=', '',str)
-               x =  re.sub ('default_midi *=', '',x)                   
+       def conv(str):
+               str =  re.sub ('default_paper *=', '',str)
+               str =  re.sub ('default_midi *=', '',x)                 
                        
                return str
        
        conversions.append ((1,0,4), conv, 'default_{paper,midi}')
 
 if 1:
-       def conv(lines):
-               x =  re.sub ('ChoireStaff', 'ChoirStaff',str)
-               x =  re.sub ('\\output', 'output = ',str)
+       def conv(str):
+               str =  re.sub ('ChoireStaff', 'ChoirStaff',str)
+               str =  re.sub ('\\output', 'output = ',str)
                        
                return str
        
        conversions.append ((1,0,5), conv, 'ChoireStaff -> ChoirStaff')
 
 if 1:
-       def conv(lines):
+       def conv(str):
                if re.search ('[a-zA-Z]+ = *\\translator',str):
                        sys.stderr.write ('\nNot smart enough to change \\translator syntax')
                        raise FatalConversionError()
@@ -211,46 +211,46 @@ if 1:
 
 
 if 1:
-       def conv(lines):
-               x =  re.sub ('\\\\lyric', '\\\\lyrics',str)
+       def conv(str):
+               str =  re.sub ('\\\\lyric', '\\\\lyrics',str)
                        
                return str
        
        conversions.append ((1,0,7), conv, '\\lyric -> \\lyrics')
 
 if 1:
-       def conv(lines):
-               x =  re.sub ('\\\\\\[/3+', '\\\\times 2/3 { ',str)
-               x =  re.sub ('\\[/3+', '\\\\times 2/3 { [',str)
-               x =  re.sub ('\\\\\\[([0-9/]+)', '\\\\times \\1 {',str)
-               x =  re.sub ('\\[([0-9/]+)', '\\\\times \\1 { [',str)
-               x =  re.sub ('\\\\\\]([0-9/]+)', '}', str)
-               x =  re.sub ('\\\\\\]', '}',str)
-               x =  re.sub ('\\]([0-9/]+)', '] }', str)
+       def conv(str):
+               str =  re.sub ('\\\\\\[/3+', '\\\\times 2/3 { ',str)
+               str =  re.sub ('\\[/3+', '\\\\times 2/3 { [',str)
+               str =  re.sub ('\\\\\\[([0-9/]+)', '\\\\times \\1 {',str)
+               str =  re.sub ('\\[([0-9/]+)', '\\\\times \\1 { [',str)
+               str =  re.sub ('\\\\\\]([0-9/]+)', '}', str)
+               str =  re.sub ('\\\\\\]', '}',str)
+               str =  re.sub ('\\]([0-9/]+)', '] }', str)
                return str
        
        conversions.append ((1,0,10), conv, '[2/3 ]1/1 -> \\times 2/3 ')
 
 if 1:
-       def conv(lines):
+       def conv(str):
                return lines
        conversions.append ((1,0,12), conv, 'Chord syntax stuff')
 
 
 if 1:
-       def conv(lines):
+       def conv(str):
                
                
-               x =  re.sub ('<([^>~]+)~([^>]*)>','<\\1 \\2> ~', str)
+               str =  re.sub ('<([^>~]+)~([^>]*)>','<\\1 \\2> ~', str)
                        
                return str
        
        conversions.append ((1,0,13), conv, '<a ~ b> c -> <a b> ~ c')
 
 if 1:
-       def conv(lines):
-               x =  re.sub ('<\\[','[<', str)
-               x =  re.sub ('\\]>','>]', str)
+       def conv(str):
+               str =  re.sub ('<\\[','[<', str)
+               str =  re.sub ('\\]>','>]', str)
                        
                return str
        
@@ -258,9 +258,9 @@ if 1:
 
 
 if 1:
-       def conv(lines):
-               x =  re.sub ('\\\\type','\\\\context', str)
-               x =  re.sub ('textstyle','textStyle', str)
+       def conv(str):
+               str =  re.sub ('\\\\type','\\\\context', str)
+               str =  re.sub ('textstyle','textStyle', str)
                        
                return str
        
@@ -268,7 +268,7 @@ if 1:
 
 
 if 1:
-       def conv(lines):
+       def conv(str):
                if re.search ('\\\\repeat',str):
                        sys.stderr.write ('\nNot smart enough to convert \\repeat')
                        raise FatalConversionError()
@@ -278,10 +278,10 @@ if 1:
                            '\\repeat NUM Music Alternative -> \\repeat FOLDSTR Music Alternative')
 
 if 1:
-       def conv(lines):
-               x =  re.sub ('SkipBars','skipBars', str)
-               x =  re.sub ('fontsize','fontSize', str)
-               x =  re.sub ('midi_instrument','midiInstrument', x)                     
+       def conv(str):
+               str =  re.sub ('SkipBars','skipBars', str)
+               str =  re.sub ('fontsize','fontSize', str)
+               str =  re.sub ('midi_instrument','midiInstrument', x)                   
                        
                return str
 
@@ -290,10 +290,10 @@ if 1:
 
 
 if 1:
-       def conv(lines):
-               x =  re.sub ('tieydirection','tieVerticalDirection', str)
-               x =  re.sub ('slurydirection','slurVerticalDirection', str)
-               x =  re.sub ('ydirection','verticalDirection', x)                       
+       def conv(str):
+               str =  re.sub ('tieydirection','tieVerticalDirection', str)
+               str =  re.sub ('slurydirection','slurVerticalDirection', str)
+               str =  re.sub ('ydirection','verticalDirection', x)                     
                        
                return str
 
@@ -302,8 +302,8 @@ if 1:
 
 
 if 1:
-       def conv(lines):
-               x =  re.sub ('hshift','horizontalNoteShift', str)
+       def conv(str):
+               str =  re.sub ('hshift','horizontalNoteShift', str)
                        
                return str
 
@@ -312,8 +312,8 @@ if 1:
 
 
 if 1:
-       def conv(lines):
-               x =  re.sub ('\\\\grouping[^;]*;','', str)
+       def conv(str):
+               str =  re.sub ('\\\\grouping[^;]*;','', str)
                        
                return str
 
@@ -322,8 +322,8 @@ if 1:
 
 
 if 1:
-       def conv(lines):
-               x =  re.sub ('\\\\wheel','\\\\coda', str)
+       def conv(str):
+               str =  re.sub ('\\\\wheel','\\\\coda', str)
                        
                return str
 
@@ -331,9 +331,9 @@ if 1:
                            '\\wheel -> \\coda')
 
 if 1:
-       def conv(lines):
-               x =  re.sub ('keyoctaviation','keyOctaviation', str)
-               x =  re.sub ('slurdash','slurDash', str)
+       def conv(str):
+               str =  re.sub ('keyoctaviation','keyOctaviation', str)
+               str =  re.sub ('slurdash','slurDash', str)
                        
                return str
 
@@ -341,8 +341,8 @@ if 1:
                            'slurdash -> slurDash, keyoctaviation -> keyOctaviation')
 
 if 1:
-       def conv(lines):
-               x =  re.sub ('\\\\repeat *\"?semi\"?','\\\\repeat "volta"', str)
+       def conv(str):
+               str =  re.sub ('\\\\repeat *\"?semi\"?','\\\\repeat "volta"', str)
                        
                return str
 
@@ -351,8 +351,8 @@ if 1:
 
 
 if 1:
-       def conv(lines):
-               x =  re.sub ('\"?beamAuto\"? *= *\"?0?\"?','noAutoBeaming = "1"', str)
+       def conv(str):
+               str =  re.sub ('\"?beamAuto\"? *= *\"?0?\"?','noAutoBeaming = "1"', str)
                        
                return str
 
@@ -360,8 +360,8 @@ if 1:
                            'beamAuto -> noAutoBeaming')
 
 if 1:
-       def conv(lines):
-               x =  re.sub ('automaticMelismas', 'automaticMelismata', str)
+       def conv(str):
+               str =  re.sub ('automaticMelismas', 'automaticMelismata', str)
                        
                return str
 
@@ -369,8 +369,8 @@ if 1:
                            'automaticMelismas -> automaticMelismata')
 
 if 1:
-       def conv(lines):
-               x =  re.sub ('dynamicDir', 'dynamicDirection', str)
+       def conv(str):
+               str =  re.sub ('dynamicDir', 'dynamicDirection', str)
                        
                return str
 
@@ -394,7 +394,7 @@ def do_conversion (infile, from_version, outfile, to_version):
        conv_list = get_conversions (from_version, to_version)
 
        sys.stderr.write ('Applying conversions: ')
-       str = infile.read (-1)
+       str = infile.read ()
        last_conversion = ()
        try:
                for x in conv_list:
@@ -408,13 +408,15 @@ def do_conversion (infile, from_version, outfile, to_version):
        if last_conversion:
                sys.stderr.write ('\n')
                new_ver =  '\\\\version \"%s\"' % tup_to_str (last_conversion)
-               if re.search (mudela_version_re_str):
+               if re.search (mudela_version_re_str, str):
                        str = re.sub (mudela_version_re_str,new_ver , str)
                else:
                        str = new_ver + '\n' + str
 
                outfile.write(str)
 
+       return last_conversion
+       
 class UnknownVersion:
        pass
 
@@ -450,8 +452,7 @@ def do_one_file (infile_name):
        else:
                outfile = sys.stdout
 
-       
-       do_conversion (infile, from_version, outfile, to_version)
+       touched = do_conversion (infile, from_version, outfile, to_version)
 
        if infile_name:
                infile.close ()
@@ -459,7 +460,7 @@ def do_one_file (infile_name):
        if outfile_name:
                outfile.close ()
 
-       if __main__.edit:
+       if __main__.edit and touched:
                try:
                        os.remove(infile_name + '~')
                except:
index c1349377c52d0ffe7f12eb188eef3db5500268cf..0ffa3a9bcf6d0f02e8be1cb68f7bdc9789eaae0a 100644 (file)
@@ -4,7 +4,7 @@
 # 
 # source file of the GNU LilyPond music typesetter
 # 
-# (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+# (c) 1998, 1999 Jan Nieuwenhuizen <janneke@gnu.org>
 
 # TODO: regex -> re.
 
@@ -84,6 +84,11 @@ def line_to_ly (s):
                        last_name = name
                else:
                        name = last_name
+               name = lstrip (name)
+               name = rstrip (name)
+               if name == "ms":
+                       name = "s"
+                       duration = 1
                if duration:
                        last_duration = duration
                else:
@@ -91,7 +96,7 @@ def line_to_ly (s):
                name = regsub.sub ("#", "is", name)
                name = regsub.sub ("+", "'", name)
                name = regsub.sub ("-", ",", name)
-               name = regsub.sub ("ms", "s1", name)
+               #name = regsub.sub ("ms", "s1", name)
                notes = notes + " %s%s" % (name, duration)
        return notes
 
@@ -149,7 +154,7 @@ for i in range (len (staffs)):
 lyfile.write ("\\score{\n")
 lyfile.write ("\\notes <\n")
 for i in range (len (staffs)):
-       lyfile.write ("\\type Staff=staff%s <\n" % chr(ord('A')+i))
+       lyfile.write ("\\context Staff=staff%s <\n" % chr(ord('A')+i))
        for v in range (len (staffs[i])):
                lyfile.write ("{ \\$staff%d_voice_%d } " % (i+1, v+1))
        lyfile.write ("\n>\n")
index 7b013a29e711630ac512c395723653f5782591cd..82e8e5b101ab1a12e7cbed6e1ab8c43b064fe76d 100644 (file)
@@ -20,3 +20,4 @@ $(outdir)/%.texi: %.texi
        cp $< $@
 
 
+
index 5aadd24bf235664fc04202f648e12e28478f31d3..b60d82b2d3d54fb686d8f14c7b8af04678a9c2d9 100644 (file)
@@ -1,6 +1,6 @@
 # Yolily_topdoc_targets.make
 
-default: do-doc 
+default: local-doc 
 
 # urg
 $(outdir)/%.html: %.yo