m@24: (cl:in-package #:amuse) m@24: m@124: ;; top-level amuse object m@24: m@125: (defclass amuse-object () ()) m@24: m@24: ;; types of information-specifiers m@24: m@125: (defclass identifier (amuse-object) ()) ;; for composition specification m@125: (defclass moment-designator (amuse-object) () d@100: (:documentation "Object indicating a point in time")) m@124: (defclass period-designator (amuse-object) () d@100: (:documentation "Object indicating a region of time")) d@100: (defclass anchored-period-designator (moment-designator period-designator) () d@100: (:documentation "Object indicating a region of time starting at d@100: a specific point in time")) m@124: (defclass pitch-designator (amuse-object) () d@100: (:documentation "Object indicating some sort of pitch")) m@124: (defclass pitch-interval-designator (amuse-object) () d@100: (:documentation "Object indicating a distance in pitch space")) m@24: m@24: ;; time-related classes m@24: m@24: (defclass moment (moment-designator) d@100: ((time :accessor %moment-time :initarg :time)) d@100: (:documentation "A moment represented on a number line")) m@24: m@24: (defclass period (period-designator) d@100: ((interval :accessor %period-interval :initarg :interval)) d@100: (:documentation "A number-line-based period")) m@24: d@100: (defclass floating-period (period) () d@100: (:documentation "A simple numeric period")) d@100: (defclass anchored-period (period moment anchored-period-designator) () d@100: (:documentation "Number-line-based anchored period")) m@24: m@24: ;; pitch-related classes m@24: m@24: (defclass frequency () ()) m@24: m@24: (defclass pitch (pitch-designator) ()) m@24: (defclass chromatic-pitch (pitch) d@100: ((number :accessor %chromatic-pitch-number :initarg :number)) d@123: (:documentation "A pitch represented as a number, with d@123: chromatic pitches having distinct values.")) c@109: (defclass diatonic-pitch (pitch) c@108: ((cp :initarg :cp :accessor %p-pc :reader diatonic-pitch-cp) c@108: (mp :initarg :mp :accessor %p-pm :reader diatonic-pitch-mp)) c@109: (:documentation "A diatonic pitch, represented using MIPS: cp is an c@109: integer representing chromatic pitch (An0 = 0, middle C = 39); mp is c@109: an integer representing the morphetic pitch (An0 = 0, middle C = c@109: 23).")) m@81: c@111: (defclass chromatic-pitch-interval (pitch-interval-designator) c@111: ((span :accessor %chromatic-pitch-interval-span :initarg :span))) c@111: c@111: (defclass diatonic-pitch-interval (pitch-interval-designator) c@111: ((span :accessor %diatonic-pitch-interval-span :initarg :span :reader span))) m@24: m@24: ;; events m@24: d@122: (defclass event (anchored-period) () d@122: (:documentation "Notelike object")) d@122: (defclass pitched-event (event pitch-designator) () d@122: (:documentation "Event with pitch information")) d@122: (defclass chromatic-pitched-event (pitched-event chromatic-pitch) () d@122: (:documentation "Event with chromatic pitch information")) d@122: (defclass percussive-event (event) () d@122: (:documentation "Unpitched percussion Event. Is there a reason why d@122: this is unpitched necessarily, or why I'm not counting piano, etc in d@122: this? Perhaps what I mean is that it should be renamed?")) m@24: m@24: ;;; Range-based `constituents' m@24: ;; Whilst these are all constituents in the CHARM sense, their m@24: ;; properties apply to a timed range rather than to a set of m@24: ;; events. As such, they can be regarded as anchored-periods with m@24: ;; properties. m@24: d@123: (defclass time-signature (anchored-period) () d@123: (:documentation "Base class for time signature")) m@24: m@48: (defclass basic-time-signature (time-signature) m@24: ((numerator :accessor %basic-time-signature-numerator m@24: :initarg :numerator) m@24: (denominator :accessor %basic-time-signature-denominator d@123: :initarg :denominator)) d@123: (:documentation "Class with slots for numerator and d@123: denominator. Can only deal with numeric signatures.")) m@24: d@123: (defclass key-signature (anchored-period) () d@123: (:documentation "Base class for key signature")) m@24: m@24: (defclass basic-key-signature (key-signature) m@24: ((sharp-count :accessor %basic-key-signature-sharp-count d@123: :initarg :sharp-count)) d@123: (:documentation "Simple class - Only has line-of-fifths d@123: distance from c, so custom signatures won't work")) m@24: m@40: (defclass midi-key-signature (basic-key-signature) m@40: ((mode :accessor %midi-key-signature-mode d@123: :initarg :mode)) d@123: (:documentation "MIDI-based flavour of basic key signature, d@123: adding a slot for mode: 0 = major key; 1 = minor key")) m@40: m@24: (defclass tempo (anchored-period) m@24: ((bpm :accessor %tempo-bpm d@123: :initarg :bpm)) d@123: (:documentation "Rather literal reading of absolute tempo. d@123: accel and rit in symbolic encoding will need other structures, d@123: as will textual tempo markings.")) m@40: m@124: ;; collections of more than one event m@124: m@124: (defclass constituent (anchored-period) ()) m@124: (defclass time-ordered-constituent (constituent list-slot-sequence) m@124: ;; this won't work if lisp implementation doesn't support extensible m@124: ;; sequences. m@124: ()) m@124: (defclass composition (time-ordered-constituent) ()) m@124: (defclass monody (composition) ()) m@125: