Video blobs trigger midi notes

Mar 28, 2013 at 11:47am

Video blobs trigger midi notes

Hey there,

I know it’s a long discussed subject in these forum pages but being novice on max and following step by step tuts and advices to build my patch, I’m stuck for a while trying to solve something that seems simple but just drive me crazy.
Here is the thing: I’m performing a blob detection on a video and extract blobs infos (via cv.jit.blobs.centroids) to trigger midi notes. What I would like to do is trigerring a midi note “on” message whenever a new blob’s detected and triggering a midi note “off” message whenever it disappears. The problem is that my blob continuously output bangs which continuously reset the midi sound produced.
I tried to filter these extra and useless bangs out with several objects (onebang, change, zl change) but can’t get it to work.
Any suggestion will be greatly appreciate !

Apr 16, 2013 at 10:08am

Well, no answer yet, maybe my question’s a little abstract, here is my patch, guess it could help to visualize the thing (you’ll need cv.jit abstraction to play it).
When you load a video (Read) and the blobs detection’s performed, it triggers continuously bangs on “noteout”, but I would just need the first one (basically to trigger a note) and a release message when the blob disappears.

Apr 16, 2013 at 11:43am

I deleted from my computer, so I can’t check it now, but this should be something like in modified patch (attached one).

Apr 16, 2013 at 4:00pm

Cant check you patch at the moment but….

what might be worth checking out is cv.jit.touches as it sends out a ‘mouse down’ and ‘mouse up’ message when it detects a blob, which you could convert the note on and off?

Not sure if the blob tracking would be as precise as what you need tho.

Just a thought,



Apr 19, 2013 at 8:43am

Thanks for your answers, gonna try this out this week end !


You must be logged in to reply to this topic.