Repository navigation
feat: FFT smoothing attack also - #637
Merged
Merged
Conversation
setFftSmoothing(smooth, attack: ...) smooths a bin that rises with a factor of its own. smooth is the factor for a bin that falls. The attack is 0 when left out, so the default of 0.8 and a call without attack now smooth the falls only. Before, one factor smoothed rises and falls alike: pass attack equal to smooth for that.
Seven blocks were under SOLOUD_SIMD_ENABLED, which nothing defines: four in the analyzer, one each in the amplitude modulator, pitch shift and parametric EQ filters. They could not compile (f32x4 has no operators), and two passed fma its arguments in the wrong order. The plain loops below them did the work and still do: with -O3 the compiler vectorizes them by itself.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
setFftSmoothinggains an optionalattack, the smoothing factor for a bin that rises. The first argument,smooth, is now the factor for a bin that falls (the decay).Behaviour change
Until now one factor smoothed rises and falls alike, as the Web Audio
AnalyserNodedoes.attackis0when left out, so the default (0.8) and every existingsetFftSmoothing(x)call now smooth the falls only: a bin jumps to a louder value at once and then sinks back. Passattackequal tosmoothfor the previous look.No call site breaks, as
attackis a named optional parameter. Every call sets both factors, so a call withoutattacksets the attack back to0.Type of Change