]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/chord.hh
patch::: 1.3.141.hwn3: Re: Sugar
[lilypond.git] / lily / include / chord.hh
index e568f709854c704ff1f949bbf33df4d83a84b334..e60fe80483420efb404d6f5808a535ea15e2ea94 100644 (file)
@@ -3,69 +3,37 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1999 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 1999--2001 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #ifndef CHORD_HH
 #define CHORD_HH
 
-#include "array.hh"
-#include "musical-pitch.hh"
-#include "lily-proto.hh"
-#include "item.hh"
-#include "molecule.hh"
+#include "pitch.hh"
 
-class Chord_name
-{
-public:
-  Molecule tonic_mol;
-  Molecule modifier_mol;
-  Molecule addition_mol;
-  Molecule inversion_mol;
-  Molecule bass_mol;
-};
-
-class Chord : public Item
+/*
+  This is not an Item, just a collection of Chord manipulation helper
+  functions
+  
+  ``chord'' is encoded:
+ (PITCHES . (INVERSION . BASS))
+
+  Chord:: namespace...  */
+class Chord
 {
 public:
-  VIRTUAL_COPY_CONS (Score_element);
-  static Array<Musical_pitch> base_arr (Musical_pitch p);
-  static int find_tonic_i (Array<Musical_pitch> const*);
-  static int find_pitch_i (Array<Musical_pitch> const*, Musical_pitch p);
-  static int find_notename_i (Array<Musical_pitch> const*, Musical_pitch p);
-  static Array<Musical_pitch> missing_thirds_pitch_arr (Array<Musical_pitch> const* pitch_arr_p);
-  static void rebuild_from_base (Array<Musical_pitch>*, int base_i);
-  static void rebuild_insert_inversion (Array<Musical_pitch>*, int tonic_i);
-  static void rebuild_transpose (Array<Musical_pitch>*, Musical_pitch tonic, bool fix7_b);
-  static void rebuild_with_bass (Array<Musical_pitch>*, int bass_i);
-  static int step_i (Musical_pitch tonic, Musical_pitch p);
-
-  Chord (Array<Musical_pitch> pitch_arr, Musical_pitch* inversion_p, Musical_pitch* bass_p);
-  Chord (Chord const&);
-  virtual ~Chord ();
-
-
-  Array<Musical_pitch> to_pitch_arr () const;
-
-  void find_additions_and_subtractions(Array<Musical_pitch> pitch_arr, Array<Musical_pitch>* add_arr_p, Array<Musical_pitch>* sub_arr_p) const;
-
-  Molecule ly_word2molecule (SCM scm) const;
-  Molecule ly_text2molecule (SCM scm) const;
-  Molecule pitch2molecule (Musical_pitch p) const;
-  bool user_chord_name (Array<Musical_pitch> pitch_arr, Chord_name* name_p) const;
-  void banter (Array<Musical_pitch> pitch_arr, Chord_name* name_p) const;
-
-  Array<Musical_pitch> pitch_arr_;
-  Musical_pitch* inversion_p_;
-  Musical_pitch* bass_p_;
-
-protected:
-  virtual Molecule* do_brew_molecule_p () const;
-  virtual void do_print () const;
+  static SCM base_pitches (SCM tonic);
+  static SCM transpose_pitches (SCM tonic, SCM pitches);
+  static SCM lower_step (SCM tonic, SCM pitches, SCM step);
+  static SCM member_notename (SCM p, SCM pitches);
+  static SCM member_pitch (SCM p, SCM pitches);
+  static SCM step_scm (SCM tonic, SCM p);
+  static SCM missing_thirds (SCM pitches);
+  static SCM to_pitches (SCM chord);
+  static SCM add_above_tonic (SCM pitch, SCM pitches);
+  static SCM add_below_tonic (SCM pitch, SCM pitches);
+  static SCM tonic_add_sub_to_pitches (SCM tonic, SCM add, SCM sub);
+  static Simultaneous_music *get_chord (SCM tonic, SCM add, SCM sub, SCM inversion, SCM bass, SCM dur);
 };
 
-Chord to_chord (Musical_pitch tonic, Array<Musical_pitch>* add_arr_p, Array<Musical_pitch>* sub_arr_p, Musical_pitch* inversion_p, Musical_pitch* bass_p);
-
-Chord to_chord (Array<Musical_pitch> pitch_arr, Tonic_req* tonic_req, Inversion_req* inversion_req, Bass_req* bass_req, bool find_inversion_b);
-
-#endif // CHORD_HH
+#endif /* CHORD_HH */