Yes, got it working!
It’s still a bit unclear as I mistook the sprintf classifyPoint entry JIT-labels %d
as being where you set which drum you are training, but you’ve now made that “automatic”. So I guess this is where you set the max amount of labels you’re going to have?
I’m going through the patch now and stripping all the bits out so I can try training it on other drums and seeing the response time. On a quick initial test (testing center of snare, edge of snare, and hitting the rim), it worked well!
edit: (edit:)
This is the timing from the initial onset detection (fluid.ampslice~
→ edge~
) to when a value is returned from fluid.knn~
:
(I cleaned up the patch some and got to these numbers now, which are waaay faster for some reason):
So pretty damned fast! And not too much slop.
As an aside, is there a way to get a distance value returned for each match? so if I play between the center and the edge, I would get whichever label is most appropriate, but perhaps a number associated with how close it is between the two.
A small coding thing, doing the edge~
→ snapshot~
thing will sometimes return the previous frame (an issue I was having a while back), which @a.harker/@weefuzzy suggested the following as a fix for:
----------begin_max5_patcher----------
2864.3oc0bs0aaqaG+4jOEB94TCdQTjbuc5Nm0Ar1sCV6PwPwPfrEiiZjkLj
nSROGz9Ye7hjLkrjrThxklGRYIMk9e82+KjN+44msXU18hhEd+Euu3c1Y+44
mclYJ8DmU9+Oaw1v6WmDVX9XKRE2ks5qKtvtjTbuzL8NurqtpPHqVHNxLs5i
9FFtZxr8xDgT9scB6abwBu+W4R6BkquNNcyk4h0R6pPr+RvEd9P9x.meHTjZ
RldIDZIn9Ijteabp5waHSvgIsuTyrP2WlHujKKYyyVbUbh3VQdQbVpym9rEg
614L8YNaQKa9Zl4Awtndp3T6Tv5oxE2FWseb8rg4JVVp3284FAxh6C7Wb3wj
EIxS2GadR1I+94UjjQejFtUTrKbscyZ0V0xGDhHTfVRA8M+ieobyGbPvoT3a
RxVeiHxQvozU6Dowo6xEEhTYnrj3qWNRbU39D4kWkkJKh+CCI.UpitV+pRRr
yE0Lgg9+k73vjZNXSdbTVplHZnJzSW85TVHDCuQbYFymHMbWGaVYLpjK8rXg
hI2WrJLWqoVkXdCnpEkYYIMWpdeIhqjkKuKNMskTTlsq+Eyi2b8.6cUlZwsC
8rMqTb49T6pWpLJj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y4e+7+OfdefPB
-----------end_max5_patcher-----------
//////////////////////////
I look forward to hearing back from @groma and @weefuzzy with regards to the more ML-y questions, but I’ll add one more to that pile.
Is there a way to setup a centile-kind of rejection of outliers for training data? Say I’m training a region, hitting it like 50 times, and one of them I missed and hit the rim by mistake. Can I specify that the training is only done on the central 90% of the points, ignoring outliers?
And I found this from the documentation of the Sensory Percussion thing, in terms of how many hits to train each point on:
Center: 50-100
Edge: 50-100
Rimshot Center: 30-40
Rimshot Edge: 30-40
Rim Tip: 50-100
Rim Shoulder: 50-100
Cross Stick: (30-40)
Damped Edge: 50-100
Stickshot: 50-100
Shell: 30-40
So a fairly high amount of hits, although they do do that outlier rejection stuff, so some percentage of these would be presumably thrown out.