What's better than one onset detector? Two onset detectors!

So I’ve talked about chaining onset detectors before but that was more about using them to analyze different things (novelty → amplitude), which is something I still want to revisit for buf-based slicing, but I was thinking about having parallel onset detectors for real-time stuff.

Since @tremblap shared his magical™ settings in the thread about fluid.ampslice~ I’ve been using that for fantastic results. It’s super fast/tight and because the Sensory Percussion pickup has such a sharp attack, the retriggering can be really short, letting me play buzz rolls etc…

So this works perfectly as it is … when I hit the surface of the drum. Granted, that’s most of the time, but occasionally I may have a bell in my hand, or be holding things above the drum, so in those cases the tight thresholds/settings on the SP pickup don’t really work well, or consistently.

That leads me to think about having parallel onset detection where the SP pickup is the first line of defence and then locks out anything else from happening, assuming (perhaps incorrectly?) that if I hit the head of the drum, that pickup would always pickup the signal and onset first, so it could lockout a DPA that’s a couple inches further away.

So my overall thinking is then having the DPA go through a second onset detector with settings tuned to be as tight as I can manage for an air-based mic (basically my “old settings”). I can then rely on the SP pickup for when I play on the head, and the DPA for when I play off the head.

I’m a bit unsure as to how to approach this architecturally in terms of which can lock out which, and what durations. For example, the @minslicelength for my SP pickup is really tight at 1024, which conceivably stop blocking the DPA from picking up the resonance of the initial sound. So I don’t think I can just use the lockout from the contact pickup to lock out the air mic, and similar problems happen in the other direction.

The other issue is potentially how to lock things out since each lockout is cross pollinating. I can do some kind of signal-based lockout, or just a sah or something, but not 100% sure on that.

Either way, wanted to post this on here to see if anyone has explored multiple parallel onset detectors on the same source? (e.g. contact mic + air mic) And if so, how’d you go about doing it?

as you want a greedy sum of them (aka the first hit is always valid but you want to avoid double triggers) i would time-gate (aka timed ignore) the airmic one. it can be done as simply as a timed gate if you are in control rate but I suspect you are in audio rate so I would use the gen~ version you have from my previous prototyping ones, but with 2 inputs: the decision one is the SP and the gated one is the air mic.

Now you have 3: the SP and the airmic each have their settings, and a third one, always open except upon attacks of the SP. The time window of that 3rd one needs to match the SP one.

that should work.

1 Like

Forgot to say: you might remember I did that in my piece for piano Baschet and electronics. The advantage of what I proposed is that the contact mic is always before the airmic, because sound is slow (1ms-ish per foot) so that the contact as master and the air as secondary has been good for me on that too.

1 Like

I followed you up to here. Are you saying there are 3 onset detectors, or three lockouts?

These are dummy abstractions, but something like this?

Yup, that’s the idea. And on days when I’m only using the airmic, the SP one will never fire and I can just use the same patch without having to declare whether I’m using the SP one or not.

not really. I would have the built-in locking for each sides, and add a gate on right one only, triggered by the left one.

I’m mainly confused by this:

there are one in each slicer (baked in) and then you add this one that is gating A conditional to the state of B.

1 Like

Ooooooh.

Yeah I gotcha now. Two fluid.ampslice~ + one gen~ @duration thing, so three “lockout engines”.

1 Like

yes, with the mod being a sidechain - the trigger to start the gating is not the one that is gated (although, if I guess, you can just merge both triggers at the input of that gen~ thing and it would work too!)

1 Like

Ok, finally got some headspace to put this together. Here’s the patch for posterity and curiosity of others.

Archive.zip (990.7 KB)


----------begin_max5_patcher----------
3612.3oc2bz1abaa9yN+JDzGJRFb7HoHojVWFR65VJvR5BVxPwP5fgtSzmUi
NIUIc1wMn929dHoD0KmNc5r0YmNCjyx7Ewm2ekW97SNwdQ5mDE1V+IqOXcxI
e9ImbhZH4.mT82mXuN3SKiCJTKyNYy5Ehb6S0SktoLVTVdSlP+NrsO0xdQPx
Jaq+a0RxBJWdYTxpyyEKK0qBi7NCcpEAQk+hgT+A4LjYOQgpyJcwO+bGts4E
kGrVTJxOWjDrHVchnp4.nJJAfDELhaFTCepQIxA+sm7D4GmNUjUbM.C0.Po3
SJDvNTDGbys.ZfP6jPTDsJIHdTx.yQg3Lt7WtzQoBt1CgojAwT7c.SiitRbV
wxzLws6Dk1KeUiPbWl7WXOEFw81AFwNxXzbHnR4rIKnRn+eqfJEilrjJgbj4
qqEEEAqDagq.HR1M2dTwVDQhQNHr5WjQQO7QF8tHNEdI2SwVG2VHz3hsX+6r
X6Eo4qCTGI+XKH+G.g3YPB1gpjco7QoHGaas6.GWIRt05kgaxCJiRSrvtb58
26BG6cFmg3HJg5gnbOWFXZlLpJL0d5FqvsA.vbqFqqPaPDIJVbkHu.PnVq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_max5_patcher-----------

Having the single secondary lockout simplifies stuff a bit, and it seems to work work. I don’t have audio at hand that covers the exact use case (some hits on the head and some hits in the air), but this nugget of test audio has some hits that fire on one and not the other.

1 Like

Actually here’s an example with more real-world audio, playing things on/off the snare, some clapping, and even me shouting.

Surprisingly the SP pickup picks up all sharp transients in the vicinity of the snare, including me clapping (unless I get really quiet or move far away). I think it’s the hair trigger sensitivity, but the DPA definitely picks up all the rest (further clapping, shouting etc…).

Archive.zip (4.3 MB)

1 Like

I’m not :slight_smile: Ths snare skin acts like a big mic membrane and the settings are soooooo sensitive. Hence going from making it the ‘master’ in my first idea to actually just merging them both in the gen~ time hysteresis gate.

Ciao Rodrigo, how are you?

I am working on a slightly different version of what you’re doing, and I was a bit stuck until I found this.
Can I ask you what is going on with the gen patch (unfortunately I still don’t speak gen~), and what is 1764 as a parameter?

Slightly OT: I always work at 48kHz, and I usually was “translating” parameters such as minslicelenght etc. In your patch I notice you dont write “rounded” values but you go also for instance like 4402 (instad of 4400). Is this not messing with the actual algorithm? Are the algorithms just working on a sample level, and it will just result in something slightly misalligned?

Thanks a lot, sorry to bother

1 Like

The gen~ patch there is something @tremblap wrote a bit ago. It doesn’t do anything special really, it just acts as a lockout so only one ‘click’ can go through before it resets. The 1764 there represents samples, so that’s how many samples can pass before another click can go through. You may want to scale that up a bit if you’re at 48k, but it’s close enough to not really. matter.

The odd numbers in the algorithm were also tweaked by @tremblap and I think are just “fine tuned” to be those values.

2 Likes

and this is the beauty of it all - I tuned them to @rodrigo.constanzo use case. Any signal that differs from very nervous drumhits might not like those values, so feel free to experiment with them

1 Like