Package raphsto
source code
Raphael and Stoddard's model for chord labelling from midi data.
An implementation of the models described in Function Harmonic
Analysis Using Probabilistic Models, Raphael and Stoddard, 2004.
In the future, this should be fitted into the tagger framework. For
now it's just a rough prototype, so I'm not bothering to work out how it
will implement the tagger interface, etc.
Author:
Mark Granroth-Wilding <mark.granroth-wilding@ed.ac.uk>
|
|
format_state(state,
time=None)
Formats a state label tuple as a string for output. |
source code
|
|
|
|
|
|
|
format_state_as_raphsto(state,
time=None)
State representation modeled on the original R&S model's labels
that are inserted into the example MIDI files. |
source code
|
|
|
|
states_to_key_transition(state,
previous_state)
Takes a state and previous state representation and returns the
(state, previous state) pair that is used by the model. |
source code
|
|
|
|
|
|
|
FILE_EXTENSION = 'mdl'
|
|
|
MODEL_TYPES = {'four-chord': <class 'jazzparser.misc.raphsto.R...
|
|
|
__package__ = 'jazzparser.misc.raphsto'
|
|
Formats a state label tuple, like format_state, but produces a chord name. This contains
less information than the result of format_state, but is easier to read.
|
states_to_key_transition(state,
previous_state)
| source code
|
Takes a state and previous state representation and returns the
(state, previous state) pair that is used by the model. This mapping
effectively implements the parameter tying of the first part of the
transition distribution.
|
|
The function described in the paper as d. Maps a pitch class to an
abstract representation that depends on the state.
This gets called a bajillion times, so needs to be as efficient as
possible.
|
MODEL_TYPES
- Value:
{'four-chord': <class 'jazzparser.misc.raphsto.RaphstoHmmFourChord'>,
'standard': <class 'jazzparser.misc.raphsto.RaphstoHmm'>,
'three-chord': <class 'jazzparser.misc.raphsto.RaphstoHmmThreeChord'>
,
'unigram': <class 'jazzparser.misc.raphsto.RaphstoHmmUnigram'>}
|
|