I would like to add one technique based on a positive definite kernel over the natural numbers: $$k(a,b) = \frac{\gcd(a,b)^2}{ab}$$ Details of this method are described [here][1]. Music generated by this method might be found here as an example: https://www.youtube.com/watch?v=EbrEBeDqq24 or here https://musescore1983.bandcamp.com/track/for-us Disclaimer: I made all this... :-) [1]: http://orges-leka.de/knn-music/Measuring_note_similarity_with_positive_definite_kernels.pdf