Hi all, I’m wondering if anyone here might have experience using the ann library with Pd (or with neural networks in general)?
I’m experimenting to see if I can train a neural net to output common note sequences within a scale based on chordal input, to simulate basic improvisation patterns. My general training approach uses 2 inputs & 1 output (inputs are current chord & current melody note, output should be a new melody note within the scale). As a simple test, I’ve been training with major scales only (running up 2 octaves).
The tricky part seems to be encoding the musical data in a way that properly trains the network, as well as decoding/interpreting the output. The ann help documentation says input values should be normalized from -1 to 1, so midi note numbers aren’t a good choice for effective training.
I tried several different approaches to encoding:
-scaling note numbers to normalized range from -1 to 1
-converting melody note number to binary (tried both -1/1 and 0/1)
-one-hot encoding chord/melody note data (to form one large vector—12 values representing possible notes of chord, and 30 values for possible melody notes between midi # 58-87, with each position -1 if absent and 1 if present.
Using any of these methods, when I run the network I get output that doesn’t make much sense. The binary/vector output is a list of floats that range from -1 to 1, as expected, but the distribution is all over the place. Sometimes I get something that looks a bit more like a note vector, but not in a way that clearly relates to the sequence I was using during training. So, either my training/encoding methods are wrong, or I’m not interpreting the output correctly.
The documentation examples are very basic, and I couldn’t find much online as far as examples of complex musical training for ann. I also tried out ml-lib, but it seems pretty unstable on Mac (lots of crashing, and also far less documentation for the Pd version than for the Max version).
So, just wanted to see if anyone else has succeeded in doing something along these lines? Thanks in advance for any suggestions!