  We examine the problem of learning a probabilistic model for melody directly
from musical sequences belonging to the same genre. This is a challenging task
as one needs to capture not only the rich temporal structure evident in music,
but also the complex statistical dependencies among different music components.
To address this problem we introduce the Variable-gram Topic Model, which
couples the latent topic formalism with a systematic model for contextual
information. We evaluate the model on next-step prediction. Additionally, we
present a novel way of model evaluation, where we directly compare model
samples with data sequences using the Maximum Mean Discrepancy of string
kernels, to assess how close is the model distribution to the data
distribution. We show that the model has the highest performance under both
evaluation measures when compared to LDA, the Topic Bigram and related
non-topic models.
