]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 1.5.36 release/1.5.36
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 2 Mar 2002 01:53:32 +0000 (02:53 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 2 Mar 2002 01:53:32 +0000 (02:53 +0100)
53 files changed:
ChangeLog
Documentation/regression-test.tely
Documentation/topdocs/INSTALL.texi
Documentation/user/appendices.itely
INSTALL.txt
VERSION
buildscripts/mf-to-table.py
input/regression/spacing-stem-same-direction.ly [new file with mode: 0644]
lily/align-interface.cc
lily/arpeggio.cc
lily/break-align-item.cc
lily/chord.cc
lily/directional-element-interface.cc
lily/duration.cc
lily/fingering-engraver.cc
lily/font-interface.cc
lily/font-metric.cc
lily/grob.cc
lily/hairpin.cc
lily/include/lily-guile.hh
lily/include/paper-def.hh
lily/include/pitch.hh
lily/input-smob.cc
lily/lexer.ll
lily/lily-guile.cc
lily/lookup.cc
lily/molecule.cc
lily/music.cc
lily/note-head.cc
lily/note-spacing.cc
lily/paper-def.cc
lily/parser.yy
lily/pitch.cc
lily/request.cc
lily/script-engraver.cc
lily/side-position-interface.cc
lily/text-item.cc
lily/translator-group.cc
lily/tuplet-bracket.cc
make/lilypond-vars.make
make/out/lilypond.lsm
make/out/lilypond.mandrake.spec
make/out/lilypond.redhat.spec
make/out/lilypond.suse.spec
mf/GNUmakefile
mf/lilypond.map [deleted file]
mf/parmesan-custodes.mf
mf/parmesan-heads.mf
scm/bass-figure.scm
scm/c++.scm
scm/grob-description.scm
scm/lily.scm
scm/molecule.scm [new file with mode: 0644]

index 83eeee5a6b9b8e2e531fda75e2701cfabaad7dff..b03413d2b964b6d13d8851ec20b269a83f1aeb0f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,48 @@
+2002-03-02  Han-Wen  <hanwen@cs.uu.nl>
+
+       * lily/lily-guile.cc: isdir_b and isaxis_b changed to ly_axis_p,
+       ly_dir_p
+
+       * lily/music.cc (ly_get_mus_property): typechecking
+       (ly_set_mus_property): idem
+       (ly_make_music): idem
+       (ly_music_name): idem
+
+       * lily/chord.cc: use scm_reverse_x iso. gh_reverse()
+
+       * lily/note-spacing.cc (stem_dir_correction): correction for
+       same stem notes as well. 
+
+       * lily/pitch.cc (pitch_transpose): stricter typechecking
+
+       * mf/parmesan*mf: magnification fixes.
+
+       * Documentation/topdocs/INSTALL.texi: update RedHat reqs
+
+2002-03-01  Mats Bengtsson  <mats.bengtsson@s3.kth.se>
+
+       * buildscripts/mf-to-table.py (postfixes): Output also .ly file
+       documenting the font. (Doesn't work for parmesan at the moment)
+
+       * Documentation/user/appendices.itely (The Feta font): Add list of
+       Feta font symbols with names.
+
+       * mf/GNUmakefile ($(outdir)/lilypond.map): Generate lilypond.map
+       automatically
+
+2002-03-01  Han-Wen  <hanwen@cs.uu.nl>
+
+       * lily/translator-group.cc (ly_set_trans_property): typechecking
+       (ly_get_trans_property): typechecking.
+
+       * lily/font-metric.cc (ly_text_dimension): typechecking 
+       (ly_find_glyph_by_name): idem.
+
+       * scm/bass-figure.scm (brew-complete-figure): support for
+       bracketed numbers.
+       
+       * lily/grob.cc (ly_get_paper_var): new function
+
 2002-02-28  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
        * VERSION (PATCH_LEVEL): 1.5.35 released.
index 100d39fc95711a03479053cceea18778ba950ae1..e78d50f4e3996c6934c3070e5896acc49cf5ca19 100644 (file)
@@ -243,6 +243,8 @@ Grace note do weird things with timing. Fragile.
 
 @lilypondfile[printfilename]{spacing-stem-direction.ly}
 
+@lilypondfile[printfilename]{spacing-stem-same-direction.ly}
+
 @lilypondfile[printfilename]{spacing-individual-tuning.ly}
 
 @lilypondfile[printfilename]{lyrics-bar.ly}
index bb1c0ac2e0ab2828df2607257b6cd99d0300c03c..4859ce993aed9335b6c3980976555f67de2731c5 100644 (file)
@@ -339,8 +339,8 @@ tetex-latex, tetex-dvips, libstdc++, python, ghostscript.
 
 For compilation on a Red Hat system you need these packages, in addition
 to the those needed for running: glibc-devel, gcc-c++, libstdc++-devel,
-guile-devel, flex, bison, texinfo, tetex-devel, groff,
-libgr-progs.
+guile-devel, flex, bison, texinfo, groff.
+
 
 
 @subsection LinuxPPC
index 17ab55f4c08450eaf16581bf4817f65760c7f812..dd424a003b26726d9314c1a907fcf65242800d62 100644 (file)
@@ -6,6 +6,7 @@
 * American Chords ::            
 * Jazz chords::                 
 * MIDI instruments::            
+* The Feta font::
 @end menu
 
 @node Lyrics mode definition
@@ -200,3 +201,12 @@ scheme = \chords {
 "viola"                     "lead 5 (charang)"     "gunshot"
 "cello"                     "lead 6 (voice)" 
 @end example 
+
+@node The Feta font
+@section The Feta font
+The following symbols are available in the Feta font and may be
+accessed directly using text markup such as 
+@code{g^#'(music "scripts-segno")}, see @ref{Text markup}.
+
+@lilypondfile{feta16.ly}
+
index 9cc58b4f139767d09cf6dc419e58cc06f3de5bd4..afe6857fac1405f8b029ccb0deb64cc9de8b1f45 100644 (file)
@@ -317,8 +317,7 @@ tetex, tetex-latex, tetex-dvips, libstdc++, python, ghostscript.
 
    For compilation on a Red Hat system you need these packages, in
 addition to the those needed for running: glibc-devel, gcc-c++,
-libstdc++-devel, guile-devel, flex, bison, texinfo, tetex-devel, groff,
-libgr-progs.
+libstdc++-devel, guile-devel, flex, bison, texinfo, groff.
 
 LinuxPPC
 --------
diff --git a/VERSION b/VERSION
index f36d3ce01b6e11017ef940433a7a7e416005058f..31be469bbf9a1a0e54b2635a9b8fa7537d2d8e64 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,7 +1,7 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=5
-PATCH_LEVEL=35
+PATCH_LEVEL=36
 MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
index c0ef406baa957baf4afb9c5ef31400805e36e31e..820dc6e6911cfe0bf53bc6c60b5891753ba033eb 100755 (executable)
@@ -122,6 +122,34 @@ def write_tex_defs (file, global_info, charmetrics):
        for m in charmetrics:
                file.write (r'''\def\%s%s{\char%d}%s''' % (nm, m['tex'], m['code'],'\n'))
 
+def write_fontlist (file, global_info, charmetrics):
+       nm = global_info['FontFamily']
+       file.write (r"""
+% Lilypond file to list all font symbols and the corresponding names
+% Automatically generated by mf-to-table.py
+\score{\notes{\fatText
+""")
+       for m in charmetrics:
+               escapedname=re.sub('_','\\\\\\\\_', m['name'])
+               file.write ('s^#\'(lines (music \"%s\") \"%s\")\n' % (m['name'], escapedname))
+       file.write (r"""
+}
+  \paper{
+    \translator{
+      \ScoreContext
+      \remove "Bar_number_engraver"
+      TextScript \override #'extra-extent-X = #'(-1 . 1)
+    }
+    \translator{
+      \StaffContext
+      \remove "Clef_engraver"
+      \remove "Key_engraver"
+      \remove "Time_signature_engraver"
+      \remove "Staff_symbol_engraver"
+    }
+  }
+}
+""")
 
 def write_deps (file, deps, targets):
        for t in targets:
@@ -149,12 +177,13 @@ Options:
 
 (options, files) = getopt.getopt(
     sys.argv[1:], 'a:d:hl:o:p:t:', 
-    ['afm=', 'outdir=', 'dep=',  'tex=', 'debug', 'help', 'package='])
+    ['afm=', 'outdir=', 'dep=',  'tex=', 'ly=', 'debug', 'help', 'package='])
 
 
 texfile_nm = ''
 depfile_nm = ''
 afmfile_nm = ''
+lyfile_nm = ''
 outdir_prefix = '.'
 
 for opt in options:
@@ -166,6 +195,8 @@ for opt in options:
                outdir_prefix = a
        elif o == '--tex' or o == '-t':
                texfile_nm = a
+       elif o == '--ly' or o == '-':
+               lyfile_nm = a
        elif o== '--help' or o == '-h':
                help()
        elif o=='--afm' or o == '-a':
@@ -190,5 +221,8 @@ for filenm in files:
        write_afm_metric (afm, g,m)
        write_tex_defs (open (texfile_nm, 'w'), g, m)
        write_deps (open (depfile_nm, 'wb'), deps, [base + '.dvi', texfile_nm, afmfile_nm])
+       if lyfile_nm != '':
+               write_fontlist(open (lyfile_nm, 'w'), g, m)
+
 
 
diff --git a/input/regression/spacing-stem-same-direction.ly b/input/regression/spacing-stem-same-direction.ly
new file mode 100644 (file)
index 0000000..62e7216
--- /dev/null
@@ -0,0 +1,13 @@
+\header {
+       texidoc = "For juxtaposed chords with the same direction, a
+slight optical correction is used. It is constant, and only works if
+two chords have no common head-positions range."
+}
+
+\score { \notes \relative c'' {
+\stemDown
+\time 12/4
+[f8 e f e] [f d f d] [f c f c] [f b, f' b,] [f' a, f' a,]
+}
+\paper { linewidth = -1. }
+}
index 0ab7a87b1b57491dc02ab35ddf04a8c73f41e5b5..ec1f482ef47257d20b0f026143e1f804d0aa1edb 100644 (file)
@@ -251,7 +251,7 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a)
        FIXME: uncommenting freaks out the Y-alignment of
        line-of-score.
        */
-      // Real align_param = isdir_b (align)  ? gh_scm2double (align) : 0.0;
+      // Real align_param = ly_dir_p (align)  ? gh_scm2double (align) : 0.0;
       
       if (gh_number_p (align))
        center_offset = total.linear_combination (gh_scm2double (align));
index 73340a4e0f9ed168f99ba206d41e0b5e5c085bca..f480a6acb9b3f29e7635f1767d1f9b75cd5a5978 100644 (file)
@@ -68,7 +68,7 @@ Arpeggio::brew_molecule (SCM smob)
     }
 
   Direction dir = CENTER;
-  if (isdir_b (me->get_grob_property ("arpeggio-direction")))
+  if (ly_dir_p (me->get_grob_property ("arpeggio-direction")))
     {
       dir = to_dir (me->get_grob_property ("arpeggio-direction"));
     }
index 1c757807e20e38befbf948737cf973ad2f20fcdc..48ac52ac32ce7d6e0b358ad03799bdaa1d53eb41 100644 (file)
@@ -234,7 +234,6 @@ Break_align_interface::do_alignment (Grob *me)
 
     The result is that an offsets of align_elements_to_extents () are
     not compensated for, and spring_len is completely off.
-
     
   */
   column->set_grob_property ("extra-space",
index 908d8f4432eaca03ec5bf0819046c3b3ede8f5ab..e76549a49ef43dd7d4a6e5025997710bc8a4b917 100644 (file)
 #include "music-list.hh"
 #include "musical-request.hh"
 
-/* some SCM abbrevs
 
-   zijn deze nou handig?
-   zijn ze er al in scheme, maar heten ze anders? */
-
-
-/* Remove doubles from (sorted) list */
-SCM
-ly_unique (SCM list)
-{
-  SCM unique = SCM_EOL;
-  for (SCM i = list; gh_pair_p (i); i = ly_cdr (i))
-    {
-      if (!gh_pair_p (ly_cdr (i))
-         || !gh_equal_p (ly_car (i), ly_cadr (i)))
-       unique = gh_cons (ly_car (i), unique);
-    }
-  return gh_reverse (unique);
-}
-
-/* Hmm, rewrite this using ly_split_list? */
-SCM
-ly_remove_member (SCM s, SCM list)
-{
-  SCM removed = SCM_EOL;
-  for (SCM i = list; gh_pair_p (i); i = ly_cdr (i))
-    {
-      if (!gh_equal_p (ly_car (i), s))
-       removed = gh_cons (ly_car (i), removed);
-    }
-  return gh_reverse (removed);
-}
-
-/* tail add */
-SCM
-ly_snoc (SCM s, SCM list)
-{
-  return gh_append2 (list, scm_list_n (s, SCM_UNDEFINED));
-}
-
-
-/* Split list at member s, removing s.
-   Return (BEFORE . AFTER) */
-SCM
-ly_split_list (SCM s, SCM list)
-{
-  SCM before = SCM_EOL;
-  SCM after = list;
-  for (; gh_pair_p (after);)
-    {
-      SCM i = ly_car (after);
-      after = ly_cdr (after);
-      if (gh_equal_p (i, s))
-       break;
-      before = gh_cons (i, before);
-    }
-  return gh_cons (gh_reverse (before), after);
-}
-
-/*
-  JUNKME. 
-  do something smarter.
-  zoals?
- */
 SCM
 Chord::base_pitches (SCM tonic)
 {
@@ -86,10 +23,10 @@ Chord::base_pitches (SCM tonic)
   SCM minor = Pitch (0, 2, -1).smobbed_copy ();
 
   base = gh_cons (tonic, base);
-  base = gh_cons (Pitch::transpose (ly_car (base), major), base);
-  base = gh_cons (Pitch::transpose (ly_car (base), minor), base);
+  base = gh_cons (pitch_transpose (ly_car (base), major), base);
+  base = gh_cons (pitch_transpose (ly_car (base), minor), base);
 
-  return gh_reverse (base);
+  return scm_reverse_x (base, SCM_EOL);
 }
 
 SCM
@@ -101,10 +38,10 @@ Chord::transpose_pitches (SCM tonic, SCM pitches)
   SCM transposed = SCM_EOL;
   for (SCM i = pitches; gh_pair_p (i); i = ly_cdr (i))
     {
-      transposed = gh_cons (Pitch::transpose (tonic, ly_car (i)),
+      transposed = gh_cons (pitch_transpose (tonic, ly_car (i)),
                            transposed);
     }
-  return gh_reverse (transposed);
+  return scm_reverse_x (transposed, SCM_EOL);
 }
 
 /*
@@ -123,11 +60,11 @@ Chord::lower_step (SCM tonic, SCM pitches, SCM step)
       if (gh_equal_p (step_scm (tonic, ly_car (i)), step)
          || gh_scm2int (step) == 0)
        {
-         p = Pitch::transpose (p, Pitch (0, 0, -1).smobbed_copy ());
+         p = pitch_transpose (p, Pitch (0, 0, -1).smobbed_copy ());
        }
       lowered = gh_cons (p, lowered);
     }
-  return gh_reverse (lowered);
+  return scm_reverse_x (lowered, SCM_EOL);
 }
 
 /* Return member that has same notename, disregarding octave or alterations */
@@ -217,7 +154,7 @@ Chord::missing_thirds (SCM pitches)
   for (int i=0; i < 7; i++)
     thirds = gh_cons (Pitch (0, 2, minormajor_a[i]).smobbed_copy (),
                      thirds);
-  thirds = scm_vector (gh_reverse (thirds));
+  thirds = scm_vector (scm_reverse_x (thirds, SCM_EOL));
   
   SCM tonic = ly_car (pitches);
   SCM last = tonic;
@@ -232,7 +169,7 @@ Chord::missing_thirds (SCM pitches)
        {
          int third = (unsmob_pitch (last)->notename_i_
                       - unsmob_pitch (tonic)-> notename_i_ + 7) % 7;
-         last = Pitch::transpose (last, scm_vector_ref (thirds, gh_int2scm (third)));
+         last = pitch_transpose (last, scm_vector_ref (thirds, gh_int2scm (third)));
        }
       
       if (step > gh_scm2int (step_scm (tonic, last)))
@@ -242,7 +179,7 @@ Chord::missing_thirds (SCM pitches)
              missing = gh_cons (last, missing);
              int third = (unsmob_pitch (last)->notename_i_
                           - unsmob_pitch (tonic)->notename_i_ + 7) % 7;
-             last = Pitch::transpose (last, scm_vector_ref (thirds,
+             last = pitch_transpose (last, scm_vector_ref (thirds,
                                                      gh_int2scm (third)));
            }
        }
@@ -262,7 +199,7 @@ Chord::add_above_tonic (SCM pitch, SCM pitches)
   /* Should we maybe first make sure that PITCH is below tonic? */
   if (pitches != SCM_EOL)
     while (Pitch::less_p (pitch, ly_car (pitches)) == SCM_BOOL_T)
-      pitch = Pitch::transpose (pitch, Pitch (1, 0, 0).smobbed_copy ());
+      pitch = pitch_transpose (pitch, Pitch (1, 0, 0).smobbed_copy ());
    
   pitches = gh_cons (pitch, pitches);
   return scm_sort_list (pitches, Pitch::less_p_proc);
index aadc62a4db1fe18202cfe87414daeba7860e4d2e..ccbdc5de9c70d08055ab92c6867c76fb2dc1d7b8 100644 (file)
@@ -15,7 +15,7 @@
 bool
 Directional_element_interface::has_interface (Grob*me) 
 {
-  return isdir_b (me->get_grob_property ("direction"));
+  return ly_dir_p (me->get_grob_property ("direction"));
 }
 
 Direction
@@ -23,7 +23,7 @@ Directional_element_interface::get (Grob*me)
 {
   // return dir_;
   SCM d= me->get_grob_property ("direction");
-  if (!isdir_b (d))
+  if (!ly_dir_p (d))
     return CENTER;
       
   return to_dir (d);
index d04491af592f58df77e54a6bdfaf9498c7128c3a..c46afab1080e9078d1661f080dd9e30c30d56224 100644 (file)
@@ -131,6 +131,9 @@ Duration::less_p (SCM p1, SCM p2)
 static SCM
 make_duration (SCM l, SCM d)
 {
+  SCM_ASSERT_TYPE(gh_number_p(l), l, SCM_ARG1, __FUNCTION__, "integer");
+  SCM_ASSERT_TYPE(gh_number_p(d), d, SCM_ARG2, __FUNCTION__, "integer");
+  
   Duration p (gh_scm2int (l), gh_scm2int (d));
   return p.smobbed_copy ();
 }
index 45196adb9fe5ce5687680858f311e6d2bc48d1ab..8a7bab80b3fe36b65d5a316efebc783c642486b4 100644 (file)
@@ -116,7 +116,7 @@ Fingering_engraver::process_music ()
   for (int i= pitch_sorted_reqs.size(); i--;)
     {
       SCM dir = pitch_sorted_reqs[i]->get_mus_property ("direction");
-      if (isdir_b (dir) && to_dir (dir)) {
+      if (ly_dir_p (dir) && to_dir (dir)) {
        if (to_dir (dir) == UP)
          up_reqs_.push (pitch_sorted_reqs[i]);
        else if (to_dir (dir) == DOWN)
@@ -189,7 +189,7 @@ Fingering_engraver::make_script (Direction d, Music *r,Axis a,  int i)
                                gh_int2scm (100 + d* i));
 
 
-  if (!isdir_b (fingering->get_grob_property ("direction")))
+  if (!ly_dir_p (fingering->get_grob_property ("direction")))
     {
       if (d)
        fingering->set_grob_property ("direction", gh_int2scm (d));
index c0f77578236b756ebb208099c68566972b8b13f7..c5c32c2337d2f2df2b08694af97e1786226a718c 100644 (file)
@@ -69,12 +69,7 @@ SCM
 ly_font_interface_get_default_font (SCM grob)
 {
   Grob * gr  = unsmob_grob (grob);
-
-  if (!gr)
-    {
-      warning ("ly_font_interface_get_default_font (): invalid argument");
-      return SCM_UNDEFINED;
-    }
+  SCM_ASSERT_TYPE(gr, grob, SCM_ARG1, __FUNCTION__, "grob");
 
   return Font_interface::get_default_font (gr)->self_scm ();
 }
index 577471baa3ec63b6b580434fe575da1026e97182..84c1cd10456a77b2f3e6b0c66882f034e16ca681 100644 (file)
@@ -137,14 +137,11 @@ Font_metric::find_by_name (String) const
 SCM
 ly_find_glyph_by_name (SCM font, SCM name)
 {
-  if (!unsmob_metrics (font) || !gh_string_p (name))
-    {
-      warning ("ly-find-glyph-by-name: invalid argument.");
-      Molecule m;
-      return m.smobbed_copy ();
-    }
+  Font_metric *fm = unsmob_metrics (font);
+  SCM_ASSERT_TYPE(fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
+  SCM_ASSERT_TYPE(gh_string_p (name), name, SCM_ARG2, __FUNCTION__, "string");
 
-  return unsmob_metrics (font)->find_by_name (ly_scm2string (name)).smobbed_copy ();
+  return fm->find_by_name (ly_scm2string (name)).smobbed_copy ();
 }
 
 
@@ -152,17 +149,11 @@ SCM
 ly_text_dimension (SCM font, SCM text)
 {
   Box b;
-  
-  if (!unsmob_metrics (font) || !gh_string_p(text))
-    {
-      warning ("ly-find-glyph-by-name: invalid argument.");
-      Molecule m;
-      return m.smobbed_copy ();
-    }
-  else
-    {
-      b = unsmob_metrics (font)->text_dimension (ly_scm2string (text));
-    }
+  Font_metric *fm = unsmob_metrics (font);
+  SCM_ASSERT_TYPE(fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
+  SCM_ASSERT_TYPE(gh_string_p (text), text, SCM_ARG2, __FUNCTION__, "string");
+
+  b = fm->text_dimension (ly_scm2string (text));
   
   return gh_cons (ly_interval2scm (b[X_AXIS]), ly_interval2scm(b[Y_AXIS]));
 }
index 064b68faabba5bc4d54787c0ba0b4128929bf454..deea0beadf1f3971a04d86b4fda680278d9527bb 100644 (file)
@@ -847,9 +847,21 @@ Grob::discretionary_processing ()
 SCM
 spanner_get_bound (SCM slur, SCM dir)
 {
-  return dynamic_cast<Spanner*> (unsmob_grob (slur))->get_bound (to_dir (dir))->self_scm ();
+  Spanner * sl = dynamic_cast<Spanner*> (unsmob_grob (slur));
+  SCM_ASSERT_TYPE(sl, slur, SCM_ARG1, __FUNCTION__, "spanner grob");
+  SCM_ASSERT_TYPE(ly_dir_p (dir), slur, SCM_ARG2, __FUNCTION__, "dir");
+  return sl->get_bound (to_dir (dir))->self_scm ();
 }
 
+SCM
+ly_get_paper_var (SCM grob, SCM sym)
+{
+  Grob * sc = unsmob_grob (grob);
+  SCM_ASSERT_TYPE(sc, grob, SCM_ARG1, __FUNCTION__, "grob");
+  SCM_ASSERT_TYPE(gh_symbol_p(sym), sym, SCM_ARG2, __FUNCTION__, "symbol");  
+
+  return sc->paper_l() ->get_scmvar_scm (sym);
+}
 
 
 
@@ -862,6 +874,8 @@ init_functions ()
                      (Scheme_function_unknown)ly_set_grob_property);
   scm_c_define_gsubr ("ly-get-spanner-bound", 2 , 0, 0,
                      (Scheme_function_unknown) spanner_get_bound);
+  scm_c_define_gsubr ("ly-get-paper-variable", 2 , 0, 0,
+                     (Scheme_function_unknown) ly_get_paper_var);
 }
 
 bool
index d0e78f62895a800dff44c5c5fd1eb0d900406e48..1e4d659f82bfcff9069bc7f4b1817baceb421629 100644 (file)
@@ -26,7 +26,7 @@ Hairpin::brew_molecule (SCM smob)
   Real line = me->paper_l ()->get_var ("stafflinethickness");  
   
   SCM s = me->get_grob_property ("grow-direction");
-  if (!isdir_b (s))
+  if (!ly_dir_p (s))
     {
       me->suicide ();
       return SCM_EOL;
index f957616d8bd838457a56de1eb9ad8fda6df09997..d4ea1f81926547f10755d17bfbcf544b7593e021 100644 (file)
@@ -184,8 +184,7 @@ void ly_display_scm (SCM s);
 void read_lily_scm_file (String);
 void init_lily_guile (String dir);
 
-bool isdir_b (SCM s);
-bool isaxis_b (SCM s);
+bool ly_dir_p (SCM s);
 bool ly_number_pair_p (SCM);
 bool ly_axis_p (SCM);
 
@@ -204,6 +203,10 @@ SCM index_cell (SCM cellp, Direction d);
 SCM index_set_cell (SCM cellp, Direction d, SCM val);
 
 
+
+SCM ly_snoc (SCM s, SCM list);
+SCM ly_split_list (SCM s, SCM list);
+SCM ly_unique (SCM list);
 /*
   snarfing.
  */
index 0ad02d105b68d26ca8eaba53e269105d07473b18..6bc9df23d3a37fec080fa951a667bc2f05d2f436 100644 (file)
@@ -61,7 +61,8 @@ public:
    */
   Real get_realvar (SCM symbol) const;
   Real get_var (String id) const;
-  SCM get_scmvar (String id)const; 
+  SCM get_scmvar (String id)const;
+  SCM get_scmvar_scm  (SCM sym) const;
   void reinit ();
   Paper_def ();
   Paper_def (Paper_def const&);
index abc2eba6bc79b08753f90ce377b65e4081c4071d..0d30f0529fa77f5544589dc6316c0f98f775b159 100644 (file)
@@ -62,8 +62,8 @@ public:
   /// return pitch from central c (in halfnotes)
   int semitone_pitch () const; 
   String str () const;
+  static SCM transpose (SCM,SCM);
 
-  static SCM transpose (SCM p, SCM delta);
 
   SCM smobbed_copy () const;
   DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
@@ -71,7 +71,7 @@ public:
 
 
 };
-
+SCM pitch_transpose (SCM p, SCM delta);
 DECLARE_UNSMOB(Pitch,pitch);
 
 #include "compare.hh"
index fd904b25be6cd88d3f2d42f94cdb0bc82292622f..89a96a1e4a4909c2f145734821be3dd795b19008 100644 (file)
@@ -35,12 +35,17 @@ free_smob (SCM s)
   return 0;
 }
 
+/*
+  for unknown reason, we don't use IMPLEMENT_TYPE_P
+ */
 SCM
 ly_input_p (SCM x)
 {
   return unsmob_input (x) ? SCM_BOOL_T : SCM_BOOL_F ;
 }
 
+
+
 static void
 start_input_smobs ()
 {
@@ -50,6 +55,7 @@ start_input_smobs ()
   scm_set_smob_print (input_tag, print_smob);
   scm_set_smob_equalp (input_tag, 0);
 
+  
   scm_c_define_gsubr ("ly-input-location?", 1, 0, 0,
                      (Scheme_function_unknown)ly_input_p);
 }
index 7bff8df6f4b16026132d488f5d397afcd9e29e86..423e437b20340db07d1069cbe41325d6a13ddff4 100644 (file)
@@ -272,12 +272,6 @@ HYPHEN             --
        _       {
                return FIGURE_SPACE;
        }
-       \]      {
-               return FIGURE_BRACKET_CLOSE;
-       }
-       \[      {
-               return FIGURE_BRACKET_OPEN;
-       }
        \>              {
                return FIGURE_CLOSE;
        }
index cf15fbd9628ab5f790a346e3e84138c401d4e73f..794062bfdd21cbc297f6c2698bf4b19a8a7111f4 100644 (file)
@@ -230,12 +230,6 @@ ly_number_pair_p (SCM p)
   return gh_pair_p (p) && gh_number_p (ly_car (p)) && gh_number_p (ly_cdr (p));
 }
 
-bool
-ly_axis_p (SCM a)
-{
-  return gh_number_p (a) && (gh_scm2int (a) == 0 || gh_scm2int (a) == 1); 
-}
-
 typedef void (*Void_fptr) ();
 Array<Void_fptr> *scm_init_funcs_;
 
@@ -289,7 +283,7 @@ unsigned int ly_scm_hash (SCM s)
 
 
 bool
-isdir_b (SCM s)
+ly_dir_p (SCM s)
 {
   if (gh_number_p (s))
     {
@@ -301,7 +295,7 @@ isdir_b (SCM s)
 
 
 bool
-isaxis_b (SCM s)
+ly_axis_p (SCM s)
 {
   if (gh_number_p (s))
     {
@@ -667,3 +661,51 @@ type_check_assignment (SCM sym, SCM val,  SCM type_symbol)
     }
   return ok;
 }
+
+
+/* some SCM abbrevs
+
+   zijn deze nou handig?
+   zijn ze er al in scheme, maar heten ze anders? */
+
+
+/* Remove doubles from (sorted) list */
+SCM
+ly_unique (SCM list)
+{
+  SCM unique = SCM_EOL;
+  for (SCM i = list; gh_pair_p (i); i = ly_cdr (i))
+    {
+      if (!gh_pair_p (ly_cdr (i))
+         || !gh_equal_p (ly_car (i), ly_cadr (i)))
+       unique = gh_cons (ly_car (i), unique);
+    }
+  return scm_reverse_x (unique, SCM_EOL);
+}
+
+/* tail add */
+SCM
+ly_snoc (SCM s, SCM list)
+{
+  return gh_append2 (list, scm_list_n (s, SCM_UNDEFINED));
+}
+
+
+/* Split list at member s, removing s.
+   Return (BEFORE . AFTER) */
+SCM
+ly_split_list (SCM s, SCM list)
+{
+  SCM before = SCM_EOL;
+  SCM after = list;
+  for (; gh_pair_p (after);)
+    {
+      SCM i = ly_car (after);
+      after = ly_cdr (after);
+      if (gh_equal_p (i, s))
+       break;
+      before = gh_cons (i, before);
+    }
+  return gh_cons ( scm_reverse_x (before, SCM_EOL),  after);
+  
+}
index 34158202053f5004d607035aea16f13304f6928f..2d832c965b9cdf6694fdb905e4ee07e7d30250b8 100644 (file)
@@ -408,7 +408,7 @@ ly_bracket (SCM a, SCM iv, SCM d, SCM t, SCM p)
 {
   SCM_ASSERT_TYPE(ly_axis_p (a), a, SCM_ARG1, __FUNCTION__, "axis") ;
   SCM_ASSERT_TYPE(ly_number_pair_p (iv), iv, SCM_ARG1, __FUNCTION__, "number pair") ;
-  SCM_ASSERT_TYPE(isdir_b (d), a, SCM_ARG1, __FUNCTION__, "direction") ;
+  SCM_ASSERT_TYPE(ly_dir_p (d), a, SCM_ARG1, __FUNCTION__, "direction") ;
   SCM_ASSERT_TYPE(gh_number_p (t), a, SCM_ARG1, __FUNCTION__, "number") ;
   SCM_ASSERT_TYPE(gh_number_p(p), a, SCM_ARG1, __FUNCTION__, "number") ;
 
index 6a7709a5bce23ffc323dfc4cca2cf3004103f330..6bb59a58a1b3239e0cf01332e45b74d75e1880bc 100644 (file)
@@ -151,13 +151,9 @@ SCM
 Molecule::ly_get_molecule_extent (SCM mol, SCM axis)
 {
   Molecule *m = unsmob_molecule (mol);
+  SCM_ASSERT_TYPE (m, mol, SCM_ARG1, __FUNCTION__, "molecule");
+  SCM_ASSERT_TYPE (ly_axis_p(axis), axis, SCM_ARG2, __FUNCTION__, "axis");
  
-  if (!m || !ly_axis_p (axis))
-    {
-      warning ("ly-get-molecule-extent: invalid arguments");
-      return ly_interval2scm (Interval (0,0));
-    }
-
   return ly_interval2scm (m->extent (Axis (gh_scm2int (axis))));
 }
 
@@ -173,7 +169,7 @@ Molecule::ly_molecule_combined_at_edge (SCM first, SCM axis, SCM direction,
 
 
   SCM_ASSERT_TYPE(ly_axis_p(axis), axis, SCM_ARG2, __FUNCTION__, "axis");
-  SCM_ASSERT_TYPE(isdir_b (direction), direction, SCM_ARG3, __FUNCTION__, "dir");
+  SCM_ASSERT_TYPE(ly_dir_p (direction), direction, SCM_ARG3, __FUNCTION__, "dir");
   SCM_ASSERT_TYPE(gh_number_p(padding), padding, SCM_ARG4, __FUNCTION__, "number");
 
   if (m1)
@@ -220,7 +216,7 @@ ly_align_to_x (SCM mol, SCM axis, SCM dir)
 {
   SCM_ASSERT_TYPE(unsmob_molecule (mol), mol, SCM_ARG1, __FUNCTION__, "molecule");
   SCM_ASSERT_TYPE(ly_axis_p(axis), axis, SCM_ARG2, __FUNCTION__, "axis");
-  SCM_ASSERT_TYPE(isdir_b (dir), dir, SCM_ARG3, __FUNCTION__, "dir");
+  SCM_ASSERT_TYPE(ly_dir_p (dir), dir, SCM_ARG3, __FUNCTION__, "dir");
 
   unsmob_molecule (mol)->align_to ((Axis)gh_scm2int (axis), Direction (gh_scm2int (dir)));
 
index f2939fb4f51ddc3b15d3fe0a234a6b010fa42304..d812fca1d5816e6a6d98c9fec42d0feca539eff1 100644 (file)
@@ -167,8 +167,6 @@ Music::internal_get_mus_property (SCM sym) const
   return (s == SCM_BOOL_F) ? SCM_EOL : ly_cdr (s); 
 }
 
-
-
 void
 Music::internal_set_mus_property (SCM s, SCM v)
 {
@@ -177,7 +175,6 @@ Music::internal_set_mus_property (SCM s, SCM v)
     assert (type_check_assignment (s, v, ly_symbol2scm ("music-type?")));
 #endif
   
-
   mutable_property_alist_ = scm_assq_set_x (mutable_property_alist_, s, v);
 }
 
@@ -189,8 +186,6 @@ Music::set_spot (Input ip)
   set_mus_property ("origin", make_input (ip));
 }
 
-
-
 Input*
 Music::origin () const
 {
@@ -199,9 +194,6 @@ Music::origin () const
 }
 
 
-
-
-
 Music::~Music ()
 {
   
@@ -211,17 +203,11 @@ SCM
 ly_get_mus_property (SCM mus, SCM sym)
 {
   Music * sc = unsmob_music (mus);
-  
-  if (sc)
-    {
+  SCM_ASSERT_TYPE(sc, mus, SCM_ARG1, __FUNCTION__, "grob");
+  SCM_ASSERT_TYPE(gh_symbol_p(sym), sym, SCM_ARG2, __FUNCTION__, "symbol");  
+
       return sc->internal_get_mus_property (sym);
-    }
-  else
-    {
-      warning (_ ("ly_get_mus_property (): Not a Music"));
-      scm_write (mus, scm_current_error_port ());
-    }
-  return SCM_EOL;
+
 }
 
 
@@ -229,22 +215,8 @@ SCM
 ly_set_mus_property (SCM mus, SCM sym, SCM val)
 {
   Music * sc = unsmob_music (mus);
-
-  if (!gh_symbol_p (sym))
-    {
-      warning (_ ("ly_set_mus_property (): Not a symbol"));
-      scm_write (mus, scm_current_error_port ());      
-
-      return SCM_UNSPECIFIED;
-    }
-
-  if (!sc)
-    {
-      warning (_ ("ly_set_mus_property ():  not of type Music: "));
-      scm_write (mus, scm_current_error_port ());
-      return SCM_UNSPECIFIED;
-    }
-
+  SCM_ASSERT_TYPE(sc, mus, SCM_ARG1, __FUNCTION__, "grob");
+  SCM_ASSERT_TYPE(gh_symbol_p(sym), sym, SCM_ARG2, __FUNCTION__, "symbol");  
 
   bool ok = type_check_assignment (sym, val, ly_symbol2scm ("music-type?"));
   if (ok)
@@ -260,35 +232,23 @@ ly_set_mus_property (SCM mus, SCM sym, SCM val)
 SCM
 ly_make_music (SCM type)
 {
-  if (!gh_string_p (type))
-    {
-      warning (_ ("ly_make_music (): Not a string"));
-      scm_write (type, scm_current_error_port ());      
-
-      return SCM_UNSPECIFIED;
-    }
-  else
-    {
-      SCM s = get_music (ly_scm2string (type))->self_scm ();
-      scm_gc_unprotect_object (s);
+  SCM_ASSERT_TYPE(gh_string_p(type), type, SCM_ARG1, __FUNCTION__, "string");
+  
+  
+  SCM s = get_music (ly_scm2string (type))->self_scm ();
+  scm_gc_unprotect_object (s);
 
-      return s;
-    }
+  return s;
 }
 
 SCM
 ly_music_name (SCM mus)
 {
   Music * m = unsmob_music (mus);
-  const char *nm ="";
-  if (!m)
-    {
-      warning (_ ("ly_music_name (): Not a music expression"));
-      scm_write (mus, scm_current_error_port ());      
-    }
-   else
-     nm = classname (m);
-   return ly_str02scm (nm);
+  SCM_ASSERT_TYPE(m, mus, SCM_ARG1, __FUNCTION__ ,"music");
+  
+  const char * nm = classname (m);
+  return ly_str02scm (nm);
 }
 
 SCM
index 4e2c2fc109a8347f87edabf6a984b95d248b14da..01276185ebb6b61998c13da7e27bbbce2f70e9a4 100644 (file)
@@ -184,7 +184,7 @@ Note_head::brew_molecule (SCM smob)
 Interval
 Note_head::head_extent (Grob *me, Axis a)
 {
-  return  internal_brew_molecule (me, false).extent (a);
+  return internal_brew_molecule (me, false).extent (a);
 }
 
 bool
index 77365b134dab7a1aa29ff610040b91a3062e323b..905975896ae77775edfb52d3740aba6c8ad88801 100644 (file)
@@ -150,7 +150,8 @@ Real
 Note_spacing::stem_dir_correction (Grob*me) 
 {
   Drul_array<Direction> stem_dirs(CENTER,CENTER);
-  Drul_array<Interval> posns;
+  Drul_array<Interval> stem_posns;
+  Drul_array<Interval> head_posns;  
   Drul_array<SCM> props(me->get_grob_property ("left-items"),
                        me->get_grob_property ("right-items"));
 
@@ -158,12 +159,17 @@ Note_spacing::stem_dir_correction (Grob*me)
   Interval intersect;
   bool correct = true;
   Direction d = LEFT;
+  bool acc_right = false;
+  
   do
     {
       for (SCM  s = props[d]; gh_pair_p (s); s = gh_cdr (s))
        {
          Item * it= dynamic_cast<Item*> (unsmob_grob (gh_car(s)));
 
+         if (d == RIGHT)
+           acc_right = acc_right || Note_column::accidentals (it);
+         
          Grob *stem = Note_column::stem_l (it);
 
          if (!stem || Stem::invisible_b (stem))
@@ -180,31 +186,81 @@ Note_spacing::stem_dir_correction (Grob*me)
            }
          stem_dirs[d] = sd;
 
-         Real chord_start = Stem::head_positions (stem)[sd];
+         Interval hp  = Stem::head_positions (stem);
+         Real chord_start = hp[sd];      
          Real stem_end = Stem::stem_end_position (stem);
          
-         posns[d] = Interval(chord_start<?stem_end, chord_start>? stem_end);
+         stem_posns[d] = Interval(chord_start<?stem_end, chord_start>? stem_end);
+         head_posns[d].unite (hp);
        }
     }
   while (flip (&d) != LEFT);
   
-  intersect = posns[LEFT];  
-  intersect.intersect(posns[RIGHT]);
-  correct = correct && !intersect.empty_b ();
-  correct = correct && (stem_dirs[LEFT] *stem_dirs[RIGHT] == -1);
-  
- exit_loop:
-  if(!correct)
-    return 0.0;
 
   /*
-    Ugh. 7 is hardcoded.
-   */
-  Real correction = abs (intersect.length ());
-  correction = (correction/7) <? 1.0;
-  correction *= stem_dirs[LEFT] ;
-  correction *= gh_scm2double (me->get_grob_property ("stem-spacing-correction"));
+    don't correct if accidentals are sticking out of the right side.
 
-  return correction;
+  */
+  if (acc_right)
+    return 0.0;
+
+  
+  if (correct && stem_dirs[LEFT] *stem_dirs[RIGHT] == -1)
+    {
+      intersect = stem_posns[LEFT];  
+      intersect.intersect(stem_posns[RIGHT]);
+      correct = correct && !intersect.empty_b ();
+
+      if (!correct)
+       return 0.0;
+      /*
+      Ugh. 7 is hardcoded.
+    */
+      Real correction = abs (intersect.length ());
+      correction = (correction/7) <? 1.0;
+      correction *= stem_dirs[LEFT] ;
+      correction *= gh_scm2double (me->get_grob_property ("stem-spacing-correction"));
+      return correction;
+    }
+  else if (correct)
+    {
+      /*
+       Correct for the following situation:
+
+        X      X
+       |      | 
+       |      |
+       |   X  |
+       |  |   |
+       ========
+
+           ^ move the center one to the left.
+       
+
+       this effect seems to be much more subtle than the
+       stem-direction stuff (why?), and also does not scale with the
+       difference in stem length.
+       
+       */
+
+      
+      Interval hp = head_posns[LEFT];
+      hp.intersect  (head_posns[RIGHT]);
+      if (!hp.empty_b())
+       return 0.0;
+
+      Direction lowest =
+       (head_posns[LEFT][DOWN] > head_posns[RIGHT][UP]) ? RIGHT : LEFT;
+
+      Real delta = head_posns[-lowest][DOWN] - head_posns[lowest][UP] ;
+      Real corr = gh_scm2double (me->get_grob_property ("stem-spacing-correction"));
+      corr =  (delta <= 1) ? 0.0 : 0.25;
+      
+      return -lowest * corr ;
+    }
+
+  
+ exit_loop:
+  return 0.0;
 }
  
index 5813786e62c080c0851c41bc2aea143d707db043..d28375ba9105103030871b0a546873eb9aec79b9 100644 (file)
 #include "file-results.hh" // urg? header_global_p
 #include "paper-outputter.hh"
 
+/*
+  This is an almost empty thing. The only substantial thing this class
+  handles, is scaling up and down to real-world dimensions (internally
+  dimensions are against global staff-space.)
+  
+ */
 Paper_def::Paper_def ()
 {
 }
@@ -45,6 +51,13 @@ Paper_def::get_scmvar (String s) const
   return  scope_p_->scm_elem (ly_symbol2scm (s.ch_C ()));
 }
 
+
+SCM
+Paper_def::get_scmvar_scm (SCM sym) const
+{
+  return  gh_double2scm (get_realvar (sym));
+}
+
 Real
 Paper_def::get_realvar (SCM s) const
 {
index c7a905166c41759b000e5f08f1f3f93844af38d7..3f972dcc01ec64eb6a8282dc29757a6f8ba6ece8 100644 (file)
@@ -1744,12 +1744,14 @@ bass_figure:
 
 br_bass_figure:
        '[' bass_figure {
-               unsmob_music ($2)->set_mus_property ("bracket-start", SCM_BOOL_T);
+               $$ = $2;
+               unsmob_music ($$)->set_mus_property ("bracket-start", SCM_BOOL_T);
        }
        | bass_figure   {
-
+               $$ = $1;
        }
        | br_bass_figure ']' {
+               $$ = $1;
                unsmob_music ($1)->set_mus_property ("bracket-stop", SCM_BOOL_T);
        }
        ;
index d160841e9c27c6686e0888d49690d1cce9f834d1..f5fe945f997d7e24c0de7dae0bd96a6bfab9b21d 100644 (file)
@@ -220,20 +220,28 @@ Pitch::down_to (int notename)
   notename_i_ = notename;
 }
 
-///MAKE_SCHEME_CALLBACK (Pitch, transpose, 2);
-///transpose_proc?
+/*
+  can't use macro MAKE_SCHEME_CALLBACK().
+   messy stuff since Pitch::transpose is overloaded.
+ */
+
 SCM
-Pitch::transpose (SCM p, SCM delta)
+pitch_transpose (SCM p, SCM delta)
 {
-  Pitch t = *unsmob_pitch (p);
-  t.transpose (*unsmob_pitch (delta));
-  return t.smobbed_copy ();
+  Pitch* t = unsmob_pitch (p);
+  Pitch *d = unsmob_pitch (delta);
+  SCM_ASSERT_TYPE(t, p, SCM_ARG1, __FUNCTION__, "pitch")  ;
+  SCM_ASSERT_TYPE(d, delta, SCM_ARG1, __FUNCTION__, "pitch")  ;
+
+  Pitch tp =*t;
+  tp.transpose (*d);
+  return tp.smobbed_copy ();
 }
 
-static SCM
-pitch_transpose (SCM p, SCM delta)
+SCM
+Pitch::transpose (SCM p, SCM d)
 {
-  return Pitch::transpose (p, delta);
+  return pitch_transpose (p,d);
 }
 
 /****************************************************************/
@@ -248,8 +256,6 @@ Pitch::mark_smob (SCM)
 }
 
 IMPLEMENT_SIMPLE_SMOBS (Pitch);
-
-
 int
 Pitch::print_smob (SCM s, SCM port, scm_print_state *)
 {
@@ -291,10 +297,13 @@ Pitch::less_p (SCM p1, SCM p2)
 /*
   should add optional args
  */
-
 static SCM
 make_pitch (SCM o, SCM n, SCM a)
 {
+  SCM_ASSERT_TYPE(gh_number_p(o), o, SCM_ARG1, __FUNCTION__, "number");
+  SCM_ASSERT_TYPE(gh_number_p(n), n, SCM_ARG2, __FUNCTION__, "number");
+  SCM_ASSERT_TYPE(gh_number_p(a), a, SCM_ARG3, __FUNCTION__, "number");
+
   Pitch p (gh_scm2int (o), gh_scm2int (n), gh_scm2int (a));
   return p.smobbed_copy ();
 }
@@ -303,11 +312,8 @@ static SCM
 pitch_octave (SCM pp)
 {
   Pitch *p = unsmob_pitch (pp);
-  int q = 0;
-  if (!p)
-    warning ("Not a pitch");
-  else
-    q = p->octave_i ();
+   SCM_ASSERT_TYPE(p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
+  int q = p->octave_i ();
 
   return gh_int2scm (q);
 }
@@ -316,11 +322,8 @@ static SCM
 pitch_alteration (SCM pp)
 {
   Pitch *p = unsmob_pitch (pp);
-  int q = 0;
-  if (!p)
-    warning ("Not a pitch");
-  else
-    q = p->alteration_i ();
+  SCM_ASSERT_TYPE(p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
+  int     q = p->alteration_i ();
 
   return gh_int2scm (q);
 }
@@ -329,11 +332,8 @@ static SCM
 pitch_notename (SCM pp)
 {
   Pitch *p = unsmob_pitch (pp);
-  int q = 0;
-  if (!p)
-    warning ("Not a pitch");
-  else
-    q = p->notename_i ();
+  SCM_ASSERT_TYPE(p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
+  int q  = p->notename_i ();
 
   return gh_int2scm (q);
 }
@@ -342,11 +342,9 @@ static SCM
 pitch_semitones (SCM pp)
 {
   Pitch *p = unsmob_pitch (pp);
-  int q = 0;
-  if (!p)
-    warning ("Not a pitch");
-  else
-    q = p->steps ();
+   SCM_ASSERT_TYPE(p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
+  int q = p->steps ();
 
   return gh_int2scm (q);
 }
@@ -356,7 +354,6 @@ add_funcs ()
 {
   // should take list?: (make-pitch ' (octave name accidental))
   scm_c_define_gsubr ("make-pitch", 3, 0, 0, (Scheme_function_unknown)make_pitch);
-
   scm_c_define_gsubr ("pitch-octave", 1, 0, 0, (Scheme_function_unknown)pitch_octave);
   scm_c_define_gsubr ("pitch-notename", 1, 0, 0, (Scheme_function_unknown)pitch_notename);
   scm_c_define_gsubr ("pitch-alteration", 1, 0, 0, (Scheme_function_unknown)pitch_alteration);
index 810936918a8cb66a9177583908bab97b919feeb9..aefeb1f7a0e51ddcfac1b8ba08d62152016a3524 100644 (file)
@@ -43,7 +43,7 @@ Script_req::get_direction () const
 {
   SCM d = get_mus_property ("direction");
 
-  return (isdir_b (d)) ?  to_dir (d) : CENTER;
+  return (ly_dir_p (d)) ?  to_dir (d) : CENTER;
 }
 
 Direction
@@ -51,7 +51,7 @@ Span_req::get_span_dir () const
 {
   SCM d = get_mus_property ("span-direction");
 
-  return (isdir_b (d)) ?  to_dir (d) : CENTER;
+  return (ly_dir_p (d)) ?  to_dir (d) : CENTER;
 }
 
 void
index 3ef8142b94eb42c2b96b3e05369bdf196dd1dcad..0466630e3a8fa702598373ed25b5330a5b871f06 100644 (file)
@@ -78,13 +78,13 @@ Script_engraver::process_music ()
       art = ly_cdr (art);
 
       SCM force_dir = l->get_mus_property ("direction");
-      if (isdir_b (force_dir) && !to_dir (force_dir))
+      if (ly_dir_p (force_dir) && !to_dir (force_dir))
        force_dir = ly_car (art);
       
       art = ly_cdr (art);
       SCM priority = ly_car (art);
 
-      if (isdir_b (force_dir) && to_dir (force_dir))
+      if (ly_dir_p (force_dir) && to_dir (force_dir))
        p->set_grob_property ("direction", force_dir);
       else if (to_dir (relative_stem_dir))
        p->set_grob_property ("side-relative-direction", relative_stem_dir);
index 2e83ee183c082527306229df7f1c409f2a85f741..9acf165858db16ee93ced2c38a35e330bd8e7fdc 100644 (file)
@@ -28,12 +28,12 @@ Direction
 Side_position_interface::get_direction (Grob*me)
 {
   SCM d = me->get_grob_property ("direction");
-  if (isdir_b (d) && to_dir (d))
+  if (ly_dir_p (d) && to_dir (d))
     return to_dir (d);
 
   Direction relative_dir = Direction (1);
   SCM reldir = me->get_grob_property ("side-relative-direction");      // should use a lambda.
-  if (isdir_b (reldir))
+  if (ly_dir_p (reldir))
     {
       relative_dir = to_dir (reldir);
     }
index 802eeefc9bb1b6e54275d982741d9d5c970ee421..b165e86711e5dc4004ba3d8550e437a77bd7520f 100644 (file)
@@ -125,7 +125,7 @@ Text_item::markup_text2molecule (Grob *me, SCM markup_text,
   Axis axis = X_AXIS;
 
   SCM a = ly_assoc_chain (ly_symbol2scm ("axis"), p);
-  if (gh_pair_p (a) && isaxis_b (ly_cdr (a)))
+  if (gh_pair_p (a) && ly_axis_p (ly_cdr (a)))
     axis = (Axis)gh_scm2int (ly_cdr (a));
 
   Real baseline_skip = 0;
index fe46960c4eb1898124280f3c6bf7985e7e8ef252..2938b2b7cd7b1cbdb3ca74a2d0c33db471410b8e 100644 (file)
@@ -414,25 +414,21 @@ ly_get_trans_property (SCM context, SCM name)
 {
   Translator *t = unsmob_translator (context);
   Translator_group* tr=   dynamic_cast<Translator_group*> (t);
-  if (!t || !tr)
-    {
-      /* programming_error? */
-      warning (_ ("ly-get-trans-property: expecting a Translator_group argument"));
-      return SCM_EOL;
-    }
+  SCM_ASSERT_TYPE(tr, context, SCM_ARG1, __FUNCTION__, "Translator group");
+  SCM_ASSERT_TYPE(gh_symbol_p(name), name, SCM_ARG2, __FUNCTION__, "symbol");
+
   return tr->internal_get_property (name);
   
 }
 SCM
 ly_set_trans_property (SCM context, SCM name, SCM val)
 {
-
   Translator *t = unsmob_translator (context);
   Translator_group* tr=   dynamic_cast<Translator_group*> (t);
-  if (tr)
-    {
-      tr->internal_set_property (name, val);
-    }
+
+  SCM_ASSERT_TYPE(tr, context, SCM_ARG1, __FUNCTION__, "Translator group");
+  tr->internal_set_property (name, val);
+
   return SCM_UNSPECIFIED;
 }
 
index b93ff670d67a6f9816a44b3b8bf2e34ab7387a14..dc74135a3c42e8fae888a6a70f4babd5bec2994e 100644 (file)
@@ -271,7 +271,7 @@ Tuplet_bracket::get_default_dir (Grob*me)
 {
   Direction d = UP;
   SCM dir_sym =me->get_grob_property ("dir-forced");
-  if (isdir_b (dir_sym))
+  if (ly_dir_p (dir_sym))
     {
       d= to_dir (dir_sym);
       if (d != CENTER)
index 09ce0f151853084630b6fc3d88cddc7e0f896949..9891207728f70e4f386dcaf8a7ebbf5e5bedf317 100644 (file)
@@ -40,7 +40,7 @@ ABC2LY = $(script-dir)/abc2ly.py
 CONVERT_LY = $(script-dir)/convert-ly.py
 LILYPOND = $(depth)/$(builddir)/lily/$(outconfbase)/lilypond
 LILYPOND_BOOK = $(script-dir)/lilypond-book.py
-LILYPOND_BOOK_INCLUDES = -I $(pwd) -I $(outdir) -I$(input-dir) -I $(input-dir)/tricks/ -I $(input-dir)/regression/ -I $(input-dir)/test/ -I $(input-dir)/tutorial/
+LILYPOND_BOOK_INCLUDES = -I $(pwd) -I $(outdir) -I$(input-dir) -I $(input-dir)/tricks/ -I $(input-dir)/regression/ -I $(input-dir)/test/ -I $(input-dir)/tutorial/ -I $(topdir)/mf/out
 LY2DVI = $(script-dir)/ly2dvi.py
 LYS_TO_TELY = $(buildscript-dir)/lys-to-tely.py
 PS_TO_GIFS = $(buildscript-dir)/ps-to-gifs.sh
index fbbe7c17dc2412ed9b8a3cbd67889007d77a1906..4023ae3f97d191fa281706aa0a83356195e2e39c 100644 (file)
@@ -1,15 +1,15 @@
 Begin3
 Title: LilyPond
-Version: 1.5.35
-Entered-date: 28FEB02
+Version: 1.5.36
+Entered-date: 02MRT02
 Description: @BLURB@
 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.5.35.tar.gz 
+       1000k lilypond-1.5.36.tar.gz 
 Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
-       1000k lilypond-1.5.35.tar.gz 
+       1000k lilypond-1.5.36.tar.gz 
 Copying-policy: GPL
 End
index 10c3901eb9966d41adbd84db3ef8ce7ae0541ff7..fb7b5b9d580c033d28f818a78c37705a51ef3183 100644 (file)
@@ -1,5 +1,5 @@
 %define name lilypond
-%define version 1.5.35
+%define version 1.5.36
 %define release 1mdk
 
 Name: %{name}
index fa24695e851c51ec4bff1a2855ebdf965c74a383..f749a9ef006735389378610a4ad3e3928ca56c5f 100644 (file)
@@ -3,11 +3,11 @@
 %define info yes
 
 Name: lilypond
-Version: 1.5.35
+Version: 1.5.36
 Release: 1
 License: GPL
 Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.35.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.36.tar.gz
 Summary: Create and print music notation 
 URL: http://www.lilypond.org/
 BuildRoot: /tmp/lilypond-install
index f1c0e7425d1390b3bd6c8bbe3898a7c9a5aeb991..ae96685caa6a9cec73355cb0cb73887cdd50f278 100644 (file)
 
 Distribution: SuSE Linux 7.0 (i386)
 Name: lilypond
-Version: 1.5.35
+Version: 1.5.36
 Release: 2
 Copyright:    GPL
 Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.35.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.5.36.tar.gz
 # music notation software for.. ?
 Summary: A program for printing sheet music.
 URL: http://www.lilypond.org/
index ee62663cfa760e6d36e8f034064e37e102b2b335..15d24e76b23180e1dd16f10eb2bd56099488edfb 100644 (file)
@@ -8,7 +8,7 @@ include $(depth)/make/stepmake.make
 
 AF_FILES = $(wildcard *.af) 
 
-EXTRA_DIST_FILES += README feta.tex lilypond.map
+EXTRA_DIST_FILES += README feta.tex
 
 # don't try to make fonts from test files
 TEST_FILES = $(wildcard *test*.mf)
@@ -57,7 +57,7 @@ ifdef MAKE_PFA_FILES
 PFA_FILES = $(addprefix $(outdir)/, $(FONT_FILES:.mf=.pfa))
 ALL_GEN_FILES += $(PFA_FILES)
 INSTALLATION_OUT_DIR4=$(datadir)/pfa
-INSTALLATION_OUT_FILES4=$(PFA_FILES) lilypond.map
+INSTALLATION_OUT_FILES4=$(PFA_FILES)
 
 pfa: $(PFA_FILES) 
 endif
@@ -66,10 +66,13 @@ export MFINPUTS:=.:$(MFINPUTS)
 
 default: $(ALL_GEN_FILES)
 
+$(outdir)/lilypond.map: 
+       echo $(FONT_FILES:.mf=) | awk -v RS=' ' '{print $$1 " TeX-" $$1 " <" $$1 ".pfa"}' > $@
+
 ##
 ## todo: this also depends on .tfm, FIXME.
 $(outdir)/%.afm  $(outdir)/%.tex $(outdir)/%.dep: $(outdir)/%.log 
-       $(PYTHON) $(buildscript-dir)/mf-to-table.py --package=$(topdir) --outdir=$(outdir) --dep $(outdir)/$(<F:.log=.dep)  --afm $(outdir)/$(<F:.log=.afm) --tex $(outdir)/$(<F:.log=.tex) $<
+       $(PYTHON) $(buildscript-dir)/mf-to-table.py --package=$(topdir) --outdir=$(outdir) --dep $(outdir)/$(<F:.log=.dep)  --afm $(outdir)/$(<F:.log=.afm) --tex $(outdir)/$(<F:.log=.tex) --ly $(outdir)/$(<F:.log=.ly) $<
 
 local-clean:
        rm -f mfplain.mem mfplain.log 
diff --git a/mf/lilypond.map b/mf/lilypond.map
deleted file mode 100644 (file)
index 5ba7e28..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-%vvv UniqueID=4455667
-feta11 TeX-feta11 <feta11.pfa
-feta13 TeX-feta13 <feta13.pfa
-feta16 TeX-feta16 <feta16.pfa
-feta19 TeX-feta19 <feta19.pfa
-feta20 TeX-feta20 <feta20.pfa
-feta23 TeX-feta23 <feta23.pfa
-feta26 TeX-feta26 <feta26.pfa
-feta-din4 TeX-feta-din4 <feta-din4.pfa
-feta-din5 TeX-feta-din5 <feta-din5.pfa
-feta-din6 TeX-feta-din6 <feta-din6.pfa
-feta-din7 TeX-feta-din7 <feta-din7.pfa
-feta-din8 TeX-feta-din8 <feta-din8.pfa
-feta-din9 TeX-feta-din9 <feta-din9.pfa
-feta-din10 TeX-feta-din10 <feta-din10.pfa
-feta-din11 TeX-feta-din11 <feta-din11.pfa
-feta-din12 TeX-feta-din12 <feta-din12.pfa
-feta-din13 TeX-feta-din13 <feta-din13.pfa
-feta-din14 TeX-feta-din14 <feta-din14.pfa
-feta-din17 TeX-feta-din17 <feta-din17.pfa
-feta-din19 TeX-feta-din19 <feta-din19.pfa
-feta-braces0 TeX-feta-braces0 <feta-braces0.pfa
-feta-braces1 TeX-feta-braces1 <feta-braces1.pfa
-feta-braces2 TeX-feta-braces2 <feta-braces2.pfa
-feta-braces3 TeX-feta-braces3 <feta-braces3.pfa
-feta-braces4 TeX-feta-braces4 <feta-braces4.pfa
-feta-braces5 TeX-feta-braces5 <feta-braces5.pfa
-feta-braces6 TeX-feta-braces6 <feta-braces6.pfa
-feta-braces7 TeX-feta-braces7 <feta-braces7.pfa
-feta-braces8 TeX-feta-braces8 <feta-braces8.pfa
-feta-nummer4 TeX-feta-nummer4 <feta-nummer4.pfa
-feta-nummer5 TeX-feta-nummer5 <feta-nummer5.pfa
-feta-nummer6 TeX-feta-nummer6 <feta-nummer6.pfa
-feta-nummer7 TeX-feta-nummer7 <feta-nummer7.pfa
-feta-nummer8 TeX-feta-nummer8 <feta-nummer8.pfa
-feta-nummer10 TeX-feta-nummer10 <feta-nummer10.pfa
-feta-nummer11 TeX-feta-nummer11 <feta-nummer11.pfa
-feta-nummer13 TeX-feta-nummer13 <feta-nummer13.pfa
index 3efab9dfbe52c0d17a73e53c3ddd37dcf66a17f7..4b167fee0c3711ed5faf7a002e9a529defc75632 100644 (file)
@@ -119,7 +119,7 @@ def custos_medicaea(expr verbose_name, internal_name, mudela_name,
                a_w := 1.09;
 
                save a, beta, ht, wd;
-               ht# = noteheight# * mag;
+               ht# = noteheight#; %%  * mag;
                2beta# = ht# * b_h;
                a# = beta# * a_b;
                wd# = 0.4a# / a_w;      % width intentionally too small
@@ -192,7 +192,7 @@ def custos_vaticana(expr verbose_name, internal_name, mudela_name,
                a_w := 1.09;
 
                save a, beta, ht, wd;
-               ht# = noteheight# * mag;
+               ht# = noteheight# ; %%  * mag;
                2beta# = ht# * b_h;
                a# = beta# * a_b;
                wd# = 0.4a# / a_w;
index 33aeea3091b00b0058d6f301fce16ebed5d09020..ef9a78dcaf9309937630e37e3b1e199b407ac79e 100644 (file)
@@ -272,7 +272,7 @@ def punctum_char (expr verbose_name, internal_name, mudela_name,
                a_w := 1.09;
 
                save a, beta, ht, wd;
-               ht# = noteheight# * mag;
+               ht# = noteheight#;  %% * mag;
                2beta# = ht# * b_h;
                a# = beta# * a_b;
                wd# = 2a# / a_w;
@@ -596,7 +596,7 @@ fet_beginchar("Solesmes oriscus", "0solesmes_oriscus",
        a_w := 1.09;
 
        save a, beta, ht, wd;
-       ht# = noteheight# * mag;
+       ht# = noteheight#; %%  * mag;
        2beta# = ht# * b_h;
        a# = beta# * a_b;
        wd# = 2a# / a_w;
index 409d58224579f29d532841876dd9e9ed403caaf6..63001abca21ea13c55da0db26378ad8e4955c954 100644 (file)
@@ -2,14 +2,6 @@
 
 ;;;; todo: make interfaces as 1st level objects in LilyPond.
 
-
-(define (fontify-text font-metric text)
-  "Set TEXT with font FONT-METRIC, returning a molecule."
-  (let* ((b  (ly-text-dimension font-metric text)))
-    (ly-make-molecule
-     (ly-fontify-atom font-metric `(text ,text)) (car b) (cdr b))
-    ))
-
 (define (brew-one-figure grob fig-music)
   "Brew a single column for a music figure"
   (let* (
     mol))
 
 
-(define (stack-molecules axis dir padding mols)
-  "Stack molecules MOLS in direction AXIS,DIR, using PADDING."
-  (if (null? mols)
-      '()
-      (if (pair? mols)
-         (ly-combine-molecule-at-edge (car mols) axis dir 
-                                      (stack-molecules axis dir padding (cdr mols))
-                                      padding
-                                      )
-         )
-  ))
 
 (define (brew-bass-figure grob)
   "Make a molecule for a Figured Bass grob"
   (let* (
         (figs (ly-get-grob-property grob 'causes ))
-        (fig-mols (map (lambda (x) (brew-one-figure grob x)) figs))
-        (fig-mol (stack-molecules 1 -1 0.2 fig-mols))
+        (mol (ly-make-molecule '() '(0 . 0) '(0 . 0)))
+        (padding (ly-get-grob-property grob 'padding))
+        (kerning (ly-get-grob-property grob 'kern))
+        (thickness (*
+                    (ly-get-paper-variable grob 'stafflinethickness)
+                    (ly-get-grob-property grob 'thickness))
+                   )
         )
 
-    (ly-align-to! fig-mol Y DOWN)
-    fig-mol
-  ))
+
+
+    (define (brew-complete-figure grob figs mol)
+      "recursive function: take some stuff from FIGS, and add it to MOL." 
+      (define (end-bracket? fig)
+       (eq? (ly-get-mus-property fig 'bracket-stop) #t)
+       )
+      
+      (if (null? figs)
+         mol
+         (if (eq? (ly-get-mus-property (car figs) 'bracket-start) #t)
+             (let* (
+                    (gather-todo (take-from-list-until figs '() end-bracket?))
+                    (unbr-mols
+                     (map
+                      (lambda (x) (brew-one-figure grob x))
+                      (reverse! (car gather-todo) '())))
+                    (br-mol (bracketify-molecule
+                             (stack-molecules Y UP kerning unbr-mols)
+                             Y thickness (* 2 padding) padding))
+                    )
+               (brew-complete-figure
+                grob (cdr gather-todo)
+                (ly-combine-molecule-at-edge mol Y UP br-mol kerning)
+                )
+               )
+             (brew-complete-figure
+              grob (cdr figs)
+              (ly-combine-molecule-at-edge mol Y UP (brew-one-figure grob (car figs))
+                                           kerning))
+             )
+         ))
+
+    
+    (set! mol (brew-complete-figure grob (reverse figs) mol))
+    (ly-align-to! mol Y DOWN)
+    mol
+    ))
 
index dc1bad45a80a2ba913ca64adcca1ebd167d8e527..5fea3d145d552e52751a2f415bc269bbe043b474 100644 (file)
 
 
 
+(define (take-from-list-until todo gathered crit?)
+  "return (G, T), where (reverse G) + T = GATHERED + TODO, and the last of G
+is the  first to satisfy CRIT "
+  (if (null? todo)
+      (cons gathered todo)
+      (if (crit? (car todo))
+         (cons (cons (car todo) gathered) (cdr todo))
+         (take-from-list-until (cdr todo) (cons (car todo) gathered) crit?)
+      )
+  ))
+; test:
+; (take-from-list-until '(1 2 3  4 5) '() (lambda (x) (eq? x 3)))
+; ((3 2 1) 4 5)
+
+
+
 ; Make a function that checks score element for being of a specific type. 
 (define (make-type-checker symbol)
   (lambda (elt)
index 3ea708e2f7b399d3292a39d8a7deb3fd7a9e535b..bb8a8545512f896859ee09d2db8823f9c0f303ea 100644 (file)
@@ -77,6 +77,9 @@
                       (direction . 0)
                       (font-family . number)
                       (font-relative-size . -1)
+                      (padding . 0.1)
+                      (kern . 0.2)
+                      (thickness . 1.0)
                       (meta . ,(grob-description text-interface font-interface ))
        ))
        (Beam . (
        (NoteSpacing . (
                (X-extent-callback . #f)
                (Y-extent-callback . #f)
-               (stem-spacing-correction . 0.)
+               (stem-spacing-correction . 0.5)
                (space-factor . 1.0)
                (meta . ,(grob-description note-spacing-interface))
        ))
index ba77f59747049703d3df0005ad702612a74c07df..530228ed61fa2bb3e2571854f373e2130f910efc 100644 (file)
           "pdf.scm"
           "pdftex.scm"
           "c++.scm"
+          "molecule.scm"
           "bass-figure.scm"
           "grob-property-description.scm"
           "context-description.scm"
diff --git a/scm/molecule.scm b/scm/molecule.scm
new file mode 100644 (file)
index 0000000..8517606
--- /dev/null
@@ -0,0 +1,38 @@
+
+(define (stack-molecules axis dir padding mols)
+  "Stack molecules MOLS in direction AXIS,DIR, using PADDING."
+  (if (null? mols)
+      '()
+      (if (pair? mols)
+         (ly-combine-molecule-at-edge (car mols) axis dir 
+                                      (stack-molecules axis dir padding (cdr mols))
+                                      padding
+                                      )
+         )
+  ))
+
+
+
+
+(define (fontify-text font-metric text)
+  "Set TEXT with font FONT-METRIC, returning a molecule."
+  (let* ((b  (ly-text-dimension font-metric text)))
+    (ly-make-molecule
+     (ly-fontify-atom font-metric `(text ,text)) (car b) (cdr b))
+    ))
+
+(define (other-axis a)
+  (remainder (+ a 1) 2))
+  
+(define (bracketify-molecule mol axis thick protusion padding)
+  "Add brackets around MOL, producing a new molecule."
+
+  (let* (
+        (ext (ly-get-molecule-extent mol axis))
+        (lb (ly-bracket axis ext -1 thick protusion))
+        (rb (ly-bracket axis ext 1 thick protusion))
+        )
+    (set! mol (ly-combine-molecule-at-edge mol (other-axis  axis) 1 lb padding))
+    (set! mol (ly-combine-molecule-at-edge mol (other-axis  axis) -1 rb padding))
+    mol
+  ))