diff base/generics.lisp @ 106:8528c316fbcc

delete diatonic-pitch (as was) Delete the diatonic-pitch class, in preparation for MIPS pitch being our single representation. Add a DIATONIC-PITCH-OCTAVE generic, and make OCTAVE return the octave based on a MIDI-PITCH-NUMBER (and make sure that it returns an integer, too). darcs-hash:20070726121235-dc3a5-4cbd1058145163eecbfc84384234904e2353fead.gz
author c.rhodes <c.rhodes@gold.ac.uk>
date Thu, 26 Jul 2007 13:12:35 +0100
parents 59e69a32b8d9
children b445959f4cc1
line wrap: on
line diff
--- a/base/generics.lisp	Thu Jul 26 10:29:52 2007 +0100
+++ b/base/generics.lisp	Thu Jul 26 13:12:35 2007 +0100
@@ -39,9 +39,8 @@
 
 (defgeneric pitch (object &key kind)) ; ? Maybe this returns the pitch
 				      ; in its ur form?
-(defgeneric chromatic-pitch (pitch-designator)) ; How simple are these
-(defgeneric diatonic-pitch (pitch-designator)) ; if has to be computed?
-(defgeneric mips-pitch (pitch-designator))
+(defgeneric chromatic-pitch (pitch-designator))
+(defgeneric diatonic-pitch (pitch-designator))
 (defgeneric frequency (object)) ;?
 
 (defgeneric octave (pitch-designator)
@@ -49,6 +48,10 @@
 pitch-designator where middle c is defined to be the lowest pitch in
 octave 4."))
 
+(defgeneric diatonic-pitch-octave (pitch-designator)
+  (:documentation "Return an integer representing the diatonic octave
+of PITCH-DESIGNATOR."))
+
 (defgeneric diatonic-pitch-accidental (pitch-designator)
   (:documentation "Return an integer representing the inflection of a
 diatonic pitch where where negative values indicate numbers of flats,
@@ -62,16 +65,6 @@
   event) and returns an integer between 0 and 127 representing
   the chromatic pitch designated (60=middle C, 48 the C below
   that, etc.)"))
-(defgeneric meredith-chromatic-pitch-number (pitch-designator)
-  (:documentation "Takes a pitch-designator (usually a pitched
-  event) and returns an integer representing the chromatic pitch
-  designated (39=middle C, 27 the C below that, etc.)")
-  ;; David Meredith's PhD and ps13 code. FIXME: What is the legal
-  ;; range of this?
-  (:method (p) (- (midi-pitch-number p) 21)))
-(defgeneric meredith-morphetic-pitch-number (pitch-designator)
-  (:documentation "Returns an integer representing the morphetic pitch
-(7 per octave, An0 = 0, An1 = 7, middle c = 23) designated."))
 (defgeneric asa-pitch-string (pitch-designator)
   (:documentation "Returns a string representing the designated ASA
 pitch name which has three parts: a letter name in the set