d@33: (in-package #:amuse-harmony) d@33: d@33: ;; This file contains classes for use in the harmony module. There are d@33: ;; two sets of classes here: those used in the chord-labelling itself, d@33: ;; and those used for label-evaluation and comparison with ground d@33: ;; truth. d@33: d@33: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; d@33: ;; d@33: ;; CHORD LABELLING d@33: ;; d@33: ;; Chord objects are the fundamental object for identifying and naming d@33: ;; chord types they also give info about pitch classes and d@33: ;; distribution. d@33: d@33: (defclass chord () d@33: ((label :accessor chord-label d@33: :initarg :label) d@33: (main-notes :accessor main-notes d@33: :initarg :notes) d@33: (bass-likelihoods :accessor bass-likelihoods d@33: :initarg :bass-likelihoods) d@33: (min-distribution :accessor min-distribution d@33: :initarg :min-distribution) d@33: (distribution :accessor distribution d@33: :initarg :distribution) d@33: (normalised-distribution :initarg :normalised-distribution d@33: :initform nil))) d@33: d@33: ;; A chordset is a gathering of chords for experiment. There are slots d@33: ;; for priors, but I'm not using them at the moment (see below for d@33: ;; current, not very good, method). d@33: d@33: (defclass chordset () d@33: ((chords :accessor chords d@33: :initarg :chords d@33: :initform nil) d@33: (priors :accessor priors d@33: :initarg :priors d@33: :initform nil))) d@33: d@33: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; d@33: ;; d@33: ;; EVALUATION d@33: ;; d@33: d@33: (defclass labelled-chord-period (anchored-period) d@33: ((root-pitch-class :writer %labelled-chord-root d@33: :reader labelled-chord-root d@33: :initarg :root) d@33: (chord-type :writer %labelled-chord-type d@33: :reader labelled-chord-type d@33: :initarg :chord-type) d@33: (bass :writer %labelled-chord-bass d@33: :reader labelled-chord-bass d@33: :initarg :bass))) d@33: