Maybe. I’m reticent about adding too much more stuff to repos without much sense of how shared maintenance is going to pan out in the future, especially given the current focus on trying to ensure that we have as much parity between hosts as possible.
That said, feel free to shine them up and put in a PR.
Something useful on the learn platform – if we can be bothered to collate and flag that its not maintained code but community code – would be to have a “snippets” area where people can peruse community sourced stuff. Keeps it out of the repos but makes it more exposed.
Unless I’m gonna get into the core guts of the stuff, it doesn’t make too much sense to try to edit help files or add snippets if it’s not in the correct style, or going to be implemented at all, etc…
I only half-remember that there is information on here, and can sometimes find the threads/patches, but I’ve been quite close to the project in that regard. Someone coming across it for the first time isn’t going to have that “luxury”.
I imagine this isn’t the code directly out of the native fluid.ampgate~ as it seems like adjusting the lockout time can break the logic of the ifelse loop.
Maybe something to do with the fact that this is taking in a differential vs having an absolute threshold as the input in fluid.ampgate~ so maybe there’s a signal that can jump out of the logic somewhere?
Ok, I don’t see how this is the case from looking at the code, but I think if the minslicetime is adjusted whilestate = 1, then it breaks the logic.
I tested this by setting the values to extremes when playback is paused (or specifically timing it between hits).
The native fluid.ampgate~ version never seems to break in the same way (from my tests) so I guess there’s code above what you posted that takes care of that?
Lol, found it. It’s because you’re passing a float into as minslicelength and the code assumes it’s an integer. When it’s a float, debounce will go below zero in the decrement loop, and the condition to change state (debounce == 0) will never be true.
So you could either change that condition to debounce <= 0, or make sure that debounce is an integer by debounce = int(minslicelength);
I love that you thought I was holding out on you though
In my second (of likely more than a few of) reasking the same or similar questions about pd implementations, is it possible to do this kind of per-sample logic/debouncing in pd without gen~?
I can make sense of doing some of this logic with vanilla objects but setting/incrementing conditional counters is not something I’ve done with msp~-esque objects.
yes. I am (unsuccessfully) offline but I can help next week. for now, check the uber-powerful expr~ - I cannot remember which of my many helpfiles have something doing exactly that or even if that survived the latest edit, but hey, you can do a counter in expr~ and a comparison.
The JIT-NMF example has the circular buffer recording with (very confusingly syntax’d!) fexpr~, so a sample counter makes sense, it just breaks down in how to fire/start/stop logic at audio rate (in pd). I’ll have a further poke today.
Also, turns out that threshold~ would be perfect on its own, as it has built-in time hysteresis, but it outputs message rate, which makes it useless for this purpose.