Repository navigation
fix filters: a bus's parameter read, faded or oscillated with a sound handle missed the bus - #623
Merged
Merged
Conversation
… handle missed the bus
Owner
|
Thanks for catching this and for the thorough write-up and test! Merging now! |
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.
What
A bus's filter parameter can be given a
soundHandle, for examplebus.filters.echoFilter.wet(soundHandle: h)wherehis a sound playing onthe bus. The four parameter operations did not agree on which voice that
addresses:
Filters::setFilterParams), so itchanged the bus's filter;
addressed the sound's voice, which has no filter in that slot. SoLoud then
returns its error value as the parameter: get read
1withnoError.Fade and oscillate silently did nothing and also returned
noError.What the native exports return on
main:The fix moves the swap into
Filters::findParam, which all four operations(and the custom-filter exports) go through. On a bus they now act on the
bus's voice, whatever handle comes with it. A bus that has not been played
still reports
soundHandleNotFound.setCustomFilterParamDefinitionpasseshandle 0 for a bus, which already got the bus's voice through set, so its
behaviour does not change.
Changes
src/filters/filters.cpp,filters.h:findParamtakes the handle byreference and replaces it with the bus's voice on a bus. The swap in
setFilterParamsis removed. The comments say so.test/common/filter_params_test.cpp: new scenariovoice. It plays asound on a bus that has an echo, then sets, reads, fades and oscillates
the bus's wet through the sound's handle, and checks the bus's value.
CHANGELOG.md: a Fixes entry under a new5.4.1 (XX Xxx 2026).Testing
macOS (arm64), from the repository root:
11 assertions, 3 failures.value 1"
is 0.5"
11 assertions, 0 failures.With the fix:
./test/common/filter_params_test.sh./test/common/filter_params_test.sh --asan./test/common/bus_destroy_filter_test.sh./test/common/filter_ops_test.sh./test/common/custom_filter_test.sh./test/common/bus_annex_test.sh./test/common/bus_visualization_test.sh./test/common/realtime_and_custom_dsp_test.sh./test/common/bus_samplerate_test.shflutter test test/common/filters_api_test.dart test/common/mixing_bus_test.dartpython3 test/support/gen_cmake.pytest/CMakeLists.txtunchangedNot run: Linux, Windows, Android and iOS. Web: built only, not run.
web/compile_wasm.shbuilds this branch (both the single- and themulti-threaded library). The rebuilt WASM libraries are left out of this PR,
so it carries no binary changes: they can go in your next
update wasm libscommit. On web, every filter parameter operation with a
soundHandlealready throws in Dart before it reaches native code, so web users were not
affected.
Follow-ups
filterParamTargetinbindings.cppstill picks the handle before itcalls
Filters. On a bus that choice no longer matters. It could besimplified in a later cleanup.
🤖 Generated with Claude Code