This repository is based on the paper "Using Variable Order Markov Model in Measuring Temporal Dynamics of Melodic Complexity in Jazz Improvisation" by Philip Pincencia (2024).
Project sturcture:
VOMM-MEL-COMPLEXITY
│ README.md
│ gui.py
│
└───Paper_and_Conference_Slides
│ │ Paper.pdf // Coming Soon
│ │ Conference_Slides.pdf
│
└───Supplement
│ └───Harmony_Score
│ │ Hscore_general.py
│ │ file112.txt
│ │ ...
│ └───Chroma_Vector
│ │ chroma.py
│ │ file112.txt
│ │ ...
│
└───examples
│ │ ... // song names
│
└───src
│ │ midi_rep.py
│ │ createdistribution.py
│ │ vomm_ppm.py
│ │ sliding_window.py
│ │ chord_parser.cpp
│ │ chord_parser.exe
Here I detail the steps of each of the approaches
I used the VOMM algorithm called Predict by Partial Match (PPM), which is implemented as a Multiway Trie. This is based on the paper "On Prediction Using Variable Order Markov Models" by Ron Begleiter, Ran El-Yaniv, and Golan Yona in the Journal of Artificial Intelligence Research 22 (2004) 385-421.
To learn the PPM model consists of several steps:
- Convert to training sequence:
xml
file is parsed bymidi_rep.py
#
- Instantiate an object of the appropriate class. Example:
import vomm
my_model = vomm.ppm()
- Learn a model from the data.
import vomm
my_model = vomm.ppm()
my_model.fit(training_data, d=2)
Denote
Learning a model consists of
- Construct the set
$S$ consisting of contexts of length at most$D$ in the training sequence. Precisely, $S={s\in q||s|\leq D}$. - Building the Mutliway Trie
$\mathcal{T}$ - Estimating the probability distribution
$\hat P(\sigma|s)$ for each context$s$ and symbol$\sigma$ in the alphabet.
After creating an object
- pdf_dict -- this is a dictionary with key context
$s$ and value the probability distribution$Pr(|s)$ . - logpdf_dict -- it's similar to pdf_dict, but the value is the log of the probability distribution.
- context_child -- this is a dictionary with key context
$s$ and value the set of possible longer children contexts${ xs }$ which are in the set of contexts recovered in step 1. This dictionary speeds up finding the largest context$s$ which matches the tail end of a sequence of symbols.
- Develop a web server to let users drop in an
xml
file and the associated chord changes pasted from WJazzDatabase - Animate the sliding window analysis to better understand the how the measure behaves
- Convert
music21
-independent python files toC++
to speed things up.