]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.5.19
authorfred <fred>
Wed, 27 Mar 2002 02:03:50 +0000 (02:03 +0000)
committerfred <fred>
Wed, 27 Mar 2002 02:03:50 +0000 (02:03 +0000)
input/test/cautionaries.ly [new file with mode: 0644]
input/test/drums.ly
input/test/music-box.ly
input/test/smart-transpose.ly
lily/accidental-engraver.cc
lily/auto-beam-engraver.cc
lily/beam-engraver.cc
lily/local-key-item.cc
ly/drumpitch-init.ly
scm/music-property-description.scm

diff --git a/input/test/cautionaries.ly b/input/test/cautionaries.ly
new file mode 100644 (file)
index 0000000..e4f4161
--- /dev/null
@@ -0,0 +1,15 @@
+\version "1.5.17"
+
+\score { \notes \context Staff \transpose c''' {
+  \key d \major
+  \property Staff.autoReminders = #'cautionary
+  \property Staff.Accidentals \override #'font-relative-size = #0
+  <dis1 c> cis2 d
+  \property Staff.Accidentals \override #'cautionary-size = #-1
+  <dis1 c> cis2 d
+  \property Staff.Accidentals \override #'paren-cautionaries = ##f
+  <dis1 c> cis2 d
+
+}
+}
+
index 93a0a9e70064f6a4255b6aa6ba63710ebebc7397..f3299139668478b65948eb181880c4bc90757cb0 100644 (file)
@@ -4,7 +4,7 @@
 
 \include "drumpitch-init.ly"
 
-\version "1.3.146"
+\version "1.5.1"
 
 drh = \notes { cymc4.^"crash" hhc16^"h.h." hh \repeat "unfold" 5 {hhc8 hho hhc8 hh16 hh} hhc4 r4 r2 }
 drl = \notes {\repeat "unfold" 3 {bd4 sn8 bd bd4 <bd ss>} bd8 tommh tommh bd toml toml bd tomfh16 tomfh }
index 2ff6c639e43bf313a4be33ded6336f20e259047b..de0b47e9f010323e9439915028095648d0adb0b9 100644 (file)
@@ -22,6 +22,7 @@ using Scheme functions to save typing work.
 }
 
 \include "deutsch.ly"
+\version "1.5.18"
 
 #(define (transform music)
   (let* ((es (ly-get-mus-property music 'elements))
@@ -48,25 +49,13 @@ using Scheme functions to save typing work.
 #(define ((trans pitches) music)
   (let* ((es (ly-get-mus-property music 'elements))
          (e (ly-get-mus-property music 'element))
-         (p (ly-get-mus-property music 'pitch))
-         (body (ly-get-mus-property music 'body))
-         (alts (ly-get-mus-property music 'alternatives)))
+         (p (ly-get-mus-property music 'pitch)))
 
     (if (pair? es)
         (ly-set-mus-property
          music 'elements
          (map (trans pitches) es)))
 
-    (if (music? alts)
-        (ly-set-mus-property
-         music 'alternatives
-         ((trans pitches) alts)))
-
-    (if (music? body)
-        (ly-set-mus-property
-         music 'body
-         ((trans pitches) body)))
-
     (if (music? e)
         (ly-set-mus-property
          music 'element
index 24d70d3cb1b1c64496189810a3d0c09b628868c1..3674d81008b030e4e746d782c1e741fba021099e 100644 (file)
@@ -1,4 +1,4 @@
-\version "1.3.146"
+\version "1.5.18"
 
 \header {
 texidoc="
@@ -42,25 +42,13 @@ how useful these enharmonic modifications are. Mats B.
 #(define (simplify music)
   (let* ((es (ly-get-mus-property music 'elements))
          (e (ly-get-mus-property music 'element))
-         (p (ly-get-mus-property music 'pitch))
-         (body (ly-get-mus-property music 'body))
-         (alts (ly-get-mus-property music 'alternatives)))
+         (p (ly-get-mus-property music 'pitch)))
 
     (if (pair? es)
         (ly-set-mus-property
          music 'elements
          (map (lambda (x) (simplify x)) es)))
 
-    (if (music? alts)
-        (ly-set-mus-property
-         music 'alternatives
-         (simplify alts)))
-
-    (if (music? body)
-        (ly-set-mus-property
-         music 'body
-         (simplify body)))
-
     (if (music? e)
         (ly-set-mus-property
          music 'element
index e9daee13c3f043368c995b8eb4673afe17e3db2b..cb87b5edb34a1ecc15691cf1289c170965e5e3c6 100644 (file)
@@ -39,7 +39,6 @@ protected:
   virtual void acknowledge_grob (Grob_info);
   virtual void stop_translation_timestep ();
   virtual void initialize ();
-  virtual int  number_accidentals (SCM sig, Note_req *);
   virtual void create_grobs ();
   virtual void finalize ();
 public:
@@ -74,17 +73,18 @@ Accidental_engraver::initialize ()
   daddy_trans_l_->set_property ("lazyKeySignature",   last_keysig_);  
 }
 
-/** calculates the number of accidentals on basis of the current local time sig
+/** calculates the number of accidentals on basis of the current local key sig
   * (passed as argument).
   * Returns number of accidentals (0, 1 or 2).
   *   Negative (-1 or -2) if accidental has changed.
   **/
-int
-Accidental_engraver::number_accidentals (SCM sig, Note_req * note_l)
+static int
+number_accidentals (SCM sig, Note_req * note_l)
 {
-  int n = unsmob_pitch (note_l->get_mus_property ("pitch"))->notename_i_;
-  int o = unsmob_pitch (note_l->get_mus_property ("pitch"))->octave_i () ;
-  int a = unsmob_pitch (note_l->get_mus_property ("pitch"))->alteration_i_;
+  Pitch *pitch = unsmob_pitch (note_l->get_mus_property ("pitch"));
+  int n = pitch->notename_i_;
+  int o = pitch->octave_i () ;
+  int a = pitch->alteration_i_;
   
   SCM prev = scm_assoc (gh_cons (gh_int2scm (o), gh_int2scm (n)), sig);
   if (prev == SCM_BOOL_F)
@@ -189,20 +189,21 @@ Accidental_engraver::create_grobs ()
            always do the correct thing?
            (???? -Rune )
           */
-         int n = unsmob_pitch (note_l->get_mus_property ("pitch"))->notename_i_;
-         int o = unsmob_pitch (note_l->get_mus_property ("pitch"))->octave_i () ;
-         int a = unsmob_pitch (note_l->get_mus_property ("pitch"))->alteration_i_;
-         SCM ON = gh_cons (gh_int2scm (o), gh_int2scm (n));
+         
+         Pitch *pitch = unsmob_pitch (note_l->get_mus_property ("pitch"));
+         int n = pitch->notename_i_;
+         int o = pitch->octave_i () ;
+         int a = pitch->alteration_i_;
+         SCM on = gh_cons (gh_int2scm (o), gh_int2scm (n));
          bool forget = to_boolean (get_property ("forgetAccidentals"));
          if (tie_changes)
            {
              /*
                Remember an alteration that is different both from
                that of the tied note and of the key signature.
-               (????? -Rune )
               */
-             localsig = scm_assoc_set_x (localsig, ON, SCM_BOOL_T); 
-             lazysig = scm_assoc_set_x  (lazysig,  ON, SCM_BOOL_T); 
+             localsig = scm_assoc_set_x (localsig, on, SCM_BOOL_T); 
+             lazysig = scm_assoc_set_x  (lazysig,  on, SCM_BOOL_T); 
            }
          else if (!forget)
            {
@@ -210,8 +211,8 @@ Accidental_engraver::create_grobs ()
                not really really correct if there are more than one
                noteheads with the same notename.
               */
-             localsig = scm_assoc_set_x (localsig, ON, gh_int2scm (a)); 
-             lazysig = scm_assoc_set_x  (lazysig,  ON, gh_int2scm (a)); 
+             localsig = scm_assoc_set_x (localsig, on, gh_int2scm (a)); 
+             lazysig = scm_assoc_set_x  (lazysig,  on, gh_int2scm (a)); 
            }
         }
   
@@ -319,5 +320,5 @@ events.  Due to interaction with ties (which don't come together
 with note heads), this needs to be in a context higher than Tie_engraver. FIXME",
 /* creats*/       "Accidentals",
 /* acks  */       "rhythmic-head-interface tie-interface arpeggio-interface",
-/* reads */       "localKeySignature forgetAccidentals noResetKey",
+/* reads */       "localKeySignature forgetAccidentals noResetKey autoReminders",
 /* write */       "");
index 2044f8850010e4d96b6f35f1de0178183ddf86b0..8d13e857df326e12807e3a9e9656768513784d2b 100644 (file)
@@ -61,6 +61,8 @@ private:
   Moment extend_mom_;
   Moment beam_start_moment_;
   Moment beam_start_location_;
+
+  bool subdivide_beams_;
   
   // We act as if beam were created, and start a grouping anyway.
   Beaming_info_list*grouping_p_;  
@@ -247,8 +249,7 @@ Auto_beam_engraver::begin_beam ()
   grouping_p_ = new Beaming_info_list;
   beam_start_moment_ = now_mom ();
   beam_start_location_ = *unsmob_moment (get_property ("measurePosition"));
-
-
+  subdivide_beams_ = gh_scm2bool(get_property("subdivideBeams")); 
 }
 
 
@@ -292,7 +293,7 @@ Auto_beam_engraver::typeset_beam ()
   if (finished_beam_p_)
     {
       finished_grouping_p_->beamify(*unsmob_moment (get_property ("beatLength")),
-                                   (bool)gh_scm2bool(get_property("subdivideBeams")));
+                                   subdivide_beams_);
       Beam::set_beaming (finished_beam_p_, finished_grouping_p_);
       typeset_grob (finished_beam_p_);
       finished_beam_p_ = 0;
@@ -480,5 +481,5 @@ stemRightBeamCount.
 ",
 /* creats*/       "Beam",
 /* acks  */       "stem-interface rest-interface beam-interface bar-line-interface",
-/* reads */       "noAutoBeaming autoBeamSettings",
+/* reads */       "noAutoBeaming autoBeamSettings subdivideBeams",
 /* write */       "");
index b9e7eb63fec08cb961c5221795ca05b9f49d9196..e17a1e8e730c0677123e304463c50ac46148ceb6 100644 (file)
@@ -38,7 +38,9 @@ class Beam_engraver : public Engraver
 
   /// moment (global time) where beam started.
   Moment beam_start_mom_;
-  
+
+  bool subdivide_beams_;
+
   void typeset_beam ();
   void set_melisma (bool);
 protected:
@@ -63,6 +65,7 @@ Beam_engraver::Beam_engraver ()
   beam_info_p_ =0;
   reqs_drul_[LEFT] = reqs_drul_[RIGHT] =0;
   prev_start_req_ =0;
+  
 }
 
 bool
@@ -182,7 +185,7 @@ Beam_engraver::typeset_beam ()
   if (finished_beam_p_)
     {
       finished_beam_info_p_->beamify(*unsmob_moment (get_property ("beatLength")),
-                                    (bool)gh_scm2bool(get_property("subdivideBeams")));
+                                    subdivide_beams_);
 
       Beam::set_beaming (finished_beam_p_, finished_beam_info_p_);
       typeset_grob (finished_beam_p_);
@@ -204,6 +207,7 @@ Beam_engraver::start_translation_timestep ()
     if (to_boolean (m) && to_boolean (b)) {
       set_melisma (true);
     }
+    subdivide_beams_ = gh_scm2bool(get_property("subdivideBeams")); 
   }
 }
 
@@ -292,5 +296,5 @@ ENTER_DESCRIPTION(Beam_engraver,
 printed with flags instead of beams.",
 /* creats*/       "Beam",
 /* acks  */       "stem-interface rest-interface",
-/* reads */       "beamMelismaBusy",
+/* reads */       "beamMelismaBusy subdivideBeams",
 /* write */       "");
index 1ffc2c696cca0a6d7d975b351bb981b1c210c412..52e7a65f775b03f063d2b9eab60c4a94ee80c07b 100644 (file)
@@ -171,8 +171,20 @@ Local_key_item::brew_molecule (SCM smob)
          oct_b = true; 
        }
       
+
       lastoct = p.octave_i () ;
 
+      bool cautionary = (scm_memq (ly_symbol2scm ("cautionary"), opts) != SCM_BOOL_F);
+      SCM font_rel_siz = me->get_grob_property("font-relative-size");
+      SCM caut_siz = me->get_grob_property("cautionary-size");
+      int frs = (gh_exact_p(font_rel_siz) ? gh_scm2int(font_rel_siz) : 0);
+      int cs = (gh_exact_p(caut_siz) ? gh_scm2int(caut_siz) : 0);
+
+
+      // Ugh. This will only work if only called once on each grob. --rz
+      if (cautionary && caut_siz!=0)
+       me->set_grob_property ("font-relative-size",gh_int2scm(frs+cs));
+
       SCM c0 =  me->get_grob_property ("c0-position");
       Real dy = (gh_number_p (c0) ? gh_scm2int (c0) : 0 + p.notename_i_)
        * note_distance;
@@ -189,8 +201,8 @@ Local_key_item::brew_molecule (SCM smob)
          acc.add_at_edge (X_AXIS, LEFT, Molecule (prefix), 0);
        }
 
-      if (scm_memq (ly_symbol2scm ("cautionary"), opts) != SCM_BOOL_F)
-       acc = parenthesize (me, acc);
+      if (cautionary && to_boolean(me->get_grob_property("paren-cautionaries")))
+        acc = parenthesize (me, acc);
 
       acc.translate_axis (dy, Y_AXIS);
       octave_mol.add_at_edge (X_AXIS, RIGHT, acc, 0);
index b55e8bb1f48e2858004efb23e473e084dc7eabc0..211246f0817c013bbd1cba98fb4adcc63f001896 100644 (file)
@@ -47,7 +47,7 @@
        (mutehiconga      cghm  ,(make-pitch 0 1 0))
        (openhiconga      cgho  ,(make-pitch 0 1 1))
        (hiconga          cgh   ,(make-pitch 0 2 -1))
- (openloconga      cglo  ,(make-pitch 0 1 2))
      (openloconga      cglo  ,(make-pitch 0 1 2))
        (loconga          cgl   ,(make-pitch 0 2 0))
        (hitimbale        timh  ,(make-pitch 0 3 0))
        (lotimbale        timl  ,(make-pitch 0 3 1))
index 39957ee4417f662e8461dc43fc518febd97c8555..8914c5c3dbabe105b19e5e552bbff66aba575f54 100644 (file)
@@ -27,7 +27,6 @@
 (music-property-description 'span-type symbol? "What kind of spanner should be created?")
 (music-property-description 'articulation-type symbol? "key for scriptDefinitions alist")
 (music-property-description 'bass boolean? "Set if this note is a bass note in a chord")
-(music-property-description 'body music? "The body of a repeat ")
 (music-property-description 'cautionary boolean? "If set, this alteration needs cautionary accidental")
 (music-property-description 'change-to-id string? "name of the context to change to ")
 (music-property-description 'change-to-type string? "type of the context to change to.")