Musical use of descriptors discussion

Real old bump here, but as I mentioned in the other thread, based on some chatting with @tremblap this week I revisited the “onset descriptors” patch idea and came up with something that works significantly better.

Where the previous version was going wrong was that I was detecting an onset very quickly, then waiting 15ms (in Max land), and then analyzing the last 20ms of audio using descriptors~, with lots of Max slop in the mix. So not only did I have to wait a fair amount of time, but I wasn’t sure that the section of audio I was analyzing was what correctly corresponded to when the onset was detected.

So at the moment the onset detection outputs a sample accurate moment in time which will then be analyzed by descriptors~. The output of that happens with Max slop but, critically, it is analyzing exactly the right slice of time.

At the moment I’m using FFT settings of 256 64 for descriptors~, and in keeping the overall analysis window a multiple of the FFT size (as per @a.harker’s suggestion a while back), I’m analyzing a 512 sample chunk of time, which equals 11.61ms, which is also the latency of the process now.

This this is a bit faster than the previous version (12ms vs 15ms) but it is significantly more accurate in its results.

Give it a spin, particularly with live sound input (mouth/voice sounds are great for testing). The red subpatch p streamView is really useful for seeing the values over time. You just have to make 50 onsets before the zl stream starts displaying on the multisliders.

Let me know what you think:


----------begin_max5_patcher----------
8867.3oc6cs0iiibc94Y9UPHDXrqcOJ08pXrWCG6GreHNI.FHAAqCFvVhcOb
G0hJRTytytvyu8TWHoHEKRV7ZydZMX2tUSQIdpu5TmaUcNme4suY08w+T3oU
d+Kdeu2adyu7127F8kTW3Mo+8aV8TvOsYWvI8ssZS7SOEtOY0cl2KI7mRzWe
Wb7G8h168gvigYu4tn8gahOuWeGnzKdHHYyGh1+36OFtIw7jQ9j0LDlCEHFT
9SN8NOJCrVfw..W.Qx+lIVCtyCyWC79eS+l1e9on86BSzDF7xEiOmjcUP5Ui
1pIx36+g2gfYj28mu+9cg5Or5B+i29V0OtyQfXe3OJ+5pfCG71DGuyK371n3
iAIgdAOcXWTx4sgd2GbJbqWPRRvlO5sMLQN9iO1YrhwVK3kwJHQrV8KFRiQz
tgQPKXjeFYYtujOeHz73WcJ5w8A6Vk+.zjX3wTfJEodypGh1E9ovimhh2W3Y
7lUAGNT3xuovGQAu+Pr9KRbW9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L6a
+IiF1SF5viFxub3G68Spb4VntAIZDdRTWdRPjc3DLCO5of4kfb3ImQdC5Igc
hakMFOIWFS5ANdnOInqrLvA9jtZYbCn2feRLGdRWs9+pyiuz6WoB+xFmgvzq
caBxPseaiMCuSCuxmI9wZUd4bkokBjwvdRtHOgMFqpQnNvsLnmDrTB4zD5Aq
kuDUkgifYq4DeAjI7ITSTaPLtC22Xyd3z.7JdnQZQAjMWZAfHGFjYkY5g+jZ
kyjMVOITaZADi0SB21SBT8QYLrO3vA0obL810OEo+P+fwKMwc5+LZu4O0tOr
5X3mhxtecSZaUvwMpCN8ljyGM9.8SLSKLY0SwRdw8miRYG0G3jqxsEynskbZ
4pSdyu715N5qYGUE64uRexckdl2J8LmUre5Vq+jsVyoZM63zb2aq+vAU9fAU
j0yRtnz+IfqOyw86j+1y7Moe4ZxnMIXI9.MmWI8JmR5e9jLjbIou4QxfxgjA
l+HCdAQ07Dw9BCGxMjASKkNY41Iidk2GtlyGc8jxOJC3B40QqHua4xwnPVk1
CswVVYmyMidlWF8Tx7HKrbj3pJu5vsYwh4YgCbWskaEClypZNT37xbmxahwh
.KleDNSgNkSDiDEVL2Gbl.cJeGFIBrTdM3NE1RtLLRDW4bVvcMMtjmBMmiBC
e.TIWDbl7c5X3OXBrRdF3fbGGysfdkWAca.YbgTu2YpQzoCAFWS0aw1a+Gu8
+GfxG3SJ
-----------end_max5_patcher-----------
1 Like

Can you explain how you’re patch is more accurate? I am missing something here.

The results are more consistent, I should say. Whether or not they are accurate… is another thing. But they do feel more accurate as well (when comparing ‘real world’ sounds).

The main difference is analyzing exactly the section of audio that is relevant to the onset, whereas before I was doing all of that in the Max domain, so being much more approximate with the analysis window.

As @rodrigo.constanzo explains, they will be more accurate for a simple reason: doing very short analysis windows bring their range in the ballpark of the Max slop. To be even clearer: Max’s slop is variable depending on the SVS and the load, so +/5 3ms is not rare - if you S&H your address after the attack with that slop, and only analyse a small window, on very percussive material, you can be within very different states of the sound you are trying to describe. If you do consistent sample-accurate S&H of the address, it is still imperfect, but you analyse about the same distance after the attacks, so you get a more consistent value.

A good test for you to make sure you understand: take a single sample (the same snare shot, no randomness) and analyse it via both patches. The ‘message domain’ values should be much more different between hits than the ‘signal domain’ one. I have not done that myself, but I did it elsewhere and it made a major difference…

1 Like

Ok, here is that test/comparison. I’m really blown away by the results actually.

Here is the old version (Max domain, with slop), run on the same snare sample, in a loop:

The centroid isn’t great, but the smf is a mess. Surprisingly the loudness is ok, but it could be because I’m requesting the maximum value, and that statistically stays the same regardless of the slop.

Here is the sah~ version run on the same loop:

You can see some tiny variations in the histograms, but the stream view shows exactly the same value 50+ times.

Absolute night & day difference.

edit:
What is curious is that the loudness reported by both is different. I’m wondering if the newer version is under reporting loudness since the window may not be big enough to capture the peak peak of the audio.

Next I’m going to try to adapt the bit of the code that created some ‘gestural’ data for each attack (waiting a bit longer and stitching together a temporal contour of the descriptors).

1 Like

which attack detector are you using? overnight i had a new idea (devilish grin emoji that does not exist here)

1 Like

I used both versions of the patch as they were posted in this thread. So both use your same onset detector, though there might be slightly diff tweaks between them, but neither uses the newer ideas you posted in the other thread.

Curious what you have in mind!

(evil grind full on)

This is it. The fastest, nervous, crazy, musical relative attack detector. It takes the slow fast one (my original) and the tweaked median filter one I optimised, and take the fastest of the 2 :wink:

Enjoy! It even rocks on brushes :wink:


----------begin_max5_patcher----------
3853.3oc6bs2aaajD+uc9TrUnnvtQVl6x20w8hatl1bHIMHNAEA0EFTjqjXL
EoNRpXqqH4y9M6CRQJQZSYQJETTCaJ580ryuY1Y2c1cze8nC5ML5VZROzOf9
CzAG7WO5fC3IwR3.4+ePuoN25F3jvKVuP5MQC+Xu9hrRo2lxSdd3LG2qQDcE
zwlJHLFg0P1H7.UDYfdVw883EFZfi00xRLZdZ.MMcwLpnezyOLsW+69iQAQN
EdA8mx1Jb9T+Pn038UrLwjzEA71tWukESPUd4LkoNyI0che33qhotoh9hA1X
fRejlN6I1j+ODx.EzexpxmeziXO5ucPGvAdCcBGWEH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aOJE2DsHhQaHa0ahrsMVyFtIVW4cGbaKIsZBbhaig
JlMlI2MvoV0voR2SZNb15CLTajonVYNZkc0pAHMYQx31Xg+3lfd5psvj+XbS
ozVuEilL1tMre0jIhVwPSKMdqIT1ztKVsXSFBn1JSNn03kXr0pl5MlTa6VWH
MZZb7Z3mv6RqDXFLhrR.YrRvXrdfXTePXrZ.XvC9Bgu0VwiV4GmyTmaMxue3
YQzPYDf4FWdHXbkeHquW7XpW9nPnXT9aqOrLW4CkAKcakiqKMLsT3cXwJgkp
MAavdyTw1RQS15OZY7jvNmEnpq51vdSgdue1fyhR2RLbAuXVMKWpKoQT0I7H
NQ0jnqweiXpoia6tUoSbo8jEi7CBxYnhAOTlSZ6MN1wye4kGRx+3bYhA7iY+
JeqTD3vqFIqZlVV.x0ux2VuZY0hXqfs4xdUorm8FjDdkZ4DNVFdKlEhQiYwQ
yhhyiymAp14kedZTNilY9N+h4Vs3q7nilIEKdP.MP6hKyz.0JEB+MfmUsaSM
qTmY2Umo3g6BFudoSZD5krH5o2Cg9Pc97i9+.DQqJ6.
-----------end_max5_patcher-----------

Thanks for the explanation. For some reason I thought that everything was in the signal world until descriptors~ for previous examples.

Cool - new test for Rod. Play a snare by hand as consistency as possible - compare the two patches (i.e. what happens in the acoustic world, where exact repeats don’t exist.

All of my sound cards don’t really work at the moment (!!), so hard for me to test it with live audio, but I ran some other training data I had with more similar hits. They aren’t the same same, but are fairly consistent.

It’s a loop of 7 hits.

And with the old version

Whoops, here is the old (Max slop) version for comparison:

The centroid looks alright here, and sfm is a mess again though. The loudness does look better, particularly since the snare hits are all quite similar in dynamics.

Hmm, definitely need to improve things there.

What’s surprising is that the window is big enough for the centroid to (appear to) be meaningful, but the loudness is way off (or rather, way inconsistent).

Here is the audio file I used as a point of reference.

snare hits.wav.zip (520.3 KB)

Ok played with it some more. It seems like that the settings for thresh~ have a massive impact on how the loudness is reported. Using a thresh of 15 20 produces more perceptually relevant results, where as my “standard” settings of 10 15 produces more erratic ones.

The first half here is 15 20 and the second (right side) is 10 15:

Where it gets weirder is that if I start and stop the audio playback, loudness reports a really loud hit on the first return. In the second half of this you can see me turning playback off after two hits, then starting it again. So it goes LOUD soft LOUD soft LOUD soft, even though the hits are fairly similar in dynamics.

One thing that sticks out to me is that you (@a.harker) specifically mentioned analyzing a window that is a multiple of the FFT size, so I was going for a window size of 512 samples (with FFT settings of 256/64), which turns into 11.609977ms. If I try to analyze a window that big, Max averages it down to 11.61 (as in, I can’t make a - 11.609977 object), so maybe that tiny bit of a semi empty frame would have something to do with this?

edit:
One more point of reference. The first half of this is a quiet noise~ burst (0.01 in amplitude), and the second half is a loud noise~ burst (1.0 in amplitude):

The idea here is to try on the exact same signal. If that is not consistent, then you cannot trust the patch since it should be. You have proven it is better with the new one, so stick to it.

As for thresh and varying signal, it makes sense. What you should do is to take the new fastest version, and listen to the sampled grain by ear - that is always a good start for me (I trust my ears) to identify if I get what I expect - if erratic, then I can troubleshoot before descriptors.

Also, be careful with @a.harker descriptor object. We have in other thread talked about errors. In my performance patch, with the current version, I sometimes have to re-send it the fft parameters to reset it. @weefuzzy had similar issues in his. It is a hard bug to reproduce, but again, it was affecting energy readings quite a lot so it might be that.

With the same exact signal I get consistent (but not the same) results from the Max and MSP versions.

I’ll try listening to the grains and play with the window/delay a bit more. I figured that even if the thresh was reporting a diff slice of time (all inside the MSP version) that grabbing a bigger window and/or waiting longer (or less) to analyze it would make for more consistent results. What I tried so far on that front didn’t have much of an impact but I’ll do some more testing.

I do remember there being some talk of problems with how loudness was computed, but it was odd that the Max version’s results looked better.

what I saw in the graphs were that you had a lot of variation in the Max one, and much more focused values in the MSP one.

the bigger the window, with consistent distance from the trigger, the more consistent I would expect it too. but again you might reach a size that makes it too big and starts to grab stuff elsewhere (other sounds)… a typical loudness measure, from the ITU paper, is around 400ms to be perceptually accurate… I recommend this kind of geek paper if you want to see what the cutting edge commercial algorithms are doing:

“LOUDNESS METERING: ‘EBU MODE’ METERING TO SUPPLEMENT EBU R 128 LOUDNESS NORMALIZATION,” n.d. (https://tech.ebu.ch/docs/tech/tech3341.pdf)

Don’t forget that I highpass the signal too, so getting energy might be problematic if your signal is low-end heavy…

if you run it again, you might get different results. That is what killed me in my piece - i got the bug, then ran it for hours without issues, then got it again. The fft trick saved the gig, but it is a strange one…

Yeah super sloppy, but the loudness even in the Max version was consistent. (surprisingly perfectly consistent)

I didn’t do that at all, so I’ll try that. And actually, I can probably pull up the bottom end of what I’m analyzing for in descriptors~ land as I’m querying for 10 20000 in terms of frequency. If my math is right, an FFT size of 256 would correspond with nothing lower than 120Hz anyways, so I can chuck a hipass and then query for less inside descriptors~ too.

1 Like

be careful

it will still represent the full signal, just not with much precision in the low end for analysis. I think loudness will take the energy in all bins, including DC, so it should not change much. you can send test signal to it at different fft and it should not change amplitude - but if you only get a part of a wave, yes, it won’t represent the full energy. that is why they use 400ms for loudness in EBU (but then they have filters to represent roughly equal loudness contour and such)

So I’m working on a version of the “onset descriptors” using the new fluid.buf...descriptors~ objects which I’ll post as soon as it’s done, but there was a lot of chatter on an older thread on the Max forum dealing with this same problem that threw up some interesting links I hadn’t come across before.

The HandSolo: A Hand Drum Controller for Natural Rhythm Entry and Production

Real-Time Hit Classification in a Smart Cajón

Hybrid Percussion: Extending Physical Instruments Using Sampled Acoustics

2 Likes