Mercurial > hg > amuse
diff midi-classes-and-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 | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/midi-classes-and-constructors.lisp Thu Dec 14 12:57:11 2006 +0000 @@ -0,0 +1,52 @@ +(cl:in-package #:amuse) + +(defclass midi-message () ;? + ((channel :accessor %midi-message-channel :initarg :channel) + (track :accessor %midi-message-track :initarg :track))) + +(defclass midi-pitched-event (chromatic-pitched-event midi-message) + ((velocity :initarg :velocity) + (patch :initarg :patch))) + +(defclass midi-percussive-event (percussive-event midi-message) + ((velocity :initarg :velocity) + (patch :initarg :patch) + (sound :initarg :sound))) + +(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))) + +;;; Constructors + +(defun make-midi-pitched-event (pitch-number velocity patch + channel track onset duration) + (make-instance 'midi-pitched-event + :number pitch-number + :velocity velocity + :patch patch + :channel channel + :track track + :time onset + :interval duration)) + +(defun make-midi-percussive-event (pitch-number velocity patch + channel track onset duration) + (make-instance 'midi-percussive-event + :sound pitch-number + :velocity velocity + :patch patch + :channel channel + :track track + :time onset + :interval duration)) + +(defun make-midi-key-signature (sharp-count mode onset duration) + (make-instance 'midi-key-signature + :sharp-count sharp-count + :mode mode + :time onset + :interval duration)) +