j@190: (cl:in-package #:amuse) j@190: j@190: ;; top-level amuse object j@190: j@190: (defclass amuse-object () ()) j@190: j@190: ;; types of information-specifiers j@190: j@190: (defclass identifier (amuse-object) () j@190: (:documentation "DEPRECATED: Base class to allow specification of j@288: composition to get. Must be subclassed.")) ; FIXME: Why deprecated? j@190: j@190: (defclass constituent-identifier (identifier) () j@288: (:documentation "Base class to allow specification of j@288: constituents")) j@288: j@190: (defclass composition-identifier (constituent-identifier) () j@288: (:documentation "Base class to allow specification of j@288: compositions constituents")) j@288: j@288: (defclass event-identifier (identifier) () j@288: (:documentation "Base class to allow specification of events.")) j@190: j@190: (defclass moment (amuse-object) () j@190: (:documentation "Object indicating a point in time")) j@190: (defclass period (amuse-object) () j@190: (:documentation "Object indicating a region of time")) j@190: (defclass anchored-period (moment period) () j@190: (:documentation "Object indicating a region of time starting at j@190: a specific point in time")) j@190: (defclass pitch (amuse-object) () j@190: (:documentation "Object indicating some sort of pitch")) j@190: (defclass pitch-interval (amuse-object) () j@190: (:documentation "Object indicating a distance in pitch space")) j@190: j@190: ;; time-related classes j@190: j@190: (defclass standard-moment (moment) j@190: ((time :accessor %moment-time :initarg :time)) j@190: (:documentation "A moment that has time represented on a j@190: continuous, progressive number line")) j@190: j@190: (defclass standard-period (period) j@190: ((interval :accessor %period-interval :initarg :interval)) j@190: (:documentation "A period that places time intervals j@190: on a progressive number-line")) j@190: j@190: (defclass standard-anchored-period (standard-period standard-moment anchored-period) () j@190: (:documentation "Number-line-based anchored period")) j@190: j@190: ;; pitch-related classes j@190: j@190: (defclass frequency-pitch (pitch) ()) j@190: j@190: (defclass chromatic-pitch (pitch) j@296: ((number :accessor %chromatic-pitch-number j@296: :reader chromatic-pitch-number :initarg :number)) j@296: (:documentation "A pitch represented as a number, with chromatic j@296: pitches having distinct values. FIXME: We should not be using the cl j@296: symbol NUMBER.")) j@296: j@190: (defclass diatonic-pitch (pitch) j@190: ((cp :initarg :cp :accessor %p-pc :reader diatonic-pitch-cp) j@190: (mp :initarg :mp :accessor %p-pm :reader diatonic-pitch-mp)) j@190: (:documentation "A diatonic pitch, represented using MIPS: cp is an j@190: integer representing chromatic pitch (An0 = 0, middle C = 39); mp is j@190: an integer representing the morphetic pitch (An0 = 0, middle C = j@190: 23).")) j@190: j@190: (defclass chromatic-pitch-interval (pitch-interval) j@190: ((span :accessor %chromatic-pitch-interval-span :initarg :span)) j@190: (:documentation "An interval represented as a number, recording j@190: the number of ascending chromatic pitches between two pitches.")) j@190: j@190: (defclass diatonic-pitch-interval (pitch-interval) j@190: ((span :accessor %diatonic-pitch-interval-span :initarg :span :reader span)) j@190: (:documentation "How is this inplemented?")) j@190: j@190: ;; events j@190: j@190: (defclass event (anchored-period) () j@190: (:documentation "Notelike object")) j@311: j@297: (defclass linked-event (amuse-object) j@297: ((composition :reader composition j@297: :writer %set-composition j@297: :initarg :composition)) j@306: (:documentation "This provides a composition slot for events. The j@306: generic function initialize-instance can be specialized on an j@306: implementation composition to assign the event slots when a j@306: composition instance is created. Or the slot can be assigned within j@306: the composition constructor function. FIXME: Not sure about this - j@306: was there a good reason why events should not know the composition j@306: they belong to? MTP-events have a slot for composition-id (an j@306: integer number), but here the slot is intended to be assigned the j@306: composition object itself. Doing this means that potentially some j@306: generic functions could loose the extra composition parameter. I j@306: made this change because of SIA projection related stuff, the only j@306: function that relies on it in amuse is find-next-event. JF")) j@306: j@190: (defclass pitched-event (event pitch) () j@190: (:documentation "Event with pitch information")) j@311: j@190: (defclass standard-pitched-event (pitched-event j@190: standard-anchored-period) () j@190: (:documentation "Event with pitch information")) j@311: j@190: (defclass chromatic-pitched-event (pitched-event chromatic-pitch) () j@190: (:documentation "Event with chromatic pitch information")) j@311: j@190: (defclass standard-chromatic-pitched-event (chromatic-pitched-event j@190: standard-anchored-period) () j@190: (:documentation "Event with chromatic pitch information and j@190: standard-period")) j@311: j@283: (defclass diatonic-pitched-event (pitched-event diatonic-pitch) () j@283: (:documentation "Event with diatonic pitch information")) j@311: j@283: (defclass standard-diatonic-pitched-event (diatonic-pitched-event j@283: standard-anchored-period) () j@283: (:documentation "Event with diatonic pitch information and j@283: standard-period")) j@311: j@190: (defclass percussive-event (event) () j@190: (:documentation "Unpitched percussion Event. There's an issue j@190: with this name - is there a reason why this is unpitched j@190: necessarily, or why I'm not counting piano, etc in this? Perhaps j@190: what I mean is that it should be renamed unpitched-event? j@190: Actually, is this necessary? Isn't this just an event?")) j@311: j@190: (defclass standard-percussive-event (event standard-anchored-period) () j@190: (:documentation "Unpitched percussion Event. There's an issue j@190: with this name - is there a reason why this is unpitched j@190: necessarily, or why I'm not counting piano, etc in this? Perhaps j@190: what I mean is that it should be renamed unpitched-event? j@190: Actually, is this necessary? Isn't this just an event? j@190: Timbral/instrumental information will be generalised later but is j@190: less agreed-on than pitch.")) j@190: j@190: ;;; Range-based `constituents' j@190: ;; Whilst these are all constituents in the CHARM sense, their j@190: ;; properties apply to a timed range rather than to a set of j@190: ;; events. As such, they can be regarded as anchored-periods with j@190: ;; properties. j@190: j@190: (defclass time-signature (amuse-object) () j@190: (:documentation "Abstract class for time signature")) j@190: j@190: (defclass time-signature-period (time-signature anchored-period) () j@190: (:documentation "Abstract class for time signatures in time")) j@190: j@190: (defclass standard-time-signature (time-signature) j@190: ((numerator :accessor %basic-time-signature-numerator j@190: :initarg :numerator) j@190: (denominator :accessor %basic-time-signature-denominator j@190: :initarg :denominator)) j@190: (:documentation "Class with slots for numerator and j@190: denominator. Can only deal with numeric signatures.")) j@190: j@190: (defclass standard-time-signature-period (standard-time-signature j@190: time-signature-period j@190: standard-anchored-period) j@190: () j@190: (:documentation "STANDARD-TIME-SIGNATURE on a time number line")) j@190: j@190: (defclass key-signature (amuse-object) () j@190: (:documentation "Base class for key signature")) j@190: j@190: (defclass key-signature-period (key-signature anchored-period) () j@190: (:documentation "Abstract class for time signatures in time")) j@190: j@190: (defclass standard-key-signature (key-signature) j@190: ((sharp-count :accessor %basic-key-signature-sharp-count j@190: :initarg :sharp-count)) j@190: (:documentation "Simple class - Only has line-of-fifths j@190: distance from c, so custom signatures won't work")) j@190: j@190: (defclass standard-key-signature-period (standard-key-signature j@190: key-signature-period j@190: standard-anchored-period) j@190: () j@190: (:documentation "STANDARD-KEY-SIGNATURE on a time number line")) j@190: j@190: (defclass midi-key-signature (standard-key-signature) j@190: ((mode :accessor %midi-key-signature-mode j@190: :initarg :mode)) j@190: (:documentation "MIDI-based flavour of basic key signature, j@190: adding a slot for mode: 0 = major key; 1 = minor key")) j@190: j@190: (defclass midi-key-signature-period (standard-key-signature-period j@190: midi-key-signature) j@190: () j@190: (:documentation "MIDI-KEY-SIGNATURE on a time number line")) j@190: j@190: (defclass tempo (amuse-object) () j@190: (:documentation "Abstract class for tempo")) j@190: (defclass tempo-period (tempo anchored-period) () j@190: (:documentation "Abstract class for tempo associated with a j@190: time period")) j@190: (defclass standard-tempo (tempo) j@190: ((bpm :accessor %tempo-bpm j@190: :initarg :bpm)) j@190: (:documentation "Rather literal reading of absolute tempo. j@190: accel and rit in symbolic encoding will need other structures, j@190: as will textual tempo markings.")) j@190: (defclass standard-tempo-period (standard-tempo j@190: tempo-period j@190: standard-anchored-period) j@190: () j@190: (:documentation "Tempo associated with a standard-anchored-period")) j@319: j@319: j@319: ;;;===================================================================== j@319: ;;; Constituents: collections of more than one event j@319: ;;;===================================================================== j@190: j@190: (defclass constituent (anchored-period) () j@190: (:documentation "Base class for constituents")) j@311: j@190: (defclass standard-constituent (constituent standard-anchored-period) () j@190: (:documentation "Base class for constituents using standard j@190: time representation")) j@190: j@190: (defclass time-ordered-constituent (constituent list-slot-sequence) j@190: ;; this won't work if lisp implementation doesn't support extensible j@190: ;; sequences. j@190: ()) j@311: j@190: (defclass standard-time-ordered-constituent (time-ordered-constituent j@311: standard-constituent) j@190: ;; this won't work if lisp implementation doesn't support extensible j@190: ;; sequences. j@190: ()) j@190: j@190: (defclass composition (time-ordered-constituent) () j@190: (:documentation "Base class for compositions")) j@190: j@190: (defclass standard-composition (composition j@190: standard-time-ordered-constituent) () j@190: (:documentation "Base class for compositions using standard j@190: time representation")) j@311: j@190: (defclass monody (composition) () j@190: (:documentation "Class for indicating suitability for analysis j@190: requiring a monody")) j@311: j@190: (defclass standard-monody (monody standard-composition) ()) j@190: j@319: ;; Floating Constituents j@319: j@319: (defclass floating-constituent (period) () j@319: (:documentation "Base class for non-anchored constituents")) j@319: j@319: (defclass standard-floating-constituent (floating-constituent j@319: standard-period) () j@319: (:documentation "Base class for floating constituents using standard j@319: time representation")) j@319: j@319: (defclass time-ordered-floating-constituent (floating-constituent j@319: list-slot-sequence) j@319: ;; this won't work if lisp implementation doesn't support extensible j@319: ;; sequences. j@319: ()) j@319: j@319: (defclass standard-time-ordered-floating-constituent j@319: (time-ordered-floating-constituent standard-floating-constituent) j@319: ;; this won't work if lisp implementation doesn't support extensible j@319: ;; sequences. j@319: ()) j@319: io901tp@323: ;;; Simultaneities are constituents whose particles have an overlapping time period. io901tp@323: (defclass simultaneity (constituent) io901tp@323: ((particles :initarg :particles :accessor %particles io901tp@323: :documentation "particles")) io901tp@323: (:documentation "Class for simultaneity constituent. A simultaneity is a constituent which is formed of particles that have an intersecting time period.")) io901tp@323: j@190: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; j@190: ;; j@190: ;; Experimental: j@190: ;; j@190: j@190: (defclass clef (amuse-object) () j@190: (:documentation "Abstract class for clef implementations")) j@190: j@190: (defclass clef-period (clef anchored-period) () j@190: (:documentation "Abstract class for clef implementations in time")) j@190: j@190: (defclass standard-clef (clef) j@190: ((type :accessor %standard-clef-type j@190: :initarg :type) j@190: (line :accessor %standard-clef-line j@190: :initarg :line) j@190: (octave-shift :accessor %standard-clef-octave-shift j@190: :initarg :octave-shift j@190: :initform nil)) j@190: (:documentation "Class of clef with slots for type (a keyword j@190: from :F, :G and :C, probably), line (counting from the lowest line = j@190: 1) and octave shift (nil or a positive or negative integer j@190: representing transposition up or down")) j@190: j@190: (defclass standard-clef-period (standard-clef clef-period standard-anchored-period) j@190: () j@190: (:documentation "Standard clef on a timeline"))