annotate utils/harmony/classes.lisp @ 35:1d757c33e00e

Changes for midi file import darcs-hash:20070502153016-f76cc-89b748c36180ccaca77d2a70a65a6e7f77df8d43.gz
author David Lewis <d.lewis@gold.ac.uk>
date Wed, 02 May 2007 16:30:16 +0100
parents d1010755f507
children
rev   line source
d@33 1 (in-package #:amuse-harmony)
d@33 2
d@33 3 ;; This file contains classes for use in the harmony module. There are
d@33 4 ;; two sets of classes here: those used in the chord-labelling itself,
d@33 5 ;; and those used for label-evaluation and comparison with ground
d@33 6 ;; truth.
d@33 7
d@33 8 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
d@33 9 ;;
d@33 10 ;; CHORD LABELLING
d@33 11 ;;
d@33 12 ;; Chord objects are the fundamental object for identifying and naming
d@33 13 ;; chord types they also give info about pitch classes and
d@33 14 ;; distribution.
d@33 15
d@33 16 (defclass chord ()
d@33 17 ((label :accessor chord-label
d@33 18 :initarg :label)
d@33 19 (main-notes :accessor main-notes
d@33 20 :initarg :notes)
d@33 21 (bass-likelihoods :accessor bass-likelihoods
d@33 22 :initarg :bass-likelihoods)
d@33 23 (min-distribution :accessor min-distribution
d@33 24 :initarg :min-distribution)
d@33 25 (distribution :accessor distribution
d@33 26 :initarg :distribution)
d@33 27 (normalised-distribution :initarg :normalised-distribution
d@33 28 :initform nil)))
d@33 29
d@33 30 ;; A chordset is a gathering of chords for experiment. There are slots
d@33 31 ;; for priors, but I'm not using them at the moment (see below for
d@33 32 ;; current, not very good, method).
d@33 33
d@33 34 (defclass chordset ()
d@33 35 ((chords :accessor chords
d@33 36 :initarg :chords
d@33 37 :initform nil)
d@33 38 (priors :accessor priors
d@33 39 :initarg :priors
d@33 40 :initform nil)))
d@33 41
d@33 42 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
d@33 43 ;;
d@33 44 ;; EVALUATION
d@33 45 ;;
d@33 46
d@33 47 (defclass labelled-chord-period (anchored-period)
d@33 48 ((root-pitch-class :writer %labelled-chord-root
d@33 49 :reader labelled-chord-root
d@33 50 :initarg :root)
d@33 51 (chord-type :writer %labelled-chord-type
d@33 52 :reader labelled-chord-type
d@33 53 :initarg :chord-type)
d@33 54 (bass :writer %labelled-chord-bass
d@33 55 :reader labelled-chord-bass
d@33 56 :initarg :bass)))
d@33 57