m@0
|
1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
|
m@0
|
2 ;;;; ======================================================================
|
m@0
|
3 ;;;; File: generics.lisp
|
m@0
|
4 ;;;; Author: Marcus Pearce <m.pearce@gold.ac.uk>
|
m@0
|
5 ;;;; Created: <2006-10-12 15:14:51 marcusp>
|
m@0
|
6 ;;;; Time-stamp: <2006-10-12 16:57:51 marcusp>
|
m@0
|
7 ;;;; ======================================================================
|
m@0
|
8
|
m@0
|
9 ;;; Accessors (do we need the get- prefix?)
|
m@0
|
10
|
m@0
|
11 (defgeneric get-pitch (object &key kind)) ; ?
|
m@0
|
12 (defgeneric get-chromatic-pitch (object))
|
m@0
|
13 (defgeneric get-diatonic-pitch (object))
|
m@0
|
14 (defgeneric get-frequency (object))
|
m@0
|
15
|
m@0
|
16 (defgeneric get-duration (object))
|
m@0
|
17
|
m@0
|
18 (defgeneric get-onset (object)) ; get-time?
|
m@0
|
19
|
m@0
|
20
|
m@0
|
21 ;;; Time Protocol (or moments?)
|
m@0
|
22
|
m@0
|
23 ;; negative times/durations -> ERROR?
|
m@0
|
24
|
m@0
|
25 ;; time+: <time> <duration> -> <time>
|
m@0
|
26 ;; <duration> <time> -> <time> (same as previous?)
|
m@0
|
27 ;; <duration> <duration> -> <duration> (or a distinct duration+?)
|
m@0
|
28 ;; <time> <time> -> ERROR?
|
m@0
|
29 ;;
|
m@0
|
30 ;; time-: <time> <time> -> <duration>
|
m@0
|
31 ;; <time> <duration> -> <time>
|
m@0
|
32 ;; <duration> <duration> -> <duration> (or a distinct duration-?)
|
m@0
|
33 ;; <duration> <time> -> ERROR?
|
m@0
|
34
|
m@0
|
35 (defgeneric time+ (object1 object2))
|
m@0
|
36 (defgeneric time- (object1 object2))
|
m@0
|
37
|
m@0
|
38 (defgeneric time> (object1 object2))
|
m@0
|
39 (defgeneric time< (object1 object2))
|
m@0
|
40 (defgeneric time>= (object1 object2))
|
m@0
|
41 (defgeneric time<= (object1 object2))
|
m@0
|
42 (defgeneric time= (object1 object2))
|
m@0
|
43 (defgeneric time/= (object1 object2))
|
m@0
|
44
|
m@0
|
45 ;;; Duration protocol
|
m@0
|
46
|
m@0
|
47 (defgeneric duration> (object1 object2))
|
m@0
|
48 (defgeneric duration< (object1 object2))
|
m@0
|
49 (defgeneric duration>= (object1 object2))
|
m@0
|
50 (defgeneric duration<= (object1 object2))
|
m@0
|
51 (defgeneric duration= (object1 object2))
|
m@0
|
52 (defgeneric duration/= (object1 object2))
|
m@0
|
53
|
m@0
|
54
|
m@0
|
55 ;;; Pitch protocol
|
m@0
|
56
|
m@0
|
57 ;; pitch+: <pitch> <pitch> -> <pitch>
|
m@0
|
58 ;; <pitch> <interval> -> <pitch>
|
m@0
|
59 ;; <interval> <pitch> -> <pitch> (same as previous?)
|
m@0
|
60 ;; <interval> <interval> -> <interval> (or a distinct interval+?)
|
m@0
|
61 ;;
|
m@0
|
62 ;; pitch-: <pitch> <pitch> -> <interval>
|
m@0
|
63 ;; <pitch> <interval> -> <pitch>
|
m@0
|
64 ;; <interval> <interval> -> <interval> (or a distinct interval-?
|
m@0
|
65 ;; <interval> <pitch> -> ERROR?
|
m@0
|
66
|
m@0
|
67 (defgeneric pitch+ (object1 object2))
|
m@0
|
68 (defgeneric pitch- (object1 object2))
|
m@0
|
69
|
m@0
|
70 (defgeneric pitch> (object1 object2))
|
m@0
|
71 (defgeneric pitch< (object1 object2))
|
m@0
|
72 (defgeneric pitch>= (object1 object2))
|
m@0
|
73 (defgeneric pitch<= (object1 object2))
|
m@0
|
74 (defgeneric pitch= (object1 object2))
|
m@0
|
75 (defgeneric pitch/= (object1 object2))
|
m@0
|
76
|
m@0
|
77 ;;; Interval protocol (emphasise _pitch_ not _time_ interval?)
|
m@0
|
78
|
m@0
|
79 (defgeneric interval> (object1 object2))
|
m@0
|
80 (defgeneric interval< (object1 object2))
|
m@0
|
81 (defgeneric interval>= (object1 object2))
|
m@0
|
82 (defgeneric interval<= (object1 object2))
|
m@0
|
83 (defgeneric interval= (object1 object2))
|
m@0
|
84 (defgeneric interval/= (object1 object2))
|
m@0
|
85
|
m@0
|
86 ;;; Time Signature
|
m@0
|
87 ;;; Tempo
|
m@0
|
88 ;;; Tonality (Key Signature / Mode)
|
m@0
|
89 ;;; Dynamics
|
m@0
|
90 ;;; Voice
|
m@0
|
91 ;;; Boundary Strength (phrasing)
|