annotate base/classes.lisp @ 24:8d2b1662f658

base/*.lisp: move files in amuse-base to subdirectory. darcs-hash:20061215161617-aa3d6-1b63bd555b02ec02aa2db12d335e8b726e2108cd.gz
author m.pearce <m.pearce@gold.ac.uk>
date Fri, 15 Dec 2006 16:16:17 +0000
parents
children d1010755f507
rev   line source
m@24 1 (cl:in-package #:amuse)
m@24 2
m@24 3 ;; collections of more than one event
m@24 4
m@24 5 (defclass constituent () ())
m@24 6 (defclass composition (constituent) ())
m@24 7 (defclass monody (constituent) ())
m@24 8
m@24 9 ;; types of information-specifiers
m@24 10
m@24 11 (defclass moment-designator () ())
m@24 12 (defclass period-designator () ())
m@24 13 (defclass anchored-period-designator (moment-designator period-designator) ())
m@24 14 (defclass pitch-designator () ())
m@24 15 (defclass pitch-interval-designator () ())
m@24 16
m@24 17 ;; time-related classes
m@24 18
m@24 19 (defclass moment (moment-designator)
m@24 20 ((time :accessor %moment-time :initarg :time)))
m@24 21
m@24 22 (defclass period (period-designator)
m@24 23 ((interval :accessor %period-interval :initarg :interval)))
m@24 24
m@24 25 (defclass floating-period (period) ())
m@24 26 (defclass anchored-period (period moment anchored-period-designator) ())
m@24 27
m@24 28 ;; pitch-related classes
m@24 29
m@24 30 (defclass frequency () ())
m@24 31
m@24 32 (defclass pitch (pitch-designator) ())
m@24 33 (defclass chromatic-pitch (pitch)
m@24 34 ((number :accessor %chromatic-pitch-number :initarg :number)))
m@24 35 (defclass diatonic-pitch (pitch)
m@24 36 ((name :accessor %diatonic-pitch-name :initarg :name)
m@24 37 (accidental :accessor %diatonic-pitch-accidental :initarg :accidental)
m@24 38 (octave :accessor %diatonic-pitch-octave :initarg :octave)))
m@24 39
m@24 40 (defclass pitch-interval (pitch-interval-designator)
m@24 41 ((span :accessor %pitch-interval-span :initarg :span)))
m@24 42
m@24 43 ;; events
m@24 44
m@24 45 (defclass event (anchored-period) ())
m@24 46 (defclass pitched-event (event pitch-designator) ())
m@24 47 (defclass chromatic-pitched-event (pitched-event chromatic-pitch) ())
m@24 48 (defclass percussive-event (event) ())
m@24 49
m@24 50 ;;; Range-based `constituents'
m@24 51 ;; Whilst these are all constituents in the CHARM sense, their
m@24 52 ;; properties apply to a timed range rather than to a set of
m@24 53 ;; events. As such, they can be regarded as anchored-periods with
m@24 54 ;; properties.
m@24 55
m@24 56 (defclass time-signature (anchored-period) ())
m@24 57
m@24 58 (defclass basic-time-signature (anchored-period)
m@24 59 ;; N.B. Can only deal with numeric signatures
m@24 60 ((numerator :accessor %basic-time-signature-numerator
m@24 61 :initarg :numerator)
m@24 62 (denominator :accessor %basic-time-signature-denominator
m@24 63 :initarg :denominator)))
m@24 64
m@24 65 (defclass key-signature (anchored-period) ())
m@24 66
m@24 67 (defclass basic-key-signature (key-signature)
m@24 68 ;; Only has line-of-fifths distance from c, so custom signatures
m@24 69 ;; won't work
m@24 70 ((sharp-count :accessor %basic-key-signature-sharp-count
m@24 71 :initarg sharp-count)))
m@24 72
m@24 73 (defclass tempo (anchored-period)
m@24 74 ;; accel and rit in symbolic encoding will need other structures, as
m@24 75 ;; will textual tempo markings.
m@24 76 ((bpm :accessor %tempo-bpm
m@24 77 :initarg :bpm)))
m@24 78