Articles

Content You Need: ml.star update

Benjamin Smith made a splash with his initial offering of ml.star, a package of machine learning objects for Max. Thanks to nearly 4,000 downloads, Ben has gotten some good feedback and a few bug reports. In this new update, ml.star is back with fixes for the reported bugs and two new ML objects - ml.hmm (Hidden Markov Model) and ml.markov (Markov Chain) - that provide two classic machine learning techniques popular in computer music.


Here's what Benjamin Smith has to say about this new update:

New with the update are ml.hmm, a Hidden Markov Model, and ml.markov, a classic multi-order Markov Chain. Markov Chains have been around music and Max for a long time and their potential is still immense for generative and improvisational mimicry music. The Markov Chain looks at where it is ’now’ and works with a set of probabilities about where it should go next, such as: “I played a C, and in this style I could play a D or an F, but most likely a G.” If you feed it music it can compute the chances that any given sequence of notes is followed by another note or chord or sequence and then generate it! The same holds true for any sequential data (images, text, continuous control data, etc).

The Hidden Markov Model is a mainstay of modern machine learning and artificial intelligence, and is used extensively in the Music Information Retrieval world, where it is a gold standard measure for many pattern recognition problems. The HMM assumes that any stream of data we can observe or hear (music, images, gestures) is being produced by a stack of markov models, that we can’t directly see. It will find a set of hidden states to explain the sequences and data you give it. At that point it can respond to inquiry (“is this new sequence in one of the styles it learned?”) or generate new material (“give me a measure in the key of C#!”).

Have you used machine learning with Max? We'd love to hear about it in the comments.
The ml.star package is available in the Max 7 Package Manager.

by Andrew Benson on May 22, 2018

Creative Commons License
yaniki's icon

Thank you! This is great!

TConnors's icon

Good stuff!

Francisco Colasanto's icon

Great Job !!! thanks

nouserid's icon

Thank you!

Abao's icon

has anyone compare this with the one Jamie bullock made?
for example the mlp object seems lack of scaling function in ml.star lib, and with less modifiable parameters.

https://github.com/cmuartfab/ml-lib/releases

ENES ENES's icon

This example of ml.fcm crashes when I send the four melodies (lists of MIDI pitch in Bach format). It crashes as soon as I send bang.

Max Patch
Copy patch and select New From Clipboard in Max.

Hugo Aymé's icon

ml.markov is the bandmate I always needed

redhexagonal's icon

Thanks! how do I restart ml.markov from the initial condition once I’ve built it? I can only restart after build which can take a while

11OLSEN's icon

I see this
Error 126 loading external ml.scale
Error 126 loading external ml.principle
in the console on Windows.

Where to report this?

Max Gardener's icon

I would suggest that reporting to the developer directly would be the best course of action. It's also an opportunity to thank them for their work. :-)

11OLSEN's icon

Ok, I didn't notice the website link in the package first. I am very grateful for this package, and I don't think that a bug report should be interpreted as a complaint

Max Gardener's icon

I didn't mean to imply the connection between bugs and complaints. For me, it's more an exercise in mindfulness. While there may be people out there who equate bug reports with complaints, my experience is that more people read notes from their users and think, "Wow. Someone's using my stuff! I wonder what they're doing with it?" :-)

TFL's icon

Hi 11olsen, did you eventually fix your error 126? I get the same one with the same objects.
I know it's been more than a year though. If no answer soon I will ask Benjamin.

11OLSEN's icon

No couldn't solve. This error indicates a missing dll, i think