Machine learning in Max

arne's icon

I've heard rumours that someone created some machine learning objects in Max, other than Olivier Pasquet's very nice op.fann neural net objects.

Was I dreaming?

timothybone's icon

is there any update on this? I'd very much like to find this...

AlexHarker's icon
timothybone's icon

Thanks you guys!

umma08's icon

Came across this recently, and thought it may help people if they are going down this road....

to_the_sun's icon

It looks like the externals at that link just above are Mac only. Any idea how one could get some machine learning into Max on Windows? What about the ml.adaboost that's used in this video?
https://www.youtube.com/watch?v=69r0a5oLbiY

mzed's icon

You could use wekinator to do the machine learning, and ship the results back to max using OSC:
http://wekinator.org/

mz

to_the_sun's icon

Thanks, I've already found my way down that path a bit. The creator of Wekinator is even teaching a class on machine learning right now and it's very illuminating.
https://www.kadenze.com/courses/machine-learning-for-musicians-and-artists#ng-il671n6u
Wekinator isn't ideal (at least in my case, for the reasons outlined here https://www.kadenze.com/courses/machine-learning-for-musicians-and-artists/forums/goldsmiths-general/threads/wekinator-headless#ng-ilcmvhzx) but it's made it possible which is bad ass.

to_the_sun's icon

What about plugging something written in C++ like ofxLearn (http://www.genekogan.com/works/ofxLearn.html) into Max in MXJ-like fashion? How feasible would that be? I certainly don't have the expertise to know…

terenceformer's icon

This may be of interest, "a set of [mubu] objects for probabilistic modelling of motion and sound relationships"
http://julesfrancoise.com/mubu-probabilistic-models/
The site mentions MuBu for windows, though I can't find it. Hmm.
(I coincidentally just came from a presentation Jules made of this work, at which OP was in attendance. It's come full circle, heheh)

mzed's icon

I'm curious to know your problems with Wekinator, but I can't read them without a login. It seems likely that Wekinator will soon be able to output pre-trained models in some portable format, either as PiPo plugins (part of MuBu) or plain C++.

IRCAM's MuBu site also mentions Windows, but doesn't seem to deliver: http://forumnet.ircam.fr/product/mubu-en/

to_the_sun's icon

Oh, I didn't think about the login. Basically it's just that I would like to automate the entire recording and training process as well and not have to rely on manually pre-trained models. There aren't enough OSC messages to do that right now. That, and perhaps the bit of latency incurred by sending OSC around in the first place.

I found the Windows version of MuBu though:

I guess it's just that the newest version is Mac-only for the moment. The archives have downloads of all flavors.

mzed's icon

It seems like the OSC control messages to Wekinator are reasonably complete:
http://www.wekinator.org/detailed-instructions/#Controlling_Wekinator_via_OSC_messages
I think you can do anything that way that you can with the Wekinator UI, although I haven't really tried.

I'm actually developing a fork of Wekinator, so I'm genuinely curious about your use cases / feature requests.

to_the_sun's icon

Well… It's a lot of the setup of different models that's missing, like model-type and the more detailed parameters. Here's the conversation copied and pasted from that link:

Ryan Fougner Mar 2, 2016 @ 12:19amPST
Just wanted to say that I would also love to be able to control Wekinator from within Max. As it is there doesn't seem to be enough OSC messages to control every aspect of it, plus it would be really great to not have to have it running side-by-side.

Rebecca Fiebrink Mar 2, 2016 @ 12:26amPST
What other OSC control would you want, beyond the ones here: http://www.wekinator.org/detailed-instructions/#Controlling_Wekinator_via_OSC_messages ?

Ryan Fougner Mar 2, 2016 @ 5:33pmPST
Well, ideally, control over everything. I'm looking to implement it in a patch of mine and I'd really like everything to be "under the hood", as they say, and run totally programmatically. I would use an external like https://github.com/cmuartfab/ml-lib/releases if I could find one for Windows, but alas, one doesn't seem to exist.

My patch allows you to beatbox in MIDI, identifying percussive onsets and creating MIDI notes for them. It's working great but right now the different pitches are assigned more or less randomly and it would be really sweet if some machine learning could match the sound you make to the most similar drum sample available. So I would like to take a folder of samples and analyze each one for a few different qualities (onset time, energy and 0-crossings, and maybe a couple more if I can think of some good ones), setting up each one as the sole example for its own class.

So I guess the main OSC control would be one to set the number of classes dynamically, as it would change whenever you loaded a new folder.

Thinking about it more now, I suppose I could set up and save a new project beforehand for every folder I intend to use, but that's a little more tedious than I had hoped for. Really every click that could be automated by an OSC message from the moment you start the program (+ saving/opening projects?) would be valuable, especially if my patch were to be used by people other than me.

mzed's icon

OK, I understand. The OSC controls don't cover much of what you'd need to create and configure new models.

It seems unlikely that anyone will take OSC control of Wekinator that far; you really would be better off with some kind of "native" Max implementation of machine learning, if such a thing existed. Ultimately, Wekinator presents an interface around the Weka algorithms: http://www.cs.waikato.ac.nz/~ml/weka/ It seems like the ml-lib project could be working on Windows, if they had a windows machine to build with. Maybe you could volunteer to help them?

For better or worse you've gotten yourself to the leading edge of this research, and the tools ecosystem isn't as developed as you might need. Eventually, I taught myself some lower-level programming languages because of the things I needed to do in Max. Best.

Spa's icon

Go TO_THE_SUN, Go ml-lib for Max Windows