Probabilistic Sequential Patterns
for Singing Transcription
Eita Nakamura∗ , Ryo Nishikimi∗ , Simon Dixon† and Kazuyoshi Yoshii∗∗ Kyoto University, Kyoto, Japan

E-mail: [enakamura,nishikimi,yoshii]@sap.ist.i.kyoto-u.ac.jp† Queen Mary University of London, London, United Kingdom

E-mail: s.dixon@qmul.ac.uk

I. I NTRODUCTION
Computational models of musical scores, sometimes referred to as music language models, play a vital role invarious tasks of music information processing [1]–[6]. For
automatic music transcription [7], for example, a musicalscore model is necessary to induce an output score to bean appropriate one that respects musical grammar, style ofthe target music, playability, etc. Conventional musical scoremodels include variants of Markov models [8], hidden Markov
models (HMMs) and probabilistic context-free grammar models [9], recurrent neural networks [10], and convolutional
neural networks [11]. These models are typically learned
supervisedly and the obtained generic score model is applied
to transcription of all target musical pieces, in combination
with an acoustic model and/or a performance model.
A musical piece commonly consists of groups of musicalnotes that are repeated several times, and detecting repeatednote patterns has been a topic of computational music analysis[12]. Repetitive structure can complement local sequential
dependence of notes, on which conventional score models
have focused, and thus can be useful for transcription. Thisis because if the repetitive structure can be inferred correctly,
one can recover part of the score or can account for timing

Probabilistic sequential pattern (PSP)

Rhythm probability

Note pattern#& 68 œ .
#& 68 œ

D4 E4 F#4 G#4 Bb4 C5 D5 E5 F#5
Eb4 F4G4 A4 B4 C#5 Eb5 F5
G5

PSP 1

PSP 2

PSP 3

···K

1 2 3
PSP

#
& 68 œ .

j œ œ
œ œ.
œ œ

œ
œ œ œ
œ

j
œ
j
œ
j
œ

Probability
0.045
0.007
0.004

···

#
& 68 œ .
0 1 2 3 4 5(b)Pitch probability

5
4
3
2
1
0

(a)

Probability

Abstract—Statistical models of musical scores play an important role in various tasks of music information processing. It has
been an open problem to construct a score model incorporating
global repetitive structure of note sequences, which is expected
to be useful for music transcription and other tasks. Since
repetitions can be described by a sparse distribution over notepatterns (segments of music), a possible solution is to consider aBayesian score model in which such a sparse distribution is first
generated for each individual piece and then musical notes are
generated in units of note patterns according to the distribution.
However, straightforward construction is impractical due to theenormous number of possible note patterns. We propose aprobabilistic model that represents a cluster of note patterns,
instead of explicitly dealing with the set of all possible notepatterns, to attain computational tractability. A score model isconstructed as a mixture or a Markov model of such clusters,
which is compatible with the above framework for describing
repetitive structure. As a practical test to evaluate the potentialof the model, we consider the problem of singing transcription
from vocal f0 trajectories. Evaluation results show that our model
achieves better predictive ability and transcription accuracies
compared to the conventional Markov model, nearly reachingstate-of-the-art performance.

j .
œ œ œ œ œ œ

···

PSP K

œ œ œ œ œ œ œ œj

Fig. 1. The proposed sequential pattern model for musical scores. (a) A PSP
generates note patterns for a bar based on a metrical Markov model (rhythm
probability) and a distribution of pitches defined for each beat position (pitch
probability). (b) A generative process of musical scores with multiple PSPs;for each bar a PSP is chosen according to a mixture/Markov model. See
section III for details. (For clear illustration, the 6/8 time in this example isdifferent from the 4/4 time considered in the main text.)

deviations, acoustic variations, and other types of “noise” inperformances. To realize this scenario, we need a score modelthat induces repetitions in generated scores. Since repetitive
structure is a global feature, it is challenging to construct a
computationally tractable model with such a property.
A framework for constructing a score model with repetitive
structure has been proposed in [13]. The idea is to consider
a distribution (or a Markov model) over a set of possible
note patterns and implicitly represent repetitive structure withsparseness of the distribution. A note pattern is defined here
as a subsequence of musical notes; if a piece consists ofa small number of note patterns then it has repetitions andvice versa. The model is described as a Bayesian extensionof a Markov model of note patterns where the Dirichletparameters of the prior distributions are assumed to be small
to induce repetitions. In addition, to deal with approximate
repetitions (i.e. repetitions with modifications), which are common in music practice [14], an additional stochastic process
of modifying patterns was incorporated. In this framework,
an individual score model is learned unsupervisedly in thetranscription process for each input signal, in contrast to theabove supervised learning scheme. That study focused onmonophonic music and only rhythms were modelled, and it
has been shown that the framework is indeed effective formusic transcription.

II. M ELODY M ARKOV M ODEL
Here we specify the problem of singing transcription considered in this study. A simple model for statistical singing
transcription is presented as a baseline method.
A. Singing Transcription from F0 Trajectories
Singing transcription is a task of converting a singing voice
signal into a musical score representation [19], [20]. Here, we
consider a situation that a singing-voice f0 trajectory is given

Pitch

Musical score Y

Transcription

Generative process

F0 trajectory X
Frequency

Although it is theoretically possible to extend this framework for more general forms of music, including pitches andmultiple voices, the model becomes so large that computational tractability will be lost. First, with Ω ∼ O(10–102 )unique pitches and ` notes, the number of possible pitch
patterns is Ω` , which soon becomes intractable as ` increases.
Second, by adding the process of modifying patterns, thecomplexity increases further: with Λ unique patterns one
should consider Λ2 possible ways of modification in general.
Third, joint modelling of pitches and rhythms further increases
the size of the state space.
In this study, we propose a new approach for modelling notepatterns including pitches and rhythms that is compatible withthe above framework for describing repetitive structure. To realize this, we treat a set of patterns related by modifications as
a cluster, named probabilistic sequential pattern (PSP), without
explicitly dealing with the set of all possible patterns (Fig. 1).
A PSP is formulated so that it can naturally accommodate
insertion, deletion, and substitution of notes as modificationsof patterns. We construct score models based on a mixture(possibly with a Markov structure on the mixture weights) of
such PSPs and its Bayesian extension. As a practical problem,
we consider the problem of singing transcription of vocal f0
trajectories [15], [16].
The main contributions of this study are:• Construction of computationally tractable score models
based on note patterns; a Bayesian framework for describing approximate repetitive structure of musical scores.
• Our model achieves better predictive ability and transcription accuracies than the conventional Markov model.
An additional contribution is proposing a framework for integrating a note-level score model and a beat-level f0 model.
Such a framework is nontrivial due to different time units
in acoustic/f0 signals and musical scores and has not beenrealized in most previous studies; in some studies frame-levelmusical score models have been considered [17], [18], whichcannot properly describe musical rhythms, and in other studies
an unrealistic situation that the number of musical notes isknown in advance has been assumed [19].
The rest of the paper is organized as follows. In the next section, we review a simple Markov model generating melodies(pitches and rhythms) and its extension for use in singing
transcription. In section III, we formulate our PSP modeland explain an inference method. Numerical experiments andevaluations are presented in section IV. The last section isdedicated to conclusions and discussion.

Beat and downbeat (given)

Fig. 2. Singing transcription from a vocal f0 trajectory and the corresponding
generative process.

in advance as well as the information about the location ofbeats and bar onsets (downbeats) (Fig. 2). The former can be
estimated by using an f0 estimation method for singing voices(e.g. [21]) and the latter can be estimated by a beat tracking
method (e.g. [22]). In the following, time frames are indexedby t ∈ {1, . . . , T } and score times in units of 16th notes areindexed by τ ∈ {τs , . . . , τe }, where T represents the signal
length and τs and τe respectively denote the first and the lastbeats. For each score time τ , its relative position to the bar
onset is denoted by [τ ] ∈ {0, . . . , B − 1} and called the beatposition. The symbol B denotes the number of beats in eachbar and it is fixed to B = 16 in what follows, as we only
consider pieces in 4/4 time for simplicity. Each score time τis associated with a time frame denoted by t(τ ).
The input signal is a sequence of f0s denoted by X =(xt )Tt=1 . The output is a musical score represented as asequence of pitches and onset score times Y = (pn , τn )N
n=1 ,
where N is the number of notes and pn is the n th note’s pitchin units of semitones. Note that the number N is unknown inadvance and must be estimated from the input signal.
In the generative modelling approach, we first construct ascore model that yields the probability P (Y ) and combine
it with an f0 model that yields P (X|Y ). The output scorecan be obtained as the one that maximizes the probability
P (Y |X) ∝ P (X|Y )P (Y ).
B. Score Model
As a minimal model, we treat pitches and rhythms independently and consider a Markov model for pitches and a metrical
Markov model [23], [24] for onset score times. It is describedwith the initial and transition probabilities for pitches
P (p1 = p) = χinip ,

P (pn = p | pn−1 = p0 ) = χp0 p(1)

and those for onset score timesini
P (τ1 = τ ) = ψ[τ],P (τn = τ | τn−1 = τ 0 ) = ψ[τ 0 ][τ ] . (2)In the transition probability matrix for onset score times, wehave implicitly assumed that the maximum interval between
adjacent onsets is the bar length B and when [τn ] ≤ [τn−1 ]we interpret that a bar line is crossed between these notes.
To apply the above note-level score model for singing
transcription, one must compare all possible segmentations

Counter cτ

8

7

6

5

4

3

2

1

4

3

2

1

6

5

4

3

2

1

2

0.12

1

E4

Pitch pn , pτ

D4
C4
60

Eq. (1)

62

64

Data
CauchyGaussian

0.1

D4
62

Eq. (2)

Beat position [τ ] 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3
Score time τ 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

Frequency (a.u.)Musical score

0.08

0.06

0.04

0.02

Note n

1

2

3

4
0

Fig. 3. Generative process of a melody Markov model.

-6

-4

-2

0

2

4

6

F0 deviation [semitone]

Fig. 4. Distribution of f0 deviations in singing voices.

of the input signal into a sequence of notes. To enable this,we reformulate the score model as an equivalent form thatis described at the beat level. Specifically, the above model
is embedded in a type of semi-Markov model called theresidential time Markov model [25] in which a counter variable
is introduced to memorize the residual duration of a note. In
this beat-level melody Markov model (Fig. 3), all variables aredefined for each beat; the pitch and the counter variable aredenoted by pτ and cτ ∈ {1, . . . , B}. The counter variables are
generated as
P (cτs = c) = ψ[τs ][τs +c] ,(3)P (cτ |cτ −1 ) = δcτ −1 (cτ +1) + δcτ −1 1 ψ[τ ][τ +cτ ] ,(4)

where δ denotes the Kronecker delta. Here, cτ −1 = 1 indicatesthat there is an onset at score time τ and the corresponding
note has a length cτ ; otherwise the pitch remains constant.
Thus, the generative process for pitches is described as
P (pτs = p) = χini
p ,

(5)

0

P (pτ = p | pτ −1 = p ) = δcτ −1 1 χp0 p + (1 − δcτ −1 1 )δpp0 . (6)C. F0 Model and Inference Method
The f0 model describes a stochastic process in whichobserved f0s are generated from a given score. As a minimalmodel, we define the output probability for each beat ast(τ +1)−1

P (xt(τ ) , . . . , xt(τ +1)−1 | pτ ) =Y
t0 =t(τ )Pf0 (xt0 |pτ ),(7)where we have assumed that each frame has independent andidentical probability. It is further assumed that the probabilities
Pf0 (x|p) for different p s share the same functional form:
Pf0 (x|p) = F (x − p)(8)for some distribution F . The distribution of f0 deviations(x − p) extracted from annotated f0 data [26] as well as
its best fit Cauchy and Gaussian distributions are shown in
Fig. 4. The width of the best fit Cauchy distribution is 0.32
(semitones) and the standard deviation of the best fit Gaussian
is 0.44 (semitones). We see that the empirical distribution in
the data is long-tailed and skewed, and the Cauchy distribution
is better fitted than the Gaussian. As in a previous study [16], aCauchy distribution is used as the distribution F in this study.
One would benefit from using a more elaborated distribution
incorporating the skewness for improving the transcription
accuracy. On the other hand, we have confirmed that thetranscription accuracy is not very sensitive to the value of thewidth parameter for the Cauchy distribution.
Given musical score data, one can estimate parameters of
the score model by the maximum-likelihood method. Once themodel parameters are given, one can estimate the score froman input signal by maximizing the probability P (p, c |X) ∝P (X| p, c)P (p, c), where p = (pτ ) and c = (cτ ). This can becomputed by the standard Viterbi algorithm [27]. Note that, bylooking at the obtained counter variables, one can determine
the most likely sequence of onset score times as well as thenumber of notes in the output score.
III. P ROBABILISTIC S EQUENTIAL PATTERN M ODELWe here formulate probabilistic sequential pattern (PSP)models. First, we formalize the idea of representing notepatterns related by modifications as a PSP. Second, we explaina score model constructed by using multiple PSPs. In the last
subsection, inference methods are explained.
A. Probabilistic Sequential Patterns
For definiteness, a subsequence of notes spanning a bar
length is considered as a note pattern in this study. This can be
represented as a segment (pi , bi )Ii=1 where bi denotes the beatposition of the i th note satisfying 0 ≤ b1 < · · · < bI < B.
Instead of considering a distribution over the set of all possible
such patterns explicitly, we consider a probabilistic model thatstochastically generates note patterns. The onset beat positions
are generated in the same way as the metrical Markov model:
P (b1 ) = ρini
b1 ,P (bi |bi−1 ) = ρbi−1 bi ,(9)which are referred to as rhythm probabilities. Next, pitches
are generated conditionally on the beat position as
P (pi |bi ) = φbi pi ,(10)which are referred to as pitch probabilities.
This model, named a PSP, can be regarded as a generalization of a note pattern (Fig. 5). This is because in the limit ofbinary probabilities, i.e. all entries of ρini , ρ, and φ are either
0 or 1, the model can generate only one note pattern withprobability 1. As long as these probability distributions aresparse, a PSP can effectively generate only a limited numberof note patterns. Furthermore, these note patterns tend to berelated to each other by certain modifications: the metrical
Markov model can naturally describe deletions and insertions

Pre-trained (generic) PSP model#6& 8 œ.

œ

j
œ

bi+1

D4 E4 F#4 G#4 Bb4 C5 D5 E5 F#5
Eb4 F4G4 A4 B4 C#5 Eb5 F5
G5

PSP model for piece 1

Pitch probability

PSP 1 PSP 2 PSP 3 PSP 4 PSP 5

5
4
3
i 2
1
0

#6
& 8 œ œ œ œ
0 1 2 3 4 5

bi+1

D4 E4 F#4 G#4 Bb4 C5 D5 E5 F#5
Eb4 F4G4 A4 B4 C#5 Eb5 F5
G5jœ

Probability = 0.007pi(b) A note pattern generated by a (non-deterministic) PSP.
Fig. 5. Examples of note patterns generated by PSPs. In (b), relevant
probabilities are marked with a bold green box. (For simpler illustration, the
6/8 time is used here instead of the 4/4 time considered in the text.)

and the pitch probability can express pitch substitutions. The
number of parameters of a PSP is B(B+1+Ω), which is muchsmaller than the number of unique note patterns as discussed
in the Introduction. Note also that pitches and rhythms are notindependently generated in a PSP so that it can be a more
precise model than the melody Markov model in general.
B. PSP-Based Score Models
1) PSP Mixture Model: The real advantage of considering
PSPs becomes clear when we consider multiple PSPs as a
generative model of musical scores. The simplest model is(k),ini (k)(k)
described by K PSPs parameterized by (ρb, ρb0 b , φbp )K
k=1
and mixture probabilities σk obeying σ1 + · · · + σK = 1. The
generative process is described as follows.
1) When a new bar is entered a component k is drawn fromthe mixture probability.
2) Pitches and onset beat positions in that bar are generated
by the k th PSP.
3) Once an onset beat position bi such that bi ≤ bi−1 isdrawn, we move to the next bar and continue the process.
To put this into equations, let m = 1, . . . , M be an index forbars and n = 1, . . . , Nm be an index for note onsets in eachbar m. The pitch and onset beat position of the n th note in
the m th bar are denoted by pmn and bmn . For each bar m, a
PSP km is chosen according to the mixture probability
P (km = k) = σk .

(11)Beat positions bm2 , . . . , bmNm are generated by(k)
P (bm(n+1) = b | bmn = b , km = k) = ρb0 b .
0(12)

The first beat position is generated by(k)

P (b(m+1)1 = b | bmNm = b0 , km = k) = ρb0 b ,(13)

except for the first bar, for which case the following holds:(k),iniP (b(m=1)1 = b | k(m=1) = k) = ρb

.

(14)

P (pmn = p | bmn = b, km = k) = φbp .

(15)

Pitches are generated as(k)

We call this model a PSP mixture model.

PSP model for piece 2

Probability

Rhythm probability

PSP

Dirichlet processpi(a) A PSP with binary probabilities generates only one note pattern.

b

PSP 1 PSP 2 PSP 3 PSP 4 PSP 5

Probability = 1
0 1 2 3 4 5Score data

Pre-training

ProbabilitybPitch probability

5
4
3
i 2
1
0

Probability

Rhythm probability

PSP

PSP 1 PSP 2 PSP 3 PSP 4 PSP 5

Piece 1

Piece 2& 42 œ œ œ œ œ œ œ œ œ œ œ& 42 œœ œ œ œœœœœ œ œ œ œ

PSP

œœ

Fig. 6. In the Bayesian extension of the PSP model, an individual PSP
model is generated for each musical piece, which is assumed to havesparse distributions to induce repetitions. (For simpler illustration, transition
probabilities for PSPs are illustrated as a mixture distribution and the 2/4 time
is used here instead of the 4/4 time considered in the text.)

2) Markov PSP Model: We can easily extend the PSP mixture model by introducing a Markov structure on the mixture
weights. Instead of the mixture probability, we consider initial
and transition probabilities for the PSP components:
P (k1 = k) = σkini ,P (km+1 = k 0 | km = k) = σkk0 , (16)P (end| kM = k) = σk end ,(17)

where the last probability is used to end the generative process.
The probabilities obey the following normalization conditions:XX
1=σkini0 =σkk0 + σk end (∀k).
(18)
k0

k0

We call this model a Markov PSP model.
The Markov PSP model has advantages over the PSP
mixture model. Since the sequential structure of note patterns
is incorporated, it can potentially describe repetitive structure
better. In addition, there is a nice theoretical property thatwith a sufficiently large number of PSPs it can completely
reproduce a given piece of music. We thus focus on Markov
PSP models in the following and simply call them PSP models.
3) Bayesian Extension: To apply the Bayesian frameworkfor describing repetitive structure explained in the Introduction, we extend the PSP model to a Bayesian model by putting
conjugate priors on the model parameters:
σ ini ∼ Dir(ασini σ̄ ini ),iniρ∼ Dir(αρini ρ̄ini ),φb ∼ Dir(αφ φ̄b ),σk ∼ Dir(ασ σ̄k ),ρb ∼ Dir(αρ ρ̄b ),

(19)
(20)
(21)

where we have introduced the notation σ ini = (σkini ), σk =(σkk0 ), etc. and Dir( · ) denotes a Dirichlet distribution. The
concentration parameters ασini , ασ , etc. are chosen to be small
to induce sparse distributions.
The above generative process can be interpreted as a processof choosing a set of note patterns like motives for composing
a particular piece (Fig. 6). Eq. (19) says that a limited setof PSPs are chosen, which induces repetitive structure for thegenerated piece. Eqs. (20) and (21) induce each PSP to become
more specific in both rhythm and pitch, which enhances therepetitive structure.

C. Inference Methods for Transcription
In the application of the PSP model to music transcription,
there are three inference problems: (i) parameter estimation fora pre-trained (generic) score model; (ii) Bayesian inference ofan individual score model given an input signal; and (iii) final
estimation of the output score for the input signal. To enable
inference, we should reformulate the PSP model as a beatlevel model. As explained in Appendix A, the note-level andbeat-level Markov PSP models can be reformulated in formsof Markov models.
Unlike conventional score models and the model studied in[13], PSPs are supposed to be pre-trained in an unsupervisedmanner. As explained in section III-C, the model parameters
can be learned by the maximum-likelihood method, similarly
as a Gaussian mixture model (GMM). Similarly as the varianceof each component Gaussian of a GMM becomes smaller as
we increase the number of mixtures, the perplexity of each PSP
becomes smaller as we increase the number of PSPs, leading
to each PSP generating a more specific subset of note patterns.
Therefore, a PSP model will spontaneously find clusters in thespace of note patterns that best explain the training data. By
varying the number of PSPs K, we can control the precisenessof the model, which is in general in a trade-off relation withthe computational cost for inference.
(k),ini (k)(k)
Writing θ = (σkini , σk0 k , ρb
, ρb0 b , φbp ) for the model
parameters and Y for the training score data, the optimal
θ is estimated by maximizing the likelihood P (Y |θ). We
can apply the expectation-maximization (EM) algorithm [28]for the maximum-likelihood estimation, by regarding (km )as latent variables. Update equations for the EM algorithm
are provided in Appendix B. The pre-trained parameters are(k),ini (k)(k)
denoted by θ̄ = (σ̄kini , σ̄k0 k , ρ̄b, ρ̄b0 b , φ̄bp ).
The first step of singing transcription by the proposed
method is to carry out Bayesian inference for learning an
individual score model for the input signal. We can apply the
Gibbs sampling method for inferring the parameters θ given
their pre-trained values θ̄ and the input signal X. Denoting
the latent variables as Z = (k, b, p) where k = (km ),b = (bmn ), and p = (pmn ), we sample from the distribution P (θ, Z | X, θ̄) ∝ P (X|Z, θ)P (Z|θ)P (θ|θ̄). For sampling
the latent variables, the forward filtering-backward sampling
method can be applied. Then the parameters can be sampledfrom the posterior Dirichlet distributions. In practice, after acertain number of Gibbs samplings, we choose the sampledparameters θ∗ that maximize the probability P (X|θ∗ ).
The final step of transcription is to estimate the output
score Y that maximizes the probability P (Y |X, θ∗ ). As in
the case of the melody Markov model, this can be done with
the Viterbi algorithm. We can simply apply the Markov-model
formulation of PSP models explained in Appendix A.
IV. E VALUATION
We conduct numerical experiments to compare the PSPmodel and the melody Markov model. First, they are evaluatedas musical score models in terms of perplexity. Next, they arecompared in terms of transcription accuracy using real data.

TABLE IT EST- DATA PERPLEXITIES .
ModelMelody Markov model
PSP model (K = 10)
PSP model (K = 30)
PSP model (K = 50)

Test-data perplexity
43.9
46.9
36.1
32.8

A. Setup
We use the popular musical pieces in the RWC database[26], [29] for evaluation. For the sake of simplicity in datapreparation, we only use pieces that are in 4/4 time without
intermediate changes of time signature and remove pieces thathave more than two voices in the vocal part or for which
the beat and f0 annotation data contain significant errors. 63
pieces remained according to these criteria and are used as
test data. The training data consist of the other pieces in the
RWC database, 193 pieces by the Beatles, and 135 other pop
music pieces, which have no overlap with the test data. To
alleviate the problem of data sparseness, the training data is
augmented: all pieces are transposed by intervals in the rangeof [−12, 12] semitones and used for training.
All the concentration parameters of the PSP models are set
to unity. For pre-training PSP models, the EM algorithm is run
until convergence. For Bayesian inference, Gibbs sampling isiterated 100 times. In general, we can introduce a parameter
to weight the relative importance of the score model and thef0 model. Formally, the logarithm of the f0 output probability
in Eq. (7) is multiplied by a factor w during inference. We use
w = 0.1 for Bayesian inference and w = 1 in other places,
which have been roughly optimized in a preliminary stage.
B. Evaluation of Score Models
After parameters of the PSP model are learned with thetraining data, the perplexity on the test data is computed. The
results for PSP models with K = 10, 30, and 50 PSPs andfor the melody Markov model are given in Table I. We seethat the test-data perplexity decreases as K increases and thecases K = 30 and 50 outperform the melody Markov model.
This indicates that even without a Bayesian extension the PSPmodel can be useful as a score model with higher predictive
ability than the melody Markov model.
Looking at the learned parameters of the PSP models reveals
what aspects of musical note sequences they capture withdifferent model sizes. When the model size is small (e.g.
K = 5), each PSP represents note patterns in different pitch
ranges. For K = 10, the model begins to learn the structureof musical scales (Fig. 7(a)). With this level of model size, nosignificant correlation between the probabilities of pitches andrhythms is learned: the pitch probability is almost independentof beat positions and the metrical transition probability is thestatistical average of all note patterns. For a larger K (e.g.
K = 50), each PSP begins to represent a more specific clusterof note patterns. Both the probabilities of pitches and rhythms
become sparser in this case (Fig. 7(b)).

Rhythm probability

Pitch probability

14

15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15C2

D2 E2 F#2 G#2 Bb2 C3 D3 E3 F#3 G#3 Bb3 C4 D4 E4 F#4 G#4 Bb4 C5 D5 E5 F#5 G#5 Bb5 C6C#2 Eb2 F2
G2 A2 B2 C#3 Eb3 F3
G3 A3 B3 C#4 Eb4 F4
G4 A4 B4 C#5 Eb5 F5
G5 A5 B5(a) The case of 10 PSPs
Rhythm probability

Pitch probability

15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0

Improvement of Error Rate (%)

12
10
8
6
4
2
0

PSP model (K = 30)
Bayesian PSP model (K = 30)

-2
-4
-6
0

10

20

30

40

50

60

Piece ID

Fig. 8. Improvements in the error rate compared to the melody Markov model.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15C2

D2 E2 F#2 G#2 Bb2 C3 D3 E3 F#3 G#3 Bb3 C4 D4 E4 F#4 G#4 Bb4 C5 D5 E5 F#5 G#5 Bb5 C6C#2 Eb2 F2
G2 A2 B2 C#3 Eb3 F3
G3 A3 B3 C#4 Eb4 F4
G4 A4 B4 C#5 Eb5 F5
G5 A5 B5(b) The case of 50 PSPs

Fig. 7. Examples of learned PSPs. Learned probabilities are visualized for atypical PSP in the case of (a) K = 10 and (b) K = 50. The left and rightboxes represent transition probabilities in Eq. (9) and the pitch probability in
Eq. (10). The vertical axis indicates the current beat position and the horizontal
axis indicates the next beat position for the rhythm probability and the output
pitch for the pitch probability.
TABLE IIAVERAGES AND STANDARD ERRORS OF ERROR RATES EVALUATED ON THE
REAL DATA . T HE P - VALUE MEASURES STATISTICAL SIGNIFICANCE OF THE
DIFFERENCE BETWEEN EACH MODEL AND THE BAYESIAN PSP MODELWITH K = 30, WHICH IS CALCULATED FROM THE DISTRIBUTION OFPIECE - WISE DIFFERENCES IN ERROR RATES .
Model
Melody Markov model
PSP model (K = 10)
PSP model (K = 30)
Bayesian PSP model (K = 10)
Bayesian PSP model (K = 30)
HHSMM [16]Error rate (%)

p-value

34.2 ± 1.6
31.0 ± 1.7
30.3 ± 1.7
30.4 ± 1.6
28.6 ± 1.6
27.6 ± 1.7< 10−5< 10−5< 10−5< 10−5—
5.7 × 10−3

C. Evaluation of Transcription Accuracy
Next we evaluate the PSP model and the melody Markov
model in terms of transcription accuracy using real data of f0
trajectories. We use the annotated f0 and beat tracking data for
the RWC data [26] as input. For the PSP models, we compare
the cases K = 10 and K = 30 and both cases of using and
not using Bayesian inference. As an evaluation measure, abeat-level error rate of estimated pitches is used.
The average error rates in Table II show that the PSPmodels significantly outperform the melody Markov model.
For both K = 10 and 30, the Bayesian extension yields better
results, even though the difference is slight for K = 10.
To see the effect of the PSP model in more detail, we plot
the improvement of error rates for each piece for the caseK = 30 (Fig. 8). We see that for all pieces except one thenon-Bayesian PSP model improves the error rate. The piece forwhich the PSP model has a worse error rate (piece ID 7/RWC
No. 16) has an f0 trajectory that deviates significantly fromthe musical score. For most pieces the Bayesian PSP model
further improves the error rate, but it sometimes yields a worse
error rate. This implies the possibility of further improving theresult if we are able to adjust the parameters (e.g. concentration
parameters and the width parameter of the f0 model) for

individual signals. For reference, the error rate for a state-ofthe-art model [16] is also shown in Table II, which is slightly
better than the best case for the PSP model. This result is
encouraging given that the compared model has a much moreelaborated f0 model [16], which can be incorporated into thepresent model in principle.
Transcription results for an example piece (piece ID
32/RWC No. 55) are shown in Fig. 9 together with the groundtruth. We see that the repetitive structure in the ground-truth
data is better reproduced in the transcription by the Bayesian
PSP model than the other two cases. We can find someincomplete repetitions of the first and third bars, which lead totranscription errors in this example. This shows the potentialof the Bayesian PSP model to capture approximate repetitions,which often appear in other pieces. Musical naturalness isalso improved by the Bayesian PSP model, as we can see
from the absence of out-of-scale notes that are present in thetranscriptions by the other methods. The example also reveals
a limitation of the present model that it is hard to recognize
repeated notes, as in the first and fifth bars. To solve thisproblem, it would be necessary to incorporate some feature,
like the spectral flux or the magnitude of percussive spectral
components, that can indicate locations of onsets.
V. C ONCLUSION
We have formulated a probabilistic description of musicalnote patterns named probabilistic sequential pattern (PSP) andconstructed musical score models that generate note sequencesin units of PSPs. The model enables a statistical descriptionof repetitive structure through a Bayesian extension. We haveconfirmed that even with a moderate number of PSPs (e.g.
K = 30), the PSP model yields better test-data perplexities
and transcription accuracies than the conventional Markov
model. The PSPs can be learned unsupervisedly and automatically capture aspects of music that provide more relevant
information depending on the model size. Within the rangeof model sizes we studied, first the pitch range is captured,second musical-scale structure, and then more specific patterns
in which pitches and rhythms are correlated.
The description of the PSP models given here is a minimal
one; several ways of extension are expected to improve themodels. First, whereas it is interesting that the PSP model
spontaneously learns the structure of key/musical scale, intro-

(a) Melody Markov modelœ œ œ œ œ #œ œ . nœ œ œ . œ œ œ œ œ ˙
4 œbœ
& 4 œ œ œ œ #œ nœjœ ‰Œœ #œ œ

(b) PSP model (K=30)jœ ‰Œœ #œ œ œ ˙œ œ œ œ œ œ #œ œ . nœ œ œ . œ œ œ . œ œ œ ˙Ó(c) Bayesian PSP model (K=30)œ œ œœœ œœ. œ œ œ œ œ œ œ œ ˙jœ ‰Œœ œ. œ ˙œ œœœ œœ œœ. œ œ œ œ œ œ œ ˙Ó(d) HHSMM [16]œ œ . œ #œ œ nœ œ œ œ œ œ œ œ ˙jœ ‰Œœ œœ ˙œ œœœ œœ œœ œ œ œ œ. œœ œ ˙

Ó

j
œ ‰Œ

œ

œ œœœ œ œœ œ œœœ œœ ˙

Ó

& 44
& 44
& 44

œ
œ
œ

bœ œ nœ œ œ œ #œ œ . nœ œ œ . œ œ œ œ œ ˙

œ ˙
œ ˙
œ ˙

œ.

(d) Ground truth4 œ& 4 œ œ.

œ œ œ œœœ œ œ œJœœœ œœ ˙œ ˙œ œ . Jœœ œ œ œ œ œ #œ œ . nœ œ œ . œ œ œ . œ œ œ œ . #œ ÓœFig. 9. Example transcription results (RWC No. 55).

ducing transposition invariance in the model can lead to more
efficient learning, leading to a model in which PSPs focus onclustering note patterns in one key. Second, a limitation of thecurrent model that sequential dependence between succeeding
pitches is not explicitly incorporated can be overcome by anautoregressive extension of the pitch probability.
For further improving the accuracy of singing transcription,
several directions of model adaptation would also be effective.
To adapt the f0 model for individual singers, one can infer theparameters, especially the width parameter, in a Bayesian manner [30]. We have also observed that the optimal values of theconcentration parameters are different for individual pieces.
Extension to a hierarchical Bayesian model for inferring theseparameters is thus another possibility.
The present model can be applied to other tasks including
automatic composition and arrangement. Extension for polyphonic music is of great importance for extending the application of the approach, which is currently under investigation.
ACKNOWLEDGMENT

(k)

(k)

0

0

P (kτs = k, pτs = p, cτs = c) = σkini ρ[τs ][τs +c] φ[τs ]p(24)

P (kτ = k, pτ = p, cτ = c | kτ −1 = k , pτ −1 = p , cτ −1 = c0 )) (
δc(c0 −1) δpp0 (cτ −1 > 1)
δk0 k ([τ ] 6= 0)
=
·
.
(kτ )
(kτ )
σk0 k ([τ ] = 0)
ρ[τ ][τ(cτ −1 = 1)+c] φ[τ ]p(25)
B. EM Algorithm for Markov PSP models
Readers are reminded the notation introduced in sections
III-B and III-C. Update equations for the EM algorithm can bederived by differentiating the following function with respectto θ with constraints for normalizations [28]:XF =−P (K| B, P , θ0 ) ln P (K, B, P , θ),(26)
KThis study was partially supported by JSPS KAKENHI
Grant Numbers 26700020, 16H01744, 16H02917, 16J05486,
and 16K00501 and JST ACCEL No. JPMJAC1602. E.N. is
supported by the JSPS research fellowship (PD).
A PPENDIX
A. Markov PSP Models Formulated as Markov Models
We first formulate a Markov PSP model as a Markov model.
We introduce stochastic variables (kn , bn , pn ) that are definedfor each note n (indexed throughout a piece). The initial andtransition probabilities are(k ),ini (k1 )φb1 p1 ,A Markov PSP model can be represented as a beat-level
score model by using the same framework as in section
II-B. We define variables (kτ , pτ , cτ ) for each score timeτ ∈ {τs , . . . , τe }. The initial and transition probabilities arethen given as

P (k1 , b1 , p1 ) = σkini
ρ 1
1 b1

(22)

P (kn , bn , pn | kn−1 , bn−1 , pn−1 )δkn kn−1 (bn > bn−1 )(kn−1 ) (kn )=· ρbn−1bn φbn pn .
σkn−1 kn (bn ≤ bn−1 )(23)This reproduces the complete-data probability for the Markov
PSP model.

0where θ denotes the parameters before an update and we haveintroduced variables B = (bl ) and P = (pl ) representing thetraining data consisting of multiple musical scores indexed byl, and K = (kl ) is the corresponding mixture variable. The
results are summarized as follows:
1X
P (k1l = k | bl , pl , θ0 ),(27)
σkini =λl
1 Xll
σkk0 =P (km= k, km+1= k 0 | bl , pl , θ0 ),
(28)
λk
l,m
1 X
(k)
l
δbblmn δb0 blρbb0 =P (km= k | bl , pl , θ0 ), (29)m(n+1)
λkb
l,m,n
1 X
(k)
l
φbp =
δbblmn δpplmn P (km= k | bl , pl , θ0 ).
(30)
ξkb
l,m,n

Here, λ, λk , λkb , and ξkb are normalization constants.
In the above equations, the relevant probabilities
l
l
l
P (km
| bl , pl , θ0 ) and P (km, km+1| bl , pl , θ0 ) can becomputed by the forward-backward algorithm. Defining theforward and backward variables and an additional variable aslαlm (k) = P (km= k, bl1:m , pl1:m |θ0 ),(31)lβlm (k) = P (bl(m+1):Ml , pl(m+1):Ml | km
= k, θ0 ),lΦ0klm = P (blm , plm | km
= k, θ0 ) =

N
m
Y

n=1

0(k)

ρbl

l
mn bm(n+1)

(32)
0(k)

φbl

l
mn pmn,(33)
the forward and backward algorithms go as
αl1 (k) = σk0ini Φ0kl1 ,X
αl(m−1) (k 0 )σk0 0 k Φ0klm ,αlm (k) =k0
βlMl (k) = σk0 end ,
X
0
0
0
σkk
βlm (k) =0 Φk 0 l(m+1) βl(m+1) (k ).
0
k

(34)
(35)
(36)
(37)

Then we havelP (km= k | bl , pl , θ0 ) ∝ αlm (k)βlm (k),

l
l
P (km
= k, km+1= k 0 | bl , pl , θ 0 )000∝ αlm (k)σkk
0 Φk 0 l(m+1) βl(m+1) (k ),

(38)
(39)

where the normalization
factor can be computed asP
P (bl , pl |θ0 ) = k αlMl (k)σk0 end .
R EFERENCES[1] H. Papadopoulos and G. Peeters. Large-scale study of chord estimation
algorithms based on chroma representation and HMM. In Proc. CBMI,
pages 53–60, 2007.
[2] M. McVicar, R. Santos-Rodrı́guez, Y. Ni, and T. De Bie. Automaticchord estimation from audio: A review of the state of the art. IEEE/ACM
TASLP, 22(2):556–575, 2014.
[3] S. A. Raczynski, S. Fukayama, and E. Vincent. Melody harmonization
with interpolated probabilistic models. J. New Music Res., 42(3):223–
235, 2013.
[4] C. Raphael and J. Stoddard. Functional harmonic analysis using
probabilistic models. Comp. Music J., 28(3):45–52, 2004.
[5] D. Temperley. A unified probabilistic model for polyphonic music
analysis. J. New Music Res., 38(1):3–18, 2009.
[6] E. Nakamura, K. Yoshii, and S. Sagayama. Rhythm transcription ofpolyphonic piano music based on merged-output HMM for multiple
voices. IEEE/ACM TASLP, 25(4):794–806, 2017.
[7] E. Benetos, S. Dixon, D. Giannoulis, H. Kirchhoff, and A. Klapuri.
Automatic music transcription: Challenges and future directions. J.
Intelligent Information Systems, 41(3):407–434, 2013.
[8] R. Scholz, E. Vincent, and F. Bimbot. Robust modeling of musical chord
sequences using probabilistic N-grams. In Proc. ICASSP, pages 53–56,
2009.

[9] H. Tsushima, E. Nakamura, K. Itoyama, and K. Yoshii. Generative
statistical models with self-emergent grammar of chord sequences. J.
New Music Res., 47, 2018. to appear.
[10] A. Ycart and E. Benetos. A study on LSTM networks for polyphonicmusic sequence modelling. In Proc. ISMIR, pages 421–427, 2017.
[11] L.-C. Yang, S.-Y. Chou, and Y.-H. Yang. MIDINET: A convolutional
generative adversarial network for symbolic-domain music generation.
In Proc. ISMIR, pages 324–331, 2017.
[12] D. Meredith (ed.). Computational Music Analysis. Springer, 2016.
[13] E. Nakamura, K. Itoyama, and K. Yoshii. Rhythm transcription of MIDI
performances based on hierarchical Bayesian modelling of repetition andmodification of musical note patterns. In Proc. EUSIPCO, pages 1946–
1950, 2016.
[14] L. Stein. Structure & Style: The Study and Analysis of Musical Forms.
Summy-Birchard Inc., 1979.
[15] R. Nishikimi, E. Nakamura, K. Itoyama, and K. Yoshii. Musical note
estimation for F0 trajectories of singing voices based on a Bayesiansemi-beat-synchronous HMM. In Proc. ISMIR, pages 461–467, 2016.
[16] R. Nishikimi, E. Nakamura, M. Goto, K. Itoyama, and K. Yoshii. Scaleand rhythm-aware musical note estimation for vocal F0 trajectories basedon a semi-tatum-synchronous hierarchical hidden semi-Markov model.
In Proc. ISMIR, pages 376–382, 2017.
[17] S. Raczynski, E. Vincent, and S. Sagayama. Dynamic Bayesian
networks for symbolic polyphonic pitch modeling. IEEE/ACM TASLP,
21(9):1830–1840, 2013.
[18] S. Sigtia, E. Benetos, and S. Dixon. An end-to-end neural network forpolyphonic piano music transcription. IEEE/ACM TASLP, 24(5):927–
939, 2016.
[19] C. Raphael. A graphical model for recognizing sung melodies. In Proc.
ISMIR, pages 658–663, 2005.
[20] M. P. Ryynänen and A. P. Klapuri. Automatic transcription of melody,
bass line, and chords in polyphonic music. Computer Music J., 32(3):72–
86, 2008.
[21] Y. Ikemiya, K. Yoshii, and K. Itoyama. Singing voice analysis and editing based on mutually dependent F0 estimation and source separation.
In Proc. ICASSP, pages 574–578, 2015.
[22] S. Böck, F. Korzeniowski, J. Schlüter, F. Krebs, and G. Widmer. madmom: A new python audio and music signal processing library. In Proc.
ACM Multimedia, pages 1174–1178, 2006.
[23] C. Raphael. A hybrid graphical model for rhythmic parsing. Artificial
Intelligence, 137:217–238, 2002.
[24] M. Hamanaka, M. Goto, H. Asoh, and N. Otsu. A learning-based
quantization: Unsupervised estimation of the model parameters. In Proc.
ICMC, pages 369–372, 2003.
[25] S.-Z. Yu. Hidden semi-Markov models. Artificial Intelligence, 174:215–
243, 2010.
[26] M. Goto. AIST annotation for the RWC music database. In Proc. ISMIR,
pages 359–360, 2006.
[27] L. Rabiner. A tutorial on hidden Markov models and selected applications in speech recognition. Proc. IEEE, 77(2):257–286, 1989.
[28] C. M. Bishop. Pattern Recognition and Machine Learning. Springer,
2006.
[29] M. Goto, H. Hashiguchi, T. Nishimura, and R. Oka. RWC music
database: Popular, classical and jazz music databases. In Proc. ISMIR,
pages 287–288, 2002.
[30] R. Nishikimi, E. Nakamura, M. Goto, K. Itoyama, and K. Yoshii.
Bayesian singing transcription based on integrated musical score andF0 trajectory models. In preparation.