]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.33
authorfred <fred>
Tue, 26 Mar 2002 22:46:52 +0000 (22:46 +0000)
committerfred <fred>
Tue, 26 Mar 2002 22:46:52 +0000 (22:46 +0000)
24 files changed:
Documentation/programmer/regression-test.tely
Documentation/user/refman.itely
input/bugs/staff-margin.ly [new file with mode: 0644]
input/test/bar-lines.ly [new file with mode: 0644]
input/test/repeat-volta.ly
input/test/stem-tremolo.ly
lily/all-font-metrics.cc
lily/include/all-font-metrics.hh
lily/include/lily-proto.hh
lily/include/lookup.hh
lily/include/molecule.hh
lily/include/musical-request.hh
lily/include/my-lily-parser.hh
lily/key-item.cc
lily/lily-guile.cc
lily/molecule.cc
lily/my-lily-parser.cc
lily/parser.yy
lily/stem-engraver.cc
lily/stem-tremolo.cc
ly/engraver.ly
mutopia/Coriolan/coriolan-paper.ly
mutopia/Coriolan/global.ly
stepmake/stepmake/c++-vars.make

index 149ea061bb98b867036aa0108ea07039fab8356e..082a1205ad6d40e0b4c44d807e2a5b3ed3e7c148 100644 (file)
@@ -65,12 +65,12 @@ natural sign.
 
 @section Stems
 
-Stem tremolos (official naming?) or rolls are tremolo signs that look
-like beam segments crossing stems.  If the stem is in a beam, the
-tremolo must be parallel to the beam.  If the stem is invisible
-(eg. on a whole note), the tremolo must be centered on the note.
+Stem tremolos or rolls are tremolo signs that look like beam segments
+crossing stems.  If the stem is in a beam, the tremolo must be parallel
+to the beam.  If the stem is invisible (eg. on a whole note), the
+tremolo must be centered on the note.
 
-@c @mu delafile{stem-tremolo.ly}
+@mudelafile{stem-tremolo.ly}
 
 Chord tremolos look like beams, but are a kind of repeat symbol.
 To avoid confusion, chord tremolo beams do not reach the stems, but 
@@ -78,7 +78,7 @@ 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.
   
-@c miudelafile{chord-tremolo.sly}
+@mudelafile{chord-tremolo.sly}
 
 Beams, stems and noteheads often have communication troubles, since
 the two systems for y dimensions (1 unit = staffspace, 1 unit = 1
index 1d222f5953196da90a8f8a9ff46951f35374e547..3862e3ad4dbbe2e134c43ffdb077fe301170c6f6 100644 (file)
@@ -1282,13 +1282,13 @@ The slur syntax with parentheses is a shorthand for this.
 
 @cindex tremolo marks
 
-@node tremolo, , ,  Reference Manual
+@node stem tremolo, , ,  Reference Manual
 
 Tremolo marks can be printed on a single note by adding
 `@code{:}[@var{length}]' after the note.  The length must be at
 least 8.  A @var{length} value of 8 gives one line across
 the note stem.  If the length is omitted, then the last value is
-used, or the value of the @code{abbrev}@indexcode{abbrev} property if there was
+used, or the value of the @code{tremoloFlags}@indexcode{tremoloFlags} property if there was
 no last value.
 
 @mudela[verbatim,fragment,center]
diff --git a/input/bugs/staff-margin.ly b/input/bugs/staff-margin.ly
new file mode 100644 (file)
index 0000000..1275f69
--- /dev/null
@@ -0,0 +1,38 @@
+voice = \notes\relative c'{
+  \property Staff.instrument   = "Voice"
+  \property Staff.instr                = "V."
+
+  % Staff_margin_engraver kan be `fixed' by doing a silly request:
+  %\bar ".|";
+
+  c1\break c \bar "|.";
+} 
+
+soprano = \notes\relative c'{
+  \property Staff.instrument   = "Soprano"
+  \property Staff.instr                = "S."
+  c1 c \bar "|.";
+} 
+
+tenor = \notes \relative c'{
+  \property Staff.instrument   = "Tenor"
+  \property Staff.instr                = "T."
+  c1 c
+}
+
+\score
+{
+  \context StaffGroup< 
+    \context Staff = "voice"   \voice
+    \context GrandStaff< 
+      \context Staff = "soprano" \soprano
+      \context Staff = "tenor" \tenor
+    >
+  >
+
+  \paper {
+    indent = 50.0\mm;
+    linewidth = 100.0\mm;
+    \translator { \StaffContext \consists Staff_margin_engraver; }
+  }
+}
diff --git a/input/test/bar-lines.ly b/input/test/bar-lines.ly
new file mode 100644 (file)
index 0000000..d9e99a3
--- /dev/null
@@ -0,0 +1,14 @@
+
+\score
+{
+\notes \relative c'' {
+c4
+\bar "|."; c
+\bar "|:";c
+\bar "||";c
+\bar ":|" ; c
+\bar ".|"; c
+\bar ".|."; c
+\bar "|";  c
+} 
+}
index 46cea92205076624ae998fa0ef94e9f14e1f99aa..b64a981a03cd2d2fc7ae8ebd5e2e6533fd8d3aa9 100644 (file)
@@ -2,7 +2,9 @@
 %  no alts.
 \score { \notes
   \relative c'' {
-\repeat volta 3 { c^"3$\\times$ 0alt" d }
+% repeat non aligning with barlines.
+e
+\repeat volta 3 { c^"3$\\times$ 0alt" d e }
 % less alts than body
 \repeat volta 4 { c^"4$\\times$ 2alt" d } \alternative { e f }
 
index bc962393deda1299e29c1a1b43df839e388f646b..022a9ae6445de0d0b7903cc2590f1b1ec313fc81 100644 (file)
@@ -1,23 +1,23 @@
 
 \version "1.3.5";
 \score{
-       \notes \transpose c'''{
+       \context Voice\notes \relative c''{
+               %%?
+               \property Voice.textVerticalDirection = #1
+               %% burp, is this in staff or half spaces, or what?
+               \property Voice.textScriptPadding = #15
+               a1:4^":4" a:8^":8" c:16^":16" a:32^":32" a^"x" a:^":"
+               a4:4 c:8 a:16 c:32 a a: a2:
+               \break
                \stemup
-%              \stemdown
-               % default abbreviations
-               c4 c4: c4:32 c4: c4 c2.
-               a,1
-               a,1:32
-               c,4:8 c': c,4:16 c':
-               [ c,8:16 c, c, c, ]
-               [ a a a a ]
-               [ c, f, b, e ] 
-               [ c,16:32 c, c, c, ] [ a16:32 a a a ]
-%              % there's still some hairy beam bugfixing todo
-               [ c'8:16 g d a, ]
-               [ c,8:32 f, b, e ]
-               [ c'16:32 g d a, ]
-
-
+               a4:32 a'4:64 
+               \stemdown
+               c,4:32 c,4:64
+               \stemboth
+               c'8:16 c c c
+               a': a a: a
+               c,16:32 c: c c a16:32 a: a a
+               c8:16 g: d: a:
+               c8:32 f: b: e:
        }
 }
index 81a41334301c06b6861c1e46b2137b579bda6f1c..0d6190706975248020e739127faadf070a4fd309 100644 (file)
@@ -147,3 +147,9 @@ All_font_metrics::font_descriptions () const
 }
 
 
+
+Font_metric*
+find_font (String name)
+{
+  return   all_fonts_global_p->find_font (name);
+}
index fa6eb9097c014468071fe8ea60aa139e643d388b..02d59dae09b4277755d205c8c7bc1dc70d7cdb4b 100644 (file)
@@ -38,5 +38,7 @@ public:
   SCM font_descriptions () const;
 };
 
+Font_metric * find_font (String name);
+
 #endif /* ALL_FONTS_HH */
 
index 3a6f324771d150932065f7c1777c1edc5a15d9be..d5f93d6a06baf6954efe074d84d92da186fe9079 100644 (file)
@@ -64,7 +64,6 @@ struct Change_translator;
 struct Chord;
 struct Chord_name;
 struct Chord_name_engraver;
-struct Chord_tremolo; 
 struct Chord_tremolo_engraver;
 struct Chord_tremolo_req;
 struct Clef_change_req;
index 2a227470fed0d3ed23510f278459e844e8983b8f..4563501eccf5c8b99b1f266cc2955464f8c090ba 100644 (file)
@@ -30,20 +30,16 @@ public:
   Lookup ();
   Lookup (Lookup const&);
 
-  Molecule simple_bar (String s, Real w, Paper_def*) const;
   Molecule afm_find (String, bool warn=true) const;
-  Molecule bar (String, Real height, Paper_def*) const;
   Molecule accordion (SCM arg, Real interline_f) const;
 
   static Molecule frame (Box b, Real thick);
   static Molecule slur (Bezier controls, Real cthick, Real thick) ;
   static Molecule beam (Real, Real, Real) ;
   static Molecule dashed_slur (Bezier, Real thick, Real dash) ;
-  static Molecule fill (Box b) ;
+  static Molecule blank (Box b) ;
   static Molecule filledbox (Box b) ;  
   static Molecule text (String style, String text, Paper_def*) ;
-  static Molecule staff_brace (Real dy, int) ;
-  static Molecule staff_bracket (Real height, Paper_def* paper_l) ;
 };
 
 #endif // LOOKUP_HH
index 6992a2fa4241bf5b270153630f283e376061cc33..ec5ed0e409cb407c884ea4faa7e631e20f1ac93a 100644 (file)
@@ -73,9 +73,14 @@ public:
   Box extent() const;
   Interval extent (Axis) const;
   bool empty_b() const;
-  void print ()const;
+
+
+  /*******/
 };
 
 SCM fontify_atom (Font_metric*, SCM atom);
 
+
+
+
 #endif
index dbabc86eddb69981d409d44e95853c8975721668..9fbbd284cd964fff84d6c2c6db405f51c73153ad 100644 (file)
@@ -177,7 +177,7 @@ public:
   VIRTUAL_COPY_CONS(Music);
 };
 /** 
- Start / stop an abbreviation beam. */
+ Start / stop a tremolo beam. */
 class Chord_tremolo_req : public Span_req  
 {
 public:
index 4231886b7e26c1a3cf65b860775d44ae178b1ebc..907aa962b44fe04e8588c145e8bd4fa57a988a43 100644 (file)
@@ -39,7 +39,7 @@ public:
   Duration default_duration_;
   Musical_pitch default_pitch_;
   Scope *default_header_p_;
-  int abbrev_beam_type_i_;
+  int chord_tremolo_type_i_;
   bool first_b_;
   int fatal_error_i_;
   Sources * source_l_;
@@ -71,7 +71,7 @@ private:
   Simultaneous_music* get_rest_element (String, Duration *);
   Simultaneous_music* get_word_element (String, Duration*);
   String notename_str (Melodic_req* melodic);
-  void set_abbrev_beam (int type_i);
+  void set_chord_tremolo (int type_i);
   void set_last_duration (Duration const *);
   void set_last_pitch (Musical_pitch const *);
   friend int yyparse (void*);
index 55c594c01cfa03552c204bb07b7960c9edb03e9b..52d76b5769a477ddaeedb8402cb848c7daa74bc8 100644 (file)
@@ -130,7 +130,7 @@ Key_item::do_brew_molecule() const
       Interval x(0, inter);
       Interval y(0,0);
 
-      mol.add_at_edge (X_AXIS, RIGHT, lookup_l()->fill (Box(x,y)),0);
+      mol.add_at_edge (X_AXIS, RIGHT, lookup_l()->blank (Box(x,y)),0);
     }
  
   for (int i =0; i < pitch_arr_.size(); i++) 
index 09eca147be7af061886b97d7e5fdeafd8ef6d8bd..dd14be84fe8adaa67c58bd2f0073b29a0162b2e7 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <math.h>              // isinf
 
 #include "libc-extension.hh"
 #include "lily-guile.hh"
@@ -217,16 +218,6 @@ ly_isdir_p (SCM s)
 }
 
 
-static void
-init_functions ()
-{
-  scm_make_gsubr ("ly-warn", 1, 0, 0, (SCM(*)(...))ly_warning);
-  scm_make_gsubr ("ly-gulp-file", 1,0, 0, (SCM(*)(...))ly_gulp_file);
-  scm_make_gsubr ("dir?", 1,0, 0, (SCM(*)(...))ly_isdir_p);  
-}
-
-ADD_SCM_INIT_FUNC(funcs, init_functions);
-
 
 typedef void (*Void_fptr)();
 Array<Void_fptr> *scm_init_funcs_;
@@ -367,3 +358,47 @@ ly_type (SCM exp)
 
   return ly_str02scm (cp);
 }
+
+/*
+  convert without too many decimals, and leave  a space at the end.
+ */
+   
+   
+SCM
+ly_number2string (SCM s)
+{
+  assert (gh_number_p (s));
+
+  char str[100];                       // ugh.
+
+  if (scm_integer_p (s))
+    {
+      Real r (gh_scm2double (s));
+
+      if (isinf (r) || isnan (r))
+       {
+         programming_error ("Infinity or NaN encountered while converting Real number; setting to zero.");
+         r = 0.0;
+       }
+
+      sprintf (str, "%8.4f ", r);
+    }
+  else
+    {
+      sprintf (str, "%d ", gh_scm2int (s));
+    }
+
+  return gh_str02scm (str);
+}
+
+
+static void
+init_functions ()
+{
+  scm_make_gsubr ("ly-warn", 1, 0, 0, (SCM(*)(...))ly_warning);
+  scm_make_gsubr ("ly-gulp-file", 1,0, 0, (SCM(*)(...))ly_gulp_file);
+  scm_make_gsubr ("dir?", 1,0, 0, (SCM(*)(...))ly_isdir_p);
+  scm_make_gsubr ("ly-number->string", 1, 0,0, (SCM(*)(...)) ly_number2string);
+}
+
+ADD_SCM_INIT_FUNC(funcs, init_functions);
index 5620a92d180e07aeccd5580b4a54439c76d56ccd..ac70426542d700de6a607ca283849bbcb1cf8afe 100644 (file)
@@ -104,13 +104,6 @@ Molecule::set_empty (bool e)
     }
 }
 
-void
-Molecule::print () const
-{
-#ifndef NPRINT
-  gh_display (expr_);
-#endif
-}
 
 void
 Molecule::align_to (Axis a, Direction d)
index 854f846c1b898735f66ddbdae2686fae3acc8e7e..b081bcf6eb0a0cbc02eba38476f58f1448e92e04 100644 (file)
@@ -28,7 +28,7 @@ My_lily_parser::My_lily_parser (Sources * source_l)
   first_b_ = true;
   source_l_ = source_l;
   lexer_p_ = 0;
-  abbrev_beam_type_i_ = 0;
+  chord_tremolo_type_i_ = 0;
   default_duration_.durlog_i_ = 2;
   error_level_i_ = 0;
 
@@ -102,9 +102,9 @@ My_lily_parser::set_last_duration (Duration const *d)
 }
 
 void
-My_lily_parser::set_abbrev_beam (int type_i)
+My_lily_parser::set_chord_tremolo (int type_i)
 {
-  abbrev_beam_type_i_ = type_i;
+  chord_tremolo_type_i_ = type_i;
 }
 
 
index c16f39fd6dd919c504d9156e826ced87042cf68a..db172c5e2637aed600150165a28c9a94452bb2b3 100644 (file)
@@ -225,7 +225,7 @@ yylex (YYSTYPE *s,  void * v_l)
 %type <i>      sub_quotes sup_quotes
 %type <music>  simple_element  request_chord command_element Simple_music  Composite_music 
 %type <music>  Alternative_music Repeated_music
-%type <i>      abbrev_type
+%type <i>      tremolo_type
 %type <i>      int unsigned
 %type <i>      script_dir
 %type <i>      optional_modality 
@@ -252,7 +252,7 @@ yylex (YYSTYPE *s,  void * v_l)
 %type <music_list> Music_list
 %type <paper>  paper_block paper_def_body
 %type <real>   real real_with_dimension
-%type <request> abbrev_command_req
+%type <request> shorthand_command_req
 %type <request>        post_request 
 %type <request> command_req verbose_command_req
 %type <request>        extender_req
@@ -926,11 +926,11 @@ command_element:
        ;
 
 command_req:
-       abbrev_command_req
+       shorthand_command_req
        | verbose_command_req semicolon { $$ = $1; }
        ;
 
-abbrev_command_req:
+shorthand_command_req:
        extender_req {
                $$ = $1;
        }
@@ -952,18 +952,19 @@ abbrev_command_req:
        | '[' ':' unsigned {
                if (!is_duration_b ($3))
                  THIS->parser_error (_f ("not a duration: %d", $3));
-               else if ($3 < 8)
-                 THIS->parser_error (_ ("Can't abbreviate"));
                else
-                 THIS->set_abbrev_beam ($3);
+                 THIS->set_chord_tremolo ($3);
 
                Chord_tremolo_req* a = new Chord_tremolo_req;
                a->span_dir_ = START;
-               a->type_i_ = THIS->abbrev_beam_type_i_;
+               // urg
+               a->type_i_ = THIS->chord_tremolo_type_i_;
                $$=a;
        }
        | ']'           {
-               if (!THIS->abbrev_beam_type_i_)
+               /* URG
+                */
+               if (!THIS->chord_tremolo_type_i_)
                  {
                     Span_req*b= new Span_req;
                     b->span_dir_ = STOP;
@@ -974,8 +975,8 @@ abbrev_command_req:
                  {
                    Chord_tremolo_req* a = new Chord_tremolo_req;
                    a->span_dir_ = STOP;
-                   a->type_i_ = THIS->abbrev_beam_type_i_;
-                   THIS->set_abbrev_beam (0);
+                   a->type_i_ = THIS->chord_tremolo_type_i_;
+                   THIS->set_chord_tremolo (0);
                    $$ = a;
                  }
        }
@@ -1114,7 +1115,7 @@ verbose_request:
                sp_p->set_spot (THIS->here_input ());
                $$ = sp_p;
        }
-       | abbrev_type   {
+       | tremolo_type  {
                Tremolo_req* a = new Tremolo_req;
                a->set_spot (THIS->here_input ());
                a->type_i_ = $1;
@@ -1384,15 +1385,13 @@ steno_duration:
        ;
 
 
-abbrev_type: 
+tremolo_type: 
        ':'     {
                $$ =0;
        }
        | ':' unsigned {
                if (!is_duration_b ($2))
                        THIS->parser_error (_f ("not a duration: %d", $2));
-               else if ($2 < 8)
-                       THIS->parser_error (_ ("Can't abbreviate"));
                $$ = $2;
        }
        ;
@@ -1408,10 +1407,14 @@ simple_element:
                
                n->pitch_ = *$1;
                n->duration_ = *$4;
-               if (THIS->abbrev_beam_type_i_)
+                /*
+                 URG
+                 */
+               if (THIS->chord_tremolo_type_i_)
                  {
                    if (n->duration_.plet_b ())
-                     THIS->parser_error (_ ("Can't abbreviate tuplet"));
+                     // urg, burp.  what nonsense / silly implementation
+                     THIS->parser_error (_ ("can't put stem tremolo on tuplet"));
                    else
                      n->duration_.set_plet (1, 2);
                  }
index a1f467e1f66bfd8d3bbff78d476369d05368188b..2af08ac71b72beedd2b713e277761903f75c3c3b 100644 (file)
@@ -7,7 +7,6 @@
 */
 
 #include "staff-symbol-referencer.hh"
-#include "stem-engraver.hh"
 #include "note-head.hh"
 #include "stem.hh"
 #include "musical-request.hh"
 #include "stem-tremolo.hh"
 #include "staff-info.hh"
 #include "translator-group.hh"
+#include "engraver.hh"
 
-Stem_engraver::Stem_engraver()
+/**
+  Make stems upon receiving noteheads.
+ */
+class Stem_engraver : public Engraver
 {
-  abbrev_req_l_ = 0;
+
+public:
+  VIRTUAL_COPY_CONS (Translator);
+  Stem_engraver();
+  
+protected:
+  virtual void do_creation_processing ();
+  virtual void acknowledge_element (Score_element_info);
+  virtual void do_pre_move_processing ();
+  virtual bool do_try_music (Music*);
+  
+private:
+  int default_tremolo_type_i_;
+  Stem *stem_p_;
+  Stem_tremolo *tremolo_p_;
+  Rhythmic_req *rhythmic_req_l_;
+  Tremolo_req* tremolo_req_l_;
+};
+
+ADD_THIS_TRANSLATOR (Stem_engraver);
+
+Stem_engraver::Stem_engraver ()
+{
+  tremolo_req_l_ = 0;
   stem_p_ = 0;
-  abbrev_p_ = 0;
-  default_abbrev_i_ = 16;
+  tremolo_p_ = 0;
+  default_tremolo_type_i_ = 16;
   rhythmic_req_l_ =0;
 }
 
 void
 Stem_engraver::do_creation_processing ()
 {
-  SCM prop = get_property ("abbrev");
+  /*
+    huh, why only at creation time?
+  */
+  SCM prop = get_property ("tremoloFlags");
   if (gh_number_p(prop)) 
     {
-      default_abbrev_i_  = gh_scm2int (prop);
+      default_tremolo_type_i_  = gh_scm2int (prop);
     }
 }
 
@@ -53,28 +82,40 @@ Stem_engraver::acknowledge_element(Score_element_info i)
          
          stem_p_->set_elt_property ("duration-log", gh_int2scm (duration_log));
 
-         if (abbrev_req_l_)
+         if (tremolo_req_l_)
            {
              /*
-               suggests typing of:
-               c8:16 c: c: c:
-               hmm, which isn't so bad?
-             */
-             int t = abbrev_req_l_->type_i_;
-             if (!t)
-               t = default_abbrev_i_;
+               Stem tremolo is never applied to a note by default,
+               is must me requested.  But there is a default for the
+               tremolo value:
+
+                  c4:8 c c:
+
+               the first and last (quarter) note bothe get one tremolo flag.
+              */
+             int requested_type = tremolo_req_l_->type_i_;
+             if (!requested_type)
+               requested_type = default_tremolo_type_i_;
              else
-               default_abbrev_i_ = t;
+               default_tremolo_type_i_ = requested_type;
 
-             if (t)
+             if (requested_type)
                {
-                 abbrev_p_ = new Stem_tremolo;
-                 announce_element (Score_element_info (abbrev_p_, abbrev_req_l_));
-                 abbrev_p_->set_elt_property ("tremolo-flags", gh_int2scm (intlog2 (t) - (duration_log>? 2)));
+                 tremolo_p_ = new Stem_tremolo;
+                 announce_element (Score_element_info (tremolo_p_, tremolo_req_l_));
+                 /*
+                   The number of tremolo flags is the number of flags of
+                   the tremolo-type minus the number of flags of the note
+                   itself.
+                  */
+                 int tremolo_flags = intlog2 (requested_type) - 2
+                   - (duration_log > 2 ? duration_log - 2 : 0);
+                 if (tremolo_flags < 0)
+                   tremolo_flags = 0;
+                 tremolo_p_->set_elt_property ("tremolo-flags",
+                                               gh_int2scm (tremolo_flags));
                }
            }
-
-         // must give the request, to preserve the rhythmic info.
          announce_element (Score_element_info (stem_p_, r));
        }
 
@@ -90,11 +131,11 @@ Stem_engraver::acknowledge_element(Score_element_info i)
 void
 Stem_engraver::do_pre_move_processing()
 {
-  if (abbrev_p_)
+  if (tremolo_p_)
     {
-      abbrev_p_->set_stem (stem_p_);
-      typeset_element (abbrev_p_);
-      abbrev_p_ = 0;
+      tremolo_p_->set_stem (stem_p_);
+      typeset_element (tremolo_p_);
+      tremolo_p_ = 0;
     }
 
   if (stem_p_)
@@ -112,18 +153,25 @@ Stem_engraver::do_pre_move_processing()
          daddy_trans_l_->set_property ("stemRightBeamCount", SCM_UNDEFINED);
        }
 
+      
       // UGH. Should mark non-forced instead.
+
+      /*
+        aargh: I don't get it.  direction is being set (and then set
+        to forced), if we have a Chord_tremolo.
+       */
       SCM dir = stem_p_->get_elt_property ("direction");
       if (gh_number_p (dir) && to_dir(dir))
        {
          stem_p_->set_elt_property ("dir-forced", SCM_BOOL_T);   
        }
 
-
       typeset_element(stem_p_);
       stem_p_ = 0;
     }
-  abbrev_req_l_ = 0;
+
+
+  tremolo_req_l_ = 0;
 }
 
 bool
@@ -131,12 +179,9 @@ Stem_engraver::do_try_music (Music* r)
 {
   if (Tremolo_req* a = dynamic_cast <Tremolo_req *> (r))
     {
-      abbrev_req_l_ = a;
+      tremolo_req_l_ = a;
       return true;
     }
   return false;
 }
 
-
-ADD_THIS_TRANSLATOR(Stem_engraver);
-
index d6b2fcfa4ce1c624ea2da244f4ed01c606c49b97..d945dc246338a156138c2e955973ce76303fad09 100644 (file)
@@ -1,5 +1,5 @@
 /*   
-  abbrev.cc --  implement Stem_tremolo
+  stem-tremolo.cc --  implement Stem_tremolo
   
   source file of the GNU LilyPond music typesetter
   
 #include "staff-symbol-referencer.hh"
 #include "directional-element-interface.hh"
 
+/*
+  TODO:
+    lengthen stem if necessary
+ */
+
 Stem_tremolo::Stem_tremolo ()
 {
   set_elt_property ("stem", SCM_EOL);
@@ -45,86 +50,79 @@ Stem_tremolo::dim_callback (Dimension_cache const *c)
 Molecule 
 Stem_tremolo::do_brew_molecule () const
 {
-  Stem * st = stem_l ();
-  int mult =0;
-  if (Beam * b = st->beam_l ())
-    {
-      mult = b->get_multiplicity ();
-    }
+  Stem * stem = stem_l ();
+  Beam * beam = stem->beam_l ();
   
-  Real interbeam_f = paper_l ()->interbeam_f (mult);
-  Real w  = gh_scm2double (get_elt_property ("beam-width"));
-  Real space = Staff_symbol_referencer_interface (st).staff_space ();
-  Real half_staff_space = space / 2;
-  Real beam_f = gh_scm2double (get_elt_property ("beam-thickness"));
-
-  int beams_i = 0;
-  Real dydx = 0.25;
-  
-  if (st && st->beam_l ())
+  Real dydx;
+  if (beam)
     {
       Real dy = 0;
-      SCM s = st->beam_l ()->get_elt_property ("height");
+      SCM s = beam->get_elt_property ("height");
       if (gh_number_p (s))
        dy = gh_scm2double (s);
-      Real dx = st->beam_l ()->last_visible_stem ()->hpos_f ()
-       - st->beam_l ()->first_visible_stem ()->hpos_f ();
-      dydx = dy/dx;
-  
-      // ugh, rather calc from Stem_tremolo_req
-      beams_i = st->beam_count(RIGHT) >? st->beam_count (LEFT);
-    } 
-
-  Molecule a (lookup_l ()->beam (dydx, w, beam_f));
-  a.translate (Offset (-w/2, w / 2 * dydx));
+      Real dx = beam->last_visible_stem ()->hpos_f ()
+       - beam->first_visible_stem ()->hpos_f ();
+      dydx = dx ? dy/dx : 0;
+    }
+  else
+    // urg
+    dydx = 0.25;
+
+  Real thick = gh_scm2double (get_elt_property ("beam-thickness"));
+  Real width = gh_scm2double (get_elt_property ("beam-width"));
+  Molecule a (lookup_l ()->beam (dydx, width, thick));
+  a.translate (Offset (-width/2, width / 2 * dydx));
   
-  int abbrev_flags = 1;
-  {
-    SCM a = get_elt_property ("abbrev-flags");
-    if (gh_number_p (a))
-      abbrev_flags = gh_scm2int (a);
-  }
-
+  int tremolo_flags;
+  SCM s = get_elt_property ("tremolo-flags");
+  if (gh_number_p (s))
+    tremolo_flags = gh_scm2int (s);
+  else
+    // huh?
+    tremolo_flags = 1;
+
+  int mult = beam ? beam->get_multiplicity () : 0;
+  Real interbeam_f = paper_l ()->interbeam_f (mult);
   Molecule mol; 
-  for (int i = 0; i < abbrev_flags; i++)
+  for (int i = 0; i < tremolo_flags; i++)
     {
       Molecule b (a);
       b.translate_axis (interbeam_f * i, Y_AXIS);
       mol.add_molecule (b);
     }
-  mol.translate_axis (-mol.extent ()[Y_AXIS].center (), Y_AXIS);
-
-  if (st)
-    { 
-      if (st->beam_l ())
-        {
-         mol.translate (Offset(st->hpos_f () - hpos_f (),
-           st->stem_end_position () * half_staff_space - 
-           directional_element (st->beam_l ()).get () * beams_i * interbeam_f));
-       }
-      else
-       {  
-         /*
-           Beams should intersect one beamthickness below staff end
-          */
-         Real dy = - mol.extent ()[Y_AXIS].length () / 2 * st->get_direction ();
-
-         /*
-           uhg.  Should use relative coords and placement
-         */
-         Real whole_note_correction = (st && st->invisible_b( ))
-           ? 0.0 //  -st->get_direction () * st->note_delta_f ()/2
-           : 0.0;
-        
-         dy += st->stem_end_position ();
-         mol.translate (Offset(st->hpos_f () - hpos_f ()+
-                                  whole_note_correction, dy));
-       }
+  if (tremolo_flags)
+    mol.translate_axis (-mol.extent ()[Y_AXIS].center (), Y_AXIS);
+
+  Real half_space = Staff_symbol_referencer_interface (stem).staff_space ()
+    / 2;
+  if (beam)
+    {
+      // ugh, rather calc from Stem_tremolo_req
+      int beams_i = stem->beam_count(RIGHT) >? stem->beam_count (LEFT);
+      mol.translate (Offset(stem->hpos_f () - hpos_f (),
+                           stem->stem_end_position () * half_space - 
+                           directional_element (beam).get () * beams_i * interbeam_f));
+    }
+  else
+    {  
+      /*
+       Beams should intersect one beamthickness below stem end
+      */
+      Real dy = stem->stem_end_position () * half_space;
+      dy -= mol.extent ()[Y_AXIS].length () / 2 *  stem->get_direction ();
 
       /*
-       there used to be half a page of code that was long commented out.
-       Removed in 1.1.35
-       */
+       uhg.  Should use relative coords and placement
+      */
+      Real whole_note_correction;
+      if (stem->invisible_b ())
+       whole_note_correction = -stem->get_direction ()
+         * stem->support_head ()->extent (X_AXIS).length () / 2;
+      else
+       whole_note_correction = 0;
+        
+      mol.translate (Offset (stem->hpos_f () - hpos_f () +
+                            whole_note_correction, dy));
     }
   
   return mol;
index 4eb5788468c5d1db7f3c68bb164a0612c6e9ac75..93ca721d078c1d89fd6350cfad20aa06abf45131 100644 (file)
@@ -255,20 +255,22 @@ LyricsContext = \translator {
 };
 \translator { \LyricsContext }
 
-\translator{
+ChordNameVoiceContext = \translator {
        \type "Engraver_group_engraver";
-       \consists "Output_property_engraver";   
+       \name ChordNameVoice ;
 
+       \consists "Output_property_engraver";   
        \consistsend "Axis_group_engraver";
-       \name ChordNameVoice ;
        \consists "Separating_line_group_engraver";
        \consists "Chord_name_engraver";
-}
-
+};
+\translator {\ChordNameVoiceContext}
 
 ChordNameContext = \translator {
        \type "Engraver_group_engraver";
        \name ChordNames;
+
+       \consists "Output_property_engraver";   
        \accepts "ChordNameVoice";
        \consistsend "Axis_group_engraver";
        };
@@ -303,6 +305,12 @@ HaraKiriStaffContext = \translator {
        \consists "Staff_margin_engraver";
        \accepts "Voice";
 };
+%{
+  The HaraKiriStaffContexts doesn't override \name,
+  so it is still named `Staff'.
+
+  %\translator { \HaraKiriStaffContext }
+%}
 
 OrchestralPartStaffContext = \translator {
        \StaffContext
index e75dd8e97094271ffa39eb818e9e1153e9e81c5c..9c059b4e025af998d6a5e7158c67524ab31dc589 100644 (file)
@@ -1,9 +1,17 @@
 \paper{
        \paper_sixteen
+
+       %%
+       \translator { \VoiceContext \remove "Dynamic_engraver"; }
+
        \translator {
                \VoiceContext
                \name "VoiceOne";
-               \consists "Line_number_engraver";
+
+               %%
+               \remove "Dynamic_engraver";
+
+               %%\consists "Line_number_engraver";
                verticalDirection = #1
                stemVerticalDirection = #1
                dynamicDirection = #-1
@@ -11,7 +19,7 @@
        \translator {
                \VoiceContext
                \name "VoiceTwo";
-               \consists "Line_number_engraver";
+               %%\consists "Line_number_engraver";
                verticalDirection = #-1
                stemVerticalDirection = #-1
                \remove "Dynamic_engraver";
index 335a15a56c1c0677e0b14e37fcf9666677028acc..7bc4c0f93d5d850d7cda17195aef4229815645e7 100644 (file)
@@ -14,6 +14,6 @@ copyright =    "public domain";
 global = \notes {
        \time 4/4;
        \key es;
-       \skip 1*314;
+       \skip 1*314; \bar "|.";
 }
 
index 3862835b3ebd793e1b30fb811808d7c9acab4743..e273cc7a48918649dde031e294c16788d2120cc9 100644 (file)
@@ -25,5 +25,5 @@ ALL_CC_SOURCES += $(HH_FILES) $(INL_FILES) $(CC_FILES) $(YY_FILES) $(LL_FILES)
 
 O_FILES+=$(addprefix $(outdir)/, $(CC_FILES:.cc=.o) $(LL_FILES:.ll=.o) $(YY_FILES:.yy=.o))
 
-TAGS_FILES += $(TCC_FILES) $(HH_FILES) $(INL_FILES) $(CC_FILES)
+TAGS_FILES += $(TCC_FILES) $(HH_FILES) $(INL_FILES) $(CC_FILES) $(YY_FILES) $(LL_FILES)