'real-time' onset detection example

Oh nice!

@a.harker is the one that suggested this thesis to me a while back, which I did my best to try to implement some of the ideas from.

This sort of postprocessing is exactly what I am working on right now for our forthcoming onsets object …

2 Likes

Now that @groma hinted at it, I can say we have amplitude and spectral onset objects coming indeed. I like the amplitude only version and @groma and I have a meeting on this very soon indeed… stay tuned!

1 Like

Awesome, can’t wait!

I imagine it’s already a design consideration, but one of the main places I find most algorithms lacking is when doing things like rolls and buzzes with drums.

don’t hold your breath on these - they are incredibly difficult. But by giving you access to a few different segmentation, with parameters like fft size and that jazz, you will be able to experiment and find a creative solution!

Totally.

There would be little I could do at a parametric level to account for algorithmic/design decisions, so just putting it out there as a use case you could test with.

1 Like

I also have an idea of feedback (in the cybernetic sense) to kind-of-auto-adjust those in Max, I’ll tell more about it here when I post it. More very soon!

1 Like

Just to throw my 2c in here. I don’t hear a roll as a series of onsets but as a sustained noisy sound. Perhaps an onset detector isn’t the right thing to be looking for, but some sort of zoomed out classifier :slight_smile: and all of a sudden we’re back to the other thread…

it depends on the quality of the drummer :wink: (although @a.harker has agreed with me that the poor quality of Quest Love press roll in the intro of Booty (Badu, 2000) does not make him a lesser groove machine after in that amazing track) a press roll is definitely a single perceptual object, but there are other types of rolls that are iterative by nature, and would be ambiguous in Schaeffer’s taxonomy!

1 Like

I agree with all of that, but I guess as roll I just meant many fast hits in succession.

So after spending some quality time with @weefuzzy on this, it seems that the thesis is doing spectral frame processing and offers some other exciting ideas… and that triggered a lot more ideas too :wink: I’ll need to check bonk~ and aubio performance in pd… stay tuned!

1 Like

Ok, based on a cool hang and chat with @tremblap this week, I’ve incorporated some of his sample-accurate funny business into the differential-based onset detection patch posted above.

The only thing that’s different now is the velocity side of things. It has a latency of 2.5ms now (vs 15ms in the previous one) thanks to the sample accurate-ness of the onset detection and envelope follower.

For some reason the first onset it reports is always wrong (it reports a dB of 0.0 (0.909091 after scaling)) no matter what the input is. I don’t know if it’s some weird signal-rate order of operations stuff, but I don’t see why/where this would be happening, and why it only happens for the first attack.

But other than that, it works pretty well.

Give it a spin and let me know what you think (and if anyone has thoughts on why the first onset is wrong, I’m all ears too):


----------begin_max5_patcher----------
3589.3oc0b08aqaaE+4b+qfvOTjL3qm32RqMEsaCX8kAzG1a8VbgrEsiZkk7
jjStoEM+suCIkjsjksksXRyBPbbHoD4uy2mCozu+galLO6KphIn+F5mP2byu
+gatwzjtgap9+alrN7KKRBKLCaRp5or4+xjo1tJUeozz7usNbC5iBuYHwLD7
IdV8P1DVt3g3zUeNWsnzNSRxLuoHoOdFmQ88YDojxnR9TD1yzEA9D8yU2fzs
qiSSTkl4muqwrsk0shqZMNxrXfE3Gox5EfcbkOuQYm8ISP+rtm+3CeP+wzwA
7UgkpWPDD9D3kvnF.Sjy39BLwS3wYBeMf4AmFujdwK4P7R7OJdKhWkFlLYZy
2bI9UQqTubBri8XZDJjxYBhOkKBnTdfgYyNCuFOTrKoGE6yCSWoQt4utD2Eo
gaJdHq7kyKmSwZnyvx.KOWvtFddOx3RxQw8xjrvRmB3EO.jvAwpAwbgzCXxD
AVhsh47qgU2GjwmSL+sT3tVwtGKYNS312+OAg6vGNubMGPMVRHLLA6Y0nkTG
IYKjukrYXEBC6THlELS.+HwRNIf.5w9.GFLoICjTJQJnhJAcew0PAXGRAXjg
aOeZs99zWCE+HUR3yufvXO8umR+mX.OGz+kbN7eAbJlnIJANRrf7lp8uIWsQ
kFgh1lGVFmkdBnSk9y38a5KHvQl9HduMQzrtnLqHb8lhSoPPIdZ.y05.XhOI
f6G3as7AM4FKe3fAnB3d48UpzWPeWMSGgkB1obA3SOV7MXByQrd14E62eEpx
qPcEruYxx3D0ip7BsT7to3lIga1rWy2r2knoU+Rl4F4Osoo3TaSdMMkqdLt9
5oMsFlCzoRfHsM2rRm7kFhn91jEoxS2FaVJ1FAtV0RxveRCWqJ1DtvdwQEal
Abk5avj87DA9fzNfM5XAXC8ly71QvAYfUIYK9UUz9K6IYfhcbJnfWnRKsJ26
2cjZY31jxOuLKsrH92LqBr1oWO8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FKM.O.1pCLiEHLPif4yf
7Qa8Xiw5umwBLugjH5IAFdH.iXW9XtPGNtutx41eHSOQetnpWmCb0ob85Wes
N1FFd80HAyn5e39RASv70N0F53z4ie3Q1fHNrrG8LRW60hHFbJ6ithmhg3Xv
LUiVLaPlhIt.TCIhSlKjm8F9D45bSF0BGOjR0zAcuSV4j2nPkk1C21aanx3g
jwQfvAhtMU767piiepFBnNLXO6FG04cgjdR57NPpy6+nCe2Gc726QcemGYde
GYe2uzYypZ1Vt0geQz7NZo9sJTaJP3hEpzxV5K9ZANPNgfE5uIAG3dr1xesd
KErKjgJI1cNYz6bnYjeNNUSYTmqplSq3V5i5P2WqMSVCq935rc1m61Bv6cF.
6Gxs.KiPA+k5EBUpqDj9afk.N10Kq0phhv5G879WXyWsLNIoY4s+aeq58sbx
p7vn3cGTjJzfa3cl2wfS68a38eMPYtLR8kAVBA5vzd+1gWV8UQB7vAFYDZkL
h9aPS3NWUX5ppWXTx8dqGsIOaSVdyaNqYPhD0ieaYVCPqyts4E7kqjpZqcLL
t39OFhCP5xrVXfXkmwGCCnRzfqVxxZjom2tYZT7g+3C+OZKcmv.
-----------end_max5_patcher-----------

Sexy!

A few ideas for improvements:

  • we used 110Hz instead of 250 for the high pass - trying different values there will change the nervousness / sensitivity to the bass - I use a 4th order highpass now.
  • I now do the dB conversion before the slices (as discovered in a compressor paper)
  • I now make a minumum of dB for the silence instead of an absolute. It does the same thing and is cleverer :wink:
  • the steepness of the slide~ for the fast envelop will give you access to how nervous it is

Ugly patch attached - it is more nervous, and yet another variation. It seems that none are perfect, and all work differently. I use the brush drum to test.


----------begin_max5_patcher----------
2176.3ocwaszjaiaD9rleEnTkZqYpRZBdwWYiS4bKG1C495TSQQBog6RQpPB
YOSbY+aOM.H4PJQpgTBZjWuTz3Ui9qefF.M+9cyluJ+EQ4bzeC86nYy99cyl
oKRUvrp+8r4aCeIJMrT2r4qSyy1uc9BSUkxWSE5xqKIeuLUHkutSXFUnBz7U
gYali9OUMYW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RsF5ESI9HHzAyFchTOryfwRY5X.SUBOe4RMuQPIUh
1BQZdYTpVI6zJHjOH4la+hM7kAl3wnaFXAVjMFwF2BRMmwH0XbanIRFql3kR
owHjTYt6ESHe1XcUcohIe5H0GtXVBOFqX70vo3nH8glfVxxdLtTNPZ2PY5kY
oOJRaiEVUiA88LK7rDgHumbzwRD5cUXrhuKmQqZRuTRwGMo55TwDJ4A4EuhJ
GjO7GjK7GmG7CmC7Gl+65be2DS9Agu1rQAHTd2lzysNgx6BApcOpy.9mRxTy
81GO4aOZkI7yCihfnq6j079pl4yBnDW0ad3.eLuau5jm8jpwr5A9QmZvbQk3
p.Hwga2X9VX1mT6tos3sCC2ZKK8yxcl5bJygpS3elG0gqei5wcHUSeqMs57k
RZKYwpMqSRSaXn1e6F0aJa9lhv3j2t8oJ9mzH6bg+3sn2257APn6Fstad99.
xsn22Nta08hFfIAZcDVkNh5MnHxA8B1Dd0WWfWqTjeWQ9t7hlOyhGYAMseuL
ugQaxiz57hrewWWqiwIEa+gNMBsKsLiCpUXp9MfmYA1TyRFt6TSl1Ga.3852
Bk4neS8AUL+bnOzmeb2+GAw02lA
-----------end_max5_patcher-----------
1 Like

Ok, here’s those ideas incorporated, and tidied.

I have to say I find the slide~ 1 2205 waay too nervous. I get those almost ‘late’ onsets all the time (with brushes). 5samps seems like a good middle ground while still being fast.

I still get the same “first velocity value is wrong” problem, but the normal onset side of stuff is fast/updated.

edit:
It looks like I’m always one onset late, hence the first one being 0.0, so I’ll troubleshoot that and post the fixed version.


(I removed the code for now)
1 Like

Ok, I’ve played with this more and I can’t seem to fix the problem. It seems like an order of operation thing, but nothing I’ve tried seems to fix it.

It’s this specific part of the patch that’s a problem:
45%20pm

It’s super inconsistent too as sometimes I get the correct value, sometimes I get the previous value, sometimes nothing at all.

I’ve tried delay 0 0 (and up to delay 20 20) before the change~ and before the snapshot~. I’ve tried deferlow and delay 0 after the edge. And nothing seems to make this particular section of the patch work consistently.

Here is the isolated section of the patch showing what I mean.


----------begin_max5_patcher----------
1578.3oc6YszaiaCD9r8uBCc1IP7sTu01C6ksm5ghhEEAxxLJZirngdrIoK1
82dGRJIS4HaK6HGrsnAHBzTjbl4advOR804y7VodVV5s3mV7oEyl804ylY5R
2wrleOyaSzywYQklg4sptpRk6sz9p75Mo4YxJy6PMctMpJ9gz7j6JjwU10lP
X2xVtfPI2JB3LtuOKfERDPeX5s91mK9qcqpptZ+k01U0Kak10zaUTdhW2jRW
azO0pOeivqSSJh1HqjE2IyiVkYlnu9Uea9b8ikiznAEZkr36CZ03lNuWkWkC
RyLgetHMJy6v3AFItkC+EH7QHAJPCDgAZffwMvA9fvQq7.UHcS8FcW2v8gI0
o2scuqSstceTr09ODbVlljqU5Ed2mohp1graTqktNBGjl54Hgxz+1NNbmfg0
znfLPWtDbW9DHkVYTIe1.edwYowO98yNFDa.3.s1sfDdBXFcBXZn3Nh2EXiW
XBk0XH31jmINEBO0oPPLEnSmqYh4LsoQstKcTznxMtWUrIxrD7CY4537CZ8H
+o172TmUkVlktVVb1X.02ACvlefH9mDDJkUf..svtL1hDKbm2ffxvQ1ASMfT
Fq1JOdE0AvBjua7fAENNXzVHp.b0xd.A2YNtt9.ueD1f.1nzItmO539onNOd
fxA3wUneRKyKWmHO6p73l56CvzfhGILNbYxiUvPbQk9OfcWlGss7AU0YmczT
ofDR.xELLFi3hPtgbAmdo62sWPhqQimPiN9AcF5k5twfIG5KBBEgzPrkOEic
E1hWflRGczCWpOFSAGJNDSXAjv.pI9F4KtBVLWLgVrcCoy2nGftLBP.r.ERw
HR.uoyfSUojd5ph6Web4wxAnSYNvZYVzKeeAB4q++bAoFJgnP1sHlOSPDDep
M6O3Zv1EeQoBZisOkWvLrleaGqhheLoPUmut2oNRxUfwpo9618fEJpKkqRT4
wpLUwIJfngqWcRLGlV3Cysfru+C4sS95NUeQV7JcvXXRiowG9DZHm00wH.c0
3ecebBpbv+FvscT8.kOA6VyXK68zcI0hu2fIzPe7xAZfN.UJL4nrFcMSWjRK
Kyx29vc86w+fzgeqR1Gm7g8+Cf5i5VTAvBHn+BkIShheomQh9OP7LgY1omvu
rPX7+GB2KDl+u2HXy37xRy2+B9LQM596GVWppKhaw9lqQawNosVVVklGUkBQ
5NiAaGzfYNiUP7wHI3fYtCRUnOJsdGwqunw3gEM4MIZAdLVs+vh1+5KZxA.b
zaRzzQHY5TDTQFiiEcMPWxXMQzTCtixsNAX6dZ+vBpM05sYQnQXRFIgdOJBI
vWibBwXLRA48pRq3pjUHHW11I1swh1tE1fsrYzFg.7v9rcWufkysePD6OM6n
5UH+RZ63Mzb7hJ.xRU.So5B6kv8L298KL27UQdcZiqDLOPjkUujs+Vm6t+t5
0opeuJppt7teSlWaoI.V08Q0YU8ghUI2mlk0sG8rt2.LGZX63Ye6xlt6SjHj
hPAFtJHh.yMsfFFxNs3YybPsShxZI3P4XA0xgPSlfz6JfalFdmr7QgVI3GF3
SssftP8nd.XYdhkCDVzw.DhEJTaUEs9TXpgciutRkTDsNUZIGahkrtXKbaoX
Au0.6N7msWcd6bbi75bFOZuX8+P6cOli3D7PmDcANb.WehginFcL1tKMWGTK
aQe60y27vkoWTbLnM8hJLADAjPLx3tDMtK2Y8ZFk6d.bkmPC1bhkQh7PbHDF
hCMgVPTL0zRGihlZ+vFYYYThbZ8EiIatKRe3jy.8ENHVNXKzgSN2cZfW250S
6GxT59YGiyKZOW3nitL9LmxefMC57DFYYu7teIqVdC5XZ0.IsDjfSMtadmBF
p6BcETvB0S4msFtSuXc4ljqjF9quDc9JnONjQsk7DDB1l6fQHDY5UvOTHkWf
FZPOh9OcKDOfiESux8mxrL0Sms1EfYHgsxAJ.Ypuw.Dkc36n3SluyGKz2OXp
L.yWK8Cpr0ms5qCE8MteFr0GyXIH2pYShBVXITn0vQW2gS4bRXS3nPXCLAfM
jbjckeuLnpnsGyPb+zz.S7OFUoV7wzjGz2614KeKicyUjpWzxsMWJn4lTm+s
4+CfB4zaz
-----------end_max5_patcher-----------

that’s the bit you changed from my original patch. My version was oversampling but consistent. This version might have the problem of Max lag as I was getting similar issues…

Yeah, I compared it to the version in your patch, but I think the delay~ is in the signal path in your version and avoids the “order of operations” problem as a result.

I couldn’t get that code to freak out at all, but you’re saying you ran into some issues with it?

I get that there would be Max slop since it’s going back to the Max domain, but if anything, the bang from edge~ would come late, and there would be +2/3ms delay on the reported onset, instead of sometimes not reporting at all.

Is there a better way to go from MSP to Max on command (that doesn’t use a snapshot~ 1)?

I ran into issue with similar code to yours (banging a snapshot~) so I kept it in audio.

technically banging like you did (and I did before) is the best. in practice, it is quite fragile I found, so I use snapshot~ 1 → change and it is the best I’ve had. It is in all my descriptor-based processes.

It’s just so expensive…

So is this change~ -> `edge~’ thing an issue of Max slop or is it a bug-y thing?

not really - every millisecond, one number is sent to one comparator then it stops there…

@a.harker explained to me one day why I was getting constant inconsistency but I cannot remember if it had to do with max slop, timings of message processing, bad coding from them, or wrong expectations from me. @weefuzzy might have a clever answer too.