On 07/05/2014 01:44 PM, Vesa wrote: > Ok so, there's been some talk about the auto-shutoff feature of LMMS > effect plugins. Some consider it a nuisance, others see it as a valuable > part of LMMS functionality. There's also been talk of a way to disable > auto-shutoff completely in settings, and that's also something that > could be done, but I'm not going to talk about that now. > > Currently, the auto-shutoff works by measuring the RMS of each period, > then determining whether the RMS value is below the treshold set by the > "gate" knob in the front panel, and the effect gets shut off when the > amount of time set by the "decay" knob passes while every period is <= > treshold. > > The problem is: RMS is a costly thing to be doing all the time. > Especially since it's only used for a trivial function like this, which > only needs to determine "is there output over this level". RMS requires > a square root calculation per each sample, so that's 2*period_size > square root calculations per period, per effect. Wasting more CPU while > the effect runs just to save CPU by turning the effect off doesn't seem > like the best possible solution... > > So: what if, instead of doing a RMS calculation, we just simply take the > maximum of the absolute values of the samples, and use that to determine > if the effect produces output? It would cost less CPU since it'd require > simpler operations. Since we can control the gate level anyway, I think > there's no need for the RMS calculation as such... the feature could > probably work just as well with max abs value. > > Opinions? > > I could whip up a test branch so that someone (Raine?) could benchmark > this to see how much savings we could get by it... > >
Ugh, I meant to say square, not square root... still probably more costly than doing an abs + comparison. ------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________ LMMS-devel mailing list LMMS-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lmms-devel