]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 1.3.1 release/1.3.1
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 27 Oct 1999 23:26:49 +0000 (01:26 +0200)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 27 Oct 1999 23:26:49 +0000 (01:26 +0200)
101 files changed:
CHANGES
Documentation/GNUmakefile
Documentation/misc/GNUmakefile
Documentation/ntweb/GNUmakefile
Documentation/programmer/1086342053.tex [deleted file]
Documentation/programmer/hacking.texi
Documentation/topdocs/INSTALL.texi
Documentation/topdocs/README.texi
Documentation/topdocs/index.tely
INSTALL.txt
README.txt
TODO
VERSION
buildscripts/genheader.py
buildscripts/set-lily.sh
flower/include/rational.hh
flower/include/scalar.hh
input/test/staff-line-leading.ly [new file with mode: 0644]
input/test/stem-length.fly [new file with mode: 0644]
input/test/stem-length.ly [new file with mode: 0644]
lily/align-note-column-engraver.cc
lily/auto-beam-engraver.cc
lily/bar-engraver.cc
lily/bar-number-engraver.cc
lily/bar-script-engraver.cc
lily/beam-engraver.cc
lily/beam.cc
lily/breathing-sign.cc
lily/chord-name-engraver.cc
lily/clef-engraver.cc
lily/clef-item.cc
lily/dynamic-engraver.cc
lily/font-size-engraver.cc
lily/include/bar-script-engraver.hh
lily/include/beam.hh
lily/include/font-size-engraver.hh
lily/include/music-output-def.hh
lily/include/paper-def.hh
lily/include/smobs.hh
lily/include/text-item.hh
lily/include/time-signature.hh
lily/include/translator-group.hh
lily/include/translator.hh
lily/lily-guile.cc
lily/lyric-engraver.cc
lily/mark-engraver.cc
lily/moment.cc
lily/note-heads-engraver.cc
lily/note-performer.cc
lily/paper-def.cc
lily/parser.yy
lily/property-engraver.cc [new file with mode: 0644]
lily/property-inspect.cc
lily/rest-engraver.cc
lily/rest.cc
lily/rhythmic-column-engraver.cc
lily/score-element.cc
lily/score-priority-engraver.cc
lily/script-engraver.cc
lily/separating-line-group-engraver.cc
lily/slur-engraver.cc
lily/slur.cc
lily/staff-margin-engraver.cc
lily/staff-performer.cc
lily/staff-sym-engraver.cc
lily/stem-engraver.cc
lily/text-engraver.cc
lily/text-item.cc
lily/tie-engraver.cc
lily/time-signature-engraver.cc
lily/time-signature.cc
lily/timing-translator.cc
lily/translator-group.cc
lily/translator.cc
lily/tuplet-engraver.cc
lily/vertical-align-engraver.cc
ly/declarations.ly
ly/engraver.ly
ly/params.ly
make/out/lilypond.lsm
make/out/lilypond.spec
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
scm/generic-property.scm [new file with mode: 0644]
scripts/convert-mudela.py
stepmake/bin/package-zet.sh
stepmake/stepmake/texinfo-rules.make
stepmake/stepmake/yolily-topdoc-targets.make

diff --git a/CHANGES b/CHANGES
index b7c75936c8e321b409af8eddded1eefe892a1f6c..b7f048a1001759cab5e2f2e8b2c8ab4144351b9d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,19 @@
+pl 3.hwn2,1
+      - Generic properties and Property_engraver. Moved most of the
+properties.
+
+0.lu1
+       - resurrected midi2ly
+
 0.jcn1
        - bf: lyrics lexer
        - reverted mup2ly revert
 
+pl 3.uu1:
+       - frontport of 1.2.17 patches.
+
+**********
+
 1.3.0:
 
 pl 15.hwn2
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) < $< > $@ 
diff --git a/Documentation/programmer/1086342053.tex b/Documentation/programmer/1086342053.tex
deleted file mode 100644 (file)
index e69de29..0000000
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 2a431f3a5c0a8c6d9eb00db2c5f15db14fcb0160..5021801990a0a87e28e8e9b7ca9595ba624b3e5f 100644 (file)
@@ -119,7 +119,8 @@ Website
 documentation on-line documentation. It is made by entering
 
        make website
-   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 c22267cdb82eb69a7b902d125d0e2328761de7e0..957e88819c50878247d6a003bfd76a14b1ef6ad0 100644 (file)
@@ -55,7 +55,7 @@ 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,
 
           Please send your e-mail to one of the MAILING LISTS
 
diff --git a/TODO b/TODO
index 68c356c704bff1585f17c4b62c46dacc7c5aa89c..771ea60f80e6d3542d52a8fc2573a3a18a98aef6 100644 (file)
--- a/TODO
+++ b/TODO
@@ -11,6 +11,13 @@ Grep -i for TODO, FIXME and ugh/ugr/urg.
 .* TODO
 . * make this file understandable for 3rd parties.
 . * use Rhythmic_head::position_i () for all Staff_referenced 
+. * eradicate all VIRTUAL_COPY_CONS () macros ; use indexed creation,
+    eg.
+
+       ctor_dict["Score_element"]->clone_func (orig);
+       ctor_dict["Score_element"]->create_func ();
+
+
 . * note head on stem err msg in dutch.
 . *  why need to run -C mf twice?
 . * fix interstaff stuff
@@ -21,8 +28,7 @@ everything works and matches up; when either is set just a bit above the
 default 5.0 (5.4 is what I was hoping to use), stems miss note heads. So
 it's some sort of a numerical (truncation/roundoff) problem.
 John
-. * metre -> meter
-. * Fixed size staff heights;
+. * Fixed size staff/system heights;
 . * ly2dvi : don't repeat opus if same.
 . * breaks before mmrests are favored.
 . * hara kiri _8 clef.
@@ -55,7 +61,6 @@ from which comes tons of confusion).  It is usually notated as (again, using
 C as the root) Cdim7 or Co7.
 
 . * Mondrup:
-
 - I would like the possibility of forcing clef- and key- changes to be
 printed _after_ the new bar line
 
diff --git a/VERSION b/VERSION
index 0e766f405c73c76b7b3e06515f26eb22672a1f8b..26233811a99f7fb4fdab876fe645114faed7fedf 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,8 +1,8 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
-PATCH_LEVEL=0
-MY_PATCH_LEVEL=jcn1
+PATCH_LEVEL=1
+MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 2f57d1a9582dbdd317a6aa07bbaccac4d99d1064..bfe64c9be67e191c8599a4b9ac98cfcad7059e27 100755 (executable)
@@ -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 f809aba7d3ea6aa3f14ad7ca852a6766e508658d..a4c77ff0cd65e6912506b11ee2f8e6bd31fc84f6 100755 (executable)
@@ -34,7 +34,11 @@ testvar ()
        fi
 }
 
-. ./stepmake/bin/package-zet.sh
+
+# . ./stepmake/bin/package-zet.sh
+sourcetree=`basename \`pwd\``
+(cd .. ; rm lilypond-devel ; showln -s $sourcetree lilypond-devel)
+
 
 echo You should add the following to your profile script
 echo
@@ -52,8 +56,8 @@ showln -sf $LILYPOND_SOURCEDIR/midi2ly/out/midi2ly $prefix/bin/midi2ly
 showln -sf $LILYPOND_SOURCEDIR/scripts/out/ly2dvi $prefix/bin/ly2dvi
 showln -sf $LILYPOND_SOURCEDIR/scripts/out/mudela-book $prefix/bin/mudela-book
 showln -sf $LILYPOND_SOURCEDIR/buildscripts/out/genheader $prefix/bin/genheader
-chmod 755 $LILYPOND_SOURCEDIR/buildscripts/ps-to-gifs.sh
-showln -sf $LILYPOND_SOURCEDIR/buildscripts/ps-to-gifs.sh $prefix/bin/ps-to-gifs
+
+
 
 testmkdir $prefix/share
 rm -rf $prefix/share/lilypond
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.
diff --git a/input/test/staff-line-leading.ly b/input/test/staff-line-leading.ly
new file mode 100644 (file)
index 0000000..03a5daf
--- /dev/null
@@ -0,0 +1,8 @@
+\score { 
+  \notes \relative c'' \context GrandStaff <
+       \context Staff = up { c4 c4  }
+       \context Staff = down { \property Staff. staffLineLeading = #5.5 c4
+         <c8 d f g>
+        }
+>
+}
diff --git a/input/test/stem-length.fly b/input/test/stem-length.fly
new file mode 100644 (file)
index 0000000..00718bc
--- /dev/null
@@ -0,0 +1,2 @@
+
+g''4 \property Voice.stemLength = #14  g4 \property Voice.stemLength = #3 g4  g,,4  
diff --git a/input/test/stem-length.ly b/input/test/stem-length.ly
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
index c28320f301dc084e9b66fadf19227c5c7a8786fb..74967e7b66807a8f0ff7144245bf0b82c1d933d7 100644 (file)
@@ -86,7 +86,7 @@ Align_note_column_engraver::process_acknowledged ()
 
       */
       SCM grsp = get_property ("graceAccidentalSpace", 0);
-      if (SCM_NUMBERP(grsp))
+      if (gh_number_p(grsp))
        {
          /*
            ugh.
index 7caf691c79f9e4e02b9da81369eaa87705e4d400..c2d30f6d504a0786506e36e5516c5b9c3943117b 100644 (file)
@@ -66,6 +66,13 @@ Auto_beam_engraver::consider_end_and_begin (Moment test_mom)
   if (test_mom.den () != 1)
     type_str = type_str + "_" + to_str (test_mom.den ());
 
+  /*
+    URG
+    
+    FIXME: SHOULD USE ALIST
+    
+   */
+
   /*
     Determine end moment for auto beaming (and begin, mostly 0==anywhere) 
     In order of increasing priority:
@@ -203,24 +210,7 @@ Auto_beam_engraver::create_beam_p ()
       beam_p->add_stem ((*stem_l_arr_p_)[i]);
     }
   
-  /* urg, copied from Beam_engraver */
-  SCM prop = get_property ("beamslopedamping", 0);
-  if (SCM_NUMBERP(prop)) 
-    beam_p->set_elt_property (damping_scm_sym, prop);
-
-  prop = get_property ("autoKneeGap", 0);
-  if (SCM_NUMBERP(prop)) 
-    beam_p->set_elt_property (auto_knee_gap_scm_sym, prop);
-
-  prop = get_property ("autoInterstaffKneeGap", 0);
-  if (SCM_NUMBERP(prop)) 
-    beam_p->set_elt_property (auto_interstaff_knee_gap_scm_sym, prop);
-      
-  prop = get_property ("beamquantisation", 0);
-  if (SCM_NUMBERP(prop)) 
-    beam_p->quantisation_ = (Beam::Quantisation)(int)prop;
-  announce_element (Score_element_info (beam_p, 0));
+
   return beam_p;
 }
 
index 5811e6dc864c1b4a4be43938f9f920c03852fc33..92378ccbd8152f1fe14f9d9d3707504675b77e09 100644 (file)
@@ -49,11 +49,6 @@ Bar_engraver::create_bar ()
        {
          bar_p_->set_elt_property (at_line_start_scm_sym, SCM_BOOL_T);
        }
-      prop = get_property ("barSize", 0);
-      if (SCM_NUMBERP(prop))
-       {
-         bar_p_->set_elt_property (bar_size_scm_sym, prop);
-       }
       announce_element (Score_element_info (bar_p_, 0));
     }
 }
index 9db68461fbff5f2932cfc4a9712c806254eb3220..2db31f2b918ab1cc9fcc044a936fc088efc14647 100644 (file)
@@ -33,7 +33,6 @@ Bar_number_engraver::do_process_requests ()
       create_items (0);
        
       text_p_->text_str_ = to_str (time->bars_i_);
-      text_p_->style_str_ = "roman";
     }
 }
 
index 12e94befc1f3d2cae47bd8e0c45f58dd8e9d0f15..cf73f365007d64f116a5d0d8c6685d44883ea832 100644 (file)
@@ -45,7 +45,7 @@ Bar_script_engraver::do_creation_processing ()
 */
  
 void
-Bar_script_engraver::do_acknowledge_element (Item *i)
+Bar_script_engraver::attach_script_to_item (Item *i)
 {
   Axis other_axis = Axis((axis_ + 1)%2);
   if (staff_side_p_ && !staff_side_p_->parent_l(other_axis)) 
@@ -106,7 +106,7 @@ Bar_script_engraver::acknowledge_element (Score_element_info inf)
       if (inf.origin_trans_l_arr_.size () != 1)
        return;
 
-      do_acknowledge_element (i);
+      attach_script_to_item (i);
     }
 }
 
@@ -154,7 +154,7 @@ Bar_script_engraver::create_items (Request *rq)
   staff_side_p_->set_victim(text_p_);
   
   SCM padding = get_property (type_ + "ScriptPadding", 0);
-  if (SCM_NUMBERP(padding))
+  if (gh_number_p(padding))
     {
       staff_side_p_->set_elt_property (padding_scm_sym, padding);
     }
index 6022a0a5781bc8cd929a48dc9c3581c52a897c3a..99a7c00d28bd2880593aa829728c09f24fbc887c 100644 (file)
@@ -99,21 +99,6 @@ Beam_engraver::do_process_requests ()
       
       
       /* urg, must copy to Auto_beam_engraver too */
-      SCM prop = get_property ("beamslopedamping", 0);
-      if (SCM_NUMBERP(prop)) 
-       beam_p_->set_elt_property (damping_scm_sym, prop);
-      
-      prop = get_property ("autoKneeGap", 0);
-      if (SCM_NUMBERP(prop)) 
-       beam_p_->set_elt_property (auto_knee_gap_scm_sym, prop);
-      
-      prop = get_property ("autoInterstaffKneeGap", 0);
-      if (SCM_NUMBERP(prop)) 
-       beam_p_->set_elt_property (auto_interstaff_knee_gap_scm_sym, prop);
-
-      prop = get_property ("beamquantisation", 0);
-      if (SCM_NUMBERP(prop)) 
-       beam_p_->quantisation_ = (Beam::Quantisation)gh_scm2int(prop);
  
       announce_element (Score_element_info (beam_p_, reqs_drul_[START]));
     }
index 83d83260aed0c335742e73dd8131beb00e0fc2b6..69de9292315ab38349ca5ea41697619fe2fe31dd 100644 (file)
@@ -41,7 +41,6 @@ Beam::Beam ()
 {
   slope_f_ = 0;
   left_y_ = 0;
-  quantisation_ = NORMAL;
   multiple_i_ = 0;
 }
 
@@ -283,34 +282,32 @@ Beam::get_default_dir () const
   Direction beam_dir;
   Direction neutral_dir = (Direction)(int)paper_l ()->get_var ("stem_default_neutral_direction");
 
-  Dir_algorithm a = (Dir_algorithm)rint(paper_l ()->get_var ("beam_dir_algorithm"));
-  switch (a)
+  SCM a = get_elt_property (gh_symbol2scm ("beam_dir_algorithm"));
+  a= gh_cdr (a);
+  
+  if (a == gh_symbol2scm ("majority")) // should get default from paper.
+    beam_dir = (count[UP] == count[DOWN]) ? neutral_dir 
+      : (count[UP] > count[DOWN]) ? UP : DOWN;
+  else if (a == gh_symbol2scm ("mean"))
+    // mean center distance
+    beam_dir = (total[UP] == total[DOWN]) ? neutral_dir
+      : (total[UP] > total[DOWN]) ? UP : DOWN;
+  else if (a == gh_symbol2scm ("median"))
     {
-    case MAJORITY:
-      beam_dir = (count[UP] == count[DOWN]) ? neutral_dir 
-        : (count[UP] > count[DOWN]) ? UP : DOWN;
-      break;
-    case MEAN:
-      // mean center distance
-      beam_dir = (total[UP] == total[DOWN]) ? neutral_dir
-        : (total[UP] > total[DOWN]) ? UP : DOWN;
-      break;
-    default:
-    case MEDIAN:
       // median center distance
-      if (!count[DOWN] || !count[UP])
-        {
-         beam_dir = (count[UP] == count[DOWN]) ? neutral_dir 
-           : (count[UP] > count[DOWN]) ? UP : DOWN;
-       }
-      else
-        {
+      if (count[DOWN] && count[UP])
+       {
          beam_dir = (total[UP] / count[UP] == total[DOWN] / count[DOWN]) 
            ? neutral_dir 
-             : (total[UP] / count[UP] > total[DOWN] / count[DOWN]) ? UP : DOWN;
+           : (total[UP] / count[UP] > total[DOWN] / count[DOWN]) ? UP : DOWN;
+       }
+      else
+       {
+         beam_dir = (count[UP] == count[DOWN]) ? neutral_dir 
+           : (count[UP] > count[DOWN]) ? UP : DOWN;
        }
-      break;
     }
+  
   return beam_dir;
 }
 
@@ -517,7 +514,10 @@ Beam::quantise_dy ()
     + n * interline
     */
 
-  if (quantisation_ <= NONE)
+  SCM q = get_elt_property (gh_symbol2scm ("slope_quantisation"));
+  q = gh_cdr (q);
+  
+  if (q == gh_symbol2scm ("none"))
     return;
 
   Real interline_f = stems_[0]->staff_line_leading_f ();
@@ -532,7 +532,6 @@ Beam::quantise_dy ()
   
   Real quanty_f = 0.0;
 
-  /* UGR.   ICE in 2.8.1; bugreport filed. */
   Array<Real> allowed_fraction (3);
   allowed_fraction[0] = 0;
   allowed_fraction[1] = (beam_f / 2 + staffline_f / 2);
@@ -560,9 +559,8 @@ Beam::quantise_left_y (bool extend_b)
     we only need to quantise the start of the beam as dy is quantised too
    if extend_b then stems must *not* get shorter
    */
-
-  if (quantisation_ == NONE)
-    return;
+  SCM q = get_elt_property (gh_symbol2scm ("slope_quantisation"));
+  q = gh_cdr (q);
 
   /*
     ----------------------------------------------------------
@@ -607,7 +605,7 @@ Beam::quantise_left_y (bool extend_b)
   Real beamdy_f = beamdx_f * slope_f_ * internote_f;
 
   Array<Real> allowed_position;
-  if (quantisation_ <= NORMAL) 
+  if (q == gh_symbol2scm ("normal"))
     {
       if ((multiple_i_ <= 2) || (abs (beamdy_f) >= staffline_f / 2))
        allowed_position.push (straddle);
@@ -615,9 +613,9 @@ Beam::quantise_left_y (bool extend_b)
        allowed_position.push (sit);
       allowed_position.push (hang);
     }
-  else
-    // TODO: check and fix TRADITIONAL
+  else if (q == gh_symbol2scm ("traditional"))
     {
+      // TODO: check and fix TRADITIONAL
       if ((multiple_i_ <= 2) || (abs (beamdy_f) >= staffline_f / 2))
        allowed_position.push (straddle);
       if ((multiple_i_ <= 1) && (beamdy_f <= staffline_f / 2))
index 0fff51106f00d4227043cd438442079ffdae85df..923eeeab1e3f4841ae3ec95591ad51b3d5f5d45d 100644 (file)
@@ -23,7 +23,6 @@ Breathing_sign::Breathing_sign ()
 {
   dir_ = UP;
   set_elt_property (breakable_scm_sym, SCM_BOOL_T);
-  set_elt_property (break_priority_scm_sym, gh_int2scm (-4));
   set_elt_property (visibility_lambda_scm_sym,
                    ly_ch_C_eval_scm ("non_postbreak_visibility"));
 }
index d0005c89833380089873a782a1255e9143631311..08d397b6f380e27d6df7f37c3712d3d17b7c7a59 100644 (file)
@@ -83,10 +83,6 @@ Chord_name_engraver::do_process_requests ()
 
   item_p->text_str_ = chord.banter_str (inversion);
   
-  SCM style = get_property ("textStyle", 0);
-  if (gh_string_p (style))
-    item_p->style_str_ = ly_scm2string (style);
-  
   text_p_arr_.push (item_p);
   announce_element (Score_element_info (item_p, 0));
 }
index 68d96cef59cd25f3193dbcb88f7c60a20490e427..335ff0a62f16efbfbb3f78e2bd3ae89e24693296 100644 (file)
@@ -190,11 +190,6 @@ Clef_engraver::create_clef()
   if (!clef_p_)
     {
       Clef_item *c= new Clef_item;
-      c->set_elt_property (break_priority_scm_sym, gh_int2scm (-2)); // ugh
-      SCM clefstyle = get_property ("clefStyle", 0);
-      if (gh_string_p(clefstyle))
-       c->set_elt_property (style_scm_sym, clefstyle);
-      
       announce_element (Score_element_info (c, clef_req_l_));
       clef_p_ = c;
     }
index 2919255e71d13168fb90e1f93a1679df038a9531..f203d39baeac11b79b3cd740d91251c74f67fca3 100644 (file)
@@ -60,7 +60,7 @@ Clef_item::do_add_processing ()
          pscore_l_->typeset_element (g);
       
          g->text_str_ = "8";
-         g->style_str_ = "italic";
+         g->set_elt_property (style_scm_sym, gh_str02scm ("italic"));
          g->set_parent (this, Y_AXIS);
          g->set_parent (this, X_AXIS);   
 
index 2933131c8d26b62339cb48bd4a07469e56230ef7..93dc2e7d5acfa89de09436befac7b41972eeea8e 100644 (file)
@@ -131,7 +131,7 @@ Dynamic_engraver::do_process_requests()
            }
 
          prop = get_property ("dynamicDirection", 0);
-         if (SCM_NUMBERP(prop))
+         if (gh_number_p(prop))
            {
              staff_side_p_->dir_ = to_dir (prop);
            }
@@ -141,7 +141,7 @@ Dynamic_engraver::do_process_requests()
            }
 
          prop = get_property ("dynamicPadding", 0);
-         if (SCM_NUMBERP(prop))
+         if (gh_number_p(prop))
            {
              staff_side_p_->set_elt_property (padding_scm_sym, prop);
            }
@@ -180,7 +180,7 @@ Dynamic_engraver::do_process_requests()
                      to_end_ss_span_p_->dir_ = to_dir (prop);
                    }
                  prop = get_property ("dynamicPadding", 0);
-                 if (SCM_NUMBERP(prop))
+                 if (gh_number_p(prop))
                    {
                      to_end_ss_span_p_->set_elt_property (padding_scm_sym,prop);
                    }
index b8d91ae55cc93c501baff57c2491680d6a923902..4f706b34bf29ad2094e0f6797a2b0c86d27cf89f 100644 (file)
@@ -13,7 +13,7 @@
 
 Font_size_engraver::Font_size_engraver ()
 {
-  size_i_ = 0;
+  size_ = SCM_EOL;
 }
 
 void
@@ -21,20 +21,25 @@ Font_size_engraver::do_process_requests ()
 {
   SCM s (get_property ("fontSize", 0));
   
-  if (SCM_NUMBERP(s))
+  if (gh_number_p(s))
     {
-      size_i_ = gh_scm2int (s);
+      size_ = gh_scm2int (s);
+    }
+  else
+    {
+      size_ = SCM_EOL;
     }
 }
 
 void
 Font_size_engraver::acknowledge_element (Score_element_info e)
 {
-  if (size_i_ && e.elem_l_->get_elt_property (fontsize_scm_sym) == SCM_BOOL_F)
+  if (size_ != SCM_EOL
+      && e.elem_l_->get_elt_property (fontsize_scm_sym) == SCM_BOOL_F)
     {
-      e.elem_l_->set_elt_property (fontsize_scm_sym,
-                                  gh_int2scm (size_i_));
+      e.elem_l_->set_elt_property (fontsize_scm_sym, size_);
     }
 }
+
 ADD_THIS_TRANSLATOR (Font_size_engraver);
 
index dec3c05ef6686107f48adef00e9be76832f6f921..a3642a29a68bb7acdbb9b11b4521b2203b3d9d36 100644 (file)
@@ -31,7 +31,7 @@ protected:
   /**
     Put the script on #it#
    */
-  void do_acknowledge_element (Item *it);
+  void attach_script_to_item (Item *it);
   /**
      Return non-nil if we want to hang something on this.
    */
index 9e1cbb83464ebcac28b9143d10dc68890083b364..de68f6f99ca4936d8d0597da61756bf1e68e22ad 100644 (file)
@@ -23,6 +23,7 @@ damping: amount of beam slope damping. (int)
 
 should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams 
 
+slope_quantisation: 'none, 'normal or 'traditional
 
 */
 class Beam : public Directional_spanner  {
@@ -44,11 +45,7 @@ public:
   /// position of leftmost end of beam  
   Real left_y_;
 
-  /** should beam pos / slope be quantised? 0: no, 1: yes, 2: traditional
-      JUNKME.
-   */
-  Quantisation quantisation_;
-  
+
   /// maximum number of beams (for opening-up of beam-spacing)
   int multiple_i_;
 
index 0edef5be86e4db8908b024867e1a47475e48cb80..d36ee646830232a0f71caf60f017f4758b5ed35e 100644 (file)
@@ -11,7 +11,7 @@
 #define FONT_SIZE_GRAV_HH
 
 #include "engraver.hh"
-
+#include "protected-scm.hh"
 /**
    Set font size on elements that do not have a fontsize set yet.
 
@@ -20,7 +20,7 @@
    Writes element property fontsize 
  */
 class Font_size_engraver : public Engraver {
-  int size_i_;
+  Protected_scm size_;
 protected:
   virtual void acknowledge_element (Score_element_info);
   virtual void  do_process_requests ();
index 45644294ee689e4e237c4ccff2142491bb472342..ee91b59f8a137f82b8a3f88442a548fdeb6971da 100644 (file)
@@ -14,6 +14,7 @@
 #include "lily-proto.hh"
 #include "virtual-methods.hh"
 #include "dictionary.hh"
+#include "scm-hash.hh"
 
 /**
   Definition of how to output mudela. 
@@ -25,6 +26,7 @@ public:
   Scope *scope_p_;
   
   Array<String> filename_str_arr_;
+  Scheme_hash_table default_properties_;
   
   Music_output_def (Music_output_def const&);
   Music_output_def ();
index 8615d9cf86c957ab430f8d8da40e889f88cff8cd..f9393470943728b4f81112537d994015b400d83f 100644 (file)
@@ -57,7 +57,6 @@ public:
   Real get_realvar (SCM symbol) const;
   Real get_var (String id) const;
 
-  SCM get_scm_var (SCM sym) const;
   
   void reinit ();
   Paper_def ();
index a038db298e7ddf004b62358c01e85e9534bc8811..5c44644c2ec22e8542fb697d390a7b063b066121 100644 (file)
@@ -33,6 +33,7 @@
        static scm_sizet free_smob (SCM s);                     \
        static int print_smob (SCM s, SCM p, scm_print_state*); \
        static long smob_tag_;                                  \
+       static SCM equal_p (SCM a, SCM b);\
        static void init_smobs();                               \
        void unsmobify_self ();\
         void do_smobify_self();\
index 8b73e999bb6714aa9b6fc9c1ddda951b1ac40475..4e628f27870ab4a1333f33c52a2a9e20848cfd1d 100644 (file)
@@ -19,9 +19,7 @@ class Text_item : public Item
 {
 public:
   String text_str_;
-  String style_str_;
 
-  Text_item ();
   VIRTUAL_COPY_CONS (Score_element);
 protected:
   virtual void do_print () const;
index 771ff759af86711f64a45dc89095aab89b125e39..39401cb2080de0b519a6d4a94d1cc518abe6c311 100644 (file)
@@ -27,8 +27,6 @@ protected:
 public:
   Time_signature () ;
   Array<int> args_;
-  String time_sig_type_str_;
-  
   
   VIRTUAL_COPY_CONS(Score_element);
 };
index 00da2cd3917804bd9d78a4d71a2d8cf6ac725649..e1d91d1aeab4c7fa0328b2ae8641e3871205ae97 100644 (file)
@@ -38,8 +38,9 @@ class Translator_group : public virtual Translator {
   Cons_list<Translator> trans_p_list_;
 
 public:
-  SCM get_property (String type_str, Translator_group  **where_found_l) const;
+  SCM get_property (SCM name_sym, Translator_group  **where_found_l) const;
   void set_property (String var_name, SCM value);
+  
 
   String id_str_;
 
index ec0feb943f3484cc5de8b985a05a62ff38337dec..598544b142d8cbdf24ddd4714903127acee43b2d 100644 (file)
@@ -59,7 +59,10 @@ public:
     ask daddy for a feature
     */
   Music_output_def *output_def_l () const;
+
   SCM get_property (String, Translator_group **) const;
+  SCM get_property (SCM symbol, Translator_group **) const;
+  
   virtual Moment now_mom () const;  
 
 protected:
index 51b56ca726deb798e2b889965d80486f795a0837..b42b34592e93b3788fe0c8db276aefba09bbf8d5 100644 (file)
@@ -109,7 +109,7 @@ ly_quote_scm (SCM s)
 SCM
 ly_symbol (String name)
 {
-  return gh_car (scm_intern ((char*)name.ch_C(), name.length_i()));
+  return gh_symbol2scm ((char*)name.ch_C());
 }
 
 String
index 080546f2f5fe6524e18e880304043fb607b9f1b1..f6b61316fa50995b51fa8a8ec7f5bceb09d39d99 100644 (file)
@@ -44,10 +44,6 @@ Lyric_engraver::do_process_requests()
       text_p_->text_str_ = req_l_->text_str_;
       text_p_->text_str_ += " ";       // ugh.
 
-      SCM style = get_property ("textStyle", 0);
-      if (gh_string_p(style))
-       text_p_->style_str_ = ly_scm2string (style);
-
       text_p_->set_elt_property (non_rhythmic_scm_sym, SCM_BOOL_T);
       
       announce_element (Score_element_info (text_p_, req_l_));
index 1c4b966a4fa7d139629ff5c84b3abd2e1ad20fb2..444bd2ffeb46985750cf307502fa1c792a443ee3 100644 (file)
@@ -46,7 +46,8 @@ Mark_engraver::do_process_requests ()
     {
       create_items (mark_req_l_);
       text_p_->text_str_ = mark_req_l_->str_;
-      text_p_->style_str_ = text_p_->text_str_.index_any_i ("0123456789") >= 0 
-       ? "mark" : "Large";
+      SCM st = gh_str02scm ((text_p_->text_str_.index_any_i ("0123456789")  >= 0 )
+                           ? "mark" : "large");
+      text_p_->set_elt_property (style_scm_sym,  st);
     }
 }
index 7b76747d7372be3f9d337952ca8303e6d427bd2e..94d65eab45908f2c7505172309927af96bde03fb 100644 (file)
@@ -67,3 +67,12 @@ init_moments ()
 }
 
 ADD_SCM_INIT_FUNC(moms,init_moments);
+
+SCM
+Moment::equal_p (SCM a, SCM b)
+{
+  Moment *m1 = SMOB_TO_TYPE(Moment, a);
+  Moment *m2 = SMOB_TO_TYPE(Moment, b);
+      
+  return (*m1 == *m2) ? SCM_BOOL_T : SCM_BOOL_F;
+}
index 99477e09d74076452d0a4e83db6a3fa6d363d4db..92c4b7ef986f2fc53a4106c51ddee706acdbd418 100644 (file)
@@ -73,12 +73,13 @@ Note_heads_engraver::do_process_requests()
        }
       note_p->position_i_  = note_req_l->pitch_.steps ();
 
+      /*
+       TODO: transparent note heads.
+       */
+        
       if (gh_string_p (noteheadstyle))
        {
-         if (ly_scm2string (noteheadstyle) == "transparent")
-           note_p->set_elt_property (transparent_scm_sym, SCM_BOOL_T);
-         else 
-           note_p->set_elt_property (style_scm_sym, noteheadstyle);
+         note_p->set_elt_property (style_scm_sym, noteheadstyle);
        }
       
       Score_element_info itinf (note_p,note_req_l);
index f455204067df9a2a76e4463d1f11ed3bdc94de9f..25a49c2f8591ff34d540461ab0485fc6d6716d4b 100644 (file)
@@ -38,7 +38,7 @@ Note_performer::do_process_requests ()
       int transposing_i = 0;
       //urg
       SCM prop = get_property ("transposing", 0);
-      if (SCM_NUMBERP(prop)) 
+      if (gh_number_p(prop)) 
        transposing_i = gh_scm2int (prop);
 
       while (note_req_l_arr_.size ())
index c5a9146f811d1240a9c1d6ed563334f7a499804d..ead9c06ae5930001a3c42f56daed25ea3accdf53 100644 (file)
@@ -54,33 +54,6 @@ Paper_def::Paper_def (Paper_def const&s)
     }
 }
 
-SCM
-Paper_def::get_scm_var (SCM s) const
-{
-  if (!scope_p_->elem_b (s))
-    return SCM_BOOL_F;
-
-  Identifier * id = scope_p_->elem (s);
-  
-  SCM z;
-  SCM_NEWCELL (z);
-  SCM_SETCAR(z, s);
-
-  SCM val;
-  
-  if (dynamic_cast<Real_identifier*> (id))
-    {
-      Real r = *id->access_content_Real (false);
-      val = gh_double2scm (r);
-    }
-  else
-    {
-      return SCM_BOOL_F;
-    }
-  
-  SCM_SETCDR(z,val);
-  return z;
-}
 
 Real
 Paper_def::get_var (String s) const
index c5b3927e59392af55540fb7e6a0c1ff7c71d0a74..fb8e92a65e9ac18fc6dee40f4c2b6bf990b01faf 100644 (file)
@@ -550,7 +550,13 @@ paper_def_body:
                $$->set_lookup ($2, l);
        }
        | paper_def_body assignment semicolon {
-
+               
+       }
+       | paper_def_body SCM_T '=' SCM_T {
+               if (!gh_symbol_p ($2))
+                       THIS->parser_error ("expect a symbol as lvalue");
+               else
+                       $$->default_properties_[$2] = $4;
        }
        | paper_def_body translator_spec_block {
                $$->assign_translator ($2);
diff --git a/lily/property-engraver.cc b/lily/property-engraver.cc
new file mode 100644 (file)
index 0000000..1ff1282
--- /dev/null
@@ -0,0 +1,74 @@
+/*   
+  property-engraver.cc --  implement Property engraver
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#include "lily-guile.hh"
+#include "engraver.hh"
+#include "protected-scm.hh"
+#include "dictionary.hh"
+#include "score-element.hh"
+
+class Property_engraver : public Engraver
+{
+  Dictionary<Protected_scm> prop_dict_;
+  void apply_properties (SCM, Score_element*);
+
+protected:
+  virtual void acknowledge_element (Score_element_info ei);
+  virtual void do_creation_processing ();
+
+  VIRTUAL_COPY_CONS(Translator);
+};
+
+void
+Property_engraver::do_creation_processing ()
+{
+  SCM plist = get_property ("Generic_property_list", 0);
+  for (; SCM_NIMP (plist); plist = gh_cdr (plist))
+    {
+      SCM elt_props = gh_car (plist);
+      prop_dict_[ly_scm2string (gh_car (elt_props))] = gh_cdr (elt_props);
+    }
+}
+
+void
+Property_engraver::acknowledge_element (Score_element_info i)
+{
+  if (prop_dict_.elem_b (i.elem_l_->name()))
+    {
+      SCM p = prop_dict_[i.elem_l_->name()];
+      apply_properties (p,i.elem_l_);
+    }
+  if (prop_dict_.elem_b ("all"))
+    {
+      apply_properties (prop_dict_["all"], i.elem_l_);
+    }
+}
+
+void
+Property_engraver::apply_properties (SCM p, Score_element *e)
+{  
+  for (; SCM_NIMP (p); p = gh_cdr (p))
+    {
+      SCM entry = gh_car (p);
+      SCM prop_sym = gh_car (entry);
+      SCM type_p   = gh_cadr (entry);
+      SCM elt_prop_name = gh_caddr (entry);
+
+      if (e->get_elt_property (elt_prop_name) != SCM_BOOL_F)
+       continue;
+      
+      SCM val = get_property (prop_sym, 0);
+      if (val != SCM_UNDEFINED
+         && gh_apply (type_p, scm_listify (val, SCM_UNDEFINED))
+         == SCM_BOOL_T)
+       e->set_elt_property (elt_prop_name, val);
+    }
+}
+
+ADD_THIS_TRANSLATOR(Property_engraver);
index 5e29f4160b094c8e262ea205cb960ea5ea7bb01e..57093f8bce8adffac3f6485baee180df7ac6415d 100644 (file)
@@ -12,7 +12,7 @@
 bool
 isdir_b (SCM s)
 {
-  if (SCM_NUMBERP (s))
+  if (gh_number_p (s))
     {
       int i = gh_int2scm (s);
       return i>= -1 && i <= 1; 
index 939baa21612a12f04c016b1f7c02a937db5190eb..dde03daa1c844476d32ebdc6dcd2a5126874692c 100644 (file)
@@ -56,12 +56,7 @@ Rest_engraver::do_process_requests ()
          dot_p_->dots_i_ = rest_req_l_->duration_.dots_i_;       
          announce_element (Score_element_info (dot_p_,0));
        }
-      if (rest_p_->balltype_i_ >= 2) 
-       {
-         SCM reststyle = get_property ("restStyle", 0);
-         if (gh_string_p (reststyle))
-           rest_p_->set_elt_property (style_scm_sym,reststyle);
-       }
+
       announce_element (Score_element_info (rest_p_, rest_req_l_));
     }
 }
index daa9ceb5ddfe2780c19559292e340a2d190bb78a..14e10a35379f5b667f2c8e14857db126070e4785 100644 (file)
@@ -52,7 +52,7 @@ Rest::do_brew_molecule_p () const
   
   String style; 
   SCM style_sym =get_elt_property (style_scm_sym);
-  if (style_sym != SCM_BOOL_F)
+  if (balltype_i_ >= 2 && style_sym != SCM_BOOL_F)
     {
       style = ly_scm2string (SCM_CDR(style_sym));
     }
index 914a2c2ecfdefa1577e9f4757a5c861e07d5671a..5862e6f790e2910aae9d633fff7fb52177618a4d 100644 (file)
@@ -107,18 +107,6 @@ Rhythmic_column_engraver::do_pre_move_processing()
 {
   if (ncol_p_) 
     {
-      SCM sh = get_property ("horizontalNoteShift", 0);
-      if (SCM_NUMBERP(sh))
-       {
-         ncol_p_->set_elt_property (horizontal_shift_scm_sym, sh);
-       }
-
-      sh = get_property ("forceHorizontalShift" ,0);
-      if (SCM_NUMBERP(sh))
-       {
-         ncol_p_->set_elt_property (force_hshift_scm_sym, sh);
-       }
-
       typeset_element (ncol_p_);
       ncol_p_ =0;
     }
index a8a82a8a87c6cb0f3e636e28fdce7655a56e4633..487a6c0d56bebb6d1612bf7e2d1d71a7271a8d07 100644 (file)
@@ -93,10 +93,17 @@ Score_element::get_elt_property (SCM sym) const
   SCM s =  scm_assq(sym, element_property_alist_);
 
   // is this a good idea?
-  if (s == SCM_BOOL_F && pscore_l_ && pscore_l_->paper_l_)
-    s = pscore_l_->paper_l_->get_scm_var (sym);
+  if (s != SCM_BOOL_F)
+    return s;
 
-  return s;
+  if (pscore_l_)
+    {
+      // should probably check for Type::sym as well.
+      if (pscore_l_->paper_l_->default_properties_.elem_b (sym))
+       return pscore_l_->paper_l_->default_properties_[sym];
+    }
+  
+  return SCM_BOOL_F;
 }
 
 SCM
@@ -464,3 +471,9 @@ Score_element::do_smobify_self ()
 }
 #include "ly-smobs.icc"
 IMPLEMENT_SMOBS(Score_element);
+
+SCM
+Score_element::equal_p (SCM a, SCM b)
+{
+  return SCM_CDR(a) == SCM_CDR(b) ? SCM_BOOL_T : SCM_BOOL_F;
+}
index 3530c26a255eaaeb17845d3de0ea6fde7cf8e53a..c72a60d01f8ec7ada51ee27e64ba79228f48f336 100644 (file)
@@ -44,8 +44,8 @@ Score_priority_engraver::acknowledge_element (Score_element_info inf)
       if (item_l->empty_b (X_AXIS) || item_l->parent_l (X_AXIS))
        return;
 
-      bool breakable
-       = (item_l->remove_elt_property (breakable_scm_sym) != SCM_BOOL_F);
+      SCM bp=item_l->remove_elt_property (breakable_scm_sym);
+      bool breakable = (bp != SCM_BOOL_F);
       if (!breakable)
        return ;
 
index ae2dfa312e94d391637f6b7105c0eefb0d7ac057..f7657e676fdb81a0eacae872714814055dbc8e6e 100644 (file)
@@ -71,14 +71,14 @@ Script_engraver::do_process_requests()
          ss->dir_ = (Direction)force_dir;
 
       SCM dir_prop (get_property ("articulationScriptVerticalDirection", 0));
-      if (SCM_NUMBERP(dir_prop))
+      if (gh_number_p(dir_prop))
        ss->dir_ = to_dir (dir_prop);
 
       if (l->dir_)
        ss->dir_ = l->dir_;
 
       SCM paddingprop = get_property ("articulationScriptPadding", 0);
-      if (SCM_NUMBERP(paddingprop))
+      if (gh_number_p(paddingprop))
        {
          ss->set_elt_property (padding_scm_sym, paddingprop);
        }
@@ -92,7 +92,7 @@ Script_engraver::do_process_requests()
 
       p->set_staff_side (ss);
       ss->set_elt_property (script_priority_scm_sym, priority);
-      if (SCM_NUMBERP (paddingprop))
+      if (gh_number_p (paddingprop))
        ss->set_elt_property (padding_scm_sym, paddingprop);
   
   
index 35e24dab23330e86b21c71bbbbbf2ff021717413..41be6e318066be3b064f337df797f5597e285179 100644 (file)
@@ -32,7 +32,7 @@ void
 Separating_line_group_engraver::do_removal_processing ()
 {
   SCM sz (get_property ("postBreakPadding", 0));
-  if (SCM_NUMBERP(sz))
+  if (gh_number_p(sz))
     {
       sep_span_p_->padding_f_ = Real(sz);
     }
index 0ac32e8d347fc1cf2b1af134a732e9a38c19eb54..045373378dc863647b16dddc7ddeae6595040ac3 100644 (file)
@@ -91,10 +91,6 @@ Slur_engraver::do_process_requests()
          // push a new slur onto stack.
          //(use temp. array to wait for all slur STOPs)
          Slur * s_p =new Slur;
-         SCM prop = get_property ("slurDash", 0);
-         if (SCM_NUMBERP(prop)) 
-           s_p->set_elt_property (dashed_scm_sym, prop);
-
          
          requests_arr_.push (slur_req_l);
          start_slur_l_arr_.push (s_p);
@@ -112,7 +108,7 @@ Slur_engraver::do_pre_move_processing()
   SCM dir2 (get_property ("verticalDirection", 0));
 
   Direction slurdir = CENTER;
-  if (SCM_NUMBERP(dir))
+  if (gh_number_p(dir))
     slurdir = to_dir (dir);
   else if (gh_number_p (dir2))
     slurdir = to_dir (dir2);
index 9e3b16d827cf03ec7565db98cdc067f556c6fa0e..8f04b9fa76244646d47304010ef2de119f54a8d5 100644 (file)
@@ -280,9 +280,6 @@ Slur::do_post_processing ()
     Now we've got a fine slur
     Catch and correct some ugly cases
    */
-
-  
-
   String infix = interstaff_b ? "interstaff_" : "";
   Real height_damp_f = paper_l ()->get_var ("slur_"+infix +"height_damping");
   Real slope_damp_f = paper_l ()->get_var ("slur_"+infix +"slope_damping");
index bddeeb9543f3b02ce8d9925d72ef1db4928ef3bc..7fdba6a601eac1937cdae7df164d565af116769b 100644 (file)
@@ -48,18 +48,17 @@ Staff_margin_engraver::acknowledge_element (Score_element_info inf)
     long_name = short_name;
 
   if (gh_string_p (long_name))
-    return;
-
-  create_items (0);
-  text_p_->text_str_ = ly_scm2string (long_name);
-  staff_side_p_->dir_ = LEFT;
-  Bar_script_engraver::do_acknowledge_element (i);
+    {
+      create_items (0);
+      text_p_->text_str_ = ly_scm2string (long_name);
+      staff_side_p_->dir_ = LEFT;
+      Bar_script_engraver::attach_script_to_item (i);
 
-  /*
+      /*
     UGH. ignores font size settings.
    */
-  Interval iv(text_p_->extent (Y_AXIS));
-  text_p_->translate_axis (- iv.center (),  Y_AXIS);
+      Interval iv(text_p_->extent (Y_AXIS));
+      text_p_->translate_axis (- iv.center (),  Y_AXIS);
+    }
 }
 
-
index 853af03f630dca484aec616446067ea1f9116b4f..1ec7d19054eaad6f070e6514164f9ba9f0c04cc9 100644 (file)
@@ -96,10 +96,10 @@ String
 Staff_performer::new_instrument_str () 
 { 
   // mustn't ask Score for instrument: it will return piano!
-  SCM minstr = get_property ("midiInstrument", 0);
+  SCM minstr = get_property (gh_symbol2scm ("midiInstrument"), 0);
 
   if (!gh_string_p(minstr))
-    minstr = get_property ("instrument", 0);
+    minstr = get_property (gh_symbol2scm ("instrument"), 0);
 
   if (ly_scm2string (minstr) == instrument_str_)
     return "";
index 93e41b28ab3733c6b73911f1a008dff78fb7df6e..a326789009b0e3ddd9de9e909e6fb68e3328b89f 100644 (file)
@@ -35,13 +35,13 @@ void
 Staff_symbol_engraver::do_removal_processing()
 {
   SCM l (get_property ("numberOfStaffLines", 0));
-  if (SCM_NUMBERP(l))
+  if (gh_number_p(l))
     {
       span_p_->no_lines_i_ = gh_scm2int (l);
     }
 
   SCM sz (get_property ("staffLineLeading", 0));
-  if (SCM_NUMBERP(sz))
+  if (gh_number_p(sz))
     {
       span_p_->staff_line_leading_f_ = gh_scm2double (sz);
     }
index d48fa3925f3f0db14beaafa23a510d69a3780219..edd978df5e024743d9a6666e8fc22395e5253b7f 100644 (file)
@@ -29,7 +29,7 @@ void
 Stem_engraver::do_creation_processing ()
 {
   SCM prop = get_property ("abbrev", 0);
-  if (SCM_NUMBERP(prop)) 
+  if (gh_number_p(prop)) 
     {
       default_abbrev_i_  = gh_scm2int (prop);
     }
@@ -97,7 +97,7 @@ Stem_engraver::do_pre_move_processing()
   if (stem_p_)
     {
       SCM prop = get_property ("verticalDirection", 0);
-      if (SCM_NUMBERP(prop))
+      if (gh_number_p(prop))
        {
          stem_p_->dir_ = to_dir (prop);
          stem_p_->set_elt_property (dir_forced_scm_sym, SCM_BOOL_T);
@@ -105,36 +105,17 @@ Stem_engraver::do_pre_move_processing()
 
       Translator_group* which;
       prop = get_property ("stemLeftBeamCount", &which);
-      if (SCM_NUMBERP(prop))
+      if (gh_number_p(prop))
        {
          stem_p_->beams_i_drul_[LEFT] = gh_scm2int (prop);
          ((Translator_group*)which)->set_property ("stemLeftBeamCount", SCM_UNDEFINED);
        }
       prop = get_property ("stemRightBeamCount", &which);
-      if (SCM_NUMBERP(prop))
+      if (gh_number_p(prop))
        {
          stem_p_->beams_i_drul_[RIGHT] = gh_scm2int (prop);
          ((Translator_group*)which)->set_property ("stemRightBeamCount", SCM_UNDEFINED);
        }
-
-      prop = get_property ("stemLength", 0);
-      if (SCM_NUMBERP(prop))
-       {
-         stem_p_->set_elt_property (length_scm_sym, prop);
-       }
-
-      prop = get_property ("stemStyle", 0);
-      if (gh_string_p (prop))
-       {
-         stem_p_->set_elt_property (style_scm_sym, prop);
-       }
-      
-      prop = get_property ("noStemExtend", 0);
-      if (gh_boolean_p (prop) && gh_scm2bool (prop))
-       {
-         stem_p_->set_elt_property (no_stem_extend_scm_sym, prop);
-       }
-      
       typeset_element(stem_p_);
       stem_p_ = 0;
     }
index 9ecc46f43402a598e2565f94702b2014ca585dd7..a2bd01461227a8e05a3848f5c80e2d3802f477ec 100644 (file)
@@ -98,21 +98,9 @@ Text_engraver::do_process_requests ()
 
       text->text_str_ = r->text_str_;
       
-      if (r->style_str_.empty_b ())
-       {
-         SCM p (get_property ("textStyle", 0));
-         if (gh_string_p (p))
-           text->style_str_ = ly_scm2string(p);
-       }
-      else
-       text->style_str_ = r->style_str_;
+      if (r->style_str_.length_i ())
+       text->set_elt_property (style_scm_sym, ly_ch_C_to_scm (r->style_str_.ch_C()));
       
-      SCM padding = get_property ("textScriptPadding", 0);
-      if (SCM_NUMBERP(padding))
-       {
-         ss->set_elt_property (padding_scm_sym, padding);
-       }
-
       SCM empty = get_property ("textEmptyDimension", 0);
       if (gh_boolean_p (empty) && gh_scm2bool (empty))
        {
index 6cc6437297c645e4d012deef50e1053f15b2ddd9..eeaf40c30ab1cf982209b97df18f22dee5b89cf8 100644 (file)
 Molecule*
 Text_item::do_brew_molecule_p () const
 {
-  Molecule a= paper_l ()->lookup_l(0)->text (style_str_,text_str_, paper_l ()); 
+  SCM style = get_elt_property (style_scm_sym);
+  String st = (style == SCM_BOOL_F) ? "" : ly_scm2string (gh_cdr (style));
+  
+  Molecule a= paper_l ()->lookup_l(0)->text (st, text_str_, paper_l ());
 
   return new Molecule (a);
 }
 
-Text_item::Text_item ()
-{
-  style_str_ = "roman";
-}
-
 void
 Text_item::do_print () const
 {
index 946f8e93671c96deea57b417a8ef1174229126b4..a3ba0358ca961638ea8869335b21ac64f66edcf6 100644 (file)
@@ -140,7 +140,7 @@ Tie_engraver::do_pre_move_processing ()
   SCM dir2 (get_property ("verticalDirection", 0));
 
   Direction tie_dir = CENTER;
-  if (SCM_NUMBERP(dir))
+  if (gh_number_p(dir))
     tie_dir = to_dir (dir);
   else if (isdir_b (dir2))
     tie_dir = to_dir (dir2);
index d9051d59aee360913ab2f5cc3aab0e03233c1ea2..f6808850642858dedad59a8e678a7c2605545f15 100644 (file)
@@ -54,11 +54,6 @@ Time_signature_engraver::do_pre_move_processing()
 {
   if (time_signature_p_) 
     {
-      SCM sigstyle = get_property ("timeSignatureStyle", 0);
-      if (gh_string_p (sigstyle))
-       {
-         time_signature_p_->time_sig_type_str_ = ly_scm2string (sigstyle);
-       }
 
       typeset_element (time_signature_p_);
       time_signature_p_ =0;
index a4960abc7ba2bc32933626d4a73c91a77b84fb87..1f6234cd9cdc72a7a4be4b721d75d7f43088cf15 100644 (file)
@@ -21,16 +21,19 @@ Time_signature::Time_signature ()
 Molecule*
 Time_signature::do_brew_molecule_p () const
 {
-  if (time_sig_type_str_.length_i ())
+  SCM st = get_elt_property (style_scm_sym);
+  
+  if (st != SCM_BOOL_F)
     {
-      if (time_sig_type_str_[0]=='1')
+      String style (ly_scm2string (gh_cdr (st)));
+      if (style[0]=='1')
        {
          Array<int> tmparr = args_;
          return new Molecule( lookup_l ()->time_signature (args_[0], 0, paper_l ()));
        }
       else
        {
-         return new Molecule( lookup_l ()-> special_time_signature (time_sig_type_str_ ,args_[0], args_[1], paper_l ()));
+         return new Molecule( lookup_l ()-> special_time_signature (style, args_[0], args_[1], paper_l ()));
        }
     }
   else
index 82ab9dc0be63c7e1f4569088eac10ca0861239a3..03479ed5b87e0e917a1dbc0d781be14d79e72a81 100644 (file)
@@ -95,7 +95,7 @@ Timing_translator::do_process_requests()
   Translator_group * tr=0;
 
   SCM barn = get_property ("currentBarNumber", &tr);
-  if (SCM_NUMBERP(barn))
+  if (gh_number_p(barn))
     {
       time_.bars_i_ = gh_scm2int (barn);
       tr->set_property ("currentBarNumber", SCM_UNDEFINED);
index cffdaf8905afa3a7896f97778785fafd925b4c18..f74aef58d486713d37c55ac67c68f85598575aa2 100644 (file)
@@ -448,10 +448,8 @@ Translator_group::do_add_processing ()
 }
 
 SCM
-Translator_group::get_property (String id,
-                               Translator_group **where_l) const
+Translator_group::get_property (SCM sym, Translator_group **where_l) const
 {
-  SCM  sym = ly_symbol (id);
   if (properties_dict_.elem_b (sym))
     {
       if (where_l)
@@ -460,7 +458,7 @@ Translator_group::get_property (String id,
     }
 
   if (daddy_trans_l_)
-    return daddy_trans_l_->get_property (id, where_l);
+    return daddy_trans_l_->get_property (sym, where_l);
   
   if (where_l)
     *where_l = 0;
index 218a8c142339f7c83eca4a5c637919c899888827..c70b629ce8465a32c0b434cf900256ad2f55b792 100644 (file)
@@ -166,7 +166,14 @@ Translator::output_def_l () const
 SCM
 Translator::get_property (String id, Translator_group **where_l) const
 {
-  return daddy_trans_l_->get_property (id, where_l);
+  return daddy_trans_l_->get_property (ly_symbol (id), where_l);
+}
+
+SCM
+Translator::get_property (SCM sym,
+                         Translator_group **where_l) const
+{
+  return daddy_trans_l_->get_property (sym, where_l);
 }
 
 
index ce9c2cd2de27ee75670d9f0b0b55be97e4629f32..b9e3cf16dcbb2c4446e592bfaa7e3e87fa0675c9 100644 (file)
@@ -40,7 +40,7 @@ Tuplet_engraver::do_process_requests ()
     dir = to_dir (prop);
   int visibility = 3;
   prop = get_property ("tupletVisibility", 0);
-  if (SCM_NUMBERP(prop))
+  if (gh_number_p(prop))
     visibility = gh_scm2int (prop);    // bool ?
 
   for (int i= started_span_p_arr_.size ();
index 2497fd4f59cc98d5b056c6b73870417f3be96fe3..48935c674cbe572705430ffdf44b1f781de114b4 100644 (file)
@@ -33,13 +33,13 @@ void
 Vertical_align_engraver::do_removal_processing()
 {
   SCM dist (get_property ("maxVerticalAlign", 0));
-  if (SCM_NUMBERP(dist))
+  if (gh_number_p(dist))
     {
       valign_p_->threshold_interval_[BIGGER]  = gh_scm2double (dist);
     }
 
   dist = get_property ("minVerticalAlign", 0);
-  if (SCM_NUMBERP(dist))
+  if (gh_number_p(dist))
     {
       valign_p_->threshold_interval_[SMALLER]  = gh_scm2double (dist);
     }
index 56438398937461dcee6b51decdc9b5741b66115e..e7b6eac28739a0da4399e73d6bcec329446a7219 100644 (file)
@@ -3,6 +3,8 @@
 breve = \duration { -1 0 }
 longa = \duration { -2 0 }
 
+#(eval-string (ly-gulp-file "generic-property.scm"))
+
 \include "nederlands.ly"               % dutch
 \include "chord-modifiers.ly"
 \include "script.ly"
index b323524d32614e8dd096722ea49fefdf1e9be54d..c1687a847d5e2e5ebd9526bfdfcd85e119c93693 100644 (file)
@@ -5,9 +5,12 @@
 StaffContext=\translator {
        \type "Engraver_group_engraver";
        \name Staff ;
+       
        barAuto = ##t
        voltaVisibility = ##t
-
+       Generic_property_list = #generic-staff-properties
+       \consists "Property_engraver";
+       
        \consists "Multi_measure_rest_engraver";
        \consists "Bar_engraver";
  % Bar_engraver must be first so default bars aren't overwritten
@@ -66,6 +69,9 @@ StaffContext=\translator {
 RhythmicStaffContext=\translator{
        \type "Engraver_group_engraver";
        numberOfStaffLines  = #1
+       \consists "Property_engraver";
+       
+       Generic_property_list = #generic-staff-properties
        
        barSize = \staffheight;
        \consists "Pitch_squash_engraver";
@@ -81,12 +87,16 @@ RhythmicStaffContext=\translator{
 };
 \translator{\RhythmicStaffContext}
 VoiceContext = \translator {
+
        \type "Engraver_group_engraver";
        dynamicPadding = #5.0
+       Generic_property_list = #generic-voice-properties
+
+
        \consists "Dynamic_engraver";   % must come before text_engraver.
        \name Voice ;
-
-%      \consists "Tie_engraver";
+       \consists "Property_engraver";
+       
        \consists "Breathing_sign_engraver";
        \consists "Rest_engraver";
        \consists "Dot_column_engraver";
@@ -95,9 +105,7 @@ VoiceContext = \translator {
        \consists "Auto_beam_engraver";
        \include "auto-beam-settings.ly";
        \consists "Chord_tremolo_engraver";
-%      \consists "Multi_measure_rest_engraver";
 
-       % ugh.  Order matters here.
        \consists "Melisma_engraver";
        textScriptPadding = #3.0
        \consists "Text_engraver";
@@ -117,6 +125,9 @@ VoiceContext = \translator {
 GraceContext=\translator {
        \type "Grace_engraver_group";
        \name "Grace";
+
+       Generic_property_list = #generic-grace-properties
+       
        \consists "Note_heads_engraver";
        \consists "Local_key_engraver";
        \consists "Stem_engraver";
@@ -126,13 +137,16 @@ GraceContext=\translator {
        \consists "Auto_beam_engraver";
        \include "auto-beam-settings.ly";
        \consists "Align_note_column_engraver";
-       \consists "Font_size_engraver";
+
        \consists "Rhythmic_column_engraver";
        \consists "Dynamic_engraver";
 
+       \consists "Property_engraver";
+
        stemStyle = #"grace" 
        weAreGraceContext = ##t 
        fontSize = #-1
+       
        stemLength = #6.0
        verticalDirection = \up ;
        graceAccidentalSpace= 1.5 * \interline;
@@ -143,7 +157,9 @@ GraceContext=\translator {
 
 ThreadContext = \translator{
        \type Engraver_group_engraver;
-       \consists "Note_heads_engraver" ;       
+       \consists "Note_heads_engraver" ;
+       Generic_property_list = #generic-thread-properties
+       \consists "Property_engraver";
        \name Thread;
 };
 
@@ -289,6 +305,9 @@ ScoreContext = \translator {
        \accepts "GrandStaff";
        \accepts "ChoirStaff";
        \accepts "PianoStaff";
+
+       clefBreakPriority = #-2
+       breathingSignBreakPriority = #-4
 };
 
 \translator { \ScoreContext }
index a3e0eba66c45b9d161e120142ca21d2e8c3921de..beb538c9b44119f59b82af42e3c528cbd1085d93 100644 (file)
@@ -97,6 +97,10 @@ MAJORITY = 2.0;
 MEAN = 3.0;
 MEDIAN = 4.0;
 
+#'beam_dir_algorithm = #'majority
+#'slope_quantisation = #'normal
+
+
 %{
 dit(code(beam_dir_algorithm)) Specify algorithm for determining
 whether beams go up or down.  It is real valued.  If set to 2.0 then
index cbb9b6fba691f25094b5c1909ec853f55330b85f..07d322a822989e41c091ab3ec5cf1b3fa84df0d4 100644 (file)
@@ -1,15 +1,15 @@
 Begin3
 Title: LilyPond
-Version: 1.3.0
-Entered-date: 26OCT99
+Version: 1.3.1
+Entered-date: 28OCT99
 Description: 
 Keywords: music notation typesetting midi fonts engraving
 Author: hanwen@cs.uu.nl (Han-Wen Nienhuys)
        janneke@gnu.org (Jan Nieuwenhuizen)
 Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
 Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
-       1000k lilypond-1.3.0.tar.gz 
+       1000k lilypond-1.3.1.tar.gz 
 Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
-       1000k lilypond-1.3.0.tar.gz 
+       1000k lilypond-1.3.1.tar.gz 
 Copying-policy: GPL
 End
index 3e62d1f6d1ed04509dcffa5b95e7e7d3df9b9602..f1cdc34164df734cd78724fda5b256ee1e98f179 100644 (file)
@@ -1,9 +1,9 @@
 Name: lilypond
-Version: 1.3.0
+Version: 1.3.1
 Release: 1
 Copyright: GPL
 Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.0.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.1.tar.gz
 Summary: A program for printing sheet music.
 URL: http://www.cs.uu.nl/~hanwen/lilypond
 Packager: Han-Wen Nienhuys <hanwen@cs.uu.nl>
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, ' ');
diff --git a/scm/generic-property.scm b/scm/generic-property.scm
new file mode 100644 (file)
index 0000000..a895d3b
--- /dev/null
@@ -0,0 +1,96 @@
+
+(define generic-beam-properties
+  (cons "Beam"
+       (list
+        (list 'beamslopedamping number? 'damping)
+        (list 'autoKneeGap number? 'auto_knee_gap)
+        (list 'autoInterstaffKneeGap number? 'auto_interstaff_knee_gap)
+        (list 'beamQuantisation symbol? 'slope_quantisation)
+        (list 'beamDirAlgorithm symbol? 'beam_dir_algorithm)
+        )
+       )
+  )
+
+
+(define generic-stem-properties
+  (cons "Stem"
+       (list
+        (list 'stemLength number? 'length)
+        (list 'stemStyle string? 'style)
+        (list 'noStemExtend boolean? 'no_stem_extend)
+        ))
+  )
+
+(define generic-text-properties
+  (cons "Text_item" (list
+                    (list 'textStyle string? 'style)
+                    (list 'textScriptPadding number? 'padding)
+                    )
+       ))
+
+(define generic-bar-properties
+  (cons "Staff_bar" (list
+                    (list 'barSize number? 'bar_size))
+       )
+  )    
+(define generic-breathing-sign-properties
+  (cons "Breathing_sign"
+       (list
+        (list 'breathingSignBreakPriority number? 'break_priority
+         ))))
+
+(define generic-clef-properties
+  (cons "Clef_item"
+       (list
+        (list 'clefBreakPriority number? 'break_priority)
+        (list 'clefStyle string? 'style))
+       )
+  )
+
+(define generic-All-properties
+  (cons "all"  (list (list 'fontSize number? 'fontsize))))
+
+(define generic-rest-properties
+  (cons "Rest" (list (list 'restStyle string? 'reststyle))))
+
+(define generic-note-column-properties
+  (cons "Note_column"
+       (list
+        (list 'horizontalNoteShift number? 'horizontal_shift)
+        (list 'forceHorizontalShift number? 'force_hshift)
+        )))
+
+(define generic-slur-properties
+  (cons "Slur"
+       (list
+        (list 'slurDash number? 'dashed))))
+
+(define generic-timesig-properties
+  (cons "Time_signature"
+       (list
+        (list 'timeSignatureStyle string? 'sigstyle))))
+
+(define generic-voice-properties
+  (list
+   generic-stem-properties
+   generic-rest-properties
+   generic-slur-properties
+   generic-beam-properties
+   generic-text-properties
+   generic-note-column-properties
+   generic-All-properties
+   ))
+
+(define generic-grace-properties generic-voice-properties)
+(define generic-staff-properties
+  (list
+   generic-bar-properties
+   generic-timesig-properties
+   generic-clef-properties
+   generic-All-properties      
+   )
+  )
+
+(define generic-thread-properties
+  (list generic-All-properties))
+   
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 0f997ad74c157197aeb26dde0c8577755b1c3881..b970f50b4855796fc06355f4b5dc8b2edc371d96 100755 (executable)
@@ -33,10 +33,10 @@ fi
 #
 mkdir -p $prefix/bin
 result=`echo $PATH | grep "$HOME/usr/bin"`
-if [ "x$result" = "x" ];then
+if [ "x$result" = "x" ]; then
     PATH=$PATH:$HOME/usr/bin
 fi
 result=`echo $PATH | grep "$sources/$package/bin"`
-if [ "x$result" = "x" ];then
+if [ "x$result" = "x" ]; then
     PATH=$PATH:$sources/$package/bin
 fi
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