lilypond-1.3.59
authorfred <fred>
Tue, 26 Mar 2002 23:53:21 +0000 (23:53 +0000)
committerfred <fred>
Tue, 26 Mar 2002 23:53:21 +0000 (23:53 +0000)
lily/include/local-key-engraver.hh [deleted file]
lily/include/newkey.hh [deleted file]
lily/key-def.cc [deleted file]
lily/newkey.cc [deleted file]

diff --git a/lily/include/local-key-engraver.hh b/lily/include/local-key-engraver.hh
deleted file mode 100644 (file)
index cf4cf30..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
-  local-key-engraver.hh -- declare Local_key_engraver
-
-  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef LOCALKEYGRAV_HH
-#define LOCALKEYGRAV_HH
-
-#endif // LOCALKEYGRAV_HH
diff --git a/lily/include/newkey.hh b/lily/include/newkey.hh
deleted file mode 100644 (file)
index 32c3ad7..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*   
-  newkey.hh -- declare Newkey
-  
-  source file of the GNU LilyPond music typesetter
-  
-  (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
-
-#ifndef NEWKEY_HH
-#define NEWKEY_HH
-
-#include "protected-scm.hh" 
-
-class Newkey
-{
-  /*
-    alist mapping 
-    (octave . notename) -> accidental and notename -> accidental
-   */
-  Protected_scm key_alist_;
-public:
-  void set (int name, int acc);
-  void set (int oct, int name, int acc);
-  void clear ();
-  void set_scm (SCM k, SCM v);
-  Newkey();
-  int get (int oct, int name);
-  int get (int name);
-};
-#endif /* NEWKEY_HH */
-
diff --git a/lily/key-def.cc b/lily/key-def.cc
deleted file mode 100644 (file)
index 523c214..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-/*   
-  key-def.cc --  implement Key_def
-  
-  source file of the GNU LilyPond music typesetter
-  
-  (c) 1999--2000 Jan Nieuwenhuizen <janneke@gnu.org>
-  
- */
-
-#include "key-def.hh"
-#include "debug.hh"
-
-Key_def::Key_def ()
-{
-  modality_i_ = 0;
-  ordinary_key_b_ = false;
-}
-int
-Key_def::ordinary_accidentals_i () const
-{
-  if (!ordinary_key_b_) 
-    {
-      programming_error ("Accidentals requested for non-conventional key");
-      return 0;
-    }
-
-  int p;
-  if (pitch_arr_.size () < 1) 
-    {
-      warning (_ ("No key name, assuming `C'"));
-      p = 0;
-    }
-  else
-    {
-      p = pitch_arr_[0].semitone_pitch ();
-      p += modality_i_;
-    }
-  /* Solve the equation 7*accidentals_i mod 12 = p, -6 <= accidentals_i <= 5 */
-  int accidentals_i = (7*p) % 12;
-  accidentals_i = (accidentals_i + 18) % 12 -6;
-  
-  /* Correct from flats to sharps or vice versa */
-  if (accidentals_i * pitch_arr_[0].accidental_i_ < 0)
-    accidentals_i += 12 * sign (pitch_arr_[0].accidental_i_);
-  return accidentals_i;
-}
-
-int
-Key_def::flats_i () const
-{
-  if (ordinary_key_b_) 
-    return 0 >? -ordinary_accidentals_i ();
-  int flats_i = 0;
-  for (int i = 0; i < pitch_arr_.size (); i++)
-    {
-      if (pitch_arr_[i].accidental_i_ < 0)
-       flats_i -= pitch_arr_[i].accidental_i_;
-    }
-  return flats_i;
-}
-
-bool
-Key_def::minor_b () const
-{
-  return modality_i_ == 3;
-}
-
-int
-Key_def::sharps_i () const
-{
-  if (ordinary_key_b_) 
-    return 0 >? ordinary_accidentals_i ();
-  int sharps_i = 0;
-  for (int i = 0; i < pitch_arr_.size (); i++)
-    {
-      if (pitch_arr_[i].accidental_i_ > 0)
-       sharps_i += pitch_arr_[i].accidental_i_;
-    }
-  return sharps_i;
-}
-
-void
-Key_def::transpose (Musical_pitch d) 
-{
-  if (ordinary_key_b_ ) 
-    { 
-      if (pitch_arr_.size () > 0) 
-        pitch_arr_[0].transpose (d);
-      else
-        {
-          warning (_ ("Don't know how handle empty keys")); // TODO 
-        }
-    }
-  else
-    {
-      Array<Musical_pitch> old_pitch_arr_;
-      for (int i = 0; i < pitch_arr_.size (); i++)
-        {
-          old_pitch_arr_.push (pitch_arr_[i]);
-        }
-      // set accidentals for \key d (as in Key_engraver::read_req)
-      // (later called "new accidentals")
-      int p = d.semitone_pitch ();
-      /* Solve the equation 7*accidentals_i mod 12 = p, -6 <= accidentals_i <= 5 */
-      int accidentals_i = (7*p) % 12;
-      accidentals_i = (accidentals_i + 18) % 12 -6;
-
-      /* Correct from flats to sharps or vice versa */
-      if (accidentals_i * d.accidental_i_ < 0)
-      accidentals_i += 12 * sign (d.accidental_i_);
-    
-      pitch_arr_.clear ();
-      if (accidentals_i < 0) 
-        {
-         int accidental = 6 ; // First accidental: bes
-          for ( ; accidentals_i < 0 ; accidentals_i++ ) 
-           {
-             Musical_pitch m;
-             m.accidental_i_ = -1;
-             m.notename_i_ = accidental;
-             pitch_arr_.push (m);
-     
-             accidental = (accidental + 3) % 7 ;
-           }
-       }
-      else 
-       { 
-         int accidental = 3 ; // First accidental: fis
-         for ( ; accidentals_i > 0 ; accidentals_i-- ) 
-           {
-             Musical_pitch m;
-             m.accidental_i_ = 1;
-             m.notename_i_ = accidental;
-             pitch_arr_.push (m);
-   
-             accidental = (accidental + 4) % 7 ;
-           }
-       }
-      // Check if transposed old accidentals and the new ones coincide
-      accidentals_i = pitch_arr_.size ();
-      int acc_found;
-      Musical_pitch mm;
-      for (int i=0; i < old_pitch_arr_.size (); i++)
-        {
-          acc_found = 0;
-          mm = old_pitch_arr_[i];
-         mm.transpose (d);
-          for (int j=0; ( (j < accidentals_i) && (acc_found == 0)); j++)
-            {
-              if (pitch_arr_[j].notename_i_ == mm.notename_i_)
-                {
-                  if (mm.accidental_i_ == 0)
-                    {
-                      // remove new accidental 
-                      pitch_arr_.del (j);
-                      accidentals_i--;
-                      acc_found = 1;
-                   }
-                 else
-                    {
-                      // change new accidental 
-                      pitch_arr_[j].accidental_i_ = mm.accidental_i_;
-                      acc_found = 1;
-                   }
-                }
-            }
-          if (acc_found == 0)
-            {
-              // add transposed old accidental 
-             pitch_arr_.push (mm);
-            }
-        }
-    }
-}
-
-void
-Key_def::squash_octaves ()
-{
-  for (int i=0; i < pitch_arr_.size (); i++)
-    {
-      pitch_arr_[i].octave_i_ = 0;
-    }
-}
diff --git a/lily/newkey.cc b/lily/newkey.cc
deleted file mode 100644 (file)
index 31bd1c9..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#include "newkey.hh"
-
-Newkey::Newkey ()
-{
-  clear();
-}
-
-void
-Newkey::clear()
-{
-  key_alist_ = SCM_EOL;
-}
-
-void
-Newkey::set (int n, int a)
-{
-  set_scm (gh_int2scm (n), gh_int2scm (a));
-}
-
-void
-Newkey::set (int o, int n, int a)
-{
-  set_scm (gh_cons (gh_int2scm (o),gh_int2scm(n)), gh_int2scm (a));
-}
-
-void
-Newkey::set_scm (SCM k, SCM v)
-{
-  key_alist_
-    = scm_assoc_set_x (key_alist_, k, v);  
-}
-
-int
-Newkey::get (int o, int n)
-{
-  SCM r = scm_assoc (gh_cons (gh_int2scm (o), gh_int2scm (n)), key_alist_);
-  return r == SCM_BOOL_F ? get (n) : gh_cdr (r);
-}
-
-int
-Newkey::get (int n)
-{
-  SCM r = scm_assoc (gh_int2scm (n), key_alist_);
-  return r == SCM_BOOL_F ? 0: gh_cdr (r);
-}