Mercurial > hg > amuse
changeset 108:b445959f4cc1
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
author | c.rhodes <c.rhodes@gold.ac.uk> |
---|---|
date | Thu, 26 Jul 2007 14:10:18 +0100 |
parents | 6bc5542fa9fa |
children | a9a1c7aa86a9 |
files | base/classes.lisp base/generics.lisp base/package.lisp |
diffstat | 3 files changed, 11 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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)."))
--- 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."))
--- 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 ))