# HG changeset patch # User c.rhodes # Date 1185455418 -3600 # Node ID b445959f4cc1ffd588f65692ec5e32ba7febd671 # Parent 6bc5542fa9fa160d141a24daf6735b612c0ac070 MIPS generic functions and methods for diatonic pitches Define and implement DIATONIC-PITCH-MP and DIATONIC-PITCH-CP for mips-pitches (soon to be diatonic-pitches). Supersedes MEREDITH-FOO darcs-hash:20070726131018-dc3a5-3421fb2c4beceae2370932768fefa1115050cfdd.gz diff -r 6bc5542fa9fa -r b445959f4cc1 base/classes.lisp --- a/base/classes.lisp Thu Jul 26 14:09:21 2007 +0100 +++ b/base/classes.lisp Thu Jul 26 14:10:18 2007 +0100 @@ -50,8 +50,8 @@ (:documentation "A pitch represented as a number, with higher values representing high pitches.")) (defclass mips-pitch (pitch) - ((cp :initarg :cp :accessor %p-pc) - (mp :initarg :mp :accessor %p-pm)) + ((cp :initarg :cp :accessor %p-pc :reader diatonic-pitch-cp) + (mp :initarg :mp :accessor %p-pm :reader diatonic-pitch-mp)) (:documentation "A MIPS pitch: cp is an integer representing chromatic pitch (An0 = 0, middle C = 39); mp is an integer representing the morphetic pitch (An0 = 0, middle c = 23).")) diff -r 6bc5542fa9fa -r b445959f4cc1 base/generics.lisp --- a/base/generics.lisp Thu Jul 26 14:09:21 2007 +0100 +++ b/base/generics.lisp Thu Jul 26 14:10:18 2007 +0100 @@ -57,6 +57,13 @@ diatonic pitch where where negative values indicate numbers of flats, 0 indicates natural and positive values indicate numbers of sharps.")) +(defgeneric diatonic-pitch-mp (pitch-designator) + (:documentation "Return an integer representing the morphetic pitch +\(in MIPS terms) of a diatonic pitch.")) +(defgeneric diatonic-pitch-cp (pitch-designator) + (:documentation "Return an integer representing the chromatic pitch +\(in MIPS terms) of a diatonic pitch.")) + (defgeneric middle-c (pitch-designator) (:documentation "Returns the value of middle C in the particular representation of pitch used by PITCH-DESIGNATOR.")) diff -r 6bc5542fa9fa -r b445959f4cc1 base/package.lisp --- a/base/package.lisp Thu Jul 26 14:09:21 2007 +0100 +++ b/base/package.lisp Thu Jul 26 14:10:18 2007 +0100 @@ -32,7 +32,6 @@ #:tempi #:key-signatures #:midi-pitch-number - #:meredith-chromatic-pitch-number #:pitch-class #:span #:duration @@ -112,7 +111,6 @@ #:tempo-equal #:insufficient-information #:undefined-action - #:meredith-morphetic-pitch-number #:asa-pitch-string #:mips-pitch #:diatonic-pitch-name @@ -123,4 +121,6 @@ #:diatonic-pitch-accidental #:ensure-monody #:crotchet + #:diatonic-pitch-cp + #:diatonic-pitch-mp ))