comparison base/generics.lisp @ 72:9960645779f0

Doc strings for some generics darcs-hash:20070704142005-f76cc-247e963a3e68bc14c2a30c4c76bb569e07a4f8e6.gz
author David Lewis <d.lewis@gold.ac.uk>
date Wed, 04 Jul 2007 15:20:05 +0100
parents 8b31d54c95be
children a98c2adfd420
comparison
equal deleted inserted replaced
71:6884aed85d61 72:9960645779f0
4 4
5 (defgeneric get-composition (identifier)) 5 (defgeneric get-composition (identifier))
6 6
7 ;;; Getting constituents from compositions 7 ;;; Getting constituents from compositions
8 ;; IS this the mechanism we want to use 8 ;; IS this the mechanism we want to use
9 (defgeneric time-signatures (composition)) 9 (defgeneric time-signatures (composition)
10 (defgeneric (setf time-signatures) (sequence composition)) 10 (:documentation "Returns all time-signatures in a composition
11 (defgeneric tempi (composition)) 11 Probably shouldn't be exported - can be replaced
12 (defgeneric (setf tempi) (sequence composition)) 12 by (get-applicable-time-signature commposition composition)"))
13 (defgeneric key-signatures (composition)) 13 (defgeneric (setf time-signatures) (sequence composition)
14 (defgeneric (setf key-signatures) (sequence composition)) 14 (:documentation "Sets all time-signatures in a composition.
15 Is this wanted here?"))
16 (defgeneric tempi (composition)
17 (:documentation "Returns all tempi in a composition Probably
18 shouldn't be exported - can be replaced
19 by (get-applicable-tempi commposition composition)"))
20 (defgeneric (setf tempi) (sequence composition)
21 (:documentation "Sets all tempi in a composition.
22 Is this wanted here?"))
23 (defgeneric key-signatures (composition)
24 (:documentation "Returns all key-signatures in a composition
25 Probably shouldn't be exported - can be replaced
26 by (get-applicable-key-signature commposition composition)"))
27 (defgeneric (setf key-signatures) (sequence composition)
28 (:documentation "Sets all key sigs in a composition.
29 Is this wanted here?"))
15 30
16 ;;; Simple Accessors 31 ;;; Simple Accessors
17 32
18 ;; pitch-based 33 ;; pitch-based
19 34
20 (defgeneric pitch (object &key kind)) ; ? Maybe this returns the pitch 35 (defgeneric pitch (object &key kind)) ; ? Maybe this returns the pitch
21 ; in its ur form? 36 ; in its ur form?
22 (defgeneric chromatic-pitch (pitch-designator)) ; How simple are these 37 (defgeneric chromatic-pitch (pitch-designator)) ; How simple are these
23 (defgeneric diatonic-pitch (pitch-designator)) ; if has to be computed? 38 (defgeneric diatonic-pitch (pitch-designator)) ; if has to be computed?
24 (defgeneric frequency (object)) ;? 39 (defgeneric frequency (object)) ;?
25 (defgeneric midi-pitch-number (pitch-designator)) 40 (defgeneric midi-pitch-number (pitch-designator)
41 (:documentation "Takes a pitch-designator (usually a pitched
42 event) and returns an integer between 0 and 127 representing
43 the chromatic pitch designated (60=middle C, 48 the C below
44 that, etc.)"))
26 (defgeneric meredith-chromatic-pitch-number (pitch-designator) 45 (defgeneric meredith-chromatic-pitch-number (pitch-designator)
27 ;; David Meredith's PhD and ps13 code 46 (:documentation "Takes a pitch-designator (usually a pitched
47 event) and returns an integer representing the chromatic pitch
48 designated (39=middle C, 27 the C below that, etc.)")
49 ;; David Meredith's PhD and ps13 code. FIXME: What is the legal
50 ;; range of this?
28 (:method (p) (- (midi-pitch-number p) 21))) 51 (:method (p) (- (midi-pitch-number p) 21)))
29 (defgeneric pitch-class (pitch-designator) 52 (defgeneric pitch-class (pitch-designator)
53 (:documentation "Takes a pitch-designator (usually a pitched
54 event) and returns an integer between 0 and 12 representing
55 the octave-independant pitch, with c=0, c#=1, etc.")
30 (:method (p) (mod (midi-pitch-number p) 12))) 56 (:method (p) (mod (midi-pitch-number p) 12)))
31 (defgeneric span (pitch-interval-designator)) 57 (defgeneric span (pitch-interval-designator))
32 58
33 ;; time 59 ;; time
34 60
35 (defgeneric duration (period-designator)) 61 (defgeneric duration (period-designator))
36 (defgeneric (setf duration) (value period-designator)) 62 (defgeneric (setf duration) (value period-designator))
37 (defgeneric timepoint (moment-designator)) 63 (defgeneric timepoint (moment-designator))
38 (defgeneric (setf timepoint) (value moment-designator)) 64 (defgeneric (setf timepoint) (value moment-designator))
39 (defgeneric cut-off (anchored-period-designator) ; name? 65 (defgeneric cut-off (anchored-period-designator) ; name?
66 (:documentation "Returns a <moment> representing the point at
67 which the anchored period has ended.")
40 (:method (apd) (time+ (moment apd) (floating-period apd)))) 68 (:method (apd) (time+ (moment apd) (floating-period apd))))
41 69
42 ;; others 70 ;; others
43 71
44 ;; I've given the time-sig accessors general names because it allows 72 ;; I've given the time-sig accessors general names because it allows