Mercurial > hg > amuse
view base/classes.lisp @ 48:cace0cf82aee
make basic-time-signature a subclass of time-signature
darcs-hash:20070615122018-aa3d6-eaed6e10f34a7de1aa4af1bb3f57b3c4d29d09ad.gz
author | m.pearce <m.pearce@gold.ac.uk> |
---|---|
date | Fri, 15 Jun 2007 13:20:18 +0100 |
parents | 085c1728480c |
children | f308c2b7b796 |
line wrap: on
line source
(cl:in-package #:amuse) ;; collections of more than one event (defclass constituent (anchored-period) ()) (defclass time-ordered-constituent (constituent list-slot-sequence) ;; this won't work if lisp implementation doesn't support extensible ;; sequences. ()) (defclass composition (time-ordered-constituent) ()) (defclass monody (time-ordered-constituent) ()) ;; types of information-specifiers (defclass identifier () ()) ;; for composition specification (defclass moment-designator () ()) (defclass period-designator () ()) (defclass anchored-period-designator (moment-designator period-designator) ()) (defclass pitch-designator () ()) (defclass pitch-interval-designator () ()) ;; time-related classes (defclass moment (moment-designator) ((time :accessor %moment-time :initarg :time))) (defclass period (period-designator) ((interval :accessor %period-interval :initarg :interval))) (defclass floating-period (period) ()) (defclass anchored-period (period moment anchored-period-designator) ()) ;; pitch-related classes (defclass frequency () ()) (defclass pitch (pitch-designator) ()) (defclass chromatic-pitch (pitch) ((number :accessor %chromatic-pitch-number :initarg :number))) (defclass diatonic-pitch (pitch) ((name :accessor %diatonic-pitch-name :initarg :name) (accidental :accessor %diatonic-pitch-accidental :initarg :accidental) (octave :accessor %diatonic-pitch-octave :initarg :octave))) (defclass pitch-interval (pitch-interval-designator) ((span :accessor %pitch-interval-span :initarg :span))) ;; events (defclass event (anchored-period) ()) (defclass pitched-event (event pitch-designator) ()) (defclass chromatic-pitched-event (pitched-event chromatic-pitch) ()) (defclass percussive-event (event) ()) ;;; Range-based `constituents' ;; Whilst these are all constituents in the CHARM sense, their ;; properties apply to a timed range rather than to a set of ;; events. As such, they can be regarded as anchored-periods with ;; properties. (defclass time-signature (anchored-period) ()) (defclass basic-time-signature (time-signature) ;; N.B. Can only deal with numeric signatures ((numerator :accessor %basic-time-signature-numerator :initarg :numerator) (denominator :accessor %basic-time-signature-denominator :initarg :denominator))) (defclass key-signature (anchored-period) ()) (defclass basic-key-signature (key-signature) ;; Only has line-of-fifths distance from c, so custom signatures ;; won't work ((sharp-count :accessor %basic-key-signature-sharp-count :initarg :sharp-count))) (defclass midi-key-signature (basic-key-signature) ;; Is mode ever used in real life? Is it ever accurately used in ;; real life? ((mode :accessor %midi-key-signature-mode :initarg :mode))) (defclass tempo (anchored-period) ;; accel and rit in symbolic encoding will need other structures, as ;; will textual tempo markings. ((bpm :accessor %tempo-bpm :initarg :bpm)))