]> git.donarmstrong.com Git - lilypond.git/commitdiff
tremolo spees
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 4 May 2002 17:59:21 +0000 (17:59 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 4 May 2002 17:59:21 +0000 (17:59 +0000)
13 files changed:
ChangeLog
GNUmakefile.in
VERSION
buildscripts/ps-to-pfa.py [deleted file]
input/regression/chord-tremolo.ly
lily/beam.cc
lily/chord-tremolo-engraver.cc
lily/chord-tremolo-iterator.cc
lily/grob-interface.cc
lily/lily-guile.cc
lily/spacing-spanner.cc
lily/system-start-delimiter-engraver.cc
make/GNUmakefile

index 6e0149eb37c94fb83c4800964837cbccb22a1216..0190906c7f4810fcf2cc6735e5c401e42b74d40a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2002-05-04  Han-Wen  <hanwen@cs.uu.nl>
 
+       * lily/*.cc: change gh_str02scm() to ly_str02scm().
+
+       * lily/spacing-spanner.cc (note_spacing): Bound
+       shortest-playing-length by the distance to next note. This should
+       fix chord tremolo spacing.
+
        * VERSION: 1.5.55 released
 
        * lily/stem.cc (off_callback): invisible stem over whole note is
index b467fed74720c90717ba7efcc74d0b4249414ca8..65ab1c609dfde77b905e6df5d6734aeb69ccae9f 100644 (file)
@@ -42,7 +42,7 @@ fonts:
 doc: lily fonts
        $(MAKE) -C Documentation
 
-web-doc:  pfa-fonts
+web-doc: pfa-fonts
        $(MAKE) out=www -C Documentation WWW
        $(MAKE) footify
 
diff --git a/VERSION b/VERSION
index 66625a26d80c21dd0ff4b3183f93c89526417abd..45393be4268dc45fe3d888723552ac43bbf9001b 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=5
 PATCH_LEVEL=55
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=hwn1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/buildscripts/ps-to-pfa.py b/buildscripts/ps-to-pfa.py
deleted file mode 100644 (file)
index a1d80c1..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-#!@PYTHON@
-
-# ps-to-pfa.py -- make PostScript Type 3 font from separate ps char files
-# 
-# source file of the GNU LilyPond music typesetter
-# 
-# (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
-
-#TODO.  This could be more efficient.
-
-name = 'ps-to-pfa'
-version = '0.4'
-
-datadir = ''
-
-import os
-import sys
-import getopt
-from string import *
-import re
-import time
-
-logfile = sys.stdout
-
-def program_id ():
-    return name + ' version ' + version;
-
-def identify ():
-    sys.stdout.write (program_id () + '\n')
-
-def help ():
-    sys.stdout.write ("Usage: %s [options] [files]\n"
-                     "ps-to-pfa.py -- make PostScript Type 3 font from separate ps char files\n\n"
-                      + "Options:\n"
-                      + "  -d, --datadir=DIR      use DIR for ps header/footer\n"
-                      + "  -h, --help             print this help\n"
-                     + "  -o, --output=FILE      set output file to FILE.\n"
-                      % (program_name)
-                     )
-    sys.exit (0)
-
-output_name = ''
-
-identify ()
-(options, files) = getopt.getopt (
-    sys.argv[1:], 'o:d:', ['help', 'package', 'output='])
-for opt in options:
-    o = opt[0]
-    a = opt[1]
-    if o== '--help' or o == '-h':
-       help ()
-    elif o == '-d' or o == '--datadir':
-       datadir = a
-    elif o == '-o' or o =='--output':
-       output_name = a
-    else:
-       print o
-       raise getopt.error
-
-
-def gulp_file (f):
-       logfile.write ('[%s' % f)
-       try:
-               i = open (f)
-               i.seek (0, 2)
-               n = i.tell ()
-               i.seek (0,0)
-       except:
-               logfile.write ('can\'t open file %s\n ' % f)
-               return ''
-       s = i.read (n)
-       logfile.write (']')
-       if len (s) <= 0:
-               logfile.write ('gulped empty file: %s\n'% f)
-       return s
-
-mf = files[0]
-
-input_name = mf
-font_name = os.path.basename (os.path.splitext (mf)[0])
-if not output_name:
-    output_name  = font_name + '.pfa'
-
-
-logfile.write ('Font: %s\n'% font_name)
-
-def header (f):
-       f.write ('%!PS-AdobeFont-3.0: ' + font_name + '\n')
-       f.write ('%%%%Creator: %s-%s\n' % (name, version))
-       f.write ('\n')
-       f.write (r"""
-8 dict begin
-/FontType 3 def                             %% Required elements of font
-/FontName /%s def""" % font_name)
-       f.write (r"""
-/FontMatrix [.083 0 0 .083 0 0] def       %% 12 is default height: 1/12 = 0.083
-/FontBBox [-1000 -1000 1000 1000] def    %% does not seem to matter.
-/Encoding 256 array def                     %% Trivial encoding vector
-0 1 255 {Encoding exch /.notdef put} for
-""")
-def footer (f):
-       f.write (r"""
-/BuildGlyph {                               % Stack contains: font charname
-  1000 0                                   % Width
-  -1000 -1000 1000 1000                    % Bounding Box
-  setcachedevice
-  exch /CharProcs get exch                  % Get CharProcs dictionary
-  2 copy known not {pop /.notdef} if        % See if charname is known
-  get exec                                  % Execute character procedure
-} bind def
-
-/BuildChar {                                % Level 1 compatibility
-  1 index /Encoding get exch get
-  1 index /BuildGlyph get exec
-} bind def
-
-currentdict
-end                                         % of font dictionary
-"""
-)
-
-       f.write ('/%s\n' % font_name)
-       f.write (''
-'exch definefont pop                         % Define the font\n')
-
-suspect_re = re.compile ('closepath ((gsave )*fill( grestore stroke)*) 1 setgray newpath (.*?) closepath fill')
-
-def characters (f):
-       logfile.write ('[')
-       
-       files = []
-       import glob
-       suffixes = [".[0-9]", ".[0-9][0-9]",  ".[0-9][0-9][0-9]"]
-       for suf in suffixes:
-               files = files + glob.glob(font_name + suf)
-
-
-       # concat all files into charprocs.
-       charprocs = '  /.notdef {} def\n'
-       encoding = ''
-       for i in files: 
-               s = gulp_file (i)
-               s = re.sub ('%[^\n]*\n', '', s)
-               
-               # if you want readable stuff, look at MP output.
-               s = re.sub ('[\n\t ]+', ' ', s)
-               s = re.sub ('showpage', '', s)
-
-               # MP's implementation of unfill confuses GS.
-               # Look for "Metapost & setgray" on deja.com
-               # we do some twiddling to use eofill i.s.o. fill
-               if re.search ('setgray',s ):
-                       m = suspect_re.search (s)
-                       while m:
-                               fill = m.group (1)
-                               path = m.group (4)
-
-                               # be complicated, in case of gsave/grestore.
-                               # vill as quick hack to avoid duple substitutions.
-                               fill = re.sub ('fill', 'eovill', fill, count = 1)
-                               s = re.sub (m.group (0), ' %s %s ' % (path, fill), s)
-                               m = suspect_re.search (s)
-
-                       s = re.sub ('eovill' , 'eofill', s)
-                       s = re.sub ('0 setgray' ,'', s)
-
-                       
-               m = re.match ('.*\.([0-9]+)',i)
-               n = atoi (m.group (1))
-
-               s = '\n  /%s-%d{\n%s} bind def\n' % (font_name, n, s)
-               encoding = encoding + 'Encoding %d /%s-%d put\n' % (n, font_name, n)
-               charprocs = charprocs + s
-
-       f.write ('\n'
-'/CharProcs 3 dict def                       % Subsidiary dictiorary for\n'
-'CharProcs begin                             % individual character definitions\n')
-       f.write (charprocs)
-       f.write ('\n')
-       f.write ('end                                         % of CharProcs\n')
-       f.write (encoding)
-       f.write ('\n')
-       logfile.write (']')
-
-
-ps_file = open (output_name, 'w')
-header (ps_file)
-characters (ps_file)
-footer (ps_file)
-logfile.write ('\n')
-ps_file.close ()
-logfile.write ('Wrote PostScript font: %s\n' % output_name)
-
index 5fd9dbdfa336335e444926bd8d58715495358c9f..c45d6df58b2967bbacfa7272a1fe4be0f4c5f55f 100644 (file)
@@ -7,6 +7,8 @@ To avoid confusion, chord tremolo beams do not reach the stems, but
 leave a gap.  Chord tremolo beams on half notes are not ambiguous,
 as half notes cannot appear in a regular beam, and should reach the 
 stems.
+
+(To ensure that the spacing engine is not confused we add some regular notes as well.) 
 "
 }
   
@@ -22,6 +24,10 @@ stems.
        \repeat "tremolo" 4 { f'8 e }
        \repeat "tremolo" 2 { f e }    
        \repeat "tremolo" 1 { f e }
+       c4 c4 c4 c4
+       c4 c4 c4 c4
+       c4 c4 c4 c4
+
   }
   \paper {
     linewidth = 90*\staffspace
index 7224333bcad65dc5db08c680bc71207a3a3d842c..8d6c2e09350787396ed52a1c873e3792b73b8241 100644 (file)
@@ -1253,8 +1253,9 @@ Beam::brew_molecule (SCM smob)
                     "%.2f");
 
       SCM properties = Font_interface::font_alist_chain (me);
-  
-      Molecule tm = Text_item::text2molecule (me, gh_str02scm (str.ch_C ()), properties);
+
+      
+      Molecule tm = Text_item::text2molecule (me, ly_str02scm (str.ch_C ()), properties);
       mol.add_at_edge (Y_AXIS, UP, tm, 5.0);
     }
   
index d2e8d5af8328cbe21d3192076c9ffa59c2ec4c58..3c46bb5ad0471ddeb5f90e93ce64d7fd8594b91e 100644 (file)
@@ -168,17 +168,6 @@ Chord_tremolo_engraver::acknowledge_grob (Grob_info info)
          Stem::set_beaming (s, f, LEFT);
          Stem::set_beaming (s, f, RIGHT);
          
-         /*
-           URG: this sets the direction of the Stem s.
-           It's amazing Mike:
-           
-             Stem:: type_i () ->first_head ()->get_direction () ->
-                     Directional_element_interface::set (me, d);
-
-
-             don't understand this comment.
-                     --hwn.
-          */
          SCM d = s->get_grob_property ("direction");
          if (Stem::type_i (s) != 1)
            {
@@ -221,7 +210,6 @@ Chord_tremolo_engraver::acknowledge_grob (Grob_info info)
 
           d->set_parent (info.grob_l_, Y_AXIS);
           announce_grob (d, SCM_EOL);
-         
        }
     }
 }
index e512cda4d968cef8cea54ea2b4f342ecc99334f1..748ac14b4b94c18717a5c1a3aa278f7f576c9c9d 100644 (file)
@@ -9,7 +9,8 @@
 
 
 /*
-  this is culled from various other iterators, but sharing code by subclassing proved to be too difficult.
+  this is culled from various other iterators, but sharing code by
+  subclassing proved to be too difficult.
  */
 
 #include "input.hh"
@@ -33,7 +34,7 @@ Chord_tremolo_iterator::Chord_tremolo_iterator ()
 Chord_tremolo_iterator::Chord_tremolo_iterator (Chord_tremolo_iterator const &src)
   : Music_iterator (src)
 {
-  child_iter_p_ = src.child_iter_p_? src.child_iter_p_->clone () : 0; 
+  child_iter_p_ = src.child_iter_p_ ? src.child_iter_p_->clone () : 0; 
 }
 
 void
index f8ae9359832a83ad284164e32e3584b6ef74ce26..b6fd450b3f061c5de18df286d6406e05161fb52b 100644 (file)
@@ -11,7 +11,7 @@ void add_interface (const char * symbol,
                    const char * vars)
 {
   SCM s = ly_symbol2scm (symbol);
-  SCM d = gh_str02scm (descr);
+  SCM d = ly_str02scm (descr);
   SCM l = parse_symbol_list (vars);
 
 
index e2ab82ae2ffd63ba16f37ec978f33f41b142906d..26d856955d8f12cb89e8695311c12610a9a952ce 100644 (file)
@@ -467,7 +467,7 @@ ly_version ()
 SCM
 ly_unit ()
 {
-  return gh_str02scm (INTERNAL_UNIT);
+  return ly_str02scm (INTERNAL_UNIT);
 }
 
 static void
index 5e48941547d3a43869b5e65c23a090d85ceb0905..d99dc2ff5041e380cc2b181e5f0c50817034af60 100644 (file)
@@ -508,7 +508,7 @@ Spacing_spanner::do_measure (Rational shortest, Grob*me, Link_array<Grob> *cols)
 
 
 /*
-  Generate the space between two musical columns LC and RC, given spacing parameters INCR and SHRTEST.
+  Generate the space between two musical columns LC and RC, given spacing parameters INCR and SHORTEST.
  */
 void
 Spacing_spanner::musical_column_spacing (Grob *me, Item * lc, Item *rc, Real increment, Rational shortest)
@@ -730,6 +730,14 @@ Spacing_spanner::note_spacing (Grob*me, Grob *lc, Grob *rc,
   Moment delta_t = rwhen - lwhen;
   Real dist = 0.0;
 
+  /*
+    In normal situations, the next column is at most
+    SHORTEST_PLAYING_LEN away. However chord-tremolos do funky faking stuff
+    with durations, invalidating this assumption. Here we kludge
+    around to get chord tremolos to behave properly.
+    
+   */
+  shortest_playing_len = shortest_playing_len >? delta_t;
   if (delta_t.main_part_ && !lwhen.grace_part_)
     {
       dist = get_duration_space (me, shortest_playing_len, shortest.main_part_, expand_only);
index 2f7cff912882984e3a2067ded6cec2c6080c30c8..bb2eac76cfcd94488661fa3ff9675043d4ad16ac 100644 (file)
@@ -7,7 +7,6 @@
   
  */
 
-
 #include "system-start-delimiter.hh"
 #include "engraver.hh"
 #include "staff-symbol.hh"
@@ -49,11 +48,11 @@ System_start_delimiter_engraver::acknowledge_grob (Grob_info inf)
       /*
        UGH UGH
        */
-      if (gh_string_p (gl) && gh_equal_p (gl, gh_str02scm  ("brace"))
-         && gh_string_p (my_gl) && gh_equal_p (my_gl, gh_str02scm  ("bracket")))
+      if (gh_string_p (gl) && gh_equal_p (gl, ly_str02scm  ("brace"))
+         && gh_string_p (my_gl) && gh_equal_p (my_gl, ly_str02scm  ("bracket")))
        inf.grob_l_->translate_axis (-0.8, X_AXIS); // ugh
-      else if (gh_string_p (gl) && gh_equal_p (gl, gh_str02scm  ("bracket"))
-              && gh_string_p (my_gl) && gh_equal_p (my_gl, gh_str02scm  ("bracket")))
+      else if (gh_string_p (gl) && gh_equal_p (gl, ly_str02scm  ("bracket"))
+              && gh_string_p (my_gl) && gh_equal_p (my_gl, ly_str02scm  ("bracket")))
        {
          inf.grob_l_->translate_axis ( -0.8, X_AXIS); // ugh
          inf.grob_l_->set_grob_property ("arch-height",
@@ -75,8 +74,6 @@ System_start_delimiter_engraver::initialize ()
   delim_ = new Spanner (internal_get_property (delim_name));
 
   delim_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
-
-
   announce_grob (delim_, SCM_EOL);
 }
 
@@ -88,7 +85,7 @@ System_start_delimiter_engraver::finalize ()
 }
 
 ENTER_DESCRIPTION(System_start_delimiter_engraver,
-/* descr */       "creates a system start delimiter (ie. SystemStart@{Bar,Brace,Bracket@} spanner",
+/* descr */       "Creates a system start delimiter (ie. SystemStart@{Bar,Brace,Bracket@} spanner",
 /* creats*/       "SystemStartBar SystemStartBrace SystemStartBracket",
 /* acks  */       "system-start-delimiter-interface staff-symbol-interface",
 /* reads */       "systemStartDelimiter",
index 62acae4cdbe2ec9c85a239dc0fb6d8183d12956a..8f46922ded5b6b49925776f6a485d1ea0b9370f9 100644 (file)
@@ -1,4 +1,4 @@
-# file    make/Makefile 
+# file make/Makefile 
 
 depth = ..
 STEPMAKE_TEMPLATES=makedir install
@@ -7,3 +7,4 @@ INSTALLATION_FILES=$(DIST_FILES)
 
 include $(depth)/make/stepmake.make 
 
+default: spec