I’m back working with the flucoma package and was working with the ampslice~ and ampfeature~ objects. I noticed that when I higher the @floor above -60 there is gradually more loss of volume, which results in having to adjust the thresholds again as well. I guess it makes sense since less sound will be passed through the gate to the envelope followers, but I would like to not having to go back and forth to much between floor <=> threshold to find the best setting.
I was wondering if there is a “straightforward” formula/calculation that can be used to compensate for the gain loss so I can for example use ampfeature~ and multiply the output to compensate and use an external [thresh~]. I’m not sure if there is a clear correlation between the floor and the gain loss or if it is heavily dependent on the input signal also.
So far I’ve just emperically looked at some compensation gain values that made sense with a floor of -50, -40, -30, -20 giving me some function like: [expr 0.138 * pow(($f1+60)/10, 2.2) + 1.] (or many other varieties that kind of fit the curve). Using this so far works quite well so maybe i’ve already answered my post with this, haha.
In any case curious to hear your thoughts or if anyone else tackeled this in some other way :), below a little patcher to illustrate.
I could be missing something, but I’m not entirely sure what volume has to do with anything here. The @floor parameter just sets the threshold under which no onset will be detected at all. It doesn’t Similarly for fluid.ampfeature~ it just ignores any changes in amplitude below a certain level.
This could help visualize exactly what’s happening:
p.s. the gen~ code in this example is basically like thresh~ but with a temporal lockout. The left outlet gives you a trigger output and the right outlet gives you a gate output.
What I mean is that (taking your example), if I would set the thresholds for detecting some of the onsets with the @floor -60, but then decide to adjust the floor to get rid of some bleed on the signal and raise it to say -30, the signal has dropped in amplitude. Meaning the thresholds that worked for me before now don’t work and require me to adjust them to a lower range. So I was wondering if there is some way to adjust the floor and not have to adjust the thresholds (so compensate for the loss of amplitude there).
Hopefully the images below illustrate what I mean.
In this case, floor is not what you want to mess with at all, but rather just manipulate the thresholding directly.
floor is meant to be the point at which you want to absolutely ignore everything, not for (dynamically) adjusting the onset detection. I tend to set this such that “silence” in my context/environment is flat, so often something like @floor 60 or @floor 54 like in that example I pasted.
The reason you are seeing the yellow line drop is that the line is the differential rather than the signal itself, so that is impacted by clamping the bottom of the signal overall.
Thanks for sharing the article, I had found that also via the help-files.
That makes sense and also confirms my thought on how it works. Thanks for some clarification on the matter.
In my experience though the floor does help a lot to reduce bleed (for example when using a trigger on the snare and trying to get rid of the kick/toms). I get different results if I leave the floor at -60 and try to remove bleed with the threshold, or when I first higher the floor significantly (like -40) and then choose the thresholds accordingly. In the first case it is more difficult to distinguish between ghostnotes and hard kick hits, while in the other case this seems to be a bit more easy, albeit that I have to lower the threshold significantly due to the drop of the signal.
I’ll try some other approaches in the future too, so far thanks for the help! Much appreciated.
Just to round off I like to share how I’ve “solved” it for now by implementing this gain compensating scaling function that adjusts the signal output gain from ampfeature before going in the threshold detection. This seems to work quite well for my goals so far.
Right, if that’s what you’re trying to do, you can do that a different/better way by “locking out” each onset detector separately.
By the nature of proximity, the audio will arrive to the closest mic first, so what you can do is that when an onset is detected at the close mic, you block all other onset detection outputs for a tiny window (5-10ms?). If you want to get precise with it you can calculate the physical distance and just have the “lockout” time be as short as is physically possible given the distances, but that’s probably overkill.
This is more-or-less what MIDI drum brains to do avoid cross talk.
This is what I would do for 2 channels, but you can extrapolate it out to as many channels as you need:
In my experience this is 1000% better, more accurate, faster, than trying to adjust all the thresholds/floors to get the drums not triggering each other.
This is an interesting approach that I had not thought about! I will give it a shot to see how that works out. Sadly in the current situation i’m not using a trigger on the tom so for that one I still have to rely on the floor/threshold combination, but with the kick this could be a good alternative indeed.
Are you using triggers (contact mic ones?) or close air mics?
There’s a lot of optimizations you can do with the highpassfreq (much much higher than you think) and the fast/slow envelope parameters. The settings I pasted there are pretty solid overall.
The tom can be tricky with the kick if it’s physically coupled, but the snare I don’t often have many issues with bleed with a snare.
I also find a bit of a 2k bandpass to be useful pre-amp feature.
I use that in SP-Tools as @input modes for all the onset detection/descriptor analysis objects. (@input 2 is optimized for contact mic-based triggers, or @input 4 if you’re using a trigger for onset detection but want to do descriptor analysis with a parallel air mic.
I’m currently using those red ddrum triggers, but also plan to explore other possibilities like using piezos or regular microphones like SM57.
Yeah i’ve been experimenting with the different settings and indeed setting the highpass like already up in the 1500+Hz range helps a lot to get a clearer reading on the transients of the signal. For snare I liked +/- 500 range because I noticed when I play with mallets and without the snare-mat I didn’t get quite enough information to go on.
Thanks for the tip, i’ll give that a shot too.
The SP-Tools are amazing, great project and inspiration! Thanks for all your efforts on that too. (: