view base/constructors.lisp @ 33:d1010755f507

Large upload of local changes. Many additions, such as harmony and piece-level objects darcs-hash:20070413100909-f76cc-a8aa8dfc07f438dc0c1a7c45cee7ace2ecc1e6a5.gz
author David Lewis <d.lewis@gold.ac.uk>
date Fri, 13 Apr 2007 11:09:09 +0100
parents 8d2b1662f658
children 5bec705db9d6
line wrap: on
line source
(cl:in-package #:amuse)

;; Time classes

(defun make-moment (time)
  (make-instance 'moment :time time))

;; N.B. period should never be constructed directly - it's either
;; floating or anchored or some other subclass.

(defun make-floating-period (interval)
  (make-instance 'floating-period :interval interval))


;; Should this take a moment and/or a period too?
(defun make-anchored-period (onset interval)
  (make-instance 'anchored-period
		 :time onset
		 :interval interval))

;; Pitch classes (no, not that sort of pitch class)

(defun make-chromatic-pitch (pitch-number)
  (make-instance 'chromatic-pitch :number pitch-number))

(defun make-diatonic-pitch (name accidental octave)
  (make-instance 'diatonic-pitch
		 :name name
		 :accidental accidental
		 :octave octave))

(defun make-pitch-interval (span)
  (make-instance 'pitch-interval :span span))

;; Events

(defun make-chromatic-pitched-event (pitch-number onset duration)
  (make-instance 'chromatic-pitched-event
		 :number pitch-number
		 :time onset
		 :interval duration))

(defun make-basic-time-signature (numerator denominator onset duration)
  (make-instance 'basic-time-signature
		 :numerator numerator
		 :denominator denominator
		 :time onset
		 :interval duration))

(defun make-basic-key-signature (sharp-count onset duration)
  (make-instance 'basic-key-signature
		 :sharp-count sharp-count
		 :time onset
		 :interval duration))

(defun make-tempo (bpm onset duration)
  (make-instance 'tempo
		 :bpm bpm
		 :time onset
		 :interval duration))