68 points · by vsakos · 11y ago · 32 comments
The results were promising I thought. Though I wouldn't call them great (they tend towards long, fast runs that are statistically possible, but unrealistic), they do have a touch of musicality that simpler analysis often lack.
It's all old Lisp code that I need to resurrect, but I found an .mp3 of generated blues solo from an analysis of Coltrane's Blue Train: https://soundcloud.com/spankalee/markov-blue-train
I think getting that high-quality data is one of the hardest things about this problem if you're interested in Jazz.
Music is not a list of numbers produced by a statistical distribution.
Structural relationships are global, not local. Markov chains are nowhere near smart enough to model that.
Or, if you want to get even better performance, you can use conditional random fields with exactly the same global features, one has an advantage of not needing so much data because the distribution being modelled isn't a joint one + CRFs are excellent with custom features (features are observed variables and their distribution is implicitly present in the conditional distribution). Disadvantage would be that you couldn't as easily generate the sequence of notes (chords) because the model isn't generative (unlike Markov chains), but one can use Gibbs sampling (combined with CRFs) to search over the space of probable sequences.
Or, some nicely trained convnets could get you even closer to the brain of the composer :D
Say you want to generate 'verse chorus verse slightly-different-chorus', which is an idea that I've seen in basically every type of music that I've listened to. If you want to generate a slightly different version of the first chorus, you need knowledge of the first chorus, which is not possible with a Markov chain unless the state that represents the start of the second chorus is only possible to reach given that the first chorus was generated; i.e. you need to code in every second chorus possible into your Markov chain, i.e. you need to code in every first chorus possible into your Markov chain, i.e. the human's composed the piece.
The thing with computer generated music is that music is complicated; it's fundamentally not just a set of rules that you can apply and get good music. Yes, counterpoint does have many rules and suggestions that can restrict you, but they don't specify all good music.
In the same way that if you start combining logical axioms and inference rules, you generally just get random useless theorems, combining musical rules in an unstructured way is pretty much guaranteed to get you useless sequences of locally-alright notes.
The correct way of using the rules is (with logic) to start at the conjecture you want to prove and use the computer to prove the theorem correct by working backwards. With counterpoint, it's to compose the music, click the 'check for mistakes' button in Sibelius and check that you haven't made any glaring errors.
Just transitioning from one note to the other means nothing. Transitioning from a C->E can occur in different situations, and can be "right" or "wrong"
The most pressing issue I see is that it is memoryless (Markov process), also the apparent lack of musical knowledge of the author.
That makes thing a quite a bit better, but it's still a memoryless process which makes any apparent motifs only generate if you happen to walk a similar path through the STM.
There are a lot more bits of state that you can track in the analysis to fix things up, but at some point you need to build up a memory of what you've generated and use that to modify the STM on the fly.
http://www.amazon.com/Algorithmic-Composition-Paradigms-Auto...
And some more examples:
Edit: Try listening to only the first bar of each sample at the bottom of the page. It almost sounds like the beginning of a proper composition. The only problem is that subsequent bars don't match. Fix that and I think there's something great here.
I'd like to see something that combines user-guided evolution and markov chains.