view utils/harmony/classes.lisp @ 61:c911d65ae94d

pointy-clicky misspelling correction darcs-hash:20070627102839-dc3a5-16cb5156dafee4b4a1aa3442274fab6c7260ed9c.gz
author c.rhodes <c.rhodes@gold.ac.uk>
date Wed, 27 Jun 2007 11:28:39 +0100
parents d1010755f507
children
line wrap: on
line source
(in-package #:amuse-harmony)

;; This file contains classes for use in the harmony module. There are
;; two sets of classes here: those used in the chord-labelling itself,
;; and those used for label-evaluation and comparison with ground
;; truth.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; CHORD LABELLING
;;
;; Chord objects are the fundamental object for identifying and naming
;; chord types they also give info about pitch classes and
;; distribution.

(defclass chord ()
  ((label :accessor chord-label
	  :initarg :label)
   (main-notes :accessor main-notes
	       :initarg :notes)
   (bass-likelihoods :accessor bass-likelihoods
		     :initarg :bass-likelihoods)
   (min-distribution :accessor min-distribution
		     :initarg :min-distribution)
   (distribution :accessor distribution
		 :initarg :distribution)
   (normalised-distribution :initarg :normalised-distribution
			    :initform nil)))

;; A chordset is a gathering of chords for experiment. There are slots
;; for priors, but I'm not using them at the moment (see below for
;; current, not very good, method).

(defclass chordset ()
  ((chords :accessor chords
	   :initarg :chords
	   :initform nil)
   (priors :accessor priors
	   :initarg :priors
	   :initform nil)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; EVALUATION
;;

(defclass labelled-chord-period (anchored-period)
  ((root-pitch-class :writer %labelled-chord-root
		     :reader labelled-chord-root
		     :initarg :root)
   (chord-type :writer %labelled-chord-type
	       :reader labelled-chord-type
	       :initarg :chord-type)
   (bass :writer %labelled-chord-bass
	 :reader labelled-chord-bass
	 :initarg :bass)))