Mercurial > hg > amuse
view classes.lisp @ 19:2f331bbdfab8
Added preliminary support for time- and key-signatures and for tempi
darcs-hash:20061213155334-f76cc-a1ece6adfd1e6292e1f67418ddb3f38a56ad2233.gz
author | David Lewis <d.lewis@gold.ac.uk> |
---|---|
date | Wed, 13 Dec 2006 15:53:34 +0000 |
parents | 70e76c1c87b7 |
children | 99ccd775245a |
line wrap: on
line source
(cl:in-package #:amuse) ;; collections of more than one event (defclass constituent () ()) (defclass composition (constituent) ()) (defclass monody (constituent) ()) ;; types of information-specifiers (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))) (defclass midi-message () ;? ((channel :accessor %midi-message-channel :initarg :channel) (track :accessor %midi-message-track :initarg :track))) ;; events (defclass event (anchored-period) ()) (defclass pitched-event (event pitch-designator) ()) (defclass chromatic-pitched-event (pitched-event chromatic-pitch) ()) (defclass midi-pitched-event (chromatic-pitched-event midi-message) ((velocity :initarg :velocity) (patch :initarg :patch))) (defclass percussive-event (event) ()) (defclass midi-percussive-event (percussive-event midi-message) ((velocity :initarg :velocity) (patch :initarg :patch) (sound :initarg :sound))) ;;; 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 (anchored-period) ;; 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)))