It's possible to use Machine Learning techniques to cluster songs into musical-scale groups? I mean: "this song was written in C"... or "this song was written in Am" etc. I made a fast search about the subject and I found no software that can do this. If you know some software, or research (academic papers), related to that subject, could you link it here for me? I'm very interested in that subject but I'm not sure from where I can begin. I have a little experience with Random Forests and Neural Networks, maybe I can accomplish the classification task with one of those algorithms, but, again, I'm not sure which kinda of features I should pass to the algorithm. Thanks in advance.
From a very high level -- You can convert the song to a spectrogram, there are a large number of implementations to do this. From there you can analyze the sound waves. In the case of the key, for instance, the note A is equal to 440 hz. Look into FFT as well. Hope this helps get you started. I know spotify trains neural networks on spectrograms of songs to find similar songs based on "sound".
You can take a look at Music Information Retrieval Evaluation eXchange (MIREX). An annual competition with number of different tasks from MIR. The most relevant to your question being Audio Key Detection. Explanation papers for the used approaches can be found here.
In terms of library for extracting knowledge from audio signal I'd recommend Essentia. There are numerous features you can compute over time window in a track including tonal descriptors (key and scale).
Once you've built discriminative representation of a track for your task you can use any supervised classification model fed with labeled data. There are several musical datasets on the web labeled with track information. Take a look at GTZAN, each track has genre, tempo and key as meta.
I kept searching and I recently found this and this articles that seems to be very promissory. I think that if I can identify a good number of notes from a music, I will be able to identify the music scale itself.
If you guys have more material to suggest on this subject I'll be very grateful.