]> git.donarmstrong.com Git - lilypond.git/commitdiff
2002-07-17 Han-Wen <hanwen@cs.uu.nl>
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 16 Jul 2002 23:41:14 +0000 (23:41 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 16 Jul 2002 23:41:14 +0000 (23:41 +0000)
* lily/parser.yy (Repeated_music): shift duration log for tremolo
repeats, instead of klutzing around.

* lily/chord-tremolo-engraver.cc (acknowledge_grob): set X parent
of stem tremolo grobs.

* scm/music-functions.scm (shift-duration-log): new function, add
to duration log of all notes.

* lily/duration.cc: add compression factor arguments to
make-duration.
compression-factor, dot-count, duration-log: add scheme functions.

* lily/mark-engraver.cc (process_music): allow \mark to take a
number as argument as well.

2002-07-16  Han-Wen  <hanwen@cs.uu.nl>

* lily/rest.cc (after_line_breaking): only translate the whole
rest if we have more than 1 staff line

* lily/parser.yy (property_def): only allow #Scheme as \property
argument.

21 files changed:
.cvsignore
ChangeLog
Documentation/user/refman.itely
input/regression/chord-tremolo.ly
input/regression/rhythmic-staff.ly
lily/chord-tremolo-engraver.cc
lily/chord-tremolo-iterator.cc
lily/duration.cc
lily/include/duration.hh
lily/include/musical-request.hh
lily/mark-engraver.cc
lily/music.cc
lily/note-heads-engraver.cc
lily/parser.yy
lily/rest.cc
lily/spacing-engraver.cc
ly/property-init.ly
scm/c++.scm
scm/grob-description.scm
scm/lily.scm
scm/music-functions.scm

index 58fa7ee2159e163594d1d19d9a6b44298a51a57c..a9116890cd25176b22ff044706a05458ec6795a9 100644 (file)
@@ -1,15 +1,3 @@
-GNUmakefile
-TAGS
-autom4te.cache
-configure
-config.cache
-config.h
-config.log
-config.make
-config.status
-.dstreamrc
-.gdbinit
-*~
 #*
 *.aux
 *.dvi
@@ -26,11 +14,28 @@ config.status
 *.tex
 *.txt
 *[0-9]pk
+*~
+.dstreamrc
+.gdbinit
+GNUmakefile
+TAGS
+afm
+autom4te.cache
+config.cache
+config.h
+config.log
+config.make
+config.status
+configure
+fonts
+l
+log
+ls-R
 ly2dvi.dir
 out
 out-www
-afm
+rc
 share
+stepmake
 tfm
 tfm.[0-9]
-stepmake
index b3ec0df4d3d382799c97487d63890fdcdf3f235d..581e57e0aa9f6eceda32365cd110de5f38991229 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2002-07-17  Han-Wen  <hanwen@cs.uu.nl>
+
+       * lily/parser.yy (Repeated_music): shift duration log for tremolo
+       repeats, instead of klutzing around.
+
+       * lily/chord-tremolo-engraver.cc (acknowledge_grob): set X parent
+       of stem tremolo grobs.
+
+       * scm/music-functions.scm (shift-duration-log): new function, add
+       to duration log of all notes.
+
+       * lily/duration.cc: add compression factor arguments to
+       make-duration.
+       compression-factor, dot-count, duration-log: add scheme functions.
+
+       * lily/mark-engraver.cc (process_music): allow \mark to take a
+       number as argument as well.
+
+2002-07-16  Han-Wen  <hanwen@cs.uu.nl>
+
+       * lily/rest.cc (after_line_breaking): only translate the whole
+       rest if we have more than 1 staff line
+
+       * lily/parser.yy (property_def): only allow #Scheme as \property
+       argument.
+
 2002-07-16  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
        * VERSION: release 1.5.68
index 7f7f7007a30c317a8e83af01a4f824733269cd0c..e39eccc2c171116045ad909a18c3ab0b797c5ab1 100644 (file)
@@ -3182,12 +3182,12 @@ a tone.  The first version will print sharps and the second version
 will print flats.
 
 @lilypond[singleline, verbatim]
-mus =\notes { \key e \major c d e f }
+mus =\notes { \key d \major cis d fis g }
 \score { \notes \context Staff {
   \clef "F" \mus
   \clef "G"
-  \transpose des'' \mus
-  \transpose cis'' \mus
+  \transpose g'' \mus
+  \transpose f'' \mus
 }}
 @end lilypond
 
index c45d6df58b2967bbacfa7272a1fe4be0f4c5f55f..c773cf2d76bec8b6d3e2d91eb56f392e383e27a4 100644 (file)
@@ -18,12 +18,11 @@ stems.
        \repeat "tremolo" 8 { d16 e }
        \repeat "tremolo" 4 { d e }
        \repeat "tremolo" 2 { d e }
-       \repeat "tremolo" 1 { d e }
-       \repeat "tremolo" 1 { d e }
+       c4
        \break
        \repeat "tremolo" 4 { f'8 e }
-       \repeat "tremolo" 2 { f e }    
-       \repeat "tremolo" 1 { f e }
+       \repeat "tremolo" 2 { f e }
+       c4
        c4 c4 c4 c4
        c4 c4 c4 c4
        c4 c4 c4 c4
index 9b9b6e1162348d89c7e50bbd74629c120837290d..55b7b64eb7d73401a2ea3750134b553d7a258f57 100644 (file)
@@ -1,11 +1,11 @@
 \header
 {
 
-    texidoc = "In rhythmic staffs, stems should go up, and bar lines have the size for a  5 line staff"
+    texidoc = "In rhythmic staffs, stems should go up, and bar lines have the size for a  5 line staff. The whole note hangs from the rhythmic staff."
 }
 
 \score { \notes \context RhythmicStaff
   {
-            r4 c4. c8 r8 c8 | c2 r2
+            r4 c4. c8 r8 c8 | c2 r2 | r1
   }
 }
index 43e66eb4a3d83f3861946f6e4966f398b46dbd36..2bf00410fb52db4b50a08657a4ad07047135658a 100644 (file)
@@ -48,13 +48,10 @@ protected:
   /// moment (global time) where beam started.
   Moment start_mom_;
   Moment stop_mom_;
-
+  int flags_i_ ;
   /// location  within measure where beam started.
   Moment beam_start_location_;
 
-  int note_head_i_;
-  int dots_i_;
-
   bool sequential_body_b_;
   Spanner * beam_p_;
   Spanner * finished_beam_p_;
@@ -72,8 +69,7 @@ Chord_tremolo_engraver::Chord_tremolo_engraver ()
 {
   beam_p_  = finished_beam_p_ = 0;
   repeat_ =0;
-  note_head_i_ = 0;
-  dots_i_ = 0;
+  flags_i_ = 0;
   stem_tremolo_ = 0;
   sequential_body_b_ = false;
 }
@@ -92,10 +88,10 @@ Chord_tremolo_engraver::try_music (Music * m)
       stop_mom_ = start_mom_ + l;
       sequential_body_b_ = dynamic_cast<Sequential_music*> (rp->body ());
 
-      // ugh. should generate triplet beams.
-      note_head_i_ = int (ceil (double(l.den ()) / l.num ()));
-      dots_i_ = intlog2 (1+l.num ()) -1 ; // 1->0, 3->1, 7->2
-      note_head_i_ = note_head_i_ <? 4; 
+      Rational total_dur = l.main_part_;
+      Rational note_dur = (total_dur / Rational (repeat_->repeat_count ()));
+       flags_i_ = intlog2 ((total_dur / note_dur).num ());
+      
       return true;
     }
 
@@ -112,7 +108,6 @@ Chord_tremolo_engraver::process_music ()
          beam_p_ = new Spanner (get_property ("Beam"));
          beam_p_->set_grob_property ("chord-tremolo", SCM_BOOL_T);
 
-
          SCM smp = get_property ("measurePosition");
          Moment mp
            = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
@@ -121,13 +116,13 @@ Chord_tremolo_engraver::process_music ()
        }
       else if (!sequential_body_b_ && !stem_tremolo_)
        {
-         int flags = intlog2 (note_head_i_ * repeat_->repeat_count ()) -2;
-         if (flags)
+
+         if (flags_i_)
            {
              stem_tremolo_ = new Item (get_property ("StemTremolo"));
              announce_grob(stem_tremolo_, repeat_->self_scm());
              stem_tremolo_->set_grob_property ("flag-count",
-                                               gh_int2scm (flags));
+                                               gh_int2scm (flags_i_));
 
            }
        }
@@ -158,59 +153,36 @@ Chord_tremolo_engraver::typeset_beam ()
 void
 Chord_tremolo_engraver::acknowledge_grob (Grob_info info)
 {
-  if (beam_p_)
+  if (beam_p_ && Stem::has_interface (info.grob_l_))
     {
-      if (Stem::has_interface (info.grob_l_))
-       {
-         Grob * s = info.grob_l_;
-         int f = Stem::duration_log (s);
-         f = (f > 2) ? f - 2 : 1;
-         Stem::set_beaming (s, f, LEFT);
-         Stem::set_beaming (s, f, RIGHT);
+      Grob * s = info.grob_l_;
+      Stem::set_beaming (s, flags_i_, LEFT);
+      Stem::set_beaming (s, flags_i_, RIGHT);
          
-         SCM d = s->get_grob_property ("direction");
-         if (Stem::duration_log (s) != 1)
-           {
-             int gap_i =Stem::duration_log (s) - ((Stem::duration_log (s) >? 2) - 2);
-             beam_p_->set_grob_property ("gap", gh_int2scm (gap_i));
-           }
-         s->set_grob_property ("direction", d);
+      SCM d = s->get_grob_property ("direction");
+      if (Stem::duration_log (s) != 1)
+       {
+         beam_p_->set_grob_property ("gap", gh_double2scm (0.8));
+       }
+      s->set_grob_property ("direction", d);
 
-         if (dynamic_cast <Rhythmic_req *> (info.music_cause ()))
-           {
-             Beam::add_stem (beam_p_, s);
-           }
+      if (dynamic_cast <Rhythmic_req *> (info.music_cause ()))
+       {
+         Beam::add_stem (beam_p_, s);
+       }
+      else
+       {
+         String s = _ ("stem must have Rhythmic structure");
+         if (info.music_cause ())
+           info.music_cause ()->origin ()->warning (s);
          else
-           {
-             String s = _ ("stem must have Rhythmic structure");
-             if (info.music_cause ())
-               info.music_cause ()->origin ()->warning (s);
-             else
-               ::warning (s);
-           }
+           ::warning (s);
        }
     }
   else if (stem_tremolo_ && Stem::has_interface (info.grob_l_))
     {
        Stem_tremolo::set_stem (stem_tremolo_, info.grob_l_);
-
-       info.grob_l_->set_grob_property ("duration-log", gh_int2scm (intlog2 (note_head_i_)));
-    }
-
-  
-  if (repeat_ && Note_head::has_interface (info.grob_l_))
-    {
-      info.grob_l_->set_grob_property ("duration-log", gh_int2scm (intlog2 (note_head_i_)));
-      if (dots_i_ > 0) 
-       {
-          Item * d = new Item (get_property ("Dots"));
-          Rhythmic_head::set_dots (info.grob_l_, d);
-          
-         d->set_grob_property ("dot-count", gh_int2scm (dots_i_));
-
-          d->set_parent (info.grob_l_, Y_AXIS);
-          announce_grob (d, SCM_EOL);
-       }
+       stem_tremolo_->set_parent (info.grob_l_,X_AXIS);
     }
 }
 
index 9228afb104363fc368584cfaa4cbe293c26765a5..e3364847d0a2a36f562a7641b4943618ebffc990 100644 (file)
@@ -21,7 +21,7 @@ void
 Chord_tremolo_iterator::construct_children ()
 {
   Repeated_music * rep = dynamic_cast<Repeated_music*> (music_l ());
-  factor_  = Moment (Rational(1, rep->repeat_count ()));
+  factor_  = Moment (Rational(1, 1));
   child_iter_p_ = get_iterator_p (rep->body ());
 }
 
@@ -53,7 +53,6 @@ Chord_tremolo_iterator::process (Moment m)
   child_iter_p_->process (factor_ * m);
 }
 
-
 Moment
 Chord_tremolo_iterator::pending_moment () const
 {
index 28b41a021068bd7d4cb60ac965d5ca6bacdf399f..43dea75b306cc473ef25cd16d1ee33137c91b6b8 100644 (file)
@@ -1,6 +1,6 @@
 /*
-  duration.cc -- implement Duration, Plet, 
-
+  duration.cc -- implement Duration
+  
   source file of the LilyPond music typesetter
 
   (c)  1997--2002 Jan Nieuwenhuizen <janneke@gnu.org>
@@ -10,6 +10,7 @@
 
 #include <assert.h>
 
+#include "misc.hh"
 #include "lily-proto.hh"
 #include "string.hh"
 #include "moment.hh"
@@ -133,15 +134,16 @@ Duration::less_p (SCM p1, SCM p2)
     return SCM_BOOL_F;
 }
 
-
 LY_DEFINE(make_duration,
-         "make-duration", 2, 0, 0, (SCM length, SCM dotcount),
+         "make-duration", 2, 2, 0, (SCM length, SCM dotcount,
+                                    SCM num, SCM den),
          "
 @var{length} is the negative logarithm (base 2) of the duration:
 1 is a half note, 2 is a quarter note, 3 is an eighth
 note, etc.  The number of dots after the note is given by
 @var{dotcount}.
 
+The duration factor is optionally given by @var{num} and @var{den}.
 
 A duration is a musical duration, i.e. a length of time described by a
 power of two (whole, half, quarter, etc.) and a number of augmentation
@@ -151,11 +153,79 @@ dots.
 {
   SCM_ASSERT_TYPE(gh_number_p(length), length, SCM_ARG1, __FUNCTION__, "integer");
   SCM_ASSERT_TYPE(gh_number_p(dotcount), dotcount, SCM_ARG2, __FUNCTION__, "integer");
+
+  bool compress = false;
+  if (num != SCM_UNDEFINED)
+    {
+      SCM_ASSERT_TYPE(gh_number_p(num), length, SCM_ARG3, __FUNCTION__, "integer");
+      compress = true;
+    }
+  else
+    num = gh_int2scm (1);
+  
+  if (den != SCM_UNDEFINED)
+    SCM_ASSERT_TYPE(gh_number_p(den), length, SCM_ARG4, __FUNCTION__, "integer");
+  else
+    den = gh_int2scm (1);
   
   Duration p (gh_scm2int (length), gh_scm2int (dotcount));
+  if (compress)
+    p = p.compressed (Rational (gh_scm2int (num), gh_scm2int (den)));
+
   return p.smobbed_copy ();
 }
 
+
+
+LY_DEFINE(duration_log,
+         "duration-log", 1, 0, 0, (SCM dur),
+         "
+Extract the duration log from @var{dur}"
+)
+{
+  SCM_ASSERT_TYPE(unsmob_duration(dur), dur, SCM_ARG1, __FUNCTION__, "duration");
+
+  return gh_int2scm (unsmob_duration (dur)->duration_log ());
+}
+
+
+LY_DEFINE(dot_count_log,
+         "duration-dot-count", 1, 0, 0, (SCM dur),
+         "
+Extract the dot count from @var{dur}"
+)
+{
+  SCM_ASSERT_TYPE(unsmob_duration(dur), dur, SCM_ARG1, __FUNCTION__, "duration");
+
+  return gh_int2scm (unsmob_duration (dur)->dot_count ());
+}
+
+
+LY_DEFINE(ly_intlog2,
+         "intlog2", 1, 0, 0, (SCM d),
+         "
+Extract the dot count from @var{dur}"
+)
+{
+  SCM_ASSERT_TYPE(gh_number_p (d), d, SCM_ARG1, __FUNCTION__, "integer");
+
+  int l = intlog2 (gh_scm2int (d));
+
+  return gh_int2scm (l);
+}
+
+LY_DEFINE(compression_factor,
+         "duration-factor", 1, 0, 0, (SCM dur),
+         "
+Extract the compression factor from @var{dur}. Return as a pair."
+)
+{
+  SCM_ASSERT_TYPE(unsmob_duration(dur), dur, SCM_ARG1, __FUNCTION__, "duration");
+  Rational r =unsmob_duration (dur)->factor ();
+
+  return gh_cons(gh_int2scm (r.num()),gh_int2scm (r.den ())); 
+}
+
 SCM
 Duration::smobbed_copy ()const
 {
index 49fe93e24390104e6f00d90bb9f472cce63650eb..654db0db8b5b3f3ed4873916212d5f237e00b174 100644 (file)
@@ -26,8 +26,7 @@ public:
 
   Duration compressed (Rational) const;
   Rational length_mom () const ;
-
-
+  Rational factor () const { return factor_; }
   int duration_log ()const;
   int dot_count () const;
 
@@ -36,7 +35,7 @@ public:
   SCM smobbed_copy () const;
   DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
   DECLARE_SIMPLE_SMOBS (Duration,);
-  
+
 private:
     /// Logarithm of the base duration.
   int durlog_i_;
index e383dcaa3caeb84735d0503c114add84fc98c980..efcde57b4f55c065ae4af3bf98d1325dd2741f6e 100644 (file)
@@ -37,9 +37,14 @@ public:
 struct Tremolo_req : public Request {
   VIRTUAL_COPY_CONS (Music);
   Tremolo_req ();
+};
+
+struct Chord_tremolo_notify_req : public Request
+{
 
-  void set_type (int);
-  int get_type () const;
+  Rational factor_;
+  VIRTUAL_COPY_CONS(Chord_tremolo_notify_req);
+  Chord_tremolo_notify_req();
 };
 
 
index ed8b7be05a0440647abc61f1ef3399e8b15ea249..f495cf9501ad1abc195d302edc49d595b794b704 100644 (file)
@@ -139,9 +139,8 @@ Mark_engraver::process_music ()
        text_p_->set_grob_property ("text",m);
       else 
        {
-         if (!gh_string_p (m)) 
+         if (!gh_string_p (m) && !gh_number_p (m)
            m =  get_property ("rehearsalMark");
-         ;
          
          if (gh_number_p (m))
            {
index db7b1f4d65cdfad1091a9c69d1ae2186ea756549..7b9e88a7694f210abb882f03dee336282f39cb1e 100644 (file)
@@ -220,7 +220,7 @@ LY_DEFINE(ly_get_mus_property,
          "Get the property @var{sym} of music expression @var{mus}.")
 {
   Music * sc = unsmob_music (mus);
-  SCM_ASSERT_TYPE(sc, mus, SCM_ARG1, __FUNCTION__, "grob");
+  SCM_ASSERT_TYPE(sc, mus, SCM_ARG1, __FUNCTION__, "music");
   SCM_ASSERT_TYPE(gh_symbol_p(sym), sym, SCM_ARG2, __FUNCTION__, "symbol");  
 
   return sc->internal_get_mus_property (sym);
index 7d48f15939122c483cd3d12b1fa1c50d34072b97..802c2278edbe983b449051a3dd7b544d978ba841 100644 (file)
@@ -136,8 +136,6 @@ Note_heads_engraver::stop_translation_timestep ()
 void
 Note_heads_engraver::start_translation_timestep ()
 {
-
-
 }
 
 
index e7d9d6498a3f1f9c31e2fdbcebc4b5fec26195a4..f0aa450c826b0e80bb1a62b5779b3affefe2a7ad 100644 (file)
@@ -301,7 +301,7 @@ yylex (YYSTYPE *s,  void * v_l)
 %type <scm>    chord_note chord_inversion chord_bass
 %type <scm>    duration_length fraction
 
-%type <scm>  embedded_scm scalar
+%type <scm>  embedded_scm 
 %type <music>  Music Sequential_music Simultaneous_music 
 %type <music>  relative_music re_rhythmed_music part_combined_music
 %type <music>  property_def translator_change
@@ -745,9 +745,22 @@ Repeated_music:
                SCM func = scm_primitive_eval (ly_symbol2scm ("repeat-name-to-ctor"));
                SCM result = gh_call1 (func, $2);
 
+               if (gh_equal_p ($2, ly_str02scm ("tremolo")))
+               {
+               /*
+               we can not get durations and other stuff correct down the line, so we have to
+               add to the duration log here.
+
+               TODO: do dots.
+               */
+                       SCM func = scm_primitive_eval (ly_symbol2scm ("shift-duration-log"));
+                       gh_call2 (func, r->self_scm (), gh_int2scm(-intlog2 ($3)));
+               }
+
                set_music_properties (r, result);
 
                r->set_spot (*$4->origin ());
+
                $$ = r;
        }
        ;
@@ -1025,7 +1038,7 @@ translator_change:
        ;
 
 property_def:
-       PROPERTY STRING '.' STRING '='  scalar {
+       PROPERTY STRING '.' STRING '='  embedded_scm {
                
                Music *t = set_property_music (scm_string_to_symbol ($4), $6);
                Context_specced_music *csm = new Context_specced_music (SCM_EOL);
@@ -1104,13 +1117,6 @@ property_def:
        }
        ;
 
-scalar:
-       string          { $$ = $1; }
-       | bare_int      { $$ = gh_int2scm ($1); }
-       | embedded_scm  { $$ = $1; }
-       ;
-
-
 request_chord:
        pre_requests {
                THIS->push_spot ();
@@ -1304,11 +1310,17 @@ verbose_command_req:
                Mark_req * m = new Mark_req;
                $$ = m;
        }
-       | MARK scalar {
+       | MARK STRING {
                Mark_req *m = new Mark_req;
                m->set_mus_property ("label", $2);
                $$ = m;
+       }
+       | MARK bare_unsigned {
+               String s(to_str ($2));
 
+               Mark_req *m = new Mark_req;
+               m->set_mus_property ("label", gh_int2scm ($2));
+               $$ = m;
        }
        | PENALTY SCM_T         {
                Break_req * b = new Break_req;
index efd28765da05a8ba7309af819e72a78e0ab5cdb6..953fcf5449ce2e369fd7457d59e9700878777c3a 100644 (file)
@@ -21,7 +21,7 @@ Rest::after_line_breaking (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
   int bt = gh_scm2int (me->get_grob_property ("duration-log"));
-  if (bt == 0)
+  if (bt == 0 && Staff_symbol_referencer::line_count (me) > 1)
     {
       me->translate_axis (Staff_symbol_referencer::staff_space (me) , Y_AXIS);
     }
index 9aa5e5421db35c072b76b1aa3e0eb939c7996cb5..fcb5d5c8dc09bbd1a270d04cd78827a98abe2b73 100644 (file)
@@ -136,6 +136,7 @@ Spacing_engraver::stop_translation_timestep ()
        {
          starter = starter <? m;
          playing_durations_.insert (now_durations_[i]);
+
        }
     }
   now_durations_.clear ();
index 8ee4ca1a2c9b482fcb2d6ccf33e6b31c42caafec..47750ece1344b79cf5bc5bb00229e96bb7292047 100644 (file)
@@ -90,14 +90,14 @@ tieSolid = \property Voice.Tie \revert #'dashed
 
        
 tiny  = 
-       \property Voice.fontSize= -2
+       \property Voice.fontSize= #-2
 
 small  = 
-       \property Voice.fontSize= -1
+       \property Voice.fontSize= #-1
 
 
 normalsize = {
-       \property Voice.fontSize= 0
+       \property Voice.fontSize= #0
 }
 
 normalkey = {
index 1ddeae1137130cfacdd87e1666b546e023a30a98..58d6222636466317d4d880829aca0dfa9db47e5e 100644 (file)
@@ -153,8 +153,10 @@ is the  first to satisfy CRIT "
                          (start-moment-function .  ,Repeated_music::first_start)
                          (length . ,Repeated_music::unfolded_music_length)))
            ("tremolo" . ((iterator-ctor . ,Chord_tremolo_iterator::constructor)
-                         (start-moment-function .  ,Repeated_music::first_start)                         
-                         (length . ,Repeated_music::unfolded_music_length)))))
+                         (start-moment-function .  ,Repeated_music::first_start)
+
+                         ;; the length of the repeat is handled by shifting the note logs
+                         (length . ,Repeated_music::folded_music_length)))))
          
        (handle (assoc name supported-reps)))
 
index 34ab83d2800b50da293a4ad02ae893d39fb86d54..4e7b18589bc1858800ad30c1ab11e3301a2f15ef 100644 (file)
        (Y-extent-callback . ,Stem_tremolo::height)
        (X-extent-callback . #f)
 
-       (beam-width . 2.0) ; staff-space
+       (beam-width . 1.6) ; staff-space
        (beam-thickness . 0.48) ; staff-space
        (meta . ((interfaces . (stem-tremolo-interface item-interface ))))
        ))
index e39e99f880c9aab03cd089c166e817819dc36518..dbb9eeba2a43d10a4cd3952ac803cd332d22bd34 100644 (file)
@@ -15,7 +15,7 @@
 
 
 
-;(debug-enable 'backtrace)
+(debug-enable 'backtrace)
 
 
 (define point-and-click #f)
index c7031f4f4230f91a688fb0eac05a5c5507fdc4af..7ccd23c208b92142772e0cd929711f5369f134d2 100644 (file)
@@ -7,7 +7,45 @@
                 ":"
                 (number->string (ly-get-mus-property mus 'denominator))
                 ))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+(define (shift-duration-log music shift )
+  "Recurse through music, adding SHIFT to duration-log to any note
+encountered. This scales the music up by a factor 2^k."
+  (let* ((es (ly-get-mus-property music 'elements))
+         (e (ly-get-mus-property music 'element))
+         (n  (ly-music-name music))
+        (f  (lambda (x)  (shift-duration-log x shift)))
+        )
+    (if (or (equal? n "Note_req")
+           (equal? n "Rest_req"))
+       (let* (
+             (d (ly-get-mus-property music 'duration))
+             (cp (duration-factor d))
+             (nd (make-duration (+ shift (duration-log d))
+                                (duration-dot-count d)
+                                (car cp)
+                                (cdr cp)))
+         
+             )
+         (ly-set-mus-property music 'duration nd)
+       ))
+
+    (if (pair? es)
+        (ly-set-mus-property
+         music 'elements
+         (map f es)))
+
+    (if (music? e)
+        (ly-set-mus-property
+         music 'element
+         (f e)))
 
+    music))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (define (unfold-repeats music)
 "
 This function replaces all repeats  with unfold repeats. It was 
@@ -18,6 +56,9 @@ written by Rune Zedeler. "
 
     (if (equal? n "Repeated_music")
         (begin
+         (if (equal? (ly-get-mus-property 'type music) 'tremolo)
+             (shift-duration-log music (- (intlog2 (ly-get-mus-property 'repeat-count music))))
+             )
           (ly-set-mus-property
            music 'length Repeated_music::unfolded_music_length)
          (ly-set-mus-property