changeset 25:fe73cc3f1605

implementations/midi: move MIDI implementation to subdirectory. darcs-hash:20061215162417-aa3d6-164486669cc7e76206afd76f5c9cdd4fb2ba5b75.gz
author m.pearce <m.pearce@gold.ac.uk>
date Fri, 15 Dec 2006 16:24:17 +0000
parents 8d2b1662f658
children 8bc3c390cefa
files implementations/midi/classes.lisp implementations/midi/constructors.lisp implementations/midi/package.lisp
diffstat 3 files changed, 57 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/implementations/midi/classes.lisp	Fri Dec 15 16:24:17 2006 +0000
@@ -0,0 +1,20 @@
+(cl:in-package #:amuse-midi) 
+
+(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)))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/implementations/midi/constructors.lisp	Fri Dec 15 16:24:17 2006 +0000
@@ -0,0 +1,31 @@
+(cl:in-package #:amuse-midi)
+
+(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))
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/implementations/midi/package.lisp	Fri Dec 15 16:24:17 2006 +0000
@@ -0,0 +1,6 @@
+(cl:defpackage #:amuse-midi 
+  (:use #:common-lisp #:amuse-base)
+  (:export #:make-midi-pitched-event
+           #:make-midi-percussive-event
+           #:make-midi-key-signature))
+