Heh heh.
How do I explain... Sorry in advance for the mammoth post, I worked on this stuff for about 8 hours today so I need to get it all out.
So I'm writing an AI program that composes music (I've posted about it on here a couple times before). First it just composed stuff (there's a first version available for download at virtualoso.blogspot.com but it won't run on anything but Windows)... then I re-wrote it with a genetic algorithm so that new compositions are combinations of two old ones, plus a little bit of randomness. All the compositions are rated on how aurally pleasing they are, and only the aurally pleasing ones "survive." (Survival of the fittest, sort of.) That's all well and good, except that so far nothing it composes has much of a structure. So I want to use a neural network for pattern recognition, since that's one of their main uses. A neural network is based on the human brain, with "neurons" that have connections of varying strengths to other neurons. In a simple neural network there are inputs that are multiplied by the weights (strengths) to produce outputs. The kind of neural network I want to use is called a Hopfield network; it takes binary inputs (0 and 1 determine whether a neuron fires or doesn't fire) and it's autoassociative, which means that if the output pattern is the same as the input pattern, the pattern is recognized.
So for a basic Hopfield network with, say, 4 neurons, you start by training it to recognize certain input patterns - for example, 0101 and 1100 and 1110. For each pattern, you put the bipolarized input pattern into a matrix and multiply it by its inverse matrix. Then you add all of the matrices together and create what's called a connection weights matrix..
Then to test if a pattern is recognized, you match the input pattern against each connection's weights, and sum all the cells in a row where the corresponding cells of the input pattern are 1. Then if the sum is greater than 0, the neuron fires (it returns 1), and if the sum is less than or equal to 0, the neuron doesn't fire (it returns 0). The output pattern tells you which neurons fire and which don't; if the output pattern is the same as the input pattern, then the network recognizes it.
So basically I'm going to have one Hopfield network for note patterns and one for rhythmic patterns, and each note/rhythm is a neuron, and each note/rhythm either fires or doesn't fire (1 or 0, plays or doesn't play). They will be trained off of music that humans have composed. Then if the computer's patterns are recognized in the network, they should be kept because they resemble human music. So obviously sequencing is important, because C D E F is a completely different pattern than C E D F.
As a sidenote, I think I solved my sequencing problem... I'll just have an array that corresponds to the binary input and store the sequencing in that array.
Hallelujah, the post is finally over.