view utils/harmony/classes.lisp @ 40:5bec705db9d6

Move midi-key-signature from implementations/midi to base/ darcs-hash:20070606134940-aa3d6-69b8a531ef8ae393234d065ff6105ed9ecd18434.gz
author m.pearce <m.pearce@gold.ac.uk>
date Wed, 06 Jun 2007 14:49:40 +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)))