comparison base/methods.lisp @ 89:0b4c624910f1

base/: basic protocol for accessing monodies darcs-hash:20070723140651-c0ce4-2c828ea984eb92f0ccb73866a6a496131c8fa736.gz
author Marcus Pearce <m.pearce@gold.ac.uk>
date Mon, 23 Jul 2007 15:06:51 +0100
parents 7a0ee88f1edb
children ad9cca28fecf
comparison
equal deleted inserted replaced
88:8ea75cc8bc2c 89:0b4c624910f1
1 (cl:in-package #:amuse) 1 (cl:in-package #:amuse)
2
3 ;;; monody
4
5 (defmethod ensure-monody ((m monody))
6 (let ((result t))
7 (dotimes (i (1- (length m)) result)
8 ;; assumes the events are time ordered which (since monody is a
9 ;; subclass of time-ordered-constituent) they ought to be.
10 (let ((e1 (elt m i))
11 (e2 (elt m (1+ i))))
12 (unless (or (before e1 e2) (meets e1 e2))
13 (setf result nil))))))
2 14
3 ;;; diatonic pitch 15 ;;; diatonic pitch
4 16
5 (defmethod octave ((dp diatonic-pitch)) 17 (defmethod octave ((dp diatonic-pitch))
6 (%diatonic-pitch-octave dp)) 18 (%diatonic-pitch-octave dp))