annotate constructors.lisp @ 22:99ccd775245a

Moved midi out of main files darcs-hash:20061214125711-f76cc-c9e7f9af1054c67473ff6d8a8e3b84e45fe43f35.gz
author David Lewis <d.lewis@gold.ac.uk>
date Thu, 14 Dec 2006 12:57:11 +0000
parents 2f331bbdfab8
children
rev   line source
d@17 1 (cl:in-package #:amuse)
d@17 2
d@17 3 ;; Time classes
d@17 4
d@17 5 (defun make-moment (time)
d@17 6 (make-instance 'moment :time time))
d@17 7
d@17 8 ;; N.B. period should never be constructed directly - it's either
d@17 9 ;; floating or anchored or some other subclass.
d@17 10
d@17 11 (defun make-floating-period (interval)
d@17 12 (make-instance 'floating-period :interval interval))
d@17 13
d@17 14 (defun make-anchored-period (onset interval)
d@17 15 (make-instance 'anchored-period
d@17 16 :time onset
d@17 17 :interval interval))
d@17 18
d@17 19 ;; Pitch classes (no, not that sort of pitch class)
d@17 20
d@17 21 (defun make-chromatic-pitch (pitch-number)
d@17 22 (make-instance 'chromatic-pitch :number pitch-number))
d@17 23
d@17 24 (defun make-diatonic-pitch (name accidental octave)
d@17 25 (make-instance 'diatonic-pitch
d@17 26 :name name
d@17 27 :accidental accidental
d@17 28 :octave octave))
d@17 29
d@17 30 (defun make-pitch-interval (span)
d@17 31 (make-instance 'pitch-interval :span span))
d@17 32
d@18 33 ;; Events
d@18 34
d@19 35 (defun make-chromatic-pitched-event (pitch-number onset duration)
d@19 36 (make-instance 'chromatic-pitched-event
d@19 37 :number pitch-number
d@19 38 :time onset
d@19 39 :interval duration))
d@19 40
d@19 41 (defun make-basic-time-signature (numerator denominator onset duration)
d@19 42 (make-instance 'basic-time-signature
d@19 43 :numerator numerator
d@19 44 :denominator denominator
d@19 45 :time onset
d@19 46 :interval duration))
d@19 47
d@19 48 (defun make-basic-key-signature (sharp-count onset duration)
d@19 49 (make-instance 'basic-key-signature
d@19 50 :sharp-count sharp-count
d@19 51 :time onset
d@19 52 :interval duration))
d@19 53
d@19 54 (defun make-tempo (bpm onset duration)
d@19 55 (make-instance 'tempo
d@19 56 :bpm bpm
d@19 57 :time onset
d@19 58 :interval duration))