14.3 Summary#
Algorithmic composition generates scores with an algorithmic process. Deterministic processes always produce the same output, while stochastic processes center around probability.
A categorical distribution assigns probabilities that sum to one to the outcomes of a finite alphabet. A stochastic process models a sequence of random outcomes, like the measures of a musical dice game.
The likelihood of a sequence is the probability that a process generates it. Fitting a process to data increases the likelihood of the data, and counting maximizes it.
A unigram model gives each outcome the fraction of the data that it makes up. A Markov chain conditions each outcome on the previous one, with transition probabilities \(\frac{\text{count}(a \to b)}{\text{count}(a \to \cdot)}\) that form a transition matrix.
The chain rule factors the probability of a sequence. An n-gram model conditions each outcome on the previous \(n - 1\), with \(|\mathcal{X}|^n\) probabilities. A longer context captures more structure, but the table grows exponentially and becomes sparser, until the model simply copies its data.
Linear predictive coding predicts each sample as a linear combination of the previous \(K\) samples, fit by least squares. Inverse filtering splits a signal into a filter and a prediction error. For a sung vowel, the filter models the formants, and the prediction error approximates the glottal pulse train, so we can resynthesize the vowel at any pitch.