Mercurial > hg > amuse
diff base/generics.lisp @ 81:4e1538df0d10
base/: add an implementation of diatonic pitch.
darcs-hash:20070717120206-c0ce4-b18278ab07116658e58839c4fd18972508da6658.gz
author | Marcus Pearce <m.pearce@gold.ac.uk> |
---|---|
date | Tue, 17 Jul 2007 13:02:06 +0100 |
parents | a98c2adfd420 |
children | 7a0ee88f1edb |
line wrap: on
line diff
--- a/base/generics.lisp Mon Jul 16 17:33:37 2007 +0100 +++ b/base/generics.lisp Tue Jul 17 13:02:06 2007 +0100 @@ -36,7 +36,12 @@ ; 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 frequency (object)) ;? + +(defgeneric middle-c (pitch-designator) + (:documentation "Returns the value of middle C in the particular +representation of pitch used by PITCH-DESIGNATOR.")) (defgeneric midi-pitch-number (pitch-designator) (:documentation "Takes a pitch-designator (usually a pitched event) and returns an integer between 0 and 127 representing @@ -49,6 +54,18 @@ ;; 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 +{A,B,C,D,E,F,G}, an inflection in the set {n,f,s,ff,ss,fff,sss,...} +and an octave number. E.g., Cn4 = Middle C.")) +(defgeneric diatonic-pitch-name (pitch-designator) + (:documentation "Returns a char in the set +{#\A,#\B,#\C,#\D,#\E,#\F,#\G}, representing the pitch name of +PITCH-DESIGNATOR.")) (defgeneric pitch-class (pitch-designator) (:documentation "Takes a pitch-designator (usually a pitched event) and returns an integer between 0 and 12 representing @@ -266,4 +283,4 @@ ;;; Dynamics ;;; Voice -;;; Boundary Strength (phrasing) \ No newline at end of file +;;; Boundary Strength (phrasing)