view tools/segmentation/generics.lisp @ 75:6b2ac9eef629

Improved segmentation implementation (ta, MTP) darcs-hash:20070713112322-f76cc-42a6ead0d8822164af5554d11ca98f93a1f96359.gz
author David Lewis <d.lewis@gold.ac.uk>
date Fri, 13 Jul 2007 12:23:22 +0100
parents a98c2adfd420
children 9f2282a2644e
line wrap: on
line source
(in-package "AMUSE-SEGMENTATION")

(defgeneric boundary-strength (segmenter object composition)
  (:documentation "Returns a (positive?) number, with 0
  indicating no boundary. N.B. Whether this indicates a boundary
  before or after moment-designator is the responsibility of the
  caller to know."))

(defgeneric boundary-time (segmenter object)
  (:documentation "Returns the moment that the value returned by
  boundary-strength applies to if object is the second input to
  the method. Essentially, this distinguishes between segmenters
  that look to the beginning of a note and those that look at the
  end."))

(defgeneric ground-truth-segmenter-before (composition)
  (:documentation "Returns the segmenter that, when put into
  boundary-strength, supplies segmentation as given in a
  ground truth for the composition. N.B. This needs to return one
  segmenter only, so in cases of multiple ground truths, this
  method must arbitrate."))

(defgeneric ground-truth-segmenter-after (composition)
  (:documentation "Returns the segmenter that, when put into
  boundary-strength-after, supplies segmentation as given in a
  ground truth for the composition. N.B. This needs to return one
  segmenter only, so in cases of multiple ground truths, this
  method must arbitrate."))

(defgeneric ground-truth-segmenterp (segmenter)
  (:method ((s ground-truth-segmenter)) t)
  (:method (s) nil)) ;; prob not necessary?
(defgeneric segments-beforep (segmenter)
  (:method ((s before-segmenter)) t)
  (:method ((s after-segmenter)) nil))
(defgeneric segments-afterp (segmenter)
  (:method (s) (not (segments-beforep s))))