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: d@147: (defclass identifier (amuse-object) () d@147: (:documentation "Base class to allow specification of d@147: composition to get. Must be subclassed.")) d@147: d@136: (defclass moment (amuse-object) () d@100: (:documentation "Object indicating a point in time")) d@136: (defclass period (amuse-object) () d@100: (:documentation "Object indicating a region of time")) d@136: (defclass anchored-period (moment period) () d@100: (:documentation "Object indicating a region of time starting at d@100: a specific point in time")) d@136: (defclass pitch (amuse-object) () d@100: (:documentation "Object indicating some sort of pitch")) d@136: (defclass pitch-interval (amuse-object) () d@100: (:documentation "Object indicating a distance in pitch space")) m@24: m@24: ;; time-related classes m@24: d@136: (defclass standard-moment (moment) d@100: ((time :accessor %moment-time :initarg :time)) d@136: (:documentation "A moment that has time represented on a d@136: continuous, progressive number line")) m@24: d@136: (defclass standard-period (period) d@100: ((interval :accessor %period-interval :initarg :interval)) d@136: (:documentation "A period that places time intervals d@136: on a progressive number-line")) m@24: d@136: (defclass standard-anchored-period (standard-period standard-moment anchored-period) () d@100: (:documentation "Number-line-based anchored period")) m@24: m@24: ;; pitch-related classes m@24: d@136: (defclass frequency-pitch (pitch) ()) m@24: 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: d@136: (defclass chromatic-pitch-interval (pitch-interval) d@138: ((span :accessor %chromatic-pitch-interval-span :initarg :span)) d@138: (:documentation "An interval represented as a number, recording d@138: the number of ascending chromatic pitches between two pitches.")) c@111: d@136: (defclass diatonic-pitch-interval (pitch-interval) d@138: ((span :accessor %diatonic-pitch-interval-span :initarg :span :reader span)) d@138: (:documentation "How is this inplemented?")) m@24: m@24: ;; events m@24: d@122: (defclass event (anchored-period) () d@122: (:documentation "Notelike object")) d@136: (defclass pitched-event (event pitch) () d@136: (:documentation "Event with pitch information")) d@136: (defclass standard-pitched-event (pitched-event d@136: standard-anchored-period) () 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@136: (defclass standard-chromatic-pitched-event (chromatic-pitched-event d@136: standard-anchored-period) () d@136: (:documentation "Event with chromatic pitch information and d@136: standard-period")) d@122: (defclass percussive-event (event) () d@134: (:documentation "Unpitched percussion Event. There's an issue d@134: with this name - is there a reason why this is unpitched d@134: necessarily, or why I'm not counting piano, etc in this? Perhaps d@136: what I mean is that it should be renamed unpitched-event? d@136: Actually, is this necessary? Isn't this just an event?")) d@136: (defclass standard-percussive-event (event standard-anchored-period) () d@136: (:documentation "Unpitched percussion Event. There's an issue d@136: with this name - is there a reason why this is unpitched d@136: necessarily, or why I'm not counting piano, etc in this? Perhaps d@136: what I mean is that it should be renamed unpitched-event? d@138: Actually, is this necessary? Isn't this just an event? d@138: Timbral/instrumental information will be generalised later but is d@138: less agreed-on than pitch.")) 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@136: (defclass time-signature (amuse-object) () d@136: (:documentation "Abstract class for time signature")) m@24: d@136: (defclass time-signature-period (time-signature anchored-period) () d@136: (:documentation "Abstract class for time signatures in time")) d@136: d@136: (defclass standard-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@136: (defclass standard-time-signature-period (standard-time-signature d@136: time-signature-period d@136: standard-anchored-period) d@136: () d@136: (:documentation "STANDARD-TIME-SIGNATURE on a time number line")) d@136: d@136: (defclass key-signature (amuse-object) () d@123: (:documentation "Base class for key signature")) m@24: d@136: (defclass key-signature-period (key-signature anchored-period) () d@136: (:documentation "Abstract class for time signatures in time")) d@136: d@136: (defclass standard-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: d@136: (defclass standard-key-signature-period (standard-key-signature d@136: key-signature-period d@136: standard-anchored-period) d@136: () d@136: (:documentation "STANDARD-KEY-SIGNATURE on a time number line")) d@136: d@136: (defclass midi-key-signature (standard-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: d@136: (defclass midi-key-signature-period (standard-key-signature-period d@136: midi-key-signature) d@136: () d@136: (:documentation "MIDI-KEY-SIGNATURE on a time number line")) d@136: d@136: (defclass tempo (amuse-object) () d@136: (:documentation "Abstract class for tempo")) d@136: (defclass tempo-period (tempo anchored-period) () d@136: (:documentation "Abstract class for tempo associated with a d@136: time period")) d@136: (defclass standard-tempo (tempo) 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.")) d@136: (defclass standard-tempo-period (standard-tempo d@136: tempo-period d@136: standard-anchored-period) d@136: () d@136: (:documentation "Tempo associated with a standard-anchored-period")) m@40: m@124: ;; collections of more than one event m@124: d@147: (defclass constituent (anchored-period) () d@147: (:documentation "Base class for constituents")) d@147: (defclass standard-constituent (constituent standard-anchored-period) () d@147: (:documentation "Base class for constituents using standard d@147: time representation")) 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: ()) d@136: (defclass standard-time-ordered-constituent (time-ordered-constituent d@136: standard-constituent d@136: list-slot-sequence) d@136: ;; this won't work if lisp implementation doesn't support extensible d@136: ;; sequences. d@136: ()) d@147: (defclass composition (time-ordered-constituent) () d@147: (:documentation "Base class for compositions")) d@136: (defclass standard-composition (composition d@147: standard-time-ordered-constituent) () d@147: (:documentation "Base class for compositions using standard d@147: time representation")) d@147: (defclass monody (composition) () d@147: (:documentation "Class for indicating suitability for analysis d@147: requiring a monody")) m@143: (defclass standard-monody (monody standard-composition) ())